diff --git a/README.md b/README.md index bcb8772..b20ee26 100644 --- a/README.md +++ b/README.md @@ -33,5 +33,20 @@ * 量子纠缠效果(隐藏款) +
+ +## 本地启动 +``` +yarn +npm run dev +``` +
+ +## 最新运行环境 +node:v20.12.2 +npm:v10.5.0 +yarn:v1.22.22 +node-gyp:v10.1.0 +
## 持续更新,敬请关注 diff --git a/docs/117.js b/docs/117.js deleted file mode 100644 index 11ed2cd..0000000 --- a/docs/117.js +++ /dev/null @@ -1,1168 +0,0 @@ -(self.webpackChunkvisualization_collection=self.webpackChunkvisualization_collection||[]).push([[117],{92138:function(t,e,n){"use strict";n.d(e,{R_:function(){return f},ez:function(){return d}});var r=n(86500),i=n(1350),o=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function a(t){var e=t.r,n=t.g,i=t.b,o=(0,r.py)(e,n,i);return{h:360*o.h,s:o.s,v:o.v}}function s(t){var e=t.r,n=t.g,i=t.b;return"#".concat((0,r.vq)(e,n,i,!1))}function u(t,e,n){var r=n/100;return{r:(e.r-t.r)*r+t.r,g:(e.g-t.g)*r+t.g,b:(e.b-t.b)*r+t.b}}function c(t,e,n){var r;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function l(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(r=1),n&&5===e&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function h(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function f(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=(0,i.uA)(t),f=5;f>0;f-=1){var d=a(r),p=s((0,i.uA)({h:c(d,f,!0),s:l(d,f,!0),v:h(d,f,!0)}));n.push(p)}n.push(s(r));for(var g=1;g<=4;g+=1){var m=a(r),v=s((0,i.uA)({h:c(m,g),s:l(m,g),v:h(m,g)}));n.push(v)}return"dark"===e.theme?o.map((function(t){var r=t.index,o=t.opacity;return s(u((0,i.uA)(e.backgroundColor||"#141414"),(0,i.uA)(n[r]),100*o))})):n}var d={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},p={},g={};Object.keys(d).forEach((function(t){p[t]=f(d[t]),p[t].primary=p[t][5],g[t]=f(d[t],{theme:"dark",backgroundColor:"#141414"}),g[t].primary=g[t][5]}));p.red,p.volcano,p.gold,p.orange,p.yellow,p.lime,p.green,p.cyan,p.blue,p.geekblue,p.purple,p.magenta,p.grey},51331:function(t,e,n){"use strict";n.d(e,{E4:function(){return It},jG:function(){return Ft},fp:function(){return Ot},xy:function(){return Tt}});var r=n(4942),i=n(1413),o=n(29439),a=n(93433),s=n(71002),u=n(67294),c=n(44958),l=n(98924);var h=function(t){for(var e,n=0,r=0,i=t.length;i>=4;++r,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},f={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},d="comm",p="rule",g="decl",m=Math.abs,v=String.fromCharCode;Object.assign;function y(t){return t.trim()}function b(t,e,n){return t.replace(e,n)}function x(t,e){return t.indexOf(e)}function w(t,e){return 0|t.charCodeAt(e)}function _(t,e,n){return t.slice(e,n)}function S(t){return t.length}function E(t){return t.length}function M(t,e){return e.push(t),t}function T(t,e){for(var n="",r=E(t),i=0;i0?w(I,--O):0,k--,10===P&&(k=1,C--),P}function R(){return P=O2||j(P)>3?"":" "}function Z(t,e){for(;--e&&R()&&!(P<48||P>102||P>57&&P<65||P>70&&P<97););return B(t,F()+(e<6&&32==z()&&32==R()))}function W(t){for(;R();)switch(P){case t:return O;case 34:case 39:34!==t&&39!==t&&W(P);break;case 40:41===t&&W(t);break;case 92:R()}return O}function Y(t,e){for(;R()&&t+P!==57&&(t+P!==84||47!==z()););return"/*"+B(e,O-1)+"*"+v(47===t?t:R())}function q(t){for(;!j(z());)R();return B(t,O)}function X(t){return V(K("",null,null,null,[""],t=U(t),0,[0],t))}function K(t,e,n,r,i,o,a,s,u){for(var c=0,l=0,h=a,f=0,d=0,p=0,g=1,m=1,y=1,_=0,E="",T=i,A=o,C=r,k=E;m;)switch(p=_,_=R()){case 40:if(108!=p&&58==w(k,h-1)){-1!=x(k+=b(H(_),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:k+=H(_);break;case 9:case 10:case 13:case 32:k+=G(p);break;case 92:k+=Z(F()-1,7);continue;case 47:switch(z()){case 42:case 47:M(Q(Y(R(),F()),e,n),u);break;default:k+="/"}break;case 123*g:s[c++]=S(k)*y;case 125*g:case 59:case 0:switch(_){case 0:case 125:m=0;case 59+l:d>0&&S(k)-h&&M(d>32?J(k+";",r,n,h-1):J(b(k," ","")+";",r,n,h-2),u);break;case 59:k+=";";default:if(M(C=$(k,e,n,c,l,i,s,E,T=[],A=[],h),o),123===_)if(0===l)K(k,e,C,C,T,o,h,s,A);else switch(99===f&&110===w(k,3)?100:f){case 100:case 109:case 115:K(t,C,C,r&&M($(t,C,C,0,0,i,s,E,i,T=[],h),A),i,A,h,s,r?T:A);break;default:K(k,C,C,C,[""],A,0,s,A)}}c=l=d=0,g=y=1,E=k="",h=a;break;case 58:h=1+S(k),d=p;default:if(g<1)if(123==_)--g;else if(125==_&&0==g++&&125==D())continue;switch(k+=v(_),_*g){case 38:y=l>0?1:(k+="\f",-1);break;case 44:s[c++]=(S(k)-1)*y,y=1;break;case 64:45===z()&&(k+=H(R())),f=z(),l=h=S(E=k+=q(F())),_++;break;case 45:45===p&&2==S(k)&&(g=0)}}return o}function $(t,e,n,r,i,o,a,s,u,c,l){for(var h=i-1,f=0===i?o:[""],d=E(f),g=0,v=0,x=0;g0?f[w]+" "+S:b(S,/&\f/g,f[w])))&&(u[x++]=M);return L(t,e,n,0===i?p:s,u,c,l)}function Q(t,e,n){return L(t,e,n,d,v(P),_(t,2,-2),0)}function J(t,e,n,r){return L(t,e,n,g,_(t,0,r),_(t,r+1,-1),r)}var tt=n(15671),et=n(43144),nt=function(){function t(){(0,tt.Z)(this,t),this.cache=new Map}return(0,et.Z)(t,[{key:"get",value:function(t){return this.cache.get(t.join("%"))||null}},{key:"update",value:function(t,e){var n=t.join("%"),r=e(this.cache.get(n));null===r?this.cache.delete(n):this.cache.set(n,r)}}]),t}(),rt="data-token-hash",it="data-css-hash",ot="__cssinjs_instance__",at=Math.random().toString(12).slice(2);function st(){if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(it,"]"))||[],e=document.head.firstChild;Array.from(t).forEach((function(t){t[ot]=t[ot]||at,document.head.insertBefore(t,e)}));var n={};Array.from(document.querySelectorAll("style[".concat(it,"]"))).forEach((function(t){var e,r=t.getAttribute(it);n[r]?t[ot]===at&&(null===(e=t.parentNode)||void 0===e||e.removeChild(t)):n[r]=!0}))}return new nt}var ut=u.createContext({hashPriority:"low",cache:st(),defaultCache:!0}),ct=ut;var lt=function(){return!1};function ht(t,e,n,r){var i=u.useContext(ct).cache,s=[t].concat((0,a.Z)(e));lt();return u.useMemo((function(){i.update(s,(function(t){var e=t||[],r=(0,o.Z)(e,2),i=r[0];return[(void 0===i?0:i)+1,r[1]||n()]}))}),[s.join("_")]),u.useEffect((function(){return function(){i.update(s,(function(t){var e=t||[],n=(0,o.Z)(e,2),i=n[0],a=void 0===i?0:i,s=n[1];return 0===a-1?(null==r||r(s,!1),null):[a-1,s]}))}}),s),i.get(s)[1]}var ft=n(80334);function dt(t){var e="";return Object.keys(t).forEach((function(n){var r=t[n];e+=n,r&&"object"===(0,s.Z)(r)?e+=dt(r):e+=r})),e}function pt(t,e){return h("".concat(e,"_").concat(dt(t)))}var gt="layer-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,""),mt="903px";var vt=void 0;function yt(){return void 0===vt&&(vt=function(t,e){if((0,l.Z)()){var n;(0,c.hq)(t,gt);var r=document.createElement("div");r.style.position="fixed",r.style.left="0",r.style.top="0",null==e||e(r),document.body.appendChild(r);var i=getComputedStyle(r).width===mt;return null===(n=r.parentNode)||void 0===n||n.removeChild(r),(0,c.jL)(gt),i}return!1}("@layer ".concat(gt," { .").concat(gt," { width: ").concat(mt,"!important; } }"),(function(t){t.className=gt}))),vt}var bt=(0,l.Z)();function xt(t){return T(X(t),A).replace(/\{%%%\:[^;];}/g,";")}function wt(t){return"object"===(0,s.Z)(t)&&t&&"_skip_check_"in t}function _t(t,e,n){if(!e)return t;var r=".".concat(e),i="low"===n?":where(".concat(r,")"):r;return t.split(",").map((function(t){var e,n=t.trim().split(/\s+/),r=n[0]||"",o=(null===(e=r.match(/^\w+/))||void 0===e?void 0:e[0])||"";return[r="".concat(o).concat(i).concat(r.slice(o.length))].concat((0,a.Z)(n.slice(1))).join(" ")})).join(",")}var St=new Set,Et=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{root:!0},a=r.root,u=r.injectHash,c=n.hashId,l=n.layer,h=n.path,d=n.hashPriority,p="",g={};function m(e){var r=e.getName(c);if(!g[r]){var i=t(e.style,n,{root:!1}),a=(0,o.Z)(i,1)[0];g[r]="@keyframes ".concat(e.getName(c)).concat(a)}}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.forEach((function(t){Array.isArray(t)?v(t,e):t&&e.push(t)})),e}var y=v(Array.isArray(e)?e:[e]);if(y.forEach((function(e){var r="string"!=typeof e||a?e:{};"string"==typeof r?p+="".concat(r,"\n"):r._keyframe?m(r):Object.keys(r).forEach((function(e){var l=r[e];if("object"!==(0,s.Z)(l)||!l||"animationName"===e&&l._keyframe||wt(l)){var v,y=null!==(v=null==l?void 0:l.value)&&void 0!==v?v:l;0;var b=e.replace(/[A-Z]/g,(function(t){return"-".concat(t.toLowerCase())})),x=y;f[e]||"number"!=typeof x||0===x||(x="".concat(x,"px")),"animationName"===e&&(null==l?void 0:l._keyframe)&&(m(l),x=l.getName(c)),p+="".concat(b,":").concat(x,";")}else{var w=!1,_=e.trim(),S=!1;(a||u)&&c?_.startsWith("@")?w=!0:_=_t(e,c,d):!a||c||"&"!==_&&""!==_||(_="",S=!0);var E=t(l,(0,i.Z)((0,i.Z)({},n),{},{path:"".concat(h," -> ").concat(_)}),{root:S,injectHash:w}),M=(0,o.Z)(E,2),T=M[0],A=M[1];g=(0,i.Z)((0,i.Z)({},g),A),p+="".concat(_).concat(T)}}))})),a){if(l&&yt()){var b=l.split(","),x=b[b.length-1].trim();p="@layer ".concat(x," {").concat(p,"}"),b.length>1&&(p="@layer ".concat(l,"{%%%:%}").concat(p))}}else p="{".concat(p,"}");return[p,g]};function Mt(){return null}function Tt(t,e){var n=t.token,s=t.path,l=t.hashId,f=t.layer,d=u.useContext(ct),p=d.autoClear,g=(d.mock,d.defaultCache),m=d.hashPriority,v=d.container,y=n._tokenKey,b=[y].concat((0,a.Z)(s)),x=bt;var w=ht("style",b,(function(){var t=e(),n=Et(t,{hashId:l,hashPriority:m,layer:f,path:s.join("-")}),r=(0,o.Z)(n,2),i=r[0],a=r[1],u=xt(i),d=function(t,e){return h("".concat(t.join("%")).concat(e))}(b,u);if({},x){var p=(0,c.hq)(u,d,{mark:it,prepend:"queue",attachTo:v});p[ot]=at,p.setAttribute(rt,y),Object.keys(a).forEach((function(t){St.has(t)||(St.add(t),(0,c.hq)(xt(a[t]),"_effect-".concat(t),{mark:it,prepend:"queue",attachTo:v}))}))}return[u,y,d]}),(function(t,e){var n=(0,o.Z)(t,3)[2];(e||p)&&bt&&(0,c.jL)(n,{mark:it})})),_=(0,o.Z)(w,3),S=_[0],E=_[1],M=_[2];return function(t){var e,n;x||!g?e=u.createElement(Mt,null):e=u.createElement("style",(0,i.Z)((0,i.Z)({},(n={},(0,r.Z)(n,rt,E),(0,r.Z)(n,it,M),n)),{},{dangerouslySetInnerHTML:{__html:S}}));return u.createElement(u.Fragment,null,e,t)}}var At={},Ct=new Map;function kt(t){Ct.set(t,(Ct.get(t)||0)+1)}function Nt(t){Ct.set(t,(Ct.get(t)||0)-1);var e=Array.from(Ct.keys()),n=e.filter((function(t){return(Ct.get(t)||0)<=0}));n.length2&&void 0!==arguments[2]?arguments[2]:{},r=n.salt,o=void 0===r?"":r,s=n.override,c=void 0===s?At:s,l=n.formatToken,f=u.useMemo((function(){return Object.assign.apply(Object,[{}].concat((0,a.Z)(e)))}),[e]),d=u.useMemo((function(){return dt(f)}),[f]),p=u.useMemo((function(){return dt(c)}),[c]),g=ht("token",[o,t.id,d,p],(function(){var e=t.getDerivativeToken(f),n=(0,i.Z)((0,i.Z)({},e),c);l&&(n=l(n));var r=pt(n,o);n._tokenKey=r,kt(r);var a="".concat("css","-").concat(h(r));return n._hashId=a,[n,a]}),(function(t){Nt(t[0]._tokenKey)}));return g}var Pt=function(){function t(e,n){(0,tt.Z)(this,t),this.name=void 0,this.style=void 0,this._keyframe=!0,this.name=e,this.style=n}return(0,et.Z)(t,[{key:"getName",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),t}(),It=Pt;var Lt=function(){function t(){(0,tt.Z)(this,t),this.cache=void 0,this.keys=void 0,this.cacheCallTimes=void 0,this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return(0,et.Z)(t,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={map:this.cache};return t.forEach((function(t){var e,n;i?i=null===(e=i)||void 0===e||null===(n=e.map)||void 0===n?void 0:n.get(t):i=void 0})),(null===(e=i)||void 0===e?void 0:e.value)&&r&&(i.value[1]=this.cacheCallTimes++),null===(n=i)||void 0===n?void 0:n.value}},{key:"get",value:function(t){var e;return null===(e=this.internalGet(t,!0))||void 0===e?void 0:e[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(e,n){var r=this;if(!this.has(e)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var i=this.keys.reduce((function(t,e){var n=(0,o.Z)(t,2)[1];return r.internalGet(e)[1]0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Dt+=1}return(0,et.Z)(t,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce((function(e,n){return n(t,e)}),void 0)}}]),t}(),zt=new Lt;function Ft(t){var e=Array.isArray(t)?t:[t];return zt.has(e)||zt.set(e,new Rt(e)),zt.get(e)}},30076:function(t,e,n){"use strict";n.d(e,{Z:function(){return C}});var r=n(1413),i=n(29439),o=n(4942),a=n(44925),s=n(67294),u=n(94184),c=n.n(u),l=n(63017),h=n(71002),f=n(92138),d=n(80334),p=n(44958);function g(t){return"object"===(0,h.Z)(t)&&"string"==typeof t.name&&"string"==typeof t.theme&&("object"===(0,h.Z)(t.icon)||"function"==typeof t.icon)}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).reduce((function(e,n){var r=t[n];if("class"===n)e.className=r,delete e.class;else e[n]=r;return e}),{})}function v(t,e,n){return n?s.createElement(t.tag,(0,r.Z)((0,r.Z)({key:e},m(t.attrs)),n),(t.children||[]).map((function(n,r){return v(n,"".concat(e,"-").concat(t.tag,"-").concat(r))}))):s.createElement(t.tag,(0,r.Z)({key:e},m(t.attrs)),(t.children||[]).map((function(n,r){return v(n,"".concat(e,"-").concat(t.tag,"-").concat(r))})))}function y(t){return(0,f.R_)(t)[0]}function b(t){return t?Array.isArray(t)?t:[t]:[]}var x="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",w=["icon","className","onClick","style","primaryColor","secondaryColor"],_={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var S=function(t){var e,n,i=t.icon,o=t.className,u=t.onClick,c=t.style,h=t.primaryColor,f=t.secondaryColor,m=(0,a.Z)(t,w),b=_;if(h&&(b={primaryColor:h,secondaryColor:f||y(h)}),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,e=(0,s.useContext)(l.Z).csp;(0,s.useEffect)((function(){(0,p.hq)(t,"@ant-design-icons",{prepend:!0,csp:e})}),[])}(),e=g(i),n="icon should be icon definiton, but got ".concat(i),(0,d.ZP)(e,"[@ant-design/icons] ".concat(n)),!g(i))return null;var S=i;return S&&"function"==typeof S.icon&&(S=(0,r.Z)((0,r.Z)({},S),{},{icon:S.icon(b.primaryColor,b.secondaryColor)})),v(S.icon,"svg-".concat(S.name),(0,r.Z)({className:o,onClick:u,style:c,"data-icon":S.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},m))};S.displayName="IconReact",S.getTwoToneColors=function(){return(0,r.Z)({},_)},S.setTwoToneColors=function(t){var e=t.primaryColor,n=t.secondaryColor;_.primaryColor=e,_.secondaryColor=n||y(e),_.calculated=!!n};var E=S;function M(t){var e=b(t),n=(0,i.Z)(e,2),r=n[0],o=n[1];return E.setTwoToneColors({primaryColor:r,secondaryColor:o})}var T=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];M("#1890ff");var A=s.forwardRef((function(t,e){var n,u=t.className,h=t.icon,f=t.spin,d=t.rotate,p=t.tabIndex,g=t.onClick,m=t.twoToneColor,v=(0,a.Z)(t,T),y=s.useContext(l.Z),x=y.prefixCls,w=void 0===x?"anticon":x,_=y.rootClassName,S=c()(_,w,(n={},(0,o.Z)(n,"".concat(w,"-").concat(h.name),!!h.name),(0,o.Z)(n,"".concat(w,"-spin"),!!f||"loading"===h.name),n),u),M=p;void 0===M&&g&&(M=-1);var A=d?{msTransform:"rotate(".concat(d,"deg)"),transform:"rotate(".concat(d,"deg)")}:void 0,C=b(m),k=(0,i.Z)(C,2),N=k[0],O=k[1];return s.createElement("span",(0,r.Z)((0,r.Z)({role:"img","aria-label":h.name},v),{},{ref:e,tabIndex:M,onClick:g,className:S}),s.createElement(E,{icon:h,primaryColor:N,secondaryColor:O,style:A}))}));A.displayName="AntdIcon",A.getTwoToneColor=function(){var t=E.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},A.setTwoToneColor=M;var C=A},63017:function(t,e,n){"use strict";var r=(0,n(67294).createContext)({});e.Z=r},26589:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v584zM639.5 414h-45c-3 0-5.8 1.7-7.1 4.4L514 563.8h-2.8l-73.4-145.4a8 8 0 00-7.1-4.4h-46c-1.3 0-2.7.3-3.8 1-3.9 2.1-5.3 7-3.2 10.9l89.3 164h-48.6c-4.4 0-8 3.6-8 8v21.3c0 4.4 3.6 8 8 8h65.1v33.7h-65.1c-4.4 0-8 3.6-8 8v21.3c0 4.4 3.6 8 8 8h65.1V752c0 4.4 3.6 8 8 8h41.3c4.4 0 8-3.6 8-8v-53.8h65.4c4.4 0 8-3.6 8-8v-21.3c0-4.4-3.6-8-8-8h-65.4v-33.7h65.4c4.4 0 8-3.6 8-8v-21.3c0-4.4-3.6-8-8-8h-49.1l89.3-164.1c.6-1.2 1-2.5 1-3.8.1-4.4-3.4-8-7.9-8z"}}]},name:"account-book",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AccountBookOutlined";var u=i.forwardRef(s)},7364:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}},{tag:"path",attrs:{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"}}]},name:"aim",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AimOutlined";var u=i.forwardRef(s)},14283:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 00-11.3 0l-39.6 39.6a8.03 8.03 0 000 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0zm669.6-79.2l-39.6-39.6a8.03 8.03 0 00-11.3 0l-67.9 67.9a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"}}]},name:"alert",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AlertOutlined";var u=i.forwardRef(s)},36108:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M308.6 545.7c-19.8 2-57.1 10.7-77.4 28.6-61 53-24.5 150 99 150 71.8 0 143.5-45.7 199.8-119-80.2-38.9-148.1-66.8-221.4-59.6zm460.5 67c100.1 33.4 154.7 43 166.7 44.8A445.9 445.9 0 00960 512c0-247.4-200.6-448-448-448S64 264.6 64 512s200.6 448 448 448c155.9 0 293.2-79.7 373.5-200.5-75.6-29.8-213.6-85-286.8-120.1-69.9 85.7-160.1 137.8-253.7 137.8-158.4 0-212.1-138.1-137.2-229 16.3-19.8 44.2-38.7 87.3-49.4 67.5-16.5 175 10.3 275.7 43.4 18.1-33.3 33.4-69.9 44.7-108.9H305.1V402h160v-56.2H271.3v-31.3h193.8v-80.1s0-13.5 13.7-13.5H557v93.6h191.7v31.3H557.1V402h156.4c-15 61.1-37.7 117.4-66.2 166.8 47.5 17.1 90.1 33.3 121.8 43.9z"}}]},name:"alipay-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AlipayCircleOutlined";var u=i.forwardRef(s)},94506:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M789 610.3c-38.7-12.9-90.7-32.7-148.5-53.6 34.8-60.3 62.5-129 80.7-203.6H530.5v-68.6h233.6v-38.3H530.5V132h-95.4c-16.7 0-16.7 16.5-16.7 16.5v97.8H182.2v38.3h236.3v68.6H223.4v38.3h378.4a667.18 667.18 0 01-54.5 132.9c-122.8-40.4-253.8-73.2-336.1-53-52.6 13-86.5 36.1-106.5 60.3-91.4 111-25.9 279.6 167.2 279.6C386 811.2 496 747.6 581.2 643 708.3 704 960 808.7 960 808.7V659.4s-31.6-2.5-171-49.1zM253.9 746.6c-150.5 0-195-118.3-120.6-183.1 24.8-21.9 70.2-32.6 94.4-35 89.4-8.8 172.2 25.2 269.9 72.8-68.8 89.5-156.3 145.3-243.7 145.3z"}}]},name:"alipay",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AlipayOutlined";var u=i.forwardRef(s)},59401:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868.2 377.4c-18.9-45.1-46.3-85.6-81.2-120.6a377.26 377.26 0 00-120.5-81.2A375.65 375.65 0 00519 145.8c-41.9 0-82.9 6.7-121.9 20C306 123.3 200.8 120 170.6 120c-2.2 0-7.4 0-9.4.2-11.9.4-22.8 6.5-29.2 16.4-6.5 9.9-7.7 22.4-3.4 33.5l64.3 161.6a378.59 378.59 0 00-52.8 193.2c0 51.4 10 101 29.8 147.6 18.9 45 46.2 85.6 81.2 120.5 34.7 34.8 75.4 62.1 120.5 81.2C418.3 894 467.9 904 519 904c51.3 0 100.9-10.1 147.7-29.8 44.9-18.9 85.5-46.3 120.4-81.2 34.7-34.8 62.1-75.4 81.2-120.6a376.5 376.5 0 0029.8-147.6c-.2-51.2-10.1-100.8-29.9-147.4zm-66.4 266.5a307.08 307.08 0 01-65.9 98c-28.4 28.5-61.3 50.7-97.7 65.9h-.1c-38 16-78.3 24.2-119.9 24.2a306.51 306.51 0 01-217.5-90.2c-28.4-28.5-50.6-61.4-65.8-97.8v-.1c-16-37.8-24.1-78.2-24.1-119.9 0-55.4 14.8-109.7 42.8-157l13.2-22.1-9.5-23.9L206 192c14.9.6 35.9 2.1 59.7 5.6 43.8 6.5 82.5 17.5 114.9 32.6l19 8.9 19.9-6.8c31.5-10.8 64.8-16.2 98.9-16.2a306.51 306.51 0 01217.5 90.2c28.4 28.5 50.6 61.4 65.8 97.8l.1.1.1.1c16 37.6 24.1 78 24.2 119.8-.1 41.7-8.3 82-24.3 119.8zM681.1 364.2c-20.4 0-37.1 16.7-37.1 37.1v55.1c0 20.4 16.6 37.1 37.1 37.1s37.1-16.7 37.1-37.1v-55.1c0-20.5-16.7-37.1-37.1-37.1zm-175.2 0c-20.5 0-37.1 16.7-37.1 37.1v55.1c0 20.4 16.7 37.1 37.1 37.1 20.5 0 37.1-16.7 37.1-37.1v-55.1c0-20.5-16.7-37.1-37.1-37.1z"}}]},name:"aliwangwang",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AliwangwangOutlined";var u=i.forwardRef(s)},1627:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M959.2 383.9c-.3-82.1-66.9-148.6-149.1-148.6H575.9l21.6 85.2 201 43.7a42.58 42.58 0 0132.9 39.7c.1.5.1 216.1 0 216.6a42.58 42.58 0 01-32.9 39.7l-201 43.7-21.6 85.3h234.2c82.1 0 148.8-66.5 149.1-148.6V383.9zM225.5 660.4a42.58 42.58 0 01-32.9-39.7c-.1-.6-.1-216.1 0-216.6.8-19.4 14.6-35.5 32.9-39.7l201-43.7 21.6-85.2H213.8c-82.1 0-148.8 66.4-149.1 148.6V641c.3 82.1 67 148.6 149.1 148.6H448l-21.6-85.3-200.9-43.9zm200.9-158.8h171v21.3h-171z"}}]},name:"aliyun",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AliyunOutlined";var u=i.forwardRef(s)},2905:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M825 768.9c-3.3-.9-7.3-.4-11.9 1.3-61.6 28.2-121.5 48.3-179.7 60.2C507.7 856 385.2 842.6 266 790.3c-33.1-14.6-79.1-39.2-138-74a9.36 9.36 0 00-5.3-2c-2-.1-3.7.1-5.3.9-1.6.8-2.8 1.8-3.7 3.1-.9 1.3-1.1 3.1-.4 5.4.6 2.2 2.1 4.7 4.6 7.4 10.4 12.2 23.3 25.2 38.6 39s35.6 29.4 60.9 46.8c25.3 17.4 51.8 32.9 79.3 46.4 27.6 13.5 59.6 24.9 96.1 34.1s73 13.8 109.4 13.8c36.2 0 71.4-3.7 105.5-10.9 34.2-7.3 63-15.9 86.5-25.9 23.4-9.9 45-21 64.8-33 19.8-12 34.4-22.2 43.9-30.3 9.5-8.2 16.3-14.6 20.2-19.4 4.6-5.7 6.9-10.6 6.9-14.9.1-4.5-1.7-7.1-5-7.9zM527.4 348.1c-15.2 1.3-33.5 4.1-55 8.3-21.5 4.1-41.4 9.3-59.8 15.4s-37.2 14.6-56.3 25.4c-19.2 10.8-35.5 23.2-49 37s-24.5 31.1-33.1 52c-8.6 20.8-12.9 43.7-12.9 68.7 0 27.1 4.7 51.2 14.3 72.5 9.5 21.3 22.2 38 38.2 50.4 15.9 12.4 34 22.1 54 29.2 20 7.1 41.2 10.3 63.2 9.4 22-.9 43.5-4.3 64.4-10.3 20.8-5.9 40.4-15.4 58.6-28.3 18.2-12.9 33.1-28.2 44.8-45.7 4.3 6.6 8.1 11.5 11.5 14.7l8.7 8.9c5.8 5.9 14.7 14.6 26.7 26.1 11.9 11.5 24.1 22.7 36.3 33.7l104.4-99.9-6-4.9c-4.3-3.3-9.4-8-15.2-14.3-5.8-6.2-11.6-13.1-17.2-20.5-5.7-7.4-10.6-16.1-14.7-25.9-4.1-9.8-6.2-19.3-6.2-28.5V258.7c0-10.1-1.9-21-5.7-32.8-3.9-11.7-10.7-24.5-20.7-38.3-10-13.8-22.4-26.2-37.2-37-14.9-10.8-34.7-20-59.6-27.4-24.8-7.4-52.6-11.1-83.2-11.1-31.3 0-60.4 3.7-87.6 10.9-27.1 7.3-50.3 17-69.7 29.2-19.3 12.2-35.9 26.3-49.7 42.4-13.8 16.1-24.1 32.9-30.8 50.4-6.7 17.5-10.1 35.2-10.1 53.1L408 310c5.5-16.4 12.9-30.6 22-42.8 9.2-12.2 17.9-21 25.8-26.5 8-5.5 16.6-9.9 25.7-13.2 9.2-3.3 15.4-5 18.6-5.4 3.2-.3 5.7-.4 7.6-.4 26.7 0 45.2 7.9 55.6 23.6 6.5 9.5 9.7 23.9 9.7 43.3v56.6c-15.2.6-30.4 1.6-45.6 2.9zM573.1 500c0 16.6-2.2 31.7-6.5 45-9.2 29.1-26.7 47.4-52.4 54.8-22.4 6.6-43.7 3.3-63.9-9.8-21.5-14-32.2-33.8-32.2-59.3 0-19.9 5-36.9 15-51.1 10-14.1 23.3-24.7 40-31.7s33-12 49-14.9c15.9-3 33-4.8 51-5.4V500zm335.2 218.9c-4.3-5.4-15.9-8.9-34.9-10.7-19-1.8-35.5-1.7-49.7.4-15.3 1.8-31.1 6.2-47.3 13.4-16.3 7.1-23.4 13.1-21.6 17.8l.7 1.3.9.7 1.4.2h4.6c.8 0 1.8-.1 3.2-.2 1.4-.1 2.7-.3 3.9-.4 1.2-.1 2.9-.3 5.1-.4 2.1-.1 4.1-.4 6-.7.3 0 3.7-.3 10.3-.9 6.6-.6 11.4-1 14.3-1.3 2.9-.3 7.8-.6 14.5-.9 6.7-.3 12.1-.3 16.1 0 4 .3 8.5.7 13.6 1.1 5.1.4 9.2 1.3 12.4 2.7 3.2 1.3 5.6 3 7.1 5.1 5.2 6.6 4.2 21.2-3 43.9s-14 40.8-20.4 54.2c-2.8 5.7-2.8 9.2 0 10.7s6.7.1 11.9-4c15.6-12.2 28.6-30.6 39.1-55.3 6.1-14.6 10.5-29.8 13.1-45.7 2.4-15.9 2-26.2-1.3-31z"}}]},name:"amazon",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AmazonOutlined";var u=i.forwardRef(s)},34262:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M448.3 225.2c-18.6 0-32 13.4-32 31.9s13.5 31.9 32 31.9c18.6 0 32-13.4 32-31.9.1-18.4-13.4-31.9-32-31.9zm393.9 96.4c-13.8-13.8-32.7-21.5-53.2-21.5-3.9 0-7.4.4-10.7 1v-1h-3.6c-5.5-30.6-18.6-60.5-38.1-87.4-18.7-25.7-43-47.9-70.8-64.9l25.1-35.8v-3.3c0-.8.4-2.3.7-3.8.6-2.4 1.4-5.5 1.4-8.9 0-18.5-13.5-31.9-32-31.9-9.8 0-19.5 5.7-25.9 15.4l-29.3 42.1c-30-9.8-62.4-15-93.8-15-31.3 0-63.7 5.2-93.8 15L389 79.4c-6.6-9.6-16.1-15.4-26-15.4-18.6 0-32 13.4-32 31.9 0 6.2 2.5 12.8 6.7 17.4l22.6 32.3c-28.7 17-53.5 39.4-72.2 65.1-19.4 26.9-32 56.8-36.7 87.4h-5.5v1c-3.2-.6-6.7-1-10.7-1-20.3 0-39.2 7.5-53.1 21.3-13.8 13.8-21.5 32.6-21.5 53v235c0 20.3 7.5 39.1 21.4 52.9 13.8 13.8 32.8 21.5 53.2 21.5 3.9 0 7.4-.4 10.7-1v93.5c0 29.2 23.9 53.1 53.2 53.1H331v58.3c0 20.3 7.5 39.1 21.4 52.9 13.8 13.8 32.8 21.5 53.2 21.5 20.3 0 39.2-7.5 53.1-21.3 13.8-13.8 21.5-32.6 21.5-53v-58.2H544v58.1c0 20.3 7.5 39.1 21.4 52.9 13.8 13.8 32.8 21.5 53.2 21.5 20.4 0 39.2-7.5 53.1-21.6 13.8-13.8 21.5-32.6 21.5-53v-58.2h31.9c29.3 0 53.2-23.8 53.2-53.1v-91.4c3.2.6 6.7 1 10.7 1 20.3 0 39.2-7.5 53.1-21.3 13.8-13.8 21.5-32.6 21.5-53v-235c-.1-20.3-7.6-39-21.4-52.9zM246 609.6c0 6.8-3.9 10.6-10.7 10.6-6.8 0-10.7-3.8-10.7-10.6V374.5c0-6.8 3.9-10.6 10.7-10.6 6.8 0 10.7 3.8 10.7 10.6v235.1zm131.1-396.8c37.5-27.3 85.3-42.3 135-42.3s97.5 15.1 135 42.5c32.4 23.7 54.2 54.2 62.7 87.5H314.4c8.5-33.4 30.5-64 62.7-87.7zm39.3 674.7c-.6 5.6-4.4 8.7-10.5 8.7-6.8 0-10.7-3.8-10.7-10.6v-58.2h21.2v60.1zm202.3 8.7c-6.8 0-10.7-3.8-10.7-10.6v-58.2h21.2v60.1c-.6 5.6-4.3 8.7-10.5 8.7zm95.8-132.6H309.9V364h404.6v399.6zm85.2-154c0 6.8-3.9 10.6-10.7 10.6-6.8 0-10.7-3.8-10.7-10.6V374.5c0-6.8 3.9-10.6 10.7-10.6 6.8 0 10.7 3.8 10.7 10.6v235.1zM576.1 225.2c-18.6 0-32 13.4-32 31.9s13.5 31.9 32 31.9c18.6 0 32.1-13.4 32.1-32-.1-18.6-13.4-31.8-32.1-31.8z"}}]},name:"android",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AndroidOutlined";var u=i.forwardRef(s)},38419:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M378.9 738c-3.1 0-6.1-.5-8.8-1.5l4.4 30.7h26.3l-15.5-29.9c-2.1.5-4.2.7-6.4.7zm421-291.2c-12.6 0-24.8 1.5-36.5 4.2-21.4-38.4-62.3-64.3-109.3-64.3-6.9 0-13.6.6-20.2 1.6-35.4-77.4-113.4-131.1-203.9-131.1-112.3 0-205.3 82.6-221.6 190.4C127.3 455.5 64 523.8 64 607c0 88.4 71.6 160.1 160 160.2h50l13.2-27.6c-26.2-8.3-43.3-29-39.1-48.8 4.6-21.6 32.8-33.9 63.1-27.5 22.9 4.9 40.4 19.1 45.5 35.1a26.1 26.1 0 0122.1-12.4h.2c-.8-3.2-1.2-6.5-1.2-9.9 0-20.1 14.8-36.7 34.1-39.6v-25.4c0-4.4 3.6-8 8-8s8 3.6 8 8v26.3c4.6 1.2 8.8 3.2 12.6 5.8l19.5-21.4c3-3.3 8-3.5 11.3-.5 3.3 3 3.5 8 .5 11.3l-20 22-.2.2a40 40 0 01-46.9 59.2c-.4 5.6-2.6 10.7-6 14.8l20 38.4H804v-.1c86.5-2.2 156-73 156-160.1 0-88.5-71.7-160.2-160.1-160.2zM338.2 737.2l-4.3 30h24.4l-5.9-41.5c-3.5 4.6-8.3 8.5-14.2 11.5zM797.5 305a48 48 0 1096 0 48 48 0 10-96 0zm-65.7 61.3a24 24 0 1048 0 24 24 0 10-48 0zM303.4 742.9l-11.6 24.3h26l3.5-24.7c-5.7.8-11.7 1-17.9.4z"}}]},name:"ant-cloud",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AntCloudOutlined";var u=i.forwardRef(s)},49434:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M716.3 313.8c19-18.9 19-49.7 0-68.6l-69.9-69.9.1.1c-18.5-18.5-50.3-50.3-95.3-95.2-21.2-20.7-55.5-20.5-76.5.5L80.9 474.2a53.84 53.84 0 000 76.4L474.6 944a54.14 54.14 0 0076.5 0l165.1-165c19-18.9 19-49.7 0-68.6a48.7 48.7 0 00-68.7 0l-125 125.2c-5.2 5.2-13.3 5.2-18.5 0L189.5 521.4c-5.2-5.2-5.2-13.3 0-18.5l314.4-314.2c.4-.4.9-.7 1.3-1.1 5.2-4.1 12.4-3.7 17.2 1.1l125.2 125.1c19 19 49.8 19 68.7 0zM408.6 514.4a106.3 106.2 0 10212.6 0 106.3 106.2 0 10-212.6 0zm536.2-38.6L821.9 353.5c-19-18.9-49.8-18.9-68.7.1a48.4 48.4 0 000 68.6l83 82.9c5.2 5.2 5.2 13.3 0 18.5l-81.8 81.7a48.4 48.4 0 000 68.6 48.7 48.7 0 0068.7 0l121.8-121.7a53.93 53.93 0 00-.1-76.4z"}}]},name:"ant-design",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AntDesignOutlined";var u=i.forwardRef(s)},54618:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ApartmentOutlined";var u=i.forwardRef(s)},3248:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ApiOutlined";var u=i.forwardRef(s)},12304:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-10.6 267c-14.3 19.9-28.7 35.6-41.9 45.7-10.5 8-18.6 11.4-24 11.6-9-.1-17.7-2.3-34.7-8.8-1.2-.5-2.5-1-4.2-1.6l-4.4-1.7c-17.4-6.7-27.8-10.3-41.1-13.8-18.6-4.8-37.1-7.4-56.9-7.4-20.2 0-39.2 2.5-58.1 7.2-13.9 3.5-25.6 7.4-42.7 13.8-.7.3-8.1 3.1-10.2 3.9-3.5 1.3-6.2 2.3-8.7 3.2-10.4 3.6-17 5.1-22.9 5.2-.7 0-1.3-.1-1.8-.2-1.1-.2-2.5-.6-4.1-1.3-4.5-1.8-9.9-5.1-16-9.8-14-10.9-29.4-28-45.1-49.9-27.5-38.6-53.5-89.8-66-125.7-15.4-44.8-23-87.7-23-128.6 0-60.2 17.8-106 48.4-137.1 26.3-26.6 61.7-41.5 97.8-42.3 5.9.1 14.5 1.5 25.4 4.5 8.6 2.3 18 5.4 30.7 9.9 3.8 1.4 16.9 6.1 18.5 6.7 7.7 2.8 13.5 4.8 19.2 6.6 18.2 5.8 32.3 9 47.6 9 15.5 0 28.8-3.3 47.7-9.8 7.1-2.4 32.9-12 37.5-13.6 25.6-9.1 44.5-14 60.8-15.2 4.8-.4 9.1-.4 13.2-.1 22.7 1.8 42.1 6.3 58.6 13.8-37.6 43.4-57 96.5-56.9 158.4-.3 14.7.9 31.7 5.1 51.8 6.4 30.5 18.6 60.7 37.9 89 14.7 21.5 32.9 40.9 54.7 57.8-11.5 23.7-25.6 48.2-40.4 68.8zm-94.5-572c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"}}]},name:"apple",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AppleOutlined";var u=i.forwardRef(s)},18401:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}}]},name:"appstore-add",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AppstoreAddOutlined";var u=i.forwardRef(s)},5405:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AppstoreOutlined";var u=i.forwardRef(s)},59512:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M682 455V311l-76 76v68c-.1 50.7-42 92.1-94 92a95.8 95.8 0 01-52-15l-54 55c29.1 22.4 65.9 36 106 36 93.8 0 170-75.1 170-168z"}},{tag:"path",attrs:{d:"M833 446h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254-63 0-120.7-23-165-61l-54 54a334.01 334.01 0 00179 81v102H326c-13.9 0-24.9 14.3-25 32v36c.1 4.4 2.9 8 6 8h408c3.2 0 6-3.6 6-8v-36c0-17.7-11-32-25-32H547V782c165.3-17.9 294-157.9 294-328 0-4.4-3.6-8-8-8zm13.1-377.7l-43.5-41.9a8 8 0 00-11.2.1l-129 129C634.3 101.2 577 64 511 64c-93.9 0-170 75.3-170 168v224c0 6.7.4 13.3 1.2 19.8l-68 68A252.33 252.33 0 01258 454c-.2-4.4-3.8-8-8-8h-60c-4.4 0-8 3.6-8 8 0 53 12.5 103 34.6 147.4l-137 137a8.03 8.03 0 000 11.3l42.7 42.7c3.1 3.1 8.2 3.1 11.3 0L846.2 79.8l.1-.1c3.1-3.2 3-8.3-.2-11.4zM417 401V232c0-50.6 41.9-92 94-92 46 0 84.1 32.3 92.3 74.7L417 401z"}}]},name:"audio-muted",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AudioMutedOutlined";var u=i.forwardRef(s)},82272:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AudioOutlined";var u=i.forwardRef(s)},62965:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 250c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm184 144H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 458H208V148h560v320c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm440-88H728v-36.6c46.3-13.8 80-56.6 80-107.4 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 50.7 33.7 93.6 80 107.4V764H520c-8.8 0-16 7.2-16 16v152c0 8.8 7.2 16 16 16h352c8.8 0 16-7.2 16-16V780c0-8.8-7.2-16-16-16zM646 620c0-27.6 22.4-50 50-50s50 22.4 50 50-22.4 50-50 50-50-22.4-50-50zm180 266H566v-60h260v60z"}}]},name:"audit",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="AuditOutlined";var u=i.forwardRef(s)},88630:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BankOutlined";var u=i.forwardRef(s)},25449:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M120 160H72c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V168c0-4.4-3.6-8-8-8zm833 0h-48c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V168c0-4.4-3.6-8-8-8zM200 736h112c4.4 0 8-3.6 8-8V168c0-4.4-3.6-8-8-8H200c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8zm321 0h48c4.4 0 8-3.6 8-8V168c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8zm126 0h178c4.4 0 8-3.6 8-8V168c0-4.4-3.6-8-8-8H647c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8zm-255 0h48c4.4 0 8-3.6 8-8V168c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8zm-79 64H201c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm257 0h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm256 0H648c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h178c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-385 0h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}}]},name:"barcode",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BarcodeOutlined";var u=i.forwardRef(s)},57551:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BarsOutlined";var u=i.forwardRef(s)},49688:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M634 294.3h199.5v48.4H634zM434.1 485.8c44.1-21.1 67.2-53.2 67.2-102.8 0-98.1-73-121.9-157.3-121.9H112v492.4h238.5c89.4 0 173.3-43 173.3-143 0-61.8-29.2-107.5-89.7-124.7zM220.2 345.1h101.5c39.1 0 74.2 10.9 74.2 56.3 0 41.8-27.3 58.6-66 58.6H220.2V345.1zm115.5 324.8H220.1V534.3H338c47.6 0 77.7 19.9 77.7 70.3 0 49.6-35.9 65.3-80 65.3zm575.8-89.5c0-105.5-61.7-193.4-173.3-193.4-108.5 0-182.3 81.7-182.3 188.8 0 111 69.9 187.2 182.3 187.2 85.1 0 140.2-38.3 166.7-120h-86.3c-9.4 30.5-47.6 46.5-77.3 46.5-57.4 0-87.4-33.6-87.4-90.7h256.9c.3-5.9.7-12.1.7-18.4zM653.9 537c3.1-46.9 34.4-76.2 81.2-76.2 49.2 0 73.8 28.9 78.1 76.2H653.9z"}}]},name:"behance",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BehanceOutlined";var u=i.forwardRef(s)},78823:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zM598.5 350.9h138.4v33.7H598.5v-33.7zM512 628.8a89.52 89.52 0 01-27 31c-11.8 8.2-24.9 14.2-38.8 17.7a167.4 167.4 0 01-44.6 5.7H236V342.1h161c16.3 0 31.1 1.5 44.6 4.3 13.4 2.8 24.8 7.6 34.4 14.1 9.5 6.5 17 15.2 22.3 26 5.2 10.7 7.9 24.1 7.9 40 0 17.2-3.9 31.4-11.7 42.9-7.9 11.5-19.3 20.8-34.8 28.1 21.1 6 36.6 16.7 46.8 31.7 10.4 15.2 15.5 33.4 15.5 54.8 0 17.4-3.3 32.3-10 44.8zM790.8 576H612.4c0 19.4 6.7 38 16.8 48 10.2 9.9 24.8 14.9 43.9 14.9 13.8 0 25.5-3.5 35.5-10.4 9.9-6.9 15.9-14.2 18.1-21.8h59.8c-9.6 29.7-24.2 50.9-44 63.7-19.6 12.8-43.6 19.2-71.5 19.2-19.5 0-37-3.2-52.7-9.3-15.1-5.9-28.7-14.9-39.9-26.5a121.2 121.2 0 01-25.1-41.2c-6.1-16.9-9.1-34.7-8.9-52.6 0-18.5 3.1-35.7 9.1-51.7 11.5-31.1 35.4-56 65.9-68.9 16.3-6.8 33.8-10.2 51.5-10 21 0 39.2 4 55 12.2a111.6 111.6 0 0138.6 32.8c10.1 13.7 17.2 29.3 21.7 46.9 4.3 17.3 5.8 35.5 4.6 54.7zm-122-95.6c-10.8 0-19.9 1.9-26.9 5.6-7 3.7-12.8 8.3-17.2 13.6a48.4 48.4 0 00-9.1 17.4c-1.6 5.3-2.7 10.7-3.1 16.2H723c-1.6-17.3-7.6-30.1-15.6-39.1-8.4-8.9-21.9-13.7-38.6-13.7zm-248.5-10.1c8.7-6.3 12.9-16.7 12.9-31 .3-6.8-1.1-13.5-4.1-19.6-2.7-4.9-6.7-9-11.6-11.9a44.8 44.8 0 00-16.6-6c-6.4-1.2-12.9-1.8-19.3-1.7h-70.3v79.7h76.1c13.1.1 24.2-3.1 32.9-9.5zm11.8 72c-9.8-7.5-22.9-11.2-39.2-11.2h-81.8v94h80.2c7.5 0 14.4-.7 21.1-2.1s12.7-3.8 17.8-7.2c5.1-3.3 9.2-7.8 12.3-13.6 3-5.8 4.5-13.2 4.5-22.1 0-17.7-5-30.2-14.9-37.8z"}}]},name:"behance-square",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BehanceSquareOutlined";var u=i.forwardRef(s)},89317:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BellOutlined";var u=i.forwardRef(s)},72285:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BlockOutlined";var u=i.forwardRef(s)},68479:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-260 72h96v209.9L621.5 312 572 347.4V136zm220 752H232V136h280v296.9c0 3.3 1 6.6 3 9.3a15.9 15.9 0 0022.3 3.7l83.8-59.9 81.4 59.4c2.7 2 6 3.1 9.4 3.1 8.8 0 16-7.2 16-16V136h64v752z"}}]},name:"book",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BookOutlined";var u=i.forwardRef(s)},71938:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M740 161c-61.8 0-112 50.2-112 112 0 50.1 33.1 92.6 78.5 106.9v95.9L320 602.4V318.1c44.2-15 76-56.9 76-106.1 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 49.2 31.8 91 76 106.1V706c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-27.8l423.5-138.7a50.52 50.52 0 0034.9-48.2V378.2c42.9-15.8 73.6-57 73.6-105.2 0-61.8-50.2-112-112-112zm-504 51a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm96 600a48.01 48.01 0 01-96 0 48.01 48.01 0 0196 0zm408-491a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"branches",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BranchesOutlined";var u=i.forwardRef(s)},2825:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 00-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 00-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 01-63 63H232a63 63 0 01-63-63c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5.2 13 .7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7a273 273 0 0022.7 49c24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2a281.38 281.38 0 00123.2-149.5A120 120 0 01836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7.4-6.4.7-12.8.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3C584 874.3 548.8 884 512 884s-72-9.7-102.9-27.8c-30.3-17.7-55.6-43-73.3-73.3A202.75 202.75 0 01308 680V412h408v268z"}}]},name:"bug",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BugOutlined";var u=i.forwardRef(s)},7278:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"}}]},name:"build",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BuildOutlined";var u=i.forwardRef(s)},43926:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="BulbOutlined";var u=i.forwardRef(s)},85369:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M251.2 387H320v68.8c0 1.8 1.8 3.2 4 3.2h48c2.2 0 4-1.4 4-3.3V387h68.8c1.8 0 3.2-1.8 3.2-4v-48c0-2.2-1.4-4-3.3-4H376v-68.8c0-1.8-1.8-3.2-4-3.2h-48c-2.2 0-4 1.4-4 3.2V331h-68.8c-1.8 0-3.2 1.8-3.2 4v48c0 2.2 1.4 4 3.2 4zm328 0h193.6c1.8 0 3.2-1.8 3.2-4v-48c0-2.2-1.4-4-3.3-4H579.2c-1.8 0-3.2 1.8-3.2 4v48c0 2.2 1.4 4 3.2 4zm0 265h193.6c1.8 0 3.2-1.8 3.2-4v-48c0-2.2-1.4-4-3.3-4H579.2c-1.8 0-3.2 1.8-3.2 4v48c0 2.2 1.4 4 3.2 4zm0 104h193.6c1.8 0 3.2-1.8 3.2-4v-48c0-2.2-1.4-4-3.3-4H579.2c-1.8 0-3.2 1.8-3.2 4v48c0 2.2 1.4 4 3.2 4zm-195.7-81l61.2-74.9c4.3-5.2.7-13.1-5.9-13.1H388c-2.3 0-4.5 1-5.9 2.9l-34 41.6-34-41.6a7.85 7.85 0 00-5.9-2.9h-50.9c-6.6 0-10.2 7.9-5.9 13.1l61.2 74.9-62.7 76.8c-4.4 5.2-.8 13.1 5.8 13.1h50.8c2.3 0 4.5-1 5.9-2.9l35.5-43.5 35.5 43.5c1.5 1.8 3.7 2.9 5.9 2.9h50.8c6.6 0 10.2-7.9 5.9-13.1L383.5 675zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-36 732H180V180h664v664z"}}]},name:"calculator",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CalculatorOutlined";var u=i.forwardRef(s)},53318:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CalendarOutlined";var u=i.forwardRef(s)},85008:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 248H728l-32.4-90.8a32.07 32.07 0 00-30.2-21.2H358.6c-13.5 0-25.6 8.5-30.1 21.2L296 248H160c-44.2 0-80 35.8-80 80v456c0 44.2 35.8 80 80 80h704c44.2 0 80-35.8 80-80V328c0-44.2-35.8-80-80-80zm8 536c0 4.4-3.6 8-8 8H160c-4.4 0-8-3.6-8-8V328c0-4.4 3.6-8 8-8h186.7l17.1-47.8 22.9-64.2h250.5l22.9 64.2 17.1 47.8H864c4.4 0 8 3.6 8 8v456zM512 384c-88.4 0-160 71.6-160 160s71.6 160 160 160 160-71.6 160-160-71.6-160-160-160zm0 256c-53 0-96-43-96-96s43-96 96-96 96 43 96 96-43 96-96 96z"}}]},name:"camera",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CameraOutlined";var u=i.forwardRef(s)},45452:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M380 704h264c4.4 0 8-3.6 8-8v-84c0-4.4-3.6-8-8-8h-40c-4.4 0-8 3.6-8 8v36H428v-36c0-4.4-3.6-8-8-8h-40c-4.4 0-8 3.6-8 8v84c0 4.4 3.6 8 8 8zm340-123a40 40 0 1080 0 40 40 0 10-80 0zm239-167.6L935.3 372a8 8 0 00-10.9-2.9l-50.7 29.6-78.3-216.2a63.9 63.9 0 00-60.9-44.4H301.2c-34.7 0-65.5 22.4-76.2 55.5l-74.6 205.2-50.8-29.6a8 8 0 00-10.9 2.9L65 413.4c-2.2 3.8-.9 8.6 2.9 10.8l60.4 35.2-14.5 40c-1.2 3.2-1.8 6.6-1.8 10v348.2c0 15.7 11.8 28.4 26.3 28.4h67.6c12.3 0 23-9.3 25.6-22.3l7.7-37.7h545.6l7.7 37.7c2.7 13 13.3 22.3 25.6 22.3h67.6c14.5 0 26.3-12.7 26.3-28.4V509.4c0-3.4-.6-6.8-1.8-10l-14.5-40 60.3-35.2a8 8 0 003-10.8zM840 517v237H184V517l15.6-43h624.8l15.6 43zM292.7 218.1l.5-1.3.4-1.3c1.1-3.3 4.1-5.5 7.6-5.5h427.6l75.4 208H220l72.7-199.9zM224 581a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"car",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CarOutlined";var u=i.forwardRef(s)},4334:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v584zM688 420h-55.2c-5.1 0-10 2.5-13 6.6L468.9 634.4l-64.7-89c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.4 0-12.8-6.5-12.8z"}}]},name:"carry-out",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CarryOutOutlined";var u=i.forwardRef(s)},38819:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CheckCircleFilled";var u=i.forwardRef(s)},79508:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CheckOutlined";var u=i.forwardRef(s)},83428:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 512.3v-.3c0-229.8-186.2-416-416-416S96 282.2 96 512v.4c0 229.8 186.2 416 416 416s416-186.2 416-416v-.3.2zm-6.7-74.6l.6 3.3-.6-3.3zM676.7 638.2c53.5-82.2 52.5-189.4-11.1-263.7l162.4-8.4c20.5 44.4 32 93.8 32 145.9 0 185.2-144.6 336.6-327.1 347.4l143.8-221.2zM512 652.3c-77.5 0-140.2-62.7-140.2-140.2 0-77.7 62.7-140.2 140.2-140.2S652.2 434.5 652.2 512 589.5 652.3 512 652.3zm369.2-331.7l-3-5.7 3 5.7zM512 164c121.3 0 228.2 62.1 290.4 156.2l-263.6-13.9c-97.5-5.7-190.2 49.2-222.3 141.1L227.8 311c63.1-88.9 166.9-147 284.2-147zM102.5 585.8c26 145 127.1 264 261.6 315.1C229.6 850 128.5 731 102.5 585.8zM164 512c0-55.9 13.2-108.7 36.6-155.5l119.7 235.4c44.1 86.7 137.4 139.7 234 121.6l-74 145.1C302.9 842.5 164 693.5 164 512zm324.7 415.4c4 .2 8 .4 12 .5-4-.2-8-.3-12-.5z"}}]},name:"chrome",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ChromeOutlined";var u=i.forwardRef(s)},72850:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ClearOutlined";var u=i.forwardRef(s)},43061:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CloseCircleFilled";var u=i.forwardRef(s)},73218:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CloseCircleOutlined";var u=i.forwardRef(s)},54549:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CloseOutlined";var u=i.forwardRef(s)},19671:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CloudDownloadOutlined";var u=i.forwardRef(s)},97254:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z"}},{tag:"path",attrs:{d:"M376.9 656.4c1.8-33.5 15.7-64.7 39.5-88.6 25.4-25.5 60-39.8 96-39.8 36.2 0 70.3 14.1 96 39.8 1.4 1.4 2.7 2.8 4.1 4.3l-25 19.6a8 8 0 003 14.1l98.2 24c5 1.2 9.9-2.6 9.9-7.7l.5-101.3c0-6.7-7.6-10.5-12.9-6.3L663 532.7c-36.6-42-90.4-68.6-150.5-68.6-107.4 0-195 85.1-199.4 191.7-.2 4.5 3.4 8.3 8 8.3H369c4.2-.1 7.7-3.4 7.9-7.7zM703 664h-47.9c-4.2 0-7.7 3.3-8 7.6-1.8 33.5-15.7 64.7-39.5 88.6-25.4 25.5-60 39.8-96 39.8-36.2 0-70.3-14.1-96-39.8-1.4-1.4-2.7-2.8-4.1-4.3l25-19.6a8 8 0 00-3-14.1l-98.2-24c-5-1.2-9.9 2.6-9.9 7.7l-.4 101.4c0 6.7 7.6 10.5 12.9 6.3l23.2-18.2c36.6 42 90.4 68.6 150.5 68.6 107.4 0 195-85.1 199.4-191.7.2-4.5-3.4-8.3-8-8.3z"}}]},name:"cloud-sync",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CloudSyncOutlined";var u=i.forwardRef(s)},62298:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M518.3 459a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-upload",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CloudUploadOutlined";var u=i.forwardRef(s)},98587:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M709.6 210l.4-.2h.2L512 96 313.9 209.8h-.2l.7.3L151.5 304v416L512 928l360.5-208V304l-162.9-94zM482.7 843.6L339.6 761V621.4L210 547.8V372.9l272.7 157.3v313.4zM238.2 321.5l134.7-77.8 138.9 79.7 139.1-79.9 135.2 78-273.9 158-274-158zM814 548.3l-128.8 73.1v139.1l-143.9 83V530.4L814 373.1v175.2z"}}]},name:"code-sandbox",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CodeSandboxOutlined";var u=i.forwardRef(s)},44251:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M488.1 414.7V303.4L300.9 428l83.6 55.8zm254.1 137.7v-79.8l-59.8 39.9zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm278 533c0 1.1-.1 2.1-.2 3.1 0 .4-.1.7-.2 1a14.16 14.16 0 01-.8 3.2c-.2.6-.4 1.2-.6 1.7-.2.4-.4.8-.5 1.2-.3.5-.5 1.1-.8 1.6-.2.4-.4.7-.7 1.1-.3.5-.7 1-1 1.5-.3.4-.5.7-.8 1-.4.4-.8.9-1.2 1.3-.3.3-.6.6-1 .9-.4.4-.9.8-1.4 1.1-.4.3-.7.6-1.1.8-.1.1-.3.2-.4.3L525.2 786c-4 2.7-8.6 4-13.2 4-4.7 0-9.3-1.4-13.3-4L244.6 616.9c-.1-.1-.3-.2-.4-.3l-1.1-.8c-.5-.4-.9-.7-1.3-1.1-.3-.3-.6-.6-1-.9-.4-.4-.8-.8-1.2-1.3a7 7 0 01-.8-1c-.4-.5-.7-1-1-1.5-.2-.4-.5-.7-.7-1.1-.3-.5-.6-1.1-.8-1.6-.2-.4-.4-.8-.5-1.2-.2-.6-.4-1.2-.6-1.7-.1-.4-.3-.8-.4-1.2-.2-.7-.3-1.3-.4-2-.1-.3-.1-.7-.2-1-.1-1-.2-2.1-.2-3.1V427.9c0-1 .1-2.1.2-3.1.1-.3.1-.7.2-1a14.16 14.16 0 01.8-3.2c.2-.6.4-1.2.6-1.7.2-.4.4-.8.5-1.2.2-.5.5-1.1.8-1.6.2-.4.4-.7.7-1.1.6-.9 1.2-1.7 1.8-2.5.4-.4.8-.9 1.2-1.3.3-.3.6-.6 1-.9.4-.4.9-.8 1.3-1.1.4-.3.7-.6 1.1-.8.1-.1.3-.2.4-.3L498.7 239c8-5.3 18.5-5.3 26.5 0l254.1 169.1c.1.1.3.2.4.3l1.1.8 1.4 1.1c.3.3.6.6 1 .9.4.4.8.8 1.2 1.3.7.8 1.3 1.6 1.8 2.5.2.4.5.7.7 1.1.3.5.6 1 .8 1.6.2.4.4.8.5 1.2.2.6.4 1.2.6 1.7.1.4.3.8.4 1.2.2.7.3 1.3.4 2 .1.3.1.7.2 1 .1 1 .2 2.1.2 3.1V597zm-254.1 13.3v111.3L723.1 597l-83.6-55.8zM281.8 472.6v79.8l59.8-39.9zM512 456.1l-84.5 56.4 84.5 56.4 84.5-56.4zM723.1 428L535.9 303.4v111.3l103.6 69.1zM384.5 541.2L300.9 597l187.2 124.6V610.3l-103.6-69.1z"}}]},name:"codepen-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CodepenCircleOutlined";var u=i.forwardRef(s)},93366:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M911.7 385.3l-.3-1.5c-.2-1-.3-1.9-.6-2.9-.2-.6-.4-1.1-.5-1.7-.3-.8-.5-1.7-.9-2.5-.2-.6-.5-1.1-.8-1.7-.4-.8-.8-1.5-1.2-2.3-.3-.5-.6-1.1-1-1.6-.8-1.2-1.7-2.4-2.6-3.6-.5-.6-1.1-1.3-1.7-1.9-.4-.5-.9-.9-1.4-1.3-.6-.6-1.3-1.1-1.9-1.6-.5-.4-1-.8-1.6-1.2-.2-.1-.4-.3-.6-.4L531.1 117.8a34.3 34.3 0 00-38.1 0L127.3 361.3c-.2.1-.4.3-.6.4-.5.4-1 .8-1.6 1.2-.7.5-1.3 1.1-1.9 1.6-.5.4-.9.9-1.4 1.3-.6.6-1.2 1.2-1.7 1.9-1 1.1-1.8 2.3-2.6 3.6-.3.5-.7 1-1 1.6-.4.7-.8 1.5-1.2 2.3-.3.5-.5 1.1-.8 1.7-.3.8-.6 1.7-.9 2.5-.2.6-.4 1.1-.5 1.7-.2.9-.4 1.9-.6 2.9l-.3 1.5c-.2 1.5-.3 3-.3 4.5v243.5c0 1.5.1 3 .3 4.5l.3 1.5.6 2.9c.2.6.3 1.1.5 1.7.3.9.6 1.7.9 2.5.2.6.5 1.1.8 1.7.4.8.7 1.5 1.2 2.3.3.5.6 1.1 1 1.6.5.7.9 1.4 1.5 2.1l1.2 1.5c.5.6 1.1 1.3 1.7 1.9.4.5.9.9 1.4 1.3.6.6 1.3 1.1 1.9 1.6.5.4 1 .8 1.6 1.2.2.1.4.3.6.4L493 905.7c5.6 3.8 12.3 5.8 19.1 5.8 6.6 0 13.3-1.9 19.1-5.8l365.6-243.5c.2-.1.4-.3.6-.4.5-.4 1-.8 1.6-1.2.7-.5 1.3-1.1 1.9-1.6.5-.4.9-.9 1.4-1.3.6-.6 1.2-1.2 1.7-1.9l1.2-1.5 1.5-2.1c.3-.5.7-1 1-1.6.4-.8.8-1.5 1.2-2.3.3-.5.5-1.1.8-1.7.3-.8.6-1.7.9-2.5.2-.5.4-1.1.5-1.7.3-.9.4-1.9.6-2.9l.3-1.5c.2-1.5.3-3 .3-4.5V389.8c-.3-1.5-.4-3-.6-4.5zM546.4 210.5l269.4 179.4-120.3 80.4-149-99.6V210.5zm-68.8 0v160.2l-149 99.6-120.3-80.4 269.3-179.4zM180.7 454.1l86 57.5-86 57.5v-115zm296.9 358.5L208.3 633.2l120.3-80.4 149 99.6v160.2zM512 592.8l-121.6-81.2L512 430.3l121.6 81.2L512 592.8zm34.4 219.8V652.4l149-99.6 120.3 80.4-269.3 179.4zM843.3 569l-86-57.5 86-57.5v115z"}}]},name:"codepen",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CodepenOutlined";var u=i.forwardRef(s)},812:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M275 281c19.9 0 36-16.1 36-36V36c0-19.9-16.1-36-36-36s-36 16.1-36 36v209c0 19.9 16.1 36 36 36zm613 144H768c0-39.8-32.2-72-72-72H200c-39.8 0-72 32.2-72 72v248c0 3.4.2 6.7.7 9.9-.5 7-.7 14-.7 21.1 0 176.7 143.3 320 320 320 160.1 0 292.7-117.5 316.3-271H888c39.8 0 72-32.2 72-72V497c0-39.8-32.2-72-72-72zM696 681h-1.1c.7 7.6 1.1 15.2 1.1 23 0 137-111 248-248 248S200 841 200 704c0-7.8.4-15.4 1.1-23H200V425h496v256zm192-8H776V497h112v176zM613 281c19.9 0 36-16.1 36-36V36c0-19.9-16.1-36-36-36s-36 16.1-36 36v209c0 19.9 16.1 36 36 36zm-170 0c19.9 0 36-16.1 36-36V36c0-19.9-16.1-36-36-36s-36 16.1-36 36v209c0 19.9 16.1 36 36 36z"}}]},name:"coffee",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CoffeeOutlined";var u=i.forwardRef(s)},70913:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm198.4-588.1a32 32 0 00-24.5.5L414.9 415 296.4 686c-3.6 8.2-3.6 17.5 0 25.7 3.4 7.8 9.7 13.9 17.7 17 3.8 1.5 7.7 2.2 11.7 2.2 4.4 0 8.7-.9 12.8-2.7l271-118.6 118.5-271a32.06 32.06 0 00-17.7-42.7zM576.8 534.4l26.2 26.2-42.4 42.4-26.2-26.2L380 644.4 447.5 490 422 464.4l42.4-42.4 25.5 25.5L644.4 380l-67.6 154.4zM464.4 422L422 464.4l25.5 25.6 86.9 86.8 26.2 26.2 42.4-42.4-26.2-26.2-86.8-86.9z"}}]},name:"compass",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CompassOutlined";var u=i.forwardRef(s)},56022:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M301.3 496.7c-23.8 0-40.2-10.5-41.6-26.9H205c.9 43.4 36.9 70.3 93.9 70.3 59.1 0 95-28.4 95-75.5 0-35.8-20-55.9-64.5-64.5l-29.1-5.6c-23.8-4.7-33.8-11.9-33.8-24.2 0-15 13.3-24.5 33.4-24.5 20.1 0 35.3 11.1 36.6 27h53c-.9-41.7-37.5-70.3-90.3-70.3-54.4 0-89.7 28.9-89.7 73 0 35.5 21.2 58 62.5 65.8l29.7 5.9c25.8 5.2 35.6 11.9 35.6 24.4.1 14.7-14.5 25.1-36 25.1z"}},{tag:"path",attrs:{d:"M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z"}},{tag:"path",attrs:{d:"M828.5 486.7h-95.8V308.5h-57.4V534h153.2zm-298.6 53.4c14.1 0 27.2-2 39.1-5.8l13.3 20.3h53.3L607.9 511c21.1-20 33-51.1 33-89.8 0-73.3-43.3-118.8-110.9-118.8s-111.2 45.3-111.2 118.8c-.1 73.7 43 118.9 111.1 118.9zm0-190c31.6 0 52.7 27.7 52.7 71.1 0 16.7-3.6 30.6-10 40.5l-5.2-6.9h-48.8L542 491c-3.9.9-8 1.4-12.2 1.4-31.7 0-52.8-27.5-52.8-71.2.1-43.6 21.2-71.1 52.9-71.1z"}}]},name:"console-sql",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ConsoleSqlOutlined";var u=i.forwardRef(s)},16640:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M594.3 601.5a111.8 111.8 0 0029.1-75.5c0-61.9-49.9-112-111.4-112s-111.4 50.1-111.4 112c0 29.1 11 55.5 29.1 75.5a158.09 158.09 0 00-74.6 126.1 8 8 0 008 8.4H407c4.2 0 7.6-3.3 7.9-7.5 3.8-50.6 46-90.5 97.2-90.5s93.4 40 97.2 90.5c.3 4.2 3.7 7.5 7.9 7.5H661a8 8 0 008-8.4c-2.8-53.3-32-99.7-74.7-126.1zM512 578c-28.5 0-51.7-23.3-51.7-52s23.2-52 51.7-52 51.7 23.3 51.7 52-23.2 52-51.7 52zm416-354H768v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56H548v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56H328v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56H96c-17.7 0-32 14.3-32 32v576c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V256c0-17.7-14.3-32-32-32zm-40 568H136V296h120v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56h148v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56h148v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56h120v496z"}}]},name:"contacts",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ContactsOutlined";var u=i.forwardRef(s)},23375:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-40 824H232V687h97.9c11.6 32.8 32 62.3 59.1 84.7 34.5 28.5 78.2 44.3 123 44.3s88.5-15.7 123-44.3c27.1-22.4 47.5-51.9 59.1-84.7H792v-63H643.6l-5.2 24.7C626.4 708.5 573.2 752 512 752s-114.4-43.5-126.5-103.3l-5.2-24.7H232V136h560v752zM320 341h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 160h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}}]},name:"container",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ContainerOutlined";var u=i.forwardRef(s)},12854:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z"}}]},name:"control",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ControlOutlined";var u=i.forwardRef(s)},88485:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M899.6 276.5L705 396.4 518.4 147.5a8.06 8.06 0 00-12.9 0L319 396.4 124.3 276.5c-5.7-3.5-13.1 1.2-12.2 7.9L188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.8-6.7-6.5-11.4-12.3-7.9zm-126 534.1H250.3l-53.8-409.4 139.8 86.1L512 252.9l175.7 234.4 139.8-86.1-53.9 409.4zM512 509c-62.1 0-112.6 50.5-112.6 112.6S449.9 734.2 512 734.2s112.6-50.5 112.6-112.6S574.1 509 512 509zm0 160.9c-26.6 0-48.2-21.6-48.2-48.3 0-26.6 21.6-48.3 48.2-48.3s48.2 21.6 48.2 48.3c0 26.6-21.6 48.3-48.2 48.3z"}}]},name:"crown",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CrownOutlined";var u=i.forwardRef(s)},33040:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 128c-212.1 0-384 171.9-384 384v360c0 13.3 10.7 24 24 24h184c35.3 0 64-28.7 64-64V624c0-35.3-28.7-64-64-64H200v-48c0-172.3 139.7-312 312-312s312 139.7 312 312v48H688c-35.3 0-64 28.7-64 64v208c0 35.3 28.7 64 64 64h184c13.3 0 24-10.7 24-24V512c0-212.1-171.9-384-384-384zM328 632v192H200V632h128zm496 192H696V632h128v192z"}}]},name:"customer-service",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="CustomerServiceOutlined";var u=i.forwardRef(s)},63392:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z"}}]},name:"dashboard",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DashboardOutlined";var u=i.forwardRef(s)},73888:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DatabaseOutlined";var u=i.forwardRef(s)},73171:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DeleteOutlined";var u=i.forwardRef(s)},48965:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 01-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0165.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"}}]},name:"deployment-unit",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DeploymentUnitOutlined";var u=i.forwardRef(s)},73566:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M573.7 252.5C422.5 197.4 201.3 96.7 201.3 96.7c-15.7-4.1-17.9 11.1-17.9 11.1-5 61.1 33.6 160.5 53.6 182.8 19.9 22.3 319.1 113.7 319.1 113.7S326 357.9 270.5 341.9c-55.6-16-37.9 17.8-37.9 17.8 11.4 61.7 64.9 131.8 107.2 138.4 42.2 6.6 220.1 4 220.1 4s-35.5 4.1-93.2 11.9c-42.7 5.8-97 12.5-111.1 17.8-33.1 12.5 24 62.6 24 62.6 84.7 76.8 129.7 50.5 129.7 50.5 33.3-10.7 61.4-18.5 85.2-24.2L565 743.1h84.6L603 928l205.3-271.9H700.8l22.3-38.7c.3.5.4.8.4.8S799.8 496.1 829 433.8l.6-1h-.1c5-10.8 8.6-19.7 10-25.8 17-71.3-114.5-99.4-265.8-154.5z"}}]},name:"dingding",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DingdingOutlined";var u=i.forwardRef(s)},4711:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M573.7 252.5C422.5 197.4 201.3 96.7 201.3 96.7c-15.7-4.1-17.9 11.1-17.9 11.1-5 61.1 33.6 160.5 53.6 182.8 19.9 22.3 319.1 113.7 319.1 113.7S326 357.9 270.5 341.9c-55.6-16-37.9 17.8-37.9 17.8 11.4 61.7 64.9 131.8 107.2 138.4 42.2 6.6 220.1 4 220.1 4s-35.5 4.1-93.2 11.9c-42.7 5.8-97 12.5-111.1 17.8-33.1 12.5 24 62.6 24 62.6 84.7 76.8 129.7 50.5 129.7 50.5 33.3-10.7 61.4-18.5 85.2-24.2L565 743.1h84.6L603 928l205.3-271.9H700.8l22.3-38.7c.3.5.4.8.4.8S799.8 496.1 829 433.8l.6-1h-.1c5-10.8 8.6-19.7 10-25.8 17-71.3-114.5-99.4-265.8-154.5z"}}]},name:"dingtalk",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DingtalkOutlined";var u=i.forwardRef(s)},57254:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DownOutlined";var u=i.forwardRef(s)},90631:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DownloadOutlined";var u=i.forwardRef(s)},80856:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 96C282.6 96 96 282.6 96 512s186.6 416 416 416 416-186.6 416-416S741.4 96 512 96zm275.1 191.8c49.5 60.5 79.5 137.5 80.2 221.4-11.7-2.5-129.2-26.3-247.4-11.4-2.5-6.1-5-12.2-7.6-18.3-7.4-17.3-15.3-34.6-23.6-51.5C720 374.3 779.6 298 787.1 287.8zM512 157.2c90.3 0 172.8 33.9 235.5 89.5-6.4 9.1-59.9 81-186.2 128.4-58.2-107-122.7-194.8-132.6-208 27.3-6.6 55.2-9.9 83.3-9.9zM360.9 191c9.4 12.8 72.9 100.9 131.7 205.5C326.4 440.6 180 440 164.1 439.8c23.1-110.3 97.4-201.9 196.8-248.8zM156.7 512.5c0-3.6.1-7.3.2-10.9 15.5.3 187.7 2.5 365.2-50.6 10.2 19.9 19.9 40.1 28.8 60.3-4.7 1.3-9.4 2.7-14 4.2C353.6 574.9 256.1 736.4 248 750.1c-56.7-63-91.3-146.3-91.3-237.6zM512 867.8c-82.2 0-157.9-28-218.1-75 6.4-13.1 78.3-152 278.7-221.9l2.3-.8c49.9 129.6 70.5 238.3 75.8 269.5A350.46 350.46 0 01512 867.8zm198.5-60.7c-3.6-21.6-22.5-125.6-69-253.3C752.9 536 850.7 565.2 862.8 569c-15.8 98.8-72.5 184.2-152.3 238.1z"}}]},name:"dribbble",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DribbbleOutlined";var u=i.forwardRef(s)},77125:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M64 556.9l264.2 173.5L512.5 577 246.8 412.7zm896-290.3zm0 0L696.8 95 512.5 248.5l265.2 164.2L512.5 577l184.3 153.4L960 558.8 777.7 412.7zM513 609.8L328.2 763.3l-79.4-51.5v57.8L513 928l263.7-158.4v-57.8l-78.9 51.5zM328.2 95L64 265.1l182.8 147.6 265.7-164.2zM64 556.9z"}}]},name:"dropbox",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="DropboxOutlined";var u=i.forwardRef(s)},44545:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="EllipsisOutlined";var u=i.forwardRef(s)},68855:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ExclamationCircleFilled";var u=i.forwardRef(s)},57119:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ExclamationCircleOutlined";var u=i.forwardRef(s)},88633:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="EyeInvisibleOutlined";var u=i.forwardRef(s)},95357:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="EyeOutlined";var u=i.forwardRef(s)},79728:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-32 736H663.9V602.2h104l15.6-120.7H663.9v-77.1c0-35 9.7-58.8 59.8-58.8h63.9v-108c-11.1-1.5-49-4.8-93.2-4.8-92.2 0-155.3 56.3-155.3 159.6v89H434.9v120.7h104.3V848H176V176h672v672z"}}]},name:"facebook",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="FacebookOutlined";var u=i.forwardRef(s)},53587:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="FileImageOutlined";var u=i.forwardRef(s)},20406:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:function(t,e){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:e}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="FileTwoTone";var u=i.forwardRef(s)},90894:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M834.1 469.2A347.49 347.49 0 00751.2 354l-29.1-26.7a8.09 8.09 0 00-13 3.3l-13 37.3c-8.1 23.4-23 47.3-44.1 70.8-1.4 1.5-3 1.9-4.1 2-1.1.1-2.8-.1-4.3-1.5-1.4-1.2-2.1-3-2-4.8 3.7-60.2-14.3-128.1-53.7-202C555.3 171 510 123.1 453.4 89.7l-41.3-24.3c-5.4-3.2-12.3 1-12 7.3l2.2 48c1.5 32.8-2.3 61.8-11.3 85.9-11 29.5-26.8 56.9-47 81.5a295.64 295.64 0 01-47.5 46.1 352.6 352.6 0 00-100.3 121.5A347.75 347.75 0 00160 610c0 47.2 9.3 92.9 27.7 136a349.4 349.4 0 0075.5 110.9c32.4 32 70 57.2 111.9 74.7C418.5 949.8 464.5 959 512 959s93.5-9.2 136.9-27.3A348.6 348.6 0 00760.8 857c32.4-32 57.8-69.4 75.5-110.9a344.2 344.2 0 0027.7-136c0-48.8-10-96.2-29.9-140.9zM713 808.5c-53.7 53.2-125 82.4-201 82.4s-147.3-29.2-201-82.4c-53.5-53.1-83-123.5-83-198.4 0-43.5 9.8-85.2 29.1-124 18.8-37.9 46.8-71.8 80.8-97.9a349.6 349.6 0 0058.6-56.8c25-30.5 44.6-64.5 58.2-101a240 240 0 0012.1-46.5c24.1 22.2 44.3 49 61.2 80.4 33.4 62.6 48.8 118.3 45.8 165.7a74.01 74.01 0 0024.4 59.8 73.36 73.36 0 0053.4 18.8c19.7-1 37.8-9.7 51-24.4 13.3-14.9 24.8-30.1 34.4-45.6 14 17.9 25.7 37.4 35 58.4 15.9 35.8 24 73.9 24 113.1 0 74.9-29.5 145.4-83 198.4z"}}]},name:"fire",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="FireOutlined";var u=i.forwardRef(s)},88528:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M484 443.1V528h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H484v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V584h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H540v-84.9c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1zm396-144.7H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder-add",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="FolderAddOutlined";var u=i.forwardRef(s)},93483:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 .6.1 1.3.2 1.9A83.99 83.99 0 00457 960c46.4 0 84-37.6 84-84 0-2.1-.1-4.1-.2-6.1.1-.6.2-1.2.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z"}}]},name:"format-painter",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="FormatPainterOutlined";var u=i.forwardRef(s)},56931:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 310H732.4c13.6-21.4 21.6-46.8 21.6-74 0-76.1-61.9-138-138-138-41.4 0-78.7 18.4-104 47.4-25.3-29-62.6-47.4-104-47.4-76.1 0-138 61.9-138 138 0 27.2 7.9 52.6 21.6 74H144c-17.7 0-32 14.3-32 32v200c0 4.4 3.6 8 8 8h40v344c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V550h40c4.4 0 8-3.6 8-8V342c0-17.7-14.3-32-32-32zm-334-74c0-38.6 31.4-70 70-70s70 31.4 70 70-31.4 70-70 70h-70v-70zm-138-70c38.6 0 70 31.4 70 70v70h-70c-38.6 0-70-31.4-70-70s31.4-70 70-70zM180 482V378h298v104H180zm48 68h250v308H228V550zm568 308H546V550h250v308zm48-376H546V378h298v104z"}}]},name:"gift",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="GiftOutlined";var u=i.forwardRef(s)},78874:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="GithubOutlined";var u=i.forwardRef(s)},67753:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M913.9 552.2L805 181.4v-.1c-7.6-22.9-25.7-36.5-48.3-36.5-23.4 0-42.5 13.5-49.7 35.2l-71.4 213H388.8l-71.4-213c-7.2-21.7-26.3-35.2-49.7-35.2-23.1 0-42.5 14.8-48.4 36.6L110.5 552.2c-4.4 14.7 1.2 31.4 13.5 40.7l368.5 276.4c2.6 3.6 6.2 6.3 10.4 7.8l8.6 6.4 8.5-6.4c4.9-1.7 9-4.7 11.9-8.9l368.4-275.4c12.4-9.2 18-25.9 13.6-40.6zM751.7 193.4c1-1.8 2.9-1.9 3.5-1.9 1.1 0 2.5.3 3.4 3L818 394.3H684.5l67.2-200.9zm-487.4 1c.9-2.6 2.3-2.9 3.4-2.9 2.7 0 2.9.1 3.4 1.7l67.3 201.2H206.5l57.8-200zM158.8 558.7l28.2-97.3 202.4 270.2-230.6-172.9zm73.9-116.4h122.1l90.8 284.3-212.9-284.3zM512.9 776L405.7 442.3H620L512.9 776zm157.9-333.7h119.5L580 723.1l90.8-280.8zm-40.7 293.9l207.3-276.7 29.5 99.2-236.8 177.5z"}}]},name:"gitlab",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="GitlabOutlined";var u=i.forwardRef(s)},11013:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M881 442.4H519.7v148.5h206.4c-8.9 48-35.9 88.6-76.6 115.8-34.4 23-78.3 36.6-129.9 36.6-99.9 0-184.4-67.5-214.6-158.2-7.6-23-12-47.6-12-72.9s4.4-49.9 12-72.9c30.3-90.6 114.8-158.1 214.7-158.1 56.3 0 106.8 19.4 146.6 57.4l110-110.1c-66.5-62-153.2-100-256.6-100-149.9 0-279.6 86-342.7 211.4-26 51.8-40.8 110.4-40.8 172.4S151 632.8 177 684.6C240.1 810 369.8 896 519.7 896c103.6 0 190.4-34.4 253.8-93 72.5-66.8 114.4-165.2 114.4-282.1 0-27.2-2.4-53.3-6.9-78.5z"}}]},name:"google",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="GoogleOutlined";var u=i.forwardRef(s)},93017:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M879.5 470.4c-.3-27-.4-54.2-.5-81.3h-80.8c-.3 27-.5 54.1-.7 81.3-27.2.1-54.2.3-81.2.6v80.9c27 .3 54.2.5 81.2.8.3 27 .3 54.1.5 81.1h80.9c.1-27 .3-54.1.5-81.3 27.2-.3 54.2-.4 81.2-.7v-80.9c-26.9-.2-54.1-.2-81.1-.5zm-530 .4c-.1 32.3 0 64.7.1 97 54.2 1.8 108.5 1 162.7 1.8-23.9 120.3-187.4 159.3-273.9 80.7-89-68.9-84.8-220 7.7-284 64.7-51.6 156.6-38.9 221.3 5.8 25.4-23.5 49.2-48.7 72.1-74.7-53.8-42.9-119.8-73.5-190-70.3-146.6-4.9-281.3 123.5-283.7 270.2-9.4 119.9 69.4 237.4 180.6 279.8 110.8 42.7 252.9 13.6 323.7-86 46.7-62.9 56.8-143.9 51.3-220-90.7-.7-181.3-.6-271.9-.3z"}}]},name:"google-plus",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="GooglePlusOutlined";var u=i.forwardRef(s)},5698:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M145 96l66 746.6L511.8 928l299.6-85.4L878.7 96H145zm610.9 700.6l-244.1 69.6-245.2-69.6-56.7-641.2h603.8l-57.8 641.2zM281 249l1.7 24.3 22.7 253.5h206.5v-.1h112.9l-11.4 118.5L511 672.9v.2h-.8l-102.4-27.7-6.5-73.2h-91l11.3 144.7 188.6 52h1.7v-.4l187.7-51.7 1.7-16.3 21.2-242.2 3.2-24.3H511v.2H389.9l-8.2-94.2h352.1l1.7-19.5 4.8-47.2L742 249H511z"}}]},name:"html5",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="Html5Outlined";var u=i.forwardRef(s)},4333:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M852.6 367.6c16.3-36.9 32.1-90.7 32.1-131.8 0-109.1-119.5-147.6-314.5-57.9-161.4-10.8-316.8 110.5-355.6 279.7 46.3-52.3 117.4-123.4 183-151.7C316.1 378.3 246.7 470 194 565.6c-31.1 56.9-66 148.8-66 217.5 0 147.9 139.3 129.8 270.4 63 47.1 23.1 99.8 23.4 152.5 23.4 145.7 0 276.4-81.4 325.2-219H694.9c-78.8 132.9-295.2 79.5-295.2-71.2h493.2c9.6-65.4-2.5-143.6-40.3-211.7zM224.8 648.3c26.6 76.7 80.6 143.8 150.4 185-133.1 73.4-259.9 43.6-150.4-185zm174-163.3c3-82.7 75.4-142.3 156-142.3 80.1 0 153 59.6 156 142.3h-312zm276.8-281.4c32.1-15.4 72.8-33 108.8-33 47.1 0 81.4 32.6 81.4 80.6 0 30-11.1 73.5-21.9 101.8-39.3-63.5-98.9-122.4-168.3-149.4z"}}]},name:"ie",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="IeOutlined";var u=i.forwardRef(s)},40847:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="InfoCircleFilled";var u=i.forwardRef(s)},68628:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="InfoCircleOutlined";var u=i.forwardRef(s)},67724:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="LeftOutlined";var u=i.forwardRef(s)},3682:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="LineChartOutlined";var u=i.forwardRef(s)},98261:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 10-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"}}]},name:"linkedin",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="LinkedinOutlined";var u=i.forwardRef(s)},7085:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="LoadingOutlined";var u=i.forwardRef(s)},26223:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M834.7 279.8l61.3-58.9V208H683.7L532.4 586.4 360.3 208H137.7v12.9l71.6 86.6c7 6.4 10.6 15.8 9.7 25.2V673c2.2 12.3-1.7 24.8-10.3 33.7L128 805v12.7h228.6v-12.9l-80.6-98a39.99 39.99 0 01-11.1-33.7V378.7l200.7 439.2h23.3l172.6-439.2v349.9c0 9.2 0 11.1-6 17.2l-62.1 60.3V819h301.2v-12.9l-59.9-58.9c-5.2-4-7.9-10.7-6.8-17.2V297a18.1 18.1 0 016.8-17.2z"}}]},name:"medium",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="MediumOutlined";var u=i.forwardRef(s)},76629:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="MenuFoldOutlined";var u=i.forwardRef(s)},1351:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="MenuUnfoldOutlined";var u=i.forwardRef(s)},31290:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"}}]},name:"merge-cells",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="MergeCellsOutlined";var u=i.forwardRef(s)},92977:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="MoreOutlined";var u=i.forwardRef(s)},74962:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="PaperClipOutlined";var u=i.forwardRef(s)},4810:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:function(t,e){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:e}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:e}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:e}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="PictureTwoTone";var u=i.forwardRef(s)},29934:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="PlayCircleOutlined";var u=i.forwardRef(s)},55017:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.8 613.2c-16-51.4-34.4-94.6-62.7-165.3C766.5 262.2 689.3 112 511.5 112 331.7 112 256.2 265.2 261 447.9c-28.4 70.8-46.7 113.7-62.7 165.3-34 109.5-23 154.8-14.6 155.8 18 2.2 70.1-82.4 70.1-82.4 0 49 25.2 112.9 79.8 159-26.4 8.1-85.7 29.9-71.6 53.8 11.4 19.3 196.2 12.3 249.5 6.3 53.3 6 238.1 13 249.5-6.3 14.1-23.8-45.3-45.7-71.6-53.8 54.6-46.2 79.8-110.1 79.8-159 0 0 52.1 84.6 70.1 82.4 8.5-1.1 19.5-46.4-14.5-155.8z"}}]},name:"qq",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="QqOutlined";var u=i.forwardRef(s)},8812:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="RightOutlined";var u=i.forwardRef(s)},50161:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z"}}]},name:"rocket",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="RocketOutlined";var u=i.forwardRef(s)},17582:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z"}},{tag:"path",attrs:{d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z"}}]},name:"rotate-left",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="RotateLeftOutlined";var u=i.forwardRef(s)},76570:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="SearchOutlined";var u=i.forwardRef(s)},24616:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="SettingOutlined";var u=i.forwardRef(s)},77093:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M883.7 578.6c4.1-22.5 6.3-45.5 6.3-68.5 0-51-10-100.5-29.7-147-19-45-46.3-85.4-81-120.1a375.79 375.79 0 00-120.1-80.9c-46.6-19.7-96-29.7-147-29.7-24 0-48.1 2.3-71.5 6.8A225.1 225.1 0 00335.6 113c-59.7 0-115.9 23.3-158.1 65.5A222.25 222.25 0 00112 336.6c0 38 9.8 75.4 28.1 108.4-3.7 21.4-5.7 43.3-5.7 65.1 0 51 10 100.5 29.7 147 19 45 46.2 85.4 80.9 120.1 34.7 34.7 75.1 61.9 120.1 80.9 46.6 19.7 96 29.7 147 29.7 22.2 0 44.4-2 66.2-5.9 33.5 18.9 71.3 29 110 29 59.7 0 115.9-23.2 158.1-65.5 42.3-42.2 65.5-98.4 65.5-158.1.1-38-9.7-75.5-28.2-108.7zm-88.1 216C766.9 823.4 729 839 688.4 839c-26.1 0-51.8-6.8-74.6-19.7l-22.5-12.7-25.5 4.5c-17.8 3.2-35.8 4.8-53.6 4.8-41.4 0-81.3-8.1-119.1-24.1-36.3-15.3-69-37.3-97.2-65.5a304.29 304.29 0 01-65.5-97.1c-16-37.7-24-77.6-24-119 0-17.4 1.6-35.2 4.6-52.8l4.4-25.1L203 410a151.02 151.02 0 01-19.1-73.4c0-40.6 15.7-78.5 44.4-107.2C257.1 200.7 295 185 335.6 185a153 153 0 0171.4 17.9l22.4 11.8 24.8-4.8c18.9-3.6 38.4-5.5 58-5.5 41.4 0 81.3 8.1 119 24 36.5 15.4 69.1 37.4 97.2 65.5 28.2 28.1 50.2 60.8 65.6 97.2 16 37.7 24 77.6 24 119 0 18.4-1.7 37-5.1 55.5l-4.7 25.5 12.6 22.6c12.6 22.5 19.2 48 19.2 73.7 0 40.7-15.7 78.5-44.4 107.2zM583.4 466.2L495 446.6c-33.6-7.7-72.3-17.8-72.3-49.5s27.1-53.9 76.1-53.9c98.7 0 89.7 67.8 138.7 67.8 25.8 0 48.4-15.2 48.4-41.2 0-60.8-97.4-106.5-180-106.5-89.7 0-185.2 38.1-185.2 139.5 0 48.8 17.4 100.8 113.6 124.9l119.4 29.8c36.1 8.9 45.2 29.2 45.2 47.6 0 30.5-30.3 60.3-85.2 60.3-107.2 0-92.3-82.5-149.7-82.5-25.8 0-44.5 17.8-44.5 43.1 0 49.4 60 115.4 194.2 115.4 127.7 0 191-61.5 191-144 0-53.1-24.5-109.6-121.3-131.2z"}}]},name:"skype",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="SkypeOutlined";var u=i.forwardRef(s)},6355:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M409.4 128c-42.4 0-76.7 34.4-76.7 76.8 0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5h76.7v-76.8c0-42.3-34.3-76.7-76.7-76.8zm0 204.8H204.7c-42.4 0-76.7 34.4-76.7 76.8s34.4 76.8 76.7 76.8h204.6c42.4 0 76.7-34.4 76.7-76.8.1-42.4-34.3-76.8-76.6-76.8zM614 486.4c42.4 0 76.8-34.4 76.7-76.8V204.8c0-42.4-34.3-76.8-76.7-76.8-42.4 0-76.7 34.4-76.7 76.8v204.8c0 42.5 34.3 76.8 76.7 76.8zm281.4-76.8c0-42.4-34.4-76.8-76.7-76.8S742 367.2 742 409.6v76.8h76.7c42.3 0 76.7-34.4 76.7-76.8zm-76.8 128H614c-42.4 0-76.7 34.4-76.7 76.8 0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5h204.6c42.4 0 76.7-34.4 76.7-76.8.1-42.4-34.3-76.7-76.7-76.8zM614 742.4h-76.7v76.8c0 42.4 34.4 76.8 76.7 76.8 42.4 0 76.8-34.4 76.7-76.8.1-42.4-34.3-76.7-76.7-76.8zM409.4 537.6c-42.4 0-76.7 34.4-76.7 76.8v204.8c0 42.4 34.4 76.8 76.7 76.8 42.4 0 76.8-34.4 76.7-76.8V614.4c0-20.3-8.1-39.9-22.4-54.3a76.92 76.92 0 00-54.3-22.5zM128 614.4c0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5c42.4 0 76.8-34.4 76.7-76.8v-76.8h-76.7c-42.3 0-76.7 34.4-76.7 76.8z"}}]},name:"slack",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="SlackOutlined";var u=i.forwardRef(s)},892:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zM529 311.4c0-27.8 22.5-50.4 50.3-50.4 27.8 0 50.3 22.6 50.3 50.4v134.4c0 27.8-22.5 50.4-50.3 50.4-27.8 0-50.3-22.6-50.3-50.4V311.4zM361.5 580.2c0 27.8-22.5 50.4-50.3 50.4a50.35 50.35 0 01-50.3-50.4c0-27.8 22.5-50.4 50.3-50.4h50.3v50.4zm134 134.4c0 27.8-22.5 50.4-50.3 50.4-27.8 0-50.3-22.6-50.3-50.4V580.2c0-27.8 22.5-50.4 50.3-50.4a50.35 50.35 0 0150.3 50.4v134.4zm-50.2-218.4h-134c-27.8 0-50.3-22.6-50.3-50.4 0-27.8 22.5-50.4 50.3-50.4h134c27.8 0 50.3 22.6 50.3 50.4-.1 27.9-22.6 50.4-50.3 50.4zm0-134.4c-13.3 0-26.1-5.3-35.6-14.8S395 324.8 395 311.4c0-27.8 22.5-50.4 50.3-50.4 27.8 0 50.3 22.6 50.3 50.4v50.4h-50.3zm134 403.2c-27.8 0-50.3-22.6-50.3-50.4v-50.4h50.3c27.8 0 50.3 22.6 50.3 50.4 0 27.8-22.5 50.4-50.3 50.4zm134-134.4h-134a50.35 50.35 0 01-50.3-50.4c0-27.8 22.5-50.4 50.3-50.4h134c27.8 0 50.3 22.6 50.3 50.4 0 27.8-22.5 50.4-50.3 50.4zm0-134.4H663v-50.4c0-27.8 22.5-50.4 50.3-50.4s50.3 22.6 50.3 50.4c0 27.8-22.5 50.4-50.3 50.4z"}}]},name:"slack-square",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="SlackSquareOutlined";var u=i.forwardRef(s)},35688:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M938.2 508.4L787.3 389c-3-2.4-7.3-.2-7.3 3.6V478H636V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H596c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H636V546h144v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM428 116H144c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H244v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h144v294H184V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"}}]},name:"split-cells",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="SplitCellsOutlined";var u=i.forwardRef(s)},48107:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zM315.7 291.5c27.3 0 49.5 22.1 49.5 49.4s-22.1 49.4-49.5 49.4a49.4 49.4 0 110-98.8zM366.9 578c-13.6 42.3-10.2 26.7-64.4 144.5l-78.5-49s87.7-79.8 105.6-116.2c19.2-38.4-21.1-58.9-21.1-58.9l-60.2-37.5 32.7-50.2c45.4 33.7 48.7 36.6 79.2 67.2 23.8 23.9 20.7 56.8 6.7 100.1zm427.2 55c-15.3 143.8-202.4 90.3-202.4 90.3l10.2-41.1 43.3 9.3c80 5 72.3-64.9 72.3-64.9V423c.6-77.3-72.6-85.4-204.2-38.3l30.6 8.3c-2.5 9-12.5 23.2-25.2 38.6h176v35.6h-99.1v44.5h98.7v35.7h-98.7V622c14.9-4.8 28.6-11.5 40.5-20.5l-8.7-32.5 46.5-14.4 38.8 94.9-57.3 23.9-10.2-37.8c-25.6 19.5-78.8 48-171.8 45.4-99.2 2.6-73.7-112-73.7-112l2.5-1.3H472c-.5 14.7-6.6 38.7 1.7 51.8 6.8 10.8 24.2 12.6 35.3 13.1 1.3.1 2.6.1 3.9.1v-85.3h-101v-35.7h101v-44.5H487c-22.7 24.1-43.5 44.1-43.5 44.1l-30.6-26.7c21.7-22.9 43.3-59.1 56.8-83.2-10.9 4.4-22 9.2-33.6 14.2-11.2 14.3-24.2 29-38.7 43.5.5.8-50-28.4-50-28.4 52.2-44.4 81.4-139.9 81.4-139.9l72.5 20.4s-5.9 14-18.4 35.6c290.3-82.3 307.4 50.5 307.4 50.5s19.1 91.8 3.8 235.7z"}}]},name:"taobao-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="TaobaoCircleOutlined";var u=i.forwardRef(s)},98522:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168.5 273.7a68.7 68.7 0 10137.4 0 68.7 68.7 0 10-137.4 0zm730 79.2s-23.7-184.4-426.9-70.1c17.3-30 25.6-49.5 25.6-49.5L396.4 205s-40.6 132.6-113 194.4c0 0 70.1 40.6 69.4 39.4 20.1-20.1 38.2-40.6 53.7-60.4 16.1-7 31.5-13.6 46.7-19.8-18.6 33.5-48.7 83.8-78.8 115.6l42.4 37s28.8-27.7 60.4-61.2h36v61.8H372.9v49.5h140.3v118.5c-1.7 0-3.6 0-5.4-.2-15.4-.7-39.5-3.3-49-18.2-11.5-18.1-3-51.5-2.4-71.9h-97l-3.4 1.8s-35.5 159.1 102.3 155.5c129.1 3.6 203-36 238.6-63.1l14.2 52.6 79.6-33.2-53.9-131.9-64.6 20.1 12.1 45.2c-16.6 12.4-35.6 21.7-56.2 28.4V561.3h137.1v-49.5H628.1V450h137.6v-49.5H521.3c17.6-21.4 31.5-41.1 35-53.6l-42.5-11.6c182.8-65.5 284.5-54.2 283.6 53.2v282.8s10.8 97.1-100.4 90.1l-60.2-12.9-14.2 57.1S882.5 880 903.7 680.2c21.3-200-5.2-327.3-5.2-327.3zm-707.4 18.3l-45.4 69.7 83.6 52.1s56 28.5 29.4 81.9C233.8 625.5 112 736.3 112 736.3l109 68.1c75.4-163.7 70.5-142 89.5-200.7 19.5-60.1 23.7-105.9-9.4-139.1-42.4-42.6-47-46.6-110-93.4z"}}]},name:"taobao",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="TaobaoOutlined";var u=i.forwardRef(s)},51984:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 160h-92v-40c0-4.4-3.6-8-8-8H256c-4.4 0-8 3.6-8 8v40h-92a44 44 0 00-44 44v148c0 81.7 60 149.6 138.2 162C265.7 630.2 359 721.7 476 734.5v105.2H280c-17.7 0-32 14.3-32 32V904c0 4.4 3.6 8 8 8h512c4.4 0 8-3.6 8-8v-32.3c0-17.7-14.3-32-32-32H548V734.5C665 721.7 758.3 630.2 773.8 514 852 501.6 912 433.7 912 352V204a44 44 0 00-44-44zM184 352V232h64v207.6a91.99 91.99 0 01-64-87.6zm520 128c0 49.1-19.1 95.4-53.9 130.1-34.8 34.8-81 53.9-130.1 53.9h-16c-49.1 0-95.4-19.1-130.1-53.9-34.8-34.8-53.9-81-53.9-130.1V184h384v296zm136-128c0 41-26.9 75.8-64 87.6V232h64v120z"}}]},name:"trophy",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="TrophyOutlined";var u=i.forwardRef(s)},75013:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0075-94 336.64 336.64 0 01-108.2 41.2A170.1 170.1 0 00672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 00-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 01-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 01-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"}}]},name:"twitter",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="TwitterOutlined";var u=i.forwardRef(s)},58491:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="UpOutlined";var u=i.forwardRef(s)},22608:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M368 724H252V608c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v116H72c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h116v116c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V788h116c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v352h72V232h576v560H448v72h272c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM888 625l-104-59.8V458.9L888 399v226z"}},{tag:"path",attrs:{d:"M320 360c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h112z"}}]},name:"video-camera-add",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="VideoCameraAddOutlined";var u=i.forwardRef(s)},14294:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M690.1 377.4c5.9 0 11.8.2 17.6.5-24.4-128.7-158.3-227.1-319.9-227.1C209 150.8 64 271.4 64 420.2c0 81.1 43.6 154.2 111.9 203.6a21.5 21.5 0 019.1 17.6c0 2.4-.5 4.6-1.1 6.9-5.5 20.3-14.2 52.8-14.6 54.3-.7 2.6-1.7 5.2-1.7 7.9 0 5.9 4.8 10.8 10.8 10.8 2.3 0 4.2-.9 6.2-2l70.9-40.9c5.3-3.1 11-5 17.2-5 3.2 0 6.4.5 9.5 1.4 33.1 9.5 68.8 14.8 105.7 14.8 6 0 11.9-.1 17.8-.4-7.1-21-10.9-43.1-10.9-66 0-135.8 132.2-245.8 295.3-245.8zm-194.3-86.5c23.8 0 43.2 19.3 43.2 43.1s-19.3 43.1-43.2 43.1c-23.8 0-43.2-19.3-43.2-43.1s19.4-43.1 43.2-43.1zm-215.9 86.2c-23.8 0-43.2-19.3-43.2-43.1s19.3-43.1 43.2-43.1 43.2 19.3 43.2 43.1-19.4 43.1-43.2 43.1zm586.8 415.6c56.9-41.2 93.2-102 93.2-169.7 0-124-120.8-224.5-269.9-224.5-149 0-269.9 100.5-269.9 224.5S540.9 847.5 690 847.5c30.8 0 60.6-4.4 88.1-12.3 2.6-.8 5.2-1.2 7.9-1.2 5.2 0 9.9 1.6 14.3 4.1l59.1 34c1.7 1 3.3 1.7 5.2 1.7a9 9 0 006.4-2.6 9 9 0 002.6-6.4c0-2.2-.9-4.4-1.4-6.6-.3-1.2-7.6-28.3-12.2-45.3-.5-1.9-.9-3.8-.9-5.7.1-5.9 3.1-11.2 7.6-14.5zM600.2 587.2c-19.9 0-36-16.1-36-35.9 0-19.8 16.1-35.9 36-35.9s36 16.1 36 35.9c0 19.8-16.2 35.9-36 35.9zm179.9 0c-19.9 0-36-16.1-36-35.9 0-19.8 16.1-35.9 36-35.9s36 16.1 36 35.9a36.08 36.08 0 01-36 35.9z"}}]},name:"wechat",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="WechatOutlined";var u=i.forwardRef(s)},39464:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-44.4 672C353.1 736 236 680.4 236 588.9c0-47.8 30.2-103.1 82.3-155.3 69.5-69.6 150.6-101.4 181.1-70.8 13.5 13.5 14.8 36.8 6.1 64.6-4.5 14 13.1 6.3 13.1 6.3 56.2-23.6 105.2-25 123.1.7 9.6 13.7 8.6 32.8-.2 55.1-4.1 10.2 1.3 11.8 9 14.1 31.7 9.8 66.9 33.6 66.9 75.5.2 69.5-99.7 156.9-249.8 156.9zm207.3-290.8a34.9 34.9 0 00-7.2-34.1 34.68 34.68 0 00-33.1-10.7 18.24 18.24 0 01-7.6-35.7c24.1-5.1 50.1 2.3 67.7 21.9 17.7 19.6 22.4 46.3 14.9 69.8a18.13 18.13 0 01-22.9 11.7 18.18 18.18 0 01-11.8-22.9zm106 34.3s0 .1 0 0a21.1 21.1 0 01-26.6 13.7 21.19 21.19 0 01-13.6-26.7c11-34.2 4-73.2-21.7-101.8a104.04 104.04 0 00-98.9-32.1 21.14 21.14 0 01-25.1-16.3 21.07 21.07 0 0116.2-25.1c49.4-10.5 102.8 4.8 139.1 45.1 36.3 40.2 46.1 95.1 30.6 143.2zm-334.5 6.1c-91.4 9-160.7 65.1-154.7 125.2 5.9 60.1 84.8 101.5 176.2 92.5 91.4-9.1 160.7-65.1 154.7-125.3-5.9-60.1-84.8-101.5-176.2-92.4zm80.2 141.7c-18.7 42.3-72.3 64.8-117.8 50.1-43.9-14.2-62.5-57.7-43.3-96.8 18.9-38.4 68-60.1 111.5-48.8 45 11.7 68 54.2 49.6 95.5zm-93-32.2c-14.2-5.9-32.4.2-41.2 13.9-8.8 13.8-4.7 30.2 9.3 36.6 14.3 6.5 33.2.3 42-13.8 8.8-14.3 4.2-30.6-10.1-36.7zm34.9-14.5c-5.4-2.2-12.2.5-15.4 5.8-3.1 5.4-1.4 11.5 4.1 13.8 5.5 2.3 12.6-.3 15.8-5.8 3-5.6 1-11.8-4.5-13.8z"}}]},name:"weibo-circle",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="WeiboCircleOutlined";var u=i.forwardRef(s)},97998:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M457.3 543c-68.1-17.7-145 16.2-174.6 76.2-30.1 61.2-1 129.1 67.8 151.3 71.2 23 155.2-12.2 184.4-78.3 28.7-64.6-7.2-131-77.6-149.2zm-52 156.2c-13.8 22.1-43.5 31.7-65.8 21.6-22-10-28.5-35.7-14.6-57.2 13.7-21.4 42.3-31 64.4-21.7 22.4 9.5 29.6 35 16 57.3zm45.5-58.5c-5 8.6-16.1 12.7-24.7 9.1-8.5-3.5-11.2-13.1-6.4-21.5 5-8.4 15.6-12.4 24.1-9.1 8.7 3.2 11.8 12.9 7 21.5zm334.5-197.2c15 4.8 31-3.4 35.9-18.3 11.8-36.6 4.4-78.4-23.2-109a111.39 111.39 0 00-106-34.3 28.45 28.45 0 00-21.9 33.8 28.39 28.39 0 0033.8 21.8c18.4-3.9 38.3 1.8 51.9 16.7a54.2 54.2 0 0111.3 53.3 28.45 28.45 0 0018.2 36zm99.8-206c-56.7-62.9-140.4-86.9-217.7-70.5a32.98 32.98 0 00-25.4 39.3 33.12 33.12 0 0039.3 25.5c55-11.7 114.4 5.4 154.8 50.1 40.3 44.7 51.2 105.7 34 159.1-5.6 17.4 3.9 36 21.3 41.7 17.4 5.6 36-3.9 41.6-21.2v-.1c24.1-75.4 8.9-161.1-47.9-223.9zM729 499c-12.2-3.6-20.5-6.1-14.1-22.1 13.8-34.7 15.2-64.7.3-86-28-40.1-104.8-37.9-192.8-1.1 0 0-27.6 12.1-20.6-9.8 13.5-43.5 11.5-79.9-9.6-101-47.7-47.8-174.6 1.8-283.5 110.6C127.3 471.1 80 557.5 80 632.2 80 775.1 263.2 862 442.5 862c235 0 391.3-136.5 391.3-245 0-65.5-55.2-102.6-104.8-118zM443 810.8c-143 14.1-266.5-50.5-275.8-144.5-9.3-93.9 99.2-181.5 242.2-195.6 143-14.2 266.5 50.5 275.8 144.4C694.4 709 586 796.6 443 810.8z"}}]},name:"weibo",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="WeiboOutlined";var u=i.forwardRef(s)},98059:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M433.6 595.1c-14.2-5.9-32.4.2-41.2 13.9-8.8 13.8-4.7 30.2 9.3 36.6 14.3 6.5 33.2.3 42-13.8 8.8-14.3 4.2-30.6-10.1-36.7zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zM467.6 736C353.1 736 236 680.4 236 588.9c0-47.8 30.2-103.1 82.3-155.3 69.5-69.6 150.6-101.4 181.1-70.8 13.5 13.5 14.8 36.8 6.1 64.6-4.5 14 13.1 6.3 13.1 6.3 56.2-23.6 105.2-25 123.1.7 9.6 13.7 8.6 32.8-.2 55.1-4.1 10.2 1.3 11.8 9 14.1 31.7 9.8 66.9 33.6 66.9 75.5.2 69.5-99.7 156.9-249.8 156.9zm207.3-290.8a34.9 34.9 0 00-7.2-34.1 34.68 34.68 0 00-33.1-10.7 18.24 18.24 0 01-7.6-35.7c24.1-5.1 50.1 2.3 67.7 21.9 17.7 19.6 22.4 46.3 14.9 69.8a18.13 18.13 0 01-22.9 11.7 18.18 18.18 0 01-11.8-22.9zm106 34.3s0 .1 0 0a21.1 21.1 0 01-26.6 13.7 21.19 21.19 0 01-13.6-26.7c11-34.2 4-73.2-21.7-101.8a104.04 104.04 0 00-98.9-32.1 21.14 21.14 0 01-25.1-16.3 21.07 21.07 0 0116.2-25.1c49.4-10.5 102.8 4.8 139.1 45.1 36.3 40.2 46.1 95.1 30.6 143.2zm-334.5 6.1c-91.4 9-160.7 65.1-154.7 125.2 5.9 60.1 84.8 101.5 176.2 92.5 91.4-9.1 160.7-65.1 154.7-125.3-5.9-60.1-84.8-101.5-176.2-92.4zm80.2 141.7c-18.7 42.3-72.3 64.8-117.8 50.1-43.9-14.2-62.5-57.7-43.3-96.8 18.9-38.4 68-60.1 111.5-48.8 45 11.7 68 54.2 49.6 95.5zm-58.1-46.7c-5.4-2.2-12.2.5-15.4 5.8-3.1 5.4-1.4 11.5 4.1 13.8 5.5 2.3 12.6-.3 15.8-5.8 3-5.6 1-11.8-4.5-13.8z"}}]},name:"weibo-square",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="WeiboSquareOutlined";var u=i.forwardRef(s)},24406:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M120.1 770.6L443 823.2V543.8H120.1v226.8zm63.4-163.5h196.2v141.6l-196.2-31.9V607.1zm340.3 226.5l382 62.2v-352h-382v289.8zm63.4-226.5h255.3v214.4l-255.3-41.6V607.1zm-63.4-415.7v288.8h382V128.1l-382 63.3zm318.7 225.5H587.3V245l255.3-42.3v214.2zm-722.4 63.3H443V201.9l-322.9 53.5v224.8zM183.5 309l196.2-32.5v140.4H183.5V309z"}}]},name:"windows",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="WindowsOutlined";var u=i.forwardRef(s)},18152:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M960 509.2c0-2.2 0-4.7-.1-7.6-.1-8.1-.3-17.2-.5-26.9-.8-27.9-2.2-55.7-4.4-81.9-3-36.1-7.4-66.2-13.4-88.8a139.52 139.52 0 00-98.3-98.5c-28.3-7.6-83.7-12.3-161.7-15.2-37.1-1.4-76.8-2.3-116.5-2.8-13.9-.2-26.8-.3-38.4-.4h-29.4c-11.6.1-24.5.2-38.4.4-39.7.5-79.4 1.4-116.5 2.8-78 3-133.5 7.7-161.7 15.2A139.35 139.35 0 0082.4 304C76.3 326.6 72 356.7 69 392.8c-2.2 26.2-3.6 54-4.4 81.9-.3 9.7-.4 18.8-.5 26.9 0 2.9-.1 5.4-.1 7.6v5.6c0 2.2 0 4.7.1 7.6.1 8.1.3 17.2.5 26.9.8 27.9 2.2 55.7 4.4 81.9 3 36.1 7.4 66.2 13.4 88.8 12.8 47.9 50.4 85.7 98.3 98.5 28.2 7.6 83.7 12.3 161.7 15.2 37.1 1.4 76.8 2.3 116.5 2.8 13.9.2 26.8.3 38.4.4h29.4c11.6-.1 24.5-.2 38.4-.4 39.7-.5 79.4-1.4 116.5-2.8 78-3 133.5-7.7 161.7-15.2 47.9-12.8 85.5-50.5 98.3-98.5 6.1-22.6 10.4-52.7 13.4-88.8 2.2-26.2 3.6-54 4.4-81.9.3-9.7.4-18.8.5-26.9 0-2.9.1-5.4.1-7.6v-5.6zm-72 5.2c0 2.1 0 4.4-.1 7.1-.1 7.8-.3 16.4-.5 25.7-.7 26.6-2.1 53.2-4.2 77.9-2.7 32.2-6.5 58.6-11.2 76.3-6.2 23.1-24.4 41.4-47.4 47.5-21 5.6-73.9 10.1-145.8 12.8-36.4 1.4-75.6 2.3-114.7 2.8-13.7.2-26.4.3-37.8.3h-28.6l-37.8-.3c-39.1-.5-78.2-1.4-114.7-2.8-71.9-2.8-124.9-7.2-145.8-12.8-23-6.2-41.2-24.4-47.4-47.5-4.7-17.7-8.5-44.1-11.2-76.3-2.1-24.7-3.4-51.3-4.2-77.9-.3-9.3-.4-18-.5-25.7 0-2.7-.1-5.1-.1-7.1v-4.8c0-2.1 0-4.4.1-7.1.1-7.8.3-16.4.5-25.7.7-26.6 2.1-53.2 4.2-77.9 2.7-32.2 6.5-58.6 11.2-76.3 6.2-23.1 24.4-41.4 47.4-47.5 21-5.6 73.9-10.1 145.8-12.8 36.4-1.4 75.6-2.3 114.7-2.8 13.7-.2 26.4-.3 37.8-.3h28.6l37.8.3c39.1.5 78.2 1.4 114.7 2.8 71.9 2.8 124.9 7.2 145.8 12.8 23 6.2 41.2 24.4 47.4 47.5 4.7 17.7 8.5 44.1 11.2 76.3 2.1 24.7 3.4 51.3 4.2 77.9.3 9.3.4 18 .5 25.7 0 2.7.1 5.1.1 7.1v4.8zM423 646l232-135-232-133z"}}]},name:"youtube",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="YoutubeOutlined";var u=i.forwardRef(s)},20720:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M564.7 230.1V803h60l25.2 71.4L756.3 803h131.5V230.1H564.7zm247.7 497h-59.9l-75.1 50.4-17.8-50.4h-18V308.3h170.7v418.8zM526.1 486.9H393.3c2.1-44.9 4.3-104.3 6.6-172.9h130.9l-.1-8.1c0-.6-.2-14.7-2.3-29.1-2.1-15-6.6-34.9-21-34.9H287.8c4.4-20.6 15.7-69.7 29.4-93.8l6.4-11.2-12.9-.7c-.8 0-19.6-.9-41.4 10.6-35.7 19-51.7 56.4-58.7 84.4-18.4 73.1-44.6 123.9-55.7 145.6-3.3 6.4-5.3 10.2-6.2 12.8-1.8 4.9-.8 9.8 2.8 13 10.5 9.5 38.2-2.9 38.5-3 .6-.3 1.3-.6 2.2-1 13.9-6.3 55.1-25 69.8-84.5h56.7c.7 32.2 3.1 138.4 2.9 172.9h-141l-2.1 1.5c-23.1 16.9-30.5 63.2-30.8 65.2l-1.4 9.2h167c-12.3 78.3-26.5 113.4-34 127.4-3.7 7-7.3 14-10.7 20.8-21.3 42.2-43.4 85.8-126.3 153.6-3.6 2.8-7 8-4.8 13.7 2.4 6.3 9.3 9.1 24.6 9.1 5.4 0 11.8-.3 19.4-1 49.9-4.4 100.8-18 135.1-87.6 17-35.1 31.7-71.7 43.9-108.9L497 850l5-12c.8-1.9 19-46.3 5.1-95.9l-.5-1.8-108.1-123-22 16.6c6.4-26.1 10.6-49.9 12.5-71.1h158.7v-8c0-40.1-18.5-63.9-19.2-64.9l-2.4-3z"}}]},name:"zhihu",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ZhihuOutlined";var u=i.forwardRef(s)},72504:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ZoomInOutlined";var u=i.forwardRef(s)},16130:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(1413),i=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"},a=n(30076),s=function(t,e){return i.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:o}))};s.displayName="ZoomOutOutlined";var u=i.forwardRef(s)},62238:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))})),i};e.default=n},10369:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return r.GADDIAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return r.connectedComponentAsync}}),e.default=void 0,Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return r.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return r.detectCycleAsync}}),e.detectDirectedCycleAsync=void 0,Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return r.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return r.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return r.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return r.floydWarshallAsync}}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return r.getAdjMatrixAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return r.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return r.getInDegreeAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return r.getNeighborsAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return r.getOutDegreeAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return r.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return r.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return r.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return r.pageRankAsync}});var r=n(30485),i=r.detectCycleAsync;e.detectDirectedCycleAsync=i;var o={getAdjMatrixAsync:r.getAdjMatrixAsync,connectedComponentAsync:r.connectedComponentAsync,getDegreeAsync:r.getDegreeAsync,getInDegreeAsync:r.getInDegreeAsync,getOutDegreeAsync:r.getOutDegreeAsync,detectCycleAsync:r.detectCycleAsync,detectDirectedCycleAsync:i,detectAllCyclesAsync:r.detectAllCyclesAsync,detectAllDirectedCycleAsync:r.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:r.detectAllUndirectedCycleAsync,dijkstraAsync:r.dijkstraAsync,findAllPathAsync:r.findAllPathAsync,findShortestPathAsync:r.findShortestPathAsync,floydWarshallAsync:r.floydWarshallAsync,labelPropagationAsync:r.labelPropagationAsync,louvainAsync:r.louvainAsync,minimumSpanningTreeAsync:r.minimumSpanningTreeAsync,pageRankAsync:r.pageRankAsync,getNeighborsAsync:r.getNeighborsAsync,GADDIAsync:r.GADDIAsync};e.default=o},83764:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(93026))&&r.__esModule?r:{default:r},o=n(70643);var a=function(t,e,n,r){void 0===r&&(r=!0);var a=function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n),s=new i.default,u=t.edges,c=void 0===u?[]:u;s.enqueue(e);for(var l="",h=function(){var t=s.dequeue();a.enter({current:t,previous:l}),(0,o.getNeighbors)(t,c,r?"target":void 0).forEach((function(e){a.allowTraversal({previous:l,current:t,next:e})&&s.enqueue(e)})),a.leave({current:t,previous:l}),l=t};!s.isEmpty();)h()};e.default=a},59527:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return e?o(t):i(t)},e.detectStrongConnectComponents=e.detectConnectedComponents=void 0;var r=n(70643),i=function(t){for(var e=t.nodes,n=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u=[],c=function t(e){u.push(e),s[e.id]=!0;for(var i=(0,r.getNeighbors)(e.id,o),a=function(e){var r=i[e];if(!s[r]){var o=n.filter((function(t){return t.id===r}));o.length>0&&t(o[0])}},c=0;c0;)f.push(u.pop());a.push(f)}}return a};e.detectConnectedComponents=i;var o=function(t){for(var e=t.nodes,n=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u={},c={},l=[],h=0,f=function t(e){u[e.id]=h,c[e.id]=h,h+=1,a.push(e),s[e.id]=!0;for(var i=(0,r.getNeighbors)(e.id,o,"target").filter((function(t){return n.map((function(t){return t.id})).indexOf(t)>-1})),f=function(r){var o=i[r];if(u[o]||0===u[o])s[o]&&(c[e.id]=Math.min(c[e.id],u[o]));else{var a=n.filter((function(t){return t.id===o}));a.length>0&&t(a[0]),c[e.id]=Math.min(c[e.id],c[o])}},d=0;d0;){var g=a.pop();if(s[g.id]=!1,p.push(g),g===e)break}p.length>0&&l.push(p)}},d=0,p=n;d0;)for(var m=d.pop(),v=m.id,y=(0,s.getNeighbors)(v,t.edges),b=function(r){var i,a=y[r],s=t.nodes.find((function(t){return t.id===a}));if(a===v)o.push(((i={})[a]=m,i));else if(a in g){if(!g[v].has(s)){for(var u=!0,c=[s,m],l=p[v];g[a].size&&!g[a].has(l)&&(c.push(l),l!==p[l.id]);)l=p[l.id];if(c.push(l),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var h={},f=1;f-1)return h;r.push(a),i.add(a);for(var f=l[a.id],d=0;d0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(a);else for(d=0;d-1}));v-1?g[m.id].push(l[b]):u.push(((i={})[m.id]=m,i))}}return{component:p,adjList:g,minIdx:a}},b=0;b=b})),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var _=y(w),S=_.minIdx,E=_.adjList,M=_.component;if(!(M.length>1))break;M.forEach((function(t){o[t.id]=new Set}));var T=c[S];if(e&&n&&-1===e.indexOf(T.id))return u;h(T,T,E),b=S+1}return u};e.detectAllDirectedCycle=l;e.detectAllCycles=function(t,e,n,r){return void 0===r&&(r=!0),e?l(t,n,r):c(t,n,r)};var h=function(t){var e=null,n=t.nodes,r={},i={},a={},s={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var u={enter:function(t){var n=t.current,o=t.previous;if(a[n]){e={};for(var s=n,u=o;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else a[n]=n,delete i[n],r[n]=o},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var n=t.next;return!e&&!s[n]}};Object.keys(i).length;){var c=Object.keys(i)[0];(0,o.default)(t,c,u)}return e};e.default=h},45891:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r){void 0===r&&(r=!0);i(t,e,"",function(t){void 0===t&&(t={});var e=t,n=function(){},r=(i={},function(t){var e=t.next;return!i[e]&&(i[e]=!0,!0)});var i;return e.allowTraversal=t.allowTraversal||r,e.enter=t.enter||n,e.leave=t.leave||n,e}(n),r)};var r=n(70643);function i(t,e,n,o,a){void 0===a&&(a=!0),o.enter({current:e,previous:n});var s=t.edges,u=void 0===s?[]:s;(0,r.getNeighbors)(e,u,a?"target":void 0).forEach((function(r){o.allowTraversal({previous:n,current:e,next:r})&&i(t,r,e,o,a)})),o.leave({current:e,previous:n})}},78089:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(59682),i=n(49242),o=n(70643),a=function(t,e,n,r){var i=t.nodes,a=void 0===i?[]:i,u=t.edges,c=void 0===u?[]:u,l=[],h={},f={},d={};a.forEach((function(t,n){var r=t.id;l.push(r),f[r]=1/0,r===e&&(f[r]=0)}));for(var p=a.length,g=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;of[e.id]+s?(f[a]=f[e.id]+s,d[a]=[e.id]):f[a]===f[e.id]+s&&d[a].push(e.id)}))},m=0;m0&&l.length>0;){var d=l[l.length-1];if(d.length){var p=d.shift();if(p&&(u.push(p),c[p]=!0,f=r?(0,o.getNeighbors)(p,s,"target"):(0,o.getNeighbors)(p,s),l.push(f.filter((function(t){return!c[t]})))),u[u.length-1]===n){var g=u.map((function(t){return t}));h.push(g);m=u.pop();c[m]=!1,l.pop()}}else{var m=u.pop();c[m]=!1,l.pop()}}return h}},75033:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(62238))&&r.__esModule?r:{default:r};var o=function(t,e){for(var n=(0,i.default)(t,e),r=[],o=n.length,a=0;ar[a][u]+r[u][s]&&(r[a][s]=r[a][u]+r[u][s]);return r};e.default=o},21146:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(49242),i=n(68575),o=function(){function t(t,e,n,r,o){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||i.VACANT_NODE_LABEL,edgeLabel:r||i.VACANT_EDGE_LABEL,nodeLabel2:o||i.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;rh||r.hasNode(o[l.to])||(e.labelv;b--){if("break"===y(b))break}if(g){var x=t.findMinLabel(p);c.dfsEdgeList.push(new o(d,m,i.VACANT_NODE_LABEL,x.edgeLabel,i.VACANT_NODE_LABEL));var w=c.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[w]===c.dfsEdgeList[w]&&a(p[x.edgeLabel].projected)}var _={};g=!1;var S=0;l.forEach((function(e){var n=new s(e),i=t.findForwardPureEdges(r,n.edges[h[0]],f,n);i.length>0&&(g=!0,S=d,i.forEach((function(t){var n="".concat(t.label,"-").concat(u[t.to].label);_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var E=h.length,M=function(e){if(g)return"break";var n=h[e];l.forEach((function(e){var i=new s(e),o=t.findForwardRmpathEdges(r,i.edges[n],f,i);o.length>0&&(g=!0,S=c.dfsEdgeList[n].fromNode,o.forEach((function(t){var n="".concat(t.label,"-").concat(u[t.to].label);_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(b=0;b=0;f--){var d=e.findBackwardEdge(i,h.edges[r[f]],h.edges[r[0]],h);if(d){var p="".concat(e.dfsCode.dfsEdgeList[r[f]].fromNode,"-").concat(d.label);l[p]||(l[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[f]].fromNode,edgeLabel:d.label}),l[p].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(i,h.edges[r[0]],u,h).forEach((function(e){var n="".concat(a,"-").concat(e.label,"-").concat(o[e.to].label);c[n]||(c[n]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:o[e.to].label}),c[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var g=function(n){e.findForwardRmpathEdges(i,h.edges[r[n]],u,h).forEach((function(i){var a="".concat(e.dfsCode.dfsEdgeList[r[n]].fromNode,"-").concat(i.label,"-").concat(o[i.to].label);c[a]||(c[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:o[i.to].label}),c[a].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(f=0;fi){var a=i;i=r,r=a}var l=t.label,h="".concat(n,"-").concat(r,"-").concat(l,"-").concat(i),f="".concat(r,"-").concat(l,"-").concat(i);if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[h]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]e&&(s=e);var r=n[t.id].inDegree;u>r&&(u=r);var i=n[t.id].outDegree;c>i&&(c=i)})),t[e]={degree:s,inDegree:u,outDegree:c}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:c}},y=function(t,e,n,s,u,y,b){var x;if(void 0===n&&(n=!1),void 0===y&&(y="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var w=t.nodes.length;if(w){var _=(0,i.default)(t,n),S=(0,i.default)(e,n),E=g(t.nodes,_,n),M=g(e.nodes,S,n),T=d(t.nodes,y),A=T.nodeMap,C=T.nodeLabelMap,k=d(e.nodes,y),N=k.nodeMap,O=k.nodeLabelMap;p(t.edges,b,A);var P=p(e.edges,b,N).edgeLabelMap,I=[];null==S||S.forEach((function(t){I=I.concat(t)})),u||(u=Math.max.apply(Math,(0,r.__spreadArray)((0,r.__spreadArray)([],I,!1),[2],!1))),s||(s=u);var L=c(t,_,y,s),D=c(e,S,y,s),R=function(t,e,n,r,i){var o=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,l=t.nodeIdxs,h=t.neighborNum-1;u2*e)););if(d<2*e&&(a["".concat(r,"-").concat(f)]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}uq&&(q=n.length,W=n,Y=e,Z=t)}));var X={},K={},$={},Q={},J={},tt={};Object.keys(O).forEach((function(r,i){J[r]=[],n&&(tt[r]=[]);var o=-1/0,a=O[r],s={};a.forEach((function(t){var e=M["".concat(Z.id,"-").concat(t.id)];if(e&&J[r].push(e),oJ[r][c]){s=!0;break}if(s)return W.splice(e,1),"continue";var l={};i.neighbors.forEach((function(t){var e=E["".concat(n.id,"-").concat(t.id)];l["".concat(n.id,"-").concat(t.id)]={start:A[n.id].idx,end:A[t.id].idx,distance:e}})),z=h(l,L,t,z);var d=[];Object.keys(l).forEach((function(t){if(G[t])d.push(G[t]);else{var e=z[t];G[t]=f(e,H,y,b),d.push(G[t])}})),d=d.sort((function(t,e){return e-t}));var p=!1;for(c=0;c=0;l--)c(l)}));var et=[];null==W||W.forEach((function(r){for(var i=A[r.id].idx,o=l(t.nodes,_[i],i,y,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1J[h][p])o.splice(s,1);else{if(n){var g="".concat(c.id,"-").concat(r.id),x=E[g];if(p=tt[h].length-1,x>tt[h][p]){o.splice(s,1);continue}}var w=G[f]?G[f]:m(t,r,c,A,d,L,H,y,b,G,z),S="".concat(Z.id,"-").concat(h);if(w=0;d--){if("break"===x(d))break}if(m)return et.splice(r,1),"continue";i.edges=c;var w=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!m){if(w[t]===1/0){var e=u[t].node[y];if(s[e]--,s[e]rt[r][rt[r].length-1]){e=u[t].node[y];if(s[e]--,s[e]=0;E--){var M=i.nodes[E],T=u[M.id].degree,C=u[M.id].inDegree,k=u[M.id].outDegree,I=M[y],L=v(X,I,N,O),D=L.minPatternNodeLabelDegree,R=L.minPatternNodeLabelInDegree,z=L.minPatternNodeLabelOutDegree;if(n?T=0;F--){var B=c[F];if(!u[B.source]||!u[B.target]){c.splice(F,1);var j=B[b];if(l[j]--,u[B.source]&&(u[B.source].degree--,u[B.source].outDegree--),u[B.target]&&(u[B.target].degree--,u[B.target].inDegree--),P[j]&&l[j]=0;ot--){if("break"===it(ot))break}var at=et.length,st=function(t){var e=et[t],n={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=et[t],r={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&et.splice(t,1)},i=at-1;i>t;i--)r(i);at=et.length};for(ot=0;ot<=at-1;ot++)st(ot);return et}}};e.default=y},5170:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(62238))&&r.__esModule?r:{default:r},o=n(70643);var a=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,c=void 0===u?[]:u,l={},h={};s.forEach((function(t,e){var n=(0,o.uniqueId)();t.clusterId=n,l[n]={id:n,nodes:[t]},h[t.id]={node:t,idx:e}}));var f=(0,i.default)(t,e),d=[],p={};f.forEach((function(t,e){var n=0,r=s[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=s[e].id;p[r][i]=t}})),d.push(n)}));for(var g=0,m=function(){var t=!1;if(s.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],i=h[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r=0&&i.splice(o,1),i&&i.length){t=!0;var a=l[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),c=l[i[u]];c.nodes.push(e),e.clusterId=c.id}}})),!t)return"break";g++};g0&&k>N&&k-NN&&(P=m.map((function(t){return{node:t,clusterId:t.clusterId}})),I=(0,r.clone)(S),N=k),L||O>100)break;O++,Object.keys(S).forEach((function(t){var e=0;y.forEach((function(r){var i=r.source,o=r.target,a=E[i].node.clusterId,s=E[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),S[t].sumTot=e})),m.forEach((function(t,e){var r,i=S[t.clusterId],o=0,a=T[e]/(2*C),s=0,c=i.nodes;c.forEach((function(t){var n=E[t.id].idx;s+=M[e][n]||0}));var h=s-i.sumTot*a,f=c.filter((function(e){return e.id!==t.id})),d=[];f.forEach((function(t,e){d[e]=b[t.originIndex]}));var g=l(f,b)*p,m=A[t.id];if(Object.keys(m).forEach((function(n){var i=E[n].node.clusterId;if(i!==t.clusterId){var s=S[i],c=s.nodes;if(c&&c.length){var f=0;c.forEach((function(t){var n=E[t.id].idx;f+=M[e][n]||0}));var d=f-s.sumTot*a,m=c.concat([t]),v=[];m.forEach((function(t,e){v[e]=b[t.originIndex]}));var y=l(m,b)*p,x=d-h;u&&(x=d+y-(h+g)),x>o&&(o=x,r=s)}}})),o>0){r.nodes.push(t);var v=t.clusterId;t.clusterId=r.id;var x=i.nodes.indexOf(t);i.nodes.splice(x,1);var w=0,_=0;y.forEach((function(t){var e=t.source,i=t.target,o=E[e].node.clusterId,a=E[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(w+=t[n]||1),(o===v&&a!==v||a===v&&o!==v)&&(_+=t[n]||1)})),r.sumTot=w,i.sumTot=_}}))}var D={},R=0;Object.keys(I).forEach((function(t){var e=I[t];if(e.nodes&&e.nodes.length){var n=String(R+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),I[n]=e,D[t]=n,delete I[t],R++)}else delete I[t]})),P.forEach((function(t){var e=t.node,n=t.clusterId;e&&(e.clusterId=n,e.clusterId&&D[e.clusterId]&&(e.clusterId=D[e.clusterId]))}));var z=[],F={};y.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=E[e].node.clusterId,a=E[r].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(F[s])F[s].weight+=i,F[s].count++;else{var u={source:o,target:a,weight:i,count:1};F[s]=u,z.push(u)}}}));var B=[];return Object.keys(I).forEach((function(t){B.push(I[t])})),{clusters:B,clusterEdges:z}};e.default=h},89454:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(38823)),i=a(n(57085)),o=n(70643);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var n=[],r=t.nodes,a=void 0===r?[]:r,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return n;var c=a[0],l=new Set;l.add(c);var h=new i.default((function(t,n){return e?t.weight-n.weight:0}));for((0,o.getEdgesByNodeId)(c.id,u).forEach((function(t){h.insert(t)}));!h.isEmpty();){var f=h.delMin(),d=f.source,p=f.target;l.has(d)&&l.has(p)||(n.push(f),l.has(d)||(l.add(d),(0,o.getEdgesByNodeId)(d,u).forEach((function(t){h.insert(t)}))),l.has(p)||(l.add(p),(0,o.getEdgesByNodeId)(p,u).forEach((function(t){h.insert(t)}))))}return n},u=function(t,e){var n=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return n;var u=s.map((function(t){return t}));e&&u.sort((function(t,e){return t.weight-e.weight}));for(var c=new r.default(o.map((function(t){return t.id})));u.length>0;){var l=u.shift(),h=l.source,f=l.target;c.connected(h,f)||(n.push(l),c.union(h,f))}return n},c=function(t,e,n){return n?{prim:s,kruskal:u}[n](t,e):u(t,e)};e.default=c},74926:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(82556))&&r.__esModule?r:{default:r},o=n(70643);var a=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,a=1,s=0,u=1e3,c=t.nodes,l=void 0===c?[]:c,h=t.edges,f=void 0===h?[]:h,d=l.length,p={},g={},m=0;m0&&a>e;){s=0;for(m=0;m0&&(r+=g[w]/_)}p[y]=n*r,s+=p[y]}}s=(1-s)/d,a=0;for(m=0;m0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r0?n=r:null!==i&&i0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}();e.default=r},88481:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LinkedListNode=void 0;var n=function(t,e){return t===e},r=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}();e.LinkedListNode=r;var i=function(){function t(t){void 0===t&&(t=n),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new r(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new r(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,i=void 0===r?void 0:r;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==n&&this.compare(o.value,n))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}();e.default=i},93026:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(88481))&&r.__esModule?r:{default:r};var o=function(){function t(){this.linkedList=new i.default}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();e.default=o},38823:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var a=this.getOuputDataTexture(),s=a.textureWidth,c=a.texelCount;i.u_OutputTextureSize=[s,s],i.u_OutputTexelCount=c,this.context.output.textureSize=[s,s];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}var e;return(0,a.Z)(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=(0,r.Z)(p().mark((function t(){var e,n,r,i,o,a,s,u,c=this;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,s=[],4!==i)for(u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=new t;return n.setConfig(e),n.setEngine(new wt),n}}]),t}()},61192:function(t,e,n){"use strict";n.d(e,{ZP:function(){return Ab}});var r={};n.r(r),n.d(r,{GADDI:function(){return le},Stack:function(){return fe},breadthFirstSearch:function(){return tt},connectedComponent:function(){return nt},cosineSimilarity:function(){return Lt},default:function(){return pe},depthFirstSearch:function(){return ut},detectAllCycles:function(){return ht},detectAllDirectedCycle:function(){return lt},detectAllUndirectedCycle:function(){return ct},detectCycle:function(){return ft},detectDirectedCycle:function(){return de},dijkstra:function(){return pt},findAllPath:function(){return yt},findShortestPath:function(){return vt},floydWarshall:function(){return bt},getAdjMatrix:function(){return G},getDegree:function(){return it},getInDegree:function(){return ot},getNeighbors:function(){return $},getOutDegree:function(){return at},iLouvain:function(){return Nt},kCore:function(){return Ot},kMeans:function(){return It},labelPropagation:function(){return xt},louvain:function(){return kt},minimumSpanningTree:function(){return Ht},nodesCosineSimilarity:function(){return Dt},pageRank:function(){return Gt}});var i={};n.r(i),n.d(i,{Line:function(){return je},applyMatrix:function(){return Ee},compare:function(){return ye},distance:function(){return Ae},floydWarshall:function(){return ke},fractionToLine:function(){return Ge},getAdjMatrix:function(){return Ne},getBBoxBoundLine:function(){return Ue},getCircleCenterByPoints:function(){return Te},getCircleIntersectByPoint:function(){return _e},getDegree:function(){return De},getEllipseIntersectByPoint:function(){return Se},getLineIntersect:function(){return xe},getPointsCenter:function(){return Ze},getRectIntersectByPoint:function(){return we},intersectBBox:function(){return Fe},invertMatrix:function(){return Me},isPointInPolygon:function(){return ze},isPointsOverlap:function(){return qe},isPolygonsIntersect:function(){return Be},itemIntersectByLine:function(){return He},lerp:function(){return $e},lerpArray:function(){return Qe},move:function(){return Pe},pointLineDistance:function(){return Ke},pointLineSquareDist:function(){return Ye},pointRectSquareDist:function(){return Xe},rotate:function(){return Le},scale:function(){return Ie},scaleMatrix:function(){return Ce},squareDist:function(){return We},translate:function(){return Oe}});var o={};n.r(o),n.d(o,{cloneBesidesImg:function(){return Nn},getAnimateCfgWithCallback:function(){return On},getBBox:function(){return mn},getComboBBox:function(){return Cn},getLabelPosition:function(){return yn},getLetterWidth:function(){return Sn},getLoopCfgs:function(){return vn},getTextSize:function(){return En},plainCombosToTrees:function(){return Tn},reconstructTree:function(){return An},shouldRefreshEdge:function(){return kn},traverseTree:function(){return wn},traverseTreeUp:function(){return _n},truncateLabelByLength:function(){return Mn}});var a={};n.r(a),n.d(a,{catmullRomToBezier:function(){return Bn},fillPath:function(){return sr},fillPathByDiff:function(){return lr},formatPath:function(){return dr},intersection:function(){return ir},parsePathArray:function(){return Yn},parsePathString:function(){return Fn},pathToAbsolute:function(){return Un},pathToCurve:function(){return Zn},rectPath:function(){return Jn}});var s={};n.r(s),n.d(s,{easeBack:function(){return Vo},easeBackIn:function(){return jo},easeBackInOut:function(){return Vo},easeBackOut:function(){return Uo},easeBounce:function(){return zo},easeBounceIn:function(){return Ro},easeBounceInOut:function(){return Fo},easeBounceOut:function(){return zo},easeCircle:function(){return Io},easeCircleIn:function(){return Oo},easeCircleInOut:function(){return Io},easeCircleOut:function(){return Po},easeCubic:function(){return yo},easeCubicIn:function(){return mo},easeCubicInOut:function(){return yo},easeCubicOut:function(){return vo},easeElastic:function(){return Zo},easeElasticIn:function(){return Go},easeElasticInOut:function(){return Wo},easeElasticOut:function(){return Zo},easeExp:function(){return No},easeExpIn:function(){return Co},easeExpInOut:function(){return No},easeExpOut:function(){return ko},easeLinear:function(){return ho},easePoly:function(){return wo},easePolyIn:function(){return bo},easePolyInOut:function(){return wo},easePolyOut:function(){return xo},easeQuad:function(){return go},easeQuadIn:function(){return fo},easeQuadInOut:function(){return go},easeQuadOut:function(){return po},easeSin:function(){return To},easeSinIn:function(){return Eo},easeSinInOut:function(){return To},easeSinOut:function(){return Mo}});var u={};n.r(u),n.d(u,{calculationItemsBBox:function(){return ps},cloneEvent:function(){return hs},formatPadding:function(){return ls},isNaN:function(){return ds},isViewportChanged:function(){return fs},processParallelEdges:function(){return gs},uniqueId:function(){return cs}});var c={};n.r(c),n.d(c,{getClosedSpline:function(){return lu},getControlPoint:function(){return su},getSpline:function(){return au},getStarPath:function(){return mu},paddedHull:function(){return gu},pathToPoints:function(){return cu},pointsToPolygon:function(){return uu},roundedHull:function(){return pu}});var l={};n.r(l),n.d(l,{defaultSubjectColors:function(){return Ku}});var h={};n.r(h),n.d(h,{isForce:function(){return $u}});var f={};n.r(f),n.d(f,{Base:function(){return Yc},Circle:function(){return Xc},Ellipse:function(){return Qc},Image:function(){return el},Line:function(){return il},Marker:function(){return sl},Path:function(){return vl},Polygon:function(){return xl},Polyline:function(){return _l},Rect:function(){return El},Text:function(){return Tl}});var d={};n.r(d),n.d(d,{Base:function(){return Gl},Circle:function(){return Wl},Dom:function(){return ql},Ellipse:function(){return Kl},Image:function(){return Ql},Line:function(){return th},Marker:function(){return ih},Path:function(){return ah},Polygon:function(){return uh},Polyline:function(){return lh},Rect:function(){return fh},Text:function(){return vh}});var p={};n.r(p),n.d(p,{getColorSetsBySubjectColors:function(){return Rf},getColorsWithSubjectColor:function(){return Df},mixColor:function(){return Lf}});var g={};n.r(g),n.d(g,{arrayToTextureData:function(){return ed},attributesToTextureData:function(){return td},buildTextureData:function(){return $f},buildTextureDataWithOneEdgeAttr:function(){return Qf},buildTextureDataWithTwoEdgeAttr:function(){return Jf},proccessToFunc:function(){return Kf},radialLayout:function(){return nd}});var m={};n.r(m),n.d(m,{gpuDetector:function(){return rd}});var v={};n.r(v),n.d(v,{getBrowserName:function(){return id}});var y={};n.r(y),n.d(y,{assign:function(){return dg},default:function(){return Ig},defaultI18n:function(){return vg},format:function(){return Og},parse:function(){return Pg},setGlobalDateI18n:function(){return bg},setGlobalDateMasks:function(){return Ng}});var b=function(t,e){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},b(t,e)};function x(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var w=function(){return w=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]-1})),h=function(i){var o=r[i];if(s[o]||0===s[o])a[o]&&(u[e.id]=Math.min(u[e.id],s[o]));else{var c=n.filter((function(t){return t.id===o}));c.length>0&&t(c[0]),u[e.id]=Math.min(u[e.id],u[o])}},f=0;f0;){var p=o.pop();if(a[p.id]=!1,d.push(p),p===e)break}d.length>0&&c.push(d)}},f=0,d=n;f0&&t(o[0])}},u=0;u0;)h.push(s.pop());o.push(h)}}return o}(t)}var rt=function(t){var e={},n=t.nodes,r=void 0===n?[]:n,i=t.edges,o=void 0===i?[]:i;return r.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),o.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},it=rt,ot=function(t,e){return rt(t)[e]?rt(t)[e].inDegree:0},at=function(t,e){return rt(t)[e]?rt(t)[e].outDegree:0};function st(t,e,n,r,i){void 0===i&&(i=!0),r.enter({current:e,previous:n});var o=t.edges;$(e,void 0===o?[]:o,i?"target":void 0).forEach((function(o){r.allowTraversal({previous:n,current:e,next:o})&&st(t,o,e,r,i)})),r.leave({current:e,previous:n})}function ut(t,e,n,r){void 0===r&&(r=!0),st(t,e,"",function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n),r)}var ct=function(t,e,n){var r,i;void 0===n&&(n=!0);for(var o=[],a=0,s=nt(t,!1);a0;)for(var p=h.pop(),g=p.id,m=$(g,t.edges),v=function(r){var i,a=m[r],s=t.nodes.find((function(t){return t.id===a}));if(a===g)o.push(((i={})[a]=p,i));else if(a in d){if(!d[g].has(s)){for(var u=!0,c=[s,p],l=f[g];d[a].size&&!d[a].has(l)&&(c.push(l),l!==f[l.id]);)l=f[l.id];if(c.push(l),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var v={},y=1;y-1)return h;r.push(u),i.add(u);for(var f=l[u.id],d=0;d0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(u);else for(d=0;d-1}));m-1?p[g.id].push(u[y]):a.push(((i={})[g.id]=g,i))}}return{component:d,adjList:p,minIdx:s}},v=0;v=v})),b=et({nodes:y,edges:t.edges}).filter((function(t){return t.length>1}));if(0===b.length)break;var x=m(b),w=x.minIdx,_=x.adjList,S=x.component;if(!(S.length>1))break;S.forEach((function(t){o[t.id]=new Set}));var E=s[w];if(e&&n&&-1===e.indexOf(E.id))return a;c(E,E,_),v=w+1}return a},ht=function(t,e,n,r){return void 0===r&&(r=!0),e?lt(t,n,r):ct(t,n,r)},ft=function(t){var e=null,n=t.nodes,r={},i={},o={},a={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var s={enter:function(t){var n=t.current,a=t.previous;if(o[n]){e={};for(var s=n,u=a;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else o[n]=n,delete i[n],r[n]=a},leave:function(t){var e=t.current;a[e]=e,delete o[e]},allowTraversal:function(t){var n=t.next;return!e&&!a[n]}};Object.keys(i).length;){ut(t,Object.keys(i)[0],s)}return e},dt=n(59682),pt=function(t,e,n,r){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],c={},l={},h={};o.forEach((function(t,n){var r=t.id;u.push(r),l[r]=1/0,r===e&&(l[r]=0)}));for(var f=o.length,d=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;ol[e.id]+s?(l[a]=l[e.id]+s,h[a]=[e.id]):l[a]===l[e.id]+s&&h[a].push(e.id)}))},p=0;p0&&c.length>0;){var f=c[c.length-1];if(f.length){var d=f.shift();if(d&&(s.push(d),u[d]=!0,h=r?$(d,a,"target"):$(d,a),c.push(h.filter((function(t){return!u[t]})))),s[s.length-1]===n){var p=s.map((function(t){return t}));l.push(p);g=s.pop();u[g]=!1,c.pop()}}else{var g=s.pop();u[g]=!1,c.pop()}}return l},bt=function(t,e){for(var n=G(t,e),r=[],i=n.length,o=0;or[o][s]+r[s][a]&&(r[o][a]=r[o][s]+r[s][a]);return r},xt=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u={},c={};o.forEach((function(t,e){var n=J();t.clusterId=n,u[n]={id:n,nodes:[t]},c[t.id]={node:t,idx:e}}));var l=G(t,e),h=[],f={};l.forEach((function(t,e){var n=0,r=o[e].id;f[r]={},t.forEach((function(t,e){if(t){n+=t;var i=o[e].id;f[r][i]=t}})),h.push(n)}));for(var d=0,p=function(){var t=!1;if(o.forEach((function(e){var n={};Object.keys(f[e.id]).forEach((function(t){var r=f[e.id][t],i=c[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r=0&&i.splice(o,1),i&&i.length){t=!0;var a=u[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var l=Math.floor(Math.random()*i.length),h=u[i[l]];h.nodes.push(e),e.clusterId=h.id}}})),!t)return"break";d++};d0&&S>E&&S-EE&&(A=l.map((function(t){return{node:t,clusterId:t.clusterId}})),C=(0,M.clone)(v),E=S),k||T>100)break;T++,Object.keys(v).forEach((function(t){var e=0;f.forEach((function(r){var i=r.source,o=r.target,a=y[i].node.clusterId,s=y[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),v[t].sumTot=e})),l.forEach((function(t,e){var r,o=v[t.clusterId],a=0,s=x[e]/(2*_),c=0,l=o.nodes;l.forEach((function(t){var n=y[t.id].idx;c+=b[e][n]||0}));var h=c-o.sumTot*s,p=l.filter((function(e){return e.id!==t.id})),g=[];p.forEach((function(t,e){g[e]=d[t.originIndex]}));var m=Ct(p,d)*u,S=w[t.id];if(Object.keys(S).forEach((function(n){var o=y[n].node.clusterId;if(o!==t.clusterId){var c=v[o],l=c.nodes;if(l&&l.length){var f=0;l.forEach((function(t){var n=y[t.id].idx;f+=b[e][n]||0}));var p=f-c.sumTot*s,g=l.concat([t]),x=[];g.forEach((function(t,e){x[e]=d[t.originIndex]}));var w=Ct(g,d)*u,_=p-h;i&&(_=p+w-(h+m)),_>a&&(a=_,r=c)}}})),a>0){r.nodes.push(t);var E=t.clusterId;t.clusterId=r.id;var M=o.nodes.indexOf(t);o.nodes.splice(M,1);var T=0,A=0;f.forEach((function(t){var e=t.source,i=t.target,o=y[e].node.clusterId,a=y[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(T+=t[n]||1),(o===E&&a!==E||a===E&&o!==E)&&(A+=t[n]||1)})),r.sumTot=T,o.sumTot=A}}))}var N={},O=0;Object.keys(C).forEach((function(t){var e=C[t];if(e.nodes&&e.nodes.length){var n=String(O+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),C[n]=e,N[t]=n,delete C[t],O++)}else delete C[t]})),A.forEach((function(t){var e=t.node,n=t.clusterId;e&&(e.clusterId=n,e.clusterId&&N[e.clusterId]&&(e.clusterId=N[e.clusterId]))}));var P=[],I={};f.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=y[e].node.clusterId,a=y[r].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(I[s])I[s].weight+=i,I[s].count++;else{var u={source:o,target:a,weight:i,count:1};I[s]=u,P.push(u)}}}));var L=[];return Object.keys(C).forEach((function(t){L.push(C[t])})),{clusters:L,clusterEdges:P}},Nt=function(t,e,n,r,i,o,a,s){return void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e-4),void 0===i&&(i=void 0),void 0===o&&(o=[]),void 0===a&&(a=["id"]),void 0===s&&(s=1),kt(t,e,n,r,!0,i,o,a,s)},Ot=function(t,e){var n;void 0===e&&(e=1);for(var r=(0,M.clone)(t),i=r.nodes,o=void 0===i?[]:i,a=r.edges,s=void 0===a?[]:a,u=function(){var t=it({nodes:o,edges:s}),r=Object.keys(t);r.sort((function(e,n){var r,i;return(null===(r=t[e])||void 0===r?void 0:r.degree)-(null===(i=t[n])||void 0===i?void 0:i.degree)}));var i=r[0];if(!o.length||(null===(n=t[i])||void 0===n?void 0:n.degree)>=e)return"break";var a=o.findIndex((function(t){return t.id===i}));o.splice(a,1),s=s.filter((function(t){return!(t.source===i||t.target===i)}))};;){if("break"===u())break}return{nodes:o,edges:s}},Pt=function(t,e,n){var r=[];if(t===mt.EuclideanDistance)r=e[n];else r=[];return r},It=function(t,e,n,r,i,o){void 0===e&&(e=3),void 0===n&&(n=void 0),void 0===r&&(r=[]),void 0===i&&(i=["id"]),void 0===o&&(o=mt.EuclideanDistance);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,c=void 0===u?[]:u,l={clusters:[{id:"0",nodes:s}],clusterEdges:[]};if(o===mt.EuclideanDistance&&!s.every((function(t){return t.hasOwnProperty(n)})))return l;var h=[],f=[];if(o===mt.EuclideanDistance&&(h=St(s,n),f=Mt(h,r,i)),!f.length)return l;for(var d=(0,M.uniq)(f.map((function(t){return t.join("")}))),p=Math.min(e,s.length,d.length),g=0;gx&&!m.find((function(e){return(0,M.isEqual)(e,Pt(o,f,s[t].originIndex))}))&&(x=i,w=t)}},S=0;S=0;N--)y[Number(s[g].clusterId)][N].id===s[g].id&&y[Number(s[g].clusterId)].splice(N,1);s[g].clusterId=String(T),y[T].push(s[g])}}var O=!1;for(g=0;g=1e3)break}var D=[],R={};return c.forEach((function(t){var e,n,r=t.source,i=t.target,o=null===(e=s.find((function(t){return t.id===r})))||void 0===e?void 0:e.clusterId,a=null===(n=s.find((function(t){return t.id===i})))||void 0===n?void 0:n.clusterId,u="".concat(o,"---").concat(a);if(R[u])R[u].count++;else{var c={source:o,target:a,count:1};R[u]=c,D.push(c)}})),{clusters:y,clusterEdges:D}},Lt=function(t,e){var n=new _t(e),r=n.norm2(),i=new _t(t),o=i.norm2(),a=n.dot(i),s=r*o,u=s?a/s:0;return u},Dt=function(t,e,n,r,i){void 0===t&&(t=[]),void 0===n&&(n=void 0),void 0===r&&(r=[]),void 0===i&&(i=[]);var o=(0,M.clone)(t.filter((function(t){return t.id!==e.id}))),a=t.findIndex((function(t){return t.id===e.id})),s=St(t,n),u=Mt(s,r,i),c=u[a],l=[];return o.forEach((function(t,n){if(t.id!==e.id){var r=u[n],i=Lt(r,c);l.push(i),t.cosineSimilarity=i}})),o.sort((function(t,e){return e.cosineSimilarity-t.cosineSimilarity})),{allCosineSimilarity:l,similarNodes:o}},Rt=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r0?n=r:null!==i&&i0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}(),jt=Bt,Ut=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=i[0],u=new Set;u.add(s);var c=new jt((function(t,n){return e?t.weight-n.weight:0}));for(Q(s.id,a).forEach((function(t){c.insert(t)}));!c.isEmpty();){var l=c.delMin(),h=l.source,f=l.target;u.has(h)&&u.has(f)||(n.push(l),u.has(h)||(u.add(h),Q(h,a).forEach((function(t){c.insert(t)}))),u.has(f)||(u.add(f),Q(f,a).forEach((function(t){c.insert(t)}))))}return n},Vt=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=a.map((function(t){return t}));e&&s.sort((function(t,e){return t.weight-e.weight}));for(var u=new zt(i.map((function(t){return t.id})));s.length>0;){var c=s.shift(),l=c.source,h=c.target;u.connected(l,h)||(n.push(c),u.union(l,h))}return n},Ht=function(t,e,n){return n?{prim:Ut,kruskal:Vt}[n](t,e):Vt(t,e)},Gt=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,i=1,o=0,a=1e3,s=t.nodes,u=void 0===s?[]:s,c=t.edges,l=void 0===c?[]:c,h=u.length,f={},d={},p=0;p0&&i>e;){o=0;for(p=0;p0&&(r+=d[b]/x)}f[m]=n*r,o+=f[m]}}o=(1-o)/h,i=0;for(p=0;p=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;rh||r.hasNode(o[l.to])||(e.labelp;m--){if("break"===g(m))break}if(f){var v=t.findMinLabel(h);o.dfsEdgeList.push(new Xt(l,d,Zt,v.edgeLabel,Zt));var y=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[y]===o.dfsEdgeList[y]&&a(h[v.edgeLabel].projected)}var b={};f=!1;var x=0;s.forEach((function(e){var n=new $t(e),o=t.findForwardPureEdges(r,n.edges[u[0]],c,n);o.length>0&&(f=!0,x=l,o.forEach((function(t){var n="".concat(t.label,"-").concat(i[t.to].label);b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var w=u.length,_=function(e){if(f)return"break";var n=u[e];s.forEach((function(e){var a=new $t(e),s=t.findForwardRmpathEdges(r,a.edges[n],c,a);s.length>0&&(f=!0,x=o.dfsEdgeList[n].fromNode,s.forEach((function(t){var n="".concat(t.label,"-").concat(i[t.to].label);b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(m=0;m=0;h--){var f=e.findBackwardEdge(u,l.edges[r[h]],l.edges[r[0]],l);if(f){var d="".concat(e.dfsCode.dfsEdgeList[r[h]].fromNode,"-").concat(f.label);s[d]||(s[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[h]].fromNode,edgeLabel:f.label}),s[d].projected.push({graphId:t.graphId,edge:f,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(u,l.edges[r[0]],o,l).forEach((function(e){var n="".concat(i,"-").concat(e.label,"-").concat(c[e.to].label);a[n]||(a[n]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:c[e.to].label}),a[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var p=function(n){e.findForwardRmpathEdges(u,l.edges[r[n]],o,l).forEach((function(i){var o="".concat(e.dfsCode.dfsEdgeList[r[n]].fromNode,"-").concat(i.label,"-").concat(c[i.to].label);a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:c[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(h=0;hi){var a=i;i=r,r=a}var l=t.label,h="".concat(n,"-").concat(r,"-").concat(l,"-").concat(i),f="".concat(r,"-").concat(l,"-").concat(i);if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[h]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]e&&(s=e);var r=n[t.id].inDegree;u>r&&(u=r);var i=n[t.id].outDegree;c>i&&(c=i)})),t[e]={degree:s,inDegree:u,outDegree:c}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:c}},le=function(t,e,n,r,i,o,a){var s;if(void 0===n&&(n=!1),void 0===o&&(o="cluster"),void 0===a&&(a="cluster"),t&&t.nodes){var u=t.nodes.length;if(u){var c=bt(t,n),l=bt(e,n),h=se(t.nodes,c,n),f=se(e.nodes,l,n),d=oe(t.nodes,o),p=d.nodeMap,g=d.nodeLabelMap,m=oe(e.nodes,o),v=m.nodeMap,y=m.nodeLabelMap;ae(t.edges,a,p);var b=ae(e.edges,a,v).edgeLabelMap,x=[];null==l||l.forEach((function(t){x=x.concat(t)})),i||(i=Math.max.apply(Math,(0,dt.__spreadArray)((0,dt.__spreadArray)([],x,!1),[2],!1))),r||(r=i);var w=ee(t,c,o,r),_=ee(e,l,o,r),S=function(t,e,n,r,i){var o=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,l=t.nodeIdxs,h=t.neighborNum-1;u2*e)););if(d<2*e&&(a["".concat(r,"-").concat(f)]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}uL&&(L=n.length,P=n,I=e,O=t)}));var D={},R={},z={},F={},B={},j={};Object.keys(y).forEach((function(r,i){B[r]=[],n&&(j[r]=[]);var s=-1/0,u=y[r],c={};u.forEach((function(t){var e=f["".concat(O.id,"-").concat(t.id)];if(e&&B[r].push(e),sB[r][f]){c=!0;break}if(c)return P.splice(e,1),"continue";var d={};i.neighbors.forEach((function(t){var e=h["".concat(n.id,"-").concat(t.id)];d["".concat(n.id,"-").concat(t.id)]={start:p[n.id].idx,end:p[t.id].idx,distance:e}})),E=re(d,w,t,E);var g=[];Object.keys(d).forEach((function(t){if(N[t])g.push(N[t]);else{var e=E[t];N[t]=ie(e,k,o,a),g.push(N[t])}})),g=g.sort((function(t,e){return e-t}));var m=!1;for(f=0;f=0;g--)d(g)}));var U=[];null==P||P.forEach((function(r){for(var s=p[r.id].idx,u=ne(t.nodes,c[s],s,o,i).neighbors,l=!1,f=u.length-1;f>=0;f--){if(u.length+1B[g][x])u.splice(f,1);else{if(n){var _="".concat(d.id,"-").concat(r.id),S=h[_];if(x=j[g].length-1,S>j[g][x]){u.splice(f,1);continue}}var M=N[m]?N[m]:ue(t,r,d,p,b,w,k,o,a,N,E),T="".concat(O.id,"-").concat(g);if(M=0;g--){if("break"===_(g))break}if(w)return U.splice(r,1),"continue";i.edges=l;var S=pt(i,i.nodes[0].id,!1).length;if(Object.keys(S).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!w){if(S[t]===1/0){var e=c[t].node[o];if(u[e]--,u[e]H[r][H[r].length-1]){e=c[t].node[o];if(u[e]--,u[e]=0;T--){var A=i.nodes[T],C=c[A.id].degree,k=c[A.id].inDegree,N=c[A.id].outDegree,P=A[o],I=ce(D,P,v,y),L=I.minPatternNodeLabelDegree,R=I.minPatternNodeLabelInDegree,z=I.minPatternNodeLabelOutDegree;if(n?C=0;F--){var B=l[F];if(!c[B.source]||!c[B.target]){l.splice(F,1);var j=B[a];if(h[j]--,c[B.source]&&(c[B.source].degree--,c[B.source].outDegree--),c[B.target]&&(c[B.target].degree--,c[B.target].inDegree--),b[j]&&h[j]=0;Z--){if("break"===G(Z))break}var W=U.length,Y=function(t){var e=U[t],n={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=U[t],r={};e.edges.forEach((function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&U.splice(t,1)},i=W-1;i>t;i--)r(i);W=U.length};for(Z=0;Z<=W-1;Z++)Y(Z);return U}}},he=function(){function t(t){void 0===t&&(t=10),this.linkedList=new q,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),fe=he,de=ft,pe={getAdjMatrix:G,breadthFirstSearch:tt,connectedComponent:nt,getDegree:it,getInDegree:ot,getOutDegree:at,detectCycle:ft,detectDirectedCycle:de,detectAllCycles:ht,detectAllDirectedCycle:lt,detectAllUndirectedCycle:ct,depthFirstSearch:ut,dijkstra:pt,findAllPath:yt,findShortestPath:vt,floydWarshall:bt,labelPropagation:xt,louvain:kt,iLouvain:Nt,kCore:Ot,kMeans:It,cosineSimilarity:Lt,nodesCosineSimilarity:Dt,minimumSpanningTree:Ht,pageRank:Gt,getNeighbors:$,Stack:fe,GADDI:le},ge=n(77160),me=n(31437),ve=H,ye=function(t){return function(e,n){return e[t]-n[t]}},be=function(t,e,n){return t>=e&&t<=n},xe=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,c=r.y-n.y,l=a*c-s*u,h=1/l;if(l*l>1e-4*(a*a+s*s)*(u*u+c*c)){var f=(i*c-o*u)*h,d=(i*s-o*a)*h;return be(f,0,1)&&be(d,0,1)?{x:t.x+f*a,y:t.y+f*s}:null}return null},we=function(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=[],s={x:n+i/2,y:r+o/2};a.push({x:n,y:r}),a.push({x:n+i,y:r}),a.push({x:n+i,y:r+o}),a.push({x:n,y:r+o}),a.push({x:n,y:r});for(var u=null,c=1;ce[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},Ne=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i},Oe=function(t,e){t.translate(e.x,e.y)},Pe=function(t,e,n,r){void 0===r&&(r={duration:500});var i=t.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),a=e.x-o.minX,s=e.y-o.minY;if(n){var u=a*i[0],c=s*i[4],l=0,h=0,f=0,d=0;t.animate((function(t){return i=ve(i,[["t",(f=u*t)-l,(d=c*t)-h]]),l=f,h=d,{matrix:i}}),r)}else{var p=ve(i,[["t",a,s]]);t.setMatrix(p)}},Ie=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e;(0,M.isArray)(e)||(r=[e,e]),(0,M.isArray)(e)&&1===e.length&&(r=[e[0],e[0]]),n=ve(n,[["s",r[0],r[1]]]),t.setMatrix(n)},Le=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=ve(n,[["r",e]]),t.setMatrix(n)},De=function(t,e,n){for(var r=[],i=0;i0!=o(u[1]-n)>0&&o(e-(n-s[1])*(s[0]-u[0])/(s[1]-u[1])-s[0])<0&&(r=!r)}return r},Fe=function(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=n(t),o=n(e);if(!Fe(i,o))return!1;var a=!1;if((0,M.each)(e,(function(e){if(ze(t,e[0],e[1]))return a=!0,!1})),a)return!0;if((0,M.each)(t,(function(t){if(ze(e,t[0],t[1]))return a=!0,!1})),a)return!0;var s=r(t),u=r(e),c=!1;return(0,M.each)(u,(function(t){if(function(t,e){var n=!1;return(0,M.each)(t,(function(t){if(xe(t.from,t.to,e.from,e.to))return n=!0,!1})),n}(s,t))return c=!0,!1})),c},je=function(){function t(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}},t}(),Ue=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},Ve=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),r=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=n/i,a=r/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},He=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=Ue(r,n[a]),u=s[0],c=s[1],l=s[2],h=s[3];o[a]=xe({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:c},{x:l,y:h}),o[a]&&(i+=1)}return[o,i]},Ge=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=Ue(r,n[a]),u=s[0],c=s[1],l=s[2],h=s[3],f=Ve(e,new je(u,c,l,h));(f=Math.abs(f-.5))>=0&&f<=1&&(o+=1,i=f0){for(var r=0,i=t;re.x+e.width,i=t.y>e.y+e.height,o=t.y":.604998779296875,"/":.5,"?":.53699951171875},hn=Math.PI,fn=Math.sin,dn=Math.cos,pn=fn(hn/8),gn=dn(hn/8),mn=function(t,e){var n=t.getBBox(),r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),r=Ee(r,o),i=Ee(i,o)}var a=r.x,s=r.y,u=i.x,c=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:c,width:u-a,height:c-s}},vn=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group").getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e.getKeyShape(),i=r.getBBox(),o=t.loopCfg||{},a=o.dist||2*Math.max(i.width,i.height),s=o.position||cn.defaultLoopPosition,u=[(i.minX+i.maxX)/2+n[6],(i.minY+i.maxY)/2+n[7]],c=[t.startPoint.x,t.startPoint.y],l=[t.endPoint.x,t.endPoint.y],h=i.height/2,f=i.width/2,d=h,p=h,g=d*pn,m=d*gn,v=p*pn,y=p*gn,b=r.get("type"),x=Math.min(h/2,f/2),w=Math.min(h,f),_=(null==o?void 0:o.pointPadding)?Math.min(w,null==o?void 0:o.pointPadding):x;if(c[0]===l[0]&&c[1]===l[1]){switch(s){case"top":"circle"===b?(c=[u[0]-g,u[1]-m],l=[u[0]+v,u[1]-y]):(c=[u[0]-_,u[1]-h],l=[u[0]+_,u[1]-h]);break;case"top-right":d=h,p=f,"circle"===b?(c=[u[0]+(g=d*pn),u[1]-(m=d*gn)],l=[u[0]+(y=p*gn),u[1]-(v=p*pn)]):(c=[u[0]+f-_,u[1]-h],l=[u[0]+f,u[1]-h+_]);break;case"right":d=f,p=f,"circle"===b?(c=[u[0]+(m=d*gn),u[1]-(g=d*pn)],l=[u[0]+(y=p*gn),u[1]+(v=p*pn)]):(c=[u[0]+f,u[1]-_],l=[u[0]+f,u[1]+_]);break;case"bottom-right":d=f,p=h,"circle"===b?(c=[u[0]+(m=d*gn),u[1]+(g=d*pn)],l=[u[0]+(v=p*pn),u[1]+(y=p*gn)]):(c=[u[0]+f,u[1]+h-_],l=[u[0]+f-_,u[1]+h]);break;case"bottom":d=h,p=h,"circle"===b?(c=[u[0]+(g=d*pn),u[1]+(m=d*gn)],l=[u[0]-(v=p*pn),u[1]+(y=p*gn)]):(c=[u[0]-_,u[1]+h],l=[u[0]+_,u[1]+h]);break;case"bottom-left":d=h,p=f,"circle"===b?(c=[u[0]-(g=d*pn),u[1]+(m=d*gn)],l=[u[0]-(y=p*gn),u[1]+(v=p*pn)]):(c=[u[0]-f,u[1]+h-_],l=[u[0]-f+_,u[1]+h]);break;case"left":d=f,p=f,"circle"===b?(c=[u[0]-(m=d*gn),u[1]+(g=d*pn)],l=[u[0]-(y=p*gn),u[1]-(v=p*pn)]):(c=[u[0]-f,u[1]-_],l=[u[0]-f,u[1]+_]);break;case"top-left":d=f,p=h,"circle"===b?(c=[u[0]-(m=d*gn),u[1]-(g=d*pn)],l=[u[0]-(v=p*pn),u[1]-(y=p*gn)]):(c=[u[0]-f+_,u[1]-h],l=[u[0]-f,u[1]-h+_]);break;default:c=[u[0]-(g=(d=f)*pn),u[1]-(m=d*gn)],l=[u[0]+(v=(p=f)*pn),u[1]-(y=p*gn)]}if(!1===o.clockwise){var S=[c[0],c[1]];c=[l[0],l[1]],l=[S[0],S[1]]}}var E=[c[0]-u[0],c[1]-u[1]],M=(d+a)/d,T=(p+a)/p;!1===o.clockwise&&(M=(p+a)/p,T=(d+a)/d);var A=me.scale([0,0],E,M),C=[u[0]+A[0],u[1]+A[1]],k=[l[0]-u[0],l[1]-u[1]],N=me.scale([0,0],k,T),O=[u[0]+N[0],u[1]+N[1]];return t.startPoint={x:c[0],y:c[1]},t.endPoint={x:l[0],y:l[1]},t.controlPoints=[{x:C[0],y:C[1]},{x:O[0],y:O[1]}],t},yn=function(t,e,n,r,i){var o=1e-4,a=[],s=null==t?void 0:t.getPoint(e);if(!s)return{x:0,y:0,angle:0};if(e.9999)a=t.getEndTangent();else{var u=null==t?void 0:t.getPoint(e+o);a.push([s.x,s.y]),a.push([u.x,u.y])}var c=Math.atan2(a[1][1]-a[0][1],a[1][0]-a[0][0]);if(c<0&&(c+=2*hn),n&&(s.x+=dn(c)*n,s.y+=fn(c)*n),r){var l=c-hn/2;c>.5*hn&&c<1.5*hn&&(l-=hn),s.x+=dn(l)*r,s.y+=fn(l)*r}var h={x:s.x,y:s.y,angle:c};return i?(c>.5*hn&&c<1.5*hn&&(c-=hn),P({rotate:c},h)):h},bn=function t(e,n,r,i){if(!1===i(e,n,r))return!1;if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return!1;return!0},xn=function t(e,n,r,i){if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return;return!1!==i(e,n,r)},wn=function(t,e){"function"==typeof e&&bn(t,null,-1,e)},_n=function(t,e){"function"==typeof e&&xn(t,null,-1,e)},Sn=function(t,e){return e*(ln[t]||1)},En=function(t,e){var n=0,r=new RegExp("[一-龥]+");return t.split("").forEach((function(t){r.test(t)?n+=e:n+=Sn(t,e)})),[n,e]},Mn=function(t,e){return"number"!=typeof e||e<=0||e>=t.length?t:t.substring(0,e)+"..."},Tn=function(t,e){var n=[],r={},i={};t.forEach((function(t){i[t.id]=t})),t.forEach((function(t,e){var o=(0,M.clone)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo ".concat(o.id," can not be the same as the combo's id")),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo ".concat(o.id," does not exist!")),delete o.parentId);var a=r[o.id];if(a){if(o.children=a.children,r[o.id]=o,!(a=o).parentId)return void n.push(a);var s=r[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var u={id:a.parentId,children:[a]};r[a.parentId]=u,r[o.id]=o}}else if((0,M.isString)(t.parentId)){var c=r[t.parentId];if(c)c.children?c.children.push(o):c.children=[o],r[o.id]=o;else{var l={id:t.parentId,children:[o]};r[l.id]=l,r[o.id]=o}}else n.push(o),r[o.id]=o}));var o={};(e||[]).forEach((function(t){o[t.id]=t;var e=r[t.comboId];if(e){var n={id:t.id,comboId:t.comboId};e.children?e.children.push(n):e.children=[n],n.itemType="node",r[t.id]=n}}));var a=0;return n.forEach((function(t){t.depth=a+10,wn(t,(function(t){var e,n=r[t.id].itemType;e="node"===n?r[t.comboId]:r[t.parentId],t.depth=e&&"node"===n?a+1:a+10,a-1&&o.splice(c,1),s||(i={id:e,itemType:"node",comboId:n},a[e]={children:void 0}),e){var l=!1;if(n){var h=0;(t||[]).forEach((function(t){l||wn(t,(function(t){return n!==t.id||(l=!0,t.children?t.children.push(i):t.children=[i],h=t.depth,"node"===i.itemType?i.depth=h+2:i.depth=h+1,!1)}))}))}else n&&l||"node"===i.itemType||t.push(i);var f=i.depth;wn(i,(function(t){return"node"===t.itemType?f+=2:f+=1,t.depth=f,!0}))}return t},Cn=function(t,e,n){var r={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!t||0===t.length){var i=(null==n?void 0:n.getModel())||{},o=i.x,a=i.y,s=i.fixSize,u=i.collapsed,c=i.fixCollapseSize,l=u?c:s,h=(0,M.isArray)(l)?l:[l,l],f=h[0],d=h[1],p=[f/2,d/2];return{minX:o-p[0],minY:a-p[1],maxX:o+p[0],maxY:a+p[1],x:o,y:a,width:f,height:d}}return t.forEach((function(t){var n=e.findById(t.id);if(n&&n.isVisible()){n.set("bboxCanvasCache",void 0);var i=n.getCanvasBBox();i.x&&r.minX>i.minX&&(r.minX=i.minX),i.y&&r.minY>i.minY&&(r.minY=i.minY),i.x&&r.maxX2&&(n.push([i].concat(a.splice(0,2))),s="l",i="m"===i?"l":"L"),"o"===s&&1===a.length&&n.push([i,a[0]]),"r"===s)n.push([i].concat(a));else for(;a.length>=e[s]&&(n.push([i].concat(a.splice(0,e[s]))),e[s]););return t})),n},Bn=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},jn=function(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o},Un=function(t){if(!(t=Fn(t))||!t.length)return[["M",0,0]];var e,n,r=[],i=0,o=0,a=0,s=0,u=0;"M"===t[0][0]&&(a=i=+t[0][1],s=o=+t[0][2],u++,r[0]=["M",i,o]);for(var c=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),l=void 0,h=void 0,f=u,d=t.length;f1&&(n*=w=Math.sqrt(w),r*=w);var _=n*n,S=r*r,E=(o===a?-1:1)*Math.sqrt(Math.abs((_*S-_*x*x-S*b*b)/(_*x*x+S*b*b)));d=E*n*x/r+(t+s)/2,p=E*-r*b/n+(e+u)/2,h=Math.asin(((e-p)/r).toFixed(9)),f=Math.asin(((u-p)/r).toFixed(9)),h=tf&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var M=f-h;if(Math.abs(M)>g){var T=f,A=s,C=u;f=h+g*(a&&f>h?1:-1),s=d+n*Math.cos(f),u=p+r*Math.sin(f),v=Gn(s,u,n,r,i,0,a,A,C,[f,T,d,p])}M=f-h;var k=Math.cos(h),N=Math.sin(h),O=Math.cos(f),P=Math.sin(f),I=Math.tan(M/4),L=4/3*n*I,D=4/3*r*I,R=[t,e],z=[t+L*N,e-D*k],F=[s+L*P,u-D*O],B=[s,u];if(z[0]=2*R[0]-z[0],z[1]=2*R[1]-z[1],c)return[z,F,B].concat(v);for(var j=[],U=0,V=(v=[z,F,B].concat(v).join().split(",")).length;U7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},d=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var p=0;p1?1:u<0?0:u)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,d=0;d<12;d++){var p=c*l[d]+c,g=qn(p,t,n,i,a),m=qn(p,e,r,o,s),v=g*g+m*m;f+=h[d]*Math.sqrt(v)}return c*f},Kn=function(t,e,n,r,i,o,a,s){for(var u,c,l,h,f=[],d=[[],[]],p=0;p<2;++p)if(0===p?(c=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*a,l=3*n-3*t):(c=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*s,l=3*r-3*e),Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;(h=-l/c)>0&&h<1&&f.push(h)}else{var g=c*c-4*l*u,m=Math.sqrt(g);if(!(g<0)){var v=(-c+m)/(2*u);v>0&&v<1&&f.push(v);var y=(-c-m)/(2*u);y>0&&y<1&&f.push(y)}}for(var b,x=f.length,w=x;x--;)b=1-(h=f[x]),d[0][x]=b*b*b*t+3*b*b*h*n+3*b*h*h*i+h*h*h*a,d[1][x]=b*b*b*e+3*b*b*h*r+3*b*h*h*o+h*h*h*s;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=s,d[0].length=d[1].length=w+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}},$n=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)Math.max(i,a)||Math.max(e,r)Math.max(o,s))){var u=(t-n)*(o-s)-(e-r)*(i-a);if(u){var c=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/u,l=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/u,h=+c.toFixed(2),f=+l.toFixed(2);if(!(h<+Math.min(t,n).toFixed(2)||h>+Math.max(t,n).toFixed(2)||h<+Math.min(i,a).toFixed(2)||h>+Math.max(i,a).toFixed(2)||f<+Math.min(e,r).toFixed(2)||f>+Math.max(e,r).toFixed(2)||f<+Math.min(o,s).toFixed(2)||f>+Math.max(o,s).toFixed(2)))return{x:c,y:l}}}},Qn=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},Jn=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=Yn,o},tr=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:Jn(t,e,n,r),vb:[t,e,n,r].join(" ")}},er=function(t,e,n,r,i,o,a,s){(0,M.isArray)(t)||(t=[t,e,n,r,i,o,a,s]);var u=Kn.apply(null,t);return tr(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},nr=function(t,e,n,r,i,o,a,s,u){var c=1-u,l=Math.pow(c,3),h=Math.pow(c,2),f=u*u,d=f*u,p=t+2*u*(n-t)+f*(i-2*n+t),g=e+2*u*(r-e)+f*(o-2*r+e),m=n+2*u*(i-n)+f*(a-2*i+n),v=r+2*u*(o-r)+f*(s-2*o+r);return{x:l*t+3*h*u*n+3*c*u*u*i+d*a,y:l*e+3*h*u*r+3*c*u*u*o+d*s,m:{x:p,y:g},n:{x:m,y:v},start:{x:c*t+u*n,y:c*e+u*r},end:{x:c*i+u*a,y:c*o+u*s},alpha:90-180*Math.atan2(p-m,g-v)/Math.PI}},rr=function(t,e,n){if(!function(t,e){return t=tr(t),e=tr(e),Qn(e,t.x,t.y)||Qn(e,t.x2,t.y)||Qn(e,t.x,t.y2)||Qn(e,t.x2,t.y2)||Qn(t,e.x,e.y)||Qn(t,e.x2,e.y)||Qn(t,e.x,e.y2)||Qn(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(er(t),er(e)))return n?0:[];for(var r=~~(Xn.apply(0,t)/8),i=~~(Xn.apply(0,e)/8),o=[],a=[],s={},u=n?0:[],c=0;c=0&&b<=1&&x>=0&&x<=1&&(n?u+=1:u.push({x:y.x,y:y.y,t1:b,t2:x}))}}return u},ir=function(t,e){return function(t,e,n){var r,i,o,a,s,u,c,l,h,f;t=Zn(t),e=Zn(e);for(var d=n?0:[],p=0,g=t.length;p=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r},sr=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var h=i-(r=t.length);if(r0)){t[r]=e[r];break}n=hr(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=hr(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=hr(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t},pr=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}(),gr=n(70655);function mr(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}var vr="undefined"!=typeof window&&void 0!==window.document;function yr(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function br(t){return t.cfg.visible&&t.cfg.capture}var xr=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=(0,M.mix)(r,e),n}return(0,gr.ZT)(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(F),wr=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;it.delay&&(0,M.each)(e.toAttrs,(function(e,n){o.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var Hr=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return(0,M.mix)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return(0,gr.ZT)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n0?r=Vr(r,y):n.addAnimator(this),r.push(y),this.set("animations",r),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");(0,M.each)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return(0,M.each)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return(0,M.each)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,i=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var o=function(t){var o=i[t],s=o.get("name");if(s){if((o.isGroup()||o.isCanvas&&o.isCanvas())&&n&&yr(o,n))return"break";(0,M.isArray)(s)?(0,M.each)(s,(function(t){r.emitDelegateEvent(o,t,e)})):a.emitDelegateEvent(o,s,e)}},a=this,s=0;s0)}));return i.length>0?(0,M.each)(i,(function(i){var o=i.getBBox(),a=o.minX,s=o.maxX,u=o.minY,c=o.maxY;ae&&(e=s),ur&&(r=c)})):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return i.length>0?(0,M.each)(i,(function(i){var o=i.getCanvasBBox(),a=o.minX,s=o.maxX,u=o.minY,c=o.maxY;ae&&(e=s),ur&&(r=c)})):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();(0,M.each)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e=0;o--){var a=t[o];if(br(a)&&(a.isGroup()?i=a.getShape(e,n,r):a.isHit(e,n)&&(i=a)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),mr(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&Wr(t,e),r&&Yr(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t=this.getChildren();(0,M.each)(t,(function(t,e){return t._INDEX=e,t})),t.sort(function(t){return function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r}}((function(t,e){return t.get("zIndex")-e.get("zIndex")}))),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return(0,M.each)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return(0,M.each)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(Gr),$r=Kr,Qr=0,Jr=0,ti=0,ei=0,ni=0,ri=0,ii="object"==typeof performance&&performance.now?performance:Date,oi="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ai(){return ni||(oi(si),ni=ii.now()+ri)}function si(){ni=0}function ui(){this._call=this._time=this._next=null}function ci(t,e,n){var r=new ui;return r.restart(t,e,n),r}function li(){ni=(ei=ii.now())+ri,Qr=Jr=0;try{!function(){ai(),++Qr;for(var t,e=qr;e;)(t=ni-e._time)>=0&&e._call.call(null,t),e=e._next;--Qr}()}finally{Qr=0,function(){var t,e,n=qr,r=1/0;for(;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:qr=e);Xr=t,fi(r)}(),ni=0}}function hi(){var t=ii.now(),e=t-ei;e>1e3&&(ri-=e,ei=t)}function fi(t){Qr||(Jr&&(Jr=clearTimeout(Jr)),t-ni>24?(t<1/0&&(Jr=setTimeout(li,t-ii.now()-ri)),ti&&(ti=clearInterval(ti))):(ti||(ei=ii.now(),ti=setInterval(hi,1e3)),Qr=1,oi(li)))}function di(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function gi(){}ui.prototype=ci.prototype={constructor:ui,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?ai():+n)+(null==e?0:+e),this._next||Xr===this||(Xr?Xr._next=this:qr=this,Xr=this),this._call=t,this._time=n,fi()},stop:function(){this._call&&(this._call=null,this._time=1/0,fi())}};var mi=.7,vi=1/mi,yi="\\s*([+-]?\\d+)\\s*",bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wi=/^#([0-9a-f]{3,8})$/,_i=new RegExp(`^rgb\\(${yi},${yi},${yi}\\)$`),Si=new RegExp(`^rgb\\(${xi},${xi},${xi}\\)$`),Ei=new RegExp(`^rgba\\(${yi},${yi},${yi},${bi}\\)$`),Mi=new RegExp(`^rgba\\(${xi},${xi},${xi},${bi}\\)$`),Ti=new RegExp(`^hsl\\(${bi},${xi},${xi}\\)$`),Ai=new RegExp(`^hsla\\(${bi},${xi},${xi},${bi}\\)$`),Ci={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ki(){return this.rgb().formatHex()}function Ni(){return this.rgb().formatRgb()}function Oi(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Pi(e):3===n?new Ri(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ii(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ii(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_i.exec(t))?new Ri(e[1],e[2],e[3],1):(e=Si.exec(t))?new Ri(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ei.exec(t))?Ii(e[1],e[2],e[3],e[4]):(e=Mi.exec(t))?Ii(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ti.exec(t))?Vi(e[1],e[2]/100,e[3]/100,1):(e=Ai.exec(t))?Vi(e[1],e[2]/100,e[3]/100,e[4]):Ci.hasOwnProperty(t)?Pi(Ci[t]):"transparent"===t?new Ri(NaN,NaN,NaN,0):null}function Pi(t){return new Ri(t>>16&255,t>>8&255,255&t,1)}function Ii(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ri(t,e,n,r)}function Li(t){return t instanceof gi||(t=Oi(t)),t?new Ri((t=t.rgb()).r,t.g,t.b,t.opacity):new Ri}function Di(t,e,n,r){return 1===arguments.length?Li(t):new Ri(t,e,n,null==r?1:r)}function Ri(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function zi(){return`#${Ui(this.r)}${Ui(this.g)}${Ui(this.b)}`}function Fi(){const t=Bi(this.opacity);return`${1===t?"rgb(":"rgba("}${ji(this.r)}, ${ji(this.g)}, ${ji(this.b)}${1===t?")":`, ${t})`}`}function Bi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ji(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ui(t){return((t=ji(t))<16?"0":"")+t.toString(16)}function Vi(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Gi(t,e,n,r)}function Hi(t){if(t instanceof Gi)return new Gi(t.h,t.s,t.l,t.opacity);if(t instanceof gi||(t=Oi(t)),!t)return new Gi;if(t instanceof Gi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new Gi(a,s,u,t.opacity)}function Gi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Zi(t){return(t=(t||0)%360)<0?t+360:t}function Wi(t){return Math.max(0,Math.min(1,t||0))}function Yi(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function qi(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}di(gi,Oi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ki,formatHex:ki,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Hi(this).formatHsl()},formatRgb:Ni,toString:Ni}),di(Ri,Di,pi(gi,{brighter(t){return t=null==t?vi:Math.pow(vi,t),new Ri(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?mi:Math.pow(mi,t),new Ri(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ri(ji(this.r),ji(this.g),ji(this.b),Bi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zi,formatHex:zi,formatHex8:function(){return`#${Ui(this.r)}${Ui(this.g)}${Ui(this.b)}${Ui(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Fi,toString:Fi})),di(Gi,(function(t,e,n,r){return 1===arguments.length?Hi(t):new Gi(t,e,n,null==r?1:r)}),pi(gi,{brighter(t){return t=null==t?vi:Math.pow(vi,t),new Gi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?mi:Math.pow(mi,t),new Gi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ri(Yi(t>=240?t-240:t+120,i,r),Yi(t,i,r),Yi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Gi(Zi(this.h),Wi(this.s),Wi(this.l),Bi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Bi(this.opacity);return`${1===t?"hsl(":"hsla("}${Zi(this.h)}, ${100*Wi(this.s)}%, ${100*Wi(this.l)}%${1===t?")":`, ${t})`}`}}));var Xi=t=>()=>t;function Ki(t,e){return function(n){return t+n*e}}function $i(t){return 1==(t=+t)?Qi:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Xi(isNaN(e)?n:e)}}function Qi(t,e){var n=e-t;return n?Ki(t,n):Xi(isNaN(t)?e:t)}var Ji=function t(e){var n=$i(e);function r(t,e){var r=n((t=Di(t)).r,(e=Di(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Qi(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function to(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=ro&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:oo(n,r)})),o=uo.lastIndex;return of.length?(h=Fn(o[l]),f=Fn(i[l]),f=lr(f,h),f=dr(f,h),e.fromAttrs.path=f,e.toAttrs.path=h):e.pathFormatted||(h=Fn(o[l]),f=Fn(i[l]),f=dr(f,h),e.fromAttrs.path=f,e.toAttrs.path=h,e.pathFormatted=!0),r[l]=[];for(var d=0;d0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],Xo(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),$o=Ko,Qo=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function Jo(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function ta(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&yr(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var ea=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");(0,M.each)(Qo,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");(0,M.each)(Qo,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new pr(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,l=a.clientY-t.clientY;u>120||c*c+l*l>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,Jo(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||ta(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{Jo(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),na=ea,ra=Nr(),ia=ra&&"firefox"===ra.name,oa=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return(0,gr.ZT)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");(0,M.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new na({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new $o(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");vr&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");vr&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(ia&&!(0,M.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,M.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}($r),aa=oa,sa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,o=t.maxY;if(e){var a=Lr(e,[t.minX,t.minY]),s=Lr(e,[t.maxX,t.minY]),u=Lr(e,[t.minX,t.maxY]),c=Lr(e,[t.maxX,t.maxY]);n=Math.min(a[0],s[0],u[0],c[0]),i=Math.max(a[0],s[0],u[0],c[0]),r=Math.min(a[1],s[1],u[1],c[1]),o=Math.max(a[1],s[1],u[1],c[1])}var l=this.attrs;if(l.shadowColor){var h=l.shadowBlur,f=void 0===h?0:h,d=l.shadowOffsetX,p=void 0===d?0:d,g=l.shadowOffsetY,m=void 0===g?0:g,v=n-f+p,y=i+f+p,b=r-f+m,x=o+f+m;n=Math.min(n,v),i=Math.max(i,y),r=Math.min(r,b),o=Math.max(o,x)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:o,width:i-n,height:o-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1},e}(Gr),la=new Map;function ha(t,e){la.set(t,e)}function fa(t){return la.get(t)}function da(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}}function pa(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}}function ga(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ma(t,e){return Math.abs(t-e)<.001}function va(t,e){var n=(0,M.min)(t),r=(0,M.min)(e);return{x:n,y:r,width:(0,M.max)(t)-n,height:(0,M.max)(e)-r}}function ya(t){return(t+2*Math.PI)%(2*Math.PI)}var ba={box:function(t,e,n,r){return va([t,n],[e,r])},length:function(t,e,n,r){return ga(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return a<0?ga(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?ga(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(me.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];me.normalize(s,s);var u=[i-t,o-e];return Math.abs(me.dot(u,s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function xa(t,e,n,r,i,o){var a,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,f=0;f<=c;f++){var d=f*l,p=[i.apply(null,t.concat([d])),i.apply(null,e.concat([d]))];(y=ga(u[0],u[1],p[0],p[1]))=0&&y=0?[i]:[]}function Sa(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Ea(t,e,n,r,i,o,a){var s=wa(t,n,i,a),u=wa(e,r,o,a),c=ba.pointAt(t,e,n,r,a),l=ba.pointAt(n,r,i,o,a);return[[t,e,c.x,c.y,s,u],[s,u,l.x,l.y,i,o]]}function Ma(t,e,n,r,i,o,a){if(0===a)return(ga(t,e,n,r)+ga(n,r,i,o)+ga(t,e,i,o))/2;var s=Ea(t,e,n,r,i,o,.5),u=s[0],c=s[1];return u.push(a-1),c.push(a-1),Ma.apply(null,u)+Ma.apply(null,c)}var Ta={box:function(t,e,n,r,i,o){var a=_a(t,n,i)[0],s=_a(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(wa(t,n,i,a)),void 0!==s&&c.push(wa(e,r,o,s)),va(u,c)},length:function(t,e,n,r,i,o){return Ma(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,s){return xa([t,n,i],[e,r,o],a,s,wa)},pointDistance:function(t,e,n,r,i,o,a,s){var u=this.nearestPoint(t,e,n,r,i,o,a,s);return ga(u.x,u.y,a,s)},interpolationAt:wa,pointAt:function(t,e,n,r,i,o,a){return{x:wa(t,n,i,a),y:wa(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return Ea(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var s=Sa(t,n,i,a),u=Sa(e,r,o,a);return ya(Math.atan2(u,s))}};function Aa(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Ca(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function ka(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(ma(s,0))ma(u,0)||(i=-c/u)>=0&&i<=1&&l.push(i);else{var h=u*u-4*s*c;ma(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),(i=(-u+a)/(2*s))>=0&&i<=1&&l.push(i),o>=0&&o<=1&&l.push(o))}return l}function Na(t,e,n,r,i,o,a,s,u){var c=Aa(t,n,i,a,u),l=Aa(e,r,o,s,u),h=ba.pointAt(t,e,n,r,u),f=ba.pointAt(n,r,i,o,u),d=ba.pointAt(i,o,a,s,u),p=ba.pointAt(h.x,h.y,f.x,f.y,u),g=ba.pointAt(f.x,f.y,d.x,d.y,u);return[[t,e,h.x,h.y,p.x,p.y,c,l],[c,l,g.x,g.y,d.x,d.y,a,s]]}function Oa(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;ic&&(c=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,v=[o,a];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var y=p+h;om&&(m=b)}return{x:u,y:g,width:c-u,height:m-g}};function Ra(t){if(t.length<2)return 0;for(var e=0,n=0;n1){var i=function(t,e){return e?e-t:.14*t}(e,n);return e*r+i*(r-1)}return e}function Ha(t){var e=t.fontSize,n=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,e+"px",n].join(" ").trim()}var Ga=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,Za=/[^\s\,]+/gi;var Wa=function(t){var e=t||[];return(0,M.isArray)(e)?e:(0,M.isString)(e)?(e=e.match(Ga),(0,M.each)(e,(function(t,n){if((t=t.match(Za))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}(0,M.each)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};var Ya=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}var $a=/[a-z]/;function Qa(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Ja(t){var e=Ka(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;r=0){n=!0;break}}if(!n)return e;var o=[],a=0,s=0,u=0,c=0,l=0,h=e[0];"M"!==h[0]&&"m"!==h[0]||(u=a=+h[1],c=s=+h[2],l++,o[0]=["M",a,s]);r=l;for(var f=e.length;r1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(h*h),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var m=r?g*n*f/r:0,v=n?g*-r*h/n:0,y=(s+c)/2+Math.cos(i)*m-Math.sin(i)*v,b=(u+l)/2+Math.sin(i)*m+Math.cos(i)*v,x=[(h-m)/n,(f-v)/r],w=[(-1*h-m)/n,(-1*f-v)/r],_=ns([1,0],x),S=ns(x,w);return es(x,w)<=-1&&(S=Math.PI),es(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:y,cy:b,rx:rs(t,[c,l])?0:n,ry:rs(t,[c,l])?0:r,startAngle:_,endAngle:_+S,xRotation:i,arcFlag:o,sweepFlag:a}}function os(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function as(t){for(var e=[],n=null,r=null,i=null,o=0,a=(t=Wa(t)).length,s=0;sMath.PI/2?Math.PI-c:c,l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}ha("rect",da),ha("image",da),ha("circle",pa),ha("marker",pa),ha("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;in&&(n=c),l>i&&(i=l)}return{x:Math.floor(e),y:Math.floor(r),width:Math.ceil(n)-Math.floor(e),height:Math.ceil(i)-Math.floor(r),minX:e,minY:r,maxX:n,maxY:i}},gs=function(t,e,n,r,i){void 0===e&&(e=15),void 0===n&&(n="quadratic"),void 0===r&&(r=void 0),void 0===i&&(i=void 0);for(var o=t.length,a=2*e,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},c=[],l={},h=0;hr.get("optimizeThreshold")){var a=1/0,s=1/0,u=-1/0,c=-1/0;o.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y;a>n&&(a=n),s>r&&(s=r),ud&&(p=d,console.warn("fitview failed, ratio out of range, ratio: %f",a,"graph maxzoom has been used instead"));var g=(0,ms.vs)(h,[["t",-i.x,-i.y],["s",p,p],["t",i.x,i.y]]),m=On({animateCfg:n,callback:function(){t.setMatrix(g),u.emit("viewportchange",{action:"translate",matrix:h}),u.emit("viewportchange",{action:"zoom",matrix:g})}});t.stopAnimate(),t.setMatrix(e),t.animate((function(t){return{matrix:Qe(e,g,t)}}),m)}else{var v=On({animateCfg:n,callback:function(){u.emit("viewportchange",{action:"translate",matrix:h})}});t.animate((function(t){return{matrix:Qe(e,h,t)}}),v)}}},t.prototype.fitView=function(t,e){var n,r=this.graph,i=this.getFormatPadding(),o=r.get("width"),a=r.get("height"),s=r.get("group"),u=s.getMatrix()||[1,0,0,0,1,0,0,0,1];s.resetMatrix();var c=r.getNodes();if(c.length>r.get("optimizeThreshold")){var l=1/0,h=1/0,f=-1/0,d=-1/0;c.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y;l>n&&(l=n),h>r&&(h=r),fv&&(y=v),t)this.animatedFitView(s,u,e,n,p,g,y,!0);else{var b=p.x-g.x,x=p.y-g.y;if(ds(b)||ds(x))return;r.translate(b,x),r.zoom(y,p)||console.warn("zoom failed, ratio out of range, ratio: %f",y)}}},t.prototype.fitViewByRules=function(t,e,n){var r,i=t.onlyOutOfViewPort,o=void 0!==i&&i,a=t.direction,s=void 0===a?"both":a,u=t.ratioRule,c=void 0===u?"min":u,l=this.graph,h=this.getFormatPadding(),f=l.get("width"),d=l.get("height"),p=l.get("group"),g=p.getMatrix()||[1,0,0,0,1,0,0,0,1];p.resetMatrix();var m=l.getNodes();if(m.length>l.get("optimizeThreshold")){var v=1/0,y=1/0,b=-1/0,x=-1/0;m.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y;v>n&&(v=n),y>r&&(y=r),bl.maxX&&(l.maxX=d.maxX),d.maxY>l.maxY&&(l.maxY=d.maxY)}if(l.x=l.minX,l.y=l.minY,l.width=l.maxX-l.minX,l.height=l.maxY-l.minY,0!==l.width&&0!==l.height){var p=this.getViewCenter(),g={x:l.x+l.width/2,y:l.y+l.height/2},m=(a-o[1]-o[3])/l.width,v=(s-o[0]-o[2])/l.height,y=m;m>v&&(y=v),n?this.animatedFitView(u,c,r,l,p,g,y,e):(i.translate(p.x-g.x,p.y-g.y),e&&!i.zoom(y,p)&&console.warn("zoom failed, ratio out of range, ratio: %f",y))}}},t.prototype.changeSize=function(t,e){var n=this.graph;if(!(0,M.isNumber)(t)||!(0,M.isNumber)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");n.set({width:t,height:e}),n.get("canvas").changeSize(t,e),n.get("plugins").forEach((function(t){t.get("gridContainer")&&t.positionInit()}))},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}(),ys=vs;function bs(t){return bs="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},bs(t)}function xs(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},n=e(t);if("string"!=typeof n)return n;for(var r=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;er.width&&(r.width=l.width+l.x),l.height+l.y>r.height&&(r.height=l.height+l.y)}}}return t.bbox=function(t,e,n){var r,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:n.width||0,height:n.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,r=2*a.r);break;case"text":a.text&&(i=En(a.text,a.fontSize||12)[0],r=16,s.y+=r,s.height=r,s.width=i,t.attrs=P({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(r=a.height)}return r>=0&&(s.height=r),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,r),t.attrs=P(P({},t.attrs),t.bbox),t}function Ss(t,e){var n,r,i,o,a=(t||{}).type,s=((null==e?void 0:e.attrs)||{}).key;if(s&&t&&(t.attrs.key=s),!t&&e)return{action:"delete",val:e,type:a,key:s};if(t&&!e)return{action:"add",val:t,type:a};if(!t&&!e)return{action:"same",type:a};var u=[];if((null===(n=t.children)||void 0===n?void 0:n.length)>0||(null===(r=e.children)||void 0===r?void 0:r.length)>0)for(var c=Math.max(null===(i=t.children)||void 0===i?void 0:i.length,null===(o=e.children)||void 0===o?void 0:o.length),l=e.children||[],h=t.children||[],f=0;f-1)return;n.push(i)}else s>-1&&n.splice(s,1)}else if((0,M.isString)(e)){var u=n.filter((function(t){return t.includes(o)}));u.length>0&&this.clearStates(u),(a=a.filter((function(t){return!t.includes(o)}))).push(i),this.set("states",a)}if(r){var c=this.get("model").type;r.setState(c,t,e,this)}},t.prototype.clearStates=function(t){var e=this,n=e.getStates(),r=e.get("shapeFactory"),i=e.get("model").type;t||(t=n),(0,M.isString)(t)&&(t=[t]);var o=n.filter((function(e){return-1===t.indexOf(e)}));e.set("states",o),t.forEach((function(t){r.setState(i,t,!1,e)}))},t.prototype.setOptimize=function(t){this.optimize=t},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){return this.getStates().indexOf(t)>=0},t.prototype.refresh=function(t){var e=this.get("model");this.updatePosition(e),this.updateShape(t),this.afterUpdate(),this.clearCache()},t.prototype.getUpdateType=function(t){},t.prototype.update=function(t,e){void 0===e&&(e=void 0);var n=this.get("model");if("move"===e)this.updatePosition(t);else{var r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o={x:n.x,y:n.y};t.x=isNaN(+t.x)?n.x:+t.x,t.y=isNaN(+t.y)?n.y:+t.y;var a=this.get("styles");if(t.stateStyles){var s=t.stateStyles;(0,M.mix)(a,s),delete t.stateStyles}Object.assign(n,t),o.x===t.x&&o.y===t.y||this.updatePosition(t),this.updateShape(e)}this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(t){var e=this.get("shapeFactory"),n=this.get("model"),r=n.type;if(e.shouldUpdate(r)&&r===this.get("currentShape")){var i=this.getShapeCfg(n,t);e.baseUpdate(r,i,this,t),"move"!==t&&this.setOriginStyle()}else this.draw();this.restoreStates(e,r)},t.prototype.updatePosition=function(t){var e=this.get("model"),n=isNaN(+t.x)?+e.x:+t.x,r=isNaN(+t.y)?+e.y:+t.y,i=this.get("group");if(isNaN(n)||isNaN(r))return!1;e.x=n,e.y=r;var o=i.getMatrix();return(!o||o[6]!==n||o[7]!==r)&&(i.resetMatrix(),Oe(i,{x:n,y:r}),this.clearCache(),!0)},t.prototype.getBBox=function(){var t=this.get(Os);return t||(t=this.calculateBBox(),this.set(Os,t)),t},t.prototype.getCanvasBBox=function(){var t=this.get(Ps);return t||(t=this.calculateCanvasBBox(),this.set(Ps,t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),Ls=Is,Ds={source:"start",target:"end"},Rs="Node",zs="Point",Fs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var n=Ds[t]+zs,r=t+Rs,i=this.get(r);i&&!i.destroyed&&i.removeEdge(this),(0,M.isPlainObject)(e)?(this.set(n,e),this.set(r,null)):e&&(e.addEdge(this),this.set(r,e),this.set(n,null))},e.prototype.getLinkPoint=function(t,e,n){var r=Ds[t]+zs,i=t+Rs,o=this.get(r);if(!o){var a=this.get(i),s=t+"Anchor",u=this.getPrePoint(t,n),c=e[s];(0,M.isNil)(c)||(o=a.getLinkPointByAnchor(c)),o=o||a.getLinkPoint(u),(0,M.isNil)(o.index)||this.set("".concat(t,"AnchorIndex"),o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var n="source"===t?"target":"source";return this.getEndPoint(n)},e.prototype.getEndPoint=function(t){var e=t+Rs,n=Ds[t]+zs,r=this.get(e);return r&&!r.destroyed?r.get("model"):this.get(n)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),n=this.getEndPoint("target"),r=this.get("shapeFactory"),i=t.type;return r.getControlPoints(i,{startPoint:e,endPoint:n})},e.prototype.getEndCenter=function(t){var e=t+Rs,n=Ds[t]+zs,r=this.get(e);if(r){var i=r.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(n)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e,n){var r=this,i=r.get("linkCenter"),o=(null==n?void 0:n.includes("move"))?e:t.prototype.getShapeCfg.call(this,e);if(i)o.startPoint=r.getEndCenter("source"),o.endPoint=r.getEndCenter("target");else{var a=o.controlPoints||r.getControlPointsByCenter(o);o.startPoint=r.getLinkPoint("source",e,a),o.endPoint=r.getLinkPoint("target",e,a)}return o.sourceNode=r.get("sourceNode"),o.targetNode=r.get("targetNode"),o},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("source".concat(Rs)),n=this.get("target".concat(Rs));return e?delete t["source".concat(Rs)]:t.source=this.get("start".concat(zs)),n?delete t["target".concat(Rs)]:t.target=this.get("end".concat(zs)),(0,M.isString)(t.source)||(0,M.isPlainObject)(t.source)||(t.source=t.source.getID()),(0,M.isString)(t.target)||(0,M.isPlainObject)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,e){void 0===e&&(e=void 0);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("source"),a=this.get("target");if(o&&!o.destroyed&&a&&!a.destroyed){var s=this.get("styles");if(t.stateStyles){var u=t.stateStyles;(0,M.mix)(s,u),delete t.stateStyles}Object.assign(n,t),this.updateShape(e),this.afterUpdate(),this.clearCache()}},e.prototype.destroy=function(){var e=this.get("source".concat(Rs)),n=this.get("target".concat(Rs));e&&!e.destroyed&&e.removeEdge(this),n&&!n.destroyed&&n.removeEdge(this),t.prototype.destroy.call(this)},e}(Ls),Bs=Fs,js="anchorPointsCache",Us=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e.prototype.getNearestPoint=function(t,e){for(var n=0,r=t[0],i=Ae(t[0],e),o=0;o-1&&e.splice(n,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set(js,null)},e.prototype.getUpdateType=function(t){var e,n,r,i,o;if(t){var a=!(0,M.isNil)(t.x),s=!(0,M.isNil)(t.y),u=Object.keys(t);return 1===u.length&&(a||s)||2===u.length&&a&&s?"move":(0,M.isNumber)(t.x)||(0,M.isNumber)(t.y)||t.type||t.anchorPoints||t.size||(null==t?void 0:t.style)&&((null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.r)||(null===(n=null==t?void 0:t.style)||void 0===n?void 0:n.width)||(null===(r=null==t?void 0:t.style)||void 0===r?void 0:r.height)||(null===(i=null==t?void 0:t.style)||void 0===i?void 0:i.rx)||(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.ry))?"bbox|label":u.includes("label")||u.includes("labelCfg")?"style|label":"style"}},e.prototype.setState=function(e,n){var r=this;this.optimize?t.prototype.setState.call(this,e,n):this.runWithBBoxAffected((function(){return t.prototype.setState.call(r,e,n)}))},e.prototype.clearStates=function(e){var n=this;this.optimize?t.prototype.clearStates.call(this,e):this.runWithBBoxAffected((function(){return t.prototype.clearStates.call(n,e)}))},e.prototype.runWithBBoxAffected=function(t){var e=["r","width","height","rx","ry","lineWidth"],n=this.getKeyShape().attr(),r={};Object.keys(this.getKeyShape().attr()).forEach((function(t){e.includes(t)&&(r[t]=n[t])})),t();for(var i=this.getKeyShape().attr(),o=0;o-1&&(e.splice(n,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){return this.set(Gs,null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set(Hs,null),this.set(Gs,null),this.set(Ws,null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),this.set(Zs,null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}(Vs),qs=Ys,Xs="node",Ks="edge",$s="vedge",Qs="combo",Js="Mapper",tu="stateStyles",eu=function(){function t(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,M.throttle)((function(t){var n=e.graph;if(n&&!n.get("destroyed")){var r=e.edgeToBeUpdateMap;if(r){var i=Object.values(r);i.length&&(i.forEach((function(t){var e=t.edge;if(e&&!e.destroyed){var n=e.getSource(),r=e.getTarget();n&&!n.destroyed&&r&&!r.destroyed&&e.refresh(t.updateType)}})),e.edgeToBeUpdateMap={})}}}),16,{trailing:!0,leading:!0}),this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var n=this.graph,r=t===$s?Ks:t,i=n.get("".concat(r,"Group"))||n.get("group"),o=(0,M.upperFirst)(r),a=null,s=n.get(r+(0,M.upperFirst)(tu))||{},u=n.get("default"+o);e.stateStyles&&(s=e.stateStyles),u&&(0,M.each)(u,(function(t,n){(0,M.isObject)(t)&&!(0,M.isArray)(t)?e[n]=(0,M.deepMix)({},t,e[n]):(0,M.isArray)(t)?e[n]=e[n]||(0,M.clone)(u[n]):e[n]=e[n]||u[n]}));var c=n.get(r+Js);if(c){var l=c(e);l.stateStyles&&(s=l.stateStyles,delete l.stateStyles),(0,M.each)(l,(function(t,n){(0,M.isObject)(t)&&!(0,M.isArray)(t)?e[n]=(0,M.deepMix)({},e[n],t):e[n]=l[n]||e[n]}))}if(n.emit("beforeadditem",{type:t,model:e}),t===Ks||t===$s){var h=void 0,f=void 0;if(h=e.source,f=e.target,h&&(0,M.isString)(h)&&(h=n.findById(h)),f&&(0,M.isString)(f)&&(f=n.findById(f)),!h||!f)return void console.warn("The source or target node of edge ".concat(e.id," does not exist!"));h.getType&&"combo"===h.getType()&&(e.isComboEdge=!0),f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),a=new Bs({model:e,source:h,target:f,styles:s,linkCenter:n.get("linkCenter"),group:i.addGroup()})}else if(t===Xs)a=new Vs({model:e,styles:s,group:i.addGroup()});else if(t===Qs){var d=e.children,p=Cn(d,n),g=void 0,m=void 0;if(isNaN(p.x)?isNaN(e.x)&&(g=100*Math.random()):g=p.x,isNaN(p.y)?isNaN(e.y)&&(m=100*Math.random()):m=p.y,isNaN(e.x)||isNaN(e.y))e.x=g,e.y=m;else{var v=e.x-g,y=e.y-m;this.updateComboSucceeds(e.id,v,y,d)}var b=i.addGroup();b.setZIndex(e.depth),a=new qs({model:e,styles:s,animate:n.get("animate"),bbox:e.collapsed?Cn([],n):p,group:b}),e.collapsed||"circle"!==a.getKeyShape().get("type")||(p.width=Math.hypot(p.height,p.width),p.height=p.width,a.set("bbox",p),a.refresh());var x=a.getModel();(d||[]).forEach((function(t){var e=n.findById(t.id);a.addChild(e),t.depth=x.depth+2}))}if(a)return a.setOptimize(n.getNodes().length>n.get("optimizeThreshold")),n.get("".concat(t,"s")).push(a),n.get("itemMap")[a.get("id")]=a,n.emit("afteradditem",{item:a,model:e}),a},t.prototype.updateItem=function(t,e){var n,r,i=this,o=this.graph;if((0,M.isString)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a="";t.getType&&(a=t.getType());var s=o.get(a+Js),u=t.getModel(),c=u.x,l=u.y,h=t.getUpdateType(e);if(s){var f=s((0,M.deepMix)({},u,e)),d=(0,M.deepMix)({},u,f,e);f.stateStyles&&(t.set("styles",d.stateStyles),delete d.stateStyles),(0,M.each)(d,(function(t,n){e[n]=t}))}else(0,M.each)(e,(function(t,n){u[n]&&(0,M.isObject)(t)&&!(0,M.isArray)(t)&&(e[n]=P(P({},u[n]),e[n]))}));if(o.emit("beforeupdateitem",{item:t,cfg:e}),a===Ks){if(e.source){var p=e.source;(0,M.isString)(p)&&(p=o.findById(p)),t.setSource(p)}if(e.target){var g=e.target;(0,M.isString)(g)&&(g=o.findById(g)),t.setTarget(g)}t.update(e)}else if(a===Xs){t.update(e,h);var m=t.getEdges();"move"===h?(0,M.each)(m,(function(t){i.edgeToBeUpdateMap[t.getID()]={edge:t,updateType:h},i.throttleRefresh()})):(null==h?void 0:h.includes("bbox"))&&(0,M.each)(m,(function(t){t.refresh(h)}))}else if(a===Qs){if(t.update(e,h),!isNaN(e.x)||!isNaN(e.y)){var v=e.x-c||0,y=e.y-l||0;this.updateComboSucceeds(u.id,v,y)}var b=t.getEdges();if(((null==h?void 0:h.includes("bbox"))||"move"===h)&&a===Qs){var x=t.get("shapeFactory"),w=u.type||"circle";(void 0===u.animate||void 0===e.animate?null===(r=null===(n=x[w])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:u.animate||e.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(0,M.each)(b,(function(t){t&&!t.destroyed&&t.refresh()}))}}),201):(0,M.each)(b,(function(t){t.refresh()}))}}t.setOptimize(o.getNodes().length>o.get("optimizeThreshold")),o.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e,n){var r,i,o=this,a=this.graph;if((0,M.isString)(t)&&(t=a.findById(t)),t&&!t.destroyed){var s=t.getModel(),u=Cn(e,a,t),c=u.x,l=u.y;t.set("bbox",u);var h=c,f=l;n?(h=isNaN(s.x)?c:s.x,f=isNaN(s.y)?l:s.y):(h=isNaN(c)?s.x:c,f=isNaN(l)?s.y:l),t.update({x:h,y:f});var d=t.get("shapeFactory"),p=s.type||"circle";(void 0===s.animate?null===(i=null===(r=d[p])||void 0===r?void 0:r.options)||void 0===i?void 0:i.animate:s.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(t.getShapeCfg(s),o.updateComboEdges(t))}}),201):this.updateComboEdges(t)}},t.prototype.updateComboEdges=function(t){for(var e,n,r=t.getEdges()||[],i=0;i-1&&o.splice(a,1),i===Ks){var s=n.get("v".concat(i,"s")),u=s.indexOf(t);u>-1&&s.splice(u,1)}var c=t.get("id");delete n.get("itemMap")[c];var l=n.get("comboTrees"),h=t.get("id");if(i===Xs){var f=t.getModel().comboId;if(l&&f){var d=l,p=!1;l.forEach((function(t){p||wn(t,(function(t){if(t.id===h&&d){var e=d.indexOf(t);return d.splice(e,1),p=!0,!1}return d=t.children,!0}))}))}for(var g=(b=t.getEdges()).length-1;g>=0;g--)n.removeItem(b[g],!1);f&&n.updateCombo(f)}else if(i===Qs){var m,v=t.getModel().parentId,y=!1;(l||[]).forEach((function(t){y||wn(t,(function(t){return t.id!==h||(m=t,y=!0,!1)}))})),m.removed=!0,m&&m.children&&m.children.forEach((function(t){e.removeItem(t.id)}));var b;for(g=(b=t.getEdges()).length;g>=0;g--)n.removeItem(b[g],!1);v&&n.updateCombo(v)}t.destroy(),n.emit("afterremoveitem",{item:r,type:i})}},t.prototype.setItemState=function(t,e,n){var r=this.graph,i=e;(0,M.isString)(n)&&(i="".concat(e,":").concat(n)),t.hasState(i)===n&&n||(0,M.isString)(n)&&t.hasState(i)||(r.emit("beforeitemstatechange",{item:t,state:i,enabled:n}),t.setState(e,n),r.autoPaint(),r.emit("afteritemstatechange",{item:t,state:i,enabled:n}))},t.prototype.priorityState=function(t,e){var n=this.graph,r=t;(0,M.isString)(t)&&(r=n.findById(t)),this.setItemState(r,e,!1),this.setItemState(r,e,!0)},t.prototype.clearItemStates=function(t,e){var n=this.graph;(0,M.isString)(t)&&(t=n.findById(t)),n.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),n.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;(0,M.isString)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var n=this,r=this.graph;(t||[]).forEach((function(t){_n(t,(function(t){var r;return e.forEach((function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,r=e)})),r&&n.addItem("combo",r),!0}))}));var i=r.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var n=this,r=this.graph;if((0,M.isString)(t)&&(t=r.findById(t)),t){if(r.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&t.getType()===Xs){var i=t.getEdges();(0,M.each)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}else if(t.getType&&t.getType()===Qs){var o=r.get("comboTrees"),a=t.get("id"),s=[],u=!1;(o||[]).forEach((function(t){u||t.children&&0!==t.children.length&&wn(t,(function(t){return t.id!==a||(s=t.children,u=!0,!1)}))})),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach((function(t){var i=r.findById(t.id);n.changeItemVisibility(i,e)}));i=t.getEdges();(0,M.each)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}return r.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),nu=eu,ru=function(){function t(t){this.graph=t,this.destroyed=!1}return t.prototype.updateState=function(t,e,n){var r=this.graph.get("states"),i=e;(0,M.isString)(n)&&(i="".concat(e,":").concat(n)),r[i]||(r[i]=[]),n?r[i].push(t):r[i]=r[i].filter((function(e){return e!==t})),this.graph.set("states",r),this.graph.emit("graphstatechange",{states:r})},t.prototype.updateStates=function(t,e,n){var r=this.graph.get("states");((0,M.isString)(e)?[e]:e).forEach((function(e){var i=e;r[i]||(r[i]=[]),(0,M.isString)(n)&&(i="".concat(e,":").concat(n)),n?r[i].push(t):r[i]=r[i].filter((function(e){return e!==t}))})),this.graph.set("states",r),this.graph.emit("graphstatechange",{states:e})},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),iu=ru,ou=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){if("\\"===t.charAt(0))return t.slice(1);var r=e[n];return 0===r&&(r="0"),r||""})):t},au=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's ".concat(t.length));for(var n=0,r=t;n0?s-1:o-1,c=me.normalize([0,0],me.add([0,0],a[u].v,me.scale([0,0],a[s].v,-1)));a[s].p=me.add([0,0],a[s].p,me.scale([0,0],c,e))}return a.map((function(t){var e=t.p;return{x:e[0],y:e[1]}}))}var mu=function(t,e){for(var n=[],r=0;r<5;r++){var i=Math.cos((18+72*r)/180*Math.PI)*t,o=Math.sin((18+72*r)/180*Math.PI)*t,a=Math.cos((54+72*r)/180*Math.PI)*e,s=Math.sin((54+72*r)/180*Math.PI)*e;0===r?n.push(["M",i,-o]):n.push(["L",i,-o]),n.push(["L",a,-s])}return n.push(["Z"]),n},vu=function(t,e,n){return(t.y-n.y)*(e.x-n.x)-(t.x-n.x)*(e.y-n.y)},yu=function(t){var e=t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}}));e.sort((function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x}));for(var n={},r=e.length-1;r>=0;r--){var i=e[r],o=i.x,a=i.y;n["".concat(o,"-").concat(a)]&&e.splice(r,1),n["".concat(o,"-").concat(a)]=!0}if(1===e.length)return e;var s=[];for(r=0;r=2&&vu(s[s.length-2],s[s.length-1],e[r])<=0;)s.pop();s.push(e[r])}var u=[];for(r=e.length-1;r>=0;r--){for(;u.length>=2&&vu(u[u.length-2],u[u.length-1],e[r])<=0;)u.pop();u.push(e[r])}return u.pop(),s.pop(),s.concat(u)},bu={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function xu(t,e,n){var r=!1,i=function(t,n){return e.cells[t+n*e.width]},o=function(t,e){var r=0;return i(t-1,e-1)>=n&&(r+=1),i(t,e-1)>n&&(r+=2),i(t-1,e)>n&&(r+=4),i(t,e)>n&&(r+=8),r},a=function(n,r){for(var i,a,s=n,u=r,c=0;c-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var l=o(s,u);switch(l){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: ".concat(l)),!0}}};this.march=function(){for(var t=0;tn&&15!==o(t,s)&&(r=a(t,s));return r}}var wu=function(t,e){var n=Number.POSITIVE_INFINITY,r=null;return t.forEach((function(t){var i=Ge(t,e);i>=0&&i0?t+1:t}),0);s*Math.pow(c+1,2)=1;)f=Mu(n,l/=1.5,h,s),d=u(f,o)||u(f,i),p=c(f,e);!f||d||s&&p||(o.push(new je(t.x1,t.y1,f.x,f.y)),o.push(new je(f.x,f.y,t.x2,t.y2)),a=!0)};f(!0),a||f(!1)}}a||i.push(t),s+=1};!a&&o.length;)l()}for(;o.length;)i.push(o.pop());return i}(new je(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y),e,r,i),s=function(t){for(var n=[];t.length>0;){var r=t.pop();if(0===t.length){n.push(r);break}var i=t.pop(),o=new je(r.x1,r.y1,i.x2,i.y2);wu(e,o)?(n.push(r),t.push(i)):t.push(o)}return n}(a);return s}var Su=function(t,e,n){var r=Object.assign(bu,n),i=Ze(t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}})));t=t.sort((function(t,e){return We({x:t.getModel().x,y:t.getModel().y},i)-We({x:e.getModel().x,y:e.getModel().y},i)}));var o=[],a=[];t.forEach((function(t){_u(t,e,o,r.maxRoutingIterations,r.morphBuffer).forEach((function(t){a.push(t)})),o.push(t)}));for(var s,u,c,l,h,f=function(t,e,n){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach((function(t){i.push(t.getBBox())})),e.forEach((function(t){i.push(t.getBBox())}));for(var o=0,a=i;or.maxX?s.maxX:r.maxX)+n,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+n}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}(t,a,r.nodeR0),d=(s=f.width,u=f.height,c=r.pixelGroupSize,l=Math.ceil(s/c),h=Math.ceil(u/c),{cells:new Float32Array(Math.max(0,l*h)).fill(0),width:l,height:h}),p=[],g=[],m=0;m1)for(y=Math.floor(v.length/r.skip);y<3&&r.skip>1;)r.skip-=1,y=Math.floor(v.length/r.skip);for(var b=0,x=0;x0))break;r.nonMemberInfluenceFactor*=.8}}return g};function Eu(t,e,n,r,i,o){function a(t,e){var n=Math.floor((t-e)/o.pixelGroupSize);return n<0?0:n}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),c=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),l=function(t,e){return[Math.min(a(t.minX,e+r.minX),i.width),Math.min(a(t.minY,e+r.minY),i.height),Math.min(a(t.maxX,-e+r.minX),i.width),Math.min(a(t.maxY,-e+r.minY),i.height)]},h=function(t,e){for(var n=t.getBBox(),a=l(n,o.nodeR1),u=a[0],c=a[1],h=a[2],f=a[3],d=c;du.y?r?c.topLeft:c.bottomRight:r?c.topRight:c.bottomLeft:a.ys.x?r?c.topLeft:c.bottomRight:r?c.bottomLeft:c.topRight:o.x0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var n,r,i;switch(this.type){case"round-convex":r=Ka(i=pu((n=yu(t)).map((function(t){return[t.x,t.y]})),this.padding));break;case"smooth-convex":2===(n=yu(t)).length?r=Ka(i=pu(n.map((function(t){return[t.x,t.y]})),this.padding)):n.length>2&&(i=gu(n.map((function(t){return[t.x,t.y]})),this.padding),r=lu(i));break;case"bubble":r=(n=Su(t,e,this.cfg.bubbleCfg)).length>=2&&lu(n)}return r},t.prototype.render=function(){this.group.addShape("path",{attrs:P({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},t.prototype.addMember=function(t){if(t){(0,M.isString)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){(0,M.isString)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){(0,M.isString)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){(0,M.isString)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var n=this;this.group.findById(this.id).remove(),t&&(this.members=t.map((function(t){return(0,M.isString)(t)?n.graph.findById(t):t}))),e&&(this.nonMembers=e.map((function(t){return(0,M.isString)(t)?n.graph.findById(t):t}))),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr(P({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=(0,M.deepMix)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map((function(t){return(0,M.isString)(t)?e.graph.findById(t):t}))),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map((function(t){return(0,M.isString)(t)?e.graph.findById(t):t}))),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,n,r=this,i=(e=(0,M.isString)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))n=cu(i.attr("path"));else{var o=i.getCanvasBBox();n=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return n=n.map((function(t){var e=r.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]})),Be(n,cu(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),Au=Tu,Cu=H,ku=function(t){function e(e){var n=t.call(this)||this;return n.sortCombos=(0,M.debounce)((function(){var t=n.get("comboSorted");if(n&&!n.destroyed&&!t){n.set("comboSorted",!0);var e=[],r={};(n.get("comboTrees")||[]).forEach((function(t){wn(t,(function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],r[t.id]=t.depth,!0}))})),(n.getEdges().concat(n.get("vedges"))||[]).forEach((function(t){var n=t.getModel(),i=r[n.source]||0,o=r[n.target]||0,a=Math.max(i,o);e[a]?e[a].push(n.id):e[a]=[n.id]})),e.forEach((function(t){if(t&&t.length)for(var e=t.length-1;e>=0;e--){var r=n.findById(t[e]);r&&r.toFront()}}))}}),500,!1),n.cfg=(0,M.deepMix)(n.getDefaultCfg(),e),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new fe(n.cfg.maxStep),n.redoStack=new fe(n.cfg.maxStep)),n}return O(e,t),e.prototype.init=function(){this.initCanvas();var t=new ys(this),e=new Ln(this),n=new nu(this),r=new iu(this);this.set({viewController:t,modeController:e,itemController:n,stateController:r}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(t){var e=(t.get("el")||{}).id,n=void 0===e?"g6":e,r=t.addGroup({id:"".concat(n,"-root"),className:cn.rootContainerClassName});if(this.get("groupByTypes")){var i=r.addGroup({id:"".concat(n,"-edge"),className:cn.edgeContainerClassName}),o=r.addGroup({id:"".concat(n,"-node"),className:cn.nodeContainerClassName}),a=r.addGroup({id:"".concat(n,"-combo"),className:cn.comboContainerClassName});a.toBack(),this.set({nodeGroup:o,edgeGroup:i,comboGroup:a})}var s=r.addGroup({id:"".concat(n,"-delegate"),className:cn.delegateContainerClassName});this.set({delegateGroup:s}),this.set("group",r)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[],optimizeThreshold:1e3}},e.prototype.set=function(t,e){return(0,M.isPlainObject)(t)?this.cfg=P(P({},this.cfg),t):this.cfg[t]=e,"enabledStack"!==t||!e||this.undoStack||this.redoStack||(this.undoStack=new fe(this.cfg.maxStep),this.redoStack=new fe(this.cfg.maxStep)),this},e.prototype.get=function(t){var e;return null===(e=this.cfg)||void 0===e?void 0:e[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){(0,M.isString)(t)&&(t=this.findById(t));var n=this.get("itemController");e||(e=t.get("states")),n.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var n,r=this.get("".concat(t,"s"));return(0,M.each)(r,(function(t,r){if(e(t,r))return n=t})),n},e.prototype.findAll=function(t,e){var n=[];return(0,M.each)(this.get("".concat(t,"s")),(function(t,r){e(t,r)&&n.push(t)})),n},e.prototype.findAllByState=function(t,e,n){return n?this.findAll(t,(function(t){return t.hasState(e)&&n(t)})):this.findAll(t,(function(t){return t.hasState(e)}))},e.prototype.translate=function(t,e,n,r){var i=this,o=this.get("group"),a=(0,M.clone)(o.getMatrix());if(a||(a=[1,0,0,0,1,0,0,0,1]),n){var s=On({animateCfg:r,callback:function(){return i.emit("viewportchange",{action:"translate",matrix:o.getMatrix()})}});Pe(o,{x:o.getCanvasBBox().x+t,y:o.getCanvasBBox().y+e},n,s||{duration:500,easing:"easeCubic"})}else a=Cu(a,[["t",t,e]]),o.setMatrix(a),this.emit("viewportchange",{action:"translate",matrix:a}),this.autoPaint()},e.prototype.moveTo=function(t,e,n,r){var i=this.get("group");Pe(i,{x:t,y:e},n,r||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},e.prototype.fitView=function(t,e,n,r){t&&this.set("fitViewPadding",t);var i=this.get("viewController");e?i.fitViewByRules(e,n,r):i.fitView(n,r),this.autoPaint()},e.prototype.fitCenter=function(t,e){this.get("viewController").fitCenter(t,e),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.updateBehavior=function(t,e,n){return this.get("modeController").updateBehavior(t,e,n),this},e.prototype.zoom=function(t,e,n,r){var i=this,o=this.get("group"),a=(0,M.clone)(o.getMatrix())||[1,0,0,0,1,0,0,0,1],s=this.get("minZoom"),u=this.get("maxZoom"),c=this.getZoom()||1,l=c*t,h=t,f=!1;if(s&&lu&&(h=u/c,f=!0),a=Cu(a,e?[["t",-e.x,-e.y],["s",h,h],["t",e.x,e.y]]:[["s",h,h]]),n){var d=(0,M.clone)(o.getMatrix());d||(d=[1,0,0,0,1,0,0,0,1]);var p=d[0],g=p*h,m=On({animateCfg:r,callback:function(){return i.emit("viewportchange",{action:"zoom",matrix:o.getMatrix()})}});o.animate((function(t){if(1===t)d=a;else{var n=$e(p,g,t)/d[0];d=Cu(d,e?[["t",-e.x,-e.y],["s",n,n],["t",e.x,e.y]]:[["s",n,n]])}return{matrix:d}}),m)}else o.setMatrix(a),this.emit("viewportchange",{action:"zoom",matrix:a}),this.autoPaint();return!f},e.prototype.zoomTo=function(t,e,n,r){var i=t/this.getZoom();return this.zoom(i,e,n,r)},e.prototype.focusItem=function(t,e,n){var r=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};n?o=n:void 0===n&&(o=this.get("animateCfg")),r.focus(t,i,o),this.autoPaint()},e.prototype.focusItems=function(t,e,n,r){this.get("viewController").focusItems(t,e,n,r)},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!1}],o.nodes=[{id:r,visible:!0}];break;case"edge":i.nodes=[{id:r,visible:!1}],o.edges=[{id:r,visible:!0}];break;case"combo":i.nodes=[{id:r,visible:!1}],o.combos=[{id:r,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!0}],o.nodes=[{id:r,visible:!1}];break;case"edge":i.nodes=[{id:r,visible:!0}],o.edges=[{id:r,visible:!1}];break;case"combo":i.nodes=[{id:r,visible:!0}],o.combos=[{id:r,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var n=t;if((0,M.isString)(t)&&(n=this.findById(t)),!n&&(0,M.isString)(t))console.warn("The item ".concat(t," to be removed does not exist!"));else if(n){var r="";if(n.getType&&(r=n.getType()),e&&this.get("enabledStack")){var i=P(P({},n.getModel()),{itemType:r}),o={};switch(r){case"node":o.nodes=[i],o.edges=[];for(var a=n.getEdges(),s=a.length-1;s>=0;s--)o.edges.push(P(P({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if("node"===r)n.getModel().comboId&&this.updateComboTree(n,void 0,!1);if(this.get("itemController").removeItem(n),"combo"===r){var u=An(this.get("comboTrees"));this.set("comboTrees",u)}}},e.prototype.innerAddItem=function(t,e,n){if(!function(t,e){if("node"===t||"combo"===t){if(e.id&&!(0,M.isString)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(!("edge"!==t||e.source&&e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0}(t,e))return!1;if(!e.id||!this.findById(e.id)){var r,i=this.get("comboTrees")||[];if("combo"===t){var o=this.get("itemMap"),a=!1;if(i.forEach((function(i){a||_n(i,(function(i){if(e.parentId===i.id){a=!0;var s=P({id:e.id,depth:i.depth+2},e);i.children?i.children.push(s):i.children=[s],e.depth=s.depth,r=n.addItem(t,e)}var u=o[i.id];return a&&u&&u.getType&&"combo"===u.getType()&&n.updateCombo(u,i.children),!0}))})),!a){var s=P({id:e.id,depth:0},e);e.depth=s.depth,i.push(s),r=n.addItem(t,e)}this.set("comboTrees",i),e.collapsed&&(this.collapseCombo(r,!1),this.updateCombo(r))}else if("node"===t&&(0,M.isString)(e.comboId)&&i){var u;(u=this.findById(e.comboId))&&u.getType&&"combo"!==u.getType()&&console.warn("'".concat(e.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),r=n.addItem(t,e);var c=this.get("itemMap"),l=!1,h=!1;i.forEach((function(t){h||l||_n(t,(function(t){if(t.id===e.id)return h=!0,!1;if(e.comboId===t.id&&!h){l=!0;var r=(0,M.clone)(e);r.itemType="node",t.children?t.children.push(r):t.children=[r],r.depth=t.depth+1}return l&&c[t.id].getType&&"combo"===c[t.id].getType()&&n.updateCombo(c[t.id],t.children),!0}))}))}else r=n.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(u=this.findById(e.comboId||e.parentId))&&u.getType&&"combo"===u.getType()&&u.addChild(r);return r}console.warn("This item exists already. Be sure the id %c".concat(e.id,"%c is unique."),"font-size: 20px; color: red;","")},e.prototype.addItem=function(t,e,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!r);var o=this.get("itemController"),a=this.innerAddItem(t,e,o);if(!1===a||!0===a)return a;var s=this.get("combos");if(s&&s.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var u=P(P({},a.getModel()),{itemType:t}),c={};switch(t){case"node":c.nodes=[u];break;case"edge":c.edges=[u];break;case"combo":c.combos=[u]}this.pushStack("add",{before:{},after:c})}return a},e.prototype.addItems=function(t,e,n){void 0===t&&(t=[]),void 0===e&&(e=!0),void 0===n&&(n=!0);var r=this.get("comboSorted");this.set("comboSorted",r&&!n);for(var i=this.get("itemController"),o=[],a=0;a0&&this.sortCombos()}if(this.autoPaint(),e&&this.get("enabledStack")){var c={nodes:[],edges:[],combos:[]};for(a=0;a=0;d--)f[d].destroyed&&f.splice(d,1);l&&(i.addCombos(l),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",c,o.edges),(0,M.each)(u,(function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&c.edges.indexOf(t)<0&&(delete u[e],i.remove(t,!1))})),(this.get("comboTrees")||[]).forEach((function(t){_n(t,(function(t){return"combo"===r.findById(t.id).getType()&&t.collapsed&&r.collapseCombo(t.id,!1),!0}))})),this.set({nodes:c.nodes,edges:c.edges});var p=(this.get("layout")||{}).relayoutAtChangeData,g=void 0===p||p,m=this.get("layoutController");return g&&m&&(m.changeData((function(){setTimeout((function(){var t;null===(t=i.getCombos())||void 0===t||t.forEach((function(t){t.set("animate",!0)}))}),0)})),i.get("animate")&&!m.getLayoutType()?(i.positionsAnimate(),null===(n=i.getCombos())||void 0===n||n.forEach((function(t){return t.set("animate",!0)}))):i.autoPaint()),setTimeout((function(){a.set("localRefresh",s)}),16),this.set("data",o),this.emit("afterchangedata"),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e,n){var r=this;void 0===n&&(n=!0);var i=this.get("itemController");this.set("comboSorted",!1);var o,a="";if(t){if((0,M.isString)(t))a=t,o={id:t};else{if(!(a=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");o=t}var s=n&&this.get("enabledStack"),u={nodes:[],combos:[]};s&&e.forEach((function(t){var e=r.findById(t),n=e.getType();if("node"===n||"combo"===n){var i=e.getModel();u["".concat(n,"s")].push({id:t,parentId:"node"===n?i.comboId:i.parentId})}}));var c=this.get("comboTrees"),l=new Set(e),h=new Map;c&&(c.forEach((function(t){_n(t,(function(t,e,n){if(l.has(t.id)){if(e){var o=r.findById(e.id),a=r.findById(t.id);e.children.splice(n,1),o.removeChild(a),i.updateCombo(o,e.children)}"combo"===t.itemType&&h.set(t.id,t)}return!0}))})),c=c.filter((function(t){return!l.has(t.id)})),this.set("comboTrees",c));var f={nodes:[],combos:[]},d=e.map((function(t){var e=r.findById(t),n=e.getModel(),i="";e.getType&&(i=e.getType());var o=h.get(t)||{id:e.getID(),itemType:i};return"combo"===i?(o.parentId=a,n.parentId=a):"node"===i&&(o.comboId=a,n.comboId=a),s&&f["".concat(i,"s")].push({id:n.id,parentId:a}),o}));o.children=d,this.addItem("combo",o,!1),this.set("comboSorted",!1),c&&(c.forEach((function(t){wn(t,(function(t){return t.id!==a||(t.itemType="combo",t.children=d,!1)}))})),this.sortCombos()),s&&(f.combos.push(o),this.pushStack("createCombo",{before:u,after:f}));var p=this.findById(a);!p.getModel().parentId&&p.getChildren().combos.length&&this.updateComboTree(p,void 0,!1),setTimeout((function(){p.set("animate",!0)}),0)}},e.prototype.uncombo=function(t,e){var n,r,i=this;void 0===e&&(e=!0);var o=t;if((0,M.isString)(t)&&(o=this.findById(t)),!o||o.getType&&"combo"!==o.getType())console.warn("The item is not a combo!");else{var a=o.getModel(),s=o.getModel().parentId,u=this.get("comboTrees");u||(u=[]);var c,l=this.get("itemMap"),h=o.get("id"),f=[],d=this.get("combos"),p=this.findById(s),g=e&&this.get("enabledStack"),m={};if(g&&((m=(0,M.clone)(a)).children=[]),u.forEach((function(t){c||_n(t,(function(t){var e;if(t.id===h){c=t;var n=o.getEdges().map((function(t){return t.getID()}));n.forEach((function(t){i.removeItem(t,!1)}));var r=d.indexOf(o);d.splice(r,1),delete l[h];var a=(0,M.clone)(o.getModel());o.destroy(),i.emit("afterremoveitem",{item:a,type:"combo"})}return!s||!c||t.id!==s||(p.removeCombo(o),-1!==(r=(f=t.children).indexOf(c))&&f.splice(r,1),null===(e=c.children)||void 0===e||e.forEach((function(t){var e=i.findById(t.id),n=e.getModel();e.getType&&"combo"===e.getType()?(t.parentId=s,delete t.comboId,n.parentId=s,delete n.comboId):e.getType&&"node"===e.getType()&&(t.comboId=s,n.comboId=s),p.addChild(e),f.push(t)})),i.updateCombo(p),!1)}))})),!s&&c){var v=u.indexOf(c);u.splice(v,1),null===(n=c.children)||void 0===n||n.forEach((function(t){t.parentId=void 0;var e=i.findById(t.id).getModel();delete e.parentId,delete e.comboId,"node"!==t.itemType&&u.push(t)}))}if(g){var y={nodes:[],combos:[]},b={nodes:[],combos:[]};null===(r=c.children)||void 0===r||r.forEach((function(t){var e=i.findById(t.id).getType();"node"!==e&&"combo"!==e||(y["".concat(e,"s")].push({id:t.id,parentId:h}),b["".concat(e,"s")].push({id:t.id,parentId:s}))})),y.combos.push(m),this.pushStack("uncombo",{before:y,after:b})}}},e.prototype.updateCombos=function(t){var e=this;void 0===t&&(t=!1);var n=this,r=this.get("comboTrees"),i=n.get("itemController"),o=n.get("itemMap");(r||[]).forEach((function(n){_n(n,(function(n){var r;if(!n)return!0;var a=o[n.id];if("combo"===(null===(r=null==a?void 0:a.getType)||void 0===r?void 0:r.call(a))){var s=R([],a.getStates(),!0);(0,M.each)(s,(function(t){return e.setItemState(a,t,!1)})),i.updateCombo(a,n.children,t),(0,M.each)(s,(function(t){return e.setItemState(a,t,!0)}))}return!0}))})),n.sortCombos()},e.prototype.updateCombo=function(t){var e,n=this,r=t;if((0,M.isString)(t)&&(r=this.findById(t)),!r||r.getType&&"combo"!==r.getType())console.warn("The item to be updated is not a combo!");else{e=r.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach((function(t){_n(t,(function(t){if(!t)return!0;var r=a[t.id];if(e===t.id&&r&&r.getType&&"combo"===r.getType()){var i=R([],r.getStates(),!0);(0,M.each)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!1)})),o.updateCombo(r,t.children),(0,M.each)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!0)})),e&&(e=t.parentId)}return!0}))}))}},e.prototype.updateComboTree=function(t,e,n){void 0===n&&(n=!0);var r;this.set("comboSorted",!1);var i,o=(r=(0,M.isString)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(r.getType&&(s=r.getType()),e&&"combo"===s){var u,c=this.get("comboTrees"),l=!0;if((c||[]).forEach((function(t){u||wn(t,(function(t){if(!u)return t.id===r.getID()&&(u=t),!0}))})),wn(u,(function(t){return t.id!==e||(l=!1,!1)})),!l)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(n&&this.get("enabledStack")){var h={},f={};"combo"===s?(h.combos=[{id:o.id,parentId:o.parentId}],f.combos=[{id:o.id,parentId:e}]):"node"===s&&(h.nodes=[{id:o.id,parentId:o.comboId}],f.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:h,after:f})}if(o.parentId||o.comboId){var d=this.findById(o.parentId||o.comboId);d&&d.removeChild(r)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(r));a&&((i=this.findById(a))&&i.removeChild(r));var p=An(this.get("comboTrees"),o.id,e);this.set("comboTrees",p),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],n=[];return(0,M.each)(this.get("nodes"),(function(e){t.push(e.getModel())})),(0,M.each)(this.get("edges"),(function(t){e.push(t.getModel())})),(0,M.each)(this.get("combos"),(function(t){n.push(t.getModel())})),{nodes:t,edges:e,combos:n}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){var t=this;if(t.emit("beforegraphrefresh"),t.get("animate"))t.positionsAnimate();else{var e=t.get("nodes"),n=t.get("edges"),r=t.get("edges");(0,M.each)(e,(function(t){t.refresh()})),(0,M.each)(n,(function(t){t.refresh()})),(0,M.each)(r,(function(t){t.refresh()}))}t.emit("aftergraphrefresh"),t.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if((0,M.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(t){var e=this;e.emit("beforeanimate");var n=e.get("animateCfg"),r=n.onFrame,i=t?e.getNodes().concat(e.getCombos()):e.getNodes(),o=i.map((function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}}));e.stopAnimate();var a=e.get("canvas");e.animating=!0,setTimeout((function(){a.animate((function(n){(0,M.each)(o,(function(t){var i=e.findById(t.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model"),s=i.getContainer().getMatrix();if(null==o&&(s&&(o={x:s[6],y:s[7]}),i.set("originAttrs",o||0)),r){var u=r(i,n,t,o||{x:0,y:0});i.set("model",Object.assign(a,u))}else o?(a.x=o.x+(t.x-o.x)*n,a.y=o.y+(t.y-o.y)*n):(a.x=t.x,a.y=t.y)}})),e.refreshPositions(t)}),{duration:n.duration,easing:n.easing,callback:function(){(0,M.each)(i,(function(t){t.set("originAttrs",null)})),n.callback&&n.callback(),e.emit("afteranimate"),e.animating=!1}})}),0)},e.prototype.refreshPositions=function(t){var e=this;e.emit("beforegraphrefreshposition");var n,r=e.get("nodes"),i=e.get("edges"),o=e.get("vedges"),a=e.get("combos"),s={},u=function(t){(0,M.each)(t,(function(t){n=t.getModel();var e=t.get("originAttrs");if(!e||n.x!==e.x||n.y!==e.y){var r=t.updatePosition({x:n.x,y:n.y});s[n.id]=r,n.comboId&&(s[n.comboId]=s[n.comboId]||r),n.parentId&&(s[n.parentId]=s[n.parentId]||r)}}))};u(a),u(r),a&&0!==a.length&&(t?(u(a),e.updateCombos()):e.updateCombos()),(0,M.each)(i,(function(t){var e=t.getSource().getModel(),n=t.getTarget();if(!(0,M.isPlainObject)(n)){var r=n.getModel();(s[e.id]||s[r.id]||t.getModel().isComboEdge)&&t.refresh()}})),(0,M.each)(o,(function(t){t.refresh()})),e.emit("aftergraphrefreshposition"),e.autoPaint()},e.prototype.stopAnimate=function(){var t=this.get("canvas").cfg.timeline;t&&t.stopAllAnimations()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(t){var e;return void 0===t&&(t=!1),null===(e=this.get("canvas"))||void 0===e||e.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,e,n,r){var i=this;void 0===t&&(t={}),void 0===r&&(r=!0);var o=this.get("layoutController");if((0,M.isString)(t)&&(t={type:t}),e){var a=n;a||(a="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),a=this.getPointByCanvas(a.x,a.y);var s=["force","gForce","fruchterman","force2"];s.includes(t.type)||!t.type&&s.includes(null==o?void 0:o.layoutType)?t.center=[a.x,a.y]:this.once("afterlayout",(function(t){var n=i.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];a.x=a.x*n[0]+n[6],a.y=a.y*n[0]+n[7];var r=i.getGroup().getCanvasBBox(),o=r.minX,s=r.maxX,u=r.minY,c={x:(o+s)/2,y:(u+r.maxY)/2};"begin"===e&&(c.x=o,c.y=u),i.translate(a.x-c.x,a.y-c.y)}))}var u=P({},this.get("layout")),c={};Object.assign(c,u,t),t.pipes&&!t.type?delete c.type:!t.pipes&&c.type&&delete c.pipes,this.set("layout",c),o&&(o.isLayoutTypeSame(c)&&c.gpuEnabled===u.gpuEnabled?o.updateLayoutCfg(c):o.changeLayout(c),r&&this.get("enabledStack")&&this.pushStack("layout",{before:u,after:c}))},e.prototype.destroyLayout=function(){var t=this.get("layoutController");null==t||t.destroyLayout()},e.prototype.layout=function(){var t,e=this.get("layoutController"),n=this.get("layout");n&&e&&(n.workerEnabled?e.layout():(null===(t=e.layoutMethods)||void 0===t?void 0:t.length)?e.relayout(!0):e.layout())},e.prototype.collapseCombo=function(t,e){var n=this;if(void 0===e&&(e=!0),!this.destroyed)if((0,M.isString)(t)&&(t=this.findById(t)),t){this.emit("beforecollapseexpandcombo",{action:"collapse",item:t});var r=t.getModel();this.get("itemController").collapseCombo(t,e),r.collapsed=!0;var i=this.getEdges().concat(this.get("vedges")),o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||wn(t,(function(t){if(s&&t.depth<=r.depth)return!1;if(r.id===t.id&&(s=!0),s){var e=n.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0}))}));var u={};i.forEach((function(t){var e=t.getModel(),i=e.isVEdge,a=e.size,s=void 0===a?1:a;if(!t.isVisible()||i){var c,l=t.getSource(),h=t.getTarget(),f=null;if(l.getModel().id===r.id||o.includes(l)&&!o.includes(h)?(f=h,c=!1):(h.getModel().id===r.id||!o.includes(l)&&o.includes(h))&&(f=l,c=!0),f){if(i)return void n.removeItem(t,!1);for(var d=f.getModel();!f.isVisible();){var p=d.parentId,g=d.comboId,m=p||g;if(!(f=n.findById(m))||!m)return;d=f.getModel()}var v=d.id,y=c?{source:v,target:r.id,size:s,isVEdge:!0}:{source:r.id,target:v,size:s,isVEdge:!0},b="".concat(y.source,"-").concat(y.target);if(u[b])return void(u[b].size+=s);u[b]=y}}})),this.addItems(Object.values(u).map((function(t){return{type:"vedge",model:t}})),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t,e){var n=this;if(void 0===e&&(e=!0),(0,M.isString)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var r=t.getModel();this.get("itemController").expandCombo(t,e),r.collapsed=!1;var i=this.getEdges().concat(this.get("vedges")),o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||wn(t,(function(t){if(s&&t.depth<=r.depth)return!1;if(r.id===t.id&&(s=!0),s){var e=n.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0}))}));var u={};i.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var e,i=t.getSource(),a=t.getTarget(),s=i.get("id"),c=a.get("id"),l=null;if(s===r.id||o.includes(i)&&!o.includes(a)?(l=a,e=!1):c===r.id||!o.includes(i)&&o.includes(a)?(l=i,e=!0):o.includes(i)&&o.includes(a)&&i.isVisible()&&a.isVisible()&&t.show(),l){var h=t.getModel(),f=h.isVEdge,d=h.size,p=void 0===d?1:d;if(f)return void n.removeItem(t,!1);for(var g=l.getModel();!l.isVisible();){var m=g.parentId,v=g.comboId,y=m||v;if(!(l=n.findById(y))||!y)return;g=l.getModel()}for(var b=g.id,x=e?a:i,w=x.getModel();!x.isVisible();){var _=w.parentId,S=w.comboId,E=_||S;if(!(x=n.findById(E))||!E)return;if(w.comboId===r.id||w.parentId===r.id)break;w=x.getModel()}var M=w.id;if(b){var T=e?{source:b,target:M,isVEdge:!0,size:p}:{source:M,target:b,isVEdge:!0,size:p},A="".concat(T.source,"-").concat(T.target);if(u[A])return void(u[A].size+=p);u[A]=T}}}})),this.addItems(Object.values(u).map((function(t){return{type:"vedge",model:t}})),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})}},e.prototype.collapseExpandCombo=function(t,e){if(void 0===e&&(e=!0),(0,M.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType())){for(var n=t.getModel(),r=this.findById(n.parentId);r;){var i=r.getModel();if(i.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(r=void 0);r=this.findById(i.parentId)}n.collapsed?this.expandCombo(t,e):this.collapseCombo(t,e),this.updateCombo(t)}},e.prototype.getNeighbors=function(t,e){var n=t;return(0,M.isString)(t)&&(n=this.findById(t)),n.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=!1);var r=t;(0,M.isString)(t)&&(r=this.findById(t));var i=this.get("degrees");i&&!n||(i=it(this.save()),this.set("degrees",i));var o=i[r.getID()],a=0;if(!o)return 0;switch(e){case"in":a=o.inDegree;break;case"out":a=o.outDegree;break;case"all":a=o;break;default:a=o.degree}return a},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},e.prototype.pushStack=function(t,e,n){if(void 0===t&&(t="update"),void 0===n&&(n="undo"),this.get("enabledStack")){var r=e?(0,M.clone)(e):{before:{},after:(0,M.clone)(this.save())};"redo"===n?this.redoStack.push({action:t,data:r}):this.undoStack.push({action:t,data:r}),this.emit("stackchange",{action:t,stackType:n,undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix");return n&&t||(n=G(this.save(),e),this.set("adjMatrix",n)),n},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix"),r=this.get("shortestPathMatrix");return n&&t||(n=G(this.save(),e),this.set("adjMatrix",n)),r&&t||(r=bt(this.save(),e),this.set("shortestPathMatrix",r)),r},e.prototype.on=function(e,n,r){return t.prototype.on.call(this,e,n,r)},e.prototype.destroy=function(){var t,e,n,r,i;this.emit("beforedestroy"),this.clear(),this.clearStack(),null===(t=this.get("itemController"))||void 0===t||t.destroy(),null===(e=this.get("modeController"))||void 0===e||e.destroy(),null===(n=this.get("viewController"))||void 0===n||n.destroy(),null===(r=this.get("stateController"))||void 0===r||r.destroy(),null===(i=this.get("canvas"))||void 0===i||i.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},e.prototype.createHull=function(t){if(t.members&&!(t.members.length<1)){var e=this.get("hullGroup"),n=this.get("hullMap");if(n||(n={},this.set("hullMap",n)),e&&!e.get("destroyed")||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),n[t.id])return console.warn("Existed hull id."),n[t.id];var r=e.addGroup({id:"".concat(t.id,"-container")}),i=new Au(this,P(P({},t),{group:r}));return n[i.id]=i,i}console.warn("Create hull failed! The members is empty.")},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e,n;n=(0,M.isString)(t)?this.getHullById(t):t,null===(e=this.get("hullMap"))||void 0===e||delete e[n.id],n.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();t&&Object.keys(t).length&&(Object.keys(t).forEach((function(e){t[e].destroy()})),this.set("hullMap",{}))},e}(F),Nu=ku;function Ou(t){return Ou="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},Ou(t)}var Pu=H,Iu="-shape",Lu="-label",Du=["startArrow","endArrow"],Ru={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},zu={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:Ru,combo:Ru},Fu="-label-bg",Bu={options:{labelCfg:{style:{fontFamily:cn.windowFontFamily}},descriptionCfg:{style:{fontFamily:cn.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return"move"===e||(null==e?void 0:e.includes("bbox"))?t:(0,M.deepMix)({},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){e.shapeMap={},this.mergeStyle=this.getOptions(t);var n=this.drawShape(t,e);if(n.set("className",this.itemType+Iu),e.shapeMap[this.itemType+Iu]=n,t.label){var r=this.drawLabel(t,e);r.set("className",this.itemType+Lu),e.shapeMap[this.itemType+Lu]=r}return n},afterDraw:function(t,e,n){},drawShape:function(t,e){return null},drawLabel:function(t,e){var n=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},r=this.getLabelStyle(t,n,e),i=r.rotate;delete r.rotate;var o=e.addShape("text",{attrs:r,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&""!==i){var a=o.getBBox(),s=[1,0,0,0,1,0,0,0,1];if(r.rotateCenter)switch(r.rotateCenter){case"center":default:s=Pu(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=Pu(s,[["t",-r.x,-r.y],["r",i],["t",r.x,r.y]]);break;case"leftcenter":s=Pu(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]])}else s=Pu(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);o.setMatrix(s)}if(r.background){var u=this.drawLabelBg(t,e,o),c=this.itemType+Fu;u.set("classname",c),e.shapeMap[c]=u,o.toFront()}return o},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=(0,M.mix)({},r,t.labelCfg),o=this.getLabelBgStyleByPosition(n,i),a=e.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return e.shapeMap["text-bg-shape"]=a,a},getLabelStyleByPosition:function(t,e,n){return{text:t.label}},getLabelBgStyleByPosition:function(t,e){return{}},getLabelStyle:function(t,e,n){var r=this.getLabelStyleByPosition(t,e,n),i="".concat(this.itemType,"Label"),o=cn[i]?cn[i].style:null;return P(P(P({},o),r),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e,n){this.updateShapeStyle(t,e,n),this.updateLabel(t,e,n)},updateShapeStyle:function(t,e,n){var r,i=e.getContainer(),o=e.getKeyShape(),a=(0,M.mix)({},o.attr(),t.style),s=function(t){var e,n=a[t];if((0,M.isPlainObject)(n)){var s=(null===(r=i.shapeMap)||void 0===r?void 0:r[t])||i.find((function(e){return e.get("name")===t}));null==s||s.attr(n)}else o.attr(((e={})[t]=n,e))};for(var u in a)s(u)},updateLabel:function(t,e,n){var r,i,o=e.getContainer(),a=(this.mergeStyle||this.getOptions({},n)||{}).labelCfg,s=void 0===a?{}:a,u=this.itemType+Lu,c=o.shapeMap[u]||o.find((function(t){return t.get("className")===u})),l=this.itemType+Fu,h=o.shapeMap[l]||o.find((function(t){return t.get("className")===l}));if(c&&void 0===t.label&&(o.removeChild(c),delete o.shapeMap[u],h&&(o.removeChild(h),delete o.shapeMap[l])),t.label||""===t.label)if(c){(!n||"bbox|label"===n||"edge"===this.itemType&&"style"!==n)&&(s=(0,M.deepMix)(s,t.labelCfg));var f=this.getLabelStyleByPosition(t,s,o),d=null===(r=t.labelCfg)||void 0===r?void 0:r.style,p=P(P({},f),d),g=p.rotate;if(delete p.rotate,isNaN(g)||""===g)1!==(null===(i=c.getMatrix())||void 0===i?void 0:i[4])&&c.resetMatrix(),c.attr(p);else{var m=[1,0,0,0,1,0,0,0,1];m=Pu(m,[["t",-p.x,-p.y],["r",g],["t",p.x,p.y]]),p.matrix=m,c.attr(p)}if(h)if(p.background){var v=this.getLabelBgStyleByPosition(c,s);h.attr(v)}else o.removeChild(h);else p.background&&((h=this.drawLabelBg(t,o,c)).set("classname",l),o.shapeMap[l]=h,c.toFront())}else{var y=this.drawLabel(t,o);y.set("className",u),o.shapeMap[u]=y}},afterUpdate:function(t,e){},setState:function(t,e,n){var r,i,o,a=n.get("keyShape");if(a&&!a.destroyed){var s=n.getType(),u=(0,M.isBoolean)(e)?t:"".concat(t,":").concat(e),c=this.getStateStyle(u,n),l=n.getStateStyle(u);if(l||c){var h=(0,M.mix)({},l||c),f=n.getContainer(),d={x:1,y:1,cx:1,cy:1,matrix:1};if("combo"===s&&(d.r=1,d.width=1,d.height=1),e){var p=function(t){var e,n=h[t];if((0,M.isPlainObject)(n)&&!Du.includes(t)){var r=(null===(o=f.shapeMap)||void 0===o?void 0:o[t])||f.find((function(e){return e.get("name")===t}));null==r||r.attr(n)}else a.attr(((e={})[t]=n,e))};for(var g in h)p(g)}else{var m=Nn(n.getCurrentStatesStyle()),v=n.getModel(),y=(0,M.mix)({},v.style,Nn(n.getOriginStyle())),b=a.get("name"),x=a.attr(),w={};Object.keys(x).forEach((function(t){if("img"!==t){var e=x[t];e&&"object"===Ou(e)?w[t]=(0,M.clone)(e):w[t]=e}}));var _={},S=function(t){var e=h[t];if((0,M.isPlainObject)(e)&&!Du.includes(t)){var n=f.shapeMap[t]||f.find((function(e){return e.get("name")===t}));if(n){var r=Nn(n.attr());(0,M.each)(e,(function(e,i){if(t===b&&w[i]&&!d[i]){delete w[i];var o=y[t][i]||zu[s][i];a.attr(i,o)}else if(r[i]||0===r[i]){delete r[i];var u=y[t][i]||zu[s][i];n.attr(i,u)}})),_[t]=r}}else if(w[t]&&!d[t]){delete w[t];var i=y[t]||(y[b]?y[b][t]:void 0)||zu[s][t];a.attr(t,i)}};for(var E in h)S(E);for(var g in b?_[b]=w:(0,M.mix)(_,w),m)if(!d[g]){var T=m[g];(0,M.isPlainObject)(T)&&!Du.includes(g)||(b?((0,M.mix)(y[b],((i={})[g]=T,i)),delete y[g]):(0,M.mix)(y,((r={})[g]=T,r)),delete m[g])}var A={};(0,M.deepMix)(A,y,_,m);var C=!1,k=function(t){var e,n,r=A[t];if((0,M.isPlainObject)(r)&&!Du.includes(t)){var i=f.shapeMap[t]||f.find((function(e){return e.get("name")===t}));i&&(("text"===i.get("type")||i.get("labelRelated"))&&(delete r.x,delete r.y,delete r.matrix),t===b&&("combo"===s&&(delete r.r,delete r.width,delete r.height),C=!0),i.attr(r))}else if(!C){var o=r||zu[s][t];"combo"===s?b||a.attr(((e={})[t]=o,e)):a.attr(((n={})[t]=o,n))}};for(var N in A)k(N)}}}},getStateStyle:function(t,e){var n=e.getModel(),r=e.getType(),i=this.getOptions(n),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,u=n.stateStyles?n.stateStyles[t]:o&&o[t];return"combo"===r?(0,M.clone)(u):(0,M.mix)({},s,u)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e,n;return(null==t?void 0:t.anchorPoints)||(null===(e=this.getCustomConfig(t))||void 0===e?void 0:e.anchorPoints)||(null===(n=this.options)||void 0===n?void 0:n.anchorPoints)}},ju={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:cn.nodeLabel.offset,getSize:function(t){var e,n=(null===(e=this.mergeStyle)||void 0===e?void 0:e.size)||t.size||this.getOptions({}).size||cn.defaultNode.size;return(0,M.isArray)(n)&&1===n.length&&(n=[n[0],n[0]]),(0,M.isArray)(n)||(n=[n,n]),n},getLabelStyleByPosition:function(t,e){var n=e.maxLength,r=t.label;n&&(r=Mn(r,n));var i=e.position||this.labelPosition;if("center"===i)return{x:0,y:0,text:r,textBaseline:"middle",textAlign:"center"};var o=e.offset;(0,M.isNil)(o)&&(o=this.offset);var a,s=this.getSize(t);switch(i){case"top":a={x:0,y:-s[1]/2-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":a={x:0,y:s[1]/2+o,textBaseline:"top",textAlign:"center"};break;case"left":a={x:-s[0]/2-o,y:0,textBaseline:"middle",textAlign:"right"};break;default:a={x:s[0]/2+o,y:0,textBaseline:"middle",textAlign:"left"}}return a.text=r,a},getLabelBgStyleByPosition:function(t,e){var n;if(!t)return{};var r=null===(n=e.style)||void 0===n?void 0:n.background;if(!r)return{};var i=t.getBBox(),o=ls(r.padding),a=i.width+o[1]+o[3],s=i.height+o[0]+o[2];return P(P({x:i.minX-o[3],y:i.minY-o[0]},r),{width:a,height:s})},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t),i=e.addShape(n,{attrs:r,draggable:!0,name:"node-shape"});return e.shapeMap["node-shape"]=i,i},updateLinkPoints:function(t,e){var n,r=(this.mergeStyle||this.getOptions(t)).linkPoints,i=e.shapeMap["link-point-left"]||e.find((function(t){return"link-point-left"===t.get("className")})),o=e.shapeMap["link-point-right"]||e.find((function(t){return"link-point-right"===t.get("className")})),a=e.shapeMap["link-point-top"]||e.find((function(t){return"link-point-top"===t.get("className")})),s=e.shapeMap["link-point-bottom"]||e.find((function(t){return"link-point-bottom"===t.get("className")}));i&&(n=i.attr()),o&&!n&&(n=o.attr()),a&&!n&&(n=a.attr()),s&&!n&&(n=s.attr()),n||(n=r);var u=(0,M.mix)({},n,t.linkPoints),c=u.fill,l=u.stroke,h=u.lineWidth,f=u.size/2;f||(f=u.r);var d=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},p=d.left,g=d.right,m=d.top,v=d.bottom,y=this.getSize(t),b=y[0],x=y[1],w={r:f,fill:c,stroke:l,lineWidth:h};if(i)p||void 0===p?i.attr(P(P({},w),{x:-b/2,y:0})):(i.remove(),delete e.shapeMap["link-point-left"]);else if(p){var _="link-point-left";e.shapeMap[_]=e.addShape("circle",{attrs:P(P({},w),{x:-b/2,y:0}),className:_,name:_,isAnchorPoint:!0})}if(o)g||void 0===g||(o.remove(),delete e.shapeMap["link-point-right"]),o.attr(P(P({},w),{x:b/2,y:0}));else if(g){var S="link-point-right";e.shapeMap[S]=e.addShape("circle",{attrs:P(P({},w),{x:b/2,y:0}),className:S,name:S,isAnchorPoint:!0})}if(a)m||void 0===m||(a.remove(),delete e.shapeMap["link-point-top"]),a.attr(P(P({},w),{x:0,y:-x/2}));else if(m){var E="link-point-top";e.shapeMap[E]=e.addShape("circle",{attrs:P(P({},w),{x:0,y:-x/2}),className:E,name:E,isAnchorPoint:!0})}if(s)v||void 0===v?s.attr(P(P({},w),{x:0,y:x/2})):(s.remove(),delete e.shapeMap["link-point-bottom"]);else if(v){var T="link-point-bottom";e.shapeMap[T]=e.addShape("circle",{attrs:P(P({},w),{x:0,y:x/2}),className:T,name:T,isAnchorPoint:!0})}},updateShape:function(t,e,n,r,i){e.get("keyShape").attr(P({},n)),this.updateLabel(t,e,i),r&&this.updateIcon(t,e)},updateIcon:function(t,e){var n=this,r=e.getContainer(),i=(this.mergeStyle||this.getOptions(t)).icon,o=t.icon?t.icon:{show:void 0,text:void 0},a=o.show,s=o.text,u=r.shapeMap["".concat(this.type,"-icon")]||r.find((function(t){return t.get("name")==="".concat(n.type,"-icon")}));if(u)if(a||void 0===a){var c=(0,M.mix)({},u.attr(),i),l=c.width,h=void 0===l?20:l,f=c.height,d=void 0===f?20:f;("iconfont"===c.fontFamily||c.hasOwnProperty("text"))&&(h=0,d=0),u.attr(P(P({},c),{x:-h/2,y:-d/2}))}else u.remove(),delete r.shapeMap["".concat(this.type,"-icon")];else if(a){var p="".concat(this.type,"-icon");if(s)r.shapeMap[p]=r.addShape("text",{attrs:P({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:p,name:p});else{h=i.width,d=i.height;r.shapeMap[p]=r.addShape("image",{attrs:P(P({},i),{x:-h/2,y:-d/2}),className:p,name:p})}var g=r.shapeMap["node-label"]||r.find((function(t){return"node-label"===t.get("name")}));g&&g.toFront()}}},Uu=P(P({},Bu),ju);Ns.registerNode("single-node",Uu);var Vu="edge-shape";var Hu={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:cn.defaultEdge.size,style:{x:0,y:0,stroke:cn.defaultEdge.style.stroke,lineAppendWidth:cn.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:cn.edgeLabel.style.fill,fontSize:cn.edgeLabel.style.fontSize,fontFamily:cn.windowFontFamily}},stateStyles:P({},cn.edgeStateStyles)},getPath:function(t){var e=[];return(0,M.each)(t,(function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=(0,M.mix)({},e,n,t.style),i=t.size||cn.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),u=[o];s&&(u=u.concat(s)),u.push(a);var c=this.getPath(u);return(0,M.mix)({},cn.defaultEdge.style,{stroke:cn.defaultEdge.color,lineWidth:i,path:c},r)},updateShapeStyle:function(t,e,n){var r,i=e.getContainer(),o=(null===(r=e.getKeyShape)||void 0===r?void 0:r.call(e))||i.shapeMap["edge-shape"],a=t.size,s=(t=this.getPathPoints(t)).startPoint,u=t.endPoint,c=this.getControlPoints(t),l=[s];c&&(l=l.concat(c)),l.push(u);var h=o.attr(),f=t.style||{};void 0===f.stroke&&(f.stroke=t.color);var d=t.sourceNode,p=t.targetNode,g={radius:f.radius};c||(g={source:d,target:p,offset:f.offset,radius:f.radius});var m=this.getPath(l,g),v={};"move"===n?v={path:m}:(h.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),h.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""}),void 0===(v=P({},t.style)).lineWidth&&(v.lineWidth=((0,M.isNumber)(a)?a:null==a?void 0:a[0])||h.lineWidth),void 0===v.path&&(v.path=m),void 0===v.stroke&&(v.stroke=h.stroke||t.color)),o&&o.attr(v)},getLabelStyleByPosition:function(t,e,n){var r,i=e.position||this.labelPosition,o={},a=null==n?void 0:n.shapeMap[Vu];r="start"===i?0:"end"===i?1:.5;var s,u=e.refX||this.refX,c=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+u,o.y=t.startPoint.y+c,o.text=t.label,o;s=(0,M.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var l=yn(a,r,u,c,s);return o.x=l.x,o.y=l.y,o.rotate=l.rotate,o.textAlign=this._getTextAlign(i,l.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e){if(!t)return{};var n=t.getBBox(),r=e.style&&e.style.background;if(!r)return{};var i=r.padding,o=n.width+i[1]+i[3],a=n.height+i[0]+i[2],s=P(P({},r),{width:o,height:a,x:n.minX-i[3],y:n.minY-i[0],matrix:[1,0,0,0,1,0,0,0,1]});return((0,M.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate)&&(s.matrix=t.attr("matrix")||[1,0,0,0,1,0,0,0,1]),s},_getTextAlign:function(t,e){var n="center";return e?(e%=2*Math.PI,"center"!==t&&(n=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),n):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var n=this.getShapeStyle(t),r=e.addShape("path",{className:Vu,name:Vu,attrs:n});return e.shapeMap[Vu]=r,r},drawLabel:function(t,e){var n=this.options.labelCfg,r=(0,M.deepMix)({},n,t.labelCfg),i=this.getLabelStyle(t,r,e),o=i.rotate;delete i.rotate;var a=e.addShape("text",{attrs:i,name:"text-shape",labelRelated:!0,draggable:!0});if(e.shapeMap["text-shape"]=a,isNaN(o)||""===o||a.rotateAtStart(o),i.background){var s=this.drawLabelBg(t,e,a,i,o),u=this.itemType+Fu;s.set("classname",u),e.shapeMap[u]=s,a.toFront()}return a},drawLabelBg:function(t,e,n,r,i){var o=this.options.labelCfg,a=(0,M.deepMix)({},o,t.labelCfg),s=this.getLabelBgStyleByPosition(n,a),u=e.addShape("rect",{name:"text-bg-shape",attrs:s,labelRelated:!0});return e.shapeMap["text-bg-shape"]=u,u}},Gu=P(P({},Bu),Hu);Ns.registerEdge("single-edge",Gu),Ns.registerEdge("line",{getControlPoints:function(){}},"single-edge"),Ns.registerEdge("spline",{getPath:function(t){return au(t)}},"single-edge"),Ns.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,n,r=t.startPoint,i=t.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2;if(void 0!==t.controlPoints){if(n=t.controlPoints[0],e=Te(r,n,i),r.x<=i.x&&r.y>i.y?this.clockwise=e.x>n.x?0:1:r.x<=i.x&&r.yn.x?1:0:r.x>i.x&&r.y<=i.y?this.clockwise=e.y=t&&i<=t+n&&o>=e&&o<=e+r}function fc(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY=0&&a<.5*Math.PI?(r={x:u.minX,y:u.minY},i={x:u.maxX,y:u.maxY}):.5*Math.PI<=a&&a1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(h*h),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var m=r?g*n*f/r:0,v=n?g*-r*h/n:0,y=(s+c)/2+Math.cos(i)*m-Math.sin(i)*v,b=(u+l)/2+Math.sin(i)*m+Math.cos(i)*v,x=[(h-m)/n,(f-v)/r],w=[(-1*h-m)/n,(-1*f-v)/r],_=_c([1,0],x),S=_c(x,w);return wc(x,w)<=-1&&(S=Math.PI),wc(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:y,cy:b,rx:dc(t,[c,l])?0:n,ry:dc(t,[c,l])?0:r,startAngle:_,endAngle:_+S,xRotation:i,arcFlag:o,sweepFlag:a}}var Ec=Math.sin,Mc=Math.cos,Tc=Math.atan2,Ac=Math.PI;function Cc(t,e,n,r,i,o,a){var s=e.stroke,u=e.lineWidth,c=Tc(r-o,n-i),l=new vl({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*Mc(Ac/6)+","+10*Ec(Ac/6)+" L0,0 L"+10*Mc(Ac/6)+",-"+10*Ec(Ac/6),stroke:s,lineWidth:u}});l.translate(i,o),l.rotateAtPoint(i,o,c),t.set(a?"startArrowShape":"endArrowShape",l)}function kc(t,e,n,r,i,o,a){var s=e.startArrow,u=e.endArrow,c=e.stroke,l=e.lineWidth,h=a?s:u,f=h.d,d=h.fill,p=h.stroke,g=h.lineWidth,m=(0,gr._T)(h,["d","fill","stroke","lineWidth"]),v=Tc(r-o,n-i);f&&(i-=Mc(v)*f,o-=Ec(v)*f);var y=new vl({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:(0,gr.pi)((0,gr.pi)({},m),{stroke:p||c,lineWidth:g||l,fill:d})});y.translate(i,o),y.rotateAtPoint(i,o,v),t.set(a?"startArrowShape":"endArrowShape",y)}function Nc(t,e,n,r,i){var o=Tc(r-e,n-t);return{dx:Mc(o)*i,dy:Ec(o)*i}}function Oc(t,e,n,r,i,o){"object"==typeof e.startArrow?kc(t,e,n,r,i,o,!0):e.startArrow?Cc(t,e,n,r,i,o,!0):t.set("startArrowShape",null)}function Pc(t,e,n,r,i,o){"object"==typeof e.endArrow?kc(t,e,n,r,i,o,!1):e.endArrow?Cc(t,e,n,r,i,o,!1):t.set("startArrowShape",null)}var Ic={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function Lc(t,e){var n=e.attr();for(var r in n){var i=n[r],o=Ic[r]?Ic[r]:r;"matrix"===o&&i?t.transform(i[0],i[1],i[3],i[4],i[6],i[7]):"lineDash"===o&&t.setLineDash?(0,M.isArray)(i)&&t.setLineDash(i):("strokeStyle"===o||"fillStyle"===o?i=bc(t,e,i):"globalAlpha"===o&&(i*=t.globalAlpha),t[o]=i)}}function Dc(t,e,n){for(var r=0;rx?b:x,T=b>x?1:b/x,A=b>x?x/b:1;e.translate(v,y),e.rotate(S),e.scale(T,A),e.arc(0,0,M,w,_,1-E),e.scale(1/T,1/A),e.rotate(-S),e.translate(-v,-y)}break;case"Z":e.closePath()}if("Z"===f)s=u;else{var C=h.length;s=[h[C-2],h[C-1]]}}}}function Vc(t,e){var n=t.get("canvas");n&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(n.refreshElement(t,e,n),n.get("autoDraw")&&n.draw())))}function Hc(t){var e,n,r;if(t.destroyed)e=t._cacheCanvasBBox;else{var i=t.get("cacheCanvasBBox"),o=i&&!(!i.width||!i.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(r=a,e=(n=i)&&r?{minX:Math.min(n.minX,r.minX),minY:Math.min(n.minY,r.minY),maxX:Math.max(n.maxX,r.maxX),maxY:Math.max(n.maxY,r.maxY)}:n||r):o?e=i:s&&(e=a)}return e}var Gc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.onCanvasChange=function(t){Vc(this,t)},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),Lc(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];(0,M.each)(t,(function(t){var r=t.cfg.cacheCanvasBBox;r&&t.cfg.isInView&&(e.push(r.minX,r.maxX),n.push(r.minY,r.maxY))}));var r=null;if(e.length){var i=(0,M.min)(e),o=(0,M.max)(e),a=(0,M.min)(n),s=(0,M.max)(n);r={minX:i,minY:a,x:i,y:a,maxX:o,maxY:s,width:o-i,height:s-a};var u=this.cfg.canvas;if(u){var c=u.getViewRange();this.set("isInView",fc(r,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",r)},e.prototype.draw=function(t,e){var n=this.cfg.children,r=!e||this.cfg.refresh;n.length&&r&&(t.save(),Lc(t,this),this._applyClip(t,this.getClip()),Dc(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(ua),Zc=Gc,Wc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return Zc},e.prototype.onCanvasChange=function(t){Vc(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=fa(t)(this),r=e/2,i=n.x-r,o=n.y-r,a=n.x+n.width+r,s=n.y+n.height+r;return{x:i,minX:i,y:o,minY:o,width:n.width+e,height:n.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),Lc(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!fc(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),Lc(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=fc(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&((0,M.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.isStroke()&&n>0&&((0,M.isNil)(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var n=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(ca),Yc=Wc,qc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,u=o.r,c=i/2,l=lc(a,s,t,e);return r&&n?l<=u+c:r?l<=u:!!n&&(l>=u-c&&l<=u+c)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()},e}(Yc),Xc=qc;function Kc(t,e,n,r){return t/(n*n)+e/(r*r)}var $c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,c=o.rx,l=o.ry,h=(t-s)*(t-s),f=(e-u)*(e-u);return r&&n?Kc(h,f,c+a,l+a)<=1:r?Kc(h,f,c,l)<=1:!!n&&(Kc(h,f,c-a,l-a)>=1&&Kc(h,f,c+a,l+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,r,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(n,r),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(Yc),Qc=$c;function Jc(t){return t instanceof HTMLElement&&(0,M.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var tl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if((0,M.isString)(t)){var r=new Image;r.onload=function(){if(e.destroyed)return!1;e.attr("img",r),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):Jc(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.sx,s=e.sy,u=e.swidth,c=e.sheight,l=e.img;(l instanceof Image||Jc(l))&&((0,M.isNil)(a)||(0,M.isNil)(s)||(0,M.isNil)(u)||(0,M.isNil)(c)?t.drawImage(l,n,r,i,o):t.drawImage(l,a,s,u,c,n,r,i,o))},e}(Yc),el=tl;function nl(t,e,n,r,i,o,a){var s=Math.min(t,n),u=Math.max(t,n),c=Math.min(e,r),l=Math.max(e,r),h=i/2;return o>=s-h&&o<=u+h&&a>=c-h&&a<=l+h&&ba.pointToLine(t,e,n,r,o,a)<=i/2}var rl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&Oc(this,t,r,i,e,n),a&&Pc(this,t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){if(!n||!i)return!1;var o=this.attr();return nl(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};a&&a.d&&(u=Nc(n,r,i,o,e.startArrow.d)),s&&s.d&&(c=Nc(n,r,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,r+u.dy),t.lineTo(i-c.dx,o-c.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return ba.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return ba.pointAt(n,r,i,o,t)},e}(Yc),il=rl,ol={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},al=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return(0,M.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,r=this.attr(),i=r.x,o=r.y,a=r.symbol||"circle",s=this._getR(r);if((0,M.isFunction)(a))n=Ja(n=(t=a)(i,o,s));else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;n=t(i,o,s)}return n},e.prototype.createPath=function(t){Uc(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=ol,e}(Yc),sl=al;function ul(t,e,n){var r=Ua();return t.createPath(r),r.isPointInPath(e,n)}function cl(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function ll(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function hl(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o0!=cl(s[1]-n)>0&&cl(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function fl(t,e,n,r,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(ui)return!1;var c={x:t+n*Math.cos(u),y:e+n*Math.sin(u)};return lc(c.x,c.y,a,s)<=o/2}var dl=H;var pl=(0,gr.pi)({hasArc:function(t){for(var e=!1,n=t.length,r=0;r0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;sv?m:v,S=dl(null,[["t",-p,-g],["r",-x],["s",1/(m>v?1:m/v),1/(m>v?v/m:1)]]);ge.transformMat3(w,w,S),o=fl(0,0,_,y,b,e,w[0],w[1])}if(o)break}}return o}},a);function gl(t,e,n){for(var r=!1,i=0;i=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var o=i[n];if((0,M.isNil)(o)||(0,M.isNil)(n))return null;var a=o.length,s=i[n+1];return Pa.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",pl.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,r,i=0,o=0,a=[],s=this.get("curve");s&&((0,M.each)(s,(function(t,e){n=s[e+1],r=t.length,n&&(i+=Pa.length(t[r-2],t[r-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",i),0!==i?((0,M.each)(s,(function(u,c){n=s[c+1],r=u.length,n&&((t=[])[0]=o/i,e=Pa.length(u[r-2],u[r-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/i,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var r=e[n-2].currentPoint,i=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},e}(Yc),vl=ml;function yl(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),ba.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];(0,M.each)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=ba.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Yc),_l=wl;var Sl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,u=o.width,c=o.height,l=o.radius;if(l){var h=!1;return n&&(h=function(t,e,n,r,i,o,a,s){return nl(t+i,e,t+n-i,e,o,a,s)||nl(t+n,e+i,t+n,e+r-i,o,a,s)||nl(t+n-i,e+r,t+i,e+r,o,a,s)||nl(t,e+r-i,t,e+i,o,a,s)||fl(t+n-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||fl(t+n-i,e+r-i,i,0,.5*Math.PI,o,a,s)||fl(t+i,e+r-i,i,.5*Math.PI,Math.PI,o,a,s)||fl(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(a,s,u,c,l,i,t,e)),!h&&r&&(h=ul(this,t,e)),h}var f=i/2;return r&&n?hc(a-f,s-f,u+f,c+f,t,e):r?hc(a,s,u,c,t,e):n?function(t,e,n,r,i,o,a){var s=i/2;return hc(t-s,e-s,n,i,o,a)||hc(t+n-s,e-s,i,r,o,a)||hc(t+s,e+r-s,n,i,o,a)||hc(t-s,e+s,i,r,o,a)}(a,s,u,c,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,r,i,o);else{var s=function(t){var e=0,n=0,r=0,i=0;return(0,M.isArray)(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,[e,n,r,i]}(a),u=s[0],c=s[1],l=s[2],h=s[3];t.moveTo(n+u,r),t.lineTo(n+i-c,r),0!==c&&t.arc(n+i-c,r+c,c,-Math.PI/2,0),t.lineTo(n+i,r+o-l),0!==l&&t.arc(n+i-l,r+o-l,l,0,Math.PI/2),t.lineTo(n+h,r+o),0!==h&&t.arc(n+h,r+o-h,h,Math.PI/2,Math.PI),t.lineTo(n,r+u),0!==u&&t.arc(n+u,r+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(Yc),El=Sl,Ml=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Ha(t)},e.prototype._setText=function(t){var e=null;(0,M.isString)(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var r,i=this.attrs,o=i.textBaseline,a=i.x,s=i.y,u=1*i.fontSize,c=this._getSpaceingY(),l=Va(i.text,i.fontSize,i.lineHeight);(0,M.each)(e,(function(e,i){r=s+i*(c+u)-l+u,"middle"===o&&(r+=l-u-(l-u)/2),"top"===o&&(r+=l-u),(0,M.isNil)(e)||(n?t.fillText(e,a,r):t.strokeText(e,a,r))}))},e.prototype._drawText=function(t,e){var n=this.attr(),r=n.x,i=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=n.text;(0,M.isNil)(a)||(e?t.fillText(a,r,i):t.strokeText(a,r,i))}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&((0,M.isNil)(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&((0,M.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(Yc),Tl=Ml;function Al(t,e,n){var r,i,o=t.getTotalMatrix();if(o){var a=(r=[e,n,1],(i=o)?Lr(Dr(i),r):r);return[a[0],a[1]]}return[e,n]}function Cl(t,e,n){if(t.isCanvas&&t.isCanvas())return!0;if(!br(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var r=Al(t,e,n),i=r[0],o=r[1];if(t.isClipped(i,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&n>=a.minY&&n<=a.maxY}function kl(t,e,n){if(!Cl(t,e,n))return null;for(var r=null,i=t.getChildren(),o=i.length-1;o>=0;o--){var a=i[o];if(a.isGroup())r=kl(a,e,n);else if(Cl(a,e,n)){var s=a,u=Al(a,e,n),c=u[0],l=u[1];s.isInShape(c,l)&&(r=a)}if(r)break}return r}var Nl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,gr.ZT)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return Zc},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||(window?window.devicePixelRatio:1);return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(e,n){return this.get("quickHit")?kl(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=function(t){if(!t.length)return null;var e=[],n=[],r=[],i=[];return(0,M.each)(t,(function(t){var o=Hc(t);o&&(e.push(o.minX),n.push(o.minY),r.push(o.maxX),i.push(o.maxY))})),{minX:(0,M.min)(e),minY:(0,M.min)(n),maxX:(0,M.max)(r),maxY:(0,M.max)(i)}}(e),t&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&fc(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,n))));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&((0,M.clearAnimationFrame)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Lc(t,this),Dc(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),Lc(t,this),Rc(this,n,r),Dc(t,n,r),t.restore()):e.length&&Fc(e),(0,M.each)(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=(0,M.requestAnimationFrame)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(aa),Ol=Nl,Pl={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},Il={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"};function Ll(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Dl(t){var e=Pl[t.type],n=t.getParent();if(!e)throw new Error("the type "+t.type+" is not supported by svg");var r=Ll(e);if(t.get("id")&&(r.id=t.get("id")),t.set("el",r),t.set("attrs",{}),n){var i=n.get("el");i||(i=n.createDom(),n.set("el",i)),i.appendChild(r)}return r}function Rl(t,e){var n=t.get("el"),r=(0,M.toArray)(n.children).sort(e),i=document.createDocumentFragment();r.forEach((function(t){i.appendChild(t)})),n.appendChild(i)}function zl(t){var e=t.attr().matrix;if(e){for(var n=t.cfg.el,r=[],i=0;i<9;i+=3)r.push(e[i]+","+e[i+1]);-1===(r=r.join(",")).indexOf("NaN")?n.setAttribute("transform","matrix("+r+")"):console.warn("invalid matrix:",e)}}function Fl(t,e){var n=t.getClip(),r=t.get("el");if(n){if(n&&!r.hasAttribute("clip-path")){Dl(n),n.createPath(e);var i=e.addClip(n);r.setAttribute("clip-path","url(#"+i+")")}}else r.removeAttribute("clip-path")}function Bl(t,e){e.forEach((function(e){e.draw(t)}))}function jl(t,e){var n=t.get("canvas");if(n&&n.get("autoDraw")){var r=n.get("context"),i=t.getParent(),o=i?i.getChildren():[n],a=t.get("el");if("remove"===e)if(t.get("isClipShape")){var s=a&&a.parentNode,u=s&&s.parentNode;s&&u&&u.removeChild(s)}else a&&a.parentNode&&a.parentNode.removeChild(a);else if("show"===e)a.setAttribute("visibility","visible");else if("hide"===e)a.setAttribute("visibility","hidden");else if("zIndex"===e)!function(t,e){var n=t.parentNode,r=Array.from(n.childNodes).filter((function(t){return 1===t.nodeType&&"defs"!==t.nodeName.toLowerCase()})),i=r[e],o=r.indexOf(t);if(i){if(o>e)n.insertBefore(t,i);else if(o0&&(e?"stroke"in n?this._setColor(t,"stroke",o):"strokeStyle"in n&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),u&&l.setAttribute(Il.strokeOpacity,u),c&&l.setAttribute(Il.lineWidth,c))},e.prototype._setColor=function(t,e,n){var r=this.get("el");if(n)if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n))(i=t.find("gradient",n))||(i=t.addGradient(n)),r.setAttribute(Il[e],"url(#"+i+")");else if(/^[p,P]{1}[\s]*\(/.test(n)){var i;(i=t.find("pattern",n))||(i=t.addPattern(n)),r.setAttribute(Il[e],"url(#"+i+")")}else r.setAttribute(Il[e],n);else r.setAttribute(Il[e],"none")},e.prototype.shadow=function(t,e){var n=this.attr(),r=e||n,i=r.shadowOffsetX,o=r.shadowOffsetY,a=r.shadowBlur,s=r.shadowColor;(i||o||a||s)&&function(t,e){var n=t.cfg.el,r=t.attr(),i={dx:r.shadowOffsetX,dy:r.shadowOffsetY,blur:r.shadowBlur,color:r.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=e.find("filter",i);o||(o=e.addShadow(i)),n.setAttribute("filter","url(#"+o+")")}else n.removeAttribute("filter")}(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&zl(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var n=this.get("el"),r=this.get("canvas").get("el").getBoundingClientRect(),i=t+r.left,o=e+r.top,a=document.elementFromPoint(i,o);return!(!a||!a.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?e+n:0},e}(ca),Gl=Hl,Zl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");(0,M.each)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):Il[e]&&r.setAttribute(Il[e],t)}))},e}(Gl),Wl=Zl,Yl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return(0,gr.ZT)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");if((0,M.each)(e||n,(function(t,e){Il[e]&&r.setAttribute(Il[e],t)})),"function"==typeof n.html){var i=n.html.call(this,n);if(i instanceof Element||i instanceof HTMLDocument){for(var o=r.childNodes,a=o.length-1;a>=0;a--)r.removeChild(o[a]);r.appendChild(i)}else r.innerHTML=i}else r.innerHTML=n.html},e}(Gl),ql=Yl,Xl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");(0,M.each)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):Il[e]&&r.setAttribute(Il[e],t)}))},e}(Gl),Kl=Xl,$l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");(0,M.each)(e||r,(function(t,e){"img"===e?n._setImage(r.img):Il[e]&&i.setAttribute(Il[e],t)}))},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),n=this.get("el");if((0,M.isString)(t))n.setAttribute("href",t);else if(t instanceof window.Image)e.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&(0,M.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var r=document.createElement("canvas");r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.getContext("2d").putImageData(t,0,0),e.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",r.toDataURL())}},e}(Gl),Ql=$l,Jl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");(0,M.each)(e||n,(function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=(0,M.isObject)(e)?t.addArrow(n,Il[i]):t.getDefaultArrow(n,Il[i]);r.setAttribute(Il[i],"url(#"+o+")")}else r.removeAttribute(Il[i]);else Il[i]&&r.setAttribute(Il[i],e)}))},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return ba.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return ba.pointAt(n,r,i,o,t)},e}(Gl),th=Jl,eh={circle:function(t,e,n){return[["M",t,e],["m",-n,0],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["z"]]},triangleDown:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},nh={get:function(t){return eh[t]},register:function(t,e){eh[t]=e},remove:function(t){delete eh[t]},getAll:function(){return eh}},rh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return(0,M.isArray)(t)?t.map((function(t){return t.join(" ")})).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),n=e.x,r=e.y,i=e.r||e.radius,o=e.symbol||"circle";return(t=(0,M.isFunction)(o)?o:nh.get(o))?t(n,r,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=nh,e}(Gl),ih=rh,oh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");(0,M.each)(e||r,(function(e,o){if("path"===o&&(0,M.isArray)(e))i.setAttribute("d",n._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=(0,M.isObject)(e)?t.addArrow(r,Il[o]):t.getDefaultArrow(r,Il[o]);i.setAttribute(Il[o],"url(#"+a+")")}else i.removeAttribute(Il[o]);else Il[o]&&i.setAttribute(Il[o],e)}))},e.prototype._formatPath=function(t){var e=t.map((function(t){return t.join(" ")})).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),n=this.getTotalLength();if(0===n)return null;var r=e?e.getPointAtLength(t*n):null;return r?{x:r.x,y:r.y}:null},e}(Gl),ah=oh,sh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");(0,M.each)(e||n,(function(t,e){"points"===e&&(0,M.isArray)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):Il[e]&&r.setAttribute(Il[e],t)}))},e}(Gl),uh=sh,ch=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");(0,M.each)(e||n,(function(t,e){"points"===e&&(0,M.isArray)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):Il[e]&&r.setAttribute(Il[e],t)}))},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return(0,M.isNil)(e)?(this.set("totalLength",za(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),(0,M.each)(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),ba.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];(0,M.each)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=ba.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Gl),lh=ch;var hh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el"),o=!1,a=["x","y","width","height","radius"];(0,M.each)(e||r,(function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&Il[e]&&i.setAttribute(Il[e],t):(i.setAttribute("d",n._assembleRect(r)),o=!0)}))},e.prototype._assembleRect=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.radius;if(!o)return"M "+e+","+n+" l "+r+",0 l 0,"+i+" l"+-r+" 0 z";var a=function(t){var e=0,n=0,r=0,i=0;return(0,M.isArray)(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}}(o);return(0,M.isArray)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+n],["l "+(r-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(i-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-r)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-i)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(Gl),fh=hh,dh={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},ph={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},gh={left:"left",start:"left",center:"middle",right:"end",end:"end"},mh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return(0,gr.ZT)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,gr.pi)((0,gr.pi)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");this._setFont(),(0,M.each)(e||r,(function(t,e){"text"===e?n._setText(""+t):"matrix"===e&&t?zl(n):Il[e]&&i.setAttribute(Il[e],t)})),i.setAttribute("paint-order","stroke"),i.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),n=e.textBaseline,r=e.textAlign,i=Nr();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",ph[n]||"alphabetic"):t.setAttribute("alignment-baseline",dh[n]||"baseline"),t.setAttribute("text-anchor",gh[r]||"left")},e.prototype._setText=function(t){var e=this.get("el"),n=this.attr(),r=n.x,i=n.textBaseline,o=void 0===i?"bottom":i;if(t)if(~t.indexOf("\n")){var a=t.split("\n"),s=a.length-1,u="";(0,M.each)(a,(function(t,e){0===e?"alphabetic"===o?u+=''+t+"":"top"===o?u+=''+t+"":"middle"===o?u+=''+t+"":"bottom"===o?u+=''+t+"":"hanging"===o&&(u+=''+t+""):u+=''+t+""})),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(Gl),vh=mh,yh=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,bh=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,xh=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function wh(t){var e=t.match(xh);if(!e)return"";var n="";return e.sort((function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])})),(0,M.each)(e,(function(t){t=t.split(":"),n+=''})),n}var _h,Sh,Eh,Mh,Th=function(){function t(t){this.cfg={};var e=null,n=(0,M.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,r,i=yh.exec(t),o=(0,M.mod)((0,M.toRadian)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(n={x:0,y:0},r={x:1,y:1}):.5*Math.PI<=o&&o';e.innerHTML=n},t}(),Oh=Nh,Ph=function(){function t(t,e){this.cfg={};var n=Ll("marker"),r=(0,M.uniqueId)("marker_");n.setAttribute("id",r);var i=Ll("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),n.appendChild(i),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=i,this.id=r;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var n=this.el,r=this.cfg.path,i=this.cfg.d;(0,M.isArray)(r)&&(r=r.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",r),n.appendChild(e),i&&n.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),Ih=Ph,Lh=function(){function t(t){this.type="clip",this.cfg={};var e=Ll("clipPath");this.el=e,this.id=(0,M.uniqueId)("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),Dh=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Rh=function(){function t(t){this.cfg={};var e=Ll("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=Ll("image");e.appendChild(n);var r=(0,M.uniqueId)("pattern_");e.id=r,this.el=e,this.id=r,this.cfg=t;var i=Dh.exec(t)[2];n.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),zh=function(){function t(t){var e=Ll("defs"),n=(0,M.uniqueId)("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var n=this.children,r=null,i=0;i]*>/,Mh={tr:document.createElement("tbody"),tbody:_h,thead:_h,tfoot:_h,td:Sh,th:Sh,"*":document.createElement("div")});var e=Eh.test(t)&&RegExp.$1;e&&e in Mh||(e="*");var n=Mh[e];t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,n.innerHTML=""+t;var r=n.childNodes[0];return r&&n.contains(r)&&n.removeChild(r),r}var Vh=n(6767),Hh=n.n(Vh);function Gh(t){return Gh="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},Gh(t)}var Zh=/^\s+/,Wh=/\s+$/;function Yh(t,e){if(e=e||{},(t=t||"")instanceof Yh)return t;if(!(this instanceof Yh))return new Yh(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(Zh,"").replace(Wh,"").toLowerCase();var e,n=!1;if(hf[t])t=hf[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=Ef.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=Ef.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=Ef.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=Ef.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=Ef.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=Ef.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=Ef.hex8.exec(t))return{r:mf(e[1]),g:mf(e[2]),b:mf(e[3]),a:xf(e[4]),format:n?"name":"hex8"};if(e=Ef.hex6.exec(t))return{r:mf(e[1]),g:mf(e[2]),b:mf(e[3]),format:n?"name":"hex"};if(e=Ef.hex4.exec(t))return{r:mf(e[1]+""+e[1]),g:mf(e[2]+""+e[2]),b:mf(e[3]+""+e[3]),a:xf(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=Ef.hex3.exec(t))return{r:mf(e[1]+""+e[1]),g:mf(e[2]+""+e[2]),b:mf(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==Gh(t)&&(Mf(t.r)&&Mf(t.g)&&Mf(t.b)?(u=t.r,c=t.g,l=t.b,e={r:255*pf(u,255),g:255*pf(c,255),b:255*pf(l,255)},a=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):Mf(t.h)&&Mf(t.s)&&Mf(t.v)?(r=yf(t.s),i=yf(t.v),e=function(t,e,n){t=6*pf(t,360),e=pf(e,100),n=pf(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,r,i),a=!0,s="hsv"):Mf(t.h)&&Mf(t.s)&&Mf(t.l)&&(r=yf(t.s),o=yf(t.l),e=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=pf(t,360),e=pf(e,100),n=pf(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,r,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(n=t.a));var u,c,l;return n=df(n),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}(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 qh(t,e,n){t=pf(t,255),e=pf(e,255),n=pf(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>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(Yh(r));return o}function lf(t,e){e=e||6;for(var n=Yh(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(Yh({h:r,s:i,v:o})),o=(o+s)%1;return a}Yh.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=df(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Xh(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Xh(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=qh(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=qh(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 Kh(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=[vf(Math.round(t).toString(16)),vf(Math.round(e).toString(16)),vf(Math.round(n).toString(16)),vf(bf(r))];if(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))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return 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*pf(this._r,255))+"%",g:Math.round(100*pf(this._g,255))+"%",b:Math.round(100*pf(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*pf(this._r,255))+"%, "+Math.round(100*pf(this._g,255))+"%, "+Math.round(100*pf(this._b,255))+"%)":"rgba("+Math.round(100*pf(this._r,255))+"%, "+Math.round(100*pf(this._g,255))+"%, "+Math.round(100*pf(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ff[Kh(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+$h(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Yh(t);n="#"+$h(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 Yh(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(ef,arguments)},brighten:function(){return this._applyModification(nf,arguments)},darken:function(){return this._applyModification(rf,arguments)},desaturate:function(){return this._applyModification(Qh,arguments)},saturate:function(){return this._applyModification(Jh,arguments)},greyscale:function(){return this._applyModification(tf,arguments)},spin:function(){return this._applyModification(of,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(cf,arguments)},complement:function(){return this._applyCombination(af,arguments)},monochromatic:function(){return this._applyCombination(lf,arguments)},splitcomplement:function(){return this._applyCombination(uf,arguments)},triad:function(){return this._applyCombination(sf,[3])},tetrad:function(){return this._applyCombination(sf,[4])}},Yh.fromRatio=function(t,e){if("object"==Gh(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:yf(t[r]));t=n}return Yh(t,e)},Yh.equals=function(t,e){return!(!t||!e)&&Yh(t).toRgbString()==Yh(e).toRgbString()},Yh.random=function(){return Yh.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Yh.mix=function(t,e,n){n=0===n?0:n||50;var r=Yh(t).toRgb(),i=Yh(e).toRgb(),o=n/100;return Yh({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})},Yh.readability=function(t,e){var n=Yh(t),r=Yh(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Yh.isReadable=function(t,e,n){var r,i,o=Yh.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},Yh.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 c=0;cu&&(u=r,s=Yh(e[c]));return Yh.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,Yh.mostReadable(t,["#fff","#000"],n))};var hf=Yh.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"},ff=Yh.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(hf);function df(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function pf(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 gf(t){return Math.min(1,Math.max(0,t))}function mf(t){return parseInt(t,16)}function vf(t){return 1==t.length?"0"+t:""+t}function yf(t){return t<=1&&(t=100*t+"%"),t}function bf(t){return Math.round(255*parseFloat(t)).toString(16)}function xf(t){return mf(t)/255}var wf,_f,Sf,Ef=(_f="[\\s|\\(]+("+(wf="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+wf+")[,|\\s]+("+wf+")\\s*\\)?",Sf="[\\s|\\(]+("+wf+")[,|\\s]+("+wf+")[,|\\s]+("+wf+")[,|\\s]+("+wf+")\\s*\\)?",{CSS_UNIT:new RegExp(wf),rgb:new RegExp("rgb"+_f),rgba:new RegExp("rgba"+Sf),hsl:new RegExp("hsl"+_f),hsla:new RegExp("hsla"+Sf),hsv:new RegExp("hsv"+_f),hsva:new RegExp("hsva"+Sf),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 Mf(t){return!!Ef.CSS_UNIT.exec(t)}var Tf=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Af(t,e,n){var r;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function Cf(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(r=1),n&&5===e&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function kf(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function Nf(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Yh(t),i=5;i>0;i-=1){var o=r.toHsv(),a=Yh({h:Af(o,i,!0),s:Cf(o,i,!0),v:kf(o,i,!0)}).toHexString();n.push(a)}n.push(r.toHexString());for(var s=1;s<=4;s+=1){var u=r.toHsv(),c=Yh({h:Af(u,s),s:Cf(u,s),v:kf(u,s)}).toHexString();n.push(c)}return"dark"===e.theme?Tf.map((function(t){var r=t.index,i=t.opacity;return Yh.mix(e.backgroundColor||"#141414",n[r],100*i).toHexString()})):n}var Of={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Pf={},If={};Object.keys(Of).forEach((function(t){Pf[t]=Nf(Of[t]),Pf[t].primary=Pf[t][5],If[t]=Nf(Of[t],{theme:"dark",backgroundColor:"#141414"}),If[t].primary=If[t][5]}));Pf.red,Pf.volcano,Pf.gold,Pf.orange,Pf.yellow,Pf.lime,Pf.green,Pf.cyan,Pf.blue,Pf.geekblue,Pf.purple,Pf.magenta,Pf.grey;var Lf=function(t,e,n){var r=Hh()(t),i=Hh()(e);return Hh()([(1-n)*r.red()+n*i.red(),(1-n)*r.green()+n*i.green(),(1-n)*r.blue()+n*i.blue()]).rgb()},Df=function(t,e,n,r){return void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)"),"default"===n?function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="rgb(150, 150, 150)");var r=Lf(e,t,.05).rgb().toString(),i=Lf(e,t,.1).rgb().toString(),o=Lf(e,t,.2).rgb().toString(),a=Lf(e,t,.4).rgb().toString(),s=Lf(e,n,.02).rgb().toString(),u=Lf(e,n,.05).rgb().toString(),c=Lf(e,n,.1).rgb().toString(),l=Lf(e,n,.2).rgb().toString(),h=Lf(e,n,.3).rgb().toString(),f=Nf(t,{theme:"default",backgroundColor:e}),d=Hh()(t).hex().toLowerCase(),p=f.indexOf(d),g=t;return-1!==p&&(g=f[p+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:r,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:e,highlightStroke:g,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:h,edgeActiveStroke:t,edgeInactiveStroke:l,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:h,comboMainFill:s,comboActiveStroke:t,comboActiveFill:r,comboInactiveStroke:h,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:g,comboHighlightFill:s,comboDisableStroke:l,comboDisableFill:u}}(t,e,"rgb(150, 150, 150)"):function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#777");var r=Lf(e,t,.2).rgb().toString(),i=Lf(e,t,.3).rgb().toString(),o=Lf(e,t,.6).rgb().toString(),a=Lf(e,t,.8).rgb().toString(),s=Lf(e,n,.2).rgb().toString(),u=Lf(e,n,.25).rgb().toString(),c=Lf(e,n,.3).rgb().toString(),l=Lf(e,n,.4).rgb().toString(),h=Lf(e,n,.5).rgb().toString(),f=Nf(t,{theme:"dark",backgroundColor:e}),d=Hh()(t).hex().toLowerCase(),p=f.indexOf(d),g=t;return-1!==p&&(g=f[p+1]),{mainStroke:a,mainFill:r,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:r,highlightStroke:t,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:l,comboMainFill:u,comboActiveStroke:t,comboActiveFill:s,comboInactiveStroke:l,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:g,comboHighlightFill:u,comboDisableStroke:l,comboDisableFill:s}}(t,e,"#777")},Rf=function(t,e,n,r){void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)");var i=[];return t.forEach((function(t){i.push(Df(t,e,n,r))})),i},zf="rgb(0, 0, 0)",Ff=Df("rgb(95, 149, 255)","rgb(255, 255, 255)"),Bf={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:Ff.mainStroke,fill:Ff.mainFill},size:20,color:Ff.mainStroke,linkPoints:{size:8,lineWidth:1,fill:Ff.activeFill,stroke:Ff.activeStroke}},nodeStateStyles:{active:{fill:Ff.activeFill,stroke:Ff.activeStroke,lineWidth:2,shadowColor:Ff.mainStroke,shadowBlur:10},selected:{fill:Ff.selectedFill,stroke:Ff.selectedStroke,lineWidth:4,shadowColor:Ff.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:Ff.highlightFill,stroke:Ff.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:Ff.inactiveFill,stroke:Ff.inactiveStroke,lineWidth:1},disable:{fill:Ff.disableFill,stroke:Ff.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:zf,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:Ff.edgeMainStroke,lineAppendWidth:2},color:Ff.edgeMainStroke},edgeStateStyles:{active:{stroke:Ff.edgeActiveStroke,lineWidth:1},selected:{stroke:Ff.edgeSelectedStroke,lineWidth:2,shadowColor:Ff.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Ff.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:Ff.edgeInactiveStroke,lineWidth:1},disable:{stroke:Ff.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:zf,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Ff.comboMainFill,lineWidth:1,stroke:Ff.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:Ff.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:Ff.comboActiveStroke,lineWidth:1,fill:Ff.comboActiveFill},selected:{stroke:Ff.comboSelectedStroke,lineWidth:2,fill:Ff.comboSelectedFill,shadowColor:Ff.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Ff.comboHighlightStroke,lineWidth:2,fill:Ff.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:Ff.comboInactiveStroke,fill:Ff.comboInactiveFill,lineWidth:1},disable:{stroke:Ff.comboDisableStroke,fill:Ff.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},jf=function t(e,n){var r;e.isGroup()&&n.isGroup()&&(null===(r=e.get("children"))||void 0===r||r.forEach((function(e,r){var i=n.get("children")[r];t(e,i)})));var i=e.get("type"),o=n.get("type");if("image"===i&&"image"===o){var a=e.get("clipShape");a&&n.setClip({type:a.get("type"),attrs:a.attr()})}};function Uf(t,e,n){if(t){if("function"==typeof t.addEventListener)return t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}};if("function"==typeof t.attachEvent)return t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}}}var Vf=Ju.cloneEvent,Hf=Ju.isViewportChanged,Gf=function(t){function e(e){var n=t.call(this,e)||this;return n.extendEvents=[],n.dragging=!1,n.mousedown=!1,n.preItem=null,n.destroy(),n.graph=e,n.destroyed=!1,n.initEvents(),n}return x(e,t),e.prototype.initEvents=function(){var t=this.graph,e=this.extendEvents,n=void 0===e?[]:e,r=t.get("canvas"),i=r.get("el"),o=(0,M.wrapBehavior)(this,"onCanvasEvents"),a=(0,M.wrapBehavior)(this,"onExtendEvents"),s=(0,M.wrapBehavior)(this,"onWheelEvent");r.off("*").on("*",o),this.canvasHandler=o,n.push(Uf(i,"wheel",s)),"undefined"!=typeof window&&(n.push(Uf(window,"keydown",a)),n.push(Uf(window,"keyup",a)),n.push(Uf(window,"focus",a))),this.resetHandler&&t.off("afterchangedata",this.resetHandler),this.resetHandler=(0,M.wrapBehavior)(this,"resetStatus"),t.on("afterchangedata",this.resetHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var n=this,r=this.graph,i=r.get("canvas"),o=t.target,a=t.type;switch(a){case"drag":this.onCanvasEvents(Object.assign({},t,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},t,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout((function(){return n.mousedown=!1}));break;case"click":if(!this.mousedown)return}t.canvasX=t.x,t.canvasY=t.y;var s={x:t.canvasX,y:t.canvasY},u=r.get("group").getMatrix();if(u||(u=[1,0,0,0,1,0,0,0,1]),Hf(u)&&(s=r.getPointByClient(t.clientX,t.clientY)),t.x=s.x,t.y=s.y,t.currentTarget=r,o===i)return"mousemove"!==a&&"mouseleave"!==a||this.handleMouseMove(t,"canvas"),t.target=i,t.item=null,r.emit(a,t),void r.emit("canvas:".concat(a),t);var c=e.getItemRoot(o);if(c){var l=c.get("item");if(!l.destroyed){var h=l.getType();if(t.target=o,t.item=l,t.canvasX===t.x&&t.canvasY===t.y){var f=r.getCanvasByPoint(t.x,t.y);t.canvasX=f.x,t.canvasY=f.y}t.name&&!t.name.includes(":")?(r.emit("".concat(h,":").concat(a),t),r.emit(a,t)):t.name&&r.emit(t.name,t),"dragstart"===a&&(this.dragging=!0),"dragend"===a&&(this.dragging=!1),"mousemove"===a&&this.handleMouseMove(t,h)}}else r.emit(a,t)},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){(0,M.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,e){var n=this.graph,r=this.preItem,i=n.get("canvas"),o=t.target===i?null:t.item;t=Vf(t),r&&r!==o&&!r.destroyed&&(t.item=r,this.emitCustomEvent(r.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(r.getType(),"dragleave",t)),o&&r!==o&&(t.item=o,this.emitCustomEvent(e,"mouseenter",t),this.dragging&&this.emitCustomEvent(e,"dragenter",t)),this.preItem=o},e.prototype.emitCustomEvent=function(t,e,n){n.type=e,this.graph.emit("".concat(t,":").concat(e),n)},e.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},e.prototype.destroy=function(){var t=this,e=t.graph,n=t.canvasHandler,r=t.extendEvents;e.get("canvas").off("*",n),(0,M.each)(r,(function(t){t.remove()})),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},e}(rc),Zf=Gf,Wf=n(83360),Yf=n(81746),qf=n.n(Yf),Xf=Ju.traverseTree,Kf=function(t,e){return t?(0,M.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},$f=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o=0&&(o="x",i="y");var a=0;Xf(t,(function(t){return a++,t.x>r.x&&(r.x=t.x),t.xr.y&&(r.y=t.y),t.yWebGL.
','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
','Find out how to get it here.'].join("\n")),t},addGetWebGLMessage:function(e){var n=void 0!==(e=e||{}).parent?e.parent:document.body,r=void 0!==e.id?e.id:"oldie",i=t().getWebGLErrorMessage();i.id=r,n.appendChild(i)}}},id=function(){var t=navigator.userAgent.toLowerCase();return t.indexOf("firefox")>-1?"firefox":t.indexOf("safari")>-1?"safari":t.indexOf("opr")>-1?"opera":t.indexOf("chrome")>-1?"chrome":t.indexOf("trident")>-1?"ie 11":t.indexOf("ie")>-1?"ie":"unknown"},od=w(w(w(w(w({},Ju),p),g),m),v),ad=od.radialLayout,sd=function(){function t(t){this.type=t.type,this.radial=t.radial,this.config=t}return t.prototype.init=function(t){var e=this;this.data=t,this.radial?this.layoutMethod=function(t){var n=qf()[e.type](t,e.config);return ad(n),n}:this.layoutMethod=function(t){return qf()[e.type](t,e.config)}},t.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},t.prototype.layout=function(t){return this.init(t),this.execute()},t}();(0,Wf.registerLayout)("grid",Wf.GridLayout),(0,Wf.registerLayout)("random",Wf.RandomLayout),(0,Wf.registerLayout)("force",Wf.ForceLayout),(0,Wf.registerLayout)("circular",Wf.CircularLayout),(0,Wf.registerLayout)("dagre",Wf.DagreLayout),(0,Wf.registerLayout)("dagreCompound",Wf.DagreCompoundLayout),(0,Wf.registerLayout)("radial",Wf.RadialLayout),(0,Wf.registerLayout)("concentric",Wf.ConcentricLayout),(0,Wf.registerLayout)("mds",Wf.MDSLayout),(0,Wf.registerLayout)("fruchterman",Wf.FruchtermanLayout),(0,Wf.registerLayout)("fruchterman-gpu",Wf.FruchtermanGPULayout),(0,Wf.registerLayout)("gForce",Wf.GForceLayout),(0,Wf.registerLayout)("force2",Wf.Force2Layout),(0,Wf.registerLayout)("gForce-gpu",Wf.GForceGPULayout),(0,Wf.registerLayout)("comboForce",Wf.ComboForceLayout),(0,Wf.registerLayout)("comboCombined",Wf.ComboCombinedLayout),(0,Wf.registerLayout)("forceAtlas2",Wf.ForceAtlas2Layout);var ud=function(t,e){var n=t.toString(),r=new Blob(["importScripts('".concat(e,"');(").concat(n,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(r))},cd=function(t){void 0===t&&(t="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js");var e=new ud((function(){var t="LAYOUT_RUN",e="LAYOUT_END",n="LAYOUT_ERROR",r="GPU_LAYOUT_RUN";layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout),onmessage=function(i){(function(e){var n=e.data.type;return n===t||n===r})(i)&&function(i){var o=this;switch(i.data.type){case t:var a,s=i.data,u=s.nodes,c=s.edges,l=s.layoutCfg,h=(m=void 0===l?{}:l).type;if(!(f=layout.getLayoutByName(h))){this.postMessage({type:n,message:"layout ".concat(h," not found")});break}m.onLayoutEnd=function(){o.postMessage({type:e,nodes:u}),null==a||a.destroy()},(a=new f(m)).init({nodes:u,edges:c}),a.execute();break;case r:var f,d=i.data,p=d.nodes,g=(c=d.edges,d.layoutCfg),m=void 0===g?{}:g,v=d.canvas;if(h=m.type,!(f=layout.getLayoutByName(h))){this.postMessage({type:n,message:"layout ".concat(h," not found")});break}if("gpu"!==h.split("-")[1]){this.postMessage({type:n,message:"layout ".concat(h," does not support GPU")});break}var y=new f(m);y.init({nodes:p,edges:c}),y.executeWithWorker(v,this)}}(i)}}),t);return e},ld="LAYOUT_RUN",hd="LAYOUT_END",fd="LAYOUT_ERROR",dd="LAYOUT_TICK",pd="GPU_LAYOUT_RUN",gd="GPU_LAYOUT_END";function md(t){return md="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},md(t)}var vd=function(t){return setTimeout(t,16)},yd=function(t){return clearTimeout(t)},bd=function(t){return("undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||vd)(t)},xd=function(t){return("undefined"!=typeof window&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||yd)(t)},wd=["fruchterman","gForce"],_d=["force","grid","circular"],Sd=function(t){function e(e){var n=t.call(this,e)||this;return n.graph=e,n.layoutCfg=e.get("layout")||{},n.layoutType=n.getLayoutType(),n.worker=null,n.workerData={},n.initLayout(),n}return x(e,t),e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker||("undefined"==typeof Worker?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=cd(this.layoutCfg.workerScriptURL)),this.worker},e.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(xd(t.requestId),t.requestId=null),t.requestId2&&(xd(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){return S(n,void 0,void 0,(function(){var n,o,a,s,u,c,l,h,f;return E(this,(function(d){switch(d.label){case 0:if(!(n=this.graph)||n.get("destroyed"))return[2];o=t.type,t.onLayoutEnd=function(){n.emit("aftersublayout",{type:o}),r()},o&&this.isGPU&&(Td(o)?o="".concat(o,"-gpu"):console.warn("The '".concat(o,"' layout does not support GPU calculation for now, it will run in CPU."))),Ju.isForce(o)?(a=t.onTick,s=t.animate,u=void 0===s&&("force"===o||"force2"===o),h=function(){a&&a(),(s||u)&&n.refreshPositions()},t.tick=h):"comboForce"!==o&&"comboCombined"!==o||(t.comboTrees=n.get("comboTrees")),!1;try{c=new Wf.Layouts[o](t),this.layoutMethods[e]&&this.layoutMethods[e].destroy(),this.layoutMethods[e]=c}catch(t){console.warn("The layout method: '".concat(o,"' does not exist! Please specify it first.")),i()}return c.enableTick&&(l=t.onTick,h=function(){l&&l(),n.refreshPositions()},c.tick=h),function(t,e){var n;if(!(null===(n=null==t?void 0:t.nodes)||void 0===n?void 0:n.length))return;t.nodes.forEach((function(t){t.layoutOrder=e}))}(f=this.filterLayoutData(this.data,t),e),c.init(f),n.emit("beforesublayout",{type:o}),[4,c.execute()];case 1:return d.sent(),c.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),[2]}}))}))}))},e.prototype.updateLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){return S(n,void 0,void 0,(function(){var n,i,o,a,s,u,c;return E(this,(function(l){switch(l.label){case 0:return n=this.graph,i=null==e?void 0:e.type,e.onLayoutEnd=function(){n.emit("aftersublayout",{type:i}),r()},Ju.isForce(i)&&(o=e.onTick,a=e.animate,s=void 0===a&&("force"===i||"force2"===i),u=function(){null==o||o(),(a||s)&&n.refreshPositions()},e.tick=u),c=this.filterLayoutData(this.data,e),t.init(c),t.updateCfg(e),n.emit("beforesublayout",{type:i}),[4,t.execute()];case 1:return l.sent(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd(),[2]}}))}))}))},e.prototype.layout=function(t){var e,n=this,r=this.graph;if(r&&!r.get("destroyed")){this.data=this.setDataFromGraph();var i=this.data,o=i.nodes,a=i.hiddenNodes;if(!o)return!1;var s=r.get("width"),u=r.get("height"),c={};Object.assign(c,{width:s,height:u,center:[s/2,u/2]},this.layoutCfg),this.layoutCfg=c;var l=c.type,h=!1;null===(e=this.layoutMethods)||void 0===e||e.forEach((function(t){var e;return h=!!(null===(e=t.nodes)||void 0===e?void 0:e.length)||h}));var f=this.destoryLayoutMethods();r.emit("beforelayout");var d=Promise.resolve();h&&l&&1===(null==f?void 0:f.length)&&f[0]===l?this.tweakInit():d=this.initPositions(c.center,o),this.initPositions(c.center,a).then(),this.isGPU=Ad(c,l);var p=c.onLayoutEnd,g=c.layoutEndFormatted,m=c.adjust;if(g||(c.layoutEndFormatted=!0,c.onAllLayoutEnd=function(){return S(n,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:return p&&p(o),this.refreshLayout(),m&&c.pipes?[4,this.adjustPipesBox(this.data,m)]:[3,2];case 1:t.sent(),this.refreshLayout(),t.label=2;case 2:return r.emit("afterlayout"),[2]}}))}))}),this.stopWorker(),c.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;var v=!1;return c.type?(v=!0,d=d.then((function(){return S(n,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:return[4,this.execLayoutMethod(c,0)];case 1:return[2,t.sent()]}}))}))}))):c.pipes&&(v=!0,c.pipes.forEach((function(t,e){d=d.then((function(){return S(n,void 0,void 0,(function(){return E(this,(function(n){switch(n.label){case 0:return[4,this.execLayoutMethod(t,e)];case 1:return[2,n.sent()]}}))}))}))}))),v?d.then((function(){c.onAllLayoutEnd&&c.onAllLayoutEnd(),t&&t()})).catch((function(t){console.warn("graph layout failed,",t)})):(r.refreshPositions(),null==t||t()),!1}},e.prototype.tweakInit=function(){var t=this.data,e=this.graph,n=t.nodes,r=t.edges;if(null==n?void 0:n.length){var i={};n.forEach((function(t){var e=t.x,n=t.y;isNaN(e)||isNaN(n)||(i[t.id]={x:e,y:n},t.mass=t.mass||2)})),r.forEach((function(t){var e=t.source,n=t.target,r=i[e],o=i[n];!r&&o?i[e]={x:o.x+80*(Math.random()-.5),y:o.y+80*(Math.random()-.5)}:!o&&r&&(i[n]={x:r.x+80*(Math.random()-.5),y:r.y+80*(Math.random()-.5)})}));var o=e.get("width"),a=e.get("height");n.forEach((function(t){var e=i[t.id]||{x:o/2+20*(Math.random()-.5),y:a/2+20*(Math.random()-.5)};t.x=e.x,t.y=e.y}))}},e.prototype.initWithPreset=function(t,e){var n=this;return new Promise((function(r,i){return S(n,void 0,void 0,(function(){var n,i,o,a,s,u,c;return E(this,(function(l){switch(l.label){case 0:return i=(n=this).layoutCfg,o=n.data,(null==(a=i.preset)?void 0:a.type)&&Wf.Layouts[null==a?void 0:a.type]?(s=Ad(a,a.type),u=s?"".concat(a.type,"-gpu"):a.type,c=new Wf.Layouts[u](a),delete i.preset,c.init(o),[4,c.execute()]):(null==e||e(),r(),[2,!1]);case 1:return l.sent(),null==t||t(),r(),[2,!0]}}))}))}))},e.prototype.layoutWithWorker=function(t,e){var n=this,r=this.layoutCfg,i=this.graph,o=this.getWorker(),a=this.workerData;if(!o)return!1;a.requestId=null,a.requestId2=null,a.currentTick=null,a.currentTickData=null,i.emit("beforelayout");var s=Promise.resolve(),u=!1;if(r.type)u=!0,s=s.then((function(){return n.runWebworker(o,t,r)}));else if(r.pipes){u=!0;for(var c=function(e){s=s.then((function(){return n.runWebworker(o,t,e)}))},l=0,h=r.pipes;l'),u=n?n.backgroundColor:void 0,c=n?n.padding:void 0;c?(0,M.isNumber)(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var l=i+c[0]+c[2],h=o+c[1]+c[3],f={container:s,height:l,width:h,quickHit:!0},d="svg"===a?new jh(f):new Ol(f),p=this.get("group").clone(),g=(0,M.clone)(p.getMatrix());g||(g=[1,0,0,0,1,0,0,0,1]);var m=(r.maxX+r.minX)/2,v=(r.maxY+r.minY)/2;g=Cd(g,[["t",-m,-v],["t",o/2+c[3],i/2+c[0]]]),p.resetMatrix(),p.setMatrix(g),d.add(p);var y=d.get("el"),b="";e||(e="image/png"),setTimeout((function(){if("svg"===a){var n=y.cloneNode(!0),r=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",r);i.replaceChild(n,i.documentElement);var o=(new XMLSerializer).serializeToString(i);b="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(o))}else{var s=void 0,c=y.getContext("2d"),f=void 0;if(u){var d="undefined"!=typeof window?window.devicePixelRatio:1;try{s=c.getImageData(0,0,h*d,l*d),f=c.globalCompositeOperation,c.globalCompositeOperation="destination-over",c.fillStyle=u,c.fillRect(0,0,h,l)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}b=y.toDataURL(e),u&&(c.clearRect(0,0,h,l),c.putImageData(s,0,0),c.globalCompositeOperation=f)}t&&t(b)}),16)},e.prototype.downloadFullImage=function(t,e,n){var r=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=Uh('
'),c=document.querySelector(".g6-graph-watermarker"),l=n?n.backgroundColor:void 0,h=n?n.padding:void 0;h?(0,M.isNumber)(h)&&(h=[h,h,h,h]):h=[0,0,0,0];var f=o+h[0]+h[2],d=a+h[1]+h[3];if(c){var p=this.get("graphWaterMarker").cfg||{},g=p.width,m=p.height;f=Math.ceil(f/m)*m,d=Math.ceil(d/g)*g}var v,y,b={container:u,height:f,width:d},x="svg"===s?new jh(b):new Ol(b),w=this.get("group"),_=(y=(v=w).clone(),jf(v,y),y),S=(0,M.clone)(_.getMatrix());S||(S=[1,0,0,0,1,0,0,0,1]);var E=(i.maxX+i.minX)/2,T=(i.maxY+i.minY)/2;S=Cd(S,[["t",-E,-T],["t",a/2+h[3],o/2+h[0]]]),_.resetMatrix(),_.setMatrix(S),x.add(_);var A=x.get("el");e||(e="image/png"),this.asyncToDataUrl(e,l,(function(n){var i=document.createElement("a"),o=(t||"graph")+("svg"===s?".svg":".".concat(e.split("/")[1]));r.dataURLToImage(n,s,i,o);var a=document.createEvent("MouseEvents");a.initEvent("click",!1,!1),i.dispatchEvent(a)}),d,f,A)},e.prototype.downloadImage=function(t,e,n){var r=this,i=this;i.stopAnimate();var o=i.get("canvas").getRenderer();e||(e="image/png");var a=(t||"graph")+("svg"===o?".svg":".".concat(e.split("/")[1])),s=document.createElement("a");i.asyncToDataUrl(e,n,(function(t){r.dataURLToImage(t,o,s,a);var e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),s.dispatchEvent(e)}))},e.prototype.dataURLToImage=function(t,e,n,r){if(t&&"data:"!==t){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,c=new Uint8Array(u);u--;)c[u]=s.charCodeAt(u);var l=new Blob([c],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(l,r):n.addEventListener("click",(function(){n.download=r,n.href=window.URL.createObjectURL(l)}))}else n.addEventListener("click",(function(){n.download=r,n.href=t}))}else console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items")},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),n=e.indexOf(t);n>=0&&(t.destroyPlugin(),e.splice(n,1))},e.prototype.setImageWaterMarker=function(t,e){void 0===t&&(t=Bf.waterMarkerImage);var n=this.get("container");(0,M.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=(0,M.deepMix)({},Bf.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.image;if(!t){var c=s?n:document.querySelector(".g6-graph-watermarker");return c&&(c.style.cssText=void 0),void(r&&r.clear())}if(r)r.clear();else{var l={container:n,width:o,height:a,capture:!1},h=this.get("pixelRatio");h&&(l.pixelRatio=h,window.devicePixelRatio=h),r=new Ol(l),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var f=r.get("context"),d=u.rotate,p=u.x,g=u.y;f.rotate(-d*Math.PI/180);var m=new Image;m.crossOrigin="anonymous",m.src=t,m.onload=function(){if(f.drawImage(m,p,g,u.width,u.height),f.rotate(d*Math.PI/180),s)n.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var t=document.querySelector(".g6-graph-watermarker");t||((t=document.createElement("div")).className="g6-graph-watermarker"),t.className="g6-graph-watermarker",r.destroyed||(t.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),n.appendChild(t))}}},e.prototype.setTextWaterMarker=function(t,e){var n=this.get("container");(0,M.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=(0,M.deepMix)({},Bf.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!(null==t?void 0:t.length)){var c=s?n:document.querySelector(".g6-graph-watermarker");return c&&(c.style.cssText=void 0),void(r&&r.clear())}if(r)r.clear();else{var l={container:n,width:o,height:a,capture:!1},h=this.get("pixelRatio");h&&(l.pixelRatio=h,window.devicePixelRatio=h),r=new Ol(l),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var f=r.get("context"),d=u.rotate,p=u.fill,g=u.fontFamily,m=u.fontSize,v=u.baseline,y=u.x,b=u.y,x=u.lineHeight;f.rotate(-d*Math.PI/180),f.font="".concat(m,"px ").concat(g),f.fillStyle=p,f.textBaseline=v;for(var w=(0,M.isString)(t)?[t]:t,_=w.length-1;_>=0;_--)f.fillText(w[_],y,b+_*x);if(f.rotate(d*Math.PI/180),s)n.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var S=document.querySelector(".g6-graph-watermarker");S||((S=document.createElement("div")).className="g6-graph-watermarker"),S.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),n.appendChild(S)}},e.prototype.destroy=function(){var e,n,r,i;(0,M.each)(this.get("plugins"),(function(t){t.destroyPlugin()}));var o=this.get("tooltips");if(o)for(var a=0;a0)for(var c=u.length-1;c>=0;c--){var l=u[c].getModel();-1===e.indexOfChild(t.children||[],l.id)&&(i.innerRemoveChild(l.id,{x:t.x,y:t.y},r),u.splice(c,1))}o.get("originAttrs")&&(a=o.get("originAttrs").x,s=o.get("originAttrs").y);var h=o.getModel();r&&o.set("originAttrs",{x:h.x,y:h.y}),o.set("model",Object.assign(h,t.data)),a===t.x&&s===t.y||o.updatePosition({x:t.x,y:t.y})}else i.innerAddChild(t,n,r)},e.prototype.innerRemoveChild=function(t,e,n){var r=this,i=r.findById(t);if(i)if((0,M.each)(i.get("children"),(function(t){r.innerRemoveChild(t.getModel().id,e,n)})),n){var o=i.getModel();i.set("to",e),i.set("originAttrs",{x:o.x,y:o.y}),r.get("removeList").push(i)}else r.removeItem(i,!1)},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var n=this;this.getNodes().map((function(t){return n.clearItemStates(t)})),this.getEdges().map((function(t){return n.clearItemStates(t)})),e&&this.get("enabledStack")&&this.pushStack("changedata",{before:n.get("originData"),after:t||n.get("data")}),t?(n.data(t),n.render(!1)):n.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");this.updateLayout(t)},e.prototype.updateLayout=function(t,e,n,r){void 0===r&&(r=!0);var i=this;if(t){if(r&&this.get("enabledStack")&&this.pushStack("layout",{before:i.get("layout"),after:t}),i.set("layout",t),i.set("layoutMethod",i.getLayout()),i.layout(),e){var o=n;o||(o="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),o=this.getPointByCanvas(o.x,o.y);var a=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];o.x=o.x*a[0]+a[6],o.y=o.y*a[0]+a[7];var s=this.getGroup().getCanvasBBox(),u=s.minX,c=s.maxX,l=s.minY,h={x:(u+c)/2,y:(l+s.maxY)/2};"begin"===e&&(h.x=u,h.y=l),this.translate(o.x-h.x,o.y-h.y)}}else console.warn("layout cannot be null")},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");this.layout(t)},e.prototype.layout=function(t){var e=this,n=this,r=n.get("data"),i=n.get("layoutMethod"),o=n.get("layout"),a=r;if(null==o?void 0:o.excludeInvisibles){r=(0,M.clone)(n.get("data"));var s={};Dd(r,(function(t){var n=t.children;if(!(null==n?void 0:n.length))return!0;for(var r=n.length-1;r>=0;r--){var i=e.findById(n[r].id);(i?!i.isVisible():!1===n[r].visible)&&(s[t.id]=s[t.id]||[],s[t.id].push({idx:r,child:n.splice(r,1)[0]}))}})),a=i?i(r,n.get("layout")):r,Dd(a,(function(t){var e=s[t.id];if(null==e?void 0:e.length)for(var n=e.length-1;n>=0;n--){var r=e[n],i=r.idx,o=r.child;t.children.splice(i,0,o)}}))}else a=i?i(r,n.get("layout")):r;var u=n.get("animate");(n.emit("beforerefreshlayout",{data:r,layoutData:a}),n.emit("beforelayout"),n.innerUpdateChild(a,void 0,u),t)&&n.get("viewController").fitView();u?n.layoutAnimate(a):(n.refresh(),n.paint()),n.emit("afterrefreshlayout",{data:r,layoutData:a}),n.emit("afterlayout")},e.prototype.addChild=function(t,e,n){void 0===n&&(n=!0);var r=this;r.emit("beforeaddchild",{model:t,parent:e}),(0,M.isString)(e)||(e=e.get("id"));var i=r.findDataById(e);i&&(i.children||(i.children=[]),i.children.push(t),r.findById(e).refresh(),r.changeData(void 0,n))},e.prototype.updateChildren=function(t,e,n){void 0===n&&(n=!0);var r=this,i=r.findById(e);e&&i?(r.findDataById(e).children=t,i.refresh(),r.changeData(void 0,n)):console.warn("Update children failed! There is no node with id '".concat(e,"'"))},e.prototype.updateChild=function(t,n,r){void 0===r&&(r=!0);var i=this;if(n&&i.findById(n)){var o=i.findDataById(n),a=i.findById(t.id);if(o.children||(o.children=[]),a){var s=e.indexOfChild(o.children,t.id);s>-1&&(o.children[s]=t)}else o.children.push(t);var u=i.findById(n);null==u||u.refresh(),i.changeData(void 0,r)}else i.changeData(t,r)},e.prototype.removeChild=function(t,n){void 0===n&&(n=!0);var r,i=this,o=i.findById(t);if((r=o?null==o?void 0:o.get("parent"):i.getNodes().find((function(e){return!!(e.getModel().children||[]).find((function(e){return e.id===t}))})))&&!r.destroyed){var a=r.get("id"),s=i.findDataById(a),u=s&&s.children||[],c=e.indexOfChild(u,t);u.splice(c,1),r.refresh()}i.changeData(void 0,n)},e.prototype.findDataById=function(t,e){var n=this;if(e||(e=n.get("data")),t===e.id)return e;var r=null;return(0,M.each)(e.children||[],(function(e){return e.id===t?(r=e,!1):!(r=n.findDataById(t,e))&&void 0})),r},e.prototype.layoutAnimate=function(t,e){var n=this,r=this.get("animateCfg");n.emit("beforeanimate",{data:t}),n.getEdges().forEach((function(t){var e=t.get("model");e.sourceAnchor||(e.sourceAnchor=t.get("sourceAnchorIndex"))})),this.get("canvas").animate((function(r){Dd(t,(function(i){var o=n.findById(i.id);if(o){var a=o.get("originAttrs"),s=o.get("model");if(a||(a={x:s.x,y:s.y},o.set("originAttrs",a)),e){var u=e(o,r,a,t);o.set("model",Object.assign(s,u))}else s.x=a.x+(i.x-a.x)*r,s.y=a.y+(i.y-a.y)*r}return!0})),(0,M.each)(n.get("removeList"),(function(t){var e=t.getModel(),n=t.get("originAttrs"),i=t.get("to");e.x=n.x+(i.x-n.x)*r,e.y=n.y+(i.y-n.y)*r})),n.refreshPositions()}),{duration:r.duration,easing:r.ease,callback:function(){(0,M.each)(n.getNodes(),(function(t){t.set("originAttrs",null)})),(0,M.each)(n.get("removeList"),(function(t){n.removeItem(t,!1)})),n.set("removeList",[]),r.callback&&r.callback(),n.emit("afteranimate",{data:t})},delay:r.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){void 0===t&&(t=!0);var e=this,n=e.get("data");if(!n||!(0,M.isObject)(n)||!Object.keys(n).length)throw new Error("data must be defined first");e.clear(),t&&this.get("enabledStack")&&this.clearStack(),e.emit("beforerender"),e.layout(this.get("fitView")),e.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(e){t.prototype.data.call(this,e),this.set("originData",Id(e))},e}(Nd),zd=Rd;function Fd(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}var Bd,jd=function(){function t(t){this._cfgs=(0,M.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return t.prototype.getDefaultCfgs=function(){return{}},t.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var n=e.getEvents(),r={};(0,M.each)(n,(function(n,i){var o=(0,M.wrapBehavior)(e,n);r[i]=o,t.on(i,o)})),this._events=r,this.init()},t.prototype.getEvents=function(){return{}},t.prototype.get=function(t){var e;return null===(e=this._cfgs)||void 0===e?void 0:e[t]},t.prototype.set=function(t,e){this._cfgs[t]=e},t.prototype.destroy=function(){},t.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,M.each)(e,(function(e,n){t.off(n,e)})),this._events=null,this._cfgs=null,this.destroyed=!0},t}(),Ud=jd,Vd=(Bd=function(t,e){return Bd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Bd(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Bd(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),Hd="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",Gd=function(t){function e(e){return t.call(this,e)||this}return Vd(e,t),e.prototype.getDefaultCfgs=function(){return{img:Hd,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),e=t.get("container"),n=t.get("canvas").get("el"),r=this.get("img")||Hd;r.includes("url(")||(r='url("'.concat(r,'")'));var i=Uh("
"),o=Uh(""));this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),e.insertBefore(i,n)},e.prototype.positionInit=function(){var t=this.get("graph"),e=t.get("minZoom"),n=t.get("width"),r=t.get("height");Fd(this.get("container"),{width:"".concat(n,"px"),height:"".concat(r,"px")});var i=80*n/e,o=80*r/e;Fd(this.get("gridContainer"),{width:"".concat(i,"px"),height:"".concat(o,"px"),left:"-".concat(i/2,"px"),top:"-".concat(o/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var e=this.get("gridContainer"),n=t.matrix;n||(n=[1,0,0,0,1,0,0,0,1]);var r=this.get("follow");Fd(e,{transform:"matrix(".concat(n[0],", ").concat(n[1],", ").concat(n[3],", ").concat(n[4],", ").concat(r?n[6]:"0",", ").concat(r?n[7]:"0",")")})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(Ud),Zd=Gd,Wd=n(38186),Yd=n.n(Wd),qd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();"undefined"!=typeof document&&Yd()("\n .g6-component-contextmenu {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .g6-contextmenu-ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n");var Xd=function(t){function e(e){return t.call(this,e)||this}return qd(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n
    \n
  • 菜单项1
  • \n
  • 菜单项2
  • \n
\n "},shouldBegin:function(t){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),e=Uh("
"));Fd(e,{top:"0px",position:"absolute",visibility:"hidden"});var n=this.get("container");n||(n=this.get("graph").get("container")),(0,M.isString)(n)&&(n=document.getElementById(n)),n.appendChild(e),this.set("menu",e)},e.prototype.onMenuShow=function(t){var e=this;t.preventDefault();var n=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&-1===n.indexOf(t.item.getType()))return void e.onMenuHide()}else if(-1===n.indexOf("canvas"))return void e.onMenuHide();if(this.get("shouldBegin")(t)){var r=this.get("menu"),i=this.get("getContent"),o=this.get("graph"),a=i(t,o);(0,M.isString)(a)?r.innerHTML=a:r.innerHTML=a.outerHTML,this.removeMenuEventListener();var s=this.get("handleMenuClick");if(s){var u=function(e){s(e.target,t.item,o)};this.set("handleMenuClickWrapper",u),r.addEventListener("click",u)}var c=o.get("width"),l=o.get("height"),h=r.getBoundingClientRect(),f=this.get("offsetX")||0,d=this.get("offsetY")||0,p=o.getContainer().offsetTop,g=o.getContainer().offsetLeft,m=t.canvasX+g+f,v=t.canvasY+p+d;m+h.width>c&&(m=t.canvasX-h.width-f+g),v+h.height>l&&(v=t.canvasY-h.height-d+p),v<0&&(v=0),Fd(r,{top:"".concat(v,"px"),left:"".concat(m,"px"),visibility:"visible"});var y="click"===this.get("trigger"),b=function(t){y?y=!1:e.onMenuHide()};document.body.addEventListener("click",b),this.set("handler",b)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),e=this.get("handler");t&&(this.get("menu").removeEventListener("click",t),this.set("handleMenuClickWrapper",null));e&&document.body.removeEventListener("click",e)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&Fd(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,M.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(Ud),Kd=Xd,$d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qd=function(){return Qd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n-1,a=navigator.userAgent.toLowerCase().indexOf("safari")>-1,s=Uh("\n ")),u=0,c=0,l=!1,h=0,f=0,d=0,p=0,g=0,m=0,v=a||o?"mousedown":"dragstart";s.addEventListener(v,(function(i){var o,a;if(i.dataTransfer){var v=new Image;v.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",null===(a=(o=i.dataTransfer).setDragImage)||void 0===a||a.call(o,v,0,0);try{i.dataTransfer.setData("text/html","view-port-minimap")}catch(t){i.dataTransfer.setData("text","view-port-minimap")}}if(e.refresh=!1,i.target===s){var y=s.style;h=parseInt(y.left,10),f=parseInt(y.top,10),d=parseInt(y.width,10),p=parseInt(y.height,10),d>n[0]||p>n[1]||(m=r.getZoom(),g=t.get("ratio"),l=!0,u=i.clientX,c=i.clientY)}}),!1);var y=function(t){if(l&&!(0,M.isNil)(t.clientX)&&!(0,M.isNil)(t.clientY)){var e=u-t.clientX,i=c-t.clientY;(h-e<0||h-e+d>=n[0])&&(e=0),(f-i<0||f-i+p>=n[1])&&(i=0),f-=i,Fd(s,{left:"".concat(h-=e,"px"),top:"".concat(f,"px")}),r.translate(e*m/g,i*m/g),u=t.clientX,c=t.clientY}};a||o||s.addEventListener("drag",y,!1);var b=function(){l=!1,e.refresh=!0},x=a||o?"mouseup":"dragend";s.addEventListener(x,b,!1),i.addEventListener("mouseleave",b),i.addEventListener("mouseup",b),(a||o)&&i.addEventListener("mousemove",y,!1),this.set("viewport",s),i.appendChild(s)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("totaldx"),n=this.get("totaldy"),r=this.get("graph"),i=this.get("size"),o=r.get("canvas").get("el"),a=r.get("width")||o.scrollWidth||500,s=r.get("height")||o.scrollHeight||500,u=r.getPointByCanvas(0,0),c=r.getPointByCanvas(a,s),l=this.get("viewport");l||this.initViewport();var h=(c.x-u.x)*t,f=(c.y-u.y)*t,d=u.x*t+e,p=u.y*t+n,g=d+h,m=p+f;d<0&&(h+=d,d=0),g>i[0]&&(h-=g-i[0]),p<0&&(f+=p,p=0),m>i[1]&&(f-=m-i[1]),this.set("ratio",t),Fd(l,{left:"".concat(d,"px"),top:"".concat(p,"px"),width:"".concat(h,"px"),height:"".concat(f,"px")})}},e.prototype.updateGraphShapes=function(){var t,e=this._cfgs.graph,n=this.get("canvas"),r=e.get("group");r.destroyed||(n.clear(),this.get("hideEdge")?(t=n.addGroup(),r.get("children").forEach((function(e){e.get("id").includes("-edge")||t.add(e.clone())}))):((t=r.clone()).resetMatrix(),n.add(t)),"svg"===e.get("renderer")&&this.updateVisible(t))},e.prototype.updateVisible=function(t){var e=this;if(t.isGroup()||t.get("visible")){var n=t.get("children");if(!n||!n.length)return;n.forEach((function(t){t.get("visible")||t.hide(),e.updateVisible(t)}))}else t.hide()},e.prototype.updateKeyShapes=function(){var t=this,e=this._cfgs.graph,n=this.get("canvas"),r=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,M.each)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),(0,M.each)(e.getNodes(),(function(e){t.updateOneNodeKeyShape(e,r)}));var i=e.getCombos();if(i&&i.length){var o=r.find((function(t){return"comboGroup"===t.get("name")}))||r.addGroup({name:"comboGroup"});setTimeout((function(){t.destroyed||((0,M.each)(i,(function(e){t.updateOneComboKeyShape(e,o)})),null==o||o.sort(),null==o||o.toBack(),t.updateCanvas())}),250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,e){if(!this.destroyed){var n=this.get("itemMap")||{},r=n[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};r?s=Object.assign(a,s):(r=o,e.add(r));var u=r.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),r.attr(s),t.isVisible()?r.show():r.hide(),r.exist=!0;var c=t.getModel().depth;isNaN(c)||r.set("zIndex",c),n[t.get("id")]=r,this.set("itemMap",n)}},e.prototype.updateOneNodeKeyShape=function(t,e){var n=this.get("itemMap")||{},r=n[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};r?(s=Object.assign(a,s),r.toFront()):(r=o,e.add(r));var u=r.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),r.attr(s),t.isVisible()?r.show():r.hide(),r.exist=!0;var c=t.getModel().depth;isNaN(c)||r.set("zIndex",c),n[t.get("id")]=r,this.set("itemMap",n)},e.prototype.updateDelegateShapes=function(){var t=this,e=this._cfgs.graph,n=this.get("canvas"),r=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,M.each)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),(0,M.each)(e.getNodes(),(function(e){t.updateOneNodeDelegateShape(e,r)}));var i=e.getCombos();if(i&&i.length){var o=r.find((function(t){return"comboGroup"===t.get("name")}))||r.addGroup({name:"comboGroup"});setTimeout((function(){t.destroyed||((0,M.each)(i,(function(e){t.updateOneComboKeyShape(e,o)})),null==o||o.sort(),null==o||o.toBack(),t.updateCanvas())}),250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},e=Object.keys(t);if(e&&0!==e.length)for(var n=e.length-1;n>=0;n--){var r=t[e[n]],i=r.exist;r.exist=!1,i||(r.remove(),delete t[e[n]])}},e.prototype.updateOneEdgeKeyShape=function(t,e){var n=this.get("itemMap")||{},r=n[t.get("id")];if(r){var i=t.get("keyShape").attr("path");r.attr("path",i)}else r=t.get("keyShape").clone(),e.add(r);t.isVisible()?r.show():r.hide(),r.exist=!0,n[t.get("id")]=r,this.set("itemMap",n)},e.prototype.updateOneNodeDelegateShape=function(t,e){var n=this.get("delegateStyle"),r=this.get("itemMap")||{},i=r[t.get("id")],o=t.getBBox();if(i){var a={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(a),i.toFront()}else i=e.addShape("rect",{attrs:Qd({x:o.minX,y:o.minY,width:o.width,height:o.height},n),name:"minimap-node-shape"});t.isVisible()?i.show():i.hide(),i.exist=!0,r[t.get("id")]=i,this.set("itemMap",r)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this,e=t.get("graph"),n=t.get("size"),r=t.get("className"),i=t.get("container"),o=Uh("
"));(0,M.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(o):e.get("container").appendChild(o),t.set("container",o);var a,s=Uh('
');o.appendChild(s),s.addEventListener("dragenter",(function(t){t.preventDefault()})),s.addEventListener("dragover",(function(t){t.preventDefault()})),a="svg"===e.get("renderer")?new jh({container:s,width:n[0],height:n[1]}):new Ol({container:s,width:n[0],height:n[1]}),t.set("canvas",a),t.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed&&this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("size"),n=this.get("canvas"),r=this.get("type"),i=this.get("padding");if(!n.destroyed){switch(r){case"default":this.updateGraphShapes();break;case"keyShape":this.updateKeyShapes();break;case"delegate":this.updateDelegateShapes()}var o=n.get("children")[0];if(o){o.resetMatrix();var a=o.getCanvasBBox(),s=t.get("canvas").getCanvasBBox(),u=t.getZoom()||1,c=s.width/u,l=s.height/u;Number.isFinite(a.width)&&(c=Jd(a.width,c),l=Jd(a.height,l)),c+=2*i,l+=2*i;var h=Math.min(e[0]/c,e[1]/l),f=[1,0,0,0,1,0,0,0,1],d=0,p=0;Number.isFinite(a.minX)&&(d=-a.minX),Number.isFinite(a.minY)&&(p=-a.minY);var g=(e[0]-(c-2*i)*h)/2,m=(e[1]-(l-2*i)*h)/2;f=tp(f,[["t",d,p],["s",h,h],["t",g,m]]),o.setMatrix(f),this.set("ratio",h),this.set("totaldx",g+d*h),this.set("totaldy",m+p*h),this.set("dx",g),this.set("dy",m),this.updateViewport()}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("container");(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)},e}(Ud),np=ep,rp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function ip(t,e,n){var r=t.x-e.x,i=t.y-e.y;return!n||Math.abs(r)>n||Math.abs(i)>n?Math.sqrt(r*r+i*i):n}function op(t,e){var n=(e.source.y-e.target.y)/(e.source.x-e.target.x),r=(n*n*e.source.x+n*(t.y-e.source.y)+t.x)/(n*n+1);return{x:r,y:n*(r-e.source.x)+e.source.y}}var ap=function(t){function e(e){return t.call(this,e)||this}return rp(e,t),e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),e=this.get("onTick");this.set("tick",(function(){e&&e(),t.refreshPositions()}))},e.prototype.bundling=function(t){var e=this;if(e.set("data",t),!e.isTicking()){var n=t.edges||[],r=t.nodes||[],i={},o=!1;if(r.forEach((function(t){null!==t.x&&null!==!t.y&&void 0!==t.x&&void 0!==!t.y||(o=!0),i[t.id]=t})),o)throw new Error("please layout the graph or assign x and y for nodes first");e.set("nodeIdMap",i);var a=e.get("divisions"),s=e.get("divRate"),u=e.divideEdges(a);e.set("edgePoints",u);var c=e.getEdgeBundles();e.set("edgeBundles",c);for(var l=e.get("cycles"),h=e.get("iterations"),f=e.get("iterRate"),d=e.get("lambda"),p=0;pl;){var r=l/n,a={x:i[o][e-1].x,y:i[o][e-1].y};a.x+=r*(t.x-i[o][e-1].x),a.y+=r*(t.y-i[o][e-1].y),h.push(a),n-=l,l=c}l-=n}})),h.push({x:u.x,y:u.y}),i[o]=h}})),i},e.prototype.getEdgeLength=function(t){var e=0;return t.forEach((function(n,r){0!==r&&(e+=ip(n,t[r-1]))})),e},e.prototype.getEdgeBundles=function(){var t=this,e=t.get("data").edges||[],n=t.get("bundleThreshold"),r=t.get("nodeIdMap"),i=t.get("edgeBundles");return i||(i=[]),e.forEach((function(t,e){i[e]&&void 0!==i[e]||(i[e]=[])})),e.forEach((function(o,a){var s=r[o.source],u=r[o.target];e.forEach((function(e,o){if(!(o<=a)){var c=r[e.source],l=r[e.target];t.getBundleScore({source:s,target:u},{source:c,target:l})>=n&&(i[a].push(o),i[o].push(a))}}))})),i},e.prototype.getBundleScore=function(t,e){var n=this;return t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,t.length=ip({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=ip({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),n.getAngleScore(t,e)*n.getScaleScore(t,e)*n.getPositionScore(t,e)*n.getVisibilityScore(t,e)},e.prototype.getAngleScore=function(t,e){var n=function(t,e){return t.x*e.x+t.y*e.y}({x:t.vx,y:t.vy},{x:e.vx,y:e.vy});return n/(t.length*e.length)},e.prototype.getScaleScore=function(t,e){var n=(t.length+e.length)/2;return 2/(n/Math.min(t.length,e.length)+Math.max(t.length,e.length)/n)},e.prototype.getPositionScore=function(t,e){var n=(t.length+e.length)/2;return n/(n+ip({x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},{x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2}))},e.prototype.getVisibilityScore=function(t,e){var n=this.getEdgeVisibility(t,e),r=this.getEdgeVisibility(e,t);return nr||Math.abs(i.y)>r){var a=1/ip(o[n][t],o[e][t]);s.x+=i.x*a,s.y+=i.y*a}})),s},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),t.prototype.destroy.call(this)},e}(Ud),sp=ap,up=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cp=function(){return cp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n(a||r.get("height"))&&n>1||u<(s||.05*r.get("height"))&&n<1)&&(n=1),u*=n,e.set("r",u),e.set("r2",u*u);var c=e.get("d");e.set("molecularParam",(c+1)*u),e.set("delegateCenterDiff",void 0),e.magnify(t,o)}},e.prototype.scaleRByDrag=function(t){var e=this;if(t){var n,r=e.get("dragPrePos"),i=e.get("graph"),o=i.getPointByClient(t.clientX,t.clientY);n=t.x-r.x<0?.95:1/.95;var a=e.get("maxR"),s=e.get("minR"),u=e.get("r");(u>(a||i.get("height"))&&n>1||u<(s||.05*i.get("height"))&&n<1)&&(n=1),u*=n,e.set("r",u),e.set("r2",u*u);var c=e.get("d");e.set("molecularParam",(c+1)*u),e.magnify(t,o),e.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){var e=this;if(t||t.originalEvent){t.preventDefault&&t.preventDefault();var n=0;n=t.originalEvent.wheelDelta<0?-.1:.1;var r=e.get("d")+n,i=e.get("maxD"),o=e.get("minD");if(ro){e.set("d",r);var a=e.get("r");e.set("molecularParam",(r+1)*a);var s=e.get("delegate"),u=s?{x:s.attr("x"),y:s.attr("y")}:void 0;e.set("delegateCenterDiff",void 0),e.magnify(t,u)}}},e.prototype.scaleDByDrag=function(t){var e=this,n=e.get("dragPrePos"),r=t.x-n.x>0?.1:-.1,i=e.get("d")+r,o=e.get("maxD"),a=e.get("minD");if(ia){e.set("d",i);var s=e.get("r");e.set("molecularParam",(i+1)*s),e.magnify(t)}e.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,e){var n=this;n.restoreCache();var r=n.get("graph"),i=n.get("cachedMagnifiedModels"),o=n.get("cachedOriginPositions"),a=n.get("showLabel"),s=n.get("r"),u=n.get("r2"),c=n.get("d"),l=n.get("molecularParam"),h=r.getNodes(),f=h.length,d=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!n.get("dragging")||"mousemove"!==n.get("trigger")&&"click"!==n.get("trigger")||(d=n.get("cacheCenter"));var p=n.get("delegateCenterDiff");p&&(d.x+=p.x,d.y+=p.y),n.updateDelegate(d,s);for(var g=0;g\n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n \n '},zoomSensitivity:2}},e.prototype.init=function(){var t=this,e=this.get("graph"),n=this.get("getContent")(e),r=n;(0,M.isString)(n)&&(r=Uh(n));var i=this.get("className");r.setAttribute("class",i||"g6-component-toolbar");var o=this.get("container");o||(o=this.get("graph").get("container")),(0,M.isString)(o)&&(o=document.getElementById(o)),o.appendChild(r),this.set("toolBar",r);var a=this.get("handleClick");r.addEventListener("click",(function(n){var r=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],n=t.target;n;){if(e.push(n),"HTML"===n.tagName)return e.push(document,window),e;n=n.parentElement}return e}(n).filter((function(t){return"LI"===t.nodeName}));if(0!==r.length){var i=r[0].getAttribute("code");i&&(a?a(i,e):t.handleDefaultOperator(i))}}));var s=this.get("position");s&&Fd(r,{top:"".concat(s.y,"px"),left:"".concat(s.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),e=document.querySelector('.g6-component-toolbar li[code="undo"]'),n=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),r=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');e&&n&&r&&i&&(e.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4"),r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),t.on("stackchange",(function(t){var o=t.undoStack,a=t.redoStack,s=o.length,u=a.length;0===s?(e.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4")):(e.removeAttribute("style"),n.removeAttribute("style")),0===u?(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),i.removeAttribute("style"))})))},e.prototype.undo=function(){var t=this.get("graph"),e=t.getUndoStack();if(e&&0!==e.length){var n=e.pop();if(n){var r=n.action;t.pushStack(r,(0,M.clone)(n.data),"redo");var i=n.data.before;if("add"===r&&(i=n.data.after),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);delete e.id,t.updateItem(n,e,!1),"combo"===n.getType()&&t.updateCombo(n)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.removeItem(e.id,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}));break;case"createCombo":var o=n.data.after.combos,a=o[o.length-1];Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))})),t.removeItem(a.id,!1);break;case"uncombo":var s=i.combos[i.combos.length-1],u=i.nodes.concat(i.combos).map((function(t){return t.id})).filter((function(t){return t!==s.id}));t.createCombo(s,u,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.redo=function(){var t=this.get("graph"),e=t.getRedoStack();if(e&&0!==e.length){var n=e.pop();if(n){var r=n.action,i=n.data.after;if(t.pushStack(r,(0,M.clone)(n.data)),"delete"===r&&(i=n.data.before),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);delete e.id,t.updateItem(n,e,!1),"combo"===n.getType()&&t.updateCombo(n)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach((function(e){t.removeItem(e.id,!1)})),i.nodes&&i.nodes.forEach((function(e){t.removeItem(e.id,!1)})),i.combos&&i.combos.forEach((function(e){t.removeItem(e.id,!1)}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}));break;case"createCombo":var o=i.combos[i.combos.length-1];t.createCombo(o,o.children.map((function(t){return t.id})),!1);break;case"uncombo":var a=n.data.before.combos,s=a[a.length-1];t.uncombo(s.id,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),e=t.getZoom(),n=1/(1-.05*this.get("zoomSensitivity"));n*e>(this.get("maxZoom")||t.get("maxZoom"))||t.zoomTo(e*n)},e.prototype.zoomIn=function(){var t=this.get("graph"),e=t.getZoom(),n=1-.05*this.get("zoomSensitivity");n*e<(this.get("minZoom")||t.get("minZoom"))||t.zoomTo(e*n)},e.prototype.realZoom=function(){this.get("graph").zoomTo(1)},e.prototype.autoZoom=function(){this.get("graph").fitView([20,20])},e.prototype.handleDefaultOperator=function(t){switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom()}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,M.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}var n=this.get("handleClick");n&&t.removeEventListener("click",n)},e}(Ud),gp=pp,mp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();"undefined"!=typeof document&&Yd()("\n .g6-component-tooltip {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n");var vp=function(t){function e(e){return t.call(this,e)||this}return mp(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n

    类型:".concat(t.item.getType(),"

    \n ID:").concat(t.item.getID(),"\n ")},shouldBegin:function(t){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,e=t.get("className")||"g6-component-tooltip",n=Uh("
    ")),r=t.get("container");r||(r=t.get("graph").get("container")),(0,M.isString)(r)&&(r=document.getElementById(r)),Fd(n,{position:"absolute",visibility:"hidden",display:"none"}),r.appendChild(n),"click"!==t.get("trigger")&&(n.addEventListener("mouseenter",(function(t){Fd(n,{visibility:"visible",display:"unset"})})),n.addEventListener("mouseleave",(function(e){t.hideTooltip()}))),t.set("tooltip",n)},e.prototype.onClick=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=t.item,r=this.get("graph");this.currentTarget===n?(this.currentTarget=null,this.hideTooltip(),r.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=n,this.showTooltip(t),r.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=t.item,r=this.get("graph");this.currentTarget=n,this.showTooltip(t),r.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var e=this.get("itemTypes");t.item&&t.item.getType&&-1===e.indexOf(t.item.getType())||this.currentTarget&&t.item===this.currentTarget&&this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip(),this.get("graph").emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(t.item){var e=this.get("itemTypes");if(!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=this.get("tooltip"),r=this.get("getContent")(t);(0,M.isString)(r)?n.innerHTML=r:(this.clearContainer(),n.appendChild(r)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&Fd(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var e=this.get("shouldBegin"),n=this.get("tooltip");if(e(t)){var r=this.get("graph"),i=r.get("width"),o=r.get("height"),a=this.get("offsetX")||0,s=this.get("offsetY")||0,u=r.getPointByClient(t.clientX,t.clientY),c=this.get("fixToNode"),l=t.item;if(l.getType&&"node"===l.getType()&&c&&(0,M.isArray)(c)&&c.length>=2){var h=l.getBBox();u={x:h.minX+h.width*c[0],y:h.minY+h.height*c[1]}}var f=r.getCanvasByPoint(u.x,u.y),d=f.x,p=f.y,g=r.getContainer(),m={x:d+g.offsetLeft+a,y:p+g.offsetTop+s};Fd(n,{visibility:"visible",display:"unset"});var v=n.getBoundingClientRect();d+v.width+a>i&&(m.x-=v.width+a),p+v.height+s>o&&(m.y-=v.height+s,m.y<0&&(m.y=0)),Fd(n,{left:"".concat(m.x,"px"),top:"".concat(m.y,"px")})}else Fd(n,{visibility:"hidden",display:"none"})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,M.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(Ud),yp=vp,bp="timebarstartplay",xp="timebarendplay",wp="valuechange",_p="timebarConfigChanged",Sp="playPauseBtn",Ep="nextStepBtn",Mp="preStepBtn",Tp=function(){function t(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.container,a=t.text,s=t.padding,u=void 0===s?[4,4,4,4]:s,c=t.className,l=void 0===c?"g6-component-timebar-tooltip":c,h=t.backgroundColor,f=void 0===h?"#000":h,d=t.textColor,p=void 0===d?"#fff":d,g=t.opacity,m=void 0===g?.8:g,v=t.fontSize,y=void 0===v?12:v;this.container=o,this.className=l,this.backgroundColor=f,this.textColor=p,this.x=n,this.y=i,this.text=a,this.padding=u,this.opacity=m,this.fontSize=y,this.render()}return t.prototype.render=function(){var t=this,e=t.className,n=(t.x,t.y,t.backgroundColor),r=t.textColor,i=t.text,o=t.padding,a=t.opacity,s=t.fontSize,u=t.container,c=Uh("
    '));(0,M.isString)(u)&&(u=document.getElementById(u)),u.appendChild(c),t.parentHeight=u.offsetHeight,t.parentWidth=u.offsetWidth,Fd(c,{visibility:"hidden",top:0,left:0});var l=Uh("\n
    "));l.innerHTML=i,c.appendChild(l),t.backgroundDOM=l;var h=Uh("
    "));c.appendChild(h),t.arrowDOM=h,t.container=c},t.prototype.show=function(t){var e=this,n=t.text,r=t.x;t.y,t.clientX,t.clientY;e.backgroundDOM.innerHTML=n;var i=e.backgroundDOM.offsetWidth,o=e.backgroundDOM.offsetHeight,a=e.arrowDOM.offsetWidth,s=e.arrowDOM.offsetHeight;Fd(e.container,{top:"".concat(-o-s,"px"),left:"".concat(r,"px"),visibility:"visible"}),Fd(e.backgroundDOM,{marginLeft:"".concat(-i/2,"px")}),Fd(e.arrowDOM,{marginLeft:"".concat(-a/2,"px"),top:"".concat(o,"px")});var u=r-i/2,c=r+i/2;u<0?Fd(e.backgroundDOM,{marginLeft:"".concat(-i/2-u,"px")}):c>e.parentWidth&&Fd(e.backgroundDOM,{marginLeft:"".concat(-i/2-c+e.parentWidth+12,"px")})},t.prototype.hide=function(){Fd(this.container,{top:0,left:0,visibility:"hidden"})},t}(),Ap=Tp,Cp=function(){return Cp=Object.assign||function(t){for(var e,n=1,r=arguments.length;nn&&(o=n,i=e)}))}i=e.originalEvent.deltaY>0?Math.max(0,i-1):Math.min(t.speedAxisY.length-1,i+1);var a=t.speedAxisY[i]-r;n=Pp(n,[["t",0,a]]),t.speedPoint.setMatrix(n),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit(_p,{speed:t.currentSpeed,type:t.currentType})})),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",(function(e){var n,r,i=e.target.get("isChecked");i?(t.checkedIcon.hide(),t.checkedText.attr("text",(null===(r=t.controllerCfg)||void 0===r?void 0:r.timePointControllerText)||"单一时间"),t.currentType=Up):(t.checkedIcon.show(),t.checkedText.attr("text",(null===(n=t.controllerCfg)||void 0===n?void 0:n.timeRangeControllerText)||"时间范围"),t.currentType=jp),e.target.set("isChecked",!i),t.group.emit(_p,{type:t.currentType,speed:t.currentSpeed})}))},t.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},t}(),Hp=Vp,Gp=function(){return Gp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=b&&r<=x?c:l,a=m.addShape("rect",{attrs:Gp({x:i+r*(g+2),y:i,width:g,height:d},o),draggable:!0,name:"tick-rect-".concat(r)}),s=m.addShape("rect",{attrs:{x:i+r*g+2*(2*r-1)/2,y:i,width:0===r||r===p-1?g+1:g+2,height:d,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(r)});s.toFront();var f,_=a.getBBox(),S=(_.minX+_.maxX)/2;if(v.push({rect:a,pickRect:s,value:e.date,x:S,y:_.minY}),u?(f=u(e),!(0,M.isString)(f)&&f&&(f=e.date)):r%Math.round(p/10)==0&&(f=e.date),f){y.push(f);var E=_.maxY+2*i;m.addShape("line",{attrs:{stroke:"#BFBFBF",x1:S,y1:E,x2:S,y2:E+4},name:"tick-line"});var T=E+4+i,A=m.addShape("text",{attrs:Gp({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:S,y:T,textAlign:"center",text:f,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},h),capture:!1,name:"tick-label"}),C=A.getBBox();if(C.maxX>n?A.attr("textAlign","right"):C.minX<0&&A.attr("textAlign","left"),(0,M.isNumber)(w)&&10!==y.length){var k=Zp([1,0,0,0,1,0,0,0,1],[["t",-S,-T],["r",w],["t",S-5,T+2]]);A.attr({textAlign:"left",matrix:k})}1===y.length?A.attr({textAlign:"left"}):10===y.length&&A.attr({textAlign:"right"})}})),this.tickRects=v;var _=this.group;this.currentSpeed=1,this.controllerBtnGroup=new Hp(Gp({group:_,x:this.x,y:this.y+r+5,width:n,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},t.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",(function(e){var n=e.target;if("rect"===n.get("type")&&n.get("name")){var r=parseInt(n.get("name").split("-")[2],10);if(!isNaN(r)){var i=t.tickRects,o=t.unselectedTickStyle;i.forEach((function(t){t.rect.attr(o)}));var a=t.selectedTickStyle;i[r].rect.attr(a),t.startTickRectId=r,t.endTickRectId=r;var s=r/i.length;t.graph.emit(wp,{value:[s,s]})}}})),e.on("dragstart",(function(e){var n=t.tickRects,r=t.unselectedTickStyle;n.forEach((function(t){t.rect.attr(r)}));var i=e.target,o=parseInt(i.get("name").split("-")[2],10),a=t.selectedTickStyle;n[o].rect.attr(a),t.startTickRectId=o;var s=o/n.length;t.graph.emit(wp,{value:[s,s]}),t.dragging=!0})),e.on("dragover",(function(e){if(t.dragging&&"rect"===e.target.get("type")){for(var n=parseInt(e.target.get("name").split("-")[2],10),r=t.startTickRectId,i=t.tickRects,o=t.selectedTickStyle,a=t.unselectedTickStyle,s=0;s=r&&s<=n?o:a;i[s].rect.attr(u)}var c=i.length;t.endTickRectId=n;var l=r/c,h=n/c;t.graph.emit(wp,{value:[l,h]})}})),e.on("drop",(function(e){if(t.dragging&&(t.dragging=!1,"rect"===e.target.get("type"))){var n=t.startTickRectId,r=parseInt(e.target.get("name").split("-")[2],10);if(!(r0?e.endTickRectId++:(n[e.endTickRectId].rect.attr(i),e.endTickRectId--),a!==e.startTickRectId)e.endTickRectIdthis.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;r1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(Jp),og=ig,ag=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,sg="\\d\\d?",ug="\\d\\d",cg="[^\\s]+",lg=/\[([^]*?)\]/gm;function hg(t,e){for(var n=[],r=0,i=t.length;r-1?i:null}};function dg(t){for(var e=[],n=1;n3?0:(t-t%10!=10?1:0)*t%10]}},yg=dg({},vg),bg=function(t){return yg=dg(yg,t)},xg=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},wg=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+wg(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+wg(Math.floor(Math.abs(e)/60),2)+":"+wg(Math.abs(e)%60,2)}},Sg=function(t){return+t-1},Eg=[null,sg],Mg=[null,cg],Tg=["isPm",cg,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],Ag=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],Cg={D:["day",sg],DD:["day",ug],Do:["day","\\d\\d?[^\\s]+",function(t){return parseInt(t,10)}],M:["month",sg,Sg],MM:["month",ug,Sg],YY:["year",ug,function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour",sg,void 0,"isPm"],hh:["hour",ug,void 0,"isPm"],H:["hour",sg],HH:["hour",ug],m:["minute",sg],mm:["minute",ug],s:["second",sg],ss:["second",ug],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond",ug,function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:Eg,dd:Eg,ddd:Mg,dddd:Mg,MMM:["month",cg,fg("monthNamesShort")],MMMM:["month",cg,fg("monthNames")],a:Tg,A:Tg,ZZ:Ag,Z:Ag},kg={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Ng=function(t){return dg(kg,t)},Og=function(t,e,n){if(void 0===e&&(e=kg.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=kg[e]||e).replace(lg,(function(t,e){return r.push(e),"@@@"}));var i=dg(dg({},yg),n);return(e=e.replace(ag,(function(e){return _g[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))};function Pg(t,e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=kg[e]||e,t.length>1e3)return null;var r={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],o=[],a=e.replace(lg,(function(t,e){return o.push(xg(e)),"@@@"})),s={},u={};a=xg(a).replace(ag,(function(t){var e=Cg[t],n=e[0],r=e[1],o=e[3];if(s[n])throw new Error("Invalid format. "+n+" specified twice in format");return s[n]=!0,o&&(u[o]=!0),i.push(e),"("+r+")"})),Object.keys(u).forEach((function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")})),a=a.replace(/@@@/g,(function(){return o.shift()}));var c=t.match(new RegExp(a,"i"));if(!c)return null;for(var l,h=dg(dg({},yg),n),f=1;f11||r.month<0||r.day>31||r.day<1||r.hour>23||r.hour<0||r.minute>59||r.minute<0||r.second>59||r.second<0)return null;return l}var Ig={format:Og,parse:Pg,defaultI18n:vg,setGlobalDateI18n:bg,setGlobalDateMasks:Ng};function Lg(t,e){return(y.format||Ig.format)(t,e)}function Dg(t){return(0,M.isString)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),(0,M.isDate)(t)&&(t=t.getTime()),t}var Rg=1e3,zg=6e4,Fg=36e5,Bg=24*Fg,jg=31*Bg,Ug=365*Bg,Vg=[["HH:mm:ss",Rg],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",zg],["HH:mm",6e5],["HH:mm",18e5],["HH",Fg],["HH",6*Fg],["HH",12*Fg],["YYYY-MM-DD",Bg],["YYYY-MM-DD",4*Bg],["YYYY-WW",7*Bg],["YYYY-MM",jg],["YYYY-MM",4*jg],["YYYY-MM",6*jg],["YYYY",380*Bg]];function Hg(t,e,n){var r,i=(r=function(t){return t[1]},function(t,e,n,i){for(var o=(0,M.isNil)(n)?0:n,a=(0,M.isNil)(i)?t.length:i;o>>1;r(t[s])>e?a=s:o=s+1}return o})(Vg,(e-t)/n)-1,o=Vg[i];return i<0?o=Vg[0]:i>=Vg.length&&(o=(0,M.last)(Vg)),o}var Gg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return eg(e,t),e.prototype.translate=function(t){t=Dg(t);var e=this.values.indexOf(t);return-1===e&&(e=(0,M.isNumber)(t)&&t-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):Lg(r,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;(0,M.each)(e,(function(t,n){e[n]=Dg(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(og),Zg=Gg,Wg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return eg(e,t),e.prototype.scale=function(t){if((0,M.isNil)(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=(0,M.head)(e),r=(0,M.last)(e);nthis.max&&(this.max=r),(0,M.isNil)(this.minLimit)||(this.min=n),(0,M.isNil)(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=(0,M.getRange)(this.values),e=t.min,n=t.max;(0,M.isNil)(this.min)&&(this.min=e),(0,M.isNil)(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=(0,M.filter)(n,(function(t){return t>=e.min&&t<=e.max}))),n},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;return(t-n)/(e-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(Jp),Yg=Wg,qg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return eg(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(Yg),Xg=qg;function Kg(t,e){var n=Math.E;return e>=0?Math.pow(n,Math.log(e)/t):-1*Math.pow(n,Math.log(-e)/t)}function $g(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function Qg(t,e,n){(0,M.isNil)(n)&&(n=Math.max.apply(null,t));var r=n;return(0,M.each)(t,(function(t){t>0&&t1&&(r=1),r}var Jg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return eg(e,t),e.prototype.invert=function(t){var e,n=this.base,r=$g(n,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(r-(e=$g(n,a/n)))*o;if(t=0?1:-1;return Math.pow(o,n)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent;return(Kg(r,t)-Kg(r,n))/(Kg(r,e)-Kg(r,n))},e}(Yg),nm=em,rm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return eg(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):Lg(n,this.mask)},e.prototype.scale=function(e){var n=e;return((0,M.isString)(n)||(0,M.isDate)(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return Dg(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if((0,M.isNil)(e)&&(0,M.isNumber)(e)||(this.min=this.translate(this.min)),(0,M.isNil)(n)&&(0,M.isNumber)(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,o=i,a=0;(0,M.each)(t,(function(t){var e=Dg(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a1&&(this.minTickInterval=o-i),(0,M.isNil)(e)&&(this.min=i),(0,M.isNil)(n)&&(this.max=a)}},e}(Xg),im=rm,om=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return eg(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,r=this.getInvertPercent(t),i=Math.floor(r*(n-1));if(i>=n-1)return(0,M.last)(e);if(i<0)return(0,M.head)(e);var o=e[i],a=i/(n-1);return o+(r-a)/((i+1)/(n-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||((0,M.last)(e)!==this.max&&e.push(this.max),(0,M.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<(0,M.head)(e))return 0;if(t>(0,M.last)(e))return 1;var n=0;return(0,M.each)(e,(function(e,r){if(!(t>=e))return!1;n=r})),n/(e.length-1)},e}(Yg),am=om,sm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return eg(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(am),um=sm,cm={};function lm(t,e){if(function(t){return cm[t]}(t))throw new Error("type '"+t+"' existed.");cm[t]=e}var hm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return eg(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,M.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},e}(Jp),fm=hm;function dm(t){var e=t.values,n=t.tickInterval,r=t.tickCount,i=t.showLast;if((0,M.isNumber)(n)){var o=(0,M.filter)(e,(function(t,e){return e%n==0})),a=(0,M.last)(e);return i&&(0,M.last)(o)!==a&&o.push(a),o}var s=e.length,u=t.min,c=t.max;if((0,M.isNil)(u)&&(u=0),(0,M.isNil)(c)&&(c=e.length-1),!(0,M.isNumber)(r)||r>=s)return e.slice(u,c+1);if(r<=0||c<=0)return[];for(var l=1===r?s:Math.floor(s/(r-1)),h=[],f=u,d=0;d=c);d++)f=Math.min(u+d*l,c),d===r-1&&i?h.push(e[c]):h.push(e[f]);return h}var pm=Math.sqrt(50),gm=Math.sqrt(10),mm=Math.sqrt(2),vm=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,n;void 0===t&&(t=5);var r,i=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],u=this._domain[a];return u0?r=ym(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,t):r<0&&(r=ym(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,t)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,this.domain(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];(r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=pm?10:o>=gm?5:o>=mm?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=pm?10:o>=gm?5:o>=mm?2:1)}function bm(t,e,n){return("ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e))*e}function xm(t,e,n){var r=bm(t,n,"floor"),i=bm(e,n,"ceil");r=(0,M.fixedBase)(r,n),i=(0,M.fixedBase)(i,n);for(var o=[],a=Math.max((i-r)/(Math.pow(2,12)-1),n),s=r;s<=i;s+=a){var u=(0,M.fixedBase)(s,a);o.push(u)}return{min:r,max:i,ticks:o}}function wm(t,e,n){var r,i=t.minLimit,o=t.maxLimit,a=t.min,s=t.max,u=t.tickCount,c=void 0===u?5:u,l=(0,M.isNil)(i)?(0,M.isNil)(e)?a:e:i,h=(0,M.isNil)(o)?(0,M.isNil)(n)?s:n:o;if(l>h&&(h=(r=[l,h])[0],l=r[1]),c<=2)return[l,h];for(var f=(h-l)/(c-1),d=[],p=0;p=0&&(u=1),1-s/(a-1)-n+u}function Tm(t,e,n){var r=(0,M.size)(e);return 1-(0,M.indexOf)(e,t)/(r-1)-n+1}function Am(t,e,n,r,i,o){var a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Cm(t,e){return t>=e?2-(t-1)/(e-1):1}function km(t,e,n,r){var i=e-t;return 1-.5*(Math.pow(e-r,2)+Math.pow(t-n,2))/Math.pow(.1*i,2)}function Nm(t,e,n){var r=e-t;if(n>r){var i=(n-r)/2;return 1-Math.pow(i,2)/Math.pow(.1*r,2)}return 1}function Om(t,e,n,r,i,o){void 0===n&&(n=5),void 0===r&&(r=!0),void 0===i&&(i=Sm),void 0===o&&(o=[.25,.2,.5,.05]);var a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===a)return{min:t,max:e,ticks:[t]};if(e-t>1e148){var s=(e-t)/(w=n||5);return{min:t,max:e,ticks:Array(w).fill(null).map((function(e,n){return _m(t+s*n)}))}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},c=1;c<1/0;){for(var l=0;lu.score&&(!r||S<=t&&E>=e)&&(u.lmin=S,u.lmax=E,u.lstep=T,u.score=N)}m+=1}d+=1}}c+=1}var O=_m(u.lmax),P=_m(u.lmin),I=_m(u.lstep),L=Math.floor(function(t){return Math.round(1e12*t)/1e12}((O-P)/I))+1,D=new Array(L);D[0]=_m(P);for(l=1;l1&&(i*=Math.ceil(a)),r&&iUg)for(var u=Lm(n),c=Math.ceil(o/Ug),l=s;l<=u+c;l+=c)a.push(Dm(l));else if(o>jg){var h=Math.ceil(o/jg),f=Rm(e),d=function(t,e){var n=Lm(t),r=Lm(e),i=Rm(t);return 12*(r-n)+(Rm(e)-i)%12}(e,n);for(l=0;l<=d+h;l+=h)a.push(zm(s,l+f))}else if(o>Bg){var p=(b=new Date(e)).getFullYear(),g=b.getMonth(),m=b.getDate(),v=Math.ceil(o/Bg),y=function(t,e){return Math.ceil((e-t)/Bg)}(e,n);for(l=0;lFg){p=(b=new Date(e)).getFullYear(),g=b.getMonth(),v=b.getDate();var b,x=b.getHours(),w=Math.ceil(o/Fg),_=function(t,e){return Math.ceil((e-t)/Fg)}(e,n);for(l=0;l<=_+w;l+=w)a.push(new Date(p,g,v,x+l).getTime())}else if(o>zg){var S=function(t,e){return Math.ceil((e-t)/6e4)}(e,n),E=Math.ceil(o/zg);for(l=0;l<=S+E;l+=E)a.push(e+l*zg)}else{var M=o;M=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a})),$p("log",(function(t){var e,n=t.base,r=t.tickCount,i=t.min,o=t.max,a=t.values,s=$g(n,o);if(i>0)e=Math.floor($g(n,i));else{var u=Qg(a,n,o);e=Math.floor($g(n,u))}for(var c=s-e,l=Math.ceil(c/r),h=[],f=e;f=0?1:-1;return Math.pow(t,e)*n}))})),$p("quantile",(function(t){var e=t.tickCount,n=t.values;if(!n||!n.length)return[];for(var r=n.slice().sort((function(t,e){return t-e})),i=[],o=0;op?(s.show(),c.show(),p=l.minX+l.width+10):(s.hide(),c.hide()),s})),this.controllerBtnGroup=new Hp(tv({group:this.group,x:this.x,y:this.y+r+25,width:n,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),a.move(this.x,this.y),this.bindEvents(),this.currentMode===jp&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},t.prototype.bindEvents=function(){var t=this,e=this.group.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var n=this.group.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),n.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat(Sp,":click"),(function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()})),this.group.on("".concat(Ep,":click"),(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()})),this.group.on("".concat(Mp,":click"),(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()})),this.group.on(_p,(function(e){var n=e.type,r=e.speed;t.currentSpeed=r,t.currentMode=n,n===jp?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):n===Up&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())}))},t.prototype.adjustTickIndex=function(t){for(var e=0;e1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var e=this.x+this.start*this.width,n=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",n-e);var r=(0,M.get)(this.handlerStyle,"width",2);this.setText(this.minText,this.maxText);var i=this.dodgeText([e,n]),o=i[0],a=i[1];this.minHandlerShape.setX(e-r/2),(0,M.each)(o,(function(e,n){return t.minTextShape.attr(n,e)})),this.maxHandlerShape.setX(n-r/2),(0,M.each)(a,(function(e,n){return t.maxTextShape.attr(n,e)})),this.currentMode===Up?this.graph.emit(wp,{value:[this.start,this.end].sort()}):this.currentMode===jp&&this.graph.emit(wp,{value:[this.end,this.end]})},t.prototype.dodgeText=function(t){var e,n,r=(0,M.get)(this.handlerStyle,"width",2),i=this.minTextShape,o=this.maxTextShape,a=t[0],s=t[1],u=!1;a>s&&(a=(e=[s,a])[0],s=e[1],i=(n=[o,i])[0],o=n[1],u=!0);var c=i.getBBox(),l=o.getBBox(),h=null,f=null;return"trend"===this.timeBarType?(h=a-c.widththis.x+this.width?{x:s-r/2-2,textAlign:"right"}:{x:s+r/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(h=i.attr("x")>c.width?{x:a,textAlign:"center"}:{x:a,textAlign:"left"},f=o.attr("x")>this.width-l.width?{x:s,textAlign:"right"}:{x:s,textAlign:"center"}),u?[f,h]:[h,f]},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame((function(){var e=t,n=e.ticks,r=e.width,i=t.currentSpeed,o=r/n.length/(1e3*(10-i)/60),a=t.adjustOffsetRange(o/t.width);t.updateStartEnd(a),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())})):void 0},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(bp,null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit(xp,null))},t.prototype.destory=function(){this.graph.off(wp,(function(){}));var t=this.group,e=t.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var n=t.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.off("maxHandlerShape-handler:mousedown"),n.off("maxHandlerShape-handler:touchstart"),n.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("".concat(Sp,":click")),t.off("".concat(Ep,":click")),t.off("".concat(Mp,":click")),t.off(_p),t.destroy(),this.trendComponent&&this.trendComponent.destory()},t}(),lv=cv,hv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fv=function(){return fv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n")),{position:"relative"}),a)&&this.get("graph").get("container").appendChild(t);this.set("timeBarContainer",t),e="SVG"===n.get("renderer")?new jh({container:t,width:i,height:o}):new Ol({container:t,width:i,height:o}),this.get("containerCSS")&&Fd(t,this.get("containerCSS")),this.set("canvas",e)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas").addGroup({name:"timebar-group"});this.set("timeBarGroup",t),this.renderTrend(),this.initEvent();var e="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",e)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var e=this.get("timebar");e&&(e.isPlay=!!t,e.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,e=this._cfgs,n=e.width,r=e.x,i=e.y,o=e.padding,a=e.type,s=e.trend,u=e.slider,c=e.controllerCfg,l=e.textStyle,h=e.tick,f=e.backgroundStyle,d=e.foregroundStyle,p=s.data,g=dv(s,["data"]),m=n-2*o,v="trend"===a?26:4,y=this.get("graph"),b=this.get("timeBarGroup"),x=this.get("canvas"),w=null;if("trend"===a||"simple"===a){var _=this.get("getValue");w=new lv(fv(fv({graph:y,canvas:x,group:b,type:a,x:r+o,y:"trend"===a?i+o:i+o+15,width:m,height:v,padding:o,backgroundStyle:f,foregroundStyle:d,trendCfg:fv(fv({},g),{data:p.map((function(t){return(null==_?void 0:_(t))||t.value}))})},u),{tick:{ticks:p,tickLabelFormatter:h.tickLabelFormatter,tickLabelStyle:h.tickLabelStyle,tickLineStyle:h.tickLineStyle},handlerStyle:fv(fv({},u.handlerStyle),{height:u.height||v}),controllerCfg:c,textStyle:l}))}else"tick"===a&&(w=new Xp(fv({graph:y,canvas:x,group:b,x:r+o,y:i+o,width:n,height:42,padding:2,controllerCfg:c},h)));var S=function e(){var n=t.get("timebar");n.draggingHandler=!1,n.isPlay&&(n.isPlay=!1,n.currentHandler=n.maxHandlerShape,n.changePlayStatus()),document.removeEventListener("mouseup",e)};x.on("mousedown",(function(t){"maxHandlerShape-handler"!==t.target.get("name")&&"minHandlerShape-handler"!==t.target.get("name")&&t.target!==w.foregroundShape||document.addEventListener("mouseup",S)})),this.set("timebar",w)},e.prototype.filterData=function(t){var e,n=t.value;if(!n){n=[];var r=this._cfgs.type;r&&"trend"!==r&&"simple"!==r?"tick"===r&&(n[0]=this._cfgs.tick.start,n[1]=this._cfgs.tick.end):(n[0]=this._cfgs.slider.start,n[1]=this._cfgs.slider.end)}var i=null,o=this._cfgs.type;if("trend"===o||"simple"===o?i=this._cfgs.trend.data:"tick"===o&&(i=this._cfgs.tick.data),i&&0!==i.length){var a=this.get("rangeChange"),s=this.get("graph"),u=Math.round(i.length*n[0]),c=Math.round(i.length*n[1]);c=c>=i.length?i.length-1:c,u=u>=i.length?i.length-1:u;var l=null===(e=this._cfgs.tick)||void 0===e?void 0:e.tickLabelFormatter,h=l?l(i[u]):i[u].date,f=l?l(i[c]):i[c].date;if("tick"!==o)this.get("timebar").setText(h,f);if(a)a(s,h,f);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=s.get("data"));var d=this.get("filterItemTypes"),p=this.get("changeData"),g=this.get("getDate"),m=this.get("shouldIgnore"),v=i[u].date,y=i[c].date;if(p||void 0===p){var b=this.cacheGraphData.nodes,x=this.cacheGraphData.edges,w={},_={};s.getNodes().forEach((function(t){return w[t.getID()]=!0})),s.getEdges().forEach((function(t){return _[t.getID()]=!0})),d.includes("node")&&(null==b||b.forEach((function(t){var e=+((null==g?void 0:g(t))||t.date),n=e>=v&&e<=y||(null==m?void 0:m("node",t,{min:v,max:y})),r=w[t.id];r&&!n?(s.removeItem(t.id),w[t.id]=!1):!r&&n&&(s.addItem("node",t),w[t.id]=!0)})),null==x||x.forEach((function(t){var e=w[t.source]&&w[t.target]||(null==m?void 0:m("edge",t,{min:v,max:y})),n=!!s.findById(t.id);n&&!e?(s.removeItem(t.id),_[t.id]=!1):!n&&e?(s.addItem("edge",t),_[t.id]=!0):n||(_[t.id]=!1)}))),(this.get("filterEdge")||d.includes("edge"))&&(null==x||x.filter((function(t){var e=+((null==g?void 0:g(t))||t.date),n=e>=v&&e<=y||(null==m?void 0:m("edge",t,{min:v,max:y})),r=w[t.source]&&w[t.target],i=n&&r,o=_[t.id];o&&!i?(_[t.id]=!1,s.removeItem(t.id)):!o&&i&&(_[t.id]=!0,s.addItem("edge",t))})))}else d.includes("node")&&s.getNodes().forEach((function(t){var e=t.getModel();if(!(null==m?void 0:m("node",e,{min:v,max:y}))){var n=+((null==g?void 0:g(e))||e.date);ny?s.hideItem(t):s.showItem(t)}})),(this.get("filterEdge")||d.includes("edge"))&&s.getEdges().forEach((function(t){var e=t.getModel();if(!(null==m?void 0:m("edge",e,{min:i[u].date,max:i[c].date}))){var n=+((null==g?void 0:g(e))||e.date);if(ni[c].date)s.hideItem(t);else{var r=t.getSource().isVisible(),o=t.getTarget().isVisible();r&&o&&s.showItem(t)}}}))}}else console.warn("请配置 TimeBar 组件的数据")},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on(wp,this.valueChangeListener)},e.prototype.destroy=function(){var e=this.get("graph");e.off("afterchangedata",this.changeData),e.off("afterrender",this.afterrenderListener),e.off(wp,this.valueChangeListener);var n=this.get("timebar");n&&n.destory&&n.destory(),t.prototype.destroy.call(this);var r=this.get("timeBarContainer");if(r){var i=this.get("container");i||(i=this.get("graph").get("container")),(0,M.isString)(i)&&(i=document.getElementById(i)),i===r&&(i=i.parentElement),i.removeChild(r)}},e}(Ud),gv=pv,mv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vv=Ju.applyMatrix;var yv=function(t){function e(e){return t.call(this,e)||this}return mv(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,n=e.graph;if(!this.destroyed){var r=this.get("container");(0,M.isString)(r)&&(r=document.getElementById(r));var i=Uh("
    ")),o=0,a=0,s=!1,u=0,c=0,l=0,h=0,f=0,d=0;r.addEventListener("mousedown",(function(r){if(e.refresh=!1,r.target===i){var u=i.style;l=parseInt(u.width,10),h=parseInt(u.height,10);var c=t.get("width"),p=t.get("height");l>c||h>p||(d=n.getZoom(),f=t.get("ratio"),s=!0,o=r.clientX,a=r.clientY)}}),!1),r.addEventListener("mousemove",(function(e){if(s&&!(0,M.isNil)(e.clientX)&&!(0,M.isNil)(e.clientY)){var r=t.get("width"),p=t.get("height"),g=i.style;u=parseInt(g.left,10),c=parseInt(g.top,10),l=parseInt(g.width,10),h=parseInt(g.height,10);var m=o-e.clientX,v=a-e.clientY;u-m<0?m=u:u-m+l>=r&&(m=0),c-v<0?v=c:c-v+h>=p&&(v=0),c-=v,Fd(i,{left:"".concat(u-=m,"px"),top:"".concat(c,"px")}),n.translate(m*d/f,v*d/f),o=e.clientX,a=e.clientY}}),!1),r.addEventListener("mouseleave",(function(){s=!1,e.refresh=!0}),!1),r.addEventListener("mouseup",(function(){s=!1,e.refresh=!0}),!1),this.set("viewport",i),r.appendChild(i)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("width"),n=this.get("height"),r=this.get("graph"),i=r.get("width"),o=i/r.get("height"),a=r.getGroup(),s=a.getCanvasBBox(),u=[(s.minX+s.maxX)/2,(s.minY+s.maxY)/2],c=[s.maxX-s.minX,s.maxY-s.minY],l={centerX:u[0],centerY:u[1],width:0,height:0,minX:0,minY:0};s[0]/s[1]>o?(l.width=c[0],l.height=l.width/o):(l.height=c[1],l.width=l.height*o),l.minX=u[0]-l.width/2,l.minY=u[1]-l.height/2;var h=a.getMatrix();h||(h=[1,0,0,0,1,0,0,0,1]);var f=B.invert([1,0,0,0,1,0,0,0,1],h),d=vv({x:l.minX,y:l.minY},f),p=r.getCanvasByPoint(d.x,d.y),g=this.get("viewport");g||this.initViewport();var m=i/l.width,v=m*e,y=m*n,b=e*-p.x/l.width,x=n*-p.y/l.height,w=b+v,_=x+y;b<0&&(v+=b,b=0),w>e&&(v-=w-e),x<0&&(y+=x,x=0),_>n&&(y-=_-n),this.set("ratio",t),Fd(g,{left:"".concat(b,"px"),top:"".concat(x,"px"),width:"".concat(v,"px"),height:"".concat(y,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this,e=t.get("graph"),n=e.get("width"),r=e.get("height")/n,i=t.get("className"),o=t.get("container"),a=t.get("width"),s=t.get("height");a||s||(a=200),a?(s=r*a,t.set("height",s)):(a=1/r*s,t.set("width",a));var u=Uh("
    "));(0,M.isString)(o)&&(o=document.getElementById(o)),o?o.appendChild(u):e.get("container").appendChild(u),t.set("container",u);var c=Uh('
    ');u.appendChild(c);var l=Uh('');c.appendChild(l),t.set("containerDOM",c),t.set("containerSpan",l);var h=Uh(''));t.set("imgDOM",h),t.updateImgSize(),l.appendChild(h),t.updateCanvas()},e.prototype.updateImgSize=function(){var t=this,e=t.get("imgDOM"),n=t.get("width"),r=t.get("height");e.onload=function(){var t=function(t,e){var n,r;if(t.naturalWidth)n=t.naturalWidth,r=t.naturalHeight;else{var i=new Image;i.src=t.src,i.onload=function(){e&&e(i.width,i.height)}}return[n,r]}(e);t[0]>t[1]?e.width=n:e.height=r}},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("width")/t.get("canvas").getCanvasBBox().width;this.set("ratio",e),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){var e=this;e.get("imgDOM").remove(),e.set("graphImg",t);var n=Uh(''));e.set("imgDOM",n),n.src=t,e.updateImgSize(),e.get("containerSpan").appendChild(n),e.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(Ud),bv=yv,xv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wv=function(){return wv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n(o||r.get("height"))&&n>1||s<(a||.05*r.get("height"))&&n<1)&&(n=1),s*=n,e.set("r",s),e.filter(t)}},e.prototype.filter=function(t){var e=this,n=e.get("graph"),r=n.getNodes(),i={},o=e.get("r"),a=e.get("type"),s={x:t.x,y:t.y};e.updateDelegate(s,o);var u=e.get("shouldShow"),c=e.get("vShapes");c&&c.forEach((function(t){t.remove(),t.destroy()})),c=[],r.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y;_v({x:n,y:r},s)
    ");r.appendChild(i),this.set("container",i);var o=this.render();Fd(i,this.getContainerPos(o)),this.bindEvents()},e.prototype.getContainerPos=function(t){void 0===t&&(t=[0,0]);var e=this.get("graph"),n=this.get("offsetX"),r=this.get("offsetY"),i=this.get("margin"),o=this.get("position").split("-"),a={top:0,right:1,bottom:2,left:3},s={left:(e.getWidth()-t[0])/2+0,top:(e.getHeight()-t[1])/2+0};return o.forEach((function(n){var r=i[a[n]],o=n;switch(n){case"top":case"left":r+=0;break;case"bottom":r=e.getHeight()-t[1]-r+0,o="top";break;default:r=e.getWidth()-t[0]-r+0,o="left"}s[o]=r})),s.top+=r+e.getContainer().offsetTop,s.left+=n+e.getContainer().offsetLeft,Object.keys(s).forEach((function(t){s[t]="".concat(s[t],"px")})),s},e.prototype.bindEvents=function(){var t=this,e=t.get("filter");if(e&&e.enable){var n=e.trigger||"click";Iv.includes(n)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),n="click");var r=t.get("legendCanvas");"mouseenter"===n?(r.on("node-container:mouseenter",(function(e){return t.filterData(e)})),r.on("node-container:mouseleave",(function(e){t.clearFilter(),t.clearActiveLegend()}))):(r.on("node-container:click",(function(e){return t.filterData(e)})),r.on("click",(function(e){e.target&&e.target.isCanvas&&e.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())})))}},e.prototype.changeData=function(t){this.set("data",t);var e=this.render();Fd(this.get("container"),this.getContainerPos(e))},e.prototype.activateLegend=function(t){var e=this.get("filter");(null==e?void 0:e.multiple)||this.clearActiveLegend();var n=t.get("parent");n.get("active")?(n.set("active",!1),this.findLegendItemsByState("active").length&&n.set("inactive",!0)):(n.set("inactive",!1),n.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach((function(t){t.set("inactive",!0)})):this.clearActiveLegend();var r=(null==e?void 0:e.legendStateStyles)||{},i=(null==r?void 0:r.inactive)||{opacity:.5,"text-shape":{opacity:.5}},o=i["text-shape"]||{};this.findLegendItemsByState("inactive").forEach((function(t){var e=t.get("children"),n=e[0],r=e[1];n.attr(Pv(Pv({},n.get("oriAttrs")),i)),r.attr(Pv(Pv({},r.get("oriAttrs")),o))}));var a=(null==r?void 0:r.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},s=a["text-shape"]||{};this.findLegendItemsByState("active").forEach((function(t){var e=t.get("children"),n=e[0],r=e[1];n.attr(Pv(Pv({},n.get("oriAttrs")),a)),r.attr(Pv(Pv({},r.get("oriAttrs")),s))}))},e.prototype.findLegendItemsByState=function(t,e,n){void 0===e&&(e="all"),void 0===n&&(n=!0);var r=this.get("legendCanvas").find((function(t){return"root"===t.get("name")})),i=r.find((function(t){return"node-group"===t.get("name")})),o=r.find((function(t){return"edge-group"===t.get("name")}));return"node"===e?i.get("children").filter((function(e){return!!e.get(t)===n})):"edge"===e?o.get("children").filter((function(e){return!!e.get(t)===n})):i.get("children").filter((function(e){return!!e.get(t)===n})).concat(o.get("children").filter((function(e){return!!e.get(t)===n})))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas").find((function(t){return"root"===t.get("name")}));[t.find((function(t){return"node-group"===t.get("name")})),t.find((function(t){return"edge-group"===t.get("name")}))].forEach((function(t){t.get("children").forEach((function(t){t.set("active",!1),t.set("inactive",!1);var e=t.get("children"),n=e[0],r=e[1];n.attr(n.get("oriAttrs")),r.attr(r.get("oriAttrs"))}))}))},e.prototype.filterData=function(t){var e=this.get("filter"),n=null==e?void 0:e.filterFunctions;if(e&&n){var r=this.get("legendCanvas"),i=this.get("graph"),o=e.graphActiveState||"active",a=e.graphInactiveState||"inactive",s=e.multiple;this.clearFilter(),s||this.clearActiveLegend(),this.activateLegend(t.target);var u=r.find((function(t){return"root"===t.get("name")})),c=u.find((function(t){return"node-group"===t.get("name")})),l=u.find((function(t){return"edge-group"===t.get("name")})),h=c.get("children").filter((function(t){return t.get("active")})),f=l.get("children").filter((function(t){return t.get("active")})),d=0,p=["getNodes","getEdges"];p.forEach((function(t){i[t]().forEach((function(e){var r=!1;("getNodes"===t?h:f).forEach((function(t){var i=n[t.get("id")];r=r||i(e.getModel())})),r?(i.setItemState(e,a,!1),i.setItemState(e,o,!0),d++):(i.setItemState(e,o,!1),i.setItemState(e,a,!0))}))})),d||p.forEach((function(t){i[t]().forEach((function(t){i.clearItemStates(t,[a])}))}))}},e.prototype.clearFilter=function(){var t=this.get("graph"),e=this.get("filter");if(e){var n=e.graphActiveState||"active",r=e.graphInactiveState||"inactive";t.getNodes().forEach((function(e){t.clearItemStates(e,[n,r])})),t.getEdges().forEach((function(e){t.clearItemStates(e,[n,r])}))}},e.prototype.render=function(){var t=this;this.processData();var e=this.get("legendCanvas");e?e.clear():e=new Ol({container:this.get("container"),width:200,height:200});var n=e.addGroup({name:"root"}),r=n.addGroup({name:"node-group"}),i=n.addGroup({name:"edge-group"});this.set("legendCanvas",e);var o=this.get("itemsData"),a=[r,i];["nodes","edges"].forEach((function(e,n){o[e].forEach((function(r){var i,o,s=a[n].addGroup({id:r.id,name:"node-container"}),u=r.type,c=t.getShapeSize(r),l=c.width,h=c.height,f=c.r,d=t.getStyle(e.substr(0,4),r);switch(r.type){case"circle":default:o={r:f,x:0,y:0};break;case"rect":o={width:l,height:h,x:-l/2,y:-h/2};break;case"ellipse":o={rx:l,ry:h,x:0,y:0},u="ellipse";break;case"line":o={x1:-l/2,y1:0,x2:l/2,y2:0},u="line";break;case"quadratic":o={path:[["M",-l/2,0],["Q",0,l/2,l/2,0]]},u="path";break;case"cubic":o={path:[["M",-l/2,0],["C",-l/6,l/2,l/6,-l/2,l/2,0]]},u="path";break;case"diamond":o={path:[["M",0,-h],["L",l,0],["L",0,h],["L",-l,0],["Z"]]},u="path";break;case"triangle":o={path:[["M",-l,h],["L",0,-h],["L",l,h],["Z"]]},u="path";break;case"star":o={path:Ju.getStarPath(3*f,1.2*f)},u="path"}var p=s.addShape(u,{attrs:Pv(Pv({},o),d),name:"".concat(r.type,"-node-keyShape"),oriAttrs:Pv({opacity:1},d)});if(r.label){var g=p.getBBox(),m=(null===(i=r.labelCfg)||void 0===i?void 0:i.style)||{},v=Pv({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},m);s.addShape("text",{attrs:Pv({x:g.maxX+4,y:0,text:r.label},v),className:"legend-label",name:"".concat(r.type,"-node-text"),oriAttrs:v})}}))}));var s,u=this.get("padding"),c=n.find((function(t){return"title-container"===t.get("name")})),l={height:0,maxY:0,width:0};if(this.get("title")){c||(c=n.addGroup({name:"title-container"}));var h={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:u[0]},f=this.get("titleConfig")||{},d=Object.assign(h,f.style||{});s=c.addShape("text",{attrs:Pv({text:this.get("title")},d)}),l=c.getCanvasBBox(),c.setMatrix([1,0,0,0,1,0,f.offsetX,f.offsetY,1])}this.layoutItems();var p=n.getCanvasBBox(),g=r.getCanvasBBox(),m=g.minX<0?Math.abs(g.minX)+u[3]:u[3],v=l.maxYc.max&&(c.max=o[0]),d>l&&(l=d),t.setMatrix([1,0,0,0,1,0,p,g,1])}));var h=c.max-c.min,f={min:0,max:-1/0},d=s.getCanvasBBox();o[0]=0,o[1]="vertical"===r?d.maxX+e:d.maxY+n,u.get("children").forEach((function(t,i){0===i&&(f.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),c=u.width,l=u.height,h=0,d=0;"vertical"===r?(h=o[1],d=o[0],o[0]=d+s.height+n,t.setMatrix([1,0,0,0,1,0,0,d+l/2,1])):(h=o[0],d=o[1],o[0]=h+s.width+e,t.setMatrix([1,0,0,0,1,0,h+c/2,0,1])),o[0]>f.max&&(f.max=o[0])}));var p=f.max-f.min;if(i&&""!==i&&"left"!==i){var g=h-p,m="center"===i?Math.abs(g)/2:Math.abs(g);(g<0?s:u).get("children").forEach((function(t){var e=t.getMatrix()||[1,0,0,0,1,0,0,0,1];"vertical"===r?e[7]+=m:e[6]+=m,t.setMatrix(e)}))}},e.prototype.processData=function(){var t=this.get("data"),e={nodes:[],edges:[]};t.nodes&&(t.nodes.sort((function(t,e){return t.order-e.order})),t.nodes.forEach((function(t){var n,r,i,o,a,s=t.size||[(null===(n=t.style)||void 0===n?void 0:n.width)||(null===(r=t.style)||void 0===r?void 0:r.r)||8,(null===(i=t.style)||void 0===i?void 0:i.height)||(null===(o=t.style)||void 0===o?void 0:o.r)||8],u=(null===(a=t.labelCfg)||void 0===a?void 0:a.style)||{};e.nodes.push({id:t.id||(0,M.uniqueId)(),type:t.type||"circle",style:Pv({},t.style),order:t.order,label:t.label,itemType:"node",size:s,labelCfg:{position:"right",style:Pv({fontFamily:"Arial"},u)}})}))),t.edges&&(t.edges.sort((function(t,e){return t.order-e.order})),t.edges.forEach((function(t){var n,r,i=t.type||"line";"cubic-horizontal"===t.type&&(i="cubic");var o=(null===(n=t.labelCfg)||void 0===n?void 0:n.style)||{},a=t.size||[(null===(r=t.style)||void 0===r?void 0:r.width)||8,1];e.edges.push({id:t.id||(0,M.uniqueId)(),type:i,size:a,style:Pv({lineWidth:(0,M.isArray)(a)?a[1]:1},t.style),order:t.order,label:t.label,itemType:"edge",labelCfg:{position:"right",style:Pv({fontFamily:"Arial"},o)}})}))),this.set("itemsData",e)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var e=this.get(t);if((0,M.isNumber)(e))this.set(t,[e,e,e,e]);else if((0,M.isArray)(e))switch(e.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[e[0],e[0],e[0],e[0]]);break;case 2:this.set(t,[e[0],e[1],e[0],e[1]]);break;case 3:this.set(t,[e[0],e[1],e[2],e[1]])}return this.get(t)},e.prototype.getShapeSize=function(t){var e,n,r;return t.size&&((0,M.isArray)(t.size)?(e=t.size[0],n=t.size[1]||t.size[0],r=t.size[0]/2):(0,M.isNumber)(t.size)&&(e=t.size,n=t.size,r=t.size/2)),t.style&&(t.style.width&&(e=t.style.width),t.style.height&&(n=t.style.height),t.style.r&&(r=t.style.r)),r||(r=5),e||(e=r),n||(n=r),{width:e,height:n,r:r}},e.prototype.getStyle=function(t,e){return Pv(Pv({},"node"===t?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1}),e.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");null==t||t.destroy();var e=this.get("graph").get("container"),n=this.get("container");e.removeChild(n)},e}(Ud),Dv=Lv,Rv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zv=function(){return zv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n+

    ":"

    -

    ",l=e?"":"

    ".concat(a,"

    "),h=e?"".concat(u,"px"):"".concat(u,"px ").concat(u,"px 0 0");return'
    \n \n

    ").concat(i,"

    \n ").concat(c,"\n ").concat("

    x

    ","\n
    \n ").concat(l,"\n ")}},e.prototype.init=function(){var t=this;if(!t.destroyed){var e=t.get("graph").getContainer(),n=t.get("container");this.get("containerCfg")?(n=this.createContainer(),e.appendChild(n)):n=e,this.set("container",n);var r=e.getBoundingClientRect(),i=new Ol({container:e,width:r.right-r.left,height:r.bottom-r.top});Fd(i.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,M.debounce)((function(){return t.resizeCanvas(t)}),100));var o=i.addGroup({id:"annotation-link-group"});t.set("linkGroup",o),t.set("canvas",i),t.get("getTitle")||t.set("getTitle",(function(t){var e,n=(null===(e=null==t?void 0:t.getModel)||void 0===e?void 0:e.call(t))||{},r=n.label,i=n.id;return r||i||"-"})),t.get("getContent")||t.set("getContent",(function(t){var e,n;if(!t)return"-";var r=(null===(e=t.getModel)||void 0===e?void 0:e.call(t))||{},i=r.label,o=r.id,a=null===(n=t.getType)||void 0===n?void 0:n.call(t),s=a?"".concat(a,": "):"";return"".concat(s).concat(i||o||"")}));var a=t.get("defaultData");a&&this.readData(a)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var e=this.get("containerCfg"),n=this.get("graph"),r=n.getContainer(),i=r.getBoundingClientRect(),o=i.left,a=i.right,s=i.top,u=i.bottom-s,c=a-o,l=e.position,h=void 0===l?"top":l,f=e.offsetX,d=void 0===f?0:f,p=e.offsetY,g=void 0===p?0:p,m=Fv(e,["position","offsetX","offsetY"]),v=e.height,y=void 0===v?"fit-content":v,b=e.width,x=void 0===b?n.getWidth():b;"100%"===y&&(y=u),"100%"===x&&(x=c);var w="unset",_="unset",S={};switch(h){case"right":w="".concat(u,"px"),(S={top:0,right:0}).right+=o+d,S.top+=s+g;break;case"bottom":_="".concat(c,"px"),(S={bottom:0,left:0}).left+=o+d,S.bottom+=s+g;break;case"top":_="".concat(c,"px");case"left":w="".concat(u,"px");default:(S={top:0,left:0}).left+=o+d,S.top+=s+g}Object.keys(S).forEach((function(t){S[t]="".concat(S[t],"px")}));var E=Uh("
    "));return Fd(E,zv(zv({position:"absolute",display:"top"===h||"bottom"===h?"inline-flex":"unset",width:(0,M.isNumber)(x)?"".concat(x,"px"):x,height:(0,M.isNumber)(y)?"".concat(y,"px"):y,maxHeight:w,maxWidth:_,overflow:"scroll"},S),m)),r.appendChild(E),E.addEventListener("scroll",(function(e){t.updateLinks()})),E}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout((function(){if(t&&!t.destroyed){var e=t.get("container").getBoundingClientRect(),n=e.right-e.left,r=e.bottom-e.top;t.get("canvas").changeSize(n,r),t.updateOutsideCards(t)}}),250)},e.prototype.updateOutsideCards=function(t){var e=t||this,n=e.get("cardInfoMap")||{},r=e.get("graph"),i=r.getPointByCanvas(0,0),o=r.getPointByCanvas(r.getWidth(),r.getHeight()),a=r.getClientByPoint(i.x,i.y),s=a.x,u=a.y,c=r.getClientByPoint(o.x,o.y),l=c.x,h=c.y;Object.values(n).forEach((function(t){var e=t.card;if(e){var n=e.style,r=Vv(n.left),i=Vv(n.top),o=e.getBoundingClientRect(),a=o.width,c=o.height,f=r,d=i;r+a>l-s&&(f=l-s-a),r<0&&(f=0),i+c>h-u&&(d=h-u-c),i<0&&(d=0),Fd(e,{left:"".concat(f,"px"),top:"".concat(d,"px")})}})),e.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var e=t.item;this.toggleAnnotation(e)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var e=t.get("cardInfoMap")||{};Object.keys(e).forEach((function(e){t.hideCard(e)}))}},e.prototype.toggleAnnotation=function(t,e){var n,r;void 0===e&&(e={});var i=this;if(!i.destroyed){var o=i.get("cardInfoMap")||{},a=i.get("graph"),s=i.get("container"),u=i.get("containerCfg"),c=Object.assign({},i.get("cardCfg")||{},e),l=c.minHeight,h=c.minWidth,f=c.width,d=c.height,p=c.collapsed,g=void 0!==p&&p,m=c.x,v=c.y,y=c.title,b=c.content,x=c.maxTitleLength,w=c.defaultBegin,_=Fv(c,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),S=i.get("linkGroup"),E=this.get("rows")||[[]],T=null===(n=t.isCanvas)||void 0===n?void 0:n.call(t),A=T?Bv:t.getID(),C=o[A]||{},k=C.card,N=C.link,O=C.x,P=C.y,I=C.title,L=C.content,D=this.get("getTitle"),R=this.get("getContent"),z=this.get("getContentPlaceholder")||function(){return""},F=this.get("getTitlePlaceHolder")||function(){return""},B=z(t),j=F(t),U=Uh(this.getDOMContent(zv({itemId:A,collapsed:g,title:(null===(r=I||y||(null==D?void 0:D(t)))||void 0===r?void 0:r.substr(0,x))||j,content:L||b||(null==R?void 0:R(t))||B},_))),V=(0,M.isNumber)(l)?"".concat(l,"px"):l;Fd(U,{minHeight:g?"unset":V,minWidth:(0,M.isNumber)(h)?"".concat(h,"px"):h,height:d,width:f});var H,G=!!k;if(G?(null==N||N.remove(!0),s.replaceChild(U,k)):s.appendChild(U),!u){if(H=s.getBoundingClientRect()||{},void 0!==m&&void 0!==v)O=m,P=v;else if(!G&&!T){var Z=H.top,W=w||{},Y=W.left,q=W.right,X=void 0===q?16:q,K=W.top,$=void 0===K?8:K,Q=W.bottom,J=X,tt=$;isNaN(Y)||(J=s.scrollWidth-Y),isNaN(Q)||(tt=s.scrollHeight-Q);var et=(0,M.isNumber)(h)?h:100;O=s.scrollWidth-U.scrollWidth-(E.length-1)*et-J;var nt=E[E.length-1],rt=(nt[nt.length-1]||{}).bbox;P=(null==rt?void 0:rt.bottom)-Z||tt}Fd(U,{position:"absolute",left:"".concat(O,"px"),top:"".concat(P,"px"),cusor:u?"unset":"move"})}this.bindListener(U,A);var it=U.getBoundingClientRect();if(!T){var ot=Uv(t,it,a,this.get("canvas")),at=this.get("linkStyle");N=S.addShape("path",{attrs:zv({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:ot},at)})}if(o[A]=zv(zv({},o[A]||{}),{id:A,collapsed:g,card:U,link:N,x:O,y:P,cardBBox:it,content:L||b,title:I||y,contentPlaceholder:B,titlePlaceholder:j,isCanvas:T}),i.set("cardInfoMap",o),u)this.updateCardPositionsInConatainer(),this.updateLinks();else{var st=!isNaN(m)&&!isNaN(v);if(!G&&!T&&!st){var ut=H.bottom,ct=void 0===ut?0:ut;Z=H.top;E[E.length-1].push({id:A,bbox:it}),it.top>ct-Z-it.height-16&&E.push([]),this.set("rows",E)}}this.updateCardSize(A);var lt=this.get("onAnnotationChange");null==lt||lt(o[A],G?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(t){var e=this.get("container"),n=this.get("containerCfg").position,r=e.getBoundingClientRect().width,i=getComputedStyle(e),o=Vv(i.paddingLeft)+Vv(i.paddingRight);r-=o,Object.values(t).forEach((function(t){var e=t.card,i=e.getBoundingClientRect().width;switch(n){case"right":Fd(e,{marginLeft:r?"".concat(r-i,"px"):"0px"});break;case"top":case"bottom":Fd(e,{marginLeft:"8px"})}}))}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var e=this.get("graph"),n=this.get("cardInfoMap");if(n){var r=n[t].collapsed,i=e.findById(t);if(i)"hide"!==this.get("cardCfg").collapseType||r?this.toggleAnnotation(i,{collapsed:!r}):this.hideCard(t),n[t]=zv(zv({},n[t]),{collapsed:!r})}}},e.prototype.hideCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e&&e[t]){var n=e[t],r=n.card,i=n.link;Fd(r,{display:"none"}),null==i||i.hide(),this.get("onAnnotationChange")(e[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var n=e[t],r=n.card,i=n.link;this.get("container").removeChild(r),null==i||i.remove(!0),delete e[t],this.get("onAnnotationChange")(n,"remove")}}},e.prototype.bindListener=function(t,e){var n=this;if(!this.destroyed){t.addEventListener("mousemove",(function(t){var r;if("g6-annotation-collapse"===t.target.className?r="collapse":"g6-annotation-expand"===t.target.className?r="expand":"g6-annotation-close"===t.target.className&&(r="close"),r){var i=n.get("cardCfg").onMouseEnterIcon;(void 0===i?function(){}:i)(t,e,r)}})),t.addEventListener("mouseout",(function(t){var r;if("g6-annotation-collapse"===t.target.className?r="collapse":"g6-annotation-expand"===t.target.className?r="expand":"g6-annotation-close"===t.target.className&&(r="close"),r){var i=n.get("cardCfg").onMouseLeaveIcon;(void 0===i?function(){}:i)(t,e,r)}})),t.addEventListener("mouseenter",(function(t){var r=n.get("cardInfoMap");if(r){var i=n.get("graph"),o=i.findById(e);if(o){var a=n.get("itemHighlightState");i.setItemState(o,a,!0)}var s=r[e].link;if(s){var u=n.get("linkHighlightStyle")||{};s.attr(u)}}})),t.addEventListener("mouseleave",(function(t){var r=n.get("cardInfoMap");if(r){var i=n.get("graph"),o=i.findById(e);if(o){var a=n.get("itemHighlightState");i.setItemState(o,a,!1)}var s=r[e].link;if(s){var u=n.get("linkHighlightStyle")||{};Object.keys(u).forEach((function(t){s.attr(t,void 0),s.attr(t,void 0)}));var c=n.get("linkStyle");s.attr(c)}}})),t.addEventListener("click",(function(t){var r=(n.get("cardCfg")||{}).onClickIcon;if("g6-annotation-collapse"===t.target.className||"g6-annotation-expand"===t.target.className)"hide"===n.get("cardCfg").collapseType?n.hideCard(e):n.handleExpandCollapseCard(e),null==r||r(t,e,"g6-annotation-collapse"===t.target.className?"collapse":"expand");else if("g6-annotation-close"===t.target.className){"remove"===n.get("cardCfg").closeType?n.removeCard(e):n.hideCard(e),null==r||r(t,e,"close")}})),this.get("editable")&&t.addEventListener("dblclick",(function(t){var r=n.get("cardInfoMap"),i=(n.get("cardCfg")||{}).maxTitleLength,o=void 0===i?20:i;if(r){var a=t.target,s=a.className;if("g6-annotation-title"===s||"g6-annotation-content"===s){var u="g6-annotation-title"===s?a.getBoundingClientRect():a.parentNode.getBoundingClientRect(),c=u.width,l=u.height,h=getComputedStyle(a),f=Uh("<".concat("g6-annotation-title"===s?"input":"textarea",' class="').concat(s,'-input" type="textarea" style="width:').concat(c,"px; height: ").concat(l,'px; min-width: 16px;"/>')),d=Uh('
    '));d.appendChild(f),a.parentNode.replaceChild(d,a);var p=r[e],g=p.contentPlaceholder,m=p.titlePlaceholder,v=p.content,y=p.title,b=v;"g6-annotation-title"===s?(f.name="title",f.maxLength=o,b=y):f.name="content",b?(f.innerHTML=a.innerHTML,f.value=a.innerHTML):f.placeholder="g6-annotation-title"===s?m:g,f.focus(),f.addEventListener("blur",(function(t){f.value&&(a.innerHTML=f.value,p[f.name||"title"]=f.value),d.parentNode.replaceChild(a,d),n.updateCardSize(e);var r=n.get("onAnnotationChange");null==r||r(p,"update")}))}}}));var r=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",(function(e){var i=e.target.className;if(!r.includes(i)){var o=t.style;n.set("dragging",{card:t,x:e.clientX,y:e.clientY,left:Vv(o.left),top:Vv(o.top)})}})),t.addEventListener("drag",(function(t){t.preventDefault();var r=n.get("cardInfoMap");if(r){var i=t.clientX,o=t.clientY,a=n.get("dragging");if(!isNaN(i)&&!isNaN(o)&&a){var s=a.x,u=a.y,c=a.left,l=a.top,h=a.card,f=i-s,d=o-u;c+=f,l+=d;var p=n.get("graph"),g=p.getPointByCanvas(0,0),m=p.getPointByCanvas(p.getWidth(),p.getHeight()),v=p.getClientByPoint(g.x,g.y),y=v.x,b=v.y,x=p.getClientByPoint(m.x,m.y),w=x.x,_=x.y,S=h.getBoundingClientRect();(c>w-y-(S.right-S.left)&&f>0||c<0&&f<0)&&(c-=f),(l>_-b-(S.bottom-S.top)&&d>0||l<0&&d<0)&&(l-=d),Fd(h,{left:"".concat(c,"px"),top:"".concat(l,"px"),visibility:"hidden"}),s=i,u=o;var E=(r[e]||{}).link;if(E){var M=p.findById(e);E.attr("path",Uv(M,S,p,n.get("canvas")))}n.set("dragging",{x:s,y:u,left:c,top:l,card:h})}}}));t.addEventListener("dragend",(function(t){var r=n.get("cardInfoMap");if(r){var i=n.get("dragging");if(i){var o=i.left,a=i.top,s=i.card;r[e].x=o,r[e].y=a,Fd(s,{visibility:"visible"}),n.set("dragging",!1);var u=n.get("rows");null==u||u.forEach((function(t){for(var n=t.length-1;n>=0;n--)t[n].id===e&&t.splice(n,1)}));var c=n.get("onAnnotationChange");null==c||c(r[e],"update")}}}))}},e.prototype.updateCardSize=function(t){var e=this.get("cardInfoMap");if(e){var n=e[t].card,r=n.getBoundingClientRect().width,i=n.getElementsByClassName("g6-annotation-title")[0];if(i){var o=getComputedStyle(i),a=Vv(o.marginLeft),s=i.getBoundingClientRect().width;Fd(i,{marginRight:"".concat(r-a-24-16-s,"px")})}}},e.prototype.updateLink=function(t){var e=t.item;if(e){var n=this.get("cardInfoMap");if(n){var r=this.get("canvas"),i=this.get("graph"),o=n[e.getID()]||{},a=o.link,s=o.card;if(a){var u=Uv(e,s.getBoundingClientRect(),i,r);a.attr("path",u)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var n=this.get("graph");Object.values(e).forEach((function(e){var r=e.id,i=n.findById(r);t.updateLink({item:i})}))}}},e.prototype.onGraphDataChange=function(){var t=this,e=this.get("cardInfoMap");if(e){var n=this.get("graph");Object.values(e).forEach((function(e){var r=e.id,i=e.card,o=e.isCanvas;if(i&&!o&&"none"!==i.style.display){var a=n.findById(r);a&&a.isVisible()?t.toggleAnnotation(a):t.hideCard(r)}}))}},e.prototype.onGraphItemVisibilityChange=function(t){var e=t.item,n=t.visible;if(e&&!e.destroyed){var r=this.get("cardInfoMap");if(r){var i=e.getID();r[i]&&(n||this.hideCard(i))}}},e.prototype.saveData=function(t){void 0===t&&(t=!1);var e=this.get("cardInfoMap");if(e){var n=this.get("graph"),r=this.get("getTitle"),i=this.get("getContent"),o=[];return Object.values(e).forEach((function(e){var a=e.title,s=e.content,u=e.x,c=e.y,l=e.id,h=e.collapsed,f=e.card;if(!f||"none"!==f.style.display||t){var d=n.findById(l)||n.get("canvas");o.push({id:l,x:u,y:c,collapsed:h,title:a||(null==r?void 0:r(d)),content:s||(null==i?void 0:i(d)),visible:f&&"none"!==f.style.display})}})),o}},e.prototype.readData=function(t){var e=this,n=this.get("graph");t.forEach((function(t){var r=t.id,i=t.x,o=t.y,a=t.title,s=t.content,u=t.collapsed,c=t.visible,l=n.findById(r);if(l||r!==Bv||(l=n.get("canvas")),!l){var h=e.get("cardInfoMap")||{};return h[r]=t,void e.set("cardInfoMap",h)}e.toggleAnnotation(l,{x:i,y:o,title:a,content:s,collapsed:u}),c||e.hideCard(r)}))},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(t){var e=this.get("container");Object.values(t).forEach((function(t){var n=t.card,r=t.link;e.removeChild(n),null==r||r.remove(!0)})),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("graph");e&&!e.destroyed&&(this.get("containerCfg")&&e.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(Ud),Uv=function(t,e,n,r){var i,o;if("edge"===t.getType())o=[t.getKeyShape().getPoint(.5)];else{var a=null===(i=t.getKeyShape)||void 0===i?void 0:i.call(t).getBBox(),s=a.minX,u=a.minY,c=a.maxX,l=a.maxY,h=t.getModel(),f=h.x,d=h.y;o={left:{x:s+=f,y:((u+=d)+(l+=d))/2},right:{x:c+=f,y:(u+l)/2},top:{x:(s+c)/2,y:u},bottom:{x:(s+c)/2,y:l}}}Object.keys(o).forEach((function(t){var e=o[t],i=e.x,a=e.y,s=n.getClientByPoint(i,a);o[t]=r.getPointByClient(s.x,s.y)}));var p=e.top,g=void 0===p?0:p,m=e.left,v=void 0===m?0:m,y=e.right,b=void 0===y?0:y,x=e.bottom,w=void 0===x?0:x,_={left:r.getPointByClient(v,(g+w)/2),right:r.getPointByClient(b,(g+w)/2),top:r.getPointByClient((v+b)/2,g),bottom:r.getPointByClient((v+b)/2,w)};return function(t,e){var n,r,i=1/0;Object.keys(t).forEach((function(o){var a=t[o];Object.keys(e).forEach((function(t){var o=e[t],s=a.x-o.x,u=a.y-o.y,c=s*s+u*u;i>c&&(i=c,n=a,r=o)}))}));var o=Ju.getControlPoint(n,r,.5,20);return[["M",n.x,n.y],["Q",o.x,o.y,r.x,r.y]]}(o,_)},Vv=function(t){return Number(t.replace(/\s+|px/gi,""))||0},Hv={PluginBase:Ud,Menu:Kd,Grid:Zd,Minimap:np,Bundling:sp,ToolBar:gp,Tooltip:yp,Fisheye:fp,TimeBar:gv,ImageMinimap:bv,EdgeFilterLens:Mv,SnapLine:Nv,Legend:Dv,Annotation:jv};var Gv=function(){return Gv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1){var u=$v(i,a),c=u.configs,l=u.totalValue;if(l){var h=Qv(n),f=h.lineWidth,d=h.arcR,p=[d,0],g=0;if(1===s)return void Xv(e,{arcR:d,arcBegin:p,beginAngle:g,config:c[0],fanIndex:0,lineWidth:f,totalValue:l,drawWhole:!0});for(var m=0;m.999)n=[o,1e-4],i=1;else{var v=m*Math.PI*2;r=s+v,n=[o*Math.cos(r),-o*Math.sin(r)],i=v>Math.PI?1:0}var y={path:[["M",a[0],a[1]],["A",o,o,0,i,0,n[0],n[1]]],stroke:u.color||(null==g?void 0:g.attr("stroke"))||Wv[c%Wv.length],lineWidth:l};return g?g.attr(y):t.shapeMap["".concat(Yv).concat(c)]=t.addShape("path",{attrs:y,name:"".concat(Yv).concat(c),draggable:!0}),{beginAngle:r,arcBegin:n,shape:t.shapeMap["".concat(Yv).concat(c)],shouldEnd:d||m>.999}},Kv=function(t,e,n){var r=t.donutAttrs,i=t.donutColorMap,o=void 0===i?{}:i,a={},s=e.getContainer();if(r){var u=$v(r,o),c=u.configs,l=u.totalValue;if(l)for(var h=Qv(n),f=h.lineWidth,d=h.arcR,p=[d,0],g=0,m=0;m=0;r--){var i=t[r];i.id="".concat(i.x,"|||").concat(i.y),n[i.id]||(n[i.id]=i,e.push(i))}return e},ey=function(t){return ty(t)},ny=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},ry=function(t,e,n){var r=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return 0===n&&0===r?0:n/e.width>r/e.height}(e,t);if(0===r){var i=t.centerX,o=t.centerY;return n.ye.x?i=t.maxX:n.xt.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},iy=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},oy=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},ay=function(t,e){var n=t.x,r=t.y;return ne.maxX||re.maxY},sy=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},uy=function(t,e,n,r,i){return sy(t,e)+sy(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,r,i])},cy=function t(e,n,r,i,o){void 0===o&&(o=0),e.unshift(n[i]),r[i]&&r[i]!==i&&o<=100&&t(e,n,r,r[i],o+1)},ly=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=r.x-t.x,s=r.y-t.y,u=n.x-e.x,c=n.y-e.y,l=r.x-e.x,h=r.y-e.y;return(i*s-o*a)*(u*h-c*l)<=0&&(i*c-o*u)*(a*h-s*l)<=0},hy=function(t,e,n){if(n.width||n.height){var r=oy(n),i=r[0],o=r[1],a=r[2],s=r[3];return ly(t,e,i,o)||ly(t,e,i,s)||ly(t,e,o,a)||ly(t,e,a,s)}return!1},fy=function(t,e,n,r){var i=[];return t.forEach((function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(hy(t,e,n)||hy(t,e,r))return;i.push(t)}})),ty(i)},dy=function(t,e){var n=[],r=t[0];return n.push("M".concat(r.x," ").concat(r.y)),t.forEach((function(r,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)}(r,o,a)){var s=function(t,e,n,r){var i=sy(t,e),o=sy(n,e);return it.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,S).filter((function(t){return ay(t,g)&&ay(t,m)})))})),[{x:v.x,y:y.y},{x:y.x,y:v.y}].forEach((function(t){ay(t,g)&&ay(t,m)&&_.push(t)})),_.unshift(v),_.push(y);var E=function(t,e,n,r,i,o,a){var s,u=[],c=((s={})[e.id]=e,s),l={},h={},f={};h[e.id]=0,f[e.id]=uy(e,n,e);var d=new gy;d.add({id:e.id,value:f[e.id]});var p,g={};for(t.forEach((function(t){g[t.id]=t}));Object.keys(c).length;){var m=d.minId(!1);if(!m)break;if((p=c[m])===n){var v=[];return cy(v,g,l,n.id),v}delete c[p.id],d.remove(p.id),u.push(p),fy(t,p,r,i).forEach((function(t){if(-1===u.indexOf(t)){var r=t.id;c[r]||(c[r]=t);var i=f[p.id]+sy(p,t);h[r]&&i>=h[r]||(l[r]=p.id,h[r]=i,f[r]=h[r]+uy(t,n,e,o,a)),d.add({id:r,value:f[r]})}}))}return[e,n]}(_=ty(_),v,y,o,a,t,e);return E.unshift(t),E.push(e),ey(E)},gy=function(){function t(){this.arr=[],this.map={},this.arr=[],this.map={}}return t.prototype._innerAdd=function(t,e){for(var n=[0,e-1];n[1]-n[0]>1;){var r=Math.floor((n[0]+n[1])/2);if(this.arr[r].value>t.value)n[1]=r;else{if(!(this.arr[r].value=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},t.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},t.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},t}(),my={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,n,r,i){return ey(py(t,e,n,r,i.offset))}},vy=(Math.PI,function(t,e){var n=Math.round(Math.abs(t/e));return n<0?0:(t<0?-1:1)*n}),yy=function(t,e){var n=e.x-t.x,r=e.y-t.y;return n||r?Math.atan2(r,n):0},by=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},xy=function(t,e,n){for(var r=1/0,i=0,o=e.length;iu.minX&&e.xu.minY&&e.y0&&C>0;){var O=y.minId((C+1)%30==0);if(!O)break;if(w=d[O],N["".concat(w.x,"|||").concat(w.y)])return Sy(w,g,c,e,t,l,s);delete d[w.id],y.remove(w.id),p[w.id]=!0;for(b=0;bo.maxAllowedDirectionChange||u[P])){d[P]||(d[P]=S);var I=a[A];E=o.distFunc(w,S)+(isNaN(I)?s:I),T=m[w.id]+E;var L=m[P];L&&T>=L||(g[P]=w,m[P]=T,v[P]=T+xy(S,f,o.distFunc),y.add({id:P,value:v[P]}))}}C-=1}return o.fallbackRoute(t,e,n,r,o)};oc("polyline",{options:{color:uc.defaultEdge.color,size:uc.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:uc.defaultEdge.style.stroke,lineAppendWidth:uc.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:uc.edgeLabel.style.fill,fontSize:uc.edgeLabel.style.fontSize,fontFamily:uc.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:Gv({},uc.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);0===n.radius&&delete n.radius;var r=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return e.shapeMap["edge-shape"]=r,r},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=(0,M.mix)({},e,n,t.style);t=this.getPathPoints(t),this.radius=r.radius,this.offset=r.offset;var i=t.startPoint,o=t.endPoint,a=this.getControlPoints(t),s=[i];a&&(s=s.concat(a)),s.push(o);var u=t.sourceNode,c=t.targetNode,l=r.radius,h=this.options.routeCfg,f=(0,M.mix)({},h,t.routeCfg);f.offset=r.offset;var d=this.getPath(s,u,c,l,f,!Boolean(a));return((0,M.isArray)(d)&&d.length<=1||(0,M.isString)(d)&&-1===d.indexOf("L"))&&(d="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&(d="M0 0, L0 0"),(0,M.mix)({},uc.defaultEdge.style,r,{lineWidth:t.size,path:d})},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var r={stroke:t.color},i=n.shapeMap["edge-shape"]||n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),c=[a];u&&(c=c.concat(u)),c.push(s);var l=i.attr(),h=(0,M.mix)({},r,l,t.style),f=t.sourceNode,d=t.targetNode,p=h.radius,g=this.options.routeCfg,m=(0,M.mix)({},g,t.routeCfg);m.offset=h.offset;var v=this.getPath(c,f,d,p,m,!Boolean(u));((0,M.isArray)(v)&&v.length<=1||(0,M.isString)(v)&&-1===v.indexOf("L"))&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(v="M0 0, L0 0"),l.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),l.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""});var y=(0,M.mix)(r,i.attr(),{lineWidth:o,path:v},t.style);i&&i.attr(y)}},getPath:function(t,e,n,r,i,o){var a=i.offset,s=i.obstacles,u=i.simple;if(!a||t.length>2||!1===o){if(r)return dy(t,r);var c=[];return(0,M.each)(t,(function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["L",t.x,t.y])})),c}!1===u||(null==s?void 0:s.length)||(u=!0);var l=u?py(t[t.length-1],t[0],n,e,a):Ey(t[0],t[t.length-1],e,n,i);return l&&l.length?r?dy(l,r):(l=function(t){if(!(null==t?void 0:t.length))return t;for(var e=t[t.length-1],n={x:e.x,y:e.y},r=[e],i=[e],o=t.length-2;o>=0;o--){var a,s=t[o];s.x===n.x?r.push(s):(r=[s],n.x=s.x),s.y===n.y?i.push(s):(i=[s],n.y=s.y),r.length>2?(a=t.indexOf(r[1]))>-1&&t.splice(a,1):i.length>2&&(a=t.indexOf(i[1]))>-1&&t.splice(a,1)}return t}(l),Ju.pointsToPolygon(l)):"M0 0, L0 0"}},"single-edge");var My=od.cloneEvent,Ty=od.isNaN,Ay=Math.abs,Cy=["shift","ctrl","alt","control"],ky={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,r=+t.clientY;if(!Ty(n)&&!Ty(r)){var i=n-e.x,o=r-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:n,y:r};var a=this.graph.get("width"),s=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),c=this.scalableRange,l=this.scalableRange;c<1&&c>-1&&(c*=a,l*=s),(u.minX<=a+c&&u.minX+i>a+c||u.maxX+c>=0&&u.maxX+c+i<0)&&(i=0),(u.minY<=s+l&&u.minY+o>s+l||u.maxY+l>=0&&u.maxY+l+o<0)&&(o=0),this.graph.translate(i,o)}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];n&&r||(t.preventDefault(),this.mousedown=!0,this.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this,n=t.originalEvent;if((!n||"touchstart"===t.name||0===n.button)&&("touchstart"===t.name||"undefined"==typeof window||!window.event||window.event.buttons||window.event.button)&&this.shouldBegin(t,this)&&!e.keydown&&this.allowDrag(t)){if(e.origin={x:t.clientX,y:t.clientY},e.dragging=!1,this.enableOptimize){for(var r=this.graph,i=r.getEdges(),o=0,a=i.length;os)for(var f=r.getNodes(),d=0,p=f.length;d-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,n,r=t.target,i=r&&r.isCanvas&&r.isCanvas();if((0,M.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!i)return!1;if((0,M.isObject)(this.allowDragOnItem)){var o=this.allowDragOnItem,a=o.node,s=o.edge,u=o.combo,c=null===(n=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===n?void 0:n.call(e);if(!a&&"node"===c)return!1;if(!s&&"edge"===c)return!1;if(!u&&"combo"===c)return!1}return!0}},Ny={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onTouchStart:function(t){if(t.item){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,this.onDragStart(t)}},onTouchMove:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return void this.onDragEnd(t);t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},"undefined"==typeof window||this.windowEventBinded||(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,n;"node"===(null===(n=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===n?void 0:n.call(e))?this.mousedown&&(this.dragstart?this.onDrag(w(w({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t))):this.onDragEnd()},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,this.shouldBegin(w(w({},t),this.mousedown),this)){var n=this.mousedown,r=n.item,i=n.target;if(r&&!r.destroyed&&!r.hasLocked()){if(r.getContainer().set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(r),i)if(i.get("isAnchorPoint"))return;var o=this.graph;this.targets=[],this.targetCombo=null;var a=o.findAllByState("node",this.selectedState),s=r.get("id"),u=a.filter((function(t){var e=t.get("id");return s===e}));if(0===u.length?this.targets.push(r):a.length>1?a.forEach((function(t){t.hasLocked()||e.targets.push(t)})):this.targets.push(r),this.graph.get("enabledStack")&&this.enableStack){var c=[];this.targets.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y,i=e.id;c.push({x:n,y:r,id:i})})),this.set("beforeDragNodes",c)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach((function(t){t.getEdges().forEach((function(t){t.isVisible()&&(e.hidenEdge[t.getID()]=!0,t.hide())}))})),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(this.mousedown&&this.origin&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var n={};this.targets.map((function(r){e.update(r,t);var i=r.getModel().comboId;i&&(n[i]=e.graph.findById(i))})),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e,n=this;if(this.mousedown=!1,this.dragstart=!1,"undefined"!=typeof window&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),this.origin){null===(e=this.cachedCaptureItems)||void 0===e||e.forEach((function(t){t.getContainer().set("capture",!0)})),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach((function(t){t.getEdges().forEach((function(t){n.hidenEdge[t.getID()]&&t.show(),t.refresh()}))})),this.hidenEdge={};var r=this.graph;if(r.get("enabledStack")&&this.enableStack){var i={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach((function(t){i.before.nodes.push(t)})),this.targets.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y,o=e.id;i.after.nodes.push({x:n,y:r,id:o})})),r.pushStack("update",(0,M.clone)(i))}r.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&this.validationCombo(e)){var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var r=e.getModel();this.targets.map((function(t){t.getModel().comboId!==r.id&&n.updateComboTree(t,r.id)})),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),this.targets&&0!==this.targets.length&&this.currentShouldEnd&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map((function(t){t.getModel().comboId&&e.updateComboTree(t)})))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=this,n=t.item,r=e.graph,i=n.getModel().comboId,o=i?r.findById(i):void 0;if(this.currentShouldEnd=this.shouldEnd(t,o,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(i){var a=r.findById(i);e.comboActiveState&&r.setItemState(a,e.comboActiveState,!1),this.targets.map((function(t){var e=t.getModel();i!==e.comboId&&r.updateComboTree(t,i)})),r.updateCombo(a)}else this.targets.map((function(t){t.getModel().comboId&&r.updateComboTree(t)}));r.emit("dragnodeend",{items:this.targets,targetItem:n})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var n=this;this.targets&&0!==this.targets.length&&(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map((function(e){return n.update(e,t)})):this.targets.map((function(r){return n.update(r,t,e)})))},update:function(t,e,n){var r=this.origin,i=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:i.x||0,y:i.y||0});var a=e.x-r.x+this.point[o].x,s=e.y-r.y+this.point[o].y;n&&(a+=r.x-e.x,s+=r.y-e.y);var u={x:a,y:s};this.get("updateEdge")?this.graph.updateItem(t,u,!1):t.updatePosition(u)},debounceUpdate:(0,M.debounce)((function(t){var e=t.targets,n=t.graph,r=t.point,i=t.origin,o=t.evt,a=t.updateEdge,s=t.onlyChangeComboSize,u=t.updateParentCombos;e.map((function(t){var e=t.get("model"),s=t.get("id");r[s]||(r[s]={x:e.x||0,y:e.y||0});var u={x:o.x-i.x+r[s].x,y:o.y-i.y+r[s].y};a?n.updateItem(t,u,!1):t.updatePosition(u)})),s&&u(n,e)}),50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var n=t.x-this.origin.x+this.originPoint.minX,r=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:n,y:r})}else{var i=e.get("group"),o=(0,M.deepMix)({},Bf.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),s=a.x,u=a.y,c=a.width,l=a.height,h=a.minX,f=a.minY;this.originPoint={x:s,y:u,width:c,height:l,minX:h,minY:f},this.delegateRect=i.addShape("rect",{attrs:w({width:c,height:l,x:s,y:u},o),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;0===e.length&&e.push(t.item);for(var n=1/0,r=-1/0,i=1/0,o=-1/0,a=0;ar&&(r=l),h>o&&(o=h)}return{x:Math.floor(n),y:Math.floor(i),width:Math.ceil(r)-Math.floor(n),height:Math.ceil(o)-Math.floor(i),minX:n,minY:i}},updateParentCombos:function(t,e){var n=t||this.graph,r=e||this.targets,i={};null==r||r.forEach((function(t){var e=t.getModel().comboId;e&&(i[e]=n.findById(e))})),Object.values(i).forEach((function(t){t&&n.updateCombo(t)}))}},Oy=null,Py={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return"mouseenter"===this.get("trigger")?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.setAllItemStates(t)},clearOnTouchStart:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this;this.shouldClearStatusOnSecond&&(Oy=null),this.timer=setTimeout((function(){e.throttleClearActiveState(t,e)}),50)},throttleSetAllItemStates:(0,M.throttle)((function(t,e){var n=t.item,r=e.graph;if(r&&!r.destroyed&&(e.item=n,e.shouldUpdate(t.item,{event:t,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,o=n.getModel().id;if(Oy===o&&i)return e.throttleClearActiveState(t,e),void(Oy=null);for(var a=e.activeState,s=e.inactiveState,u=r.getNodes(),c=r.getCombos(),l=r.getEdges(),h=r.get("vedges"),f=u.length,d=c.length,p=l.length,g=h.length,m=e.inactiveItems||{},v=e.activeItems||{},y=0;y-1||(this.trigger=Ry,console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,n=this.brush,r=this.selectOnCombo,i="combo"===(null==e?void 0:e.getType());i&&!r||!i&&e||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&this.updateBrush(t)},onMouseUp:function(t){this.graph;(this.brush||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this.graph,e=this.selectedState,n=t.findAllByState("node",e),r=t.findAllByState("edge",e),i=t.findAllByState("combo",e);n.forEach((function(n){return t.setItemState(n,e,!1)})),r.forEach((function(n){return t.setItemState(n,e,!1)})),i.forEach((function(n){return t.setItemState(n,e,!1)})),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,n,r,i){var o=t.getBBox();return o.centerX>=e&&o.centerX<=n&&o.centerY>=r&&o.centerY<=i},getSelectedNodes:function(t){var e=this,n=this,r=n.graph,i=n.originPoint,o=n.shouldUpdate,a=n.isBBoxCenterInRect,s=this.selectedState,u={x:t.x,y:t.y},c=r.getPointByCanvas(i.x,i.y),l=Iy(u.x,c.x),h=Ly(u.x,c.x),f=Iy(u.y,c.y),d=Ly(u.y,c.y),p=[],g=[];r.getNodes().forEach((function(t){if(t.isVisible()&&a(t,l,h,f,d)&&o(t,"select",e)){p.push(t);var n=t.getModel();g.push(n.id),r.setItemState(t,s,!0)}}));var m=[];this.includeEdges&&p.forEach((function(t){t.getOutEdges().forEach((function(t){if(t.isVisible()){var n=t.getModel(),i=n.source,a=n.target;g.includes(i)&&g.includes(a)&&o(t,"select",e)&&(m.push(t),r.setItemState(t,e.selectedState,!0))}}))}));var v=[];this.includeCombos&&r.getCombos().forEach((function(t){if(t.isVisible()&&a(t,l,h,f,d)&&o(t,"select",e)){v.push(t);var n=t.getModel();g.push(n.id),r.setItemState(t,s,!0)}})),this.selectedEdges=m,this.selectedNodes=p,this.selectedCombos=v,this.onSelect&&this.onSelect(p,m,v),r.emit("nodeselectchange",{selectedItems:{nodes:p,edges:m,combos:v},select:!0})},createBrush:function(){var t=this.graph.get("canvas").addShape("rect",{attrs:this.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:Dy(t.canvasX-e.x),height:Dy(t.canvasY-e.y),x:Iy(t.canvasX,e.x),y:Iy(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.keydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},By="shift",jy=["shift","ctrl","alt","control"],Uy={getDefaultCfg:function(){return{multiple:!0,trigger:By,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return jy.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=By,console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),t.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(n&&!n.destroyed){var r=n.getType(),i=e.graph,o=e.keydown,a=e.multiple,s=e.shouldUpdate;if((0,e.shouldBegin)(t,e)){if(!o||!a){var u=i.findAllByState("node",e.selectedState).concat(i.findAllByState("edge",e.selectedState)).concat(i.findAllByState("combo",e.selectedState));(0,M.each)(u,(function(t){t!==n&&i.setItemState(t,e.selectedState,!1)}))}if(function(){switch(r){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}())if(n.hasState(e.selectedState)){s(t,e)&&i.setItemState(n,e.selectedState,!1);c=i.findAllByState("node",e.selectedState),l=i.findAllByState("edge",e.selectedState),h=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,edges:l,combos:h},select:!1})}else{s(t,e)&&i.setItemState(n,e.selectedState,!0);c=i.findAllByState("node",e.selectedState),l=i.findAllByState("edge",e.selectedState),h=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,edges:l,combos:h},select:!0})}else{var c=i.findAllByState("node",e.selectedState),l=i.findAllByState("edge",e.selectedState),h=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{selectedItems:{nodes:c,edges:l,combos:h},select:!1})}}}},onCanvasClick:function(t){var e=this,n=this.graph;if((0,this.shouldBegin)(t,this)){var r=n.findAllByState("node",this.selectedState);(0,M.each)(r,(function(t){n.setItemState(t,e.selectedState,!1)}));var i=n.findAllByState("edge",this.selectedState);(0,M.each)(i,(function(t){n.setItemState(t,e.selectedState,!1)}));var o=n.findAllByState("combo",this.selectedState);(0,M.each)(o,(function(t){n.setItemState(t,e.selectedState,!1)})),n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()||"control"===e.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1}},Vy=H,Hy=.05,Gy={getDefaultCfg:function(){return this.isFireFox="firefox"===id(),{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];t.preventDefault(),r&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,r&&(this.endPoint={pageX:r.pageX,pageY:r.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,n=e[0],r=e[1];if(r){this.endPoint||(this.endPoint={pageX:r.pageX,pageY:r.pageY});var i=function(t,e){return Math.hypot(e.x-t.x,e.y-t.y)},o=i({x:n.pageX,y:n.pageY},{x:r.pageX,y:r.pageY})/i({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),a=this.originScale*o;this.currentScale=a;var s=this.get("minZoom")||this.graph.get("minZoom");if(!(a>(this.get("maxZoom")||this.graph.get("maxZoom"))||a0||t.wheelDelta<0?1-Hy*o:1/(1-Hy*o):t.wheelDelta<0?1-Hy*o:1/(1-Hy*o));var u=this.get("minZoom")||n.get("minZoom"),c=this.get("maxZoom")||n.get("maxZoom");if(s>c?s=c:sr/2?c-=h.width:c+=this.offset,l>i/2?l-=h.height:l+=this.offset;var f="".concat(c,"px"),d="".concat(l,"px");Fd(this.container,{left:f,top:d,visibility:"visible"})}else Fd(o,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var n=Uh('
    '));return e.parentNode.appendChild(n),Fd(n,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}},Wy=w({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Zy),Yy=w({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Zy),qy="click",Xy=["click","dblclick"],Ky={getDefaultCfg:function(){return{trigger:qy,onChange:function(){}}},getEvents:function(){var t,e;return Xy.includes(this.trigger)?e=this.trigger:(e=qy,console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if("click"===this.trigger){if(this.timer)return clearTimeout(this.timer),void(this.timer=0);this.timer=setTimeout((function(){e.toggle(t),clearTimeout(e.timer),e.timer=0}),200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var n=this.graph.findDataById(e.get("id"));if(n){var r=n.children;if(r&&0!==r.length){var i=!n.collapsed;this.shouldBegin(t,i,this)&&(n.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i,this)&&(this.onChange(e,i,this),this.graph.layout()))}}}}},$y=od.calculationItemsBBox,Qy=function t(e,n){if(!1!==n(e)&&e){var r=e.get("combos");if(0===r.length)return!1;(0,M.each)(r,(function(e){t(e,n)}))}},Jy={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate(t,this)&&"combo"===e.getType())},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,n=this.graph,r=t.item;if(this.currentShouldEnd=!0,this.validationCombo(t)){this.targets=[];var i=n.findAllByState("combo",this.selectedState),o=r.get("id"),a=i.filter((function(t){var e=t.get("id");return o===e}));0===a.length?this.targets.push(r):this.targets=i;var s=[];this.targets.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y,i=e.id;s.push({x:n,y:r,id:i})})),this.set("beforeDragItems",s),this.activeState&&this.targets.map((function(t){var r=t.getModel();if(r.parentId){var i=n.findById(r.parentId);i&&n.setItemState(i,e.activeState,!0)}})),this.point={},this.originPoint={},this.currentItemChildCombos=[],Qy(r,(function(t){if(t.destroyed)return!1;var n=t.getModel();return e.currentItemChildCombos.push(n.id),!0}))}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var n=this.graph,r=t.item,i=r.getModel(),o=n.getCombos(),a=r.getBBox(),s=a.centerX,u=a.centerY,c=a.width,l=o.filter((function(t){var n=t.getModel();return i.parentId,n.id!==i.id&&!e.currentItemChildCombos.includes(n.id)}));l.map((function(t){var r=t.getBBox(),i=r.centerX,o=r.centerY,a=r.width,l=s-i,h=u-o,f=2*Math.sqrt(l*l+h*h);c+a-f>.8*c?n.setItemState(t,e.activeState,!0):n.setItemState(t,e.activeState,!1)}))}(0,M.each)(this.targets,(function(n){e.updateCombo(n,t)})),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var n=this;(this.enableDelegate||e)&&(0,M.each)(this.targets,(function(r){n.updateCombo(r,t,e)}))},onDrop:function(t){var e=this,n=t.item;if(this.currentShouldEnd=this.shouldEnd(t,n,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&n&&this.targets&&!n.destroyed){var r=this.graph,i=n.getModel();this.targets.map((function(t){t.getModel().parentId!==i.id?(e.activeState&&r.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t,i.id,!1)):r.updateCombo(n)})),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){var n=this.graph,r=t.item.getModel().comboId,i=r?n.findById(r):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){var o;if(r){if(this.activeState){var a=n.findById(r);n.setItemState(a,this.activeState,!1)}this.targets.map((function(t){e.onlyChangeComboSize?n.updateCombo(t):r!==t.getID()&&(o=n.findById(r),r!==t.getModel().parentId&&n.updateComboTree(t,r,!1))}))}else this.targets.map((function(t){e.onlyChangeComboSize?n.updateCombo(t):t.getModel().comboId&&n.updateComboTree(t,void 0,!1)}));this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),r=this.graph;n&&this.activeState&&r.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var r=this.graph;if(this.delegateShape)r.get("delegateGroup").clear(),this.delegateShape=null;if(t&&this.activeState&&r.setItemState(t,this.activeState,!1),!t){var i=r.get("enabledStack")&&this.enableStack,o={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map((function(t){if(n.onlyChangeComboSize){r.updateCombo(t);var e=t.getModel(),a=e.x,s=e.y,u=e.id;o.after.combos.push({x:a,y:s,id:u}),r.pushStack("update",o)}else r.updateComboTree(t,void 0,i)}))}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,n){var r=this;if(void 0===n&&(n={}),!1!==e(t,n)&&t){var i=t.get("combos");(0,M.each)(i,(function(t){r.traverse(t,e,n)}));var o=t.get("nodes");(0,M.each)(o,(function(t){r.traverse(t,e,n)}))}},updateCombo:function(t,e,n){this.updateSingleItem(t,e,n);var r={};this.traverse(t,(function(t,e){return!t.destroyed&&(t.getEdges().forEach((function(t){return e[t.getID()]=t})),!0)}),r),Object.values(r).forEach((function(t){return t.refresh()}))},updateSingleItem:function(t,e,n){var r=this.origin,i=this.graph,o=t.getModel(),a=t.get("id");this.point[a]||(this.point[a]={x:o.x,y:o.y});var s=e.x-r.x+this.point[a].x,u=e.y-r.y+this.point[a].y;n&&(s+=r.x-e.x,u+=r.y-e.y),i.updateItem(t,{x:s,y:u},!1)},getParentCombo:function(t){var e=this.graph;if(t){var n=e.findById(t);if(n)return n}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var n=t.x-this.origin.x+this.originPoint.minX,r=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:n,y:r})}else{var i=e.get("delegateGroup"),o=null,a=(o=this.targets.length>1?$y(this.targets):this.targets[0].getBBox()).x,s=o.y,u=o.width,c=o.height,l=o.minX,h=o.minY;this.originPoint={x:a,y:s,width:u,height:c,minX:l,minY:h};var f=w(w({},Bf.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:w({width:o.width,height:o.height,x:o.x,y:o.y},f),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this.graph,e=this.targets,n={};null==e||e.forEach((function(e){var r=e.getModel().parentId;r&&(n[r]=t.findById(r))})),Object.values(n).forEach((function(e){e&&t.updateCombo(e)}))}},tb="dblclick",eb=["click","dblclick"],nb={getDefaultCfg:function(){return{trigger:tb,relayout:!0}},getEvents:function(){var t,e;return eb.includes(this.trigger)?e=this.trigger:(e=tb,console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this.graph,r=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(n.collapseExpandCombo(i),r&&n.get("layout")?n.layout():n.refreshPositions())}}},rb=od.isPolygonsIntersect,ib=od.pathToPoints,ob="shift",ab=["drag","shift","ctrl","alt","control"],sb={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:ob,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return ab.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=ob,console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso;t.item||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){(this.lasso||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach((function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){void 0===t&&(t="canvas:click");var e=this,n=e.graph,r=e.selectedState,i=e.shouldDeselect,o=n.findAllByState("node",r),a=n.findAllByState("edge",r);i&&!i({action:t,nodes:o,edges:a})||(o.forEach((function(t){return n.setItemState(t,r,!1)})),a.forEach((function(t){return n.setItemState(t,r,!1)}))),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this.graph,n=this.shouldUpdate,r=this.points.map((function(t){return[e.getCanvasByPoint(t.x,t.y).x,e.getCanvasByPoint(t.x,t.y).y]})),i=this.selectedState,o=[],a=[];e.getNodes().forEach((function(s){if(s.isVisible()&&function(t,e){var n,r=t.getKeyShape();if("path"===t.get("type"))n=ib(r.attr("path"));else{var i=r.getCanvasBBox();n=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return rb(e,n)}(s,r)&&n(s,"select",t)){o.push(s);var u=s.getModel();a.push(u.id),e.setItemState(s,i,!0)}}));var s=[];this.includeEdges&&o.forEach((function(r){r.getOutEdges().forEach((function(r){if(r.isVisible()){var i=r.getModel(),o=i.source,u=i.target;a.includes(o)&&a.includes(u)&&n(r,"select",t)&&(s.push(r),e.setItemState(r,t.selectedState,!0))}}))})),this.selectedEdges=s,this.selectedNodes=o,this.onSelect&&this.onSelect(o,s),e.emit("nodeselectchange",{selectedItems:{nodes:o,edges:s},select:!0})},createLasso:function(){var t=this.graph.get("delegateGroup").addShape("path",{attrs:w({path:[]},this.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(t){this.lasso.attr({path:this.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},ub="click",cb=["click","drag"],lb=void 0,hb=["shift","ctrl","control","alt","meta",void 0],fb={getDefaultCfg:function(){return{trigger:ub,key:lb,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t,e=this;return cb.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=ub,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),e.key&&-1===hb.indexOf(e.key.toLowerCase())&&(e.trigger=lb,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===e.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===e.trigger&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),e.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){var e=this;if(!e.key||e.keydown){var n=t.item;n&&n.getID()!==e.source&&"node"===n.getType()||e.cancelCreating({item:e.edge,x:t.x,y:t.y})}},onClick:function(t){var e=this;if(!e.key||e.keydown){var n=t.item,r=e.graph,i=n.getModel(),o=e.getEdgeConfig;if(e.addingEdge&&e.edge){if(!e.shouldEnd(t,e))return;var a=void 0;a=o&&(0,M.isFunction)(o)?o({source:e.source,target:i.id},e):e.edgeConfig;var s=w({target:i.id},a);if(e.source===i.id&&(s.type="loop"),r.emit("beforecreateedge",{}),r.updateItem(e.edge,s,!1),r.get("enabledStack")){var u=w(w({},e.edge.getModel()),{itemType:"edge"}),c={};c.edges=[u],r.pushStack("add",{before:{},after:c})}r.emit("aftercreateedge",{edge:e.edge}),e.edge.getKeyShape().set("capture",!0),e.edge=null,e.addingEdge=!1}else{if(!e.shouldBegin(t,e))return;a=void 0;a=o&&(0,M.isFunction)(o)?o({source:i.id,target:i.id},e):e.edgeConfig,e.edge=r.addItem("edge",w({source:i.id,target:i.id},a),!1),e.source=i.id,e.addingEdge=!0,e.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){var e=this;if(!e.key||e.keydown){e.edge&&e.edge.destroyed&&e.cancelCreating({item:e.edge});var n={x:t.x,y:t.y};e.graph.findById(e.source)?e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:n},!1):e.addingEdge=!1}},cancelCreating:function(t){var e,n,r=this;if(!r.key||r.keydown){var i=r.graph,o=t.item;return r.addingEdge&&(r.edge===o||(null===(n=null===(e=t.target)||void 0===e?void 0:e.isCanvas)||void 0===n?void 0:n.call(e)))?(r.edge&&!r.edge.destroyed&&i.removeItem(r.edge,!1),r.edge=null,void(r.addingEdge=!1)):void 0}},onKeyDown:function(t){var e=this,n=t.key;n&&(n.toLowerCase()===e.key.toLowerCase()?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.addingEdge&&t.edge&&(t.graph.removeItem(t.edge,!1),t.addingEdge=!1,t.edge=null),this.keydown=!1}},db="ctrl",pb=["shift","ctrl","alt","control"],gb={getDefaultCfg:function(){return{trigger:db,combinedKey:"1",functionName:"fitView",functionParams:[]}},getEvents:function(){return pb.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=db,console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(this.trigger,"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.triggerKeydown||(this.triggerKeydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n);var i=this.graph;if(!i[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(!this.triggerKeydown||this.combinedKey){var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(r===o||"control"===r&&"ctrl"===o||"ctrl"===r&&"control"===o)&&(this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]())}else this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]()}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}},mb=["shift","ctrl","alt","control","meta"],vb={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return this.zoomKey&&-1!==mb.indexOf(this.zoomKey)||(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var n=this.graph,r=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];if(r.includes("control")&&r.push("ctrl"),r.some((function(e){return t["".concat(e,"Key")]}))){var i=n.get("canvas").getPointByClient(t.clientX,t.clientY),o=n.getZoom();t.wheelDelta>0?o+=.05*o:o-=.05*o,n.zoomTo(o,{x:i.x,y:i.y})}else{var a=t.deltaX||t.movementX,s=t.deltaY||t.movementY;!s&&navigator.userAgent.indexOf("Firefox")>-1&&(s=125*-t.wheelDelta/3);var u=this.graph.get("width"),c=this.graph.get("height"),l=this.graph.get("canvas").getCanvasBBox(),h=this.scalableRange,f=this.scalableRange;h<1&&h>-1&&(h*=u,f*=c);var d=l.minX,p=l.maxX,g=l.minY,m=l.maxY;a>0?p<-h?a=0:p-a<-h&&(a=p+h):a<0&&(d>u+h?a=0:d-a>u+h&&(a=d-(u+h))),s>0?m<-f?s=0:m-s<-f&&(s=m+f):s<0&&(g>c+f?s=0:g-s>c+f&&(s=g-(c+f))),"x"===this.get("direction")?s=0:"y"===this.get("direction")&&(a=0),n.translate(-a,-s)}if(t.preventDefault(),this.get("enableOptimize")){var v=this.get("optimizeZoom"),y=this.get("optimized"),b=n.getNodes(),x=n.getEdges(),w=b.length,_=x.length;if(!y){for(var S=0;S0?t.set(e,n):t.delete(e))}function l(t,e,n,r){var i=String(e),o=String(n);if(!t&&i>o){var s=i;i=o,o=s}return i+a.EDGE_KEY_DELIM+o+a.EDGE_KEY_DELIM+(void 0===r?a.DEFAULT_EDGE_NAME:r)}function h(t,e,n,r){var i=String(e),o=String(n),a={v:e,w:n};if(!t&&i>o){var s=a.v;a.v=a.w,a.w=s}return void 0!==r&&(a.name=r),a}function f(t,e){return l(t,e.v,e.w,e.name)}function d(t){return"function"==typeof t}n.r(s),n.d(s,{getGraphComplement:function(){return At}}),function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}(a||(a={}));var p=function(t){return t.nodes().map((function(e){var n={id:e,value:t.node(e),parent:t.parent(e)};return void 0===n.value&&delete n.value,void 0===n.parent&&delete n.parent,n}))},g=function(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w,value:n,name:e.name};return void 0===r.name&&delete r.name,void 0===r.value&&delete r.value,r}))},m=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:p(t),edges:g(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function v(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 y(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};x(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=a.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return d(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.inEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.sinks=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.outEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.setNodes=function(t,n){return t.map((function(t){return e.setNode(t,n)})),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var n,r=null===(n=e.parentMap)||void 0===n?void 0:n.get(t);if(r!==e.GRAPH_NODE)return r}},this.removeFromParentsChildList=function(t){var n=e.parentMap.get(t);e.childrenMap.get(n).delete(t)},this.setParent=function(t,n){var r,i;e.checkCompound();for(var o=void 0===n?e.GRAPH_NODE:n,a=e.parent(o);a;){if(t===a)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");a=e.parent(a)}n&&e.setNode(n),e.setNode(t),e.removeFromParentsChildList(t),null===(r=e.parentMap)||void 0===r||r.set(t,o);var s=e.childrenMap.get(o);return s.set(t,!0),null===(i=e.childrenMap)||void 0===i||i.set(o,s),e},this.children=function(t){var n=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var r,i=null===(r=e.childrenMap)||void 0===r?void 0:r.get(n);return i?Array.from(i.keys()):void 0}return n===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var n=e.predecessorsMap.get(t);return n?Array.from(n.keys()):void 0},this.successors=function(t){var n=e.successorsMap.get(t);return n?Array.from(n.keys()):void 0},this.neighbors=function(t){var n;if(e.hasNode(t))return Array.from(new Set(null===(n=e.predecessors(t))||void 0===n?void 0:n.concat(e.successors(t))))},this.isLeaf=function(t){var n,r;return e.isDirected()?!(null===(r=e.successors(t))||void 0===r?void 0:r.length):!(null===(n=e.neighbors(t))||void 0===n?void 0:n.length)},this.filterNodes=function(n){var r=e.directed,i=e.multigraph,o=e.compound,a=new t({directed:r,multigraph:i,compound:o});if(a.setGraph(e.graph()),e.nodes().forEach((function(t){n(t)&&a.setNode(t,e.node(t))})),e.edges().forEach((function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))})),o){a.nodes().forEach((function(t){a.setParent(t,function(t){for(var n=e.parent(t);void 0!==n&&!a.hasNode(n);)n=e.parent(n);return n}(t))}))}return a},this.setDefaultEdgeLabel=function(t){return d(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,n){return e.setEdge(t.v,t.w,n,t.name)},this.setPath=function(t,n){return t.reduce((function(t,r){return e.setEdge(t,r,n),r})),e},this.edgeFromArgs=function(t,n,r){return e.edge({v:t,w:n,name:r})},this.edge=function(t){return e.edgesLabelsMap.get(f(e.isDirected(),t))},this.hasEdge=function(t,n,r){return e.edgesLabelsMap.has(f(e.isDirected(),{v:t,w:n,name:r}))},this.removeEdgeObj=function(t){var n=t.v,r=t.w,i=t.name;return e.removeEdge(n,r,i)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,n){var r=e.inEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.v===n}))},this.outEdges=function(t,n){var r=e.outEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.w===n}))},this.nodeEdges=function(t,n){var r;if(e.hasNode(t))return null===(r=e.inEdges(t,n))||void 0===r?void 0:r.concat(e.outEdges(t,n))},this.toJSON=function(){return m(e)},this.nodeInDegree=function(t){var n=e.inEdgesMap.get(t);return n?n.size:0},this.nodeOutDegree=function(t){var n=e.outEdgesMap.get(t);return n?n.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var r=y(y({},_),n);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,n,r;return e=t,(n=[{key:"setNode",value:function(t,e){var n,r=this.nodesLabelMap,i=this.defaultNodeLabelFn,o=this.isCompound,a=this.parentMap,s=this.childrenMap,u=this.inEdgesMap,c=this.outEdgesMap,l=this.predecessorsMap,h=this.successorsMap;return r.has(t)?(void 0!==e&&r.set(t,e),this):(r.set(t,e||i(t)),o()&&(null==a||a.set(t,this.GRAPH_NODE),null==s||s.set(t,new Map),(null==s?void 0:s.has(this.GRAPH_NODE))||null==s||s.set(this.GRAPH_NODE,new Map),null==s||null===(n=s.get(this.GRAPH_NODE))||void 0===n||n.set(t,!0)),[u,c,l,h].forEach((function(e){return e.set(t,new Map)})),this.nodeCountNum+=1,this)}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var n,r,i,o=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,s=this.outEdgesMap,u=this.predecessorsMap,c=this.successorsMap,l=this.nodesLabelMap;this.isCompound()&&(this.removeFromParentsChildList(t),null===(n=this.parentMap)||void 0===n||n.delete(t),null===(r=this.children(t))||void 0===r||r.forEach((function(t){return e.setParent(t)})),null===(i=this.childrenMap)||void 0===i||i.delete(t));var h=a.get(t),f=s.get(t);Array.from(h.values()).forEach((function(t){return o(t)})),Array.from(f.values()).forEach((function(t){return o(t)})),l.delete(t),a.delete(t),s.delete(t),u.delete(t),c.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,n,r){var i,o,a=h(this.isDirected(),t,e,r),s=f(this.isDirected(),a),c=a.v,l=a.w;if(this.edgesLabelsMap.has(s))return this.edgesLabelsMap.set(s,n),this;if(void 0!==r&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(l),this.edgesLabelsMap.set(s,n||this.defaultEdgeLabelFn(c,l,r)),Object.freeze(a),this.edgesMap.set(s,a);var d=this.predecessorsMap.get(l),p=this.successorsMap.get(c);return u(d,c),u(p,l),null===(i=this.inEdgesMap.get(l))||void 0===i||i.set(s,a),null===(o=this.outEdgesMap.get(c))||void 0===o||o.set(s,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,n){var r=l(this.isDirected(),t,e,n);if(this.edgesMap.get(r)){var i=h(this.isDirected(),t,e,n),o=i.v,a=i.w;this.edgesLabelsMap.delete(r),this.edgesMap.delete(r);var s=this.predecessorsMap.get(a),u=this.successorsMap.get(o);c(s,o),c(u,a),this.inEdgesMap.get(a).delete(r),this.outEdgesMap.get(o).delete(r),this.edgeCountNum-=1}return this}}])&&w(e.prototype,n),r&&w(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function E(t){return E="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},E(t)}function M(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;n-1&&this.eventPool[t].splice(n,1)}}},{key:"emitEvent",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r>1])||void 0===a?void 0:a.priority)e.arr[r].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[r].priority," New: ").concat(n));e.arr[r].priority=n,e.innerDecrease(r)}})),z=function(t,e){var n,r=new S,i=new Map,o=new R;function a(t){var r=t.v===n?t.w:t.v,a=o.priority(r);if(void 0!==a){var s=e(t);s0;){var u;if(n=o.removeMin(),i.has(n))r.setEdge(n,i.get(n));else{if(s)throw new Error("Input graph is not connected: "+t.graph());s=!0}null===(u=t.nodeEdges(n))||void 0===u||u.forEach(a)}return r},F=function(t){var e=new Set,n=[];return t.nodes().forEach((function(r){for(var i=[],o=[r];o.length>0;){var a,s,u=o.pop();if(!e.has(u))e.add(u),i.push(u),null===(a=t.successors(u))||void 0===a||a.forEach((function(t){return o.push(t)})),null===(s=t.predecessors(u))||void 0===s||s.forEach((function(t){return o.push(t)}))}i.length&&n.push(i)})),n},B=function t(e,n,r,i,o,a){i.includes(n)||(i.push(n),r||a.push(n),o(n).forEach((function(n){return t(e,n,r,i,o,a)})),r&&a.push(n))},j=function(t,e,n){var r=Array.isArray(e)?e:[e],i=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},o=[],a=[];return r.forEach((function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);B(t,e,"post"===n,a,i,o)})),o};function U(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)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return V(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V(t,e)}(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 V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(i=s.removeMin(),!(o=a.get(i))||o.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(u);var c={};return Array.from(a.entries()).forEach((function(t){var e=U(t,2),n=e[0],r=e[1];return c[String(n)]=r,c})),c},Z=function(t,e,n,r){return G(t,e,n||H,r||function(e){return t.outEdges(e)})},W=function(t,e,n){var r={};return t.nodes().forEach((function(i){return r[String(i)]=Z(t,i,e,n),r})),r},Y=function(t){var e=0,n=[],r=new Map,i=[];function o(a){var s,u={onStack:!0,lowlink:e,index:e};if(r.set(a,u),e+=1,n.push(a),null===(s=t.successors(a))||void 0===s||s.forEach((function(t){var e;if(r.has(t)){if(null===(e=r.get(t))||void 0===e?void 0:e.onStack){var n=r.get(t);u.lowlink=Math.min(u.lowlink,n.index)}}else{o(t);var i=r.get(t);u.lowlink=Math.min(u.lowlink,i.lowlink)}})),u.lowlink===u.index){var c,l=[];do{c=n.pop(),r.get(c).onStack=!1,l.push(c)}while(a!==c);i.push(l)}}return t.nodes().forEach((function(t){r.has(t)||o(t)})),i},q=function(t){return Y(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};function X(t){return X="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},X(t)}function K(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1}},function(t,e,n){"use strict";e.a=function(t){return"object"==typeof t&&null!==t}},function(t,e,n){"use strict";var r=n(8),i=n(2),o=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return Object(r.a)(t,(function(n,r){Object(i.a)(t)&&"prototype"===r||e.push(n)})),e};e.a=o},function(t,e,n){"use strict";function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}e.a=function(t,e,n,i){return e&&r(t,e),n&&r(t,n),i&&r(t,i),t}},function(t,e,n){var r=n(35),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,n){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])n(t,e);else if(s===i[1])n(t,e),t.right2left();else if(s===i[2])n(t,e);else if(s===i[3])n(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=r(t,e),c=u.left,l=u.right;n(c,e),n(l,e),e.isHorizontal?c.right2left():c.bottom2top(),l.translate(c.x-l.x,c.y-l.y),t.x=c.x,t.y=l.y;var h=t.getBoundingBox();e.isHorizontal?h.top<0&&t.translate(0,-h.top):h.left<0&&t.translate(-h.left,0)}var f=e.fixedRoot;return void 0===f&&(f=!0),f&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},function(t,e,n){var r=n(6),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof o)return t;n.data=t;var r=e.getHGap(t),i=e.getVGap(t);return n.preH=e.getPreH(t),n.preV=e.getPreV(t),n.width=e.getWidth(t),n.height=e.getHeight(t),n.width+=n.preH,n.height+=n.preV,n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,i),n}r.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){var n=this;n.hgap+=t,n.vgap+=e,n.width+=2*t,n.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e,n.x+=n.preH,n.y+=n.preV}))},right2left:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.x=t.x-2*(t.x-e.left)-t.width})),t.translate(e.width,0)},bottom2top:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.y=t.y-2*(t.y-e.top)-t.height})),t.translate(0,e.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new o(t,e=r.assign({},i,e)),u=[s];if(!n&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var c=e.getChildren(a.data),l=c?c.length:0;if(a.children=new Array(l),c&&l)for(var h=0;h-1;)i.call(t,s,1);return t}},function(t,e,n){"use strict";var r=n(1),i=n(24);e.a=function(t,e){var n=[];if(!Object(r.a)(t))return n;for(var o=-1,a=[],s=t.length;++oe[r])return 1;if(t[r]n?n:t}},function(t,e,n){"use strict";e.a=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%1!=0}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%2==0}},function(t,e,n){"use strict";var r=n(5),i=Number.isInteger?Number.isInteger:function(t){return Object(r.a)(t)&&t%1==0};e.a=i},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t<0}},function(t,e,n){"use strict";e.a=function(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)0}},function(t,e,n){"use strict";var r=n(0),i=n(2);e.a=function(t,e){if(Object(r.a)(t)){for(var n,o=-1/0,a=0;ao&&(n=s,o=u)}return n}}},function(t,e,n){"use strict";var r=n(0),i=n(2);e.a=function(t,e){if(Object(r.a)(t)){for(var n,o=1/0,a=0;ae?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}},function(t,e,n){"use strict";var r=n(1);e.a=function(t){return Object(r.a)(t)?Array.prototype.slice.call(t):[]}},function(t,e,n){"use strict";var r={};e.a=function(t){return r[t=t||"g"]?r[t]+=1:r[t]=1,t+r[t]}},function(t,e,n){"use strict";e.a=function(){}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";e.a=function(t){return Object(r.a)(t)?0:Object(i.a)(t)?t.length:Object.keys(t).length};var r=n(7),i=n(1)},function(t,e,n){"use strict";e.a=function(){for(var t=0,e=0,n=arguments.length;eh&&u>h);)if(f.push(s),h-=u,!(l=l.substr(16)))return f.join("");for(;s=l.substr(0,1),!((u=Object(o.a)(s,n))+c>h);)if(f.push(s),h-=u,!(l=l.substr(1)))return f.join("");return""+f.join("")+a}},function(t,e,n){"use strict";var r=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();e.a=r},function(t,e){function n(t,e,n,r){void 0===r&&(r=[]);var i=this;i.w=t||0,i.h=e||0,i.y=n||0,i.x=0,i.c=r||[],i.cs=r.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e,n){n?t.y+=e:t.x+=e,t.children.forEach((function(t){r(t,e,n)}))}function i(t,e){var n=e?t.y:t.x;return t.children.forEach((function(t){n=Math.min(i(t,e),n)})),n}function o(t,e){r(t,-i(t,e),e)}function a(t,e,n){n?e.y=t.x:e.x=t.x,t.c.forEach((function(t,r){a(t,e.children[r],n)}))}function s(t,e,n){void 0===n&&(n=0),e?(t.x=n,n+=t.width):(t.y=n,n+=t.height),t.children.forEach((function(t){s(t,e,n)}))}n.fromNode=function(t,e){if(!t)return null;var r=[];return t.children.forEach((function(t){r.push(n.fromNode(t,e))})),e?new n(t.height,t.width,t.x,r):new n(t.width,t.height,t.y,r)},t.exports=function(t,e){void 0===e&&(e={});var r=e.isHorizontal;function i(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function u(t,e,n){for(var r=t.c[e-1],i=r.mod,o=t.c[e],a=o.mod;null!==r&&null!==o;){f(r)>n.low&&(n=n.nxt);var s=i+r.prelim+r.w-(a+o.prelim);s>0&&(a+=s,c(t,e,n.index,s));var u=f(r),d=f(o);u<=d&&null!==(r=h(r))&&(i+=r.mod),u>=d&&null!==(o=l(o))&&(a+=o.mod)}!r&&o?function(t,e,n,r){var i=t.c[0].el;i.tl=n;var o=r-n.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):r&&!o&&function(t,e,n,r){var i=t.c[e].er;i.tr=n;var o=r-n.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,i)}function c(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var i=e-n;t.c[n+1].shift+=r/i,t.c[e].shift-=r/i,t.c[e].change-=r-r/i}}(t,e,n,r)}function l(t){return 0===t.cs?t.tl:t.c[0]}function h(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function f(t){return t.y+t.h}function d(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}s(t,r);var p=n.fromNode(t,r);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=d(f(e.c[0].el),0,null),r=1;rs&&(s=e.depth);var n=e.children,r=n.length,o=new i(e.height,[]);return n.forEach((function(e,n){var i=t(e);o.children.push(i),0===n&&(o.leftChild=i),n===r-1&&(o.rightChild=i)})),o.originNode=e,o.isLeaf=e.isLeaf(),o}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=s;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(u),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(u),a(u,t,e.isHorizontal),t}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(11),o=n(123),a=n(35),s=n(6),u=["LR","RL","H"],c=u[0],l=function(t){var e,n;function i(){return t.apply(this,arguments)||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=void 0===n?20:n,i=t.dropCap,s=void 0===i||i,l=t.direction,h=void 0===l?c:l,f=t.align;if(h&&-1===u.indexOf(h))throw new TypeError("Invalid direction: "+h);if(h===u[0])o(e,r,s,f);else if(h===u[1])o(e,r,s,f),e.right2left();else if(h===u[2]){var d=a(e,t),p=d.left,g=d.right;o(p,r,s,f),p.right2left(),o(g,r,s,f);var m=p.getBoundingBox();g.translate(m.width,0),e.x=g.x-e.width/2}return e},i}(i),h={};t.exports=function(t,e){return e=s.assign({},h,e),new l(t,e).execute()}},function(t,e,n){var r=n(6);t.exports=function(t,e,n,i){var o=null;t.eachNode((function(t){!function(t,e,n,i,o){var a="function"==typeof n?n(t):n*t.depth;if(!i)try{if(t.id===t.parent.children[0].id)return t.x+=a,void(t.y=e?e.y:0)}catch(t){}if(t.x+=a,e){if(t.y=e.y+r.getHeight(e,t,o),e.parent&&t.parent.id!==e.parent.id){var s=e.parent,u=s.y+r.getHeight(s,t,o);t.y=u>t.y?u:t.y}}else t.y=0}(t,o,e,n,i),o=t}))}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(11),o=n(125),a=n(17),s=n(6),u=function(t){var e,n;function i(){return t.apply(this,arguments)||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.execute=function(){return a(this.rootNode,this.options,o)},i}(i),c={};t.exports=function(t,e){return e=s.assign({},c,e),new u(t,e).execute()}},function(t,e,n){var r=n(6);function i(t,e){var n=0;return t.children.length?t.children.forEach((function(t){n+=i(t,e)})):n=t.height,t._subTreeSep=e.getSubTreeSep(t.data),t.totalHeight=Math.max(t.height,n)+2*t._subTreeSep,t.totalHeight}function o(t){var e=t.children,n=e.length;if(n){e.forEach((function(t){o(t)}));var r=e[0],i=e[n-1],a=i.y-r.y+i.height,s=0;if(e.forEach((function(t){s+=t.totalHeight})),a>t.height)t.y=r.y+a/2-t.height/2;else if(1!==e.length||t.height>s){var u=t.y+(t.height-a)/2-r.y;e.forEach((function(t){t.translate(0,u)}))}else t.y=(r.y+r.height/2+i.y+i.height/2)/2-t.height/2}}var a={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},a,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,i(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var i=1;ir?1:0}var u=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this,n=e.nodes,r=e.edges,i=n.length;if(0!==i){e.width||"undefined"==typeof window||(e.width=window.innerWidth),e.height||"undefined"==typeof window||(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var o=e.center;if(1===i)return n[0].x=o[0],n[0].y=o[1],void(e.onLayoutEnd&&e.onLayoutEnd());var s=e.radius,u=e.startRadius,c=e.endRadius,l=e.divisions,h=e.startAngle,f=e.endAngle,d=e.angleRatio,p=e.ordering,g=e.clockwise,m=e.nodeSpacing,v=e.nodeSize,y=(f-h)/i,b={};n.forEach((function(t,e){b[t.id]=e})),e.nodeMap=b;var x=(0,a.getDegree)(n.length,b,r);if(e.degrees=x,m){var w=(0,a.getFuncByUnknownType)(10,m),_=(0,a.getFuncByUnknownType)(10,v),S=-1/0;n.forEach((function(t){var e=_(t);Se.width?e.width/2:e.height/2;var M=y*d,T=[];T="topology"===p?e.topologyOrdering():"topology-directed"===p?e.topologyOrdering(!0):"degree"===p?e.degreeOrdering():n;for(var A=Math.ceil(i/l),C=0;C=0;E--)S(E);return{nodes:n,edges:r,combos:i,comboEdges:s}},e.prototype.getInnerGraphs=function(t){var e=this,n=e.comboTrees,r=e.nodeSize,i=e.edges,a=e.comboPadding,s=e.spacing,l={},h=this.innerLayout||new c.ConcentricLayout({type:"concentric",sortBy:"id"});return h.center=[0,0],h.preventOverlap=!0,h.nodeSpacing=s,(n||[]).forEach((function(e){(0,u.traverseTreeUp)(e,(function(e){var n,s=(null==a?void 0:a(e))||10;if((0,u.isArray)(s)&&(s=Math.max.apply(Math,s)),null===(n=e.children)||void 0===n?void 0:n.length){var c=e.children.map((function(e){if("combo"===e.itemType)return l[e.id];var n=t[e.id]||{};return o(o({},n),e)})),f=c.map((function(t){return t.id})),d={nodes:c,edges:i.filter((function(t){return f.includes(t.source)&&f.includes(t.target)}))},p=1/0;c.forEach((function(t){var e;t.size||(t.size=(null===(e=l[t.id])||void 0===e?void 0:e.size)||(null==r?void 0:r(t))||[30,30]),(0,u.isNumber)(t.size)&&(t.size=[t.size,t.size]),p>t.size[0]&&(p=t.size[0]),p>t.size[1]&&(p=t.size[1])})),h.layout(d);var g=(0,u.getLayoutBBox)(c),m=g.minX,v=g.minY,y=g.maxX,b=g.maxY,x={x:(y+m)/2,y:(b+v)/2};d.nodes.forEach((function(t){t.x-=x.x,t.y-=x.y}));var w=Math.max(y-m,p)+2*s,_=Math.max(b-v,p)+2*s;l[e.id]={id:e.id,nodes:c,size:[w,_]}}else if("combo"===e.itemType){var S=s?[2*s,2*s]:[30,30];l[e.id]={id:e.id,nodes:[],size:S}}return!0}))})),l},e.prototype.initVals=function(){var t,e,n=this,r=n.nodeSize,i=n.spacing;if(e=(0,u.isNumber)(i)?function(){return i}:(0,u.isFunction)(i)?i:function(){return 0},this.spacing=e,r)if((0,u.isFunction)(r))t=function(t){var n=r(t),i=e(t);return(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if((0,u.isArray)(r)){var o=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return o+e(t)/2}}else{var a=r/2;t=function(t){return a+e(t)/2}}else t=function(t){var n=e(t);return t.size?(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+n)/2:(0,u.isObject)(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+n)/2:(t.size+n)/2:10+n/2};this.nodeSize=t;var s,c=n.comboPadding;s=(0,u.isNumber)(c)?function(){return c}:(0,u.isArray)(c)?function(){return Math.max.apply(null,c)}:(0,u.isFunction)(c)?c:function(){return 0},this.comboPadding=s},e.prototype.getType=function(){return"comboCombined"},e}(s.Base);e.ComboCombinedLayout=l},66590:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ComboForceLayout=void 0;var o=n(62329),a=n(49784),s=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var s=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){(0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)&&(t.x+=r[e].x*i,t.y+=r[e].y*i)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;uv[1]?v[0]:v[1])/2;g=function(t){return b}}else{var x=v/2;g=function(t){return x}}else g=function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=g;var w,_=t.comboSpacing;w=(0,a.isNumber)(_)?function(){return _}:(0,a.isFunction)(_)?_:function(){return 0},this.comboSpacing=w;var S,E=t.comboPadding;S=(0,a.isNumber)(E)?function(){return E}:(0,a.isArray)(E)?function(){return Math.max.apply(null,E)}:(0,a.isFunction)(E)?E:function(){return 0},this.comboPadding=S;var M,T=this.linkDistance;T||(T=10),M=(0,a.isNumber)(T)?function(t){return T}:T,this.linkDistance=M;var A,C=this.edgeStrength;C||(C=1),A=(0,a.isNumber)(C)?function(t){return C}:C,this.edgeStrength=A;var k,N=this.nodeStrength;N||(N=30),k=(0,a.isNumber)(N)?function(t){return N}:N,this.nodeStrength=k},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,i=t[r];r&&i?(e.x=i.cx+100/(n+1),e.y=i.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,i={};return(n||[]).forEach((function(n){var o=[];(0,a.traverseTreeUp)(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===i[n.id]){var s={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};i[n.id]=s}var u=n.children;u&&u.forEach((function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)}));var c=i[n.id];if(c.cx=0,c.cy=0,0===o.length){c.empty=!0;var l=r[n.id];c.cx=l.x,c.cy=l.y}return o.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=i[t.id];return(0,a.isNumber)(n.cx)&&(c.cx+=n.cx),void((0,a.isNumber)(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&((0,a.isNumber)(r.x)&&(c.cx+=r.x),(0,a.isNumber)(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=o,!0}))})),i},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,i=this.alpha,o=e.comboTrees,s=e.indexMap,u=e.nodeMap,c=e.comboMap;(o||[]).forEach((function(e){(0,a.traverseTreeUp)(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],o=(n.depth+1)/10*.5,l=n.cx,h=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var f=c[e.id];return f&&(0,a.isNumber)(f.cx)&&(n.cx+=f.cx),void(f&&(0,a.isNumber)(f.cy)&&(n.cy+=f.cy))}var d=u[e.id],p=d.x-l||.005,g=d.y-h||.005,m=Math.sqrt(p*p+g*g),v=s[d.id],y=r*i/m*o;t[v].x-=p*y,t[v].y-=g*y,(0,a.isNumber)(d.x)&&(n.cx+=d.x),(0,a.isNumber)(d.y)&&(n.cy+=d.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,i={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(eo&&(c.minX=o),c.minY>a&&(c.minY=a),c.maxX1&&r.forEach((function(n,a){if("node"===n.itemType)return!1;var u=e[n.id];u&&r.forEach((function(r,c){if(a<=c)return!1;if("node"===r.itemType)return!1;var l=e[r.id];if(!l)return!1;var h=u.cx-l.cx||.005,f=u.cy-l.cy||.005,d=h*h+f*f,p=u.r||1,g=l.r||1,m=p+g,v=g*g,y=p*p;if(di)){var v=e["".concat(d.id,"-").concat(n.id)],y=v.vx,b=v.vy,x=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;x=x<1?1:x,n.comboId!==d.comboId&&(x+=1);var w=x?Math.pow(h,x):1,_=o(n)*a/g*w;if(t[p].x+=y*_,t[p].y+=b*_,p0){var e=Math.abs(v[0][n.sortBy]-t[n.sortBy]);n.maxLevelDiff&&e>=n.maxLevelDiff&&(v=[],m.push(v))}v.push(t)}));var y=u+(f||n.minNodeSpacing);if(!n.preventOverlap){var b=m.length>0&&m[0].length>1,x=(Math.min(n.width,n.height)/2-y)/(m.length+(b?1:0));y=Math.min(y,x)}var w=0;if(m.forEach((function(t){var e=n.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var r=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&n.preventOverlap){var i=Math.cos(r)-Math.cos(0),o=Math.sin(r)-Math.sin(0),a=Math.sqrt(y*y/(i*i+o*o));w=Math.max(a,w)}t.r=w,w+=y})),n.equidistant){for(var _=0,S=0,E=0;Ee.x&&(I=e.x),L>e.y&&(L=e.y)})),w.edges().forEach((function(t){var e;null===(e=w.edge(t).points)||void 0===e||e.forEach((function(t){I>t.x&&(I=t.x),L>t.y&&(L=t.y)}))})),P[0]=p[0]-I,P[1]=p[1]-L}var D="LR"===f||"RL"===f;if(g){var R=this,z=R.focusNode,F=R.ranksep,B=R.getRadialPos,j=(0,s.isString)(z)?z:null==z?void 0:z.id,U=j?null===(r=w.node(j))||void 0===r?void 0:r._rank:0,V=[],H=D?"y":"x",G=D?"height":"width",Z=1/0,W=-1/0;w.nodes().forEach((function(t){var e=w.node(t);if(o.nodeMap[t]){var n=A(o.nodeMap[t]);if(0===U)V[e._rank]||(V[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),V[e._rank].nodes.push(t),V[e._rank].totalWidth+=2*n+e[G],V[e._rank].maxSizeW&&(W=s)}}));var Y=F||50,q={},X=(W-Z)/.9,K=[.5*(Z+W-X),.5*(Z+W+X)],$=function(t,e,n,r){void 0===n&&(n=-1/0),void 0===r&&(r=[0,1]);var i=n;return t.forEach((function(t){var n=w.node(t);q[t]=e;var a=B(n[H],K,X,e,r),s=a.x,u=a.y;if(o.nodeMap[t]){o.nodeMap[t].x=s+P[0],o.nodeMap[t].y=u+P[1],o.nodeMap[t]._order=n._order;var c=T(o.nodeMap[t]);i=i}))}:function(t,e,n){var r=Math.max(e.x,n.x),i=Math.min(e.x,n.x);return t.filter((function(t){return t.x<=r&&t.x>=i}))};w.edges().forEach((function(t){var e,n=w.edge(t),r=x.findIndex((function(e){var n=(0,s.getEdgeTerminal)(e,"source"),r=(0,s.getEdgeTerminal)(e,"target");return n===t.v&&r===t.w}));if(!(r<=-1)&&o.edgeLabelSpace&&o.controlPoints&&"loop"!==x[r].type){null===(e=null==n?void 0:n.points)||void 0===e||e.forEach((function(t){t.x+=P[0],t.y+=P[1]}));var i=o.nodeMap[t.v],a=o.nodeMap[t.w];x[r].controlPoints=h(null==n?void 0:n.points,i,a,et,D,nt,rt)}}))}return o.onLayoutEnd&&o.onLayoutEnd(),{nodes:u,edges:x}}},e.prototype.getRadialPos=function(t,e,n,r,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/n,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*r,y:Math.sin(a)*r}},e.prototype.getType=function(){return"dagre"},e}(u.Base);e.DagreLayout=l;var h=function(t,e,n,r,i,o,a){var s=(null==t?void 0:t.slice(1,t.length-1))||[];if(e&&n){var u=e.x,c=e.y,l=n.x,h=n.y;if(i&&(u=e.y,c=e.x,l=n.y,h=n.x),h!==c&&u!==l){var f=r.indexOf(c),d=r[f+1];if(d){var p=s[0],g=i?{x:(c+d)/2,y:(null==p?void 0:p.y)||l}:{x:(null==p?void 0:p.x)||l,y:(c+d)/2};p&&!o(p,g)||s.unshift(g)}var m=r.indexOf(h),v=Math.abs(m-f);if(1===v)(s=a(s,e,n)).length||s.push(i?{x:(c+h)/2,y:u}:{x:u,y:(c+h)/2});else if(v>1){var y=r[m-1];if(y){var b=s[s.length-1],x=i?{x:(h+y)/2,y:(null==b?void 0:b.y)||l}:{x:(null==b?void 0:b.x)||u,y:(h+y)/2};b&&!o(b,x)||s.push(x)}}}}return s}},77057:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;nt.x&&(i=t.x),o>t.y&&(o=t.y)})),e.forEach((function(t){t.points.forEach((function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)}))})),r[0]=n[0]-i,r[1]=n[1]-o}return r},e.prototype.updateNodePosition=function(t,e){var n=this,r=n.combos,i=n.nodes,o=n.edges,a=n.anchorPoint,s=n.graphSettings,c=this.getBegin(t,e);t.forEach((function(t){var n,l=t.x,h=t.y,f=t.id,d=t.type,p=t.coreBox;if(d===u.HierarchyNodeType.META&&f!==u.ROOT_NAME){var g=r.findIndex((function(t){return t.id===f})),m=null===(n=null==s?void 0:s.subScene)||void 0===n?void 0:n.meta;r[g].offsetX=l+c[0],r[g].offsetY=h+c[1],r[g].fixSize=[p.width,p.height],r[g].fixCollapseSize=[p.width,p.height],t.expanded?r[g].padding=[null==m?void 0:m.paddingTop,null==m?void 0:m.paddingRight,null==m?void 0:m.paddingBottom,null==m?void 0:m.paddingLeft]:r[g].padding=[0,0,0,0]}else if(d===u.HierarchyNodeType.OP){g=i.findIndex((function(t){return t.id===f}));if(i[g].x=l+c[0],i[g].y=h+c[1],a){var v=[],y=e.filter((function(t){return t.v===f})),b=e.filter((function(t){return t.w===f}));y.length>0&&y.forEach((function(e){var n=e.points[0],r=(n.x-l)/t.width+.5,i=(n.y-h)/t.height+.5;v.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.sourceAnchor=v.length-1)}))})),b.length>0&&b.forEach((function(e){var n=e.points[e.points.length-1],r=(n.x-l)/t.width+.5,i=(n.y-h)/t.height+.5;v.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.targetAnchor=v.length-1)}))})),i[g].anchorPoints=v.length>0?v:i[g].anchorPoints||[]}}}))},e.prototype.updateEdgePosition=function(t,e){var n=this,r=n.combos,i=n.edges,s=n.controlPoints,c=this.getBegin(t,e);s&&(r.forEach((function(t){t.inEdges=[],t.outEdges=[]})),i.forEach((function(e){var i,s,l,h,f=t.find((function(t){return t.id===e.source})),d=t.find((function(t){return t.id===e.target})),p=[],g=[];if(f&&d)g=(0,u.getEdges)(null==f?void 0:f.id,null==d?void 0:d.id,t);else if(!f||!d){var m=n.getNodePath(e.source),v=n.getNodePath(e.target),y=m.reverse().slice(f?0:1).find((function(e){return t.find((function(t){return t.id===e}))})),b=v.reverse().slice(d?0:1).find((function(e){return t.find((function(t){return t.id===e}))}));f=t.find((function(t){return t.id===y})),d=t.find((function(t){return t.id===b})),g=(0,u.getEdges)(null==f?void 0:f.id,null==d?void 0:d.id,t,{v:e.source,w:e.target})}if(p=(p=g.reduce((function(t,e){return a(a([],t,!0),e.points.map((function(t){return o(o({},t),{x:t.x+c[0],y:t.y+c[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=p,(null==d?void 0:d.type)===u.NodeType.META){var x=r.findIndex((function(t){return t.id===(null==d?void 0:d.id)}));if(!r[x]||(null===(i=r[x].inEdges)||void 0===i?void 0:i.some((function(t){return t.source===f.id&&t.target===d.id}))))return;null===(s=r[x].inEdges)||void 0===s||s.push({source:f.id,target:d.id,controlPoints:p})}if((null==f?void 0:f.type)===u.NodeType.META){x=r.findIndex((function(t){return t.id===(null==f?void 0:f.id)}));if(!r[x]||(null===(l=r[x].outEdges)||void 0===l?void 0:l.some((function(t){return t.source===f.id&&t.target===d.id}))))return;null===(h=r[x].outEdges)||void 0===h||h.push({source:f.id,target:d.id,controlPoints:p})}})))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every((function(t){return void 0!==t.layoutOrder}))||t.forEach((function(t,e){t.layoutOrder=e})),t.sort((function(t,e){return t.layoutOrder-e.layoutOrder}))},e}(s.Base);e.DagreCompoundLayout=l},27652:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(n(69787).Graph);e.Graph=o},41106:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(65236)),o=n(69209);e.default={layout:i.default,util:{time:o.time,notime:o.notime}}},78029:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(40773)),o=function(t){var e=[],n={},r={},i=function(o){var a;r[o]||(r[o]=!0,n[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach((function(t){n[t.w]?e.push(t):i(t.w)})),delete n[o])};return t.nodes().forEach(i),e};e.default={run:function(t){var e="greedy"===t.graph().acyclicer?(0,i.default)(t,function(t){return function(e){var n;return(null===(n=t.edge(e))||void 0===n?void 0:n.weight)||1}}(t)):o(t);null==e||e.forEach((function(e){var n=t.edge(e);t.removeEdgeObj(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-".concat(Math.random()))}))},undo:function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}}},11500:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69209),i=function(t,e,n,i,o,a){var s={rank:a,borderType:e,width:0,height:0},u=o[e][a-1],c=(0,r.addDummyNode)(t,"border",s,n);o[e][a]=c,t.setParent(c,i),u&&t.setEdge(u,c,{weight:1})};e.default=function(t){var e,n=function(e){var r=t.children(e),o=t.node(e);if((null==r?void 0:r.length)&&r.forEach((function(t){return n(t)})),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,s=o.maxRank+1;a0;--s)if(r=e[s].dequeue()){i=i.concat(f(t,e,n,r,!0));break}}return i},f=function(t,e,n,r,i){var o,a,s=[];return null===(o=t.inEdges(r.v))||void 0===o||o.forEach((function(r){var o=t.edge(r),a=t.node(r.v);i&&s.push({v:r.v,w:r.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=o,p(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var i=t.edge(r),o=r.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,p(e,n,a)})),t.removeNode(r.v),i?s:void 0},d=function(t,e){var n=new c,r=0,i=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var o=n.edge(t)||0,a=(null==e?void 0:e(t))||1,s=o+a;n.setEdge(t.v,t.w,s),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var o=[],a=i+r+3,s=0;s0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}})),c};e.default=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);r+=1)n+=i(t,e[r-1],e[r]);return n}},19597:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(15697)),o=r(n(32957)),a=r(n(77006)),s=r(n(80314)),u=r(n(99455)),c=n(49784),l=n(27652),h=n(69209),f=function(t,e,n){return e.map((function(e){return(0,a.default)(t,e,n)}))},d=function(t,e,n,r){var i=new l.Graph;null==t||t.forEach((function(t){for(var o,a=t.graph().root,c=(0,u.default)(t,a,i,e,n,r),l=0;l<(null===(o=c.vs)||void 0===o?void 0:o.length);l++){var h=t.node(c.vs[l]);h&&(h.order=l)}(0,s.default)(t,i,c.vs)}))},p=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};e.default=function(t,e){for(var n=(0,h.maxRank)(t),r=[],a=[],s=1;s-1;s--)a.push(s);var u=f(t,r,"inEdges"),l=f(t,a,"outEdges"),g=(0,i.default)(t);p(t,g);for(var m,v=Number.POSITIVE_INFINITY,y=(s=0,0);y<4;++s,++y){d(s%2?u:l,s%4>=2,!1,e),g=(0,h.buildLayerMatrix)(t),(b=(0,o.default)(t,g))=2,!0,e),g=(0,h.buildLayerMatrix)(t),(b=(0,o.default)(t,g))=e.barycenter)&&r(e,t)})(t);var e})),null===(n=o.out)||void 0===n||n.forEach((function(e){return(n=o,function(e){e.in.push(n),0==--e.indegree&&t.push(e)})(e);var n}))};null==t?void 0:t.length;)o();var a=i.filter((function(t){return!t.merged})),s=["vs","i","barycenter","weight"];return a.map((function(t){var e={};return null==s||s.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))},r=function(t,e){var n,r=0,i=0;t.weight&&(r+=t.barycenter*t.weight,i+=t.weight),e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};e.default=function(t,e){var r,i,o,a={};null==t||t.forEach((function(t,e){a[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var n=a[t.v];void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(r=e.edges())||void 0===r||r.forEach((function(t){var e=a[t.v],n=a[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(a[t.w]))}));var s=null===(o=(i=Object.values(a)).filter)||void 0===o?void 0:o.call(i,(function(t){return!t.indegree}));return n(s)}},99455:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(89921)),o=r(n(7043)),a=r(n(21498)),s=function(t,e,n,r,l,h){var f,d,p,g,m=t.children(e),v=t.node(e),y=v?v.borderLeft:void 0,b=v?v.borderRight:void 0,x={};y&&(m=null==m?void 0:m.filter((function(t){return t!==y&&t!==b})));var w=(0,i.default)(t,m||[]);null==w||w.forEach((function(e){var i;if(null===(i=t.children(e.v))||void 0===i?void 0:i.length){var o=s(t,e.v,n,r,h);x[e.v]=o,o.hasOwnProperty("barycenter")&&c(e,o)}}));var _=(0,o.default)(w,n);u(_,x),null===(f=_.filter((function(t){return t.vs.length>0})))||void 0===f||f.forEach((function(e){var n=t.node(e.vs[0]);n&&(e.fixorder=n.fixorder,e.order=n.order)}));var S=(0,a.default)(_,r,l,h);if(y&&(S.vs=[y,S.vs,b].flat(),null===(d=t.predecessors(y))||void 0===d?void 0:d.length)){var E=t.node((null===(p=t.predecessors(y))||void 0===p?void 0:p[0])||""),M=t.node((null===(g=t.predecessors(b))||void 0===g?void 0:g[0])||"");S.hasOwnProperty("barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+E.order+M.order)/(S.weight+2),S.weight+=2}return S},u=function(t,e){null==t||t.forEach((function(t){var n,r=null===(n=t.vs)||void 0===n?void 0:n.map((function(t){return e[t]?e[t].vs:t}));t.vs=r.flat()}))},c=function(t,e){void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)};e.default=s},21498:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(69209),i=function(t,e,n){for(var r,i=n;e.length&&(r=e[e.length-1]).i<=i;)e.pop(),null==t||t.push(r.vs),i++;return i},o=function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenterr.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.orderr.order)return 1}return t?r.i-n.i:n.i-r.i}};e.default=function(t,e,n,a){var s=(0,r.partition)(t,(function(t){var e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return a?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")})),u=s.lhs,c=s.rhs.sort((function(t,e){return-t.i- -e.i})),l=[],h=0,f=0,d=0;null==u||u.sort(o(!!e,!!n)),d=i(l,c,d),null==u||u.forEach((function(t){var e;d+=null===(e=t.vs)||void 0===e?void 0:e.length,l.push(t.vs),h+=t.barycenter*t.weight,f+=t.weight,d=i(l,c,d)}));var p={vs:l.flat()};return f&&(p.barycenter=h/f,p.weight=f),p}},33562:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e,n=function(t){var e,n={},r=0,i=function(e){var o,a=r;null===(o=t.children(e))||void 0===o||o.forEach(i),n[e]={low:a,lim:r++}};return null===(e=t.children())||void 0===e||e.forEach(i),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,i,o=e,a=t.node(o),s=a.edgeObj;if(s)for(var u=function(t,e,n,r){var i,o,a=[],s=[],u=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||c>e[i].lim));for(o=i,i=r;i&&i!==o;)s.push(i),i=t.parent(i);return{lca:o,path:a.concat(s.reverse())}}(t,n,s.v,s.w),c=u.path,l=u.lca,h=0,f=c[h],d=!0;o!==s.w;){if(a=t.node(o),d){for(;f!==l&&(null===(r=t.node(f))||void 0===r?void 0:r.maxRank)s)&&(0,e.addConflict)(r,n,l)})))}function o(t,e){var n=function(t){return JSON.stringify(t.slice(1))}(t);e.get(n)||(i.apply(void 0,t),e.set(n,!0))}return(null==n?void 0:n.length)&&n.reduce((function(e,n){var r,i=-1,a=0,s=new Map;return null==n||n.forEach((function(u,c){var l;if("border"===(null===(l=t.node(u))||void 0===l?void 0:l.dummy)){var h=t.predecessors(u)||[];h.length&&(r=t.node(h[0]).order,o([n,a,c,i,r],s),a=c,i=r)}o([n,a,n.length,r,e.length],s)})),n})),r};e.findOtherInnerSegmentNode=function(t,e){var n,r;if(null===(n=t.node(e))||void 0===n?void 0:n.dummy)return null===(r=t.predecessors(e))||void 0===r?void 0:r.find((function(e){return t.node(e).dummy}))};e.addConflict=function(t,e,n){var r=e,i=n;if(r>i){var o=r;r=i,i=o}var a=t[r];a||(t[r]=a={}),a[i]=!0};e.hasConflict=function(t,e,n){var r=e;r>n&&(r=n);return!!t[r]};e.verticalAlignment=function(t,n,r,i){var o={},a={},s={};return null==n||n.forEach((function(t){null==t||t.forEach((function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),null==n||n.forEach((function(t){var n=-1;null==t||t.forEach((function(t){var u=i(t);if(u.length)for(var c=((u=u.sort((function(t,e){return s[t]-s[e]}))).length-1)/2,l=Math.floor(c),h=Math.ceil(c);l<=h;++l){var f=u[l];a[t]===t&&nu.lim&&(c=u,l=!0);var h=e.edges().filter((function(e){return l===d(t,t.node(e.v),c)&&l!==d(t,t.node(e.w),c)}));return(0,o.minBy)(h,(function(t){return(0,i.slack)(e,t)}))};e.exchangeEdges=function(t,n,r,i){var o=r.v,a=r.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),(0,e.initLowLimValues)(t),(0,e.initCutValues)(t,n),h(t,n)};var h=function(t,e){var n=t.nodes().find((function(t){var n;return!(null===(n=e.node(t))||void 0===n?void 0:n.parent)})),r=s(t,n);null==(r=null==r?void 0:r.slice(1))||r.forEach((function(n){var r=t.node(n).parent,i=e.edgeFromArgs(n,r),o=!1;i||(i=e.edgeFromArgs(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))},f=function(t,e,n){return t.hasEdge(e,n)},d=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};e.default=function(t){var n=(0,o.simplify)(t);(0,i.longestPath)(n);var a,s,u=(0,r.feasibleTree)(n);for((0,e.initLowLimValues)(u),(0,e.initCutValues)(u,n);a=(0,e.leaveEdge)(u);)s=(0,e.enterEdge)(u,n,a),(0,e.exchangeEdges)(u,n,a,s)}},37323:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slack=e.longestPathWithLayer=e.longestPath=void 0;var n=function(t){var e,n={},r=function(e){var i,o,a=t.node(e);return a?n[e]?a.rank:(n[e]=!0,null===(i=t.outEdges(e))||void 0===i||i.forEach((function(e){var n=r(e.w)-t.edge(e).minlen;n&&(void 0===o||nMath.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:i+n,y:o+r}):{x:0,y:0}};e.buildLayerMatrix=function(t){for(var n=[],r=(0,e.maxRank)(t)+1,i=0;ie)&&(e=i)})),e||(e=0),e};e.partition=function(t,e){var n={lhs:[],rhs:[]};return null==t||t.forEach((function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n};e.time=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}};e.notime=function(t,e){return e()};e.minBy=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))}},34015:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1){var e=r({},t);delete e.size,s.push(e)}}));var f=[];i.forEach((function(t){var e=s.find((function(e){return e.id===t.source})),n=s.find((function(e){return e.id===t.target}));e&&n&&f.push(t)}));var d=new h.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:s,edges:f}).nodes;n.forEach((function(t){var e=(d||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||o/2,t.y=(null==e?void 0:e.y)||a/2}));var p=JSON.parse(JSON.stringify(n)),g=JSON.parse(JSON.stringify(i)),m=u.forceSimulation().nodes(p).force("link",u.forceLink(g).id((function(t){return t.id})).distance((function(t){return f.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",u.forceManyBody()).force("center",u.forceCenter(o/2,a/2)).force("x",u.forceX(o/2)).force("y",u.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise((function(t){m.on("end",(function(){n.forEach((function(t){var e=p.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var r=Math.min.apply(Math,n.map((function(t){return t.x}))),s=Math.max.apply(Math,n.map((function(t){return t.x}))),u=Math.min.apply(Math,n.map((function(t){return t.y}))),h=Math.max.apply(Math,n.map((function(t){return t.y}))),f=o/(s-r),d=a/(h-u);n.forEach((function(t){void 0!==t.x&&f<1&&(t.x=(t.x-r)*f),void 0!==t.y&&d<1&&(t.y=(t.y-u)*d)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),(0,l.default)(n,i),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),(0,c.default)({nodes:n,edges:i},e),t()}))}))}},88221:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(28611));e.default=function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,o=e.nodeMinGap,a=1e4,s=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;a=Math.min(e,a),s=Math.min(n,s)}));var u=new i.default;u.init(n,r,{CELL_H:s,CELL_W:a}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var c=0;ca){for(var p=m=Math.ceil((l.size[0]+o)/a)-1,g=0;g-1)||u.cells[f+g+1][d].node)break;p--}u.insertColumn(f,p)}if(l.size[1]+o>s){var m;for(p=m=Math.ceil((l.size[1]+o)/s)-1,g=0;g-1)||u.cells[f][d+g+1].node)break;p--}u.insertRow(d,p)}}for(c=0;ct;r--)for(i=0;i=t&&(this.additionColumn[i]+=e);for(r=0;rt;r--)this.cells[i][r+e]=n(n({},this.cells[i][r]),{dx:i,dy:r+e,x:i*this.CELL_W,y:(r+e)*this.CELL_H}),this.cells[i][r]={dx:i,dy:r,x:i*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null};for(r=0;r=t&&(this.additionRow[r]+=e);for(i=0;is?e:t,c=a>s?t:e,l=u.x-u.size[0]/2,h=u.y-u.size[1]/2,f=u.x+u.size[0]/2,d=u.y+u.size[1]/2,p=c.x-c.size[0]/2,g=c.y-c.size[1]/2,m=c.x+c.size[0]/2,v=c.y+c.size[1]/2,y=u.x,b=u.y,x=c.x,w=c.y,_=0,S=0;if(f>=p&&m>=l&&d>=g&&v>=h){0===(S=Math.sqrt(Math.pow(x-y,2)+Math.pow(w-b,2)))&&(S=1e-7),_=10/S*100+((fp?l:p))*((dg?h:g)),_*=n}else{var E=!1,M=function(t,e,n){var i=t.x-t.size[0]/2,o=t.y-t.size[1]/2,a=t.x+t.size[0]/2,s=t.y+t.size[1]/2,u=e.x-e.size[0]/2,c=e.y-e.size[1]/2,l=e.x+e.size[0]/2,h=e.y+e.size[1]/2,f=t.x,d=t.y,p=e.x,g=e.y,m=p-f,v=Math.atan2(m,g-d),y=0,b=0,x=0,w=0;v>r?(b=o-h,y=u-a,x=parseFloat(b?(b/Math.cos(v)).toFixed(2):y.toFixed(2)),w=parseFloat(y?(y/Math.sin(v)).toFixed(2):b.toFixed(2))):x=w=0(y=u-a)?parseFloat(b?(b/Math.cos(v)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(v)).toFixed(2):b.toFixed(2)):v<-r?(b=o-h)>(y=-(l-i))?parseFloat(b?(b/Math.cos(v)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(v)).toFixed(2):b.toFixed(2)):(b=c-s)>(y=Math.abs(m)>(a-i)/2?i-l:m)?parseFloat(b?(b/Math.cos(v)).toFixed(2):y.toFixed(2)):parseFloat(y&&0!==v?(y/Math.sin(v)).toFixed(2):b.toFixed(2));var _=parseFloat(v.toFixed(2)),S=n;return n&&(S=1.1780972450961724<_&&_<1.9634954084936207),{distance:Math.abs(x1200||r.y>800)&&(e+=1e12);for(var i=n+1;i70&&l<110,d=h>70&&h<110;if((l<30||l>150)&&!(h<30||h>150)||l*h<0){s=!1;break}if(f&&!d||l*h<0){s=!1;break}if((c.x-t.x)*(c.x-e.x)<0){s=!1;break}if((c.y-t.y)*(c.y-e.y)<0){s=!1;break}}return s}function c(t,e){for(var n=!1,r=[10,-10,0,0],i=[0,0,10,-10],a=0;a.1?(h=d,n=!0):(c.x-=r[f],c.y-=i[f])}}return o>.1&&(o*=.5),n?s(t):0}function l(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>1200||t.y+t.size[1]+20>800)&&(n+=1e12);for(var r=0;r0&&!(++u>=50);){var l=c(t,e);0!==l&&(a=l),o=a-n,n=a,0===o?--r:r=20}return t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2})),{nodes:t,edges:e}}},91019:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forceNBody=void 0;var r=n(71829),i=.1;function o(t){var e=0,n=0,r=0;if(t.length){for(var i=0;i<4;i++){(o=t[i])&&o.weight&&(e+=o.weight,n+=o.x*o.weight,r+=o.y*o.weight)}t.x=n/e,t.y=r/e,t.weight=e}else{var o=t;t.x=o.data.x,t.y=o.data.y,t.weight=o.data.weight}}e.forceNBody=function(t,e,n,a,s){var u=n/a,c=t.map((function(t,n){var r=e[t.id],i=r.data,o=r.x,a=r.y,s=r.size,c=i.layout.force.nodeStrength;return{x:o,y:a,size:s,index:n,vx:0,vy:0,weight:u*c}})),l=(0,r.quadtree)(c,(function(t){return t.x}),(function(t){return t.y})).visitAfter(o);return c.forEach((function(t){!function(t,e){e.visit((function(e,n,r,o,a){return function(t,e,n,r,o,a){var s=a.x-t.x||i,u=a.y-t.y||i,c=r-e,l=s*s+u*u,h=Math.sqrt(l)*l;if(c*c*.811&&(o=(0,s.getAvgNodePosition)(c))}else o=void 0;return{x:null==o?void 0:o.x,y:null==o?void 0:o.y}}}}if(r){t||(t=this.getSameTypeLeafMap());var d=Array.from(new Set(a.map((function(t,e){return t[i]})))).filter((function(t){return void 0!==t})),p={};d.forEach((function(t){var e=a.filter((function(e){return e[i]===t})).map((function(t){return u[t.id]}));p[t]=(0,s.getAvgNodePosition)(e)})),h={single:function(t){return l(t)},leaf:function(t){return l(t)},others:function(t){return l(t)},center:function(t,e,n){var r=p[t[i]];return{x:null==r?void 0:r.x,y:null==r?void 0:r.y}}}}this.centripetalOptions=o(o({},this.centripetalOptions),h);var g=this.centripetalOptions,m=g.leaf,v=g.single,y=g.others;m&&"function"!=typeof m&&(this.centripetalOptions.leaf=function(){return m}),v&&"function"!=typeof v&&(this.centripetalOptions.single=function(){return v}),y&&"function"!=typeof y&&(this.centripetalOptions.others=function(){return y})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var e=t.nodes,n=t.edges,r=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void t.onLayoutEnd([o({},e[0])]);t.degreesMap=(0,s.getDegreeMap)(e,n),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var n=1;(0,s.isNumber)(e.mass)&&(n=e.mass);var r=t.degreesMap[e.id].all;return!r||r<5?n:5*r*n};var a,u=t.nodeSize;if(t.preventOverlap){var l,h=t.nodeSpacing;l=(0,s.isNumber)(h)?function(){return h}:(0,s.isFunction)(h)?h:function(){return 0},a=u?(0,s.isArray)(u)?function(t){return Math.max(u[0],u[1])+l(t)}:function(t){return u+l(t)}:function(t){return t.size?(0,s.isArray)(t.size)?Math.max(t.size[0],t.size[1])+l(t):(0,s.isObject)(t.size)?Math.max(t.size.width,t.size.height)+l(t):t.size+l(t):10+l(t)}}t.nodeSize=a,t.linkDistance=c(t.linkDistance,1),t.nodeStrength=c(t.nodeStrength,1),t.edgeStrength=c(t.edgeStrength,1);var f={},d={};e.forEach((function(e,r){(0,s.isNumber)(e.x)||(e.x=Math.random()*t.width),(0,s.isNumber)(e.y)||(e.y=Math.random()*t.height);var i=t.degreesMap[e.id];f[e.id]=o(o({},e),{data:o(o({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:i.in,outDegree:i.out,degree:i.all,tDegree:i.in,sDegree:i.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,n)}}})}),d[e.id]=r})),t.nodeMap=f,t.nodeIdxMap=d,t.edgeInfos=[],null==n||n.forEach((function(e){var n=f[e.source],i=f[e.target];n&&i?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:r?r(o(o({},e),{source:n,target:i}),n,i):t.linkDistance(e,n,i)||1+(u(n)+u(n)||0)/2}):elf.edgeInfos.push({})})),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,n=t.nodes,r=t.edges,i=t.workerEnabled,o=t.minMovement,a=t.animate,s=t.nodeMap,u=t.height;if(t.currentMinY=0,t.currentMaxY=u,n){var c=[];if(n.forEach((function(t,e){c[2*e]=0,c[2*e+1]=0})),this.defSideCoe&&"function"==typeof this.defSideCoe){var l={};r.forEach((function(t){var e=t.source,n=t.target;l[e]=l[e]||[],l[e].push(t),l[n]=l[n]||[],l[n].push(t)})),this.relatedEdges=l}var h=e;if(i||!a){for(var f=0;(t.judgingDistance>o||f<1)&&f=h||t.judgingDistancea){var l=a/c;s*=l,u*=l}e[2*i]=s,e[2*i+1]=u}))},e.prototype.updatePosition=function(t,e){var n=this,r=n.nodes,i=n.distanceThresholdMode,o=n.nodeMap;if(null==r?void 0:r.length){var a=0;"max"===i?n.judgingDistance=-1/0:"min"===i&&(n.judgingDistance=1/0);var u=1/0,c=-1/0;r.forEach((function(r,l){var h=o[r.id];if((0,s.isNumber)(r.fx)&&(0,s.isNumber)(r.fy))return r.x=r.fx,r.y=r.fy,h.x=r.x,void(h.y=r.y);var f=t[2*l]*e,d=t[2*l+1]*e;r.x+=f,r.y+=d,h.x=r.x,h.y=r.y,r.yc&&(c=r.y);var p=Math.sqrt(f*f+d*d);switch(i){case"max":n.judgingDistancep&&(n.judgingDistance=p);break;default:a+=p}})),this.currentMinY=u,this.currentMaxY=c,i&&"mean"!==i||(n.judgingDistance=a/r.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,n=t.nodes,r=t.edges,i=t.nodeMap,o=t.degreesMap;if(null==n?void 0:n.length){var a={};return n.forEach((function(t,n){1===o[t.id].all&&(a[t.id]=(0,s.getCoreNodeAndRelativeLeafNodes)("leaf",t,r,e,o,i))})),a}},e}(a.Base);e.Force2Layout=l},19712:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();e.default=n},48564:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForceAtlas2Layout=void 0;var a=n(62329),s=n(49784),u=o(n(19712)),c=o(n(51638)),l=o(n(62732)),h=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,i=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var o=[],a=e.length,u=0;u250&&(t.barnesHut=!0),void 0===t.prune&&a>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(i=100,a<=200&&a>100?i=500:a>200&&(i=950),this.maxIteration=i):(i=250,a<=200&&a>100?i=1e3:a>200&&(i=1200),this.maxIteration=i),t.kr||(t.kr=50,a>100&&a<=500?t.kr=20:a>500&&(t.kr=1)),t.kg||(t.kg=20,a>100&&a<=500?t.kg=10:a>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(o),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,i=e.nodes,o=n.filter((function(t){return(0,s.getEdgeTerminal)(t,"source")!==(0,s.getEdgeTerminal)(t,"target")})),a=i.length,u=o.length,c=[],l={},h={},f=[],d=0;d0;){for(y=0;y50||!l)?this.getOptRepGraForces(g,v,i):this.getRepGraForces(p,50,g,100,o,i);var x=this.updatePos(g,m,d,i);s=x.nodes,d=x.sg,p--,a.tick&&a.tick()}return s},e.prototype.getAttrForces=function(t,e,n,r,i,o,a,s){for(var u=this,c=u.nodes,l=u.preventOverlap,h=u.dissuadeHubs,f=u.mode,d=u.prune,p=0;p0&&(w=x,_=x),s[2*r[g.id]]+=w*b[0],s[2*r[v.id]]-=_*b[0],s[2*r[g.id]+1]+=w*b[1],s[2*r[v.id]+1]-=_*b[1]}}return s},e.prototype.getRepGraForces=function(t,e,n,r,i,o){for(var a=this,s=a.nodes,u=a.preventOverlap,c=a.kr,l=a.kg,h=a.center,f=a.prune,d=s.length,p=0;p0&&(y=c*(o[p]+1)*(o[g]+1)/v),n[2*p]-=y*m[0],n[2*g]+=y*m[0],n[2*p+1]-=y*m[1],n[2*g+1]+=y*m[1]}var b=[s[p].x-h[0],s[p].y-h[1]],x=Math.hypot(b[0],b[1]);b[0]=b[0]/x,b[1]=b[1]/x;var w=l*(o[p]+1);n[2*p]-=w*b[0],n[2*p+1]-=w*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,i=r.nodes,o=r.kg,a=r.center,s=r.prune,u=i.length,h=9e10,f=-9e10,d=9e10,p=-9e10,g=0;g=f&&(f=i[g].x),i[g].x<=h&&(h=i[g].x),i[g].y>=p&&(p=i[g].y),i[g].y<=d&&(d=i[g].y));var m={xmid:(f+h)/2,ymid:(p+d)/2,length:Math.max(f-h,p-d),massCenter:a,mass:u},v=new c.default(m),y=new l.default(v);for(g=0;g1.5*w?1.5*w:n);for(m=0;mE?E:_)*t[2*m],T=_*t[2*m+1];o[m].x+=M,o[m].y+=T}return{nodes:o,sg:n}},e}(a.Base);e.ForceAtlas2Layout=h},51638:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();e.default=n},62732:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),r&&e.edgeForce)e.edgeForce.links(r);else if(r&&!e.edgeForce){f=c.forceLink().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{var u=c.forceManyBody();if(e.nodeStrength&&u.strength(e.nodeStrength),i=c.forceSimulation().nodes(n),e.clustering){var h=(0,l.default)();h.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&h.links(r),n&&h.nodes(n),h.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=h,i.force("group",h)}if(i.force("center",c.forceCenter(e.center[0],e.center[1])).force("charge",u).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=c.forceLink().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}if(e.workerEnabled&&!g()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var p=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),m=1;m<=p;m++)i.tick(),postMessage({nodes:n,currentTick:m,totalTicks:p,type:d.LAYOUT_MESSAGE.TICK},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,i=r.nodeSize,o=r.nodeSpacing,a=r.collideStrength;if(n=(0,h.isNumber)(o)?function(){return o}:(0,h.isFunction)(o)?o:function(){return 0},i)if((0,h.isFunction)(i))e=function(t){return i(t)+n(t)};else if((0,h.isArray)(i)){var s=(i[0]>i[1]?i[0]:i[1])/2;e=function(t){return s+n(t)}}else if((0,h.isNumber)(i)){var u=i/2;e=function(t){return u+n(t)}}else e=function(){return 10};else e=function(t){return t.size?(0,h.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):(0,h.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",c.forceCollide(e).strength(a))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(f.Base);function g(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}e.ForceLayout=p},85717:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(8810),e)},80374:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FruchtermanLayout=void 0;var o=n(62329),a=n(49784),s=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.animate=!0,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=this,i=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),i&&0!==i.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var o=r.center;if(1===i.length)return i[0].x=o[0],i[0].y=o[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var s={},u={};return i.forEach((function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*n.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*n.height),s[t.id]=t,u[t.id]=e})),r.nodeMap=s,r.nodeIdxMap=u,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,s=e.animate,u={};if(a&&n.forEach((function(t){void 0===u[t.cluster]&&(u[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})})),o||!s){for(var c=0;c=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var i=n.edges,o=n.center,s=n.gravity,u=n.speed,c=n.clustering,l=n.height*n.width,h=Math.sqrt(l)/10,f=l/(r.length+1),d=Math.sqrt(f),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,i,p,d,f),c){for(var g in t)t[g].cx=0,t[g].cy=0,t[g].count=0;for(var g in r.forEach((function(e){var n=t[e.cluster];(0,a.isNumber)(e.x)&&(n.cx+=e.x),(0,a.isNumber)(e.y)&&(n.cy+=e.y),n.count++})),t)t[g].cx/=t[g].count,t[g].cy/=t[g].count;var m=n.clusterGravity||s;r.forEach((function(e,n){if((0,a.isNumber)(e.x)&&(0,a.isNumber)(e.y)){var r=t[e.cluster],i=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),o=d*m;p[n].x-=o*(e.x-r.cx)/i,p[n].y-=o*(e.y-r.cy)/i}}))}r.forEach((function(t,e){if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var n=.01*d*s;p[e].x-=n*(t.x-o[0]),p[e].y-=n*(t.y-o[1])}})),r.forEach((function(t,e){if((0,a.isNumber)(t.fx)&&(0,a.isNumber)(t.fy))return t.x=t.fx,void(t.y=t.fy);if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(h*(u/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,o){if(i!==o&&(0,a.isNumber)(r.x)&&(0,a.isNumber)(t.x)&&(0,a.isNumber)(r.y)&&(0,a.isNumber)(t.y)){var s=r.x-t.x,u=r.y-t.y,c=s*s+u*u;if(0===c){c=1;var l=i>o?1:-1;s=.01*l,u=.01*l}var h=n/c;e[i].x+=s*h,e[i].y+=u*h}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var i=(0,a.getEdgeTerminal)(t,"source"),o=(0,a.getEdgeTerminal)(t,"target");if(i&&o){var s=r.nodeIdxMap[i],u=r.nodeIdxMap[o];if(s!==u){var c=r.nodeMap[i],l=r.nodeMap[o];if((0,a.isNumber)(l.x)&&(0,a.isNumber)(c.x)&&(0,a.isNumber)(l.y)&&(0,a.isNumber)(c.y)){var h=l.x-c.x,f=l.y-c.y,d=Math.sqrt(h*h+f*f),p=d*d/n;e[u].x-=h/d*p,e[u].y-=f/d*p,e[s].x+=h/d*p,e[s].y+=f/d*p}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(o.Base);e.FruchtermanLayout=s},13653:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.GForceLayout=void 0;var o=n(62329),a=n(49784),s=function(t,e){return t?(0,a.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},u=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var i=n.center;if(1===r.length)return r[0].x=i[0],r[0].y=i[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var o={},u={};r.forEach((function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*n.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,u[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=u,n.linkDistance=s(n.linkDistance,1),n.nodeStrength=s(n.nodeStrength,1),n.edgeStrength=s(n.edgeStrength,1);var c,l=n.nodeSize;if(n.preventOverlap){var h,f=n.nodeSpacing;h=(0,a.isNumber)(f)?function(){return f}:(0,a.isFunction)(f)?f:function(){return 0},c=l?(0,a.isArray)(l)?function(t){return Math.max(l[0],l[1])+h(t)}:function(t){return l+h(t)}:function(t){return t.size?(0,a.isArray)(t.size)?Math.max(t.size[0],t.size[1])+h(t):(0,a.isObject)(t.size)?Math.max(t.size.width,t.size.height)+h(t):t.size+h(t):10+h(t)}}n.nodeSize=c;var d=n.edges;n.degrees=(0,a.getDegree)(r.length,n.nodeIdxMap,d),n.getMass||(n.getMass=function(t){return t.mass||n.degrees[n.nodeIdxMap[t.id]].all||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(r)if(i||!a){for(var s=0;s=n&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var i=t.x-e[n].x,o=t.y-e[n].y;r+=Math.sqrt(i*i+o*o)})),(r/=t.length)=f)){var d=n.x-e.x,p=n.y-e.y;0===d&&0===p&&(d=.01*Math.random(),p=.01*Math.random());var g=d*d+p*p,m=Math.sqrt(g),v=(m+.1)*o,y=d/m,b=p/m,x=.5*(c(n)+c(e))*i/(v*v),w=r?r(e):1;if(t[2*s]+=y*x,t[2*s+1]+=b*x,t[2*f]-=y*x,t[2*f+1]-=b*x,a&&(l(n)+l(e))/2>m){var _=u*(c(n)+c(e))*.5/g;t[2*s]+=y*_/h,t[2*s+1]+=b*_/h,t[2*f]-=y*_/w,t[2*f+1]-=b*_/w}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,i=n.nodeIdxMap,o=n.linkDistance,s=n.edgeStrength,u=n.nodeSize,c=n.getMass;e.forEach((function(e,n){var l=(0,a.getEdgeTerminal)(e,"source"),h=(0,a.getEdgeTerminal)(e,"target"),f=r[l],d=r[h],p=d.x-f.x,g=d.y-f.y;0===p&&0===g&&(p=.01*Math.random(),g=.01*Math.random());var m=Math.sqrt(p*p+g*g),v=p/m,y=g/m,b=((o(e,f,d)||1+(u(f)+u(d)||0)/2)-m)*s(e),x=i[l],w=i[h],_=c?c(f):1,S=c?c(d):1;t[2*x]-=v*b/_,t[2*x+1]-=y*b/_,t[2*w]+=v*b/S,t[2*w+1]+=y*b/S}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,i=n.gravity,o=n.degrees,s=e.length,u=0;ui.maxSpeed){var c=i.maxSpeed/u;a*=c,s*=c}e[2*r]=a,e[2*r+1]=s}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if((0,a.isNumber)(n.fx)&&(0,a.isNumber)(n.fy))return n.x=n.fx,void(n.y=n.fy);var i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(o.Base);e.GForceLayout=u},87745:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]t.cells)((x=t.small())-1)*(b=t.large())>=t.cells?t.small(x-1):(b-1)*x>=t.cells&&t.large(b-1);else for(;t.cols*t.rows=t.cells?t.large(b+1):t.small(x+1)}if(t.cellWidth=s/t.cols,t.cellHeight=u/t.rows,c&&(t.cellWidth=0,t.cellHeight=0),h||f){var w=(0,o.getFuncByUnknownType)(10,f),_=(0,o.getFuncByUnknownType)(30,d,!1);p.forEach((function(e){e.x&&e.y||(e.x=0,e.y=0);var n,r,i=_(e)||30;(0,o.isArray)(i)?(n=i[0],r=i[1]):(n=i,r=i);var a=void 0!==w?w(e):l,s=n+a,u=r+a;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)}))}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var S=0;S=e&&(t.col=0,t.row++)},e.prototype.getPos=function(t){var e,n,r=this,i=r.begin,o=r.cellWidth,a=r.cellHeight,s=r.id2manPos[t.id];if(s)e=s.col*o+o/2+i[0],n=s.row*a+a/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*o+o/2+i[0],n=r.row*a+a/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},e.prototype.getType=function(){return"grid"},e}(n(62329).Base);e.GridLayout=a},2584:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.ERLayout=e.ForceAtlas2Layout=e.ComboCombinedLayout=e.ComboForceLayout=e.GForceGPULayout=e.FruchtermanGPULayout=e.FruchtermanLayout=e.MDSLayout=e.ConcentricLayout=e.RadialLayout=e.DagreCompoundLayout=e.DagreLayout=e.CircularLayout=e.ForceLayout=e.Force2Layout=e.GForceLayout=e.RandomLayout=e.GridLayout=e.Layouts=e.Layout=void 0;var o=n(94414);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return o.GridLayout}});var a=n(39711);Object.defineProperty(e,"RandomLayout",{enumerable:!0,get:function(){return a.RandomLayout}});var s=n(13653);Object.defineProperty(e,"GForceLayout",{enumerable:!0,get:function(){return s.GForceLayout}});var u=n(6740);Object.defineProperty(e,"Force2Layout",{enumerable:!0,get:function(){return u.Force2Layout}});var c=n(85717);Object.defineProperty(e,"ForceLayout",{enumerable:!0,get:function(){return c.ForceLayout}});var l=n(64885);Object.defineProperty(e,"CircularLayout",{enumerable:!0,get:function(){return l.CircularLayout}});var h=n(20171);Object.defineProperty(e,"DagreLayout",{enumerable:!0,get:function(){return h.DagreLayout}});var f=n(77057);Object.defineProperty(e,"DagreCompoundLayout",{enumerable:!0,get:function(){return f.DagreCompoundLayout}});var d=n(47944);Object.defineProperty(e,"RadialLayout",{enumerable:!0,get:function(){return d.RadialLayout}});var p=n(43281);Object.defineProperty(e,"ConcentricLayout",{enumerable:!0,get:function(){return p.ConcentricLayout}});var g=n(52899);Object.defineProperty(e,"MDSLayout",{enumerable:!0,get:function(){return g.MDSLayout}});var m=n(80374);Object.defineProperty(e,"FruchtermanLayout",{enumerable:!0,get:function(){return m.FruchtermanLayout}});var v=n(87745);Object.defineProperty(e,"FruchtermanGPULayout",{enumerable:!0,get:function(){return v.FruchtermanGPULayout}});var y=n(85194);Object.defineProperty(e,"GForceGPULayout",{enumerable:!0,get:function(){return y.GForceGPULayout}});var b=n(66590);Object.defineProperty(e,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var x=n(63861);Object.defineProperty(e,"ComboCombinedLayout",{enumerable:!0,get:function(){return x.ComboCombinedLayout}});var w=n(48564);Object.defineProperty(e,"ForceAtlas2Layout",{enumerable:!0,get:function(){return w.ForceAtlas2Layout}});var _=n(90441);Object.defineProperty(e,"ERLayout",{enumerable:!0,get:function(){return _.ERLayout}});var S=n(42875);Object.defineProperty(e,"Layout",{enumerable:!0,get:function(){return S.Layout}}),Object.defineProperty(e,"Layouts",{enumerable:!0,get:function(){return S.Layouts}}),i(n(32867),e)},42875:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var r=n(95326),i=n(94414),o=n(39711),a=n(6740),s=n(13653),u=n(85717),c=n(64885),l=n(20171),h=n(47944),f=n(43281),d=n(52899),p=n(80374),g=n(87745),m=n(85194),v=n(66590),y=n(63861),b=n(48564),x=n(90441),w=n(77057),_=n(49784),S=function(){function t(t){var e=(0,r.getLayoutByName)(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null==t?void 0:t.length){var e=1/0,n=[];if(t.forEach((function(t){(0,_.isString)(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(n.push(t),t.layerr[0]?r[0]:b-r[0],_=x-r[1]>r[1]?r[1]:x-r[1];0===w&&(w=b/2),0===_&&(_=x/2);var S=_>w?w:_,E=Math.max.apply(Math,y),M=[];y.forEach((function(e,n){t.unitRadius||(t.unitRadius=S/E),M[n]=e*t.unitRadius})),t.radii=M;var T=t.eIdealDisMatrix();t.eIdealDistances=T;var A=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;iO[1]?O[0]:O[1])+I(t)}:function(t){return O+I(t)}:function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+I(t):(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+I(t):t.size+I(t):10+I(t)};var D={nodes:e,nodeSizeFunc:k,adjMatrix:g,positions:C,radii:M,height:x,width:b,strictRadial:P,focusID:p,iterations:t.maxPreventOverlapIteration||200,k:C.length/4.5},R=new c.default(D);C=R.layout()}return C.forEach((function(t,n){e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],i=t.eIdealDistances||[],o=t.radii||[],a=0;a<=e;a++){var s=a/e;t.oneIteration(s,n,o,i,r)}},e.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(s,u){var c=l(s,[0,0]),h=0===c?0:1/c;if(u!==a){var f=0,d=0,p=0;e.forEach((function(t,e){if(u!==e){var n=l(s,t),o=0===n?0:1/n,a=r[e][u];p+=i[u][e],f+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),d+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}}));var g=0===n[u]?0:1/n[u];p*=o,p+=t*g*g,f*=o,f+=t*g*s[0]*h,s[0]=f/p,d*=o,d+=t*g*s[1]*h,s[1]=d/p}}))},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var n=t.distances,r=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,s=[];return n&&n.forEach((function(n,u){var c=[];n.forEach((function(n,s){if(u===s)c.push(0);else if(i[u]===i[s])if("data"===t.sortBy)c.push(n*(Math.abs(u-s)*t.sortStrength)/(i[u]/o));else if(t.sortBy){var l=e[u][t.sortBy]||0,h=e[s][t.sortBy]||0;(0,a.isString)(l)&&(l=l.charCodeAt(0)),(0,a.isString)(h)&&(h=h.charCodeAt(0)),c.push(n*(Math.abs(l-h)*t.sortStrength)/(i[u]/o))}else c.push(n*r/(i[u]/o));else{var f=(r+o)/2;c.push(n*f)}})),s.push(c)})),s},e.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;in?t[e][r]:n);return n},e.prototype.getType=function(){return"radial"},e}(s.Base);e.RadialLayout=h},6290:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,i=t.width/10;t.maxDisplace=i,t.disp=n;for(var o=0;ou?1:-1;c=.01*f,l=.01*f}if(hMath.PI/2&&(l-=Math.PI/2,s*=-1,u*=-1);var h=Math.cos(l)*c;t.x=s*h,t.y=u*h}));var s=t.radii;e.forEach((function(t,u){if(u!==o){var c=Math.sqrt(n[u].x*n[u].x+n[u].y*n[u].y);if(c>0&&u!==o){var l=Math.min(a*(r/800),c);if(t[0]+=n[u].x/c*l,t[1]+=n[u].y/c*l,i){var h=t[0]-e[o][0],f=t[1]-e[o][1],d=Math.sqrt(h*h+f*f);h=h/d*s[u],f=f/d*s[u],t[0]=e[o][0]+h,t[1]=e[o][1]+f}}}}))},t}();e.default=n},39711:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(n(62329).Base);e.RandomLayout=o},32867:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},95326:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=n(62329),a=n(49784),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),(0,a.isObject)(e)){var n=function(t){function n(n){var r,i,o=r=t.call(this)||this,a={},s=Object.assign({},o.getDefaultCfg(),(null===(i=e.getDefaultCfg)||void 0===i?void 0:i.call(e))||{});return Object.assign(a,s,e,n),Object.keys(a).forEach((function(t){var e=a[t];o[t]=e})),r}return i(n,t),n}(o.Base);s.set(t,n)}else s.set(t,e);return s.get(t)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},85087:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},78732:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFuncByUnknownType=e.getFunc=e.isFunction=void 0;var r=n(49784),i=n(30627);e.isFunction=function(t){return"function"==typeof t};e.getFunc=function(t,e,n){return n||((0,i.isNumber)(t)?function(){return t}:function(){return e})};e.getFuncByUnknownType=function(t,n,o){return void 0===o&&(o=!0),n||0===n?(0,e.isFunction)(n)?n:(0,i.isNumber)(n)?function(){return n}:(0,r.isArray)(n)?function(){if(o){var e=Math.max.apply(Math,n);return isNaN(e)?t:e}return n}:(0,r.isObject)(n)?function(){if(o){var e=Math.max(n.width,n.height);return isNaN(e)?t:e}return[n.width,n.height]}:function(){return t}:function(e){return e.size?(0,r.isArray)(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:(0,r.isObject)(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}}},48835:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToTextureData=e.attributesToTextureData=e.buildTextureDataWithTwoEdgeAttr=e.buildTextureData=e.proccessToFunc=void 0;var r=n(49784),i=n(80628);e.proccessToFunc=function(t,e){return t?(0,r.isNumber)(t)?function(){return t}:t:function(){return e||1}};e.buildTextureData=function(t,e){var n=[],r=[],o={},a=0;for(a=0;ae[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e};e.getAdjMatrix=function(t,n){var r=t.nodes,i=t.edges,o=[],a={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach((function(t,e){a[t.id]=e;o.push([])})),null==i||i.forEach((function(t){var r=(0,e.getEdgeTerminal)(t,"source"),i=(0,e.getEdgeTerminal)(t,"target"),s=a[r],u=a[i];void 0!==s&&void 0!==u&&(o[s][u]=1,n||(o[u][s]=1))})),o};e.scaleMatrix=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n};var a=function(t,e){if(t&&t.children)for(var n=t.children.length-1;n>=0;n--)if(!a(t.children[n],e))return;return!!e(t)};e.traverseTreeUp=function(t,e){"function"==typeof e&&a(t,e)};e.getLayoutBBox=function(t){var e=1/0,n=1/0,o=-1/0,a=-1/0;return t.forEach((function(t){var s=t.size;(0,r.isArray)(s)?1===s.length&&(s=[s[0],s[0]]):(0,i.isNumber)(s)?s=[s,s]:(void 0===s||isNaN(s))&&(s=[30,30]);var u=[s[0]/2,s[1]/2],c=t.x-u[0],l=t.x+u[0],h=t.y-u[1],f=t.y+u[1];e>c&&(e=c),n>h&&(n=h),oi&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}(n),r},c=/rgba?\(([\s.,0-9]+)\)/;var l=u((function(t){if("#"===t[0]&&7===t.length)return t;var e;a||((e=document.createElement("i")).title="Web Colour Picker",e.style.display="none",document.body.appendChild(e),a=e),a.style.color=t;var n=document.defaultView.getComputedStyle(a,"").getPropertyValue("color");return n=o(c.exec(n)[1].split(/\s*,\s*/).map((function(t){return Number(t)})))}),(function(t){return t}),256);function h(t,e,n,r){return t[r]+(e[r]-t[r])*n}function f(t){var e=("string"==typeof t?t.split("-"):t).map((function(t){return r(-1===t.indexOf("#")?l(t):t)}));return function(t){return function(t,e){var n=isNaN(Number(e))||e<0?0:e>1?1:Number(e),r=t.length-1,i=Math.floor(r*n),a=r*n-i,s=t[i],u=i===r?s:t[i+1];return o([h(s,u,a,0),h(s,u,a,1),h(s,u,a,2)])}(e,t)}}var d=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,p=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,g=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function m(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,n=void 0;if("l"===t[0]){var r=+(i=d.exec(t))[1]+90;n=i[2],e="linear-gradient("+r+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",n=(i=p.exec(t))[4]}var o=n.match(g);return o.forEach((function(t,n){var r=t.split(":");e+=r[1]+" "+100*Number(r[0])+"%",n!==o.length-1&&(e+=", ")})),e+=")"}return t}var v=n(35600);function y(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return v.fromRotation(r,n),v.multiply(t,r,e)}function b(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return v.fromScaling(r,n),v.multiply(t,r,e)}function x(t,e,n){return v.multiply(t,n,e)}function w(t,e){for(var n,r,i,o,a=t?[].concat(t):[1,0,0,0,1,0,0,0,1],s=0,u=e.length;s=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function M(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function T(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var n="number"==typeof e&&e>=1?Math.pow(10,e):1;return t.map((function(t){var r=t.slice(1).map(Number).map((function(t){return e?Math.round(t*n)/n:Math.round(t)}));return[t[0]].concat(r)}))}(t,e).map((function(t){return t[0]+t.slice(1).join(" ")})).join("")}var A=function(){return A=Object.assign||function(t){for(var e,n=1,r=arguments.length;n7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var O={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function P(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return O[e]===t.length-1&&"achlmqstvz".includes(e)}))}function I(t){return P(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function L(t){return I(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function D(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=O[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,O[n]))),O[n]););}function R(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function z(t){return t>=48&&t<=57||43===t||45===t||46===t}function F(t){return t>=48&&t<=57}function B(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),F(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function U(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=O[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,j(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?B(t):R(t),t.err.length)return;t.data.push(t.param),j(t),t.index=t.max)break;if(!z(n.charCodeAt(t.index)))break}D(t)}else D(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var V=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function H(t){if(P(t))return[].concat(t);var e=new V(t);for(j(e);e.index1&&(v*=T=Math.sqrt(T),y*=T);var A=v*v,C=y*y,k=(o===a?-1:1)*Math.sqrt(Math.abs((A*C-A*M*M-C*E*E)/(A*M*M+C*E*E)));d=k*v*M/y+(g+b)/2,p=k*-y*E/v+(m+x)/2,h=Math.asin(((m-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),f=Math.asin(((x-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),h=gf&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var N=f-h;if(Math.abs(N)>w){var O=f,P=b,I=x;f=h+w*(a&&f>h?1:-1),S=q(b=d+v*Math.cos(f),x=p+y*Math.sin(f),v,y,i,0,a,P,I,[f,O,d,p])}N=f-h;var L=Math.cos(h),D=Math.sin(h),R=Math.cos(f),z=Math.sin(f),F=Math.tan(N/4),B=4/3*v*F,j=4/3*y*F,U=[g,m],V=[g+B*D,m-j*L],H=[b+B*z,x-j*R],G=[b,x];if(V[0]=2*U[0]-V[0],V[1]=2*U[1]-V[1],c)return V.concat(H,G,S);for(var Z=[],W=0,X=(S=V.concat(H,G,S)).length;W=o)a={x:n,y:r};else{var s=X([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function rt(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function it(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,p=Math.PI,g=l(n),m=l(r),v=(i%360+360)%360*(p/180);if(t===s&&e===u)return{x:t,y:e};if(0===g||0===m)return nt(t,e,s,u,c).point;var y=(t-s)/2,b=(e-u)/2,x={x:f(v)*y+h(v)*b,y:-h(v)*y+f(v)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=d(w),m*=d(w));var _=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(m,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(m,2)*Math.pow(x.x,2)),S=(o!==a?1:-1)*d(_=_<0?0:_),E=S*(g*x.y/m),M=S*(-m*x.x/g),T=f(v)*E-h(v)*M+(t+s)/2,A=h(v)*E+f(v)*M+(e+u)/2,C={x:(x.x-E)/g,y:(x.y-M)/m},k=rt({x:1,y:0},C),N=rt(C,{x:(-x.x-E)/g,y:(-x.y-M)/m});!a&&N>0?N-=2*p:a&&N<0&&(N+=2*p);var O=k+(N%=2*p)*c,P=g*f(O),I=m*h(O);return{x:f(v)*P-h(v)*I+T,y:h(v)*P+f(v)*I+A}}function ot(t,e,n,r,i,o,a,s,u,c,l){var h,f=l.bbox,d=void 0===f||f,p=l.length,g=void 0===p||p,m=l.sampleSize,v=void 0===m?30:m,y="number"==typeof c,b=t,x=e,w=0,_=[b,x,w],S=[b,x],E={x:0,y:0},M=[{x:b,y:x}];y&&c<=0&&(E={x:b,y:x});for(var T=0;T<=v;T+=1){if(b=(h=it(t,e,n,r,i,o,a,s,u,T/v)).x,x=h.y,d&&M.push({x:b,y:x}),g&&(w+=et(S,[b,x])),S=[b,x],y&&w>=c&&c>_[2]){var A=(w-c)/(w-_[2]);E={x:S[0]*(1-A)+_[0]*A,y:S[1]*(1-A)+_[1]*A}}_=[b,x,w]}return y&&c>=w&&(E={x:s,y:u}),{length:w,point:E,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function at(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function st(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,f=void 0===h||h,d=c.length,p=void 0===d||d,g=c.sampleSize,m=void 0===g?10:g,v="number"==typeof u,y=t,b=e,x=0,w=[y,b,x],_=[y,b],S={x:0,y:0},E=[{x:y,y:b}];v&&u<=0&&(S={x:y,y:b});for(var M=0;M<=m;M+=1){if(y=(l=at(t,e,n,r,i,o,a,s,M/m)).x,b=l.y,f&&E.push({x:y,y:b}),p&&(x+=et(_,[y,b])),_=[y,b],v&&x>=u&&u>w[2]){var T=(x-u)/(x-w[2]);S={x:_[0]*(1-T)+w[0]*T,y:_[1]*(1-T)+w[1]*T}}w=[y,b,x]}return v&&u>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function ut(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function ct(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,m=t,v=e,y=0,b=[m,v,y],x=[m,v],w={x:0,y:0},_=[{x:m,y:v}];g&&a<=0&&(w={x:m,y:v});for(var S=0;S<=p;S+=1){if(m=(u=ut(t,e,n,r,i,o,S/p)).x,v=u.y,l&&_.push({x:m,y:v}),f&&(y+=et(x,[m,v])),x=[m,v],g&&y>=a&&a>b[2]){var E=(y-a)/(y-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[m,v,y]}return g&&a>=y&&(w={x:i,y:o}),{length:y,point:w,min:{x:Math.min.apply(null,_.map((function(t){return t.x}))),y:Math.min.apply(null,_.map((function(t){return t.y})))},max:{x:Math.max.apply(null,_.map((function(t){return t.x}))),y:Math.max.apply(null,_.map((function(t){return t.y})))}}}function lt(t,e,n){for(var r,i,o,a,s,u,c,l,h,f=W(t),d="number"==typeof e,p=[],g=0,m=0,v=0,y=0,b=[],x=[],w=0,_={x:0,y:0},S=_,E=_,M=_,T=0,A=0,C=f.length;A=e&&(M=E),x.push(S),b.push(_),T+=w,g=(u="Z"!==l?h.slice(-2):[v,y])[0],m=u[1];return d&&e>=T&&(M={x:g,y:m}),{length:T,point:M,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function ht(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=lt(t,void 0,A(A({},e),{length:!1})),r=n.min,i=r.x,o=r.y,a=n.max,s=a.x,u=a.y,c=s-i,l=u-o;return{width:c,height:l,x:i,y:o,x2:s,y2:u,cx:i+c/2,cy:o+l/2,cz:Math.max(c,l)+Math.min(c,l)/2}}function ft(t,e){return lt(t,void 0,A(A({},e),{bbox:!1,length:!0})).length}function dt(t,e){if(!t)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=lt(t,void 0,A(A({},e),{bbox:!0,length:!0})),r=n.length,i=n.min,o=i.x,a=i.y,s=n.max,u=s.x,c=s.y,l=u-o,h=c-a;return{length:r,width:l,height:h,x:o,y:a,x2:u,y2:c,cx:o+l/2,cy:a+h/2,cz:Math.max(l,h)+Math.min(l,h)/2}}function pt(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=et(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function gt(t){var e=0,n=0,r=0;return Q(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],u=o[2],c=o[3],l=o[4],h=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,u,c,l,h),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}function mt(t){return gt(t)>=0}function vt(t,e,n){return lt(t,e,A(A({},n),{bbox:!1,length:!0})).point}function yt(t,e){for(var n,r,i,o,a=H(t),s=W(a),u=ft(a),c=function(t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},l=8,h=0,f=0,d=1/0,p=0;p<=u;p+=l)(h=c(n=vt(s,p))).5;)v=c(i=vt(s,g=f-l)),y=c(o=vt(s,m=f+l)),g>=0&&v=i)return s=i-(a=ft(r=n.slice(0,-1))),{segment:n[o],index:o,length:s,lengthAtSegment:a};for(var h=[];o>0;)u=r[o],s=i-(a=ft(r=r.slice(0,-1))),i=a,h.push({segment:u,index:o,length:s,lengthAtSegment:a}),o-=1;return h.find((function(t){return t.lengthAtSegment<=e}))}(a,f);return{closest:r,distance:Math.sqrt(d),segment:b}}function bt(t,e){var n=yt(t,e).distance;return Math.abs(n)<.001}function xt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?st(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=X(n,r,e),s=X(r,i,e),u=X(i,o,e),c=X(a,s,e),l=X(s,u,e),h=X(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function wt(t,e,n){var r=xt(t),i=xt(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),f=[c,l],d=[h-o,h-a],p=0,g=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=f[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:wt(g[0],g[1],h)}var _t=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},St=function(t,e){return!!_t(t)&&t.indexOf(e)>-1},Et=function(t,e){if(!_t(t))return t;for(var n=[],r=0;r-1;)Wt.call(t,o,1);return t},Xt=Array.prototype.splice,Kt=function(t,e){if(!_t(t))return[];for(var n=t?e.length:0,r=n-1;n--;){var i=void 0,o=e[n];n!==r&&o===i||(i=o,Xt.call(t,o,1))}return t},$t=function(t,e,n){if(!kt(t)&&!Dt(t))return t;var r=n;return Ot(t,(function(t,n){r=e(r,t,n)})),r},Qt=function(t,e){var n=[];if(!_t(t))return n;for(var r=-1,i=[],o=t.length;++re[i])return 1;if(t[i]n?n:t},xe=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},we=function(t){return Ct(t,"Number")},_e=function(t){return we(t)&&t%1!=0},Se=function(t){return we(t)&&t%2==0},Ee=Number.isInteger?Number.isInteger:function(t){return we(t)&&t%1==0},Me=function(t){return we(t)&&t<0};function Te(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)0},ke=function(t,e){if(kt(t)){for(var n,r=-1/0,i=0;ir&&(n=o,r=a)}return n}},Ne=function(t,e){if(kt(t)){for(var n,r=1/0,i=0;ie?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},Dn=function(t){return _t(t)?Array.prototype.slice.call(t):[]},Rn={},zn=function(t){return Rn[t=t||"g"]?Rn[t]+=1:Rn[t]=1,t+Rn[t]},Fn=function(){},Bn=function(t){return t};function jn(t){return Tt(t)?0:_t(t)?t.length:Object.keys(t).length}var Un=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();function Vn(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Hn(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Gn(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o0!=Vn(s[1]-n)>0&&Vn(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var Zn=function(t,e,n){return t>=e&&t<=n};function Wn(t){for(var e=[],n=t.length,r=0;r1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function Yn(t,e){var n=!1;return t.forEach((function(t){if(function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,c=r.y-n.y,l=a*c-s*u,h=null;if(l*l>.001*(a*a+s*s)*(u*u+c*c)){var f=(i*c-o*u)/l,d=(i*s-o*a)/l;Zn(f,0,1)&&Zn(d,0,1)&&(h={x:t.x+f*a,y:t.y+f*s})}return h}(t.from,t.to,e.from,e.to))return n=!0,!1})),n}function qn(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,n),maxY:Math.max.apply(null,n)}}function Xn(t,e){if(t.length<2||e.length<2)return!1;var n,r,i=qn(t),o=qn(e);if(n=i,(r=o).minX>n.maxX||r.maxXn.maxY||r.maxY1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,a=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],u=r+1;us&&(s=t[u]);return s}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,a=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],u=r+1;u1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!i(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=a(t),s=o(t);if(r===s)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var u=n.min,c=void 0===u?n.autoMinMax?r:0:u,l=n.max,h=void 0===l?n.autoMinMax?s:1:l;if(c>=h)throw new RangeError("min option must be smaller than max option");for(var f=(h-c)/(s-r),d=0;dr)throw new RangeError("Row index out of range")}function d(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function p(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function g(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function m(t,e,n){return{row:v(t,e),column:y(t,n)}}function v(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");if(e.some((e=>e<0||e>=t.rows)))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function y(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some((e=>e<0||e>=t.columns)))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function b(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(w("startRow",e),w("endRow",n),w("startColumn",r),w("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function x(t,e=0){let n=[];for(let r=0;r=i)throw new RangeError("min must be smaller than max");let a=i-r,s=new E(t,e);for(let n=0;nn?(i=!0,n=e):(r=!1,i=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;tn?(i=!0,n=e):(r=!1,i=!0);for(let n=e+1;nt.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let i=t.get(e,n);for(let r=n;r=0;)if(0===t.maxRow(r))r--;else{let i=0,o=!1;for(;it&&(t=this.get(e,n));return t}maxIndex(){let t=this.get(0,0),e=[0,0];for(let n=0;nt&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(){let t=this.get(0,0);for(let e=0;ee&&(e=this.get(t,n));return e}maxRowIndex(t){f(this,t);let e=this.get(t,0),n=[t,0];for(let r=1;re&&(e=this.get(t,r),n[1]=r);return n}minRow(t){f(this,t);let e=this.get(t,0);for(let n=1;ne&&(e=this.get(n,t));return e}maxColumnIndex(t){d(this,t);let e=this.get(0,t),n=[0,t];for(let r=1;re&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){d(this,t);let e=this.get(0,t);for(let n=1;n=n)throw new RangeError("min must be smaller than max");let r=new E(this.rows,this.columns);for(let t=0;t=n)throw new RangeError("min must be smaller than max");let r=new E(this.rows,this.columns);for(let t=0;tn||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new E(t.length,n-e+1);for(let i=0;i=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);r.set(i,o-e,this.get(t[i],o))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new E(n-e+1,t.length);for(let i=0;i=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);r.set(o-e,i,this.get(o,t[i]))}return r}setSubMatrix(t,e,n){b(this,e,e+(t=E.checkMatrix(t)).rows-1,n,n+t.columns-1);for(let r=0;r0){if(this.data=[],!(Number.isInteger(e)&&e>0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;tMath.abs(u[i])&&(i=e);if(i!==n){for(r=0;r=0;i--){for(r=0;re?r.set(i,e,t.get(i,e)):i===e?r.set(i,e,1):r.set(i,e,0);return r}get upperTriangularMatrix(){let t=this.LU,e=t.rows,n=t.columns,r=new E(e,n);for(let i=0;iMath.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class j{constructor(t){let e,n,r,i,o=(t=R.checkMatrix(t)).clone(),a=t.rows,s=t.columns,u=new Float64Array(s);for(r=0;r=0;o--){for(i=0;i=0;n--){for(t=0;t=0;t--)if(0!==d[t]){for(let e=t+1;e=0;t--){if(t0;){let t,e;for(t=_-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+T*Math.abs(d[t]+Math.abs(d[t+1]));if(Math.abs(m[t])<=e||Number.isNaN(m[t])){m[t]=0;break}}if(t===_-2)e=4;else{let n;for(n=_-1;n>=t&&n!==t;n--){let e=(n!==_?Math.abs(m[n]):0)+(n!==t+1?Math.abs(m[n-1]):0);if(Math.abs(d[n])<=T*e){d[n]=0;break}}n===t?e=3:n===_-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=m[_-2];m[_-2]=0;for(let n=_-2;n>=t;n--){let i=B(d[n],e),o=d[n]/i,a=e/i;if(d[n]=i,n!==t&&(e=-a*m[n-1],m[n-1]=o*m[n-1]),c)for(let t=0;t=d[t+1]);){let e=d[t];if(d[t]=d[t+1],d[t+1]=e,c&&te&&i.set(o,n,t.get(o,n)/this.s[n]);let o=this.U,a=o.rows,s=o.columns,u=new E(n,a);for(let t=0;tt&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return E.diag(this.s)}}function V(t,e=!1){return t=R.checkMatrix(t),e?new U(t).inverse():H(t,E.eye(t.rows))}function H(t,e,n=!1){return t=R.checkMatrix(t),e=R.checkMatrix(e),n?new U(t).solve(e):t.isSquare()?new F(t).solve(e):new j(t).solve(e)}function G(t){if((t=E.checkMatrix(t)).isSquare()){let e,n,r,i;if(2===t.columns)return e=t.get(0,0),n=t.get(0,1),r=t.get(1,0),i=t.get(1,1),e*i-n*r;if(3===t.columns){let i,o,a;return i=new P(t,[1,2],[1,2]),o=new P(t,[1,2],[0,2]),a=new P(t,[1,2],[0,1]),e=t.get(0,0),n=t.get(0,1),r=t.get(0,2),e*G(i)-n*G(o)+r*G(a)}return new F(t).determinant}throw Error("determinant can only be calculated for a square matrix")}function Z(t,e){let n=[];for(let r=0;ri)return new Array(e.rows+1).fill(0);{let t=e.addRow(n,[0]);for(let e=0;ee?o[t]=1/o[t]:o[t]=0;return i.mmul(E.diag(o).mmul(r.transpose()))}function X(t,e=t,n={}){t=new E(t);let r=!1;if("object"!=typeof e||E.isMatrix(e)||Array.isArray(e)?e=new E(e):(n=e,e=t,r=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0}=n;i&&(t=t.center("column"),r||(e=e.center("column")));const o=t.transpose().mmul(e);for(let e=0;e0;s--){for(h=0,a=0,c=0;c0&&(o=-o),e[s]=h*o,a-=i*o,n[s-1]=i-o,u=0;uc){x=0;do{for(x+=1,i=n[c],h=(n[c+1]-i)/(2*e[c]),f=B(h,1),h<0&&(f=-f),n[c]=e[c]/(h+f),n[c+1]=e[c]*(h+f),d=n[c+1],o=i-n[c],a=c+2;a=c;a--)for(m=g,g=p,b=y,i=p*e[a],o=p*h,f=B(h,e[a]),e[a+1]=y*f,y=e[a]/f,p=h/f,h=p*n[a]-y*i,n[a+1]=o+y*(p*i+y*n[a]),u=0;uS*_)}n[c]=n[c]+w,e[c]=0}for(a=0;a=c;s--)n[s]=e.get(s,c-1)/l,a+=n[s]*n[s];for(o=Math.sqrt(a),n[c]>0&&(o=-o),a-=n[c]*o,n[c]=n[c]-o,u=c;u=c;s--)i+=n[s]*e.get(s,u);for(i/=a,s=c;s<=f;s++)e.set(s,u,e.get(s,u)-i*n[s])}for(s=0;s<=f;s++){for(i=0,u=f;u>=c;u--)i+=n[u]*e.get(s,u);for(i/=a,u=c;u<=f;u++)e.set(s,u,e.get(s,u)-i*n[u])}n[c]=l*n[c],e.set(c,c-1,l*o)}}for(s=0;s=h+1;c--)if(0!==e.get(c,c-1)){for(s=c+1;s<=f;s++)n[s]=e.get(s,c-1);for(u=c;u<=f;u++){for(o=0,s=c;s<=f;s++)o+=n[s]*r.get(s,u);for(o=o/n[c]/e.get(c,c-1),s=c;s<=f;s++)r.set(s,u,r.get(s,u)+o*n[s])}}}(o,t,e,a),function(t,e,n,r,i){let o,a,s,u,c,l,h,f,d,p,g,m,v,y,b,x=t-1,w=0,_=t-1,S=Number.EPSILON,E=0,M=0,T=0,A=0,C=0,k=0,N=0,O=0;for(o=0;o_)&&(n[o]=i.get(o,o),e[o]=0),a=Math.max(o-1,0);a=w;){for(u=x;u>w&&(k=Math.abs(i.get(u-1,u-1))+Math.abs(i.get(u,u)),0===k&&(k=M),!(Math.abs(i.get(u,u-1))=0){for(N=T>=0?T+N:T-N,n[x-1]=f+N,n[x]=n[x-1],0!==N&&(n[x]=f-h/N),e[x-1]=0,e[x]=0,f=i.get(x,x-1),k=Math.abs(f)+Math.abs(N),T=f/k,A=N/k,C=Math.sqrt(T*T+A*A),T/=C,A/=C,a=x-1;a0)){for(k=Math.sqrt(k),d=u&&(N=i.get(c,c),C=f-N,k=d-N,T=(C*k-h)/i.get(c+1,c)+i.get(c,c+1),A=i.get(c+1,c+1)-N-C-k,C=i.get(c+2,c+1),k=Math.abs(T)+Math.abs(A)+Math.abs(C),T/=k,A/=k,C/=k,c!==u)&&!(Math.abs(i.get(c,c-1))*(Math.abs(A)+Math.abs(C))c+2&&i.set(o,o-3,0);for(s=c;s<=x-1&&(y=s!==x-1,s!==c&&(T=i.get(s,s-1),A=i.get(s+1,s-1),C=y?i.get(s+2,s-1):0,f=Math.abs(T)+Math.abs(A)+Math.abs(C),0!==f&&(T/=f,A/=f,C/=f)),0!==f);s++)if(k=Math.sqrt(T*T+A*A+C*C),T<0&&(k=-k),0!==k){for(s!==c?i.set(s,s-1,-k*f):u!==c&&i.set(s,s-1,-i.get(s,s-1)),T+=k,f=T/k,d=A/k,N=C/k,A/=T,C/=T,a=s;a=0;x--)if(T=n[x],A=e[x],0===A)for(u=x,i.set(x,x,1),o=x-1;o>=0;o--){for(h=i.get(o,o)-T,C=0,a=u;a<=x;a++)C+=i.get(o,a)*i.get(a,x);if(e[o]<0)N=h,k=C;else if(u=o,0===e[o]?i.set(o,x,0!==h?-C/h:-C/(S*M)):(f=i.get(o,o+1),d=i.get(o+1,o),A=(n[o]-T)*(n[o]-T)+e[o]*e[o],l=(f*k-N*C)/A,i.set(o,x,l),i.set(o+1,x,Math.abs(f)>Math.abs(N)?(-C-h*l)/f:(-k-d*l)/N)),l=Math.abs(i.get(o,x)),S*l*l>1)for(a=o;a<=x;a++)i.set(a,x,i.get(a,x)/l)}else if(A<0)for(u=x-1,Math.abs(i.get(x,x-1))>Math.abs(i.get(x-1,x))?(i.set(x-1,x-1,A/i.get(x,x-1)),i.set(x-1,x,-(i.get(x,x)-T)/i.get(x,x-1))):(b=Q(0,-i.get(x-1,x),i.get(x-1,x-1)-T,A),i.set(x-1,x-1,b[0]),i.set(x-1,x,b[1])),i.set(x,x-1,0),i.set(x,x,1),o=x-2;o>=0;o--){for(p=0,g=0,a=u;a<=x;a++)p+=i.get(o,a)*i.get(a,x-1),g+=i.get(o,a)*i.get(a,x);if(h=i.get(o,o)-T,e[o]<0)N=h,C=p,k=g;else if(u=o,0===e[o]?(b=Q(-p,-g,h,A),i.set(o,x-1,b[0]),i.set(o,x,b[1])):(f=i.get(o,o+1),d=i.get(o+1,o),m=(n[o]-T)*(n[o]-T)+e[o]*e[o]-A*A,v=2*(n[o]-T)*A,0===m&&0===v&&(m=S*M*(Math.abs(h)+Math.abs(A)+Math.abs(f)+Math.abs(d)+Math.abs(N))),b=Q(f*C-N*p+A*g,f*k-N*g-A*p,m,v),i.set(o,x-1,b[0]),i.set(o,x,b[1]),Math.abs(f)>Math.abs(N)+Math.abs(A)?(i.set(o+1,x-1,(-p-h*i.get(o,x-1)+A*i.get(o,x))/f),i.set(o+1,x,(-g-h*i.get(o,x)-A*i.get(o,x-1))/f)):(b=Q(-C-d*i.get(o,x-1),-k-d*i.get(o,x),N,A),i.set(o+1,x-1,b[0]),i.set(o+1,x,b[1]))),l=Math.max(Math.abs(i.get(o,x-1)),Math.abs(i.get(o,x))),S*l*l>1)for(a=o;a<=x;a++)i.set(a,x-1,i.get(a,x-1)/l),i.set(a,x,i.get(a,x)/l)}for(o=0;o_)for(a=o;a=w;a--)for(o=w;o<=_;o++){for(N=0,s=w;s<=Math.min(a,_);s++)N+=r.get(o,s)*i.get(s,a);r.set(o,a,N)}}(o,u,s,a,t)}this.n=o,this.e=u,this.d=s,this.V=a}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let t,e,n=this.n,r=this.e,i=this.d,o=new E(n,n);for(t=0;t0?o.set(t,t+1,r[t]):r[t]<0&&o.set(t,t-1,r[t])}return o}}function Q(t,e,n,r){let i,o;return Math.abs(n)>Math.abs(r)?(i=r/n,o=n+i*r,[(t+i*e)/o,(e-i*t)/o]):(i=n/r,o=r+i*n,[(i*t+e)/o,(i*e-t)/o])}class J{constructor(t){if(!(t=R.checkMatrix(t)).isSymmetric())throw new Error("Matrix is not symmetric");let e,n,r,i=t,o=i.rows,a=new E(o,o),s=!0;for(n=0;n0,a.set(n,n,Math.sqrt(Math.max(t,0))),r=n+1;r=0;o--)for(i=0;io;e++)c=t.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),c=c.div(c.norm()),s=t.mmul(c).div(c.transpose().mmul(c).get(0,0)),e>0&&(h=s.clone().sub(l).pow(2).sum()),l=s.clone(),n?(u=n.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),u=u.div(u.norm()),a=n.mmul(u).div(u.transpose().mmul(u).get(0,0))):a=s;if(n){let e=t.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0));e=e.div(e.norm());let r=t.clone().sub(s.clone().mmul(e.transpose())),i=a.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),o=n.clone().sub(s.clone().mulS(i.get(0,0)).mmul(u.transpose()));this.t=s,this.p=e.transpose(),this.w=c.transpose(),this.q=u,this.u=a,this.s=s.transpose().mmul(s),this.xResidual=r,this.yResidual=o,this.betas=i}else this.w=c.transpose(),this.s=s.transpose().mmul(s).sqrt(),this.t=r?s.clone().div(this.s.get(0,0)):s,this.xResidual=t.sub(s.mmul(c.transpose()))}}},31278:function(t,e,n){"use strict";var r=n(64530);function i(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.mat3.fromTranslation(i,n),r.mat3.multiply(t,i,e)}function o(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.mat3.fromRotation(i,n),r.mat3.multiply(t,i,e)}function a(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.mat3.fromScaling(i,n),r.mat3.multiply(t,i,e)}function s(t,e){return t[0]*e[1]-e[0]*t[1]}e.vs=function(t,e){for(var n,s,u,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],l=0,h=e.length;l-1},o=function(t,e){if(!r(t))return t;for(var n=[],i=0;i-1;)C.call(t,o,1);return t},O=Array.prototype.splice,P=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var o=void 0,a=e[n];n!==i&&a===o||(o=a,O.call(t,a,1))}return t},I=function(t,e,n){if(!h(t)&&!v(t))return t;var r=n;return d(t,(function(t,n){r=e(r,t,n)})),r},L=function(t,e){var n=[];if(!r(t))return n;for(var i=-1,o=[],a=t.length;++ie[i])return 1;if(t[i]n?n:t},nt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},rt=function(t){return u(t,"Number")},it=function(t){return rt(t)&&t%1!=0},ot=function(t){return rt(t)&&t%2==0},at=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0},st=function(t){return rt(t)&&t<0};function ut(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)0},ht=function(t,e){if(h(t)){for(var n,r=-1/0,i=0;ir&&(n=o,r=a)}return n}},ft=function(t,e){if(h(t)){for(var n,r=1/0,i=0;ie?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},me=function(t){return r(t)?Array.prototype.slice.call(t):[]},ve={},ye=function(t){return ve[t=t||"g"]?ve[t]+=1:ve[t]=1,t+ve[t]},be=function(){},xe=function(t){return t};function we(t){return l(t)?0:r(t)?t.length:Object.keys(t).length}var _e,Se=n(70655),Ee=$t((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return _e||(_e=document.createElement("canvas").getContext("2d")),_e.font=[o,a,i,n+"px",r].join(" "),_e.measureText(D(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),(0,Se.pr)([t],_t(e)).join("")})),Me=function(t,e,n,r){void 0===r&&(r="...");var i,o,a=Ee(r,n),s=D(t)?t:Et(t),u=e,c=[];if(Ee(t,n)<=e)return t;for(;i=s.substr(0,16),!((o=Ee(i,n))+a>u&&o>u);)if(c.push(i),u-=o,!(s=s.substr(16)))return c.join("");for(;i=s.substr(0,1),!((o=Ee(i,n))+a>u);)if(c.push(i),u-=o,!(s=s.substr(1)))return c.join("");return""+c.join("")+r},Te=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},86500:function(t,e,n){"use strict";n.d(e,{T6:function(){return d},VD:function(){return p},WE:function(){return c},Yt:function(){return g},lC:function(){return o},py:function(){return u},rW:function(){return i},s:function(){return h},ve:function(){return s},vq:function(){return l}});var r=n(90279);function i(t,e,n){return{r:255*(0,r.sh)(t,255),g:255*(0,r.sh)(e,255),b:255*(0,r.sh)(n,255)}}function o(t,e,n){t=(0,r.sh)(t,255),e=(0,r.sh)(e,255),n=(0,r.sh)(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),a=0,s=0,u=(i+o)/2;if(i===o)s=0,a=0;else{var c=i-o;switch(s=u>.5?c/(2-i-o):c/(i+o),i){case t:a=(e-n)/c+(e1&&(n-=1),n<1/6?t+6*n*(e-t):n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function s(t,e,n){var i,o,s;if(t=(0,r.sh)(t,360),e=(0,r.sh)(e,100),n=(0,r.sh)(n,100),0===e)o=n,s=n,i=n;else{var u=n<.5?n*(1+e):n+e-n*e,c=2*n-u;i=a(c,u,t+1/3),o=a(c,u,t),s=a(c,u,t-1/3)}return{r:255*i,g:255*o,b:255*s}}function u(t,e,n){t=(0,r.sh)(t,255),e=(0,r.sh)(e,255),n=(0,r.sh)(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),a=0,s=i,u=i-o,c=0===i?0:u/i;if(i===o)a=0;else{switch(i){case t:a=(e-n)/u+(e>16,g:(65280&t)>>8,b:255&t}}},48701:function(t,e,n){"use strict";n.d(e,{R:function(){return r}});var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},1350:function(t,e,n){"use strict";n.d(e,{uA:function(){return a}});var r=n(86500),i=n(48701),o=n(90279);function a(t){var e={r:0,g:0,b:0},n=1,a=null,s=null,u=null,c=!1,f=!1;return"string"==typeof t&&(t=function(t){if(0===(t=t.trim().toLowerCase()).length)return!1;var e=!1;if(i.R[t])t=i.R[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};var n=l.rgb.exec(t);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=l.rgba.exec(t))return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=l.hsl.exec(t))return{h:n[1],s:n[2],l:n[3]};if(n=l.hsla.exec(t))return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=l.hsv.exec(t))return{h:n[1],s:n[2],v:n[3]};if(n=l.hsva.exec(t))return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=l.hex8.exec(t))return{r:(0,r.VD)(n[1]),g:(0,r.VD)(n[2]),b:(0,r.VD)(n[3]),a:(0,r.T6)(n[4]),format:e?"name":"hex8"};if(n=l.hex6.exec(t))return{r:(0,r.VD)(n[1]),g:(0,r.VD)(n[2]),b:(0,r.VD)(n[3]),format:e?"name":"hex"};if(n=l.hex4.exec(t))return{r:(0,r.VD)(n[1]+n[1]),g:(0,r.VD)(n[2]+n[2]),b:(0,r.VD)(n[3]+n[3]),a:(0,r.T6)(n[4]+n[4]),format:e?"name":"hex8"};if(n=l.hex3.exec(t))return{r:(0,r.VD)(n[1]+n[1]),g:(0,r.VD)(n[2]+n[2]),b:(0,r.VD)(n[3]+n[3]),format:e?"name":"hex"};return!1}(t)),"object"==typeof t&&(h(t.r)&&h(t.g)&&h(t.b)?(e=(0,r.rW)(t.r,t.g,t.b),c=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):h(t.h)&&h(t.s)&&h(t.v)?(a=(0,o.JX)(t.s),s=(0,o.JX)(t.v),e=(0,r.WE)(t.h,a,s),c=!0,f="hsv"):h(t.h)&&h(t.s)&&h(t.l)&&(a=(0,o.JX)(t.s),u=(0,o.JX)(t.l),e=(0,r.ve)(t.h,a,u),c=!0,f="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=(0,o.Yq)(n),{ok:c,format:t.format||f,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var s="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),u="[\\s|\\(]+(".concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")\\s*\\)?"),c="[\\s|\\(]+(".concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")\\s*\\)?"),l={CSS_UNIT:new RegExp(s),rgb:new RegExp("rgb"+u),rgba:new RegExp("rgba"+c),hsl:new RegExp("hsl"+u),hsla:new RegExp("hsla"+c),hsv:new RegExp("hsv"+u),hsva:new RegExp("hsva"+c),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 h(t){return Boolean(l.CSS_UNIT.exec(String(t)))}},10274:function(t,e,n){"use strict";n.d(e,{C:function(){return s}});var r=n(86500),i=n(48701),o=n(1350),a=n(90279),s=function(){function t(e,n){var i;if(void 0===e&&(e=""),void 0===n&&(n={}),e instanceof t)return e;"number"==typeof e&&(e=(0,r.Yt)(e)),this.originalInput=e;var a=(0,o.uA)(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(i=n.format)&&void 0!==i?i:a.format,this.gradientType=n.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.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,n=t.g/255,r=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=(0,a.Yq)(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){return 0===this.toHsl().s},t.prototype.toHsv=function(){var t=(0,r.py)(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=(0,r.py)(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var t=(0,r.lC)(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=(0,r.lC)(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(t){return void 0===t&&(t=!1),(0,r.vq)(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),(0,r.s)(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(n,")"):"rgba(".concat(t,", ").concat(e,", ").concat(n,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var t=function(t){return"".concat(Math.round(100*(0,a.sh)(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*(0,a.sh)(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+(0,r.vq)(this.r,this.g,this.b,!1),e=0,n=Object.entries(i.R);e=0;return e||!r||!t.startsWith("hex")&&"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()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=(0,a.V2)(n.l),new t(n)},t.prototype.brighten=function(e){void 0===e&&(e=10);var n=this.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))),new t(n)},t.prototype.darken=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=(0,a.V2)(n.l),new t(n)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=(0,a.V2)(n.s),new t(n)},t.prototype.saturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=(0,a.V2)(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){void 0===n&&(n=50);var r=this.toRgb(),i=new t(e).toRgb(),o=n/100;return new t({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})},t.prototype.analogous=function(e,n){void 0===e&&(e=6),void 0===n&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(new t(r));return o},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(new t({h:r,s:i,v:o})),o=(o+s)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb();return new t({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,i=[this],o=360/e,a=1;a1)&&(t=1),t}function a(t){return t<=1?"".concat(100*Number(t),"%"):t}function s(t){return 1===t.length?"0"+t:String(t)}n.d(e,{FZ:function(){return s},JX:function(){return a},V2:function(){return i},Yq:function(){return o},sh:function(){return r}})},25687:function(t,e,n){"use strict";n.d(e,{kG:function(){return r}});function r(t,e,n){if(void 0===n&&(n=Error),!t)throw new n(e)}},95957:function(t,e,n){"use strict";function r(t,e){var n=e&&e.cache?e.cache:l,r=e&&e.serializer?e.serializer:u;return(e&&e.strategy?e.strategy:s)(t,{cache:n,serializer:r})}function i(t,e,n,r){var i,o=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),a=e.get(o);return void 0===a&&(a=t.call(this,r),e.set(o,a)),a}function o(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return void 0===o&&(o=t.apply(this,r),e.set(i,o)),o}function a(t,e,n,r,i){return n.bind(e,t,r,i)}function s(t,e){return a(t,this,1===t.length?i:o,e.cache.create(),e.serializer)}n.d(e,{A:function(){return h},Z:function(){return r}});var u=function(){return JSON.stringify(arguments)};function c(){this.cache=Object.create(null)}c.prototype.get=function(t){return this.cache[t]},c.prototype.set=function(t,e){this.cache[t]=e};var l={create:function(){return new c}},h={variadic:function(t,e){return a(t,this,o,e.cache.create(),e.serializer)},monadic:function(t,e){return a(t,this,i,e.cache.create(),e.serializer)}}},35258:function(t,e,n){"use strict";n.d(e,{wD:function(){return o},VG:function(){return u},rp:function(){return l},Ii:function(){return v},O4:function(){return s},uf:function(){return c},Wh:function(){return m},Jo:function(){return d},yx:function(){return p},Wi:function(){return f},HI:function(){return g},pe:function(){return h},Qc:function(){return at}});var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(M,(function(t,n,r,i,o,a){if(n)e.minimumIntegerDigits=r.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(T.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(S.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(S,(function(t,n,r,i,o,a){return"*"===r?e.minimumFractionDigits=n.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&a?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+a.length):(e.minimumFractionDigits=n.length,e.maximumFractionDigits=n.length),""}));var o=i.options[0];"w"===o?e=w(w({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=w(w({},e),A(o)))}else if(E.test(i.stem))e=w(w({},e),A(i.stem));else{var a=C(i.stem);a&&(e=w(w({},e),a));var s=k(i.stem);s&&(e=w(w({},e),s))}}return e}var P,I={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function L(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=t.language;return"root"!==r&&(n=t.maximize().region),(I[n||""]||I[r||""]||I["".concat(r,"-001")]||I["001"])[0]}var D=new RegExp("^".concat(y.source,"*")),R=new RegExp("".concat(y.source,"*$"));function z(t,e){return{start:t,end:e}}var F=!!String.prototype.startsWith,B=!!String.fromCodePoint,j=!!Object.fromEntries,U=!!String.prototype.codePointAt,V=!!String.prototype.trimStart,H=!!String.prototype.trimEnd,G=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},Z=!0;try{Z="a"===(null===(P=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===P?void 0:P[0])}catch(t){Z=!1}var W,Y=F?function(t,e,n){return t.startsWith(e,n)}:function(t,e,n){return t.slice(n,n+e.length)===e},q=B?String.fromCodePoint:function(){for(var t=[],e=0;eo;){if((n=t[o++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},X=j?Object.fromEntries:function(t){for(var e={},n=0,r=t;n=n)){var r,i=t.charCodeAt(e);return i<55296||i>56319||e+1===n||(r=t.charCodeAt(e+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},$=V?function(t){return t.trimStart()}:function(t){return t.replace(D,"")},Q=H?function(t){return t.trimEnd()}:function(t){return t.replace(R,"")};function J(t,e){return new RegExp(t,e)}if(Z){var tt=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");W=function(t,e){var n;return tt.lastIndex=e,null!==(n=tt.exec(t)[1])&&void 0!==n?n:""}}else W=function(t,e){for(var n=[];;){var r=K(t,e);if(void 0===r||rt(r)||it(r))break;n.push(r),e+=r>=65536?2:1}return q.apply(void 0,n)};var et=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,n){for(var r=[];!this.isEOF();){var a=this.char();if(123===a){if((s=this.parseArgument(t,n)).err)return s;r.push(s.val)}else{if(125===a&&t>0)break;if(35!==a||"plural"!==e&&"selectordinal"!==e){if(60===a&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(i.UNMATCHED_CLOSING_TAG,z(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&nt(this.peek()||0)){if((s=this.parseTag(t,e)).err)return s;r.push(s.val)}else{var s;if((s=this.parseLiteral(t,e)).err)return s;r.push(s.val)}}else{var u=this.clonePosition();this.bump(),r.push({type:o.pound,location:z(u,this.clonePosition())})}}}return{val:r,err:null}},t.prototype.parseTag=function(t,e){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:o.literal,value:"<".concat(r,"/>"),location:z(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(t+1,e,!0);if(a.err)return a;var s=a.val,u=this.clonePosition();if(this.bumpIf("")?{val:{type:o.tag,value:r,children:s,location:z(n,this.clonePosition())},err:null}:this.error(i.INVALID_TAG,z(u,this.clonePosition())))}return this.error(i.UNCLOSED_TAG,z(n,this.clonePosition()))}return this.error(i.INVALID_TAG,z(n,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var n=this.clonePosition(),r="";;){var i=this.tryParseQuote(e);if(i)r+=i;else{var a=this.tryParseUnquoted(t,e);if(a)r+=a;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var u=z(n,this.clonePosition());return{val:{type:o.literal,value:r,location:u},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(nt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(n);this.bump()}return q.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===e||"selectordinal"===e)||125===n&&t>0?null:(this.bump(),q(n))},t.prototype.parseArgument=function(t,e){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,z(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(i.EMPTY_ARGUMENT,z(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(i.MALFORMED_ARGUMENT,z(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,z(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:o.argument,value:r,location:z(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,z(n,this.clonePosition())):this.parseArgumentOptions(t,e,r,n);default:return this.error(i.MALFORMED_ARGUMENT,z(n,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),n=W(this.message,e),r=e+n.length;return this.bumpTo(r),{value:n,location:z(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,n,s){var u,c=this.clonePosition(),l=this.parseIdentifierIfPossible().value,h=this.clonePosition();switch(l){case"":return this.error(i.EXPECT_ARGUMENT_TYPE,z(c,h));case"number":case"date":case"time":this.bumpSpace();var f=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition();if((_=this.parseSimpleArgStyleIfPossible()).err)return _;if(0===(v=Q(_.val)).length)return this.error(i.EXPECT_ARGUMENT_STYLE,z(this.clonePosition(),this.clonePosition()));f={style:v,styleLocation:z(d,this.clonePosition())}}if((S=this.tryParseArgumentClose(s)).err)return S;var p=z(s,this.clonePosition());if(f&&Y(null==f?void 0:f.style,"::",0)){var g=$(f.style.slice(2));if("number"===l)return(_=this.parseNumberSkeletonFromString(g,f.styleLocation)).err?_:{val:{type:o.number,value:n,location:p,style:_.val},err:null};if(0===g.length)return this.error(i.EXPECT_DATE_TIME_SKELETON,p);var m=g;this.locale&&(m=function(t,e){for(var n="",r=0;r>1),u=L(e);for("H"!=u&&"k"!=u||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=u+n}else n+="J"===i?"H":i}return n}(g,this.locale));var v={type:a.dateTime,pattern:m,location:f.styleLocation,parsedOptions:this.shouldParseSkeletons?x(m):{}};return{val:{type:"date"===l?o.date:o.time,value:n,location:p,style:v},err:null}}return{val:{type:"number"===l?o.number:"date"===l?o.date:o.time,value:n,location:p,style:null!==(u=null==f?void 0:f.style)&&void 0!==u?u:null},err:null};case"plural":case"selectordinal":case"select":var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(i.EXPECT_SELECT_ARGUMENT_OPTIONS,z(y,r({},y)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),w=0;if("select"!==l&&"offset"===b.value){if(!this.bumpIf(":"))return this.error(i.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,z(this.clonePosition(),this.clonePosition()));var _;if(this.bumpSpace(),(_=this.tryParseDecimalInteger(i.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,i.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return _;this.bumpSpace(),b=this.parseIdentifierIfPossible(),w=_.val}var S,E=this.tryParsePluralOrSelectOptions(t,l,e,b);if(E.err)return E;if((S=this.tryParseArgumentClose(s)).err)return S;var M=z(s,this.clonePosition());return"select"===l?{val:{type:o.select,value:n,options:X(E.val),location:M},err:null}:{val:{type:o.plural,value:n,options:X(E.val),offset:w,pluralType:"plural"===l?"cardinal":"ordinal",location:M},err:null};default:return this.error(i.INVALID_ARGUMENT_TYPE,z(c,h))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,z(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(i.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,z(n,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var n=[];try{n=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],n=0,r=t.split(_).filter((function(t){return t.length>0}));n=48&&a<=57))break;i=!0,o=10*o+(a-48),this.bump()}var s=z(r,this.clonePosition());return i?G(o*=n)?{val:o,err:null}:this.error(e,s):this.error(t,s)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=K(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(Y(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&rt(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),n=this.message.charCodeAt(e+(t>=65536?2:1));return null!=n?n:null},t}();function nt(t){return t>=97&&t<=122||t>=65&&t<=90}function rt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function it(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function ot(t){t.forEach((function(t){if(delete t.location,f(t)||d(t))for(var e in t.options)delete t.options[e].location,ot(t.options[e].value);else c(t)&&m(t.style)||(l(t)||h(t))&&v(t.style)?delete t.style.location:g(t)&&ot(t.children)}))}function at(t,e){void 0===e&&(e={}),e=r({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new et(t,e).parse();if(n.err){var o=SyntaxError(i[n.err.kind]);throw o.location=n.err.location,o.originalMessage=n.err.message,o}return(null==e?void 0:e.captureLocation)||ot(n.val),n.val}},88222:function(t,e,n){"use strict";n.d(e,{$6:function(){return h},OV:function(){return s},Qe:function(){return c},Rw:function(){return o},X9:function(){return l},bc:function(){return r},gb:function(){return u},wI:function(){return a}});var r,i=n(14874);!function(t){t.FORMAT_ERROR="FORMAT_ERROR",t.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",t.INVALID_CONFIG="INVALID_CONFIG",t.MISSING_DATA="MISSING_DATA",t.MISSING_TRANSLATION="MISSING_TRANSLATION"}(r||(r={}));var o=function(t){function e(n,r,i){var o=this,a=i?i instanceof Error?i:new Error(String(i)):void 0;return(o=t.call(this,"[@formatjs/intl Error ".concat(n,"] ").concat(r,"\n").concat(a?"\n".concat(a.message,"\n").concat(a.stack):""))||this).code=n,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o,e),o}return(0,i.ZT)(e,t),e}(Error),a=function(t){function e(e,n){return t.call(this,r.UNSUPPORTED_FORMATTER,e,n)||this}return(0,i.ZT)(e,t),e}(o),s=function(t){function e(e,n){return t.call(this,r.INVALID_CONFIG,e,n)||this}return(0,i.ZT)(e,t),e}(o),u=function(t){function e(e,n){return t.call(this,r.MISSING_DATA,e,n)||this}return(0,i.ZT)(e,t),e}(o),c=function(t){function e(e,n,i){return t.call(this,r.FORMAT_ERROR,"".concat(e,"\nLocale: ").concat(n,"\n"),i)||this}return(0,i.ZT)(e,t),e}(o),l=function(t){function e(e,n,r,i){var o=t.call(this,"".concat(e,"\nMessageID: ").concat(null==r?void 0:r.id,"\nDefault Message: ").concat(null==r?void 0:r.defaultMessage,"\nDescription: ").concat(null==r?void 0:r.description,"\n"),n,i)||this;return o.descriptor=r,o}return(0,i.ZT)(e,t),e}(c),h=function(t){function e(e,n){var i=t.call(this,r.MISSING_TRANSLATION,'Missing message: "'.concat(e.id,'" for locale "').concat(n,'", using ').concat(e.defaultMessage?"default message (".concat("string"==typeof e.defaultMessage?e.defaultMessage:e.defaultMessage.map((function(t){var e;return null!==(e=t.value)&&void 0!==e?e:JSON.stringify(t)})).join(),")"):"id"," as fallback."))||this;return i.descriptor=e,i}return(0,i.ZT)(e,t),e}(o)},82644:function(t,e,n){"use strict";n.d(e,{L6:function(){return s},Sn:function(){return c},TB:function(){return f},Z0:function(){return u},ax:function(){return h}});var r=n(14874),i=n(16284),o=n(95957),a=n(88222);function s(t,e,n){return void 0===n&&(n={}),e.reduce((function(e,r){return r in t?e[r]=t[r]:r in n&&(e[r]=n[r]),e}),{})}var u={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(t){0},onWarn:function(t){0}};function c(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function l(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}}}function h(t){void 0===t&&(t={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}});var e=Intl.RelativeTimeFormat,n=Intl.ListFormat,a=Intl.DisplayNames,s=(0,o.Z)((function(){for(var t,e=[],n=0;n>>0)+"_",i=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;oe&&(e=Math.max(0,r+e)),(null==n||n>r)&&(n=r),0>(n=Number(n))&&(n=Math.max(0,r+n)),e=Number(e||0);e(e=e||0)&&(e=Math.max(e+r,0));e>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function I(){if(!O){O={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));N[n]=r;for(var i=0;i>2];a=e[(3&a)<<4|s>>4],s=e[(15&s)<<2|u>>6],u=e[63&u],n[o++]=c+a+s+u}switch(c=0,u=r,t.length-i){case 2:u=e[(15&(c=t[i+1]))<<2]||r;case 1:t=t[i],n[o]=e[t>>2]+e[(3&t)<<4|c>>4]+u+r}return n.join("")}for(e="";10240t,n=(t=Math.abs(t))>>>0;t=Math.floor((t-n)/4294967296),e&&(e=(n=s(X(n,t))).next().value,t=n.next().value,n=e),G=n>>>0,Z=t>>>0}var Y,q="function"==typeof BigInt;function X(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function K(t,e){this.i=t>>>0,this.h=e>>>0}function $(t){if(!t)return Y||(Y=new K(0,0));if(!/^-?\d+$/.test(t))return null;if(16>t.length)W(Number(t));else if(q)t=BigInt(t),G=Number(t&BigInt(4294967295))>>>0,Z=Number(t>>BigInt(32)&BigInt(4294967295));else{var e=+("-"===t[0]);Z=G=0;for(var n=t.length,r=e,i=(n-e)%6+e;i<=n;r=i,i+=6)r=Number(t.slice(r,i)),Z*=1e6,4294967296<=(G=1e6*G+r)&&(Z+=G/4294967296|0,G%=4294967296);e&&(t=(e=s(X(G,Z))).next().value,e=e.next().value,G=t,Z=e)}return new K(G,Z)}function Q(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function J(){return Error("Failed to read varint, encoding is invalid.")}function tt(t,e){return Error("Tried to read past the end of the data "+e+" > "+t)}function et(){throw Error("Invalid UTF8")}function nt(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var rt,it,ot,at=void 0,st="undefined"!=typeof TextDecoder,ut="undefined"!=typeof TextEncoder;function ct(t){if(t!==V)throw Error("illegal external caller")}function lt(t,e){if(ct(e),this.V=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}function ht(){return ot||(ot=new lt(null,V))}function ft(t){ct(V);var e=t.V;return null==(e=null==e||L&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?j(e):null)?e:t.V=e}function dt(t,e){this.i=null,this.m=!1,this.h=this.j=this.l=0,pt(this,t,e)}function pt(t,e,n){n=void 0===n?{}:n,t.S=void 0!==n.S&&n.S,e&&(e=function(t){if("string"==typeof t)return{buffer:j(t),C:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),C:!1};if(t.constructor===Uint8Array)return{buffer:t,C:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),C:!1};if(t.constructor===lt)return{buffer:ft(t)||U(),C:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),C:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}(e),t.i=e.buffer,t.m=e.C,t.l=0,t.j=t.i.length,t.h=t.l)}function gt(t,e){if(t.h=e,e>t.j)throw tt(t.j,e)}function mt(t){var e=t.i,n=t.h,r=e[n++],i=127&r;if(128&r&&(i|=(127&(r=e[n++]))<<7,128&r&&(i|=(127&(r=e[n++]))<<14,128&r&&(i|=(127&(r=e[n++]))<<21,128&r&&(i|=(r=e[n++])<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw J();return gt(t,n),i}function vt(t,e){if(0>e)throw Error("Tried to read a negative byte length: "+e);var n=t.h,r=n+e;if(r>t.j)throw tt(e,t.j-n);return t.h=r,n}dt.prototype.reset=function(){this.h=this.l};var yt=[];function bt(){this.h=[]}function xt(t,e,n){for(;0>>7|n<<25)>>>0,n>>>=7;t.h.push(e)}function wt(t,e){for(;127>>=7;t.h.push(e)}function _t(t,e){if(yt.length){var n=yt.pop();pt(n,t,e),t=n}else t=new dt(t,e);this.h=t,this.j=this.h.h,this.i=this.l=-1,this.setOptions(e)}function St(t){var e=t.h;if(e.h==e.j)return!1;t.j=t.h.h;var n=mt(t.h)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw Q(n,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.l=e,t.i=n,!0}function Et(t){switch(t.i){case 0:if(0!=t.i)Et(t);else t:{for(var e=(t=t.h).h,n=e+10,r=t.i;e>>0,gt(t=t.h,t.h+e));break;case 5:gt(t=t.h,t.h+4);break;case 3:for(e=t.l;;){if(!St(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.l!=e)throw Error("Unmatched end-group tag");break}Et(t)}break;default:throw Q(t.i,t.j)}}bt.prototype.length=function(){return this.h.length},bt.prototype.end=function(){var t=this.h;return this.h=[],t},_t.prototype.setOptions=function(t){t=void 0===t?{}:t,this.ca=void 0!==t.ca&&t.ca},_t.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var Mt=[];function Tt(){this.j=[],this.i=0,this.h=new bt}function At(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}var Ct="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function kt(t,e){return Ct?t[Ct]|=e:void 0!==t.A?t.A|=e:(Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}}),e)}function Nt(t,e){Ct?t[Ct]&&(t[Ct]&=~e):void 0!==t.A&&(t.A&=~e)}function Ot(t){var e;return null==(e=Ct?t[Ct]:t.A)?0:e}function Pt(t,e){Ct?t[Ct]=e:void 0!==t.A?t.A=e:Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}})}function It(t){return kt(t,1),t}function Lt(t,e){Pt(e,-51&(0|t))}function Dt(t,e){Pt(e,-41&(18|t))}var Rt={};function zt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}var Ft,Bt,jt=[];function Ut(t){if(2&Ot(t.o))throw Error("Cannot mutate an immutable Message")}function Vt(t){var e=t.length;(e=e?t[e-1]:void 0)&&zt(e)?e.g=1:(e={},t.push((e.g=1,e)))}function Ht(t){var e=t.i+t.G;return t.B||(t.B=t.o[e]={})}function Gt(t,e){return-1===e?null:e>=t.i?t.B?t.B[e]:void 0:t.o[e+t.G]}function Zt(t,e,n,r){Ut(t),Wt(t,e,n,r)}function Wt(t,e,n,r){t.j&&(t.j=void 0),e>=t.i||r?Ht(t)[e]=n:(t.o[e+t.G]=n,(t=t.B)&&e in t&&delete t[e])}function Yt(t,e,n,r){var i=Gt(t,e);Array.isArray(i)||(i=Ft);var o=Ot(i);if(1&o||It(i),r)2&o||kt(i,2),1&n||Object.freeze(i);else{r=!(2&n);var a=2&o;1&n||!a?r&&16&o&&!a&&Nt(i,16):Wt(t,e,i=It(Array.prototype.slice.call(i)))}return i}function qt(t,e){var n=Gt(t,e),r=null==n?n:"number"==typeof n||"NaN"===n||"Infinity"===n||"-Infinity"===n?Number(n):void 0;return null!=r&&r!==n&&Wt(t,e,r),r}function Xt(t,e,n,r,i){t.h||(t.h={});var o=t.h[n],a=Yt(t,n,3,i);if(!o){var s=a;o=[];var u=!!(16&Ot(t.o));a=!!(2&Ot(s));var c=s;!i&&a&&(s=Array.prototype.slice.call(s));for(var l=a,h=0;ha&&"number"!=typeof t[a]){var s=t[a++];n(e,s)}for(;a>>0)>>31)+1,o=a>>>23&255,a&=8388607,Zt(e,n,255==o?a?NaN:1/0*t:0==o?t*Math.pow(2,-149)*a:t*Math.pow(2,o-150)*(a+Math.pow(2,23))),!0}),(function(t,e,n){if(null!=(e=qt(e,n))){wt(t.h,8*n+5),t=t.h;var r=+e;0===r?0<1/r?G=Z=0:(Z=0,G=2147483648):isNaN(r)?(Z=0,G=2147483647):34028234663852886e22<(r=(n=0>r?-2147483648:0)?-r:r)?(Z=0,G=(2139095040|n)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),Z=0,G=(n|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),16777216<=(r=Math.round(8388608*r))&&++e,Z=0,G=(n|e+127<<23|8388607&r)>>>0),n=G,t.h.push(n>>>0&255),t.h.push(n>>>8&255),t.h.push(n>>>16&255),t.h.push(n>>>24&255)}})),ze=De((function(t,e,n){if(0!==t.i)return!1;var r=t.h,i=0,o=t=0,a=r.i,s=r.h;do{var u=a[s++];i|=(127&u)<o&&128&u);for(32>4),o=3;32>o&&128&u;o+=7)t|=(127&(u=a[s++]))<u))throw J();return r=i>>>0,(t=2147483648&(u=t>>>0))&&(u=~u>>>0,0==(r=1+~r>>>0)&&(u=u+1>>>0)),r=4294967296*u+(r>>>0),Zt(e,n,t?-r:r),!0}),(function(t,e,n){null!=(e=Gt(e,n))&&("string"==typeof e&&$(e),null!=e&&(wt(t.h,8*n),"number"==typeof e?(t=t.h,W(e),xt(t,G,Z)):(n=$(e),xt(t.h,n.i,n.h))))})),Fe=De((function(t,e,n){return 0===t.i&&(Zt(e,n,mt(t.h)),!0)}),(function(t,e,n){if(null!=(e=Gt(e,n))&&null!=e)if(wt(t.h,8*n),t=t.h,0<=(n=e))wt(t,n);else{for(e=0;9>e;e++)t.h.push(127&n|128),n>>=7;t.h.push(1)}})),Be=De((function(t,e,n){if(2!==t.i)return!1;var r=mt(t.h)>>>0,i=vt(t=t.h,r);if(t=t.i,st){var o,a=t;(o=rt)||(o=rt=new TextDecoder("utf-8",{fatal:!0})),t=i+r,a=0===i&&t===a.length?a:a.subarray(i,t);try{var s=o.decode(a)}catch(t){if(void 0===at){try{o.decode(new Uint8Array([128]))}catch(t){}try{o.decode(new Uint8Array([97])),at=!0}catch(t){at=!1}}throw!at&&(rt=void 0),t}}else{r=(s=i)+r,i=[];for(var u,c,l=null;s(u=t[s++])?i.push(u):224>u?s>=r?et():(c=t[s++],194>u||128!=(192&c)?(s--,et()):i.push((31&u)<<6|63&c)):240>u?s>=r-1?et():128!=(192&(c=t[s++]))||224===u&&160>c||237===u&&160<=c||128!=(192&(a=t[s++]))?(s--,et()):i.push((15&u)<<12|(63&c)<<6|63&a):244>=u?s>=r-2?et():128!=(192&(c=t[s++]))||0!=c-144+(u<<28)>>30||128!=(192&(a=t[s++]))||128!=(192&(o=t[s++]))?(s--,et()):(u=(7&u)<<18|(63&c)<<12|(63&a)<<6|63&o,u-=65536,i.push(55296+(u>>10&1023),56320+(1023&u))):et(),8192<=i.length&&(l=nt(l,i),i.length=0);s=nt(l,i)}return Zt(e,n,s),!0}),(function(t,e,n){if(null!=(e=Gt(e,n))){var r=!1;if(r=void 0!==r&&r,ut){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(it||(it=new TextEncoder)).encode(e)}else{for(var i=0,o=new Uint8Array(3*e.length),a=0;as)o[i++]=s;else{if(2048>s)o[i++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&a=u){s=1024*(s-55296)+u-56320+65536,o[i++]=s>>18|240,o[i++]=s>>12&63|128,o[i++]=s>>6&63|128,o[i++]=63&s|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");s=65533}o[i++]=s>>12|224,o[i++]=s>>6&63|128}o[i++]=63&s|128}}e=i===o.length?o:o.subarray(0,i)}wt(t.h,8*n+2),wt(t.h,e.length),At(t,t.h.end()),At(t,e)}})),je=De((function(t,e,n,r,i){if(2!==t.i)return!1;e=Qt(e,n,r),n=t.h.j,r=mt(t.h)>>>0;var o=t.h.h+r,a=o-n;if(0>=a&&(t.h.j=o,i(e,t,void 0,void 0,void 0),a=o-t.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.h.h=o,t.h.j=n,!0}),(function(t,e,n,r,i){if(null!=(e=Kt(e,r,n)))for(r=0;r>>=7,a.i++;o.push(s),a.i++}}));function Ue(t){return function(e,n){t:{if(Mt.length){var r=Mt.pop();r.setOptions(n),pt(r.h,e,n),e=r}else e=new _t(e,n);try{var i=Pe(t),o=Ie(new i.P,e,i);break t}finally{(i=e.h).i=null,i.m=!1,i.l=0,i.j=0,i.h=0,i.S=!1,e.l=-1,e.i=-1,100>Mt.length&&Mt.push(e)}o=void 0}return o}}function Ve(t){return function(){var e=new Tt;Le(this,e,Te(t)),At(e,e.h.end());for(var n=new Uint8Array(e.i),r=e.j,i=r.length,o=0,a=0;a>>0)+"_",i=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;oe&&(e=Math.max(0,r+e)),(null==n||n>r)&&(n=r),0>(n=Number(n))&&(n=Math.max(0,r+n)),e=Number(e||0);e(e=e||0)&&(e=Math.max(e+r,0));e>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function I(){if(!O){O={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));N[n]=r;for(var i=0;i>2];a=e[(3&a)<<4|s>>4],s=e[(15&s)<<2|u>>6],u=e[63&u],n[o++]=c+a+s+u}switch(c=0,u=r,t.length-i){case 2:u=e[(15&(c=t[i+1]))<<2]||r;case 1:t=t[i],n[o]=e[t>>2]+e[(3&t)<<4|c>>4]+u+r}return n.join("")}for(e="";10240t,n=(t=Math.abs(t))>>>0;t=Math.floor((t-n)/4294967296),e&&(e=(n=s(X(n,t))).next().value,t=n.next().value,n=e),G=n>>>0,Z=t>>>0}var Y,q="function"==typeof BigInt;function X(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function K(t,e){this.i=t>>>0,this.h=e>>>0}function $(t){if(!t)return Y||(Y=new K(0,0));if(!/^-?\d+$/.test(t))return null;if(16>t.length)W(Number(t));else if(q)t=BigInt(t),G=Number(t&BigInt(4294967295))>>>0,Z=Number(t>>BigInt(32)&BigInt(4294967295));else{var e=+("-"===t[0]);Z=G=0;for(var n=t.length,r=e,i=(n-e)%6+e;i<=n;r=i,i+=6)r=Number(t.slice(r,i)),Z*=1e6,4294967296<=(G=1e6*G+r)&&(Z+=G/4294967296|0,G%=4294967296);e&&(t=(e=s(X(G,Z))).next().value,e=e.next().value,G=t,Z=e)}return new K(G,Z)}function Q(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function J(){return Error("Failed to read varint, encoding is invalid.")}function tt(t,e){return Error("Tried to read past the end of the data "+e+" > "+t)}function et(){throw Error("Invalid UTF8")}function nt(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var rt,it,ot,at=void 0,st="undefined"!=typeof TextDecoder,ut="undefined"!=typeof TextEncoder;function ct(t){if(t!==V)throw Error("illegal external caller")}function lt(t,e){if(ct(e),this.V=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}function ht(){return ot||(ot=new lt(null,V))}function ft(t){ct(V);var e=t.V;return null==(e=null==e||L&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?j(e):null)?e:t.V=e}function dt(t,e){this.i=null,this.m=!1,this.h=this.j=this.l=0,pt(this,t,e)}function pt(t,e,n){n=void 0===n?{}:n,t.S=void 0!==n.S&&n.S,e&&(e=function(t){if("string"==typeof t)return{buffer:j(t),C:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),C:!1};if(t.constructor===Uint8Array)return{buffer:t,C:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),C:!1};if(t.constructor===lt)return{buffer:ft(t)||U(),C:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),C:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}(e),t.i=e.buffer,t.m=e.C,t.l=0,t.j=t.i.length,t.h=t.l)}function gt(t,e){if(t.h=e,e>t.j)throw tt(t.j,e)}function mt(t){var e=t.i,n=t.h,r=e[n++],i=127&r;if(128&r&&(i|=(127&(r=e[n++]))<<7,128&r&&(i|=(127&(r=e[n++]))<<14,128&r&&(i|=(127&(r=e[n++]))<<21,128&r&&(i|=(r=e[n++])<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw J();return gt(t,n),i}function vt(t,e){if(0>e)throw Error("Tried to read a negative byte length: "+e);var n=t.h,r=n+e;if(r>t.j)throw tt(e,t.j-n);return t.h=r,n}dt.prototype.reset=function(){this.h=this.l};var yt=[];function bt(){this.h=[]}function xt(t,e,n){for(;0>>7|n<<25)>>>0,n>>>=7;t.h.push(e)}function wt(t,e){for(;127>>=7;t.h.push(e)}function _t(t,e){if(yt.length){var n=yt.pop();pt(n,t,e),t=n}else t=new dt(t,e);this.h=t,this.j=this.h.h,this.i=this.l=-1,this.setOptions(e)}function St(t){var e=t.h;if(e.h==e.j)return!1;t.j=t.h.h;var n=mt(t.h)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw Q(n,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.l=e,t.i=n,!0}function Et(t){switch(t.i){case 0:if(0!=t.i)Et(t);else t:{for(var e=(t=t.h).h,n=e+10,r=t.i;e>>0,gt(t=t.h,t.h+e));break;case 5:gt(t=t.h,t.h+4);break;case 3:for(e=t.l;;){if(!St(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.l!=e)throw Error("Unmatched end-group tag");break}Et(t)}break;default:throw Q(t.i,t.j)}}bt.prototype.length=function(){return this.h.length},bt.prototype.end=function(){var t=this.h;return this.h=[],t},_t.prototype.setOptions=function(t){t=void 0===t?{}:t,this.ca=void 0!==t.ca&&t.ca},_t.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var Mt=[];function Tt(){this.j=[],this.i=0,this.h=new bt}function At(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}var Ct="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function kt(t,e){return Ct?t[Ct]|=e:void 0!==t.A?t.A|=e:(Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}}),e)}function Nt(t,e){Ct?t[Ct]&&(t[Ct]&=~e):void 0!==t.A&&(t.A&=~e)}function Ot(t){var e;return null==(e=Ct?t[Ct]:t.A)?0:e}function Pt(t,e){Ct?t[Ct]=e:void 0!==t.A?t.A=e:Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}})}function It(t){return kt(t,1),t}function Lt(t,e){Pt(e,-51&(0|t))}function Dt(t,e){Pt(e,-41&(18|t))}var Rt={};function zt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}var Ft,Bt,jt=[];function Ut(t){if(2&Ot(t.o))throw Error("Cannot mutate an immutable Message")}function Vt(t){var e=t.length;(e=e?t[e-1]:void 0)&&zt(e)?e.g=1:(e={},t.push((e.g=1,e)))}function Ht(t){var e=t.i+t.G;return t.B||(t.B=t.o[e]={})}function Gt(t,e){return-1===e?null:e>=t.i?t.B?t.B[e]:void 0:t.o[e+t.G]}function Zt(t,e,n,r){Ut(t),Wt(t,e,n,r)}function Wt(t,e,n,r){t.j&&(t.j=void 0),e>=t.i||r?Ht(t)[e]=n:(t.o[e+t.G]=n,(t=t.B)&&e in t&&delete t[e])}function Yt(t,e,n,r){var i=Gt(t,e);Array.isArray(i)||(i=Ft);var o=Ot(i);if(1&o||It(i),r)2&o||kt(i,2),1&n||Object.freeze(i);else{r=!(2&n);var a=2&o;1&n||!a?r&&16&o&&!a&&Nt(i,16):Wt(t,e,i=It(Array.prototype.slice.call(i)))}return i}function qt(t,e){var n=Gt(t,e),r=null==n?n:"number"==typeof n||"NaN"===n||"Infinity"===n||"-Infinity"===n?Number(n):void 0;return null!=r&&r!==n&&Wt(t,e,r),r}function Xt(t,e,n,r,i){t.h||(t.h={});var o=t.h[n],a=Yt(t,n,3,i);if(!o){var s=a;o=[];var u=!!(16&Ot(t.o));a=!!(2&Ot(s));var c=s;!i&&a&&(s=Array.prototype.slice.call(s));for(var l=a,h=0;ha&&"number"!=typeof t[a]){var s=t[a++];n(e,s)}for(;a>>0)>>31)+1,o=a>>>23&255,a&=8388607,Zt(e,n,255==o?a?NaN:1/0*t:0==o?t*Math.pow(2,-149)*a:t*Math.pow(2,o-150)*(a+Math.pow(2,23))),!0}),(function(t,e,n){if(null!=(e=qt(e,n))){wt(t.h,8*n+5),t=t.h;var r=+e;0===r?0<1/r?G=Z=0:(Z=0,G=2147483648):isNaN(r)?(Z=0,G=2147483647):34028234663852886e22<(r=(n=0>r?-2147483648:0)?-r:r)?(Z=0,G=(2139095040|n)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),Z=0,G=(n|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),16777216<=(r=Math.round(8388608*r))&&++e,Z=0,G=(n|e+127<<23|8388607&r)>>>0),n=G,t.h.push(n>>>0&255),t.h.push(n>>>8&255),t.h.push(n>>>16&255),t.h.push(n>>>24&255)}})),ze=De((function(t,e,n){if(0!==t.i)return!1;var r=t.h,i=0,o=t=0,a=r.i,s=r.h;do{var u=a[s++];i|=(127&u)<o&&128&u);for(32>4),o=3;32>o&&128&u;o+=7)t|=(127&(u=a[s++]))<u))throw J();return r=i>>>0,(t=2147483648&(u=t>>>0))&&(u=~u>>>0,0==(r=1+~r>>>0)&&(u=u+1>>>0)),r=4294967296*u+(r>>>0),Zt(e,n,t?-r:r),!0}),(function(t,e,n){null!=(e=Gt(e,n))&&("string"==typeof e&&$(e),null!=e&&(wt(t.h,8*n),"number"==typeof e?(t=t.h,W(e),xt(t,G,Z)):(n=$(e),xt(t.h,n.i,n.h))))})),Fe=De((function(t,e,n){return 0===t.i&&(Zt(e,n,mt(t.h)),!0)}),(function(t,e,n){if(null!=(e=Gt(e,n))&&null!=e)if(wt(t.h,8*n),t=t.h,0<=(n=e))wt(t,n);else{for(e=0;9>e;e++)t.h.push(127&n|128),n>>=7;t.h.push(1)}})),Be=De((function(t,e,n){if(2!==t.i)return!1;var r=mt(t.h)>>>0,i=vt(t=t.h,r);if(t=t.i,st){var o,a=t;(o=rt)||(o=rt=new TextDecoder("utf-8",{fatal:!0})),t=i+r,a=0===i&&t===a.length?a:a.subarray(i,t);try{var s=o.decode(a)}catch(t){if(void 0===at){try{o.decode(new Uint8Array([128]))}catch(t){}try{o.decode(new Uint8Array([97])),at=!0}catch(t){at=!1}}throw!at&&(rt=void 0),t}}else{r=(s=i)+r,i=[];for(var u,c,l=null;s(u=t[s++])?i.push(u):224>u?s>=r?et():(c=t[s++],194>u||128!=(192&c)?(s--,et()):i.push((31&u)<<6|63&c)):240>u?s>=r-1?et():128!=(192&(c=t[s++]))||224===u&&160>c||237===u&&160<=c||128!=(192&(a=t[s++]))?(s--,et()):i.push((15&u)<<12|(63&c)<<6|63&a):244>=u?s>=r-2?et():128!=(192&(c=t[s++]))||0!=c-144+(u<<28)>>30||128!=(192&(a=t[s++]))||128!=(192&(o=t[s++]))?(s--,et()):(u=(7&u)<<18|(63&c)<<12|(63&a)<<6|63&o,u-=65536,i.push(55296+(u>>10&1023),56320+(1023&u))):et(),8192<=i.length&&(l=nt(l,i),i.length=0);s=nt(l,i)}return Zt(e,n,s),!0}),(function(t,e,n){if(null!=(e=Gt(e,n))){var r=!1;if(r=void 0!==r&&r,ut){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(it||(it=new TextEncoder)).encode(e)}else{for(var i=0,o=new Uint8Array(3*e.length),a=0;as)o[i++]=s;else{if(2048>s)o[i++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&a=u){s=1024*(s-55296)+u-56320+65536,o[i++]=s>>18|240,o[i++]=s>>12&63|128,o[i++]=s>>6&63|128,o[i++]=63&s|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");s=65533}o[i++]=s>>12|224,o[i++]=s>>6&63|128}o[i++]=63&s|128}}e=i===o.length?o:o.subarray(0,i)}wt(t.h,8*n+2),wt(t.h,e.length),At(t,t.h.end()),At(t,e)}})),je=De((function(t,e,n,r,i){if(2!==t.i)return!1;e=Qt(e,n,r),n=t.h.j,r=mt(t.h)>>>0;var o=t.h.h+r,a=o-n;if(0>=a&&(t.h.j=o,i(e,t,void 0,void 0,void 0),a=o-t.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.h.h=o,t.h.j=n,!0}),(function(t,e,n,r,i){if(null!=(e=Kt(e,r,n)))for(r=0;r>>=7,a.i++;o.push(s),a.i++}}));function Ue(t){return function(e,n){t:{if(Mt.length){var r=Mt.pop();r.setOptions(n),pt(r.h,e,n),e=r}else e=new _t(e,n);try{var i=Pe(t),o=Ie(new i.P,e,i);break t}finally{(i=e.h).i=null,i.m=!1,i.l=0,i.j=0,i.h=0,i.S=!1,e.l=-1,e.i=-1,100>Mt.length&&Mt.push(e)}o=void 0}return o}}function Ve(t){return function(){var e=new Tt;Le(this,e,Te(t)),At(e,e.h.end());for(var n=new Uint8Array(e.i),r=e.j,i=r.length,o=0,a=0;a=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function f(t,e,n,r){void 0===r&&(r={});let{window:a=document.defaultView,v5Compat:s=!1}=r,l=a.history,h=i.Pop,f=null;function d(){h=i.Pop,f&&f({action:h,location:p.location})}let p={get action(){return h},get location(){return t(a,l)},listen(t){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(o,d),f=t,()=>{a.removeEventListener(o,d),f=null}},createHref(t){return e(a,t)},push:function(t,e){h=i.Push;let r=c(p.location,t,e);n&&n(r,t);let o=u(r),d=p.createHref(r);try{l.pushState(o,"",d)}catch(t){a.location.assign(d)}s&&f&&f({action:h,location:r})},replace:function(t,e){h=i.Replace;let r=c(p.location,t,e);n&&n(r,t);let o=u(r),a=p.createHref(r);l.replaceState(o,"",a),s&&f&&f({action:h,location:r})},go(t){return l.go(t)}};return p}var d;function p(t,e,n){void 0===n&&(n="/");let r=w(("string"==typeof e?h(e):e).pathname||"/",n);if(null==r)return null;let i=g(t);!function(t){t.sort(((t,e)=>t.score!==e.score?e.score-t.score:function(t,e){return t.length===e.length&&t.slice(0,-1).every(((t,n)=>t===e[n]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(i);let o=null;for(let t=0;null==o&&t{let o={relativePath:t.path||"",caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};o.relativePath.startsWith("/")&&(_(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));let a=T([r,o.relativePath]),s=n.concat(o);t.children&&t.children.length>0&&(_(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+a+'".'),g(t.children,e,s,a)),(null!=t.path||t.index)&&e.push({path:a,score:y(a,t.index),routesMeta:s})})),e}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(d||(d={}));const m=/^:\w+$/,v=t=>"*"===t;function y(t,e){let n=t.split("/"),r=n.length;return n.some(v)&&(r+=-2),e&&(r+=2),n.filter((t=>!v(t))).reduce(((t,e)=>t+(m.test(e)?3:""===e?1:10)),r)}function b(t,e){let{routesMeta:n}=t,r={},i="/",o=[];for(let t=0;t(r.push(e),"([^\\/]+)")));t.endsWith("*")?(r.push("*"),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))");return[new RegExp(i,e?void 0:"i"),r]}(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce(((t,e,n)=>{if("*"===e){let t=s[n]||"";a=o.slice(0,o.length-t.length).replace(/(.)\/+$/,"$1")}return t[e]=function(t,e){try{return decodeURIComponent(t)}catch(n){return S(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),t}}(s[n]||"",e),t}),{}),pathname:o,pathnameBase:a,pattern:t}}function w(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&"/"!==r?null:t.slice(n)||"/"}function _(t,e){if(!1===t||null==t)throw new Error(e)}function S(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function E(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function M(t,e,n,i){let o;void 0===i&&(i=!1),"string"==typeof t?o=h(t):(o=r({},t),_(!o.pathname||!o.pathname.includes("?"),E("?","pathname","search",o)),_(!o.pathname||!o.pathname.includes("#"),E("#","pathname","hash",o)),_(!o.search||!o.search.includes("#"),E("#","search","hash",o)));let a,s=""===t||""===o.pathname,u=s?"/":o.pathname;if(i||null==u)a=n;else{let t=e.length-1;if(u.startsWith("..")){let e=u.split("/");for(;".."===e[0];)e.shift(),t-=1;o.pathname=e.join("/")}a=t>=0?e[t]:"/"}let c=function(t,e){void 0===e&&(e="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof t?h(t):t,o=n?n.startsWith("/")?n:function(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?n.length>1&&n.pop():"."!==t&&n.push(t)})),n.length>1?n.join("/"):"/"}(n,e):e;return{pathname:o,search:C(r),hash:k(i)}}(o,a),l=u&&"/"!==u&&u.endsWith("/"),f=(s||"."===u)&&n.endsWith("/");return c.pathname.endsWith("/")||!l&&!f||(c.pathname+="/"),c}const T=t=>t.join("/").replace(/\/\/+/g,"/"),A=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),C=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",k=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";class N extends Error{}class O{constructor(t,e,n){this.status=t,this.statusText=e||"",this.data=n}}function P(t){return t instanceof O}},1221:function(t,e,n){"use strict";n.r(e),n.d(e,{addImpl:function(){return g},bincountImpl:function(){return v},bincountReduceImpl:function(){return y},castImpl:function(){return h},ceilImpl:function(){return _},concatImpl:function(){return S},equalImpl:function(){return E},expImpl:function(){return M},expm1Impl:function(){return T},floorImpl:function(){return A},gatherNdImpl:function(){return C},gatherV2Impl:function(){return k},greaterEqualImpl:function(){return O},greaterImpl:function(){return N},lessEqualImpl:function(){return I},lessImpl:function(){return P},linSpaceImpl:function(){return L},logImpl:function(){return D},maxImpl:function(){return R},maximumImpl:function(){return z},minimumImpl:function(){return F},multiplyImpl:function(){return B},negImpl:function(){return U},notEqualImpl:function(){return V},prodImpl:function(){return G},raggedGatherImpl:function(){return q},raggedRangeImpl:function(){return K},raggedTensorToTensorImpl:function(){return et},rangeImpl:function(){return nt},rsqrtImpl:function(){return rt},scatterImpl:function(){return it},sigmoidImpl:function(){return ot},simpleAbsImpl:function(){return o},sliceImpl:function(){return at},sparseFillEmptyRowsImpl:function(){return st},sparseReshapeImpl:function(){return ut},sparseSegmentReductionImpl:function(){return ct},sqrtImpl:function(){return lt},squaredDifferenceImpl:function(){return ht},stridedSliceImpl:function(){return ft},stringNGramsImpl:function(){return pt},stringSplitImpl:function(){return mt},stringToHashBucketFastImpl:function(){return vt},subImpl:function(){return yt},tileImpl:function(){return xt},topKImpl:function(){return St},transposeImpl:function(){return H},uniqueImpl:function(){return Et}});var r=n(38986); -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function i(t,e){Array.isArray(t)||(t=[t]),t.forEach((t=>{null!=t&&r.util.assert("complex64"!==t.dtype,(()=>`${e} does not support complex64 tensors in the CPU backend.`))}))} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function o(t){const e=new Float32Array(t.length);for(let n=0;n{const s=r.backend_util.assertAndGetBroadcastShape(e,n),u=s.length,c=r.util.computeStrides(s),l=r.util.sizeFromShape(s),h=r.util.getTypedArrayFromDType(a,l),f=e.length,d=n.length,p=r.util.computeStrides(e),g=r.util.computeStrides(n),m=r.backend_util.getBroadcastDims(e,s),v=r.backend_util.getBroadcastDims(n,s);if(m.length+v.length===0)for(let e=0;ea[t]=0));const s=r.util.locToIndex(a,f,p),l=n.slice(-d);v.forEach((t=>l[t]=0));const y=r.util.locToIndex(l,d,g);h[e]=t(i[s],o[y])}return[h,s]}} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function s(t){const{inputs:e,backend:n}=t,{real:r,imag:i}=e,o=n.data.get(r.dataId).values,a=n.data.get(i.dataId).values,s=n.makeTensorInfo(r.shape,"complex64");return n.data.get(s.dataId).complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",o),imag:n.makeTensorInfo(i.shape,"float32",a)},s}r.Complex; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function u(t,e,n="float32"){if("complex64"===n){return s({inputs:{real:u(t,e,"float32"),imag:u(t,e,"float32")},backend:t})}const i=r.util.makeZerosTypedArray(r.util.sizeFromShape(e),n);return t.makeTensorInfo(e,n,i)} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function c(t){const{inputs:e,backend:n}=t,{x:r}=e;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}r.Identity; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function l(t){const{inputs:e,backend:n}=t,{input:r}=e,i=n.data.get(r.dataId).complexTensorInfos.real,o=n.data.get(i.dataId).values;return n.makeTensorInfo(i.shape,i.dtype,o)}r.Real; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function h(t,e,n,i){if("int32"===i){return[e,"int32",Int32Array.from(t)]}if("bool"===i){const i=r.util.toTypedArray([0],n),[o,s]=a(((t,e)=>t!==e?1:0))(e,[],t,i,"bool");return[s,"bool",o]}throw new Error(`Error in Cast: failed to cast ${n} to ${i}`)}function f(t){const{inputs:e,backend:n,attrs:i}=t,{x:o}=e,{dtype:a}=i;if("complex64"===a){if("complex64"===o.dtype)return c({inputs:{x:o},backend:n});const t=u(n,o.shape,o.dtype),e=f({inputs:{x:o},backend:n,attrs:{dtype:"float32"}}),r=s({inputs:{real:e,imag:t},backend:n});return n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(e),r}if("complex64"===o.dtype){const t=l({inputs:{input:o},backend:n}),e=f({inputs:{x:t},backend:n,attrs:{dtype:a}});return n.disposeIntermediateTensorInfo(t),e}if(!r.util.hasEncodingLoss(o.dtype,a)){const t=c({inputs:{x:o},backend:n});return{dataId:t.dataId,shape:t.shape,dtype:a}}const d=n.data.get(o.dataId).values,[p,g,m]=h(d,o.shape,o.dtype,a);return n.makeTensorInfo(p,g,m)}r.Cast; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function d(t,e,n,o){return null==n?({inputs:n,backend:a})=>{const{a:s,b:u}=n,c=a;i([s,u],t);const l=c.data.get(s.dataId).values,h=c.data.get(u.dataId).values,f="string"===s.dtype?r.backend_util.fromUint8ToStringArray(l):l,d="string"===s.dtype?r.backend_util.fromUint8ToStringArray(h):h,p=o||s.dtype,[g,m]=e(s.shape,u.shape,f,d,p);return c.makeTensorInfo(m,p,g)}:({inputs:t,backend:r})=>{const{a:i,b:a}=t,u=r;if("complex64"===i.dtype||"complex64"===a.dtype){const t=f({inputs:{x:i},backend:u,attrs:{dtype:"complex64"}}),e=u.data.get(t.dataId),r=e.complexTensorInfos.real,o=e.complexTensorInfos.imag,c=u.data.get(r.dataId).values,l=u.data.get(o.dataId).values,h=f({inputs:{x:a},backend:u,attrs:{dtype:"complex64"}}),d=u.data.get(h.dataId),p=d.complexTensorInfos.real,g=d.complexTensorInfos.imag,m=u.data.get(p.dataId).values,v=u.data.get(g.dataId).values,[y,b,x]=n(i.shape,a.shape,c,l,m,v),w=u.makeTensorInfo(x,"float32",y),_=u.makeTensorInfo(x,"float32",b),S=s({inputs:{real:w,imag:_},backend:u});return u.disposeIntermediateTensorInfo(t),u.disposeIntermediateTensorInfo(h),u.disposeIntermediateTensorInfo(w),u.disposeIntermediateTensorInfo(_),S}{const t=u.data.get(i.dataId).values,n=u.data.get(a.dataId).values,r=o||i.dtype,[s,c]=e(i.shape,a.shape,t,n,r);return u.makeTensorInfo(c,r,s)}}}function p(t){return(e,n,i,o,a,s)=>{const u=r.backend_util.assertAndGetBroadcastShape(e,n),c=r.util.sizeFromShape(u),l=u.length,h=r.util.computeStrides(u),f=r.util.getTypedArrayFromDType("float32",c),d=r.util.getTypedArrayFromDType("float32",c),p=r.backend_util.getBroadcastDims(e,u),g=r.backend_util.getBroadcastDims(n,u),m=r.backend_util.mergeRealAndImagArrays(i,o),v=r.backend_util.mergeRealAndImagArrays(a,s),y=e.length,b=r.util.computeStrides(e),x=n.length,w=r.util.computeStrides(n);if(p.length+g.length===0)for(let e=0;ei[t]=0));const o=r.util.locToIndex(i,y,b),a=n.slice(-x);g.forEach((t=>a[t]=0));const s=r.util.locToIndex(a,x,w),u=t(m[2*o],m[2*o+1],v[2*s],v[2*s+1]);f[e]=u.real,d[e]=u.imag}return[f,d,u]}} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -const g=a(((t,e)=>t+e)),m=p(((t,e,n,r)=>({real:t+n,imag:e+r})));d(r.Add,g,m),r.Add; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function v(t,e,n,i,o){const a=r.util.sizeFromShape(i),s=r.util.makeZerosTypedArray(o,n);for(let n=0;n=o||(s[r]+=a>0?e[n]:1)}return s}function y(t,e,n,i=!1){const o=t.shape[0],a=t.shape[1],s=(0,r.buffer)([o,n],e.dtype);for(let r=0;r=n||(i?s.set(1,r,a):e.size>0?s.set(s.get(r,a)+e.get(r,o),r,a):s.set(s.get(r,a)+1,r,a))}return s} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function b(t){return(e,n,i)=>{const o=r.util.getTypedArrayFromDType(n,e.length);for(let n=0;n{const{x:u}=o;if(i(u,t),"string"===u.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const c=s,l=c.data.get(u.dataId).values,h=r.util.sizeFromShape(u.shape),f=n||u.dtype,d=r.util.getArrayFromDType(f,h);for(let t=0;t{const{x:s}=r;if(i(s,t),"string"===s.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const u=a,c=u.data.get(s.dataId).values,l=n||s.dtype,h=e(c,l,o);return u.makeTensorInfo(s.shape,l,h)}} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -const _=b((t=>Math.ceil(t)));w(r.Ceil,_),r.Ceil; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function S(t,e,n,i){const o=r.util.getArrayFromDType(n,r.util.sizeFromShape(e));if(i&&"string"!==n){let e=0;t.forEach((t=>{const n=r.util.sizeFromShape(t.shape);o.set(t.vals,e),e+=n}))}else{let i=0;t.forEach((t=>{const a="string"===n?r.backend_util.fromUint8ToStringArray(t.vals):t.vals;let s=0;for(let n=0;nt===e?1:0)),M=(d(r.Equal,E,null,"bool"),r.Equal,b((t=>Math.exp(t)))),T=(w(r.Exp,M,"float32"),r.Exp,b((t=>Math.expm1(t)))),A=(w(r.Expm1,T),r.Expm1,b((t=>Math.floor(t))));w(r.Floor,A),r.Floor; -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function C(t,e,n,i,o,a,s,u,c){const l=(0,r.buffer)([i,a],n);for(let n=0;n=c/a)throw new Error(`Invalid indices: ${r} does not index into ${u}`);for(let t=0;tt>e?1:0)),O=(d(r.Greater,N,null,"bool"),r.Greater,a(((t,e)=>t>=e?1:0))),P=(d(r.GreaterEqual,O,null,"bool"),r.GreaterEqual,a(((t,e)=>tt<=e?1:0)));d(r.LessEqual,I,null,"bool"),r.LessEqual; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function L(t,e,n){const i=(e-t)/(n-1),o=r.util.makeZerosTypedArray(n,"float32");o[0]=t;for(let t=1;tMath.log(t)));w(r.Log,D),r.Log; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function R(t,e,n,i){const o=r.util.getTypedArrayFromDType(i,r.util.sizeFromShape(n));for(let n=0;ni)&&(i=e)}o[n]=i}return o} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -const z=a(((t,e)=>Math.max(t,e))),F=(d(r.Maximum,z),r.Maximum,a(((t,e)=>Math.min(t,e)))),B=(d(r.Minimum,F),r.Minimum,a(((t,e)=>t*e))),j=p(((t,e,n,r)=>({real:t*n-e*r,imag:t*r+e*n})));d(r.Multiply,B,j),r.Multiply; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function U(t,e,n){const i=r.util.createScalarValue(-1,n);return B([],e,i,t,n)}r.Neg;const V=a(((t,e)=>t!==e?1:0));d(r.NotEqual,V,null,"bool"),r.NotEqual; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function H(t,e,n,i,o){const a=e.length,s=r.util.sizeFromShape(e),u=r.util.computeStrides(e),c=r.util.computeStrides(o),l=r.util.getTypedArrayFromDType(n,r.util.sizeFromShape(o));for(let e=0;e[0]));!function(t,e){for(let n=0;ni)throw new Error("Ragged splits must not point past values");for(let t=1;tr[t])throw new Error("Ragged splits must be sorted in ascending order")}}(n,r);let u=1;for(let t=0;t=0){const t=s[i],e=t[t.length-1]-r[a];for(let t=a;t{if(t<0||t>=n){const o=r.util.indexToLoc(i,e.length,r.util.computeStrides(e)).join(",");throw new Error(`indices[${o}] = ${t} is not in [0, ${n})`)}}))}(a,s,e[0][0]-1),0===i.length)throw new Error("params.rank must be nonzero");const c=i[0],{outSplits:l,valueSlices:h,numValues:f}=Z(a,s,t,c),d=function(t){const e=[];for(let n=0;no[e]=t))}return e}(l),p=Y(n,i,o,h,f);return[d,p[0],p[1]]} -/** - * @license - * Copyright 2022 Google LLC. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -const X=2147483647;function K(t,e,n,i,o,a,s){if(e.length>1)throw new Error("starts must be a scalar or vector");if(o.length>1)throw new Error("limits must be a scalar or vector");if(s.length>1)throw new Error("deltas must be a scalar or vector");const u=0===e.length,c=0===o.length,l=0===s.length,h=[];u||h.push(e[0]),c||h.push(o[0]),l||h.push(s[0]);for(let t=1;t0&&rn)s=0;else if(s=Math.ceil(Math.abs((r-n)/o)),s>X)throw new Error("Requires ((limit - start) / delta) <= 2147483647");d[e+1]=d[e]+s}const p=d[f],g=r.util.getArrayFromDType(n,p);let m=0;for(let e=0;en&&(n=e)}return n}static getMaxWidthValueRowID(t){const e=t.length;if(0===e)return 0;let n=0,r=t[0],i=0;for(let o=1;o"Final length of result must be equal to firstDimension.")),o}calculateOutputIndexRowSplit(t,e,n,r){const i=t.length,o=[];for(let a=0;a0&&o.length!==t[i-1])throw new Error("Invalid row split size.");return o}calculateOutputIndexValueRowID(t,e,n,r){const i=t.length,o=[];if(0===i)return[];let a=0,s=t[0];if(s>=e.length)throw new Error(`Got currentValueRowId=${s}, which is not less than ${e.length}`);let u=e[s];o.push(u);for(let c=1;c=0&&(++a,a=e.length)throw new Error(`Got nextValueRowId=${i} which is not less than ${e.length}`);u=e[i]}o.push(u)}if(o.length!==t.length)throw new Error("Invalid row ids.");return o}calculateOutputIndex(t,e,n,r){const i=this.getRowPartitionTensor(t),o=this.getRowPartitionTypeByDimension(t);switch(o){case $.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(i,e,n,r);case $.ROW_SPLITS:if(i.length-1>e.length)throw new Error(`Row partition size is greater than output size: ${i.length-1} > ${e.length}`);return this.calculateOutputIndexRowSplit(i,e,n,r);default:throw new Error(`Unsupported partition type: ${$[o]}`)}}getFirstDimensionSize(){const t=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const e=this.rowPartitionTypes[0];switch(e){case $.FIRST_DIM_SIZE:return t[0];case $.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case $.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${$[e]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const t=this.getFirstDimensionSize(),e=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let t=n.length-2;t>=0;--t)n[t]=n[t+1]*e[t+1];const i=tt(e,!1),o=r.util.getArrayFromDType(this.valuesDType,r.util.sizeFromShape(i));if(n[0]*e[0]>0){let r=this.calculateFirstParentOutputIndex(t,n[0],e[0]);for(let t=1;t<=this.raggedRank;++t){r=this.calculateOutputIndex(t-1,r,n[t],e[t])}this.setOutput(this.raggedRank,r,o,i)}return[i,o]}setOutput(t,e,n,i){if(0===n.length)return;const o=this.values,a=n;let s=i.slice();s=s.slice(t+1);const u=r.util.sizeFromShape(s),c=e.length;let l=this.defaultValue;if(l.length!==u&&1!==l.length){const t=this.defaultValueShape;(0,r.tidy)((()=>{const e=(0,r.reshape)(l,t),n=(0,r.broadcastTo)(e,s);l=n.dataSync()}))}let h=0,f=0,d=0;for(let t=0;t<=c;++t){let r=t=c){const t=n.length;r=Math.floor(t/u)}if(r>d)if(1===this.defaultValue.length)a.subarray(d*u,r*u).fill(this.defaultValue[0]),d=r;else for(;r>d;){J(a.slice(d*u),l,u),++d}r<0?(h=t+1,f=d):(h=t,f=d,d=f+1)}else++d}}}function J(t,e,n){for(let r=0;r= 0`);if(r<-1)throw new Error(`Dimension ${r} must be >= -1`);r=-1}n.push(r)}return n}function et(t,e,n,r,i,o,a,s,u,c){return new Q(t,e,n,r,i,o,a,s,u,c).compute()} -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function nt(t,e,n,i){if(t===e||t1)return r.util.makeZerosTypedArray(0,i);const o=Math.abs(Math.ceil((e-t)/n)),a=r.util.makeZerosTypedArray(o,i);e1/Math.sqrt(t)));w(r.Rsqrt,rt),r.Rsqrt; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function it(t,e,n,i,o,a,s,u,c,l){const h=[i/o,o],f=t.values,d=e.values;if(0===i)return(0,r.buffer)(n,e.dtype);const p=(0,r.buffer)(h,e.dtype);"string"==typeof c||"number"==typeof c?p.values.fill(c):"boolean"==typeof c&&p.values.fill(+c);for(let t=0;t=i/o)throw new Error(`Invalid indices: ${r} does not index into ${n}`);for(let n=0;n1/(1+Math.exp(-t))));x(r.Sigmoid,(t=>1/(1+Math.exp(-t)))),r.Sigmoid; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function at(t,e,n,i,o){const a=r.slice_util.isSliceContinous(i,e,n),s=r.util.sizeFromShape(n),u=r.util.computeStrides(i);if(a){const n=r.slice_util.computeFlatOffset(e,u);return"string"===o?t.slice(n,n+s):t.subarray(n,n+s)}const c="string"===o?r.backend_util.fromUint8ToStringArray(t):t,l=(0,r.buffer)(i,o,c),h=(0,r.buffer)(n,o);for(let t=0;tt+e[n]));h.set(l.get(...r),...n)}return"string"===o?r.backend_util.fromStringArrayToUint8(h.values):h.values}r.Slice; -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function st(t,e,n,i,o,a,s){const u=e[0],c=a[0],l=new Array(c),h=new Array(u),f=e[1];if(0===c){if(0!==u)throw new Error(r.backend_util.getSparseFillEmptyRowsIndicesDenseShapeMismatch(u));return[r.util.getArrayFromDType(n,0),[0,f],r.util.getArrayFromDType(o,0),l,h]}let d=!0,p=0;const g=new Array(c).fill(0);for(let e=0;e=c)throw new Error(r.backend_util.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(e,n,c));++g[n],d=d&&n>=p,p=n}let m=!0;for(let t=0;t0&&(g[t]+=g[t-1])}if(m&&d){const e=t,n=i;for(let t=0;t0){d[f-1]=1;for(let t=f-2;t>=0;--t)d[t]=d[t+1]*i[t+1]}const p=[];if(u>0){p[u-1]=1;for(let t=u-2;t>=0;--t)p[t]=p[t+1]*c[t+1]}const g=r.util.getArrayFromDType(n,s*u);for(let e=0;e0?o[u-1]+1:0;if(h<0)throw new Error(r.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());const f=e.slice();f[0]=h;const d=f.reduce(((t,e)=>t*e),1),p=r.util.getArrayFromDType(n,d);if(0===u)return h>0&&p.fill(s),[p,f];if(h<=0)throw new Error(r.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let g=0,m=1,v=0,y=o[g];for(;;){let e=0;if(m=e)throw new Error(r.backend_util.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(y<0||y>=h)throw new Error(r.backend_util.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(y,h));y>v&&p.fill(s,v*l,y*l);for(let e=g;e=c[0])throw new Error(r.backend_util.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(e,i[e],c[0]));for(let e=0;eu)break}return vMath.sqrt(t))),ht=(x(r.Sqrt,(t=>Math.sqrt(t))),r.Sqrt,a(((t,e)=>{const n=t-e;return n*n})));d(r.SquaredDifference,ht),r.SquaredDifference; -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function ft(t,e,n,i){const o=(0,r.buffer)(t,e.dtype);for(let t=0;t0?0:a-s);let f=0;f+=u*this.leftPad.length;for(let e=0;et.forEach((t=>d[p++]=t));for(let t=0;t0){g(t[h+l-1]);for(let t=0;t0){let t=e[0];if(0!==t)throw new Error(`First split value must be 0, got ${t}`);for(let r=1;r=t;if(i=i&&e[r]<=n,!i)throw new Error(`Invalid split value ${e[r]}, must be in [${t}, ${n}]`);t=e[r]}if(t!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${t}`)}const o=i-1,a=r.util.getArrayFromDType("int32",i);if(0===n||0===i){const t=new Array(n);for(let t=0;t<=o;++t)a[t]=0;return[t,a]}a[0]=0;for(let t=1;t<=o;++t){const n=e[t]-e[t-1];let r=0;this.nGramWidths.forEach((t=>{r+=this.getNumNGrams(n,t)})),this.preserveShort&&n>0&&0===r&&(r=1),a[t]=a[t-1]+r}const s=new Array(a[o]);for(let n=0;n{const a=e[n+1]-e[n],u=this.getNumNGrams(a,o);this.createNGrams(t,r,s,i,u,o),i+=u})),this.preserveShort&&i===a[n]){const o=e[n+1]-e[n];if(0===o)continue;const a=o+2*this.padWidth,u=1;this.createNGrams(t,r,s,i,u,a)}}return[s,a]}}function pt(t,e,n,r,i,o,a,s){return new dt(n,r,i,o,a,s).compute(t,e)} -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function gt(t,e,n,r){if(!t.length)return;if(0===e.length){for(let e=0;et-e)),bt=p(((t,e,n,r)=>({real:t-n,imag:e-r})));d(r.Sub,yt,bt),r.Sub; -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function xt(t,e){const n=new Array(t.rank);for(let r=0;r{const n=e.value-t.value;return 0===n?t.index-e.index:n};function _t(t,e,n=0,i=t.length-1){for(;i>n;){if(i-n>600){const r=i-n+1,o=e-n+1,a=Math.log(r),s=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*s*(r-s)/r)*Math.sign(o-r/2);_t(t,e,Math.max(n,Math.floor(e-o*s/r+u)),Math.min(i,Math.floor(e+(r-o)*s/r+u)))}const o=t[e];let a=n,s=i;for(r.util.swap(t,n,e),wt(t[i],o)>0&&r.util.swap(t,n,i);a0;)s-=1}0===wt(t[n],o)?r.util.swap(t,n,s):(s+=1,r.util.swap(t,s,i)),s<=e&&(n=s+1),e<=s&&(i=s-1)}}function St(t,e,n,i,o){const a=e[e.length-1],[s,u]=[t.length/a,a],c=r.util.getTypedArrayFromDType(n,s*i),l=r.util.getTypedArrayFromDType("int32",s*i);for(let e=0;ea[e]={value:t,index:e})),i{for(let n=0;n!1),(t=>{t&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")})),function(t){t[t.DT_INVALID=0]="DT_INVALID",t[t.DT_FLOAT=1]="DT_FLOAT",t[t.DT_DOUBLE=2]="DT_DOUBLE",t[t.DT_INT32=3]="DT_INT32",t[t.DT_UINT8=4]="DT_UINT8",t[t.DT_INT16=5]="DT_INT16",t[t.DT_INT8=6]="DT_INT8",t[t.DT_STRING=7]="DT_STRING",t[t.DT_COMPLEX64=8]="DT_COMPLEX64",t[t.DT_INT64=9]="DT_INT64",t[t.DT_BOOL=10]="DT_BOOL",t[t.DT_QINT8=11]="DT_QINT8",t[t.DT_QUINT8=12]="DT_QUINT8",t[t.DT_QINT32=13]="DT_QINT32",t[t.DT_BFLOAT16=14]="DT_BFLOAT16",t[t.DT_QINT16=15]="DT_QINT16",t[t.DT_QUINT16=16]="DT_QUINT16",t[t.DT_UINT16=17]="DT_UINT16",t[t.DT_COMPLEX128=18]="DT_COMPLEX128",t[t.DT_HALF=19]="DT_HALF",t[t.DT_RESOURCE=20]="DT_RESOURCE",t[t.DT_VARIANT=21]="DT_VARIANT",t[t.DT_UINT32=22]="DT_UINT32",t[t.DT_UINT64=23]="DT_UINT64",t[t.DT_FLOAT_REF=101]="DT_FLOAT_REF",t[t.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",t[t.DT_INT32_REF=103]="DT_INT32_REF",t[t.DT_UINT8_REF=104]="DT_UINT8_REF",t[t.DT_INT16_REF=105]="DT_INT16_REF",t[t.DT_INT8_REF=106]="DT_INT8_REF",t[t.DT_STRING_REF=107]="DT_STRING_REF",t[t.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",t[t.DT_INT64_REF=109]="DT_INT64_REF",t[t.DT_BOOL_REF=110]="DT_BOOL_REF",t[t.DT_QINT8_REF=111]="DT_QINT8_REF",t[t.DT_QUINT8_REF=112]="DT_QUINT8_REF",t[t.DT_QINT32_REF=113]="DT_QINT32_REF",t[t.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",t[t.DT_QINT16_REF=115]="DT_QINT16_REF",t[t.DT_QUINT16_REF=116]="DT_QUINT16_REF",t[t.DT_UINT16_REF=117]="DT_UINT16_REF",t[t.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",t[t.DT_HALF_REF=119]="DT_HALF_REF",t[t.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",t[t.DT_VARIANT_REF=121]="DT_VARIANT_REF",t[t.DT_UINT32_REF=122]="DT_UINT32_REF",t[t.DT_UINT64_REF=123]="DT_UINT64_REF"}(S||(S={})),function(t){let e;!function(t){t[t.LEGACY=0]="LEGACY",t[t.V1=1]="V1",t[t.V2=2]="V2"}(e=t.CheckpointFormatVersion||(t.CheckpointFormatVersion={}))}(E||(E={})); -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -const M={};function T(t){return M[t]} -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function A(t,e,n,r,i){const o=e.inputParams[t];if(o&&void 0!==o.inputIndexStart){const t=o.inputIndexStart,a=0===o.inputIndexEnd?void 0:void 0===o.inputIndexEnd?t+1:o.inputIndexEnd;if("tensor"===o.type)return C(e.inputNames[o.inputIndexStart],n,r,i);if("tensors"===o.type){return e.inputNames.slice(t,a).map((t=>C(t,n,r,i)))}const s=C(e.inputNames.slice(t)[0],n,r,i),u=s.dataSync();return"number"===o.type?u[0]:_.util.toNestedArray(s.shape,u)}const a=e.attrParams[t];return a&&a.value}function C(t,e,n,r){const[i,o]=O(t);if(null!=r){const t=r.getHashTableHandleByName(i);if(null!=t)return t}const a=n.currentContextIds.find((t=>!!e[N(i,t)]));return void 0!==a?e[N(i,a)][o]:void 0}function k(t,e){const[n,r,i]=O(t);return[N(n,e&&e.currentContextId),r,i]}function N(t,e){return e?`${t}-${e}`:t}function O(t){const e=t.split(":");if(1===e.length)return[t,0,void 0];const n=e[0],r=3===e.length?e[1]:void 0;return[n,Number(e[e.length-1]),r]}function P(t,e,n){let r=A("pad",t,e,n);if("explicit"===r){r=A("explicitPaddings",t,e,n);const i=[[0,0],[0,0],[0,0],[0,0]];for(let t=0;t<4;t++)i[t][0]=r[2*t],i[t][1]=r[2*t+1];return i}return r}function I(t){return t.kept?t:(0,_.clone)(t)} -/** - * @license - * Copyright 2023 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -const L=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],D=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],R=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],z=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],F=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],B=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],j=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],U=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],V=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],H=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],G=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],Z=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}],W=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}],Y=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],q=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}],X=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],K=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],$=[{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],Q=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}]; -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -class J{constructor(){const t=[].concat(...[r,i,o,a,s,u,c,l,h,f,d,p,g,m,v,y,b,x,w].map((t=>t.json)));this.opMappers=t.reduce(((t,e)=>(t[e.tfOpName]=e,t)),{})}static get Instance(){return this._instance||(this._instance=new this)}transformGraph(t,e={}){const n=t.node,r=[],i=[],o=[],a=n.reduce(((t,e)=>(t[e.name]=this.mapNode(e),e.op.startsWith("Placeholder")?r.push(t[e.name]):"Const"===e.op?i.push(t[e.name]):null!=e.input&&0!==e.input.length||o.push(t[e.name]),t)),{});let s=[];const u=[];let c={},l={};null!=e&&(c=this.mapSignatureEntries(e.inputs),l=this.mapSignatureEntries(e.outputs));const h=Object.keys(a);h.forEach((t=>{const e=a[t];e.inputNames.forEach(((t,n)=>{const[r,,i]=k(t),o=a[r];if(null!=o.outputs){const t=o.outputs.indexOf(i);if(-1!==t){const i=`${r}:${t}`;e.inputNames[n]=i}}e.inputs.push(o),o.children.push(e)}))})),0===Object.keys(l).length?h.forEach((t=>{const e=a[t];0===e.children.length&&u.push(e)})):Object.keys(l).forEach((t=>{const[e]=k(t),n=a[e];null!=n&&(n.signatureKey=l[t],u.push(n))})),Object.keys(c).length>0?Object.keys(c).forEach((t=>{const[e]=k(t),n=a[e];n&&(n.signatureKey=c[t],s.push(n))})):s=r;let f={};null!=t.library&&null!=t.library.function&&(f=t.library.function.reduce(((t,e)=>(t[e.signature.name]=this.mapFunction(e),t)),{}));const d={nodes:a,inputs:s,outputs:u,weights:i,placeholders:r,signature:e,functions:f};return o.length>0&&(d.initNodes=o),d}mapSignatureEntries(t){return Object.keys(t||{}).reduce(((e,n)=>(e[t[n].name]=n,e)),{})}mapNode(t){const e=T(t.op)||this.opMappers[t.op]||{};null==t.attr&&(t.attr={});const n={name:t.name,op:t.op,category:e.category,inputNames:(t.input||[]).map((t=>t.startsWith("^")?t.slice(1):t)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:t.attr,outputs:e.outputs};return null!=e.inputs&&(n.inputParams=e.inputs.reduce(((t,e)=>(t[e.name]={type:e.type,inputIndexStart:e.start,inputIndexEnd:e.end},t)),{})),null!=e.attrs&&(n.attrParams=e.attrs.reduce(((e,n)=>{const r=n.type;let i;switch(n.type){case"string":i=et(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=et(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":i=ht(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ht(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":i=rt(t.attr,n.tfName,n.defaultValue||0),void 0===i&&n.tfDeprecatedName&&(i=rt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":i=lt(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=lt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":i=nt(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=nt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":i=dt(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=dt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":i=ct(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ct(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":i=ft(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ft(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":i=at(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=at(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":i=st(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=st(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":i=ot(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ot(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${t.op}`)}return e[n.name]={value:i,type:r},e}),{})),n}mapFunction(t){const e=t.nodeDef,n=[];let r={};null!=e&&(r=e.reduce(((t,e)=>(t[e.name]=this.mapNode(e),"Const"===e.op&&n.push(t[e.name]),t)),{}));const i=[],o=[];t.signature.inputArg.forEach((t=>{const[e]=k(t.name),n={name:e,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:it(t.type),type:"dtype"}},children:[]};n.signatureKey=t.name,i.push(n),r[e]=n}));Object.keys(r).forEach((t=>{const e=r[t];e.inputNames.forEach(((t,n)=>{const[i,,o]=k(t),a=r[i];if(null!=a.outputs){const t=a.outputs.indexOf(o);if(-1!==t){const r=`${i}:${t}`;e.inputNames[n]=r}}e.inputs.push(a),a.children.push(e)}))}));const a=t.ret;t.signature.outputArg.forEach((t=>{const[e,n]=k(a[t.name]),i=r[e];null!=i&&(i.defaultOutput=n,o.push(i))}));const s=this.mapArgsToSignature(t);return{nodes:r,inputs:i,outputs:o,weights:n,placeholders:[],signature:s}}mapArgsToSignature(t){return{methodName:t.signature.name,inputs:t.signature.inputArg.reduce(((t,e)=>(t[e.name]=this.mapArgToTensorInfo(e),t)),{}),outputs:t.signature.outputArg.reduce(((e,n)=>(e[n.name]=this.mapArgToTensorInfo(n,t.ret),e)),{})}}mapArgToTensorInfo(t,e){let n=t.name;return null!=e&&(n=e[n]),{name:n,dtype:t.type}}}function tt(t,e){const n=Array.isArray(t)?String.fromCharCode.apply(null,t):function(t){const e=(0,_.env)().global;if(void 0!==e.atob)return e.atob(t);if("undefined"!=typeof Buffer)return new Buffer(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(t);return e?n:n.toLowerCase()}function et(t,e,n,r=!1){const i=t[e];return null!=i?tt(i.s,r):n}function nt(t,e,n){const r=t[e];return r?r.b:n}function rt(t,e,n){const r=t[e]||{},i=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof i?i:parseInt(i,10)}function it(t){switch("string"==typeof t&&(t=S[t]),t){case S.DT_FLOAT:case S.DT_HALF:return"float32";case S.DT_INT32:case S.DT_INT64:case S.DT_INT8:case S.DT_UINT8:return"int32";case S.DT_BOOL:return"bool";case S.DT_DOUBLE:return"float32";case S.DT_STRING:return"string";default:return null}}function ot(t,e,n){const r=t[e];return r&&r.func?r.func.name:n}function at(t,e,n){const r=t[e];return r&&r.type?it(r.type):n}function st(t,e,n){const r=t[e];return r&&r.list&&r.list.type?r.list.type.map((t=>it(t))):n}function ut(t){if(!t.unknownRank)return null!=t.dim?t.dim.map((t=>"number"==typeof t.size?t.size:parseInt(t.size,10))):[]}function ct(t,e,n){const r=t[e];return r&&r.shape?ut(r.shape):n}function lt(t,e,n){const r=t[e];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map((t=>"number"==typeof t?t:parseInt(t,10))):n}function ht(t,e,n,r=!1){const i=t[e];return i&&i.list&&i.list.s?i.list.s.map((t=>tt(t,r))):n}function ft(t,e,n){const r=t[e];return r&&r.list&&r.list.shape?r.list.shape.map((t=>ut(t))):n}function dt(t,e,n){const r=t[e];return r&&r.list&&r.list.b?r.list.b:n} -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -class pt{constructor(t,e,n){this.node=t,this.tensorMap=e,this.context=n,this.inputs=[],this.attrs={},this.inputs=t.inputNames.map((t=>this.getInput(t))),null!=t.rawAttrs&&(this.attrs=Object.keys(t.rawAttrs).reduce(((t,e)=>(t[e]=this.getAttr(e),t)),{}))}getInput(t){return C(t,this.tensorMap,this.context)}getAttr(t,e){const n=this.node.rawAttrs[t];if(null!=n.tensor)return C(t,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return rt(this.node.rawAttrs,t,e);if(null!=n.s)return et(this.node.rawAttrs,t,e);if(null!=n.b)return nt(this.node.rawAttrs,t,e);if(null!=n.shape)return ct(this.node.rawAttrs,t,e);if(null!=n.type)return at(this.node.rawAttrs,t,e);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return lt(this.node.rawAttrs,t,e);if(null!=n.list.s)return ht(this.node.rawAttrs,t,e);if(null!=n.list.shape)return ft(this.node.rawAttrs,t,e);if(null!=n.list.b)return dt(this.node.rawAttrs,t,e);if(null!=n.list.type)return st(this.node.rawAttrs,t,e)}return e}}var gt=n(97611); -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function mt(t,e,n=""){if("number"!=typeof t&&"number"!=typeof e){_.util.assert(t.length===e.length,(()=>n+` Shapes ${t} and ${e} must match`));for(let r=0;rn+` Shapes ${t} and ${e} must match`))}}}function vt(t){return"number"!=typeof t&&!t.some((t=>t<0))}function yt(t,e,n){let r=bt(t,n);const i=!vt(r);if(i&&0===e.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(i&&e.forEach((t=>{r=bt(t.shape,r)})),!vt(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function bt(t,e){if("number"==typeof t)return e;if("number"==typeof e)return t;if(t.length!==e.length)throw new Error(`Incompatible ranks during merge: ${t} vs. ${e}`);const n=[];for(let r=0;r=0&&o>=0&&i!==o)throw new Error(`Incompatible shape during merge: ${t} vs. ${e}`);n[r]=i>=0?i:o}return n} -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -class xt{constructor(t,e,n,r,i,o,a){this.name=t,this.dtype=e,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=i,this.dynamicSize=o,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=(0,_.scalar)(0),(0,_.keep)(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(t){this.tensors.forEach((e=>{null!=t&&t.has(e.tensor.id)||e.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||t>=this.size())throw new Error(`Tried to read from index ${t}, but array size is: ${this.size()}`);const e=this.tensors[t];if(e.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${t} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(e.cleared=!0),e.read=!0,e.tensor}readMany(t){return t.map((t=>this.read(t)))}write(t,e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||!this.dynamicSize&&t>=this.maxSize)throw new Error(`Tried to write to index ${t}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[t]||{};if(e.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t},\n because the value dtype is ${e.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=e.shape),mt(this.elementShape,e.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${t}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been written.`);n.tensor=e,(0,_.keep)(e),n.written=!0,this.tensors[t]=n}writeMany(t,e){if(t.length!==e.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${t.length} is not the same as tensors size: ${e.length}.`);t.forEach(((t,n)=>this.write(t,e[n])))}gather(t,e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${e}`);if(t)t=t.slice(0,this.size());else{t=[];for(let e=0;e=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(t,(0,_.unstack)(e,0))}split(t,e){if(e.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`);let n=0;const r=t.map((t=>(n+=t,n)));if(n!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${e.shape}`);if(!this.dynamicSize&&t.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${t.length}), and the TensorArray is not marked as dynamically resizeable`);const i=0===n?0:e.size/n,o=[];(0,_.tidy)((()=>{e=(0,_.reshape)(e,[1,n,i]);for(let n=0;n{if(n!==t.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${t.dtype}`);mt(e,t.shape,"TensorList shape mismatch: "),(0,_.keep)(t)})),this.idTensor=(0,_.scalar)(0),this.maxNumElements=r,(0,_.keep)(this.idTensor)}get id(){return this.idTensor.id}copy(){return new wt([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(t){this.tensors.forEach((e=>{null!=t&&t.has(e.id)||e.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(t,e,n=-1){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);mt(t,this.elementShape,"TensorList shape mismatch: ");const r=yt(this.elementShape,this.tensors,t);return(0,_.tidy)((()=>{const t=this.tensors.map((t=>(0,_.reshape)(t,r)));return(0,_.stack)(t,0)}))}popBack(t,e){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=yt(this.elementShape,this.tensors,t),r=this.tensors.pop();return r.kept=!1,mt(r.shape,t,"TensorList shape mismatch: "),(0,_.reshape)(r,n)}pushBack(t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(mt(t.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");(0,_.keep)(t),this.tensors.push(t)}resize(t){if(t<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${t}`);if(-1!==this.maxNumElements&&t>this.maxNumElements)throw new Error(`TensorListResize input size ${t} is greater maxNumElement ${this.maxNumElements}.`);const e=new wt([],this.elementShape,this.elementDtype,this.maxNumElements);e.tensors.length=t;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${t} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[t])throw new Error(`element at index ${t} is null.`);mt(this.tensors[t].shape,e,"TensorList shape mismatch: ");const r=yt(this.elementShape,this.tensors,e);return(0,_.reshape)(this.tensors[t],r)}setItem(t,e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(t<0||-1!==this.maxNumElements&&t>=this.maxNumElements)throw new Error(`Trying to set element ${t} in a list with max ${this.maxNumElements} elements.`);mt(this.elementShape,e.shape,"TensorList shape mismatch: "),(0,_.keep)(e),null!=this.tensors[t]&&(this.tensors[t].kept=!1),this.tensors[t]=e}gather(t,e,n){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);mt(this.elementShape,n,"TensorList shape mismatch: "),t=t.slice(0,this.size());const r=yt(this.elementShape,this.tensors,n);return 0===t.length?(0,_.tensor)([],[0].concat(r)):(0,_.tidy)((()=>{const e=t.map((t=>(0,_.reshape)(this.tensors[t],r)));return(0,_.stack)(e,0)}))}concat(t,e){if(t&&t!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t}`);mt(this.elementShape,e,"TensorList shape mismatch: ");const n=yt(this.elementShape,this.tensors,e);return 0===this.size()?(0,_.tensor)([],[0].concat(n)):(0,_.tidy)((()=>{const t=this.tensors.map((t=>(0,_.reshape)(t,n)));return(0,_.concat)(t,0)}))}} -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -const _t=async(t,e,n)=>{switch(t.op){case"If":case"StatelessIf":{const r=A("thenBranch",t,e,n),i=A("elseBranch",t,e,n),o=A("cond",t,e,n),a=A("args",t,e,n);return(await o.data())[0]?n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[i].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=A("body",t,e,n),i=A("cond",t,e,n),o=A("args",t,e,n),a=await n.functionMap[i].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap),s=o.map((t=>t.id));let u=await a[0].data();a.forEach((t=>{t.kept||-1!==s.indexOf(t.id)||t.dispose()}));let c=o;for(;u[0];){const t=c;c=await n.functionMap[r].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);const e=c.map((t=>t.id));t.forEach((t=>{t.kept||-1!==s.indexOf(t.id)||-1!==e.indexOf(t.id)||t.dispose()}));const o=await n.functionMap[i].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);u=await o[0].data(),o.forEach((t=>{t.kept||-1!==s.indexOf(t.id)||-1!==e.indexOf(t.id)||t.dispose()}))}return c}case"LoopCond":return[I(A("pred",t,e,n))];case"Switch":{const r=A("pred",t,e,n);let i=A("data",t,e,n);return i.kept||(i=I(i)),(await r.data())[0]?[void 0,i]:[i,void 0]}case"Merge":{const r=t.inputNames.find((t=>void 0!==C(t,e,n)));if(r){return[I(C(r,e,n))]}return}case"Enter":{const r=A("frameName",t,e,n),i=A("tensor",t,e,n);return n.enterFrame(r),[I(i)]}case"Exit":{const r=A("tensor",t,e,n);return n.exitFrame(),[I(r)]}case"NextIteration":{const r=A("tensor",t,e,n);return n.nextIteration(),[I(r)]}case"TensorArrayV3":{const r=A("size",t,e,n),i=A("dtype",t,e,n),o=A("elementShape",t,e,n),a=A("dynamicSize",t,e,n),s=A("clearAfterRead",t,e,n),u=A("identicalElementShapes",t,e,n),c=A("name",t,e,n),l=new xt(c,i,r,o,u,a,s);return n.addTensorArray(l),[l.idTensor,(0,_.scalar)(1)]}case"TensorArrayWriteV3":{const r=A("tensorArrayId",t,e,n),i=A("index",t,e,n),o=A("tensor",t,e,n),a=n.getTensorArray(r.id);return a.write(i,o),[a.idTensor]}case"TensorArrayReadV3":{const r=A("tensorArrayId",t,e,n),i=A("index",t,e,n);return[n.getTensorArray(r.id).read(i)]}case"TensorArrayGatherV3":{const r=A("tensorArrayId",t,e,n),i=A("indices",t,e,n),o=A("dtype",t,e,n);return[n.getTensorArray(r.id).gather(i,o)]}case"TensorArrayScatterV3":{const r=A("tensorArrayId",t,e,n),i=A("indices",t,e,n),o=A("tensor",t,e,n),a=n.getTensorArray(r.id);return a.scatter(i,o),[a.idTensor]}case"TensorArrayConcatV3":{const r=A("tensorArrayId",t,e,n),i=n.getTensorArray(r.id),o=A("dtype",t,e,n);return[i.concat(o)]}case"TensorArraySplitV3":{const r=A("tensorArrayId",t,e,n),i=A("tensor",t,e,n),o=A("lengths",t,e,n),a=n.getTensorArray(r.id);return a.split(o,i),[a.idTensor]}case"TensorArraySizeV3":{const r=A("tensorArrayId",t,e,n),i=n.getTensorArray(r.id);return[(0,_.scalar)(i.size(),"int32")]}case"TensorArrayCloseV3":{const r=A("tensorArrayId",t,e,n),i=n.getTensorArray(r.id);return i.clearAndClose(),[i.idTensor]}case"TensorListSetItem":{const r=A("tensorListId",t,e,n),i=A("index",t,e,n),o=A("tensor",t,e,n),a=n.getTensorList(r.id);return a.setItem(i,o),[a.idTensor]}case"TensorListGetItem":{const r=A("tensorListId",t,e,n),i=A("index",t,e,n),o=A("elementShape",t,e,n),a=A("elementDType",t,e,n);return[n.getTensorList(r.id).getItem(i,o,a)]}case"TensorListScatterV2":case"TensorListScatter":{const r=A("indices",t,e,n),i=function(t,e,n,r){if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const i=Math.max(...e);if(null!=r&&-1!==r&&i>=r)throw new Error(`Max index must be < array size (${i} vs. ${r})`);const o=new wt([],n,t.dtype,r),a=(0,_.unstack)(t,0);return e.forEach(((t,e)=>{o.setItem(t,a[e])})),o}(A("tensor",t,e,n),r,A("elementShape",t,e,n),A("numElements",t,e,n));return n.addTensorList(i),[i.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=A("elementShape",t,e,n),i=A("elementDType",t,e,n);let o;o="TensorListReserve"===t.op?"numElements":"maxNumElements";const a=A(o,t,e,n),s=function(t,e,n,r){return new wt([],t,e,r)}(r,i,0,"TensorListReserve"===t.op?-1:a);return n.addTensorList(s),[s.idTensor]}case"TensorListGather":{const r=A("tensorListId",t,e,n),i=A("indices",t,e,n),o=A("elementShape",t,e,n),a=A("elementDType",t,e,n);return[n.getTensorList(r.id).gather(i,a,o)]}case"TensorListStack":{const r=A("tensorListId",t,e,n),i=A("elementShape",t,e,n),o=A("elementDType",t,e,n),a=A("numElements",t,e,n);return[n.getTensorList(r.id).stack(i,o,a)]}case"TensorListFromTensor":{const r=function(t,e,n){const r=t.dtype;if(t.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${t.shape}`);if(t.dtype!==n)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${n}`);mt(t.shape.slice(1),e,"TensorList shape mismatch: ");const i=(0,_.unstack)(t);return new wt(i,e,r)}(A("tensor",t,e,n),A("elementShape",t,e,n),A("elementDType",t,e,n));return n.addTensorList(r),[r.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const r=A("tensorListId",t,e,n),i=n.getTensorList(r.id),o=A("dtype",t,e,n),a=A("elementShape",t,e,n);return[i.concat(o,a)]}case"TensorListPushBack":{const r=A("tensorListId",t,e,n),i=A("tensor",t,e,n),o=n.getTensorList(r.id);return o.pushBack(i),[o.idTensor]}case"TensorListPopBack":{const r=A("tensorListId",t,e,n),i=A("elementShape",t,e,n),o=A("elementDType",t,e,n);return[n.getTensorList(r.id).popBack(i,o)]}case"TensorListSplit":{const r=A("tensor",t,e,n),i=A("elementShape",t,e,n),o=function(t,e,n){let r=0;const i=e.map((t=>(r+=t,r)));if(r!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${r}, and tensor's shape is: ${t.shape}`);const o=bt(t.shape.slice(1),n),a=0===r?0:t.size/r,s=(0,_.tidy)((()=>{const n=[];t=(0,_.reshape)(t,[1,r,a]);for(let r=0;rt.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Mt.i(this.size(),"int32")}async import(t,e){this.checkKeyAndValueTensor(t,e);const n=await t.data();return this.tensorMap.forEach((t=>t.dispose())),this.tensorMap.clear(),(0,_.tidy)((()=>{const t=(0,_.unstack)(e),r=n.length,i=t.length;_.util.assert(r===i,(()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${i} elements.`));for(let e=0;e{const t=[];for(let r=0;r{switch(t.category){case"arithmetic":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"BiasAdd":case"AddV2":case"Add":return[r.add(A("a",t,e,n),A("b",t,e,n))];case"AddN":return[r.addN(A("tensors",t,e,n))];case"FloorMod":case"Mod":return[r.mod(A("a",t,e,n),A("b",t,e,n))];case"Mul":return[r.mul(A("a",t,e,n),A("b",t,e,n))];case"RealDiv":case"Div":return[r.div(A("a",t,e,n),A("b",t,e,n))];case"DivNoNan":return[r.divNoNan(A("a",t,e,n),A("b",t,e,n))];case"FloorDiv":return[r.floorDiv(A("a",t,e,n),A("b",t,e,n))];case"Sub":return[r.sub(A("a",t,e,n),A("b",t,e,n))];case"Minimum":return[r.minimum(A("a",t,e,n),A("b",t,e,n))];case"Maximum":return[r.maximum(A("a",t,e,n),A("b",t,e,n))];case"Pow":return[r.pow(A("a",t,e,n),A("b",t,e,n))];case"SquaredDifference":return[r.squaredDifference(A("a",t,e,n),A("b",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"basic_math":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Abs":case"ComplexAbs":return[r.abs(A("x",t,e,n))];case"Acos":return[r.acos(A("x",t,e,n))];case"Acosh":return[r.acosh(A("x",t,e,n))];case"Asin":return[r.asin(A("x",t,e,n))];case"Asinh":return[r.asinh(A("x",t,e,n))];case"Atan":return[r.atan(A("x",t,e,n))];case"Atan2":return[r.atan2(A("x",t,e,n),A("y",t,e,n))];case"Atanh":return[r.atanh(A("x",t,e,n))];case"Ceil":return[r.ceil(A("x",t,e,n))];case"Complex":return[r.complex(A("real",t,e,n),A("imag",t,e,n))];case"Cos":return[r.cos(A("x",t,e,n))];case"Cosh":return[r.cosh(A("x",t,e,n))];case"Elu":return[r.elu(A("x",t,e,n))];case"Erf":return[r.erf(A("x",t,e,n))];case"Exp":return[r.exp(A("x",t,e,n))];case"Expm1":return[r.expm1(A("x",t,e,n))];case"Floor":return[r.floor(A("x",t,e,n))];case"Log":return[r.log(A("x",t,e,n))];case"Log1p":return[r.log1p(A("x",t,e,n))];case"Imag":return[r.imag(A("x",t,e,n))];case"Neg":return[r.neg(A("x",t,e,n))];case"Reciprocal":return[r.reciprocal(A("x",t,e,n))];case"Real":return[r.real(A("x",t,e,n))];case"Relu":return[r.relu(A("x",t,e,n))];case"Round":return[r.round(A("x",t,e,n))];case"Selu":return[r.selu(A("x",t,e,n))];case"Sigmoid":return[r.sigmoid(A("x",t,e,n))];case"Sin":return[r.sin(A("x",t,e,n))];case"Sign":return[r.sign(A("x",t,e,n))];case"Sinh":return[r.sinh(A("x",t,e,n))];case"Softplus":return[r.softplus(A("x",t,e,n))];case"Sqrt":return[r.sqrt(A("x",t,e,n))];case"Square":return[r.square(A("x",t,e,n))];case"Tanh":return[r.tanh(A("x",t,e,n))];case"Tan":return[r.tan(A("x",t,e,n))];case"ClipByValue":return[r.clipByValue(A("x",t,e,n),A("clipValueMin",t,e,n),A("clipValueMax",t,e,n))];case"Relu6":return[r.relu6(A("x",t,e,n))];case"Rsqrt":return[r.rsqrt(C(t.inputNames[0],e,n))];case"Prod":return[r.prod(A("x",t,e,n),A("axes",t,e,n))];case"LeakyRelu":return[r.leakyRelu(A("x",t,e,n),A("alpha",t,e,n))];case"Prelu":return[r.prelu(A("x",t,e,n),A("alpha",t,e,n))];case"IsNan":return[r.isNaN(C(t.inputNames[0],e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"control":return _t(t,e,n);case"convolution":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Conv1D":{const i=A("stride",t,e,n),o=A("pad",t,e,n),a=A("dataFormat",t,e,n).toUpperCase(),s=A("dilation",t,e,n);return[r.conv1d(A("x",t,e,n),A("filter",t,e,n),i,o,a,s)]}case"Conv2D":{const i=A("strides",t,e,n),o=P(t,e,n),a=A("dataFormat",t,e,n).toUpperCase(),s=A("dilations",t,e,n);return[r.conv2d(A("x",t,e,n),A("filter",t,e,n),[i[1],i[2]],o,a,[s[1],s[2]])]}case"_FusedConv2D":{const{stride:i,pad:o,dataFormat:a,dilations:s,biasArg:u,preluArg:c,activationFunc:l,leakyreluAlpha:h}=St(t,e,n);return[r.fused.conv2d({x:A("x",t,e,n),filter:A("filter",t,e,n),strides:[i[1],i[2]],pad:o,dataFormat:a,dilations:[s[1],s[2]],bias:u,activation:l,preluActivationWeights:c,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:i,pad:o,dataFormat:a,dilations:s,biasArg:u,preluArg:c,activationFunc:l,leakyreluAlpha:h}=St(t,e,n);return[r.fused.depthwiseConv2d({x:A("x",t,e,n),filter:A("filter",t,e,n),strides:[i[1],i[2]],pad:o,dataFormat:a,dilations:[s[1],s[2]],bias:u,activation:l,preluActivationWeights:c,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const i=A("outputShape",t,e,n),o=A("strides",t,e,n),a=P(t,e,n);return[r.conv2dTranspose(A("x",t,e,n),A("filter",t,e,n),i,[o[1],o[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const i=A("strides",t,e,n),o=P(t,e,n),a=A("dilations",t,e,n),s=A("dataFormat",t,e,n).toUpperCase();return[r.depthwiseConv2d(A("input",t,e,n),A("filter",t,e,n),[i[1],i[2]],o,s,[a[1],a[2]])]}case"Conv3D":{const i=A("strides",t,e,n),o=A("pad",t,e,n),a=A("dataFormat",t,e,n).toUpperCase(),s=A("dilations",t,e,n);return[r.conv3d(A("x",t,e,n),A("filter",t,e,n),[i[1],i[2],i[3]],o,a,[s[1],s[2],s[3]])]}case"AvgPool":{const i=A("strides",t,e,n),o=A("pad",t,e,n),a=A("kernelSize",t,e,n);return[r.avgPool(A("x",t,e,n),[a[1],a[2]],[i[1],i[2]],o)]}case"MaxPool":{const i=A("strides",t,e,n),o=A("pad",t,e,n),a=A("kernelSize",t,e,n);return[r.maxPool(A("x",t,e,n),[a[1],a[2]],[i[1],i[2]],o)]}case"MaxPoolWithArgmax":{const i=A("strides",t,e,n),o=A("pad",t,e,n),a=A("kernelSize",t,e,n),s=A("includeBatchInIndex",t,e,n),{result:u,indexes:c}=r.maxPoolWithArgmax(A("x",t,e,n),[a[1],a[2]],[i[1],i[2]],o,s);return[u,c]}case"AvgPool3D":{const i=A("strides",t,e,n),o=A("pad",t,e,n),a=A("kernelSize",t,e,n);return[r.avgPool3d(A("x",t,e,n),[a[1],a[2],a[3]],[i[1],i[2],i[3]],o)]}case"MaxPool3D":{const i=A("strides",t,e,n),o=A("pad",t,e,n),a=A("kernelSize",t,e,n);return[r.maxPool3d(A("x",t,e,n),[a[1],a[2],a[3]],[i[1],i[2],i[3]],o)]}case"Dilation2D":{const i=A("strides",t,e,n),o=A("pad",t,e,n),a=A("dilations",t,e,n),s=i[1],u=i[2],c=a[1],l=a[2];return[r.dilation2d(A("x",t,e,n),A("filter",t,e,n),[s,u],o,[c,l],"NHWC")]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"creation":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Fill":{const i=A("shape",t,e,n),o=A("dtype",t,e,n),a=A("value",t,e,n);return[r.fill(i,a,o)]}case"LinSpace":{const i=A("start",t,e,n),o=A("stop",t,e,n),a=A("num",t,e,n);return[r.linspace(i,o,a)]}case"Multinomial":{const i=A("logits",t,e,n),o=A("numSamples",t,e,n),a=A("seed",t,e,n);return[r.multinomial(i,o,a)]}case"OneHot":{const i=A("indices",t,e,n),o=A("depth",t,e,n),a=A("onValue",t,e,n),s=A("offValue",t,e,n),u=A("dtype",t,e,n);return[r.oneHot(i,o,a,s,u)]}case"Ones":return[r.ones(A("shape",t,e,n),A("dtype",t,e,n))];case"OnesLike":return[r.onesLike(A("x",t,e,n))];case"RandomStandardNormal":return[r.randomStandardNormal(A("shape",t,e,n),A("dtype",t,e,n),A("seed",t,e,n))];case"RandomUniform":return[r.randomUniform(A("shape",t,e,n),A("minval",t,e,n),A("maxval",t,e,n),A("dtype",t,e,n))];case"Range":{const i=A("start",t,e,n),o=A("stop",t,e,n),a=A("step",t,e,n);return[r.range(i,o,a,A("dtype",t,e,n))]}case"TruncatedNormal":{const i=A("shape",t,e,n),o=A("mean",t,e,n),a=A("stdDev",t,e,n),s=A("seed",t,e,n);return[r.truncatedNormal(i,o,a,A("dtype",t,e,n),s)]}case"Zeros":return[r.zeros(A("shape",t,e,n),A("dtype",t,e,n))];case"ZerosLike":return[r.zerosLike(A("x",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"dynamic":return(async(t,e,n,r,i=gt)=>{switch(t.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:o,maxOutputSize:a,iouThreshold:s,scoreThreshold:u,softNmsSigma:c}=Et(t,e,n),l=await i.image.nonMaxSuppressionWithScoreAsync(r,o,a,s,u,c);return[l.selectedIndices,l.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:o,maxOutputSize:a,iouThreshold:s,scoreThreshold:u}=Et(t,e,n),c=A("padToMaxOutputSize",t,e,n),l=await i.image.nonMaxSuppressionPaddedAsync(r,o,a,s,u,c);return[l.selectedIndices,l.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:o,maxOutputSize:a,iouThreshold:s,scoreThreshold:u}=Et(t,e,n);return[await i.image.nonMaxSuppressionAsync(r,o,a,s,u)]}case"Where":{const r=i.cast(A("condition",t,e,n),"bool"),o=[await i.whereAsync(r)];return r.dispose(),o}case"ListDiff":return i.setdiff1dAsync(A("x",t,e,n),A("y",t,e,n));default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n);case"evaluation":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"LowerBound":{const i=A("sortedSequence",t,e,n),o=A("values",t,e,n);return[r.lowerBound(i,o)]}case"TopKV2":{const i=A("x",t,e,n),o=A("k",t,e,n),a=A("sorted",t,e,n),s=r.topk(i,o,a);return[s.values,s.indices]}case"UpperBound":{const i=A("sortedSequence",t,e,n),o=A("values",t,e,n);return[r.upperBound(i,o)]}case"Unique":{const i=A("x",t,e,n),o=r.unique(i);return[o.values,o.indices]}case"UniqueV2":{const i=A("x",t,e,n),o=A("axis",t,e,n),a=r.unique(i,o);return[a.values,a.indices]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"image":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"ResizeBilinear":{const i=A("images",t,e,n),o=A("size",t,e,n),a=A("alignCorners",t,e,n),s=A("halfPixelCenters",t,e,n);return[r.image.resizeBilinear(i,[o[0],o[1]],a,s)]}case"ResizeNearestNeighbor":{const i=A("images",t,e,n),o=A("size",t,e,n),a=A("alignCorners",t,e,n),s=A("halfPixelCenters",t,e,n);return[r.image.resizeNearestNeighbor(i,[o[0],o[1]],a,s)]}case"CropAndResize":{const i=A("image",t,e,n),o=A("boxes",t,e,n),a=A("boxInd",t,e,n),s=A("cropSize",t,e,n),u=A("method",t,e,n),c=A("extrapolationValue",t,e,n);return[r.image.cropAndResize(i,o,a,s,u,c)]}case"ImageProjectiveTransformV3":{const i=A("images",t,e,n),o=A("transforms",t,e,n),a=A("outputShape",t,e,n),s=A("fillValue",t,e,n),u=A("interpolation",t,e,n),c=A("fillMode",t,e,n);return[r.image.transform(i,o,u.toLowerCase(),c.toLowerCase(),s,a)]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"graph":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Const":return e[t.name];case"PlaceholderWithDefault":const i=A("default",t,e,n);return[C(t.name,e,n)||i];case"Placeholder":return[C(t.name,e,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[I(A("x",t,e,n))];case"IdentityN":return A("x",t,e,n).map((t=>I(t)));case"Shape":return[r.tensor1d(A("x",t,e,n).shape,"int32")];case"ShapeN":return A("x",t,e,n).map((t=>r.tensor1d(t.shape)));case"Size":return[r.scalar(A("x",t,e,n).size,"int32")];case"Rank":return[r.scalar(A("x",t,e,n).rank,"int32")];case"NoOp":return[r.scalar(1)];case"Print":const o=A("x",t,e,n),a=A("data",t,e,n),s=A("message",t,e,n),u=A("summarize",t,e,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(s);for(let t=0;t((t,e,n,r=gt)=>{switch(t.op){case"Equal":return[r.equal(A("a",t,e,n),A("b",t,e,n))];case"NotEqual":return[r.notEqual(A("a",t,e,n),A("b",t,e,n))];case"Greater":return[r.greater(A("a",t,e,n),A("b",t,e,n))];case"GreaterEqual":return[r.greaterEqual(A("a",t,e,n),A("b",t,e,n))];case"Less":return[r.less(A("a",t,e,n),A("b",t,e,n))];case"LessEqual":return[r.lessEqual(A("a",t,e,n),A("b",t,e,n))];case"LogicalAnd":return[r.logicalAnd(A("a",t,e,n),A("b",t,e,n))];case"LogicalNot":return[r.logicalNot(A("a",t,e,n))];case"LogicalOr":return[r.logicalOr(A("a",t,e,n),A("b",t,e,n))];case"Select":case"SelectV2":return[r.where(A("condition",t,e,n),A("a",t,e,n),A("b",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"matrices":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[r.matMul(A("a",t,e,n),A("b",t,e,n),A("transposeA",t,e,n),A("transposeB",t,e,n))];case"Einsum":return[r.einsum(A("equation",t,e,n),...A("tensors",t,e,n))];case"Transpose":return[r.transpose(A("x",t,e,n),A("perm",t,e,n))];case"_FusedMatMul":const[i,o]=A("fusedOps",t,e,n),a="biasadd"===i,s="prelu"===o,u=A("numArgs",t,e,n),c=A("leakyreluAlpha",t,e,n);if(a){if(s&&2!==u)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!s&&1!==u)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[l,h]=A("args",t,e,n);return[r.fused.matMul({a:A("a",t,e,n),b:A("b",t,e,n),transposeA:A("transposeA",t,e,n),transposeB:A("transposeB",t,e,n),bias:l,activation:o,preluActivationWeights:h,leakyreluAlpha:c})];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"normalization":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"EuclideanNorm":return[r.euclideanNorm(A("x",t,e,n),A("axis",t,e,n),A("keepDims",t,e,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[r.batchNorm(A("x",t,e,n),A("mean",t,e,n),A("variance",t,e,n),A("offset",t,e,n),A("scale",t,e,n),A("epsilon",t,e,n))];case"LRN":return[r.localResponseNormalization(A("x",t,e,n),A("radius",t,e,n),A("bias",t,e,n),A("alpha",t,e,n),A("beta",t,e,n))];case"Softmax":return[r.softmax(A("x",t,e,n))];case"LogSoftmax":return[r.logSoftmax(A("x",t,e,n))];case"SparseToDense":return[r.sparseToDense(A("sparseIndices",t,e,n),A("outputShape",t,e,n),A("sparseValues",t,e,n),A("defaultValue",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"ragged":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"RaggedGather":{const{outputNestedSplits:i,outputDenseValues:o}=r.raggedGather(A("paramsNestedSplits",t,e,n),A("paramsDenseValues",t,e,n),A("indices",t,e,n),A("outputRaggedRank",t,e,n));return i.concat(o)}case"RaggedRange":{const{rtNestedSplits:i,rtDenseValues:o}=r.raggedRange(A("starts",t,e,n),A("limits",t,e,n),A("splits",t,e,n));return[i,o]}case"RaggedTensorToTensor":return[r.raggedTensorToTensor(A("shape",t,e,n),A("values",t,e,n),A("defaultValue",t,e,n),A("rowPartitionTensors",t,e,n),A("rowPartitionTypes",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"reduction":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Max":{const i=A("axis",t,e,n),o=A("keepDims",t,e,n);return[r.max(A("x",t,e,n),i,o)]}case"Mean":{const i=A("axis",t,e,n),o=A("keepDims",t,e,n);return[r.mean(A("x",t,e,n),i,o)]}case"Min":{const i=A("axis",t,e,n),o=A("keepDims",t,e,n);return[r.min(A("x",t,e,n),i,o)]}case"Sum":{const i=A("axis",t,e,n),o=A("keepDims",t,e,n);return[r.sum(A("x",t,e,n),i,o)]}case"All":{const i=A("axis",t,e,n),o=A("keepDims",t,e,n);return[r.all(A("x",t,e,n),i,o)]}case"Any":{const i=A("axis",t,e,n),o=A("keepDims",t,e,n);return[r.any(A("x",t,e,n),i,o)]}case"ArgMax":{const i=A("axis",t,e,n);return[r.argMax(A("x",t,e,n),i)]}case"ArgMin":{const i=A("axis",t,e,n);return[r.argMin(A("x",t,e,n),i)]}case"Prod":{const i=A("axis",t,e,n),o=A("keepDims",t,e,n);return[r.prod(A("x",t,e,n),i,o)]}case"Cumprod":{const i=A("axis",t,e,n),o=A("exclusive",t,e,n),a=A("reverse",t,e,n);return[r.cumprod(A("x",t,e,n),i,o,a)]}case"Cumsum":{const i=A("axis",t,e,n),o=A("exclusive",t,e,n),a=A("reverse",t,e,n);return[r.cumsum(A("x",t,e,n),i,o,a)]}case"Bincount":const i=A("x",t,e,n),o=A("weights",t,e,n),a=A("size",t,e,n);return[r.bincount(i,o,a)];case"DenseBincount":{const i=A("x",t,e,n),o=A("weights",t,e,n),a=A("size",t,e,n),s=A("binaryOutput",t,e,n);return[r.denseBincount(i,o,a,s)]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"slice_join":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"ConcatV2":case"Concat":{const i=A("n",t,e,n),o=A("axis",t,e,n);let a=A("tensors",t,e,n);return a=a.slice(0,i),[r.concat(a,o)]}case"Gather":{const i=A("x",t,e,n),o=A("indices",t,e,n);return[r.gather(i,r.cast(o,"int32"),0)]}case"GatherV2":{const i=A("axis",t,e,n),o=A("batchDims",t,e,n),a=A("x",t,e,n),s=A("indices",t,e,n);return[r.gather(a,r.cast(s,"int32"),i,o)]}case"Reverse":{const i=A("dims",t,e,n),o=[];for(let t=0;t{const i=A("axis",t,e,n),o=A("tensors",t,e,n),a=o[0].shape,s=r.squeeze(o[0]).shape,u=o.map((t=>{const e=_.util.arraysEqual(t.shape,a);if(!e&&!_.util.arraysEqual(r.squeeze(t).shape,s))throw new Error("the input tensors shape does not match");return e?t:r.reshape(t,a)}));return[r.stack(u,i)]}));case"Unpack":{const i=A("axis",t,e,n),o=A("tensor",t,e,n);return r.unstack(o,i)}case"Tile":{const i=A("reps",t,e,n);return[r.tile(A("x",t,e,n),i)]}case"Split":case"SplitV":{const i=A("axis",t,e,n),o=A("numOrSizeSplits",t,e,n),a=A("x",t,e,n);return r.split(a,o,i)}case"ScatterNd":{const i=A("indices",t,e,n),o=A("values",t,e,n),a=A("shape",t,e,n);return[r.scatterND(i,o,a)]}case"GatherNd":{const i=A("x",t,e,n),o=A("indices",t,e,n);return[r.gatherND(i,o)]}case"SparseToDense":{const i=A("sparseIndices",t,e,n),o=A("outputShape",t,e,n),a=A("sparseValues",t,e,n),s=A("defaultValue",t,e,n);return[r.sparseToDense(i,a,o,a.dtype===s.dtype?s:r.cast(s,a.dtype))]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"sparse":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"SparseFillEmptyRows":{const{outputIndices:i,outputValues:o,emptyRowIndicator:a,reverseIndexMap:s}=r.sparse.sparseFillEmptyRows(A("indices",t,e,n),A("values",t,e,n),A("denseShape",t,e,n),A("defaultValue",t,e,n));return[i,o,a,s]}case"SparseReshape":{const{outputIndices:i,outputShape:o}=r.sparse.sparseReshape(A("inputIndices",t,e,n),A("inputShape",t,e,n),A("newShape",t,e,n));return[i,o]}case"SparseSegmentMean":return[r.sparse.sparseSegmentMean(A("data",t,e,n),A("indices",t,e,n),A("segmentIds",t,e,n))];case"SparseSegmentSum":return[r.sparse.sparseSegmentSum(A("data",t,e,n),A("indices",t,e,n),A("segmentIds",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"spectral":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"FFT":return[r.fft(A("x",t,e,n))];case"IFFT":return[r.ifft(A("x",t,e,n))];case"RFFT":return[r.rfft(A("x",t,e,n))];case"IRFFT":return[r.irfft(A("x",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"string":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"StringNGrams":{const{nGrams:i,nGramsSplits:o}=r.string.stringNGrams(A("data",t,e,n),A("dataSplits",t,e,n),A("separator",t,e,n),A("nGramWidths",t,e,n),A("leftPad",t,e,n),A("rightPad",t,e,n),A("padWidth",t,e,n),A("preserveShortSequences",t,e,n));return[i,o]}case"StringSplit":{const{indices:i,values:o,shape:a}=r.string.stringSplit(A("input",t,e,n),A("delimiter",t,e,n),A("skipEmpty",t,e,n));return[i,o,a]}case"StringToHashBucketFast":return[r.string.stringToHashBucketFast(A("input",t,e,n),A("numBuckets",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"transformation":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Cast":return[r.cast(A("x",t,e,n),A("dtype",t,e,n))];case"ExpandDims":{const i=A("axis",t,e,n);return[r.expandDims(A("x",t,e,n),i)]}case"Squeeze":{const i=A("axis",t,e,n);return[r.squeeze(A("x",t,e,n),i)]}case"Reshape":return[r.reshape(A("x",t,e,n),A("shape",t,e,n))];case"MirrorPad":return[r.mirrorPad(A("x",t,e,n),A("padding",t,e,n),A("mode",t,e,n))];case"PadV2":case"Pad":return[r.pad(A("x",t,e,n),A("padding",t,e,n),A("constantValue",t,e,n))];case"SpaceToBatchND":{const i=A("blockShape",t,e,n),o=A("paddings",t,e,n);return[r.spaceToBatchND(A("x",t,e,n),i,o)]}case"BatchToSpaceND":{const i=A("blockShape",t,e,n),o=A("crops",t,e,n);return[r.batchToSpaceND(A("x",t,e,n),i,o)]}case"DepthToSpace":{const i=A("blockSize",t,e,n),o=A("dataFormat",t,e,n).toUpperCase();return[r.depthToSpace(A("x",t,e,n),i,o)]}case"BroadcastTo":return[r.broadcastTo(A("x",t,e,n),A("shape",t,e,n))];case"BroadcastArgs":return[r.broadcastArgs(A("s0",t,e,n),A("s1",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"hash_table":return(async(t,e,n,r)=>{switch(t.op){case"HashTable":case"HashTableV2":{const i=r.getHashTableHandleByName(t.name);if(null!=i)return[i];{const i=A("keyDType",t,e,n),o=A("valueDType",t,e,n),a=new Tt(i,o);return r.addHashTable(t.name,a),[a.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const i=A("tableHandle",t,e,n,r),o=A("keys",t,e,n),a=A("values",t,e,n),s=r.getHashTableById(i.id);return[await s.import(o,a)]}case"LookupTableFind":case"LookupTableFindV2":{const i=A("tableHandle",t,e,n,r),o=A("keys",t,e,n),a=A("defaultValue",t,e,n),s=r.getHashTableById(i.id);return[await s.find(o,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const i=A("tableHandle",t,e,n,r);return[r.getHashTableById(i.id).tensorSize()]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n,r);case"custom":const o=T(t.op);if(o&&o.customExecutor)return o.customExecutor(new pt(t,e,n));throw TypeError(`Custom op ${t.op} is not registered.`);default:throw TypeError(`Unknown op '${t.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(t,e,n);return _.util.isPromise(o)?o.then((t=>[].concat(t))):[].concat(o)}class Ct{constructor(t={},e={},n={},r={}){this.weightMap=t,this.tensorArrayMap=e,this.tensorListMap=n,this.functionMap=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(t,e){return{id:t,frameName:e,iterationId:0}}set currentContext(t){this.contexts!==t&&(this.contexts=t,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const t=[];for(let e=0;e0===t.id&&0===t.iterationId?"":`${t.frameName}-${t.iterationId}`)).join("/"):""}enterFrame(t){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,t)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const t=Object.assign({},this.contexts[this.contexts.length-1]);t.iterationId+=1,t.id=this.lastId,this.contexts.splice(-1,1,t),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(t){return this.weightMap[t]}addTensorArray(t){this.tensorArrayMap[t.id]=t}getTensorArray(t){return this.tensorArrayMap[t]}addTensorList(t){this.tensorListMap[t.id]=t}getTensorList(t){return this.tensorListMap[t]}dispose(t){for(const e in this.tensorArrayMap)this.tensorArrayMap[e].clearAndClose(t);for(const e in this.tensorListMap)this.tensorListMap[e].clearAndClose(t)}} -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -function kt(t,e,n,r){const i=new Set,o=[];let a=null,s=null;const u=new Set,c=Object.keys(t).map((t=>O(t)[0]));let l=[];null!=r&&(l=r.map((t=>O(t.name)[0])));const h=[...e];for(;h.length>0;){const t=h.pop();(It(t)||Lt(t)||Dt(t))&&null==a&&(a=t,s=a.children.map((t=>t.name)).filter((t=>i.has(t)))),i.add(t.name),null==n[t.name]&&(-1===c.indexOf(t.name)&&-1===l.indexOf(t.name)&&(0!==t.inputs.length?t.inputs.forEach((t=>{u.has(t.name)||(u.add(t.name),h.push(t))})):o.push(t.name)))}return{inputs:t,outputs:e,usedNodes:i,missingInputs:o,dynamicNode:a,syncInputs:s}}const Nt=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],Ot=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],Pt=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function It(t){return Nt.indexOf(t.op)>=0}function Lt(t){return Ot.indexOf(t.op)>=0}function Dt(t){return Pt.indexOf(t.op)>=0} -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -class Rt{constructor(t,e){this.graph=t,this.parent=e,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,null!=t.functions&&Object.keys(t.functions).forEach((e=>{this._functionExecutorMap[e]=new Rt(t.functions[e],this)}))}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(t){const e=Object.keys(t).map((e=>t[e].map((t=>t.id))));this._weightIds=[].concat(...e),this._weightMap=t}set resourceManager(t){this._resourceManager=t}get inputs(){return this._inputs.map((t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((t=>t.signatureKey||t.name))}get outputNodes(){return this._outputs.map((t=>{const e=t.signatureKey||t.name;return t.defaultOutput?`${e}:${t.defaultOutput}`:e}))}get functions(){return Object.keys(this._functions).reduce(((t,e)=>(t[e]=this._functions[e].signature,t)),{})}getCompilationKey(t,e){const n=t.map((t=>t.name)).sort(),r=e.map((t=>t.name)).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}compile(t,e){const n=kt(t,e,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:i,syncInputs:o}=n;if(null!=i)throw new Error(`This execution contains the node '${i.name}', which has the dynamic op '${i.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${o}]`);if(r.length>0){const n=e.map((t=>t.name)),i=Object.keys(t);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${i}]. Missing the following inputs: [${r}]`)}return function(t,e,n){const{usedNodes:r,inputs:i}=n,o=[],a=Object.keys(i).map((t=>O(t)[0])).map((e=>t.nodes[e])),s=t.initNodes;a.forEach((t=>{r.has(t.name)&&o.push(t)})),t.weights.forEach((t=>{r.has(t.name)&&o.push(t)})),null!=s&&s.forEach((t=>{r.has(t.name)&&o.push(t)}));const u=new Set,c=[];for(;o.length>0;){const t=o.pop();u.add(t.name),e[t.name]||c.push(t),t.children.forEach((t=>{!u.has(t.name)&&r.has(t.name)&&t.inputs.every((t=>u.has(t.name)))&&o.push(t)}))}return c}(this.graph,this.weightMap,n)}cloneAndKeepTensor(t){if(null==t)return null;const e=t.clone();return(0,_.keep)(e),e}cloneTensorList(t){if(!t)return null;return t.map((t=>this.cloneAndKeepTensor(t)))}cloneTensorMap(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,this.cloneTensorList(e)])))}execute(t,e){this.disposeIntermediateTensors(),t=this.mapInputs(t);const n=Object.keys(t).sort();this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e);const r=n.map((t=>this.graph.nodes[O(t)[0]])),i=e.map((t=>O(t)[0]));let o=i.map((t=>this.graph.nodes[t]));0===o.length&&(o=this._outputs);const a=this.getCompilationKey(r,o);let s=this.compiledMap.get(a);null==s&&(s=this.compile(t,o),this.compiledMap.set(a,s));try{this.keepIntermediateTensors=(0,_.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(t){this.keepIntermediateTensors=!1,console.warn(t.message)}const u={},c={};return(0,_.tidy)((()=>{const n=new Ct(this.weightMap,u,c,this.functionExecutorMap),r=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(t).forEach((e=>{const[n,i]=O(e),o=[];o[i]=t[e],r[n]=o,this.keepIntermediateTensors&&(this.clonedTensorsMap[n]=this.cloneTensorList(o))}));const o=this.getFrozenTensorIds(r),a={};for(let t=0;tC(t,r,n)))}))}getFrozenTensorIds(t){const e=[].concat.apply([],Object.keys(t).map((e=>t[e])).map((t=>t.map((t=>t.id)))));return new Set(e)}checkTensorForDisposal(t,e,n,r,i,o,a){"control"!==e.category&&-1===o.indexOf(t)&&(n[t].forEach((t=>{null!=t&&(a[t.id]=(a[t.id]||0)+e.children.length)})),e.inputs.forEach((t=>{if("control"!==t.category){const e=function(t,e,n){return e[N(t,n.currentContextId)]}(t.name,n,r);null!=e&&e.forEach((t=>{if(t&&!t.kept&&!i.has(t.id)){const e=a[t.id];1===e?(t.dispose(),delete a[t.id]):null!=e&&a[t.id]--}}))}})))}async executeAsync(t,e){return this._executeAsync(t,e)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((t=>{for(const e of t)e&&!e.isDisposed&&e.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(t,e,n=!1,r={},i={}){this.disposeIntermediateTensors(),n||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e));try{this.keepIntermediateTensors=(0,_.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(t){this.keepIntermediateTensors=!1,console.warn(t.message)}const o=new Ct(this.weightMap,r,i,this.functionExecutorMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const a=await this.executeWithControlFlow(t,o,e,n),s=e.map((t=>C(t,a,o))),u=s.map((t=>t.id)),c=Object.keys(t).map((e=>t[e].id)),l=new Set([...u,...c,...this.weightIds]);return Object.values(a).forEach((t=>{t.forEach((t=>{!t||t.isDisposed||l.has(t.id)||t.dispose()}))})),null==this.parent&&o.dispose(l),s}async executeFunctionAsync(t,e,n){const r=t.reduce(((t,e,n)=>(t[this.inputs[n].name]=e,t)),{});return this._executeAsync(r,this.outputNodes,!0,e,n)}async executeWithControlFlow(t,e,n,r){const i=Object.keys(t),o=i.map((t=>this.graph.nodes[O(t)[0]])),a=n.map((t=>O(t)[0]));let s=a.map((t=>this.graph.nodes[t]));0===s.length&&(s=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:l,syncInputs:h}=kt(t,s,this.weightMap,this._initNodes),f=[...o,...this.graph.weights,...this._initNodes||[]].map((t=>({node:t,contexts:e.currentContext}))),d=Object.assign({},this.weightMap);Object.keys(t).forEach((e=>{const[n,r]=O(e),i=[];i[r]=t[e],d[n]=i}));const p={},g=this.getFrozenTensorIds(d),m={};for(;f.length>0;){const t=this.processStack(o,f,e,d,m,g,a,p,u);await Promise.all(t)}null!=l||r||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const v=s.filter((t=>!It(t)&&!C(t.name,d,e))).map((t=>t.name));if(v.length>0){let t="";throw null!=l&&(t=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${v}] from the provided inputs [${i}]. Consider providing the following inputs: [${c}]. ${t}`)}return d}processStack(t,e,n,r,i,o,a,s,u){const c=[];for(;e.length>0;){const t=e.pop();n.currentContext=t.contexts;let l="";if("Enter"===t.node.op&&A("isConstant",t.node,r,n)&&([l]=k(t.node.name,n)),null==r[t.node.name]){const h=At(t.node,r,n,this._resourceManager);l||([l]=k(t.node.name,n));const f=n.currentContext;_.util.isPromise(h)?c.push(h.then((c=>(r[l]=c,this.keepIntermediateTensors&&(this.clonedTensorsMap[l]=this.cloneTensorList(c)),n.currentContext=f,this.checkTensorForDisposal(l,t.node,r,n,o,a,s),this.processChildNodes(t.node,e,n,r,i,u),c)))):(r[l]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[l]=this.cloneTensorList(h)),this.checkTensorForDisposal(l,t.node,r,n,o,a,s),this.processChildNodes(t.node,e,n,r,i,u))}else this.processChildNodes(t.node,e,n,r,i,u)}return c}processChildNodes(t,e,n,r,i,o){t.children.forEach((t=>{const[a]=k(t.name,n);!i[a]&&o.has(t.name)&&("Merge"===t.op?t.inputNames.some((t=>!!C(t,r,n)))&&(i[a]=!0,e.push({contexts:n.currentContext,node:t})):t.inputNames.every((t=>!!C(t,r,n)))&&(i[a]=!0,e.push({contexts:n.currentContext,node:t})))}))}dispose(){Object.keys(this.weightMap).forEach((t=>this.weightMap[t].forEach((t=>t.dispose()))))}checkInputShapeAndType(t){Object.keys(t).forEach((e=>{const n=t[e],[r]=O(e),i=this.graph.nodes[r];if(i.attrParams.shape&&i.attrParams.shape.value){const t=i.attrParams.shape.value,e=t.length===n.shape.length&&n.shape.every(((e,n)=>-1===t[n]||t[n]===e));_.util.assert(e,(()=>`The shape of dict['${i.name}'] provided in model.execute(dict) must be [${t}], but was [${n.shape}]`))}i.attrParams.dtype&&i.attrParams.dtype.value&&_.util.assert(n.dtype===i.attrParams.dtype.value,(()=>`The dtype of dict['${i.name}'] provided in model.execute(dict) must be ${i.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(t){var e,n;const r={};for(const i in t){const o=null===(n=null===(e=this._signature)||void 0===e?void 0:e.inputs)||void 0===n?void 0:n[i];null!=o?r[o.name]=t[i]:r[i]=t[i]}return r}checkInputs(t){const e=Object.keys(t).filter((t=>{const[e]=O(t);return null==this.graph.nodes[e]}));if(e.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${e}] that are not part of graph`)}mapOutputs(t){return t.map((t=>{var e,n;const r=null===(n=null===(e=this._signature)||void 0===e?void 0:e.outputs)||void 0===n?void 0:n[t];return null!=r?r.name:t}),{})}checkOutputs(t){t.forEach((t=>{const[e]=O(t);if(!this.graph.nodes[e])throw new Error(`The output '${t}' is not found in the graph`)}))}}class zt{constructor(t={},e={}){this.hashTableNameToHandle=t,this.hashTableMap=e}addHashTable(t,e){this.hashTableNameToHandle[t]=e.handle,this.hashTableMap[e.id]=e}getHashTableHandleByName(t){return this.hashTableNameToHandle[t]}getHashTableById(t){return this.hashTableMap[t]}dispose(){for(const t in this.hashTableMap)this.hashTableMap[t].clearAndClose(),delete this.hashTableMap[t];for(const t in this.hashTableNameToHandle)this.hashTableNameToHandle[t].dispose(),delete this.hashTableNameToHandle[t]}}class Ft{constructor(t,e={},n=_.io){this.modelUrl=t,this.loadOptions=e,this.version="n/a",this.io=n,null==e&&(this.loadOptions={}),this.resourceManager=new zt}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}findIOHandler(){const t=this.modelUrl;if(null!=t.load)this.handler=t;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(t,this.loadOptions);else{const e=this.io.getLoadHandlers(t,this.loadOptions);if(0===e.length)e.push(this.io.browserHTTPRequest(t,this.loadOptions));else if(e.length>1)throw new Error(`Found more than one (${e.length}) load handlers for URL '${[t]}'`);this.handler=e[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const t=this.handler.load();return _.util.isPromise(t)?t.then((t=>this.loadSync(t))):this.loadSync(t)}loadSync(t){this.artifacts=t;const e=this.artifacts.modelTopology;let n=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const t=this.artifacts.userDefinedMetadata;null!=t.signature&&(n=t.signature),null!=t.structuredOutputKeys&&(this.structuredOutputKeys=t.structuredOutputKeys)}this.signature=n,this.version=`${e.versions.producer}.${e.versions.minConsumer}`;const r=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new Rt(J.Instance.transformGraph(e,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=t.modelInitializer&&null!=t.modelInitializer.node){const e=J.Instance.transformGraph(t.modelInitializer);this.initializer=new Rt(e),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=t.initializerSignature}return!0}async save(t,e){if("string"==typeof t){const e=this.io.getSaveHandlers(t);if(0===e.length)throw new Error(`Cannot find any save handlers for URL '${t}'`);if(e.length>1)throw new Error(`Found more than one (${e.length}) save handlers for URL '${t}'`);t=e[0]}if(null==t.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return t.save(this.artifacts)}addStructuredOutputNames(t){if(this.structuredOutputKeys){const e=t instanceof _.Tensor?[t]:t,n={};return e.forEach(((t,e)=>n[this.structuredOutputKeys[e]]=t)),n}return t}predict(t,e){const n=this.execute(t,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(t,e){const n=await this.executeAsync(t,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(t){var e;if(!(t instanceof _.Tensor||Array.isArray(t))){const n=null===(e=this.signature)||void 0===e?void 0:e.inputs;if(null!=n)for(const e in n){const r=n[e];null!=r.resourceId&&(t[e]=this.resourceIdToCapturedInput[r.resourceId])}return t}t=Array.isArray(t)?t:[t];const n=Object.keys(this.resourceIdToCapturedInput).length;if(t.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${t.length} input tensors provided.`);let r=0;return this.inputNodes.reduce(((e,n)=>{var i,o,a;const s=null===(a=null===(o=null===(i=this.signature)||void 0===i?void 0:i.inputs)||void 0===o?void 0:o[n])||void 0===a?void 0:a.resourceId;return e[n]=null!=s?this.resourceIdToCapturedInput[s]:t[r++],e}),{})}normalizeOutputs(t){return t=t||this.outputNodes,Array.isArray(t)?t:[t]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(t){if(this.resourceIdToCapturedInput={},this.initializerSignature){const e=this.initializerSignature.outputs,n=Object.keys(e);for(let r=0;r1?n:n[0]}async executeAsync(t,e){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),t=this.normalizeInputs(t),e=this.normalizeOutputs(e);const n=await this.executor.executeAsync(t,e);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(t){return Object.keys(t).reduce(((e,n)=>(e[n]=[t[n]],e)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&(0,_.dispose)(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function Bt(t,e={},n=_.io){if(null==t)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==e&&(e={}),e.fromTFHub&&"string"==typeof t&&(t=function(t){t.endsWith("/")||(t+="/");return`${t}model.json?tfjs-format=file`}(t));const r=new Ft(t,e,n);return await r.load(),r}},85191:function(t,e,n){"use strict";n.d(e,{Z:function(){return l}});var r=n(23279),i=n.n(r),o=n(67294);var a=function(t){var e=(0,o.useRef)(t);return e.current=t,e},s=function(t){var e=a(t);(0,o.useEffect)((function(){return function(){e.current()}}),[])},u=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},c=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i0){const t=1/r;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return r}unit(t){void 0===t&&(t=new o);const e=this.x,n=this.y,r=this.z;let i=Math.sqrt(e*e+n*n+r*r);return i>0?(i=1/i,t.x=e*i,t.y=n*i,t.z=r*i):(t.x=1,t.y=0,t.z=0),t}length(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}lengthSquared(){return this.dot(this)}distanceTo(t){const e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z;return Math.sqrt((i-e)*(i-e)+(o-n)*(o-n)+(a-r)*(a-r))}distanceSquared(t){const e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z;return(i-e)*(i-e)+(o-n)*(o-n)+(a-r)*(a-r)}scale(t,e){void 0===e&&(e=new o);const n=this.x,r=this.y,i=this.z;return e.x=t*n,e.y=t*r,e.z=t*i,e}vmul(t,e){return void 0===e&&(e=new o),e.x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e}addScaledVector(t,e,n){return void 0===n&&(n=new o),n.x=this.x+t*e.x,n.y=this.y+t*e.y,n.z=this.z+t*e.z,n}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(t){return void 0===t&&(t=new o),t.x=-this.x,t.y=-this.y,t.z=-this.z,t}tangents(t,e){const n=this.length();if(n>0){const r=a,i=1/n;r.set(this.x*i,this.y*i,this.z*i);const o=s;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,t)):(o.set(0,1,0),r.cross(o,t)),r.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}lerp(t,e,n){const r=this.x,i=this.y,o=this.z;n.x=r+(t.x-r)*e,n.y=i+(t.y-i)*e,n.z=o+(t.z-o)*e}almostEquals(t,e){return void 0===e&&(e=1e-6),!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)}almostZero(t){return void 0===t&&(t=1e-6),!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)}isAntiparallelTo(t,e){return this.negate(u),u.almostEquals(t,e)}clone(){return new o(this.x,this.y,this.z)}}o.ZERO=new o(0,0,0),o.UNIT_X=new o(1,0,0),o.UNIT_Y=new o(0,1,0),o.UNIT_Z=new o(0,0,1);const a=new o,s=new o,u=new o;class c{constructor(t){void 0===t&&(t={}),this.lowerBound=new o,this.upperBound=new o,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}setFromPoints(t,e,n,r){const i=this.lowerBound,o=this.upperBound,a=n;i.copy(t[0]),a&&a.vmult(i,i),o.copy(i);for(let e=1;eo.x&&(o.x=n.x),n.xo.y&&(o.y=n.y),n.yo.z&&(o.z=n.z),n.z=i.x&&e.y<=r.y&&n.y>=i.y&&e.z<=r.z&&n.z>=i.z}getCorners(t,e,n,r,i,o,a,s){const u=this.lowerBound,c=this.upperBound;t.copy(u),e.set(c.x,u.y,u.z),n.set(c.x,c.y,u.z),r.set(u.x,c.y,c.z),i.set(c.x,u.y,c.z),o.set(u.x,c.y,u.z),a.set(u.x,u.y,c.z),s.copy(c)}toLocalFrame(t,e){const n=h,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],c=n[6],l=n[7];this.getCorners(r,i,o,a,s,u,c,l);for(let e=0;8!==e;e++){const r=n[e];t.pointToLocal(r,r)}return e.setFromPoints(n)}toWorldFrame(t,e){const n=h,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],c=n[6],l=n[7];this.getCorners(r,i,o,a,s,u,c,l);for(let e=0;8!==e;e++){const r=n[e];t.pointToWorld(r,r)}return e.setFromPoints(n)}overlapsRay(t){const{direction:e,from:n}=t,r=1/e.x,i=1/e.y,o=1/e.z,a=(this.lowerBound.x-n.x)*r,s=(this.upperBound.x-n.x)*r,u=(this.lowerBound.y-n.y)*i,c=(this.upperBound.y-n.y)*i,l=(this.lowerBound.z-n.z)*o,h=(this.upperBound.z-n.z)*o,f=Math.max(Math.max(Math.min(a,s),Math.min(u,c)),Math.min(l,h)),d=Math.min(Math.min(Math.max(a,s),Math.max(u,c)),Math.max(l,h));return!(d<0)&&!(f>d)}}const l=new o,h=[new o,new o,new o,new o,new o,new o,new o,new o];class f{constructor(){this.matrix=[]}get(t,e){let{index:n}=t,{index:r}=e;if(r>n){const t=r;r=n,n=t}return this.matrix[(n*(n+1)>>1)+r-1]}set(t,e,n){let{index:r}=t,{index:i}=e;if(i>r){const t=i;i=r,r=t}this.matrix[(r*(r+1)>>1)+i-1]=n?1:0}reset(){for(let t=0,e=this.matrix.length;t!==e;t++)this.matrix[t]=0}setNumObjects(t){this.matrix.length=t*(t-1)>>1}}class d{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;return void 0===n[t]&&(n[t]=[]),n[t].includes(e)||n[t].push(e),this}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return!(void 0===n[t]||!n[t].includes(e))}hasAnyEventListener(t){if(void 0===this._listeners)return!1;return void 0!==this._listeners[t]}removeEventListener(t,e){if(void 0===this._listeners)return this;const n=this._listeners;if(void 0===n[t])return this;const r=n[t].indexOf(e);return-1!==r&&n[t].splice(r,1),this}dispatchEvent(t){if(void 0===this._listeners)return this;const e=this._listeners[t.type];if(void 0!==e){t.target=this;for(let n=0,r=e.length;n.499&&(n=2*Math.atan2(o,u),r=Math.PI/2,i=0),t<-.499&&(n=-2*Math.atan2(o,u),r=-Math.PI/2,i=0),void 0===n){const e=o*o,c=a*a,l=s*s;n=Math.atan2(2*a*u-2*o*s,1-2*c-2*l),r=Math.asin(2*t),i=Math.atan2(2*o*u-2*a*s,1-2*e-2*l)}}t.y=n,t.z=r,t.x=i}setFromEuler(t,e,n,r){void 0===r&&(r="XYZ");const i=Math.cos(t/2),o=Math.cos(e/2),a=Math.cos(n/2),s=Math.sin(t/2),u=Math.sin(e/2),c=Math.sin(n/2);return"XYZ"===r?(this.x=s*o*a+i*u*c,this.y=i*u*a-s*o*c,this.z=i*o*c+s*u*a,this.w=i*o*a-s*u*c):"YXZ"===r?(this.x=s*o*a+i*u*c,this.y=i*u*a-s*o*c,this.z=i*o*c-s*u*a,this.w=i*o*a+s*u*c):"ZXY"===r?(this.x=s*o*a-i*u*c,this.y=i*u*a+s*o*c,this.z=i*o*c+s*u*a,this.w=i*o*a-s*u*c):"ZYX"===r?(this.x=s*o*a-i*u*c,this.y=i*u*a+s*o*c,this.z=i*o*c-s*u*a,this.w=i*o*a+s*u*c):"YZX"===r?(this.x=s*o*a+i*u*c,this.y=i*u*a+s*o*c,this.z=i*o*c-s*u*a,this.w=i*o*a-s*u*c):"XZY"===r&&(this.x=s*o*a-i*u*c,this.y=i*u*a-s*o*c,this.z=i*o*c+s*u*a,this.w=i*o*a+s*u*c),this}clone(){return new p(this.x,this.y,this.z,this.w)}slerp(t,e,n){void 0===n&&(n=new p);const r=this.x,i=this.y,o=this.z,a=this.w;let s,u,c,l,h,f=t.x,d=t.y,g=t.z,m=t.w;return u=r*f+i*d+o*g+a*m,u<0&&(u=-u,f=-f,d=-d,g=-g,m=-m),1-u>1e-6?(s=Math.acos(u),c=Math.sin(s),l=Math.sin((1-e)*s)/c,h=Math.sin(e*s)/c):(l=1-e,h=e),n.x=l*r+h*f,n.y=l*i+h*d,n.z=l*o+h*g,n.w=l*a+h*m,n}integrate(t,e,n,r){void 0===r&&(r=new p);const i=t.x*n.x,o=t.y*n.y,a=t.z*n.z,s=this.x,u=this.y,c=this.z,l=this.w,h=.5*e;return r.x+=h*(i*l+o*c-a*u),r.y+=h*(o*l+a*s-i*c),r.z+=h*(a*l+i*u-o*s),r.w+=h*(-i*s-o*u-a*c),r}}const g=new o,m=new o;class v{constructor(t){void 0===t&&(t={}),this.id=v.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw`computeBoundingSphereRadius() not implemented for shape type ${this.type}`}volume(){throw`volume() not implemented for shape type ${this.type}`}calculateLocalInertia(t,e){throw`calculateLocalInertia() not implemented for shape type ${this.type}`}calculateWorldAABB(t,e,n,r){throw`calculateWorldAABB() not implemented for shape type ${this.type}`}}v.idCounter=0,v.types={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class y{constructor(t){void 0===t&&(t={}),this.position=new o,this.quaternion=new p,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return y.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return y.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,r){return void 0===r&&(r=new o),n.vsub(t,r),e.conjugate(b),b.vmult(r,r),r}static pointToWorldFrame(t,e,n,r){return void 0===r&&(r=new o),e.vmult(n,r),r.vadd(t,r),r}static vectorToWorldFrame(t,e,n){return void 0===n&&(n=new o),t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,r){return void 0===r&&(r=new o),e.w*=-1,e.vmult(n,r),e.w*=-1,r}}const b=new p;class x extends v{constructor(t){void 0===t&&(t={});const{vertices:e=[],faces:n=[],normals:r=[],axes:i,boundingSphereRadius:o}=t;super({type:v.types.CONVEXPOLYHEDRON}),this.vertices=e,this.faces=n,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=i?i.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const t=this.faces,e=this.vertices,n=this.uniqueEdges;n.length=0;const r=new o;for(let i=0;i!==t.length;i++){const o=t[i],a=o.length;for(let t=0;t!==a;t++){const i=(t+1)%a;e[o[t]].vsub(e[o[i]],r),r.normalize();let s=!1;for(let t=0;t!==n.length;t++)if(n[t].almostEquals(r)||n[t].almostEquals(r)){s=!0;break}s||n.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let t=0;tf&&(f=e,h=t)}const d=[];for(let t=0;t=0&&this.clipFaceAgainstHull(a,t,e,d,s,u,c)}findSeparatingAxis(t,e,n,r,i,a,s,u){const c=new o,l=new o,h=new o,f=new o,d=new o,p=new o;let g=Number.MAX_VALUE;const m=this;if(m.uniqueAxes)for(let o=0;o!==m.uniqueAxes.length;o++){n.vmult(m.uniqueAxes[o],c);const s=m.testSepAxis(c,t,e,n,r,i);if(!1===s)return!1;s0&&a.negate(a),!0}testSepAxis(t,e,n,r,i,o){x.project(this,t,n,r,w),x.project(e,t,i,o,_);const a=w[0],s=w[1],u=_[0],c=_[1];if(ae.x&&(e.x=i.x),i.ye.y&&(e.y=i.y),i.ze.z&&(e.z=i.z)}}computeWorldFaceNormals(t){const e=this.faceNormals.length;for(;this.worldFaceNormals.lengtht&&(t=r)}this.boundingSphereRadius=Math.sqrt(t)}calculateWorldAABB(t,e,n,r){const i=this.vertices;let a,s,u,c,l,h,f=new o;for(let n=0;nc)&&(c=r.x),(void 0===s||r.yl)&&(l=r.y),(void 0===u||r.zh)&&(h=r.z)}n.set(a,s,u),r.set(c,l,h)}volume(){return 4*Math.PI*this.boundingSphereRadius/3}getAveragePointLocal(t){void 0===t&&(t=new o);const e=this.vertices;for(let n=0;n0||l>0&&f<0)return!1}return-1}static project(t,e,n,r,i){const o=t.vertices.length,a=S;let s=0,u=0;const c=E,l=t.vertices;c.setZero(),y.vectorToLocalFrame(n,r,e,a),y.pointToLocalFrame(n,r,c,c);const h=c.dot(a);u=s=l[0].dot(a);for(let t=1;ts&&(s=e),es){const t=u;u=s,s=t}i[0]=s,i[1]=u}}const w=[],_=[],S=(new o,new o),E=new o;class M extends v{constructor(t){super({type:v.types.BOX}),this.halfExtents=t,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}updateConvexPolyhedronRepresentation(){const t=this.halfExtents.x,e=this.halfExtents.y,n=this.halfExtents.z,r=o,i=[new r(-t,-e,-n),new r(t,-e,-n),new r(t,e,-n),new r(-t,e,-n),new r(-t,-e,n),new r(t,-e,n),new r(t,e,n),new r(-t,e,n)],a=[new r(0,0,1),new r(0,1,0),new r(1,0,0)],s=new x({vertices:i,faces:[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],axes:a});this.convexPolyhedronRepresentation=s,s.material=this.material}calculateLocalInertia(t,e){return void 0===e&&(e=new o),M.calculateInertia(this.halfExtents,t,e),e}static calculateInertia(t,e,n){const r=t;n.x=1/12*e*(2*r.y*2*r.y+2*r.z*2*r.z),n.y=1/12*e*(2*r.x*2*r.x+2*r.z*2*r.z),n.z=1/12*e*(2*r.y*2*r.y+2*r.x*2*r.x)}getSideNormals(t,e){const n=t,r=this.halfExtents;if(n[0].set(r.x,0,0),n[1].set(0,r.y,0),n[2].set(0,0,r.z),n[3].set(-r.x,0,0),n[4].set(0,-r.y,0),n[5].set(0,0,-r.z),void 0!==e)for(let t=0;t!==n.length;t++)e.vmult(n[t],n[t]);return n}volume(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z}updateBoundingSphereRadius(){this.boundingSphereRadius=this.halfExtents.length()}forEachWorldCorner(t,e,n){const r=this.halfExtents,i=[[r.x,r.y,r.z],[-r.x,r.y,r.z],[-r.x,-r.y,r.z],[-r.x,-r.y,-r.z],[r.x,-r.y,-r.z],[r.x,r.y,-r.z],[-r.x,r.y,-r.z],[r.x,-r.y,r.z]];for(let r=0;rr.x&&(r.x=a),s>r.y&&(r.y=s),u>r.z&&(r.z=u),a0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?L.STATIC:L.DYNAMIC,typeof t.type==typeof L.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=L.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new o,this.quaternion=new p,this.initQuaternion=new p,this.previousQuaternion=new p,this.interpolatedQuaternion=new p,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new o,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new o,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new o,this.invInertia=new o,this.invInertiaWorld=new r,this.invMassSolve=0,this.invInertiaSolve=new o,this.invInertiaWorldSolve=new r,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new o(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new o(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new c,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new o,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=L.AWAKE,this.wakeUpAfterNarrowphase=!1,t===L.SLEEPING&&this.dispatchEvent(L.wakeupEvent)}sleep(){this.sleepState=L.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(t){if(this.allowSleep){const e=this.sleepState,n=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=this.sleepSpeedLimit**2;e===L.AWAKE&&nr?this.wakeUp():e===L.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(L.sleepEvent))}}updateSolveMassProperties(){this.sleepState===L.SLEEPING||this.type===L.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(t,e){return void 0===e&&(e=new o),t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e){return void 0===e&&(e=new o),this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e}addShape(t,e,n){const r=new o,i=new p;return e&&r.copy(e),n&&i.copy(n),this.shapes.push(t),this.shapeOffsets.push(r),this.shapeOrientations.push(i),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this}removeShape(t){const e=this.shapes.indexOf(t);return-1===e?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(e,1),this.shapeOffsets.splice(e,1),this.shapeOrientations.splice(e,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=null,this)}updateBoundingRadius(){const t=this.shapes,e=this.shapeOffsets,n=t.length;let r=0;for(let i=0;i!==n;i++){const n=t[i];n.updateBoundingSphereRadius();const o=e[i].length(),a=n.boundingSphereRadius;o+a>r&&(r=o+a)}this.boundingRadius=r}updateAABB(){const t=this.shapes,e=this.shapeOffsets,n=this.shapeOrientations,r=t.length,i=D,o=R,a=this.quaternion,s=this.aabb,u=z;for(let c=0;c!==r;c++){const r=t[c];a.vmult(e[c],i),i.vadd(this.position,i),a.mult(n[c],o),r.calculateWorldAABB(i,o,u.lowerBound,u.upperBound),0===c?s.copy(u):s.extend(u)}this.aabbNeedsUpdate=!1}updateInertiaWorld(t){const e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){const t=F,n=B;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}else;}applyForce(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;this.sleepState===L.SLEEPING&&this.wakeUp();const n=j;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;const n=U,r=V;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,r),this.applyForce(n,r)}applyTorque(t){this.type===L.DYNAMIC&&(this.sleepState===L.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;this.sleepState===L.SLEEPING&&this.wakeUp();const n=e,r=H;r.copy(t),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const i=G;n.cross(t,i),this.invInertiaWorld.vmult(i,i),this.angularVelocity.vadd(i,this.angularVelocity)}applyLocalImpulse(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;const n=Z,r=W;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,r),this.applyImpulse(n,r)}updateMassProperties(){const t=Y;this.invMass=this.mass>0?1/this.mass:0;const e=this.inertia,n=this.fixedRotation;this.updateAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),M.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!n?1/e.x:0,e.y>0&&!n?1/e.y:0,e.z>0&&!n?1/e.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(t,e){const n=new o;return t.vsub(this.position,n),this.angularVelocity.cross(n,e),this.velocity.vadd(e,e),e}integrate(t,e,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==L.DYNAMIC&&this.type!==L.KINEMATIC||this.sleepState===L.SLEEPING)return;const r=this.velocity,i=this.angularVelocity,o=this.position,a=this.force,s=this.torque,u=this.quaternion,c=this.invMass,l=this.invInertiaWorld,h=this.linearFactor,f=c*t;r.x+=a.x*f*h.x,r.y+=a.y*f*h.y,r.z+=a.z*f*h.z;const d=l.elements,p=this.angularFactor,g=s.x*p.x,m=s.y*p.y,v=s.z*p.z;i.x+=t*(d[0]*g+d[1]*m+d[2]*v),i.y+=t*(d[3]*g+d[4]*m+d[5]*v),i.z+=t*(d[6]*g+d[7]*m+d[8]*v),o.x+=r.x*t,o.y+=r.y*t,o.z+=r.z*t,u.integrate(this.angularVelocity,t,this.angularFactor,u),e&&(n?u.normalizeFast():u.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}L.idCounter=0,L.COLLIDE_EVENT_NAME="collide",L.DYNAMIC=C,L.STATIC=k,L.KINEMATIC=N,L.AWAKE=O,L.SLEEPY=P,L.SLEEPING=I,L.wakeupEvent={type:"wakeup"},L.sleepyEvent={type:"sleepy"},L.sleepEvent={type:"sleep"};const D=new o,R=new p,z=new c,F=new r,B=new r,j=(new r,new o),U=new o,V=new o,H=new o,G=new o,Z=new o,W=new o,Y=new o;class q{constructor(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(t,e,n){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(t,e){return 0!=(t.collisionFilterGroup&e.collisionFilterMask)&&0!=(e.collisionFilterGroup&t.collisionFilterMask)&&(0==(t.type&L.STATIC)&&t.sleepState!==L.SLEEPING||0==(e.type&L.STATIC)&&e.sleepState!==L.SLEEPING)}intersectionTest(t,e,n,r){this.useBoundingBoxes?this.doBoundingBoxBroadphase(t,e,n,r):this.doBoundingSphereBroadphase(t,e,n,r)}doBoundingSphereBroadphase(t,e,n,r){const i=X;e.position.vsub(t.position,i);const o=(t.boundingRadius+e.boundingRadius)**2;i.lengthSquared()n.lengthSquared()}aabbQuery(t,e,n){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}}const X=new o;new o,new p,new o;const K={keys:[]},$=[],Q=[];new o;new o;new o;class J extends q{constructor(){super()}collisionPairs(t,e,n){const r=t.bodies,i=r.length;let o,a;for(let t=0;t!==i;t++)for(let i=0;i!==t;i++)o=r[t],a=r[i],this.needBroadphaseCollision(o,a)&&this.intersectionTest(o,a,e,n)}aabbQuery(t,e,n){void 0===n&&(n=[]);for(let r=0;r{}}intersectWorld(t,e){return this.mode=e.mode||ht.ANY,this.result=e.result||new tt,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===e.checkCollisionResponse||e.checkCollisionResponse,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(ft),dt.length=0,t.broadphase.aabbQuery(t,ft,dt),this.intersectBodies(dt),this.hasHit}intersectBody(t,e){e&&(this.result=e,this.updateDirection());const n=this.checkCollisionResponse;if(n&&!t.collisionResponse)return;if(0==(this.collisionFilterGroup&t.collisionFilterMask)||0==(t.collisionFilterGroup&this.collisionFilterMask))return;const r=mt,i=vt;for(let e=0,o=t.shapes.length;et.boundingSphereRadius)return;const o=this[t.type];o&&o.call(this,t,e,n,r,t)}_intersectBox(t,e,n,r,i){return this._intersectConvex(t.convexPolyhedronRepresentation,e,n,r,i)}_intersectPlane(t,e,n,r,i){const a=this.from,s=this.to,u=this.direction,c=new o(0,0,1);e.vmult(c,c);const l=new o;a.vsub(n,l);const h=l.dot(c);s.vsub(n,l);if(h*l.dot(c)>0)return;if(a.distanceTo(s)=0&&t<=1&&(o.lerp(a,t,h),h.vsub(n,f),f.normalize(),this.reportIntersection(f,h,i,r,-1)),this.result.shouldStop)return;e>=0&&e<=1&&(o.lerp(a,e,h),h.vsub(n,f),f.normalize(),this.reportIntersection(f,h,i,r,-1))}}_intersectConvex(t,e,n,r,i,o){const a=Ct,s=kt,u=o&&o.faceList||null,c=t.faces,l=t.vertices,h=t.faceNormals,f=this.direction,d=this.from,p=this.to,g=d.distanceTo(p),m=u?u.length:c.length,v=this.result;for(let t=0;!v.shouldStop&&tg||this.reportIntersection(a,yt,i,r,o)}}}}_intersectTrimesh(t,e,n,r,i,o){const a=Nt,s=Rt,u=zt,c=kt,l=Ot,h=Pt,f=It,d=Dt,p=Lt,g=t.indices;t.vertices;const m=this.from,v=this.to,b=this.direction;u.position.copy(n),u.quaternion.copy(e),y.vectorToLocalFrame(n,e,b,l),y.pointToLocalFrame(n,e,m,h),y.pointToLocalFrame(n,e,v,f),f.x*=t.scale.x,f.y*=t.scale.y,f.z*=t.scale.z,h.x*=t.scale.x,h.y*=t.scale.y,h.z*=t.scale.z,f.vsub(h,l),l.normalize();const x=h.distanceSquared(f);t.tree.rayQuery(this,u,s);for(let o=0,u=s.length;!this.result.shouldStop&&o!==u;o++){const u=s[o];t.getNormal(u,a),t.getVertex(g[3*u],bt),bt.vsub(h,c);const f=l.dot(a),m=a.dot(c)/f;if(m<0)continue;l.scale(m,yt),yt.vadd(h,yt),t.getVertex(g[3*u+1],xt),t.getVertex(g[3*u+2],wt);const v=yt.distanceSquared(h);!ht.pointInTriangle(yt,xt,bt,wt)&&!ht.pointInTriangle(yt,bt,xt,wt)||v>x||(y.vectorToWorldFrame(e,a,p),y.pointToWorldFrame(n,e,yt,d),this.reportIntersection(p,d,i,r,u))}s.length=0}reportIntersection(t,e,n,r,i){const o=this.from,a=this.to,s=o.distanceTo(e),u=this.result;if(!(this.skipBackfaces&&t.dot(this.direction)>0))switch(u.hitFaceIndex=void 0!==i?i:-1,this.mode){case ht.ALL:this.hasHit=!0,u.set(o,a,t,e,n,r,s),u.hasHit=!0,this.callback(u);break;case ht.CLOSEST:(s=0&&(l=i*u-o*a)>=0&&c+le.maxForce&&(f=e.maxForce-g),y[t]+=f,d+=f>0?f:-f,e.addToWlambda(f)}if(d*dt;)e.pop();for(;e.length=0&&c.restitution>=0&&(a.restitution=u.restitution*c.restitution),a.si=i||n,a.sj=o||r,a}createFrictionEquationsFromContact(t,e){const n=t.bi,r=t.bj,i=t.si,o=t.sj,a=this.world,s=this.currentContactMaterial;let u=s.friction;const c=i.material||n.material,l=o.material||r.material;if(c&&l&&c.friction>=0&&l.friction>=0&&(u=c.friction*l.friction),u>0){const i=u*(a.frictionGravity||a.gravity).length();let o=n.invMass+r.invMass;o>0&&(o=1/o);const c=this.frictionEquationPool,l=c.length?c.pop():new oe(n,r,i*o),h=c.length?c.pop():new oe(n,r,i*o);return l.bi=h.bi=n,l.bj=h.bj=r,l.minForce=h.minForce=-i*o,l.maxForce=h.maxForce=i*o,l.ri.copy(t.ri),l.rj.copy(t.rj),h.ri.copy(t.ri),h.rj.copy(t.rj),t.ni.tangents(l.t,h.t),l.setSpookParams(s.frictionEquationStiffness,s.frictionEquationRelaxation,a.dt),h.setSpookParams(s.frictionEquationStiffness,s.frictionEquationRelaxation,a.dt),l.enabled=h.enabled=t.enabled,e.push(l,h),!0}return!1}createFrictionFromAverage(t){let e=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(e,this.frictionResult)||1===t)return;const n=this.frictionResult[this.frictionResult.length-2],r=this.frictionResult[this.frictionResult.length-1];Ze.setZero(),We.setZero(),Ye.setZero();const i=e.bi;e.bj;for(let n=0;n!==t;n++)e=this.result[this.result.length-1-n],e.bi!==i?(Ze.vadd(e.ni,Ze),We.vadd(e.ri,We),Ye.vadd(e.rj,Ye)):(Ze.vsub(e.ni,Ze),We.vadd(e.rj,We),Ye.vadd(e.ri,Ye));const o=1/t;We.scale(o,n.ri),Ye.scale(o,n.rj),r.ri.copy(n.ri),r.rj.copy(n.rj),Ze.normalize(),Ze.tangents(n.t,r.t)}getContacts(t,e,n,r,i,o,a){this.contactPointPool=i,this.frictionEquationPool=a,this.result=r,this.frictionResult=o;const s=Ke,u=$e,c=qe,l=Xe;for(let r=0,i=t.length;r!==i;r++){const i=t[r],o=e[r];let a=null;i.material&&o.material&&(a=n.getContactMaterial(i.material,o.material)||null);const h=i.type&L.KINEMATIC&&o.type&L.STATIC||i.type&L.STATIC&&o.type&L.KINEMATIC||i.type&L.KINEMATIC&&o.type&L.KINEMATIC;for(let t=0;te.boundingSphereRadius+r.boundingSphereRadius)continue;let f=null;e.material&&r.material&&(f=n.getContactMaterial(e.material,r.material)||null),this.currentContactMaterial=f||a||n.defaultContactMaterial;const d=this[e.type|r.type];if(d){let t=!1;t=e.type0){const i=Mn,o=Tn;i.copy(f[(t+1)%3]),o.copy(f[(t+2)%3]);const a=i.length(),s=o.length();i.normalize(),o.normalize();const u=Sn.dot(i),c=Sn.dot(o);if(u-a&&c-s){const t=Math.abs(r-n-d);if((null===_||t<_)&&(_=t,x=u,w=c,y=n,g.copy(e),m.copy(i),v.copy(o),b++,l))return!0}}}if(b){p=!0;const i=this.createContactEquation(a,s,t,e,u,c);g.scale(-d,i.ri),i.ni.copy(g),i.ni.negate(i.ni),g.scale(y,g),m.scale(x,m),g.vadd(m,g),v.scale(w,v),g.vadd(v,i.rj),i.ri.vadd(n,i.ri),i.ri.vsub(a.position,i.ri),i.rj.vadd(r,i.rj),i.rj.vsub(s.position,i.rj),this.result.push(i),this.createFrictionEquationsFromContact(i,this.frictionResult)}let S=h.get();const E=Cn;for(let i=0;2!==i&&!p;i++)for(let o=0;2!==o&&!p;o++)for(let h=0;2!==h&&!p;h++)if(S.set(0,0,0),i?S.vadd(f[0],S):S.vsub(f[0],S),o?S.vadd(f[1],S):S.vsub(f[1],S),h?S.vadd(f[2],S):S.vsub(f[2],S),r.vadd(S,E),E.vsub(n,E),E.lengthSquared()t.boundingSphereRadius+e.boundingSphereRadius)&&t.findSeparatingAxis(e,n,i,r,o,d,h,f)){const h=[],f=Yn;t.clipAgainstHull(n,i,e,r,o,d,-100,100,h);let p=0;for(let i=0;i!==h.length;i++){if(l)return!0;const o=this.createContactEquation(a,s,t,e,u,c),g=o.ri,m=o.rj;d.negate(o.ni),h[i].normal.negate(f),f.scale(h[i].depth,f),h[i].point.vadd(f,g),m.copy(h[i].point),g.vsub(n,g),m.vsub(r,m),g.vadd(n,g),g.vsub(a.position,g),m.vadd(r,m),m.vsub(s.position,m),this.result.push(o),p++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(o,this.frictionResult)}this.enableFrictionReduction&&p&&this.createFrictionFromAverage(p)}}sphereConvex(t,e,n,r,i,o,a,s,u,c,l){const h=this.v3pool;n.vsub(r,Pn);const f=e.faceNormals,d=e.faces,p=e.vertices,g=t.radius;let m=!1;for(let i=0;i!==p.length;i++){const h=p[i],f=Rn;o.vmult(h,f),r.vadd(f,f);const d=Dn;if(f.vsub(n,d),d.lengthSquared()0){const i=[];for(let t=0,e=y.length;t!==e;t++){const e=h.get();o.vmult(p[y[t]],e),r.vadd(e,e),i.push(e)}if(_n(i,b,n)){if(l)return!0;m=!0;const o=this.createContactEquation(a,s,t,e,u,c);b.scale(-g,o.ri),b.negate(o.ni);const f=h.get();b.scale(-S,f);const d=h.get();b.scale(-g,d),n.vsub(r,o.rj),o.rj.vadd(d,o.rj),o.rj.vadd(f,o.rj),o.rj.vadd(r,o.rj),o.rj.vsub(s.position,o.rj),o.ri.vadd(n,o.ri),o.ri.vsub(a.position,o.ri),h.release(f),h.release(d),this.result.push(o),this.createFrictionEquationsFromContact(o,this.frictionResult);for(let t=0,e=i.length;t!==e;t++)h.release(i[t]);return}for(let f=0;f!==y.length;f++){const d=h.get(),m=h.get();o.vmult(p[y[(f+1)%y.length]],d),o.vmult(p[y[(f+2)%y.length]],m),r.vadd(d,d),r.vadd(m,m);const v=In;m.vsub(d,v);const b=Ln;v.unit(b);const x=h.get(),w=h.get();n.vsub(d,w);const _=w.dot(b);b.scale(_,x),x.vadd(d,x);const S=h.get();if(x.vsub(n,S),_>0&&_*_h.length||b>h[0].length)return;m<0&&(m=0),v<0&&(v=0),b<0&&(b=0),x<0&&(x=0),m>=h.length&&(m=h.length-1),v>=h.length&&(v=h.length-1),x>=h[0].length&&(x=h[0].length-1),b>=h[0].length&&(b=h[0].length-1);const w=[];e.getRectMinMax(m,b,v,x,w);const _=w[0],S=w[1];if(g.z-f>S||g.z+f<_)return;const E=this.result;for(let u=m;u2)return}}boxHeightfield(t,e,n,r,i,o,a,s,u,c,l){return t.convexPolyhedronRepresentation.material=t.material,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,this.convexHeightfield(t.convexPolyhedronRepresentation,e,n,r,i,o,a,s,t,e,l)}convexHeightfield(t,e,n,r,i,o,a,s,u,c,l){const h=e.data,f=e.elementSize,d=t.boundingSphereRadius,p=ir,g=or,m=rr;y.pointToLocalFrame(r,o,n,m);let v=Math.floor((m.x-d)/f)-1,b=Math.ceil((m.x+d)/f)+1,x=Math.floor((m.y-d)/f)-1,w=Math.ceil((m.y+d)/f)+1;if(b<0||w<0||v>h.length||x>h[0].length)return;v<0&&(v=0),b<0&&(b=0),x<0&&(x=0),w<0&&(w=0),v>=h.length&&(v=h.length-1),b>=h.length&&(b=h.length-1),w>=h[0].length&&(w=h[0].length-1),x>=h[0].length&&(x=h[0].length-1);const _=[];e.getRectMinMax(v,x,b,w,_);const S=_[0],E=_[1];if(!(m.z-d>E||m.z+d0&&b<0){g.vsub(h,m),p.copy(d),p.normalize(),x=m.dot(p),p.scale(x,m),m.vadd(h,m);if(m.distanceTo(g)0&&!0===r||l<=0&&!1===r))return!1;null===r&&(r=l>0)}return!0}const Sn=new o,En=new o,Mn=new o,Tn=new o,An=[new o,new o,new o,new o,new o,new o],Cn=new o,kn=new o,Nn=new o,On=new o,Pn=new o,In=new o,Ln=new o,Dn=new o,Rn=new o,zn=new o,Fn=new o,Bn=new o,jn=new o,Un=new o;new o,new o;const Vn=new o,Hn=new o,Gn=new o,Zn=new o,Wn=new o,Yn=new o,qn=new o,Xn=new o,Kn=new o,$n=new o,Qn=new p,Jn=new o;new o;const tr=new o,er=new o,nr=new o,rr=new o,ir=new o,or=[0],ar=new o,sr=new o;class ur{constructor(){this.current=[],this.previous=[]}getKey(t,e){if(er[i];)i++;if(n!==r[i]){for(let t=r.length-1;t>=i;t--)r[t+1]=r[t];r[i]=n}}tick(){const t=this.current;this.current=this.previous,this.previous=t,this.current.length=0}getDiff(t,e){const n=this.current,r=this.previous,i=n.length,o=r.length;let a=0;for(let e=0;er[a];)a++;i=o===r[a],i||cr(t,o)}a=0;for(let t=0;tn[a];)a++;i=n[a]===o,i||cr(e,o)}}}function cr(t,e){t.push((4294901760&e)>>16,65535&e)}const lr=(t,e)=>t0;){delete t[e.pop()]}}}class fr extends d{constructor(t){void 0===t&&(t={}),super(),this.dt=-1,this.allowSleep=!!t.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=void 0!==t.quatNormalizeSkip?t.quatNormalizeSkip:0,this.quatNormalizeFast=void 0!==t.quatNormalizeFast&&t.quatNormalizeFast,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new o,t.gravity&&this.gravity.copy(t.gravity),t.frictionGravity&&(this.frictionGravity=new o,this.frictionGravity.copy(t.frictionGravity)),this.broadphase=void 0!==t.broadphase?t.broadphase:new J,this.bodies=[],this.hasActiveBodies=!1,this.solver=void 0!==t.solver?t.solver:new de,this.constraints=[],this.narrowphase=new Ge(this),this.collisionMatrix=new f,this.collisionMatrixPrevious=new f,this.bodyOverlapKeeper=new ur,this.shapeOverlapKeeper=new ur,this.contactmaterials=[],this.contactMaterialTable=new hr,this.defaultMaterial=new ce("default"),this.defaultContactMaterial=new ue(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(t,e){return this.contactMaterialTable.get(t.id,e.id)}collisionMatrixTick(){const t=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=t,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(t){this.constraints.push(t)}removeConstraint(t){const e=this.constraints.indexOf(t);-1!==e&&this.constraints.splice(e,1)}rayTest(t,e,n){n instanceof tt?this.raycastClosest(t,e,{skipBackfaces:!0},n):this.raycastAll(t,e,{skipBackfaces:!0},n)}raycastAll(t,e,n,r){return void 0===n&&(n={}),n.mode=ht.ALL,n.from=t,n.to=e,n.callback=r,dr.intersectWorld(this,n)}raycastAny(t,e,n,r){return void 0===n&&(n={}),n.mode=ht.ANY,n.from=t,n.to=e,n.result=r,dr.intersectWorld(this,n)}raycastClosest(t,e,n,r){return void 0===n&&(n={}),n.mode=ht.CLOSEST,n.from=t,n.to=e,n.result=r,dr.intersectWorld(this,n)}addBody(t){this.bodies.includes(t)||(t.index=this.bodies.length,this.bodies.push(t),t.world=this,t.initPosition.copy(t.position),t.initVelocity.copy(t.velocity),t.timeLastSleepy=this.time,t instanceof L&&(t.initAngularVelocity.copy(t.angularVelocity),t.initQuaternion.copy(t.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=t,this.idToBodyMap[t.id]=t,this.dispatchEvent(this.addBodyEvent))}removeBody(t){t.world=null;const e=this.bodies.length-1,n=this.bodies,r=n.indexOf(t);if(-1!==r){n.splice(r,1);for(let t=0;t!==n.length;t++)n[t].index=t;this.collisionMatrix.setNumObjects(e),this.removeBodyEvent.body=t,delete this.idToBodyMap[t.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(t){return this.idToBodyMap[t]}getShapeById(t){const e=this.bodies;for(let n=0;n=t&&i1e3*t)););this.accumulator=this.accumulator%t;const o=this.accumulator/t;for(let t=0;t!==this.bodies.length;t++){const e=this.bodies[t];e.previousPosition.lerp(e.position,o,e.interpolatedPosition),e.previousQuaternion.slerp(e.quaternion,o,e.interpolatedQuaternion),e.previousQuaternion.normalize()}this.time+=e}}internalStep(t){this.dt=t;const e=this.contacts,n=xr,r=wr,i=this.bodies.length,o=this.bodies,a=this.solver,s=this.gravity,u=this.doProfiling,c=this.profile,l=L.DYNAMIC;let h=-1/0;const f=this.constraints,d=br;s.length();const p=s.x,g=s.y,m=s.z;let v=0;for(u&&(h=pr.now()),v=0;v!==i;v++){const t=o[v];if(t.type===l){const e=t.force,n=t.mass;e.x+=n*p,e.y+=n*g,e.z+=n*m}}for(let t=0,e=this.subsystems.length;t!==e;t++)this.subsystems[t].update();u&&(h=pr.now()),n.length=0,r.length=0,this.broadphase.collisionPairs(this,n,r),u&&(c.broadphase=pr.now()-h);let y=f.length;for(v=0;v!==y;v++){const t=f[v];if(!t.collideConnected)for(let e=n.length-1;e>=0;e-=1)(t.bodyA===n[e]&&t.bodyB===r[e]||t.bodyB===n[e]&&t.bodyA===r[e])&&(n.splice(e,1),r.splice(e,1))}this.collisionMatrixTick(),u&&(h=pr.now());const b=yr,x=e.length;for(v=0;v!==x;v++)b.push(e[v]);e.length=0;const w=this.frictionEquations.length;for(v=0;v!==w;v++)d.push(this.frictionEquations[v]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(n,r,this,e,b,this.frictionEquations,d),u&&(c.narrowphase=pr.now()-h),u&&(h=pr.now()),v=0;v=0&&i.material.friction>=0&&(r.material.friction,i.material.friction),r.material.restitution>=0&&i.material.restitution>=0&&(n.restitution=r.material.restitution*i.material.restitution)),a.addEquation(n),r.allowSleep&&r.type===L.DYNAMIC&&r.sleepState===L.SLEEPING&&i.sleepState===L.AWAKE&&i.type!==L.STATIC){i.velocity.lengthSquared()+i.angularVelocity.lengthSquared()>=2*i.sleepSpeedLimit**2&&(r.wakeUpAfterNarrowphase=!0)}if(i.allowSleep&&i.type===L.DYNAMIC&&i.sleepState===L.SLEEPING&&r.sleepState===L.AWAKE&&r.type!==L.STATIC){r.velocity.lengthSquared()+r.angularVelocity.lengthSquared()>=2*r.sleepSpeedLimit**2&&(i.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(r,i,!0),this.collisionMatrixPrevious.get(r,i)||(vr.body=i,vr.contact=n,r.dispatchEvent(vr),vr.body=r,i.dispatchEvent(vr)),this.bodyOverlapKeeper.set(r.id,i.id),this.shapeOverlapKeeper.set(o.id,s.id)}for(this.emitContactEvents(),u&&(c.makeContactConstraints=pr.now()-h,h=pr.now()),v=0;v!==i;v++){const t=o[v];t.wakeUpAfterNarrowphase&&(t.wakeUp(),t.wakeUpAfterNarrowphase=!1)}for(y=f.length,v=0;v!==y;v++){const t=f[v];t.update();for(let e=0,n=t.equations.length;e!==n;e++){const n=t.equations[e];a.addEquation(n)}}a.solve(t,this),u&&(c.solve=pr.now()-h),a.removeAllEquations();const S=Math.pow;for(v=0;v!==i;v++){const e=o[v];if(e.type&l){const n=S(1-e.linearDamping,t),r=e.velocity;r.scale(n,r);const i=e.angularVelocity;if(i){const n=S(1-e.angularDamping,t);i.scale(n,i)}}}this.dispatchEvent(mr),u&&(h=pr.now());const E=this.stepnumber%(this.quatNormalizeSkip+1)==0,M=this.quatNormalizeFast;for(v=0;v!==i;v++)o[v].integrate(t,E,M);this.clearForces(),this.broadphase.dirty=!0,u&&(c.integrate=pr.now()-h),this.stepnumber+=1,this.dispatchEvent(gr);let T=!0;if(this.allowSleep)for(T=!1,v=0;v!==i;v++){const t=o[v];t.sleepTick(this.time),t.sleepState!==L.SLEEPING&&(T=!0)}this.hasActiveBodies=T}emitContactEvents(){const t=this.hasAnyEventListener("beginContact"),e=this.hasAnyEventListener("endContact");if((t||e)&&this.bodyOverlapKeeper.getDiff(_r,Sr),t){for(let t=0,e=_r.length;tDate.now()-t}new o;const gr={type:"postStep"},mr={type:"preStep"},vr={type:L.COLLIDE_EVENT_NAME,body:null,contact:null},yr=[],br=[],xr=[],wr=[],_r=[],Sr=[],Er={type:"beginContact",bodyA:null,bodyB:null},Mr={type:"endContact",bodyA:null,bodyB:null},Tr={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},Ar={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null}},94184:function(t,e){var n; -/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],l=(o=t,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));l.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[c]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,s,u=t[0]/360,c=t[1]/100,l=t[2]/100,h=c+l;switch(h>1&&(c/=h,l/=h),r=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(r=1-r),i=c+r*((n=1-l)-c),e){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},12085:function(t,e,n){var r=n(48168),i=n(4111),o={};Object.keys(r).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:r[t].channels}),Object.defineProperty(o[t],"labels",{value:r[t].labels});var e=i(t);Object.keys(e).forEach((function(n){var r=e[n];o[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var r=n.length,i=0;i1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=o},39092:function(t){"use strict";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]}},4111:function(t,e,n){var r=n(48168);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i=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)]}},6767:function(t,e,n){"use strict";var r=n(19818),i=n(12085),o=[].slice,a=["keyword","gray","hex"],s={};Object.keys(i).forEach((function(t){s[o.call(i[t].labels).sort().join("")]=t}));var u={};function c(t,e){if(!(this instanceof c))return new c(t,e);if(e&&e in a&&(e=null),e&&!(e in i))throw new Error("Unknown model: "+e);var n,l;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof c)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var h=r.get(t);if(null===h)throw new Error("Unable to parse color from string: "+t);this.model=h.model,l=i[this.model].channels,this.color=h.value.slice(0,l),this.valpha="number"==typeof h.value[l]?h.value[l]:1}else if(t.length){this.model=e||"rgb",l=i[this.model].channels;var f=o.call(t,0,l);this.color=d(f,l),this.valpha="number"==typeof t[l]?t[l]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var p=Object.keys(t);"alpha"in t&&(p.splice(p.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var g=p.sort().join("");if(!(g in s))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=s[g];var m=i[this.model].labels,v=[];for(n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return c.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var n=t.rgb(),r=this.rgb(),i=void 0===e?.5:e,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,u=1-s;return c.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue(),n.alpha()*i+r.alpha()*(1-i))}},Object.keys(i).forEach((function(t){if(-1===a.indexOf(t)){var e=i[t].channels;c.prototype[t]=function(){if(this.model===t)return new c(this);if(arguments.length)return new c(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new c(f(i[this.model][t].raw(this.color)).concat(n),t)},c[t]=function(n){return"number"==typeof n&&(n=d(o.call(arguments),e)),new c(n,t)}}})),t.exports=c},61515:function(t,e,n){"use strict";function r(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;id+l||ip+l||oh.index){var f=d-s.x-s.vx,v=p-s.y-s.vy,y=f*f+v*v;yt.r&&(t.r=t[e].r)}function d(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[c(t,e,r),t])));for(o=0,i=new Array(u);o{}};function p(){for(var t,e=0,n=arguments.length,r={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function v(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(null,t),e=e._next;--_}()}finally{_=0,function(){var t,e,n=b,r=1/0;for(;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:b=e);x=t,R(r)}(),T=0}}function D(){var t=C.now(),e=t-M;e>1e3&&(A-=e,M=t)}function R(t){_||(S&&(S=clearTimeout(S)),t-T>24?(t<1/0&&(S=setTimeout(L,t-C.now()-A)),E&&(E=clearInterval(E))):(E||(M=C.now(),E=setInterval(D,1e3)),_=1,k(L)))}P.prototype=I.prototype={constructor:P,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?N():+n)+(null==e?0:+e),this._next||x===this||(x?x._next=this:b=this,x=this),this._call=t,this._time=n,R()},stop:function(){this._call&&(this._call=null,this._time=1/0,R())}};const z=4294967296;function F(t){return t.x}function B(t){return t.y}var j=Math.PI*(3-Math.sqrt(5));function U(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=I(h),c=w("tick","end"),l=function(){let t=1;return()=>(t=(1664525*t+1013904223)%z)/z}();function h(){f(),c.call("tick",e),n1?(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,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}}function V(){var t,e,n,r,s,u=o(-30),c=1,l=1/0,h=.81;function f(n){var o,a=t.length,s=(0,i.Z)(t,F,B).visitAfter(p);for(r=n,o=0;o=l)){(t.data!==e||t.next)&&(0===f&&(g+=(f=a(n))*f),0===d&&(g+=(d=a(n))*d),g=(o=(g+v)/2))?g=o:v=o,(l=n>=(a=(m+y)/2))?m=a:y=a,i=d,!(d=d[h=l<<1|c]))return i[h]=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[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+v)/2))?g=o:v=o,(l=n>=(a=(m+y)/2))?m=a:y=a}while((h=l<<1|c)==(f=(u>=a)<<1|s>=o));return i[f]=d,i[h]=p,t}function i(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function o(t){return t[0]}function a(t){return t[1]}function s(t,e,n){var r=new u(null==e?o:e,null==n?a:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function u(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 c(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}n.d(e,{Z:function(){return s}});var l=s.prototype=u.prototype;l.copy=function(){var t,e,n=new u(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=c(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]=c(e));return n},l.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return r(this.cover(e,n),e,n,t)},l.addAll=function(t){var e,n,i,o,a=t.length,s=new Array(a),u=new Array(a),c=1/0,l=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),of&&(f=o));if(c>h||l>f)return this;for(this.cover(c,l).cover(h,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(ed||(a=c.y0)>p||(s=c.x1)=y)<<1|t>=v)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-l],g[g.length-1-l]=c)}else{var b=t-+this._x.call(null,m.data),x=e-+this._y.call(null,m.data),w=b*b+x*x;if(w=(s=(p+m)/2))?p=s:m=s,(l=a>=(u=(g+v)/2))?g=u:v=u,e=d,!(d=d[h=l<<1|c]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}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[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[f]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,n=t.length;e-1},v.prototype.set=function(t,e){var n=this.__data__,r=g(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var y,b=v,x="object"==typeof f&&f&&f.Object===Object&&f,w="object"==typeof self&&self&&self.Object===Object&&self,_=x||w||Function("return this")(),S=_.Symbol,E=Object.prototype,M=E.hasOwnProperty,T=E.toString,A=S?S.toStringTag:void 0,C=Object.prototype.toString,k=S?S.toStringTag:void 0,N=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":k&&k in Object(t)?function(t){var e=M.call(t,A),n=t[A];try{t[A]=void 0;var r=!0}catch(t){}var i=T.call(t);return r&&(e?t[A]=n:delete t[A]),i}(t):function(t){return C.call(t)}(t)},O=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},P=function(t){if(!O(t))return!1;var e=N(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},I=_["__core-js_shared__"],L=(y=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",D=Function.prototype.toString,R=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""},z=/^\[object .+?Constructor\]$/,F=Function.prototype,B=Object.prototype,j=F.toString,U=B.hasOwnProperty,V=RegExp("^"+j.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=function(t){return!(!O(t)||function(t){return!!L&&L in t}(t))&&(P(t)?V:z).test(R(t))},G=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return H(n)?n:void 0},Z=G(_,"Map"),W=G(Object,"create"),Y=Object.prototype.hasOwnProperty,q=Object.prototype.hasOwnProperty;function X(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},xt={};xt["[object Float32Array]"]=xt["[object Float64Array]"]=xt["[object Int8Array]"]=xt["[object Int16Array]"]=xt["[object Int32Array]"]=xt["[object Uint8Array]"]=xt["[object Uint8ClampedArray]"]=xt["[object Uint16Array]"]=xt["[object Uint32Array]"]=!0,xt["[object Arguments]"]=xt["[object Array]"]=xt["[object ArrayBuffer]"]=xt["[object Boolean]"]=xt["[object DataView]"]=xt["[object Date]"]=xt["[object Error]"]=xt["[object Function]"]=xt["[object Map]"]=xt["[object Number]"]=xt["[object Object]"]=xt["[object RegExp]"]=xt["[object Set]"]=xt["[object String]"]=xt["[object WeakMap]"]=!1;var wt=function(t){return function(e){return t(e)}},_t=d((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n&&x.process,o=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o})),St=_t&&_t.isTypedArray,Et=St?wt(St):function(t){return ut(t)&&bt(t.length)&&!!xt[N(t)]},Mt=Object.prototype.hasOwnProperty,Tt=function(t,e){var n=pt(t),r=!n&&dt(t),i=!n&&!r&&mt(t),o=!n&&!r&&!i&&Et(t),a=n||r||i||o,s=a?function(t,e){for(var n=-1,r=Array(t);++ns))return!1;var c=o.get(t),l=o.get(e);if(c&&l)return c==e&&l==t;var h=-1,f=!0,d=2&n?new De:void 0;for(o.set(t,e),o.set(e,t);++h0&&r(u)?n>1?t(u,n-1,r,i,o):Zt(o,u):i||(o[o.length]=u)}return o},Xn=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Kn=Math.max,$n=function(t,e,n){return e=Kn(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Kn(r.length-e,0),a=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Qn),er=function(t,e){return tr($n(t,e,ke),t+"")},nr=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o-1},or=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r=200){var c=e?null:ar(t);if(c)return je(c);a=!1,i=ze,u=new De}else u=e?[]:s;t:for(;++ro){var a=i;i=o,o=a}return i+""+o+""+(lr.isUndefined(r)?"\0":r)}function mr(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function vr(t,e){return gr(t,e.v,e.w,e.name)}fr.prototype._nodeCount=0,fr.prototype._edgeCount=0,fr.prototype.isDirected=function(){return this._isDirected},fr.prototype.isMultigraph=function(){return this._isMultigraph},fr.prototype.isCompound=function(){return this._isCompound},fr.prototype.setGraph=function(t){return this._label=t,this},fr.prototype.graph=function(){return this._label},fr.prototype.setDefaultNodeLabel=function(t){return lr.isFunction(t)||(t=lr.constant(t)),this._defaultNodeLabelFn=t,this},fr.prototype.nodeCount=function(){return this._nodeCount},fr.prototype.nodes=function(){return lr.keys(this._nodes)},fr.prototype.sources=function(){var t=this;return lr.filter(this.nodes(),(function(e){return lr.isEmpty(t._in[e])}))},fr.prototype.sinks=function(){var t=this;return lr.filter(this.nodes(),(function(e){return lr.isEmpty(t._out[e])}))},fr.prototype.setNodes=function(t,e){var n=arguments,r=this;return lr.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},fr.prototype.setNode=function(t,e){return lr.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},fr.prototype.node=function(t){return this._nodes[t]},fr.prototype.hasNode=function(t){return lr.has(this._nodes,t)},fr.prototype.removeNode=function(t){var e=this;if(lr.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],lr.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),lr.each(lr.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],lr.each(lr.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},fr.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(lr.isUndefined(e))e="\0";else{for(var n=e+="";!lr.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},fr.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},fr.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},fr.prototype.children=function(t){if(lr.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return lr.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},fr.prototype.predecessors=function(t){var e=this._preds[t];if(e)return lr.keys(e)},fr.prototype.successors=function(t){var e=this._sucs[t];if(e)return lr.keys(e)},fr.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return lr.union(e,this.successors(t))},fr.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},fr.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;lr.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),lr.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var o=n.parent(t);return void 0===o||e.hasNode(o)?(r[t]=o,o):o in r?r[o]:i(o)}return this._isCompound&&lr.each(e.nodes(),(function(t){e.setParent(t,i(t))})),e},fr.prototype.setDefaultEdgeLabel=function(t){return lr.isFunction(t)||(t=lr.constant(t)),this._defaultEdgeLabelFn=t,this},fr.prototype.edgeCount=function(){return this._edgeCount},fr.prototype.edges=function(){return lr.values(this._edgeObjs)},fr.prototype.setPath=function(t,e){var n=this,r=arguments;return lr.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},fr.prototype.setEdge=function(){var t,e,n,r,i=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(t=o.v,e=o.w,n=o.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=o,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,lr.isUndefined(n)||(n=""+n);var a=gr(this._isDirected,t,e,n);if(lr.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=r),this;if(!lr.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?r:this._defaultEdgeLabelFn(t,e,n);var s=mr(this._isDirected,t,e,n);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,dr(this._preds[e],t),dr(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},fr.prototype.edge=function(t,e,n){var r=1===arguments.length?vr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n);return this._edgeLabels[r]},fr.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?vr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n);return lr.has(this._edgeLabels,r)},fr.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?vr(this._isDirected,arguments[0]):gr(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],pr(this._preds[e],t),pr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},fr.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=lr.values(n);return e?lr.filter(r,(function(t){return t.v===e})):r}},fr.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=lr.values(n);return e?lr.filter(r,(function(t){return t.w===e})):r}},fr.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var yr={Graph:hr,version:"2.1.8"},br={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:xr(t),edges:wr(t)};return lr.isUndefined(t.graph())||(e.value=lr.clone(t.graph())),e},read:function(t){var e=new hr(t.options).setGraph(t.value);return lr.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),lr.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function xr(t){return lr.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return lr.isUndefined(n)||(i.value=n),lr.isUndefined(r)||(i.parent=r),i}))}function wr(t){return lr.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return lr.isUndefined(e.name)||(r.name=e.name),lr.isUndefined(n)||(r.value=n),r}))}var _r=Sr;function Sr(){this._arr=[],this._keyIndices={}}Sr.prototype.size=function(){return this._arr.length},Sr.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},Sr.prototype.has=function(t){return lr.has(this._keyIndices,t)},Sr.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},Sr.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Sr.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!lr.has(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1},Sr.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},Sr.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},Sr.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1].priority0&&(i=s.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(u);return a}(t,String(e),n||Mr,r||function(e){return t.outEdges(e)})},Mr=lr.constant(1),Tr=function(t){var e=0,n=[],r={},i=[];function o(a){var s=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){lr.has(r,t)?r[t].onStack&&(s.lowlink=Math.min(s.lowlink,r[t].index)):(o(t),s.lowlink=Math.min(s.lowlink,r[t].lowlink))})),s.lowlink===s.index){var u,c=[];do{u=n.pop(),r[u].onStack=!1,c.push(u)}while(a!==u);i.push(c)}}return t.nodes().forEach((function(t){lr.has(r,t)||o(t)})),i},Ar=lr.constant(1),Cr=kr;function kr(t){var e={},n={},r=[];if(lr.each(t.sinks(),(function i(o){if(lr.has(n,o))throw new Nr;lr.has(e,o)||(n[o]=!0,e[o]=!0,lr.each(t.predecessors(o),i),delete n[o],r.push(o))})),lr.size(e)!==t.nodeCount())throw new Nr;return r}function Nr(){}kr.CycleException=Nr,Nr.prototype=new Error;var Or=function(t,e,n){lr.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],o={};return lr.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);Pr(t,e,"post"===n,o,r,i)})),i};function Pr(t,e,n,r,i,o){lr.has(r,e)||(r[e]=!0,n||o.push(e),lr.each(i(e),(function(e){Pr(t,e,n,r,i,o)})),n&&o.push(e))}var Ir,Lr={Graph:yr.Graph,json:br,alg:{components:function(t){var e,n={},r=[];function i(r){lr.has(n,r)||(n[r]=!0,e.push(r),lr.each(t.successors(r),i),lr.each(t.predecessors(r),i))}return lr.each(t.nodes(),(function(t){e=[],i(t),e.length&&r.push(e)})),r},dijkstra:Er,dijkstraAll:function(t,e,n){return lr.transform(t.nodes(),(function(r,i){r[i]=Er(t,i,e,n)}),{})},findCycles:function(t){return lr.filter(Tr(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))},floydWarshall:function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s0;){if(n=o.removeMin(),lr.has(i,n))r.setEdge(n,i[n]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(n).forEach(a)}return r},tarjan:Tr,topsort:Cr},version:yr.version};try{Ir=Lr}catch(r){}Ir||(Ir=window.graphlib);var Dr,Rr=Ir,zr=function(t,e,n){if(!O(n))return!1;var r=typeof e;return!!("number"==r?It(n)&&yt(e,n.length):"string"==r&&e in n)&&p(n[e],t)},Fr=Object.prototype,Br=Fr.hasOwnProperty,jr=er((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&zr(e[0],e[1],i)&&(r=1);++n-1?i[o?e[a]:a]:void 0}}((function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:function(t){var e=Wr(t),n=e%1;return e==e?n?e-n:e:0}(n);return i<0&&(i=Yr(r+i,0)),nr(t,_n(e),i)})),Xr=function(t){return null!=t&&t.length?qn(t,1):[]},Kr=function(t,e,n){for(var r=-1,i=t.length;++re},Qr=function(t,e,n){(void 0!==n&&!p(t[e],n)||void 0===n&&!(e in t))&&it(t,e,n)},Jr=Function.prototype,ti=Object.prototype,ei=Jr.toString,ni=ti.hasOwnProperty,ri=ei.call(Object),ii=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},oi=function(t,e,n,r,i,o,a){var s=ii(t,n),u=ii(e,n),c=a.get(u);if(c)Qr(t,n,c);else{var l=o?o(s,u,n+"",t,e,a):void 0,h=void 0===l;if(h){var f=pt(u),d=!f&&mt(u),p=!f&&!d&&Et(u);l=u,f||d||p?pt(s)?l=s:sr(s)?l=Bt(s):d?(h=!1,l=Ft(u,!0)):p?(h=!1,l=pe(u,!0)):l=[]:function(t){if(!ut(t)||"[object Object]"!=N(t))return!1;var e=Wt(t);if(null===e)return!0;var n=ni.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ei.call(n)==ri}(u)||dt(u)?(l=s,dt(s)?l=function(t){return st(t,zt(t))}(s):O(s)&&!P(s)||(l=ye(u))):h=!1}h&&(a.set(u,l),i(l,u,r,o,a),a.delete(u)),Qr(t,n,l)}},ai=function t(e,n,r,i,o){e!==n&&Te(n,(function(a,s){if(o||(o=new et),O(a))oi(e,n,s,r,t,i,o);else{var u=i?i(ii(e,s),a,s+"",e,n,o):void 0;void 0===u&&(u=a),Qr(e,s,u)}}),zt)},si=function(t){return er((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&zr(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++re||o&&a&&u&&!s&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!c&&t=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))},vi=er((function(t,e){if(null==t)return[];var n=e.length;return n>1&&zr(t,e[0],e[1])?e=[]:n>2&&zr(e[0],e[1],e[2])&&(e=[e[0]]),mi(t,qn(e,1),[])})),yi=0;try{Dr={cloneDeep:function(t){return Ee(t,5)},constant:Me,defaults:jr,each:Pe,filter:Sn,find:qr,flatten:Xr,forEach:Oe,forIn:function(t,e){return null==t?t:Te(t,Ne(e),zt)},has:Tn,isUndefined:Cn,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Nn,mapValues:function(t,e){var n={};return e=_n(e),Ae(t,(function(t,r,i){it(n,r,e(t,r,i))})),n},max:function(t){return t&&t.length?Kr(t,ke,$r):void 0},merge:si,min:function(t){return t&&t.length?Kr(t,ke,ui):void 0},minBy:function(t,e){return t&&t.length?Kr(t,_n(e),ui):void 0},now:function(){return _.Date.now()},pick:hi,range:pi,reduce:In,sortBy:vi,uniqueId:function(t){var e=++yi;return fn(t)+e},values:cr,zipObject:function(t,e){return function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r0;--s)if(r=e[s].dequeue()){i=i.concat(Ti(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return bi.flatten(bi.map(r,(function(e){return t.outEdges(e.v,e.w)})),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return bi.forEach(t.nodes(),(function i(o){bi.has(r,o)||(r[o]=!0,n[o]=!0,bi.forEach(t.outEdges(o),(function(t){bi.has(n,t.w)?e.push(t):i(t.w)})),delete n[o])})),e}(t);bi.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,bi.uniqueId("rev"))}))},ki=function(t){bi.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))},Ni=Rr.Graph,Oi={addDummyNode:Pi,simplify:function(t){var e=(new Ni).setGraph(t.graph());return bi.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),bi.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new Ni({multigraph:t.isMultigraph()}).setGraph(t.graph());return bi.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),bi.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=bi.map(t.nodes(),(function(e){var n={};return bi.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return bi.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=bi.map(t.nodes(),(function(e){var n={};return bi.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return bi.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=bi.map(bi.range(Ii(t)+1),(function(){return[]}));return bi.forEach(t.nodes(),(function(n){var r=t.node(n),i=r.rank;bi.isUndefined(i)||(e[i][r.order]=n)})),e},normalizeRanks:function(t){var e=bi.min(bi.map(t.nodes(),(function(e){return t.node(e).rank})));bi.forEach(t.nodes(),(function(n){var r=t.node(n);bi.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=bi.min(bi.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];bi.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var r=0,i=t.graph().nodeRankFactor;bi.forEach(n,(function(e,n){bi.isUndefined(e)&&n%i!=0?--r:r&&bi.forEach(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Pi(t,"border",i,e)},maxRank:Ii,partition:function(t,e){var n={lhs:[],rhs:[]};return bi.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=bi.now();try{return e()}finally{console.log(t+" time: "+(bi.now()-n)+"ms")}},notime:function(t,e){return e()}};function Pi(t,e,n,r){var i;do{i=bi.uniqueId(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function Ii(t){return bi.max(bi.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!bi.isUndefined(n))return n})))}var Li=function(t){t.graph().dummyChains=[],bi.forEach(t.edges(),(function(e){!function(t,e){var n,r,i,o=e.v,a=t.node(o).rank,s=e.w,u=t.node(s).rank,c=e.name,l=t.edge(e),h=l.labelRank;if(u!==a+1){for(t.removeEdge(e),i=0,++a;aa.lim&&(s=a,u=!0);var c=bi.filter(e.edges(),(function(e){return u===io(t,t.node(e.v),s)&&u!==io(t,t.node(e.w),s)}));return bi.minBy(c,(function(t){return Gi(e,t)}))}function ro(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),Ji(t),$i(t,e),function(t,e){var n=bi.find(t.nodes(),(function(t){return!e.node(t).parent})),r=Wi(t,n);r=r.slice(1),bi.forEach(r,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function io(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Ki.initLowLimValues=Ji,Ki.initCutValues=$i,Ki.calcCutValue=Qi,Ki.leaveEdge=eo,Ki.enterEdge=no,Ki.exchangeEdges=ro;var oo=Ri,ao=oo;function so(t){Xi(t)}var uo=function(t){var e=Oi.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var o=t.children(r);o&&o.length&&bi.forEach(o,(function(t){n(t,i+1)})),e[r]=i}return bi.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=bi.max(bi.values(n))-1,i=2*r+1;t.graph().nestingRoot=e,bi.forEach(t.edges(),(function(e){t.edge(e).minlen*=i}));var o=function(t){return bi.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;bi.forEach(t.children(),(function(a){lo(t,e,i,o,r,n,a)})),t.graph().nodeRankFactor=i},co=function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,bi.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))};function lo(t,e,n,r,i,o,a){var s=t.children(a);if(s.length){var u=Oi.addBorderNode(t,"_bt"),c=Oi.addBorderNode(t,"_bb"),l=t.node(a);t.setParent(u,a),l.borderTop=u,t.setParent(c,a),l.borderBottom=c,bi.forEach(s,(function(s){lo(t,e,n,r,i,o,s);var l=t.node(s),h=l.borderTop?l.borderTop:s,f=l.borderBottom?l.borderBottom:s,d=l.borderTop?r:2*r,p=h!==f?1:i-o[a]+1;t.setEdge(u,h,{weight:d,minlen:p,nestingEdge:!0}),t.setEdge(f,c,{weight:d,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,u,{weight:0,minlen:i+o[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}function ho(t,e,n,r,i,o){var a={width:0,height:0,rank:o,borderType:e},s=i[e][o-1],u=Oi.addDummyNode(t,"border",a,n);i[e][o]=u,t.setParent(u,r),s&&t.setEdge(s,u,{weight:1})}var fo=function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||go(t)},po=function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){bi.forEach(t.nodes(),(function(e){vo(t.node(e))})),bi.forEach(t.edges(),(function(e){var n=t.edge(e);bi.forEach(n.points,vo),bi.has(n,"y")&&vo(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){bi.forEach(t.nodes(),(function(e){yo(t.node(e))})),bi.forEach(t.edges(),(function(e){var n=t.edge(e);bi.forEach(n.points,yo),bi.has(n,"x")&&yo(n)}))}(t),go(t))};function go(t){bi.forEach(t.nodes(),(function(e){mo(t.node(e))})),bi.forEach(t.edges(),(function(e){mo(t.edge(e))}))}function mo(t){var e=t.width;t.width=t.height,t.height=e}function vo(t){t.y=-t.y}function yo(t){var e=t.x;t.x=t.y,t.y=e}var bo=function(t,e){for(var n=0,r=1;r0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*n}))),u}function wo(t,e,n){for(var r;e.length&&(r=bi.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var _o=function t(e,n,r,i){var o=e.children(n),a=e.node(n),s=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,c={};s&&(o=bi.filter(o,(function(t){return t!==s&&t!==u})));var l=function(t,e){return bi.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=bi.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,o);bi.forEach(l,(function(n){if(e.children(n.v).length){var o=t(e,n.v,r,i);c[n.v]=o,bi.has(o,"barycenter")&&(a=n,s=o,bi.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s}));var h=function(t,e){var n={};return bi.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};bi.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),bi.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];bi.isUndefined(e)||bi.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(bi.isUndefined(e.barycenter)||bi.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var i=t.pop();e.push(i),bi.forEach(i.in.reverse(),n(i)),bi.forEach(i.out,r(i))}return bi.map(bi.filter(e,(function(t){return!t.merged})),(function(t){return bi.pick(t,["vs","i","barycenter","weight"])}))}(bi.filter(n,(function(t){return!t.indegree})))}(l,r);!function(t,e){bi.forEach(t,(function(t){t.vs=bi.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(h,c);var f=function(t,e){var n,r=Oi.partition(t,(function(t){return bi.has(t,"barycenter")})),i=r.lhs,o=bi.sortBy(r.rhs,(function(t){return-t.i})),a=[],s=0,u=0,c=0;i.sort((n=!!e,function(t,e){return t.barycentere.barycenter?1:n?e.i-t.i:t.i-e.i})),c=wo(a,o,c),bi.forEach(i,(function(t){c+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,c=wo(a,o,c)}));var l={vs:bi.flatten(a,!0)};return u&&(l.barycenter=s/u,l.weight=u),l}(h,i);if(s&&(f.vs=bi.flatten([s,f.vs,u],!0),e.predecessors(s).length)){var d=e.node(e.predecessors(s)[0]),p=e.node(e.predecessors(u)[0]);bi.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+p.order)/(f.weight+2),f.weight+=2}return f},So=Rr.Graph,Eo=Rr.Graph,Mo=function(t){var e=Oi.maxRank(t),n=To(t,bi.range(1,e+1),"inEdges"),r=To(t,bi.range(e-1,-1,-1),"outEdges"),i=function(t){var e={},n=bi.filter(t.nodes(),(function(e){return!t.children(e).length})),r=bi.max(bi.map(n,(function(e){return t.node(e).rank}))),i=bi.map(bi.range(r+1),(function(){return[]})),o=bi.sortBy(n,(function(e){return t.node(e).rank}));return bi.forEach(o,(function n(r){if(!bi.has(e,r)){e[r]=!0;var o=t.node(r);i[o.rank].push(r),bi.forEach(t.successors(r),n)}})),i}(t);Co(t,i);for(var o,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){Ao(s%2?n:r,s%4>=2),i=Oi.buildLayerMatrix(t);var c=bo(t,i);cn){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function Oo(t,e,n){if(e>n){var r=e;e=n,n=r}return bi.has(t[e],n)}var Po=function(t){var e,n=Oi.buildLayerMatrix(t),r=bi.merge(function(t,e){var n={};return bi.reduce(e,(function(e,r){var i=0,o=0,a=e.length,s=bi.last(r);return bi.forEach(r,(function(e,u){var c=function(t,e){if(t.node(e).dummy)return bi.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),l=c?t.node(c).order:a;(c||e===s)&&(bi.forEach(r.slice(o,u+1),(function(e){bi.forEach(t.predecessors(e),(function(r){var o=t.node(r),a=o.order;!(aa)&&No(n,e,s)}))}))}return bi.reduce(e,(function(e,n){var i,o=-1,a=0;return bi.forEach(n,(function(s,u){if("border"===t.node(s).dummy){var c=t.predecessors(s);c.length&&(i=t.node(c[0]).order,r(n,a,u,o,i),a=u,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,n)),i={};bi.forEach(["u","d"],(function(o){e="u"===o?n:bi.values(n).reverse(),bi.forEach(["l","r"],(function(n){"r"===n&&(e=bi.map(e,(function(t){return bi.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),s=function(t,e,n,r){var i={},o={},a={};return bi.forEach(e,(function(t){bi.forEach(t,(function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),bi.forEach(e,(function(t){var e=-1;bi.forEach(t,(function(t){var s=r(t);if(s.length)for(var u=((s=bi.sortBy(s,(function(t){return a[t]}))).length-1)/2,c=Math.floor(u),l=Math.ceil(u);c<=l;++c){var h=s[c];o[t]===t&&eu||c>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],l=!0;n!==i.w;){if(r=t.node(n),l){for(;(c=a[u])!==s&&t.node(c).maxRankthis.metaGraph.node(t)))}leaves(){let t,e=[],n=[this];for(;n.length;){let r=n.shift();r.isGroupNode?(t=r.metaGraph,t.nodes().forEach((e=>n.push(t.node(e))))):e.push(r.name)}return e}}class ta{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function ea(t,e={}){return new Jo(t,e)}function na(t,e){return new ta(t,e)}function ra(t,e,n){const r=n||{},i=new Xo.Graph(r);return i.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),i}class ia{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=ea(a,this.graphOptions),this.index[a]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const r=ra(s,l.BRIDGE,this.graphOptions);if(n.bridgeGraph=r,!e.parentNode||!("metaGraph"in e.parentNode))return r;const i=e.parentNode;return[i.metaGraph,this.getBridgeGraph(i.name)].forEach((e=>{e.edges().filter((e=>e.v===t||e.w===t)).forEach((n=>{const i=n.w===t;e.edge(n).baseEdgeList.forEach((e=>{const[o,a]=i?[e.w,n.v]:[e.v,n.w],s=this.getChildName(t,o),u={v:i?a:s,w:i?s:a};let c=r.edge(u);c||(c=na(u.v,u.w),c.inbound=i,r.setEdge(u.v,u.w,c)),c.addBaseEdge(e,this)}))}))})),r}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const r=t.parentNode,i=r.metaGraph,o=this.getBridgeGraph(r.name);return oa(i,t,e,n),oa(o,t,e,n),n}}function oa(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class aa{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new ca(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==u.META)return;const n=e,r=n.node.metaGraph,i=n.coreGraph;r.nodes().forEach((t=>{const e=this.getOrCreateRenderNodeByName(t);i.setNode(t,e)})),r.edges().forEach((t=>{const e=r.edge(t),n=new ua(e);i.setEdge(t.v,t.w,n)}));const o=n.node.parentNode;if(!o)return;const a=this.getRenderNodeByName(o.name),s=(t,...e)=>e.concat([t?"IN":"OUT"]).join("~~"),l=this.hierarchy.getBridgeGraph(t);l.edges().forEach((e=>{const n=l.edge(e),h=!!r.node(e.w),[f,d]=h?[e.w,e.v]:[e.v,e.w],p=e=>{const n=h?{v:e,w:t}:{v:t,w:e};return a.coreGraph.edge(n)};let g=p(d);g||(g=p(s(h,d,o.name)));const m=s(h,t),v=s(h,d,t);let y=i.node(v);if(!y){let t=i.node(m);if(!t){const e={name:m,type:u.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:c.UNSPECIFIED,inbound:h,attr:{}};t=new sa(e),this.index[m]=t,i.setNode(m,t)}const e={name:v,type:u.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:c.UNSPECIFIED,inbound:h,attr:{}};y=new sa(e),this.index[v]=y,i.setNode(v,y),i.setParent(v,m),t.node.cardinality++}const b=new ua(n);b.adjoiningMetaEdge=g,h?i.setEdge(v,f,b):i.setEdge(f,v,b)}))}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new ca(e,this.hierarchy.graphOptions):new sa(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class sa{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class ua{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class ca extends sa{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=ra(n.name,l.CORE,e)}}function la(t,e){t.node.isGroupNode&&function(t,e){const n=i(e);t.coreGraph.nodes().map((e=>t.coreGraph.node(e))).forEach((t=>{var r,i,o,a,s,c;const{height:l,width:h}=t;switch(t.node.type){case u.NODE:Object.assign(t,n.nodeSize.node),t.height=l||n.nodeSize.node.height,t.width=h||n.nodeSize.node.width;break;case u.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case u.META:t.expanded?la(t,e):(Object.assign(t,n.nodeSize.meta),t.height=n.nodeSize.meta.height,t.width=n.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+t.node.type)}if(!t.expanded){const n=t.attr;!function(t,e=!1){if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){const e=`${t.displayName}`.length,n=3;t.width=Math.max(t.coreBox.width,e*n)}}(t,e&&(0===t.node.type&&!!(null===(i=null===(r=null==e?void 0:e.nodeSize)||void 0===r?void 0:r.meta)||void 0===i?void 0:i.width)||1===t.node.type&&(!!(null===(a=null===(o=null==e?void 0:e.nodeSize)||void 0===o?void 0:o.node)||void 0===a?void 0:a.width)||!!n.width)||2===t.node.type&&!!(null===(c=null===(s=null==e?void 0:e.nodeSize)||void 0===s?void 0:s.bridge)||void 0===c?void 0:c.width)))}}))}(t,e),t.node.type===u.META&&function(t,e){const n=i(e),r=n.subScene.meta;Object.assign(t,r);const{nodeSep:o,rankSep:a,edgeSep:s,align:c}=n.graph.meta,l={nodesep:o,ranksep:a,edgesep:s,align:c};Object.assign(t.coreBox,function(t,e){const{ranksep:n,nodesep:r,edgesep:i,align:o}=e;Object.assign(t.graph(),{ranksep:n,nodesep:r,edgesep:i,align:o});const a=[];if(t.nodes().forEach((e=>{t.node(e).node.type!==u.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};Ko(t);let s=1/0,c=1/0,l=-1/0,h=-1/0;return a.forEach((e=>{const n=t.node(e),r=.5*n.width,i=n.x-r,o=n.x+r;s=il?o:l;const a=.5*n.height,u=n.y-a,f=n.y+a;c=uh?f:h})),t.edges().forEach((e=>{const n=t.edge(e),r=t.node(n.metaEdge.v),i=t.node(n.metaEdge.w);if(3===n.points.length&&function(t){let e=ha(t[0],t[1]);for(let n=1;n1)return!1;e=r}return!0}(n.points)){if(null!=r){const t=r.expanded?r.x:fa(r);n.points[0].x=t}if(null!=i){const t=i.expanded?i.x:fa(i);n.points[2].x=t}n.points=[n.points[0],n.points[1]]}const o=n.points[n.points.length-2];null!=i&&(n.points[n.points.length-1]=da(o,i));const a=n.points[1];null!=r&&(n.points[0]=da(a,r)),n.points.forEach((t=>{s=t.xl?t.x:l,c=t.yh?t.y:h}))})),t.nodes().forEach((e=>{const n=t.node(e);n.x-=s,n.y-=c})),t.edges().forEach((e=>{t.edge(e).points.forEach((t=>{t.x-=s,t.y-=c}))})),{width:l-s,height:h-c}}(t.coreGraph,l));let h=0;t.coreGraph.nodeCount()>0&&h++;const f=h<=1?0:h;t.coreBox.width+=f+f,t.coreBox.height=r.labelHeight+t.coreBox.height,t.width=t.coreBox.width+r.paddingLeft+r.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function ha(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function fa(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function da(t,e){const n=e.expanded?e.x:fa(e),r=e.y,i=t.x-n,o=t.y-r;let a,s,u=e.expanded?e.width:e.coreBox.width,c=e.expanded?e.height:e.coreBox.height;return Math.abs(o)*u/2>Math.abs(i)*c/2?(o<0&&(c=-c),a=0===o?0:c/2*i/o,s=c/2):(i<0&&(u=-u),a=u/2,s=0===i?0:u/2*o/i),{x:n+a,y:r+s}}function pa(t,e,n){var i,o,a,s;const u=t.nodes.filter(((t,e,n)=>n.findIndex((e=>e.id===t.id))!==e)).map((t=>t.id));if(u.length)throw new Error(`Duplicated ids found: ${u.join(", ")}`);const c=function(t){const e={nodes:[]},n=t.compound,r=Object.keys(n||{}),i=new Map,o=(t,e=[])=>{if(i.has(t))return i.get(t);for(let i=0;it.edges.filter((t=>t.w===e)).map((t=>({name:t.v})));return t.nodes.forEach((t=>{const n=t.id,r=[...o(n),n];let i=a(n);e.nodes.push({name:n,path:r,inputs:i,width:t.width,height:t.height,attr:Object.assign({},t)})})),e}(t),l=function(t,e){const n=(t,e)=>{for(let n of e.values())if(n.includes(t))return!0;return!1},r=(t,e=[])=>{if(0===Object.keys(t).length)return[...new Set(e)];const i=new Map(Object.keys(t).map((e=>[e,t[e]]))),o={};for(let[t,r]of i)n(t,i)?o[t]=r:e=e.concat(t,r);return r(o,e)};return r(t).filter((t=>e.includes(t)))}(t.compound||{},(null==e?void 0:e.expanded)||[]),h=function(t,e){return function(t){return new aa(t)}(function(t,e){const{rankDirection:n,align:r}=e,i=new ia({rankdir:n,align:r});return function(t,e){Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n],i=r.path;let o=t.root;o.depth=Math.max(i.length,o.depth);for(let e=0;e{let n=0;for(;t;)e[n++]=t.name,t=t.parentNode;return n-1};e.edges.forEach((a=>{r=[],i=[];let s=o(e.nodes[a.v],r),u=o(e.nodes[a.w],i);for(;r[s]===i[u];)if(s--,u--,s<0||u<0)throw Error("No difference found between ancestor paths.");const c=n[r[s+1]],l=r[s],h=i[u];let f=c.metaGraph.edge(l,h);f||(f=na(l,h),c.metaGraph.setEdge(l,h,f)),f.addBaseEdge(a,t)}))}(i,t),i}(function(t){const e=new Qo;return t.nodes.map((t=>new $o(t))).forEach((t=>{e.nodes[t.name]=t,t.inputs.forEach((n=>{!function(t,e,n){n.name!==e.name&&t.edges.push(Object.assign(Object.assign({},n.attr),{v:n.name,w:e.name}))}(e,t,n)}))})),e}(t),e))}(c,{rankDirection:(null===(o=null===(i=null==n?void 0:n.graph)||void 0===i?void 0:i.meta)||void 0===o?void 0:o.rankDir)||(null==e?void 0:e.rankDirection)||r.graph.meta.rankDir,align:(null===(s=null===(a=null==n?void 0:n.graph)||void 0===a?void 0:a.meta)||void 0===s?void 0:s.align)||r.graph.meta.align});return function(t,e){e.forEach((e=>{const n=t.getRenderInfoNodes().find((t=>t.displayName===e));let r=n&&n.node&&n.node.name||"";const i=t.getRenderNodeByName(r);if(!i)throw new Error(`No nodes found: ${r}`);i.expanded=!0,t.buildSubHierarchy(r)}))}(h,l),la(h.root,n),va(h.root)}function ga(t,e=!1){const n=JSON.parse(JSON.stringify(t)),r={nodes:[n],edges:[...n.edges]};return n.nodes.forEach((function t(e){(0===e.type||1===e.type)&&r.nodes.push(e),0===e.type&&(r.edges=r.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)})),e&&r.nodes.forEach((t=>{const e=r.nodes.find((e=>e.id===t.parentNodeName));if(e){const n=e.x-e.width/2+e.paddingLeft,r=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==a&&(t.x+=n,t.y+=r),0===t.type&&t.edges.forEach((e=>{e.points.forEach((e=>{e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop}))}))}})),r}function ma(t,e,n,r){var i,o;let s=[];const u=(null===(i=n.find((e=>e.id===t)))||void 0===i?void 0:i.path)||[],c=(null===(o=n.find((t=>t.id===e)))||void 0===o?void 0:o.path)||[],l=[a,...u].slice(0,u.length).reverse(),h=[a,...c].slice(0,c.length);return l.forEach((i=>{const o=n.find((t=>t.id===i));s=s.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),h.filter((t=>!l.includes(t))).forEach((i=>{const o=n.find((t=>t.id===i));s=s.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),s}function va(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},ya(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===u.META?va(t):ya(t)))):[],edges:t.expanded?ba(t):[]});var n}function ya(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}function ba(t){return t.coreGraph.edges().map((e=>({renderInfoEdge:t.coreGraph.edge(e),edge:e}))).filter((({renderInfoEdge:t})=>t.metaEdge)).map((({edge:e,renderInfoEdge:n})=>{const r=function(t,e){const n=e.points.map((t=>Object.assign({},t)));if(e.adjoiningMetaEdge){const r=e.adjoiningMetaEdge.points,i=e.metaEdge.inbound,o=i?r[r.length-1]:r[0],a=n[i?0:n.length-1],s=t.x-t.width/2,u=t.y-t.height/2,c=o.x-s,l=o.y-u,h=-t.paddingLeft,f=-(t.paddingTop+t.labelHeight);a.x=c+h,a.y=l+f}return n}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}}))}},13882:function(t,e,n){"use strict";function r(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}n.d(e,{Z:function(){return r}})},83946:function(t,e,n){"use strict";function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}n.d(e,{Z:function(){return r}})},78343:function(t,e,n){"use strict";n.d(e,{Z:function(){return s}});var r=n(83946),i=n(51820),o=n(13882),a=36e5;function s(t,e){(0,o.Z)(2,arguments);var n=(0,r.Z)(e);return(0,i.Z)(t,n*a)}},51820:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(83946),i=n(19013),o=n(13882);function a(t,e){(0,o.Z)(2,arguments);var n=(0,i.Z)(t).getTime(),a=(0,r.Z)(e);return new Date(n+a)}},79501:function(t,e,n){"use strict";n.d(e,{Z:function(){return lt}});var r=n(13882);function i(t){return i="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},i(t)}function o(t){return(0,r.Z)(1,arguments),t instanceof Date||"object"===i(t)&&"[object Date]"===Object.prototype.toString.call(t)}var a=n(19013);function s(t){if((0,r.Z)(1,arguments),!o(t)&&"number"!=typeof t)return!1;var e=(0,a.Z)(t);return!isNaN(Number(e))}var u=n(51820),c=n(83946);function l(t,e){(0,r.Z)(2,arguments);var n=(0,c.Z)(e);return(0,u.Z)(t,-n)}var h=864e5;function f(t){(0,r.Z)(1,arguments);var e=1,n=(0,a.Z)(t),i=n.getUTCDay(),o=(i=o.getTime()?n+1:e.getTime()>=u.getTime()?n:n-1}function p(t){(0,r.Z)(1,arguments);var e=d(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var i=f(n);return i}var g=6048e5;var m={};function v(){return m}function y(t,e){var n,i,o,s,u,l,h,f;(0,r.Z)(1,arguments);var d=v(),p=(0,c.Z)(null!==(n=null!==(i=null!==(o=null!==(s=null==e?void 0:e.weekStartsOn)&&void 0!==s?s:null==e||null===(u=e.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:d.weekStartsOn)&&void 0!==i?i:null===(h=d.locale)||void 0===h||null===(f=h.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==n?n:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,a.Z)(t),m=g.getUTCDay(),y=(m=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(p+1,0,m),b.setUTCHours(0,0,0,0);var x=y(b,e),w=new Date(0);w.setUTCFullYear(p,0,m),w.setUTCHours(0,0,0,0);var _=y(w,e);return d.getTime()>=x.getTime()?p+1:d.getTime()>=_.getTime()?p:p-1}function x(t,e){var n,i,o,a,s,u,l,h;(0,r.Z)(1,arguments);var f=v(),d=(0,c.Z)(null!==(n=null!==(i=null!==(o=null!==(a=null==e?void 0:e.firstWeekContainsDate)&&void 0!==a?a:null==e||null===(s=e.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==o?o:f.firstWeekContainsDate)&&void 0!==i?i:null===(l=f.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==n?n:1),p=b(t,e),g=new Date(0);g.setUTCFullYear(p,0,d),g.setUTCHours(0,0,0,0);var m=y(g,e);return m}var w=6048e5;function _(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return _("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):_(n+1,2)},d:function(t,e){return _(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return _(t.getUTCHours()%12||12,e.length)},H:function(t,e){return _(t.getUTCHours(),e.length)},m:function(t,e){return _(t.getUTCMinutes(),e.length)},s:function(t,e){return _(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return _(Math.floor(r*Math.pow(10,n-3)),e.length)}},E="midnight",M="noon",T="morning",A="afternoon",C="evening",k="night",N={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return S.y(t,e)},Y:function(t,e,n,r){var i=b(t,r),o=i>0?i:1-i;return"YY"===e?_(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):_(o,e.length)},R:function(t,e){return _(d(t),e.length)},u:function(t,e){return _(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return _(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return _(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return S.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return _(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var o=function(t,e){(0,r.Z)(1,arguments);var n=(0,a.Z)(t),i=y(n,e).getTime()-x(n,e).getTime();return Math.round(i/w)+1}(t,i);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):_(o,e.length)},I:function(t,e,n){var i=function(t){(0,r.Z)(1,arguments);var e=(0,a.Z)(t),n=f(e).getTime()-p(e).getTime();return Math.round(n/g)+1}(t);return"Io"===e?n.ordinalNumber(i,{unit:"week"}):_(i,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):S.d(t,e)},D:function(t,e,n){var i=function(t){(0,r.Z)(1,arguments);var e=(0,a.Z)(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var i=e.getTime(),o=n-i;return Math.floor(o/h)+1}(t);return"Do"===e?n.ordinalNumber(i,{unit:"dayOfYear"}):_(i,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return _(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return _(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return _(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?M:0===i?E:i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?C:i>=12?A:i>=4?T:k,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return S.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):S.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):_(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):_(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):S.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):S.s(t,e)},S:function(t,e){return S.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return P(i);case"XXXX":case"XX":return I(i);default:return I(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return P(i);case"xxxx":case"xx":return I(i);default:return I(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+O(i,":");default:return"GMT"+I(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+O(i,":");default:return"GMT"+I(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return _(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return _((r._originalDate||t).getTime(),e.length)}};function O(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=e||"";return n+String(i)+a+_(o,2)}function P(t,e){return t%60==0?(t>0?"-":"+")+_(Math.abs(t)/60,2):I(t,e)}function I(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+_(Math.floor(i/60),2)+n+_(i%60,2)}var L=N,D=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},R=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},z={p:R,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return D(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",D(i,e)).replace("{{time}}",R(o,e))}},F=z;function B(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var j=["D","DD"],U=["YY","YYYY"];function V(t){return-1!==j.indexOf(t)}function H(t){return-1!==U.indexOf(t)}function G(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Z={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},W=function(t,e,n){var r,i=Z[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var q={date:Y({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Y({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Y({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},X={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},K=function(t,e,n,r){return X[t]};function $(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,s=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(e):e]}}var Q={ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:$({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:$({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:$({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:$({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:$({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function J(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var a,s=o[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(u)?et(u,(function(t){return t.test(s)})):tt(u,(function(t){return t.test(s)}));a=t.valueCallback?t.valueCallback(c):c,a=n.valueCallback?n.valueCallback(a):a;var l=e.slice(s.length);return{value:a,rest:l}}}function tt(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function et(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(nt.matchPattern);if(!n)return null;var r=n[0],i=t.match(nt.parsePattern);if(!i)return null;var o=nt.valueCallback?nt.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:J({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:J({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:J({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:J({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},it={code:"en-US",formatDistance:W,formatLong:q,formatRelative:K,localize:Q,match:rt,options:{weekStartsOn:0,firstWeekContainsDate:1}},ot=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,at=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,st=/^'([^]*?)'?$/,ut=/''/g,ct=/[a-zA-Z]/;function lt(t,e,n){var i,o,u,h,f,d,p,g,m,y,b,x,w,_,S,E,M,T;(0,r.Z)(2,arguments);var A=String(e),C=v(),k=null!==(i=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:C.locale)&&void 0!==i?i:it,N=(0,c.Z)(null!==(u=null!==(h=null!==(f=null!==(d=null==n?void 0:n.firstWeekContainsDate)&&void 0!==d?d:null==n||null===(p=n.locale)||void 0===p||null===(g=p.options)||void 0===g?void 0:g.firstWeekContainsDate)&&void 0!==f?f:C.firstWeekContainsDate)&&void 0!==h?h:null===(m=C.locale)||void 0===m||null===(y=m.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==u?u:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=(0,c.Z)(null!==(b=null!==(x=null!==(w=null!==(_=null==n?void 0:n.weekStartsOn)&&void 0!==_?_:null==n||null===(S=n.locale)||void 0===S||null===(E=S.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==w?w:C.weekStartsOn)&&void 0!==x?x:null===(M=C.locale)||void 0===M||null===(T=M.options)||void 0===T?void 0:T.weekStartsOn)&&void 0!==b?b:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var P=(0,a.Z)(t);if(!s(P))throw new RangeError("Invalid time value");var I=B(P),D=l(P,I),R={firstWeekContainsDate:N,weekStartsOn:O,locale:k,_originalDate:P},z=A.match(at).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,F[e])(t,k.formatLong):t})).join("").match(ot).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return ht(r);var o=L[i];if(o)return null!=n&&n.useAdditionalWeekYearTokens||!H(r)||G(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!V(r)||G(r,e,String(t)),o(D,r,k.localize,R);if(i.match(ct))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return z}function ht(t){var e=t.match(st);return e?e[1].replace(ut,"'"):t}},32370:function(t,e,n){"use strict";n.d(e,{Z:function(){return s}});var r=n(83946),i=n(19013),o=n(13882);function a(t,e){(0,o.Z)(2,arguments);var n=(0,i.Z)(t),a=(0,r.Z)(e);return isNaN(a)?new Date(NaN):a?(n.setDate(n.getDate()+a),n):n}function s(t,e){(0,o.Z)(2,arguments);var n=(0,r.Z)(e);return a(t,-n)}},19013:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(13882);function i(t){return i="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},i(t)}function o(t){(0,r.Z)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===i(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},49685:function(t,e,n){"use strict";n.r(e),n.d(e,{ARRAY_TYPE:function(){return i},EPSILON:function(){return r},RANDOM:function(){return o},equals:function(){return c},setMatrixArrayType:function(){return a},toRadian:function(){return u}});var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;function a(t){i=t}var s=Math.PI/180;function u(t){return t*s}function c(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},64530:function(t,e,n){"use strict";n.r(e),n.d(e,{glMatrix:function(){return c},mat2:function(){return r},mat2d:function(){return i},mat3:function(){return st},mat4:function(){return o},quat:function(){return s},quat2:function(){return u},vec2:function(){return Mr},vec3:function(){return oe},vec4:function(){return a}});var r={};n.r(r),n.d(r,{LDU:function(){return A},add:function(){return C},adjoint:function(){return y},clone:function(){return h},copy:function(){return f},create:function(){return l},determinant:function(){return b},equals:function(){return O},exactEquals:function(){return N},frob:function(){return T},fromRotation:function(){return S},fromScaling:function(){return E},fromValues:function(){return p},identity:function(){return d},invert:function(){return v},mul:function(){return L},multiply:function(){return x},multiplyScalar:function(){return P},multiplyScalarAndAdd:function(){return I},rotate:function(){return w},scale:function(){return _},set:function(){return g},str:function(){return M},sub:function(){return D},subtract:function(){return k},transpose:function(){return m}});var i={};n.r(i),n.d(i,{add:function(){return J},clone:function(){return z},copy:function(){return F},create:function(){return R},determinant:function(){return H},equals:function(){return it},exactEquals:function(){return rt},frob:function(){return Q},fromRotation:function(){return q},fromScaling:function(){return X},fromTranslation:function(){return K},fromValues:function(){return j},identity:function(){return B},invert:function(){return V},mul:function(){return ot},multiply:function(){return G},multiplyScalar:function(){return et},multiplyScalarAndAdd:function(){return nt},rotate:function(){return Z},scale:function(){return W},set:function(){return U},str:function(){return $},sub:function(){return at},subtract:function(){return tt},translate:function(){return Y}});var o={};n.r(o),n.d(o,{add:function(){return $t},adjoint:function(){return mt},clone:function(){return ct},copy:function(){return lt},create:function(){return ut},determinant:function(){return vt},equals:function(){return ne},exactEquals:function(){return ee},frob:function(){return Kt},fromQuat:function(){return Ft},fromQuat2:function(){return Pt},fromRotation:function(){return At},fromRotationTranslation:function(){return Ot},fromRotationTranslationScale:function(){return Rt},fromRotationTranslationScaleOrigin:function(){return zt},fromScaling:function(){return Tt},fromTranslation:function(){return Mt},fromValues:function(){return ht},fromXRotation:function(){return Ct},fromYRotation:function(){return kt},fromZRotation:function(){return Nt},frustum:function(){return Bt},getRotation:function(){return Dt},getScaling:function(){return Lt},getTranslation:function(){return It},identity:function(){return dt},invert:function(){return gt},lookAt:function(){return Yt},mul:function(){return re},multiply:function(){return yt},multiplyScalar:function(){return Jt},multiplyScalarAndAdd:function(){return te},ortho:function(){return Zt},orthoNO:function(){return Gt},orthoZO:function(){return Wt},perspective:function(){return Ut},perspectiveFromFieldOfView:function(){return Ht},perspectiveNO:function(){return jt},perspectiveZO:function(){return Vt},rotate:function(){return wt},rotateX:function(){return _t},rotateY:function(){return St},rotateZ:function(){return Et},scale:function(){return xt},set:function(){return ft},str:function(){return Xt},sub:function(){return ie},subtract:function(){return Qt},targetTo:function(){return qt},translate:function(){return bt},transpose:function(){return pt}});var a={};n.r(a),n.d(a,{add:function(){return he},ceil:function(){return ge},clone:function(){return se},copy:function(){return ce},create:function(){return ae},cross:function(){return Ne},dist:function(){return He},distance:function(){return _e},div:function(){return Ve},divide:function(){return pe},dot:function(){return ke},equals:function(){return Fe},exactEquals:function(){return ze},floor:function(){return me},forEach:function(){return Ye},fromValues:function(){return ue},inverse:function(){return Ae},len:function(){return Ze},length:function(){return Ee},lerp:function(){return Oe},max:function(){return ye},min:function(){return ve},mul:function(){return Ue},multiply:function(){return de},negate:function(){return Te},normalize:function(){return Ce},random:function(){return Pe},round:function(){return be},scale:function(){return xe},scaleAndAdd:function(){return we},set:function(){return le},sqrDist:function(){return Ge},sqrLen:function(){return We},squaredDistance:function(){return Se},squaredLength:function(){return Me},str:function(){return Re},sub:function(){return je},subtract:function(){return fe},transformMat4:function(){return Ie},transformQuat:function(){return Le},zero:function(){return De}});var s={};n.r(s),n.d(s,{add:function(){return Mn},calculateW:function(){return rn},clone:function(){return wn},conjugate:function(){return hn},copy:function(){return Sn},create:function(){return qe},dot:function(){return Cn},equals:function(){return Rn},exactEquals:function(){return Dn},exp:function(){return on},fromEuler:function(){return dn},fromMat3:function(){return fn},fromValues:function(){return _n},getAngle:function(){return Qe},getAxisAngle:function(){return $e},identity:function(){return Xe},invert:function(){return ln},len:function(){return On},length:function(){return Nn},lerp:function(){return kn},ln:function(){return an},mul:function(){return Tn},multiply:function(){return Je},normalize:function(){return Ln},pow:function(){return sn},random:function(){return cn},rotateX:function(){return tn},rotateY:function(){return en},rotateZ:function(){return nn},rotationTo:function(){return zn},scale:function(){return An},set:function(){return En},setAxes:function(){return Bn},setAxisAngle:function(){return Ke},slerp:function(){return un},sqlerp:function(){return Fn},sqrLen:function(){return In},squaredLength:function(){return Pn},str:function(){return pn}});var u={};n.r(u),n.d(u,{add:function(){return cr},clone:function(){return Un},conjugate:function(){return mr},copy:function(){return qn},create:function(){return jn},dot:function(){return dr},equals:function(){return Er},exactEquals:function(){return Sr},fromMat4:function(){return Yn},fromRotation:function(){return Wn},fromRotationTranslation:function(){return Gn},fromRotationTranslationValues:function(){return Hn},fromTranslation:function(){return Zn},fromValues:function(){return Vn},getDual:function(){return Qn},getReal:function(){return $n},getTranslation:function(){return er},identity:function(){return Xn},invert:function(){return gr},len:function(){return yr},length:function(){return vr},lerp:function(){return pr},mul:function(){return hr},multiply:function(){return lr},normalize:function(){return wr},rotateAroundAxis:function(){return ur},rotateByQuatAppend:function(){return ar},rotateByQuatPrepend:function(){return sr},rotateX:function(){return rr},rotateY:function(){return ir},rotateZ:function(){return or},scale:function(){return fr},set:function(){return Kn},setDual:function(){return tr},setReal:function(){return Jn},sqrLen:function(){return xr},squaredLength:function(){return br},str:function(){return _r},translate:function(){return nr}});var c=n(49685);function l(){var t=new c.ARRAY_TYPE(4);return c.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function h(t){var e=new c.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function d(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function p(t,e,n,r){var i=new c.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function g(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function m(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function v(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*o-i*r;return a?(a=1/a,t[0]=o*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null}function y(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t}function b(t){return t[0]*t[3]-t[2]*t[1]}function x(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*s+o*u,t[1]=i*s+a*u,t[2]=r*c+o*l,t[3]=i*c+a*l,t}function w(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*s,t[1]=i*u+a*s,t[2]=r*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1];return t[0]=r*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function S(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t}function E(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function M(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function T(t){return Math.hypot(t[0],t[1],t[2],t[3])}function A(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]}function C(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function k(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function N(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function O(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],l=e[3];return Math.abs(n-a)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-l)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))}function P(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function I(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}var L=x,D=k;function R(){var t=new c.ARRAY_TYPE(6);return c.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function z(t){var e=new c.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function F(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function B(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function j(t,e,n,r,i,o){var a=new c.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a[4]=i,a[5]=o,a}function U(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t}function V(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=n*o-r*i;return u?(u=1/u,t[0]=o*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*s-o*a)*u,t[5]=(r*a-n*s)*u,t):null}function H(t){return t[0]*t[3]-t[1]*t[2]}function G(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1],h=n[2],f=n[3],d=n[4],p=n[5];return t[0]=r*c+o*l,t[1]=i*c+a*l,t[2]=r*h+o*f,t[3]=i*h+a*f,t[4]=r*d+o*p+s,t[5]=i*d+a*p+u,t}function Z(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=Math.sin(n),l=Math.cos(n);return t[0]=r*l+o*c,t[1]=i*l+a*c,t[2]=r*-c+o*l,t[3]=i*-c+a*l,t[4]=s,t[5]=u,t}function W(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r*c,t[1]=i*c,t[2]=o*l,t[3]=a*l,t[4]=s,t[5]=u,t}function Y(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=r*c+o*l+s,t[5]=i*c+a*l+u,t}function q(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t}function X(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function K(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function $(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Q(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function J(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t}function tt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}function et(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t}function nt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t}function rt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function it(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],l=e[1],h=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(n-u)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(r-l)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-h)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(o-f)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-p)<=c.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))}var ot=G,at=tt,st=n(35600);function ut(){var t=new c.ARRAY_TYPE(16);return c.ARRAY_TYPE!=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}function ct(t){var e=new c.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ht(t,e,n,r,i,o,a,s,u,l,h,f,d,p,g,m){var v=new c.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=l,v[10]=h,v[11]=f,v[12]=d,v[13]=p,v[14]=g,v[15]=m,v}function ft(t,e,n,r,i,o,a,s,u,c,l,h,f,d,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function dt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function gt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,_=r*c-o*s,S=i*c-o*u,E=l*g-h*p,M=l*m-f*p,T=l*v-d*p,A=h*m-f*g,C=h*v-d*g,k=f*v-d*m,N=y*k-b*C+x*A+w*T-_*M+S*E;return N?(N=1/N,t[0]=(s*k-u*C+c*A)*N,t[1]=(i*C-r*k-o*A)*N,t[2]=(g*S-m*_+v*w)*N,t[3]=(f*_-h*S-d*w)*N,t[4]=(u*T-a*k-c*M)*N,t[5]=(n*k-i*T+o*M)*N,t[6]=(m*x-p*S-v*b)*N,t[7]=(l*S-f*x+d*b)*N,t[8]=(a*C-s*T+c*E)*N,t[9]=(r*T-n*C-o*E)*N,t[10]=(p*_-g*x+v*y)*N,t[11]=(h*x-l*_-d*y)*N,t[12]=(s*M-a*A-u*E)*N,t[13]=(n*A-r*M+i*E)*N,t[14]=(g*b-p*w-m*y)*N,t[15]=(l*w-h*b+f*y)*N,t):null}function mt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(f*v-d*m)-h*(u*v-c*m)+g*(u*d-c*f),t[1]=-(r*(f*v-d*m)-h*(i*v-o*m)+g*(i*d-o*f)),t[2]=r*(u*v-c*m)-s*(i*v-o*m)+g*(i*c-o*u),t[3]=-(r*(u*d-c*f)-s*(i*d-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*v-d*m)-l*(u*v-c*m)+p*(u*d-c*f)),t[5]=n*(f*v-d*m)-l*(i*v-o*m)+p*(i*d-o*f),t[6]=-(n*(u*v-c*m)-a*(i*v-o*m)+p*(i*c-o*u)),t[7]=n*(u*d-c*f)-a*(i*d-o*f)+l*(i*c-o*u),t[8]=a*(h*v-d*g)-l*(s*v-c*g)+p*(s*d-c*h),t[9]=-(n*(h*v-d*g)-l*(r*v-o*g)+p*(r*d-o*h)),t[10]=n*(s*v-c*g)-a*(r*v-o*g)+p*(r*c-o*s),t[11]=-(n*(s*d-c*h)-a*(r*d-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*m-f*g)-l*(s*m-u*g)+p*(s*f-u*h)),t[13]=n*(h*m-f*g)-l*(r*m-i*g)+p*(r*f-i*h),t[14]=-(n*(s*m-u*g)-a*(r*m-i*g)+p*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t}function vt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(h*m-f*g)-(e*s-r*o)*(l*m-f*p)+(e*u-i*o)*(l*g-h*p)+(n*s-r*a)*(c*m-f*d)-(n*u-i*a)*(c*g-h*d)+(r*u-i*s)*(c*p-l*d)}function yt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],b=n[0],x=n[1],w=n[2],_=n[3];return t[0]=b*r+x*s+w*h+_*g,t[1]=b*i+x*u+w*f+_*m,t[2]=b*o+x*c+w*d+_*v,t[3]=b*a+x*l+w*p+_*y,b=n[4],x=n[5],w=n[6],_=n[7],t[4]=b*r+x*s+w*h+_*g,t[5]=b*i+x*u+w*f+_*m,t[6]=b*o+x*c+w*d+_*v,t[7]=b*a+x*l+w*p+_*y,b=n[8],x=n[9],w=n[10],_=n[11],t[8]=b*r+x*s+w*h+_*g,t[9]=b*i+x*u+w*f+_*m,t[10]=b*o+x*c+w*d+_*v,t[11]=b*a+x*l+w*p+_*y,b=n[12],x=n[13],w=n[14],_=n[15],t[12]=b*r+x*s+w*h+_*g,t[13]=b*i+x*u+w*f+_*m,t[14]=b*o+x*c+w*d+_*v,t[15]=b*a+x*l+w*p+_*y,t}function bt(t,e,n){var r,i,o,a,s,u,c,l,h,f,d,p,g=n[0],m=n[1],v=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*m+h*v+e[12],t[13]=i*g+u*m+f*v+e[13],t[14]=o*g+c*m+d*v+e[14],t[15]=a*g+l*m+p*v+e[15]),t}function xt(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function wt(t,e,n,r){var i,o,a,s,u,l,h,f,d,p,g,m,v,y,b,x,w,_,S,E,M,T,A,C,k=r[0],N=r[1],O=r[2],P=Math.hypot(k,N,O);return P0?(n[0]=2*(s*a+h*r+u*o-l*i)/f,n[1]=2*(u*a+h*i+l*r-s*o)/f,n[2]=2*(l*a+h*o+s*i-u*r)/f):(n[0]=2*(s*a+h*r+u*o-l*i),n[1]=2*(u*a+h*i+l*r-s*o),n[2]=2*(l*a+h*o+s*i-u*r)),Ot(t,e,n),t}function It(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Lt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}function Dt(t,e){var n=new c.ARRAY_TYPE(3);Lt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,l=e[4]*r,h=e[5]*i,f=e[6]*o,d=e[8]*r,p=e[9]*i,g=e[10]*o,m=a+h+g,v=0;return m>0?(v=2*Math.sqrt(m+1),t[3]=.25*v,t[0]=(f-p)/v,t[1]=(d-u)/v,t[2]=(s-l)/v):a>h&&a>g?(v=2*Math.sqrt(1+a-h-g),t[3]=(f-p)/v,t[0]=.25*v,t[1]=(s+l)/v,t[2]=(d+u)/v):h>g?(v=2*Math.sqrt(1+h-a-g),t[3]=(d-u)/v,t[0]=(s+l)/v,t[1]=.25*v,t[2]=(f+p)/v):(v=2*Math.sqrt(1+g-a-h),t[3]=(s-l)/v,t[0]=(d+u)/v,t[1]=(f+p)/v,t[2]=.25*v),t}function Rt(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,d=i*l,p=o*c,g=o*l,m=a*l,v=s*u,y=s*c,b=s*l,x=r[0],w=r[1],_=r[2];return t[0]=(1-(p+m))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*w,t[5]=(1-(h+m))*w,t[6]=(g+v)*w,t[7]=0,t[8]=(d+y)*_,t[9]=(g-v)*_,t[10]=(1-(h+p))*_,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function zt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,f=o*c,d=o*l,p=o*h,g=a*l,m=a*h,v=s*h,y=u*c,b=u*l,x=u*h,w=r[0],_=r[1],S=r[2],E=i[0],M=i[1],T=i[2],A=(1-(g+v))*w,C=(d+x)*w,k=(p-b)*w,N=(d-x)*_,O=(1-(f+v))*_,P=(m+y)*_,I=(p+b)*S,L=(m-y)*S,D=(1-(f+g))*S;return t[0]=A,t[1]=C,t[2]=k,t[3]=0,t[4]=N,t[5]=O,t[6]=P,t[7]=0,t[8]=I,t[9]=L,t[10]=D,t[11]=0,t[12]=n[0]+E-(A*E+N*M+I*T),t[13]=n[1]+M-(C*E+O*M+L*T),t[14]=n[2]+T-(k*E+P*M+D*T),t[15]=1,t}function Ft(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,d=i*s,p=i*u,g=o*a,m=o*s,v=o*u;return t[0]=1-h-p,t[1]=l+v,t[2]=f-m,t[3]=0,t[4]=l-v,t[5]=1-c-p,t[6]=d+g,t[7]=0,t[8]=f+m,t[9]=d-g,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bt(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function jt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var Ut=jt;function Vt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function Ht(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function Gt(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=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*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}var Zt=Gt;function Wt(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t}function Yt(t,e,n,r){var i,o,a,s,u,l,h,f,d,p,g=e[0],m=e[1],v=e[2],y=r[0],b=r[1],x=r[2],w=n[0],_=n[1],S=n[2];return Math.abs(g-w)0&&(l*=d=1/Math.sqrt(d),h*=d,f*=d);var p=u*f-c*h,g=c*l-s*f,m=s*h-u*l;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=h*m-f*g,t[5]=f*p-l*m,t[6]=l*g-h*p,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function Xt(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function $t(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Qt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Jt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function te(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function ee(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ne(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],g=t[12],m=t[13],v=t[14],y=t[15],b=e[0],x=e[1],w=e[2],_=e[3],S=e[4],E=e[5],M=e[6],T=e[7],A=e[8],C=e[9],k=e[10],N=e[11],O=e[12],P=e[13],I=e[14],L=e[15];return Math.abs(n-b)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-x)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-w)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(o-_)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(s-E)<=c.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(u-M)<=c.EPSILON*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(l-T)<=c.EPSILON*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(h-A)<=c.EPSILON*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(f-C)<=c.EPSILON*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(d-k)<=c.EPSILON*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-N)<=c.EPSILON*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(g-O)<=c.EPSILON*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(m-P)<=c.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(v-I)<=c.EPSILON*Math.max(1,Math.abs(v),Math.abs(I))&&Math.abs(y-L)<=c.EPSILON*Math.max(1,Math.abs(y),Math.abs(L))}var re=yt,ie=Qt,oe=n(77160);function ae(){var t=new c.ARRAY_TYPE(4);return c.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function se(t){var e=new c.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ue(t,e,n,r){var i=new c.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ce(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function le(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function he(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function fe(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function de(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function pe(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function ge(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function me(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function ve(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function ye(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function be(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function xe(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function we(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function _e(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function Se(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function Ee(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function Me(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function Te(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function Ae(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function Ce(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function ke(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ne(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],u=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],l=e[0],h=e[1],f=e[2],d=e[3];return t[0]=h*c-f*u+d*s,t[1]=-l*c+f*a-d*o,t[2]=l*u-h*a+d*i,t[3]=-l*s+h*o-f*i,t}function Oe(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function Pe(t,e){var n,r,i,o,a,s;e=e||1;do{a=(n=2*c.RANDOM()-1)*n+(r=2*c.RANDOM()-1)*r}while(a>=1);do{s=(i=2*c.RANDOM()-1)*i+(o=2*c.RANDOM()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*n,t[1]=e*r,t[2]=e*i*u,t[3]=e*o*u,t}function Ie(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function Le(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*r+s*o-u*i,h=c*i+u*r-a*o,f=c*o+a*i-s*r,d=-a*r-s*i-u*o;return t[0]=l*c+d*-a+h*-u-f*-s,t[1]=h*c+d*-s+f*-a-l*-u,t[2]=f*c+d*-u+l*-s-h*-a,t[3]=e[3],t}function De(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function Re(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function ze(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Fe(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],l=e[3];return Math.abs(n-a)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-l)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))}var Be,je=fe,Ue=de,Ve=pe,He=_e,Ge=Se,Ze=Ee,We=Me,Ye=(Be=ae(),function(t,e,n,r,i,o){var a,s;for(e||(e=4),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;ac.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function Qe(t,e){var n=Cn(t,e);return Math.acos(2*n*n-1)}function Je(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function tn(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-r*s,t}function en(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u-o*s,t[1]=i*u+a*s,t[2]=o*u+r*s,t[3]=a*u-i*s,t}function nn(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*s,t[1]=i*u-r*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function rn(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function on(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function an(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function sn(t,e,n){return an(t,e),An(t,t,n),on(t,t),t}function un(t,e,n,r){var i,o,a,s,u,l=e[0],h=e[1],f=e[2],d=e[3],p=n[0],g=n[1],m=n[2],v=n[3];return(o=l*p+h*g+f*m+d*v)<0&&(o=-o,p=-p,g=-g,m=-m,v=-v),1-o>c.EPSILON?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*l+u*p,t[1]=s*h+u*g,t[2]=s*f+u*m,t[3]=s*d+u*v,t}function cn(t){var e=c.RANDOM(),n=c.RANDOM(),r=c.RANDOM(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function ln(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function hn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function fn(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function dn(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}function pn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var gn,mn,vn,yn,bn,xn,wn=se,_n=ue,Sn=ce,En=le,Mn=he,Tn=Je,An=xe,Cn=ke,kn=Oe,Nn=Ee,On=Nn,Pn=Me,In=Pn,Ln=Ce,Dn=ze,Rn=Fe,zn=(gn=oe.create(),mn=oe.fromValues(1,0,0),vn=oe.fromValues(0,1,0),function(t,e,n){var r=oe.dot(e,n);return r<-.999999?(oe.cross(gn,mn,e),oe.len(gn)<1e-6&&oe.cross(gn,vn,e),oe.normalize(gn,gn),Ke(t,gn,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(oe.cross(gn,e,n),t[0]=gn[0],t[1]=gn[1],t[2]=gn[2],t[3]=1+r,Ln(t,t))}),Fn=(yn=qe(),bn=qe(),function(t,e,n,r,i,o){return un(yn,e,i,o),un(bn,n,r,o),un(t,yn,bn,2*o*(1-o)),t}),Bn=(xn=st.create(),function(t,e,n,r){return xn[0]=n[0],xn[3]=n[1],xn[6]=n[2],xn[1]=r[0],xn[4]=r[1],xn[7]=r[2],xn[2]=-e[0],xn[5]=-e[1],xn[8]=-e[2],Ln(t,fn(t,xn))});function jn(){var t=new c.ARRAY_TYPE(8);return c.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function Un(t){var e=new c.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Vn(t,e,n,r,i,o,a,s){var u=new c.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=n,u[3]=r,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function Hn(t,e,n,r,i,o,a){var s=new c.ARRAY_TYPE(8);s[0]=t,s[1]=e,s[2]=n,s[3]=r;var u=.5*i,l=.5*o,h=.5*a;return s[4]=u*r+l*n-h*e,s[5]=l*r+h*t-u*n,s[6]=h*r+u*e-l*t,s[7]=-u*t-l*e-h*n,s}function Gn(t,e,n){var r=.5*n[0],i=.5*n[1],o=.5*n[2],a=e[0],s=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=c,t[4]=r*c+i*u-o*s,t[5]=i*c+o*a-r*u,t[6]=o*c+r*s-i*a,t[7]=-r*a-i*s-o*u,t}function Zn(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Wn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Yn(t,e){var n=qe();Dt(n,e);var r=new c.ARRAY_TYPE(3);return It(r,e),Gn(t,n,r),t}function qn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Xn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Kn(t,e,n,r,i,o,a,s,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var $n=Sn;function Qn(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Jn=Sn;function tr(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function er(t,e){var n=e[4],r=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],c=e[3];return t[0]=2*(n*c+o*a+r*u-i*s),t[1]=2*(r*c+o*s+i*a-n*u),t[2]=2*(i*c+o*u+n*s-r*a),t}function nr(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=.5*n[0],u=.5*n[1],c=.5*n[2],l=e[4],h=e[5],f=e[6],d=e[7];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*c-o*u+l,t[5]=a*u+o*s-r*c+h,t[6]=a*c+r*u-i*s+f,t[7]=-r*s-i*u-o*c+d,t}function rr(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=s*a+l*r+u*o-c*i,f=u*a+l*i+c*r-s*o,d=c*a+l*o+s*i-u*r,p=l*a-s*r-u*i-c*o;return tn(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+f*o-d*i,t[5]=f*a+p*i+d*r-h*o,t[6]=d*a+p*o+h*i-f*r,t[7]=p*a-h*r-f*i-d*o,t}function ir(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=s*a+l*r+u*o-c*i,f=u*a+l*i+c*r-s*o,d=c*a+l*o+s*i-u*r,p=l*a-s*r-u*i-c*o;return en(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+f*o-d*i,t[5]=f*a+p*i+d*r-h*o,t[6]=d*a+p*o+h*i-f*r,t[7]=p*a-h*r-f*i-d*o,t}function or(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=s*a+l*r+u*o-c*i,f=u*a+l*i+c*r-s*o,d=c*a+l*o+s*i-u*r,p=l*a-s*r-u*i-c*o;return nn(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+f*o-d*i,t[5]=f*a+p*i+d*r-h*o,t[6]=d*a+p*o+h*i-f*r,t[7]=p*a-h*r-f*i-d*o,t}function ar(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=e[3];return t[0]=s*a+l*r+u*o-c*i,t[1]=u*a+l*i+c*r-s*o,t[2]=c*a+l*o+s*i-u*r,t[3]=l*a-s*r-u*i-c*o,s=e[4],u=e[5],c=e[6],l=e[7],t[4]=s*a+l*r+u*o-c*i,t[5]=u*a+l*i+c*r-s*o,t[6]=c*a+l*o+s*i-u*r,t[7]=l*a-s*r-u*i-c*o,t}function sr(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,s=n[4],u=n[5],c=n[6],l=n[7],t[4]=r*l+a*s+i*c-o*u,t[5]=i*l+a*u+o*s-r*c,t[6]=o*l+a*c+r*u-i*s,t[7]=a*l-r*s-i*u-o*c,t}function ur(t,e,n,r){if(Math.abs(r)0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,o=e[2]/n,a=e[3]/n,s=e[4],u=e[5],c=e[6],l=e[7],h=r*s+i*u+o*c+a*l;t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-r*h)/n,t[5]=(u-i*h)/n,t[6]=(c-o*h)/n,t[7]=(l-a*h)/n}return t}function _r(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Sr(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function Er(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],m=e[5],v=e[6],y=e[7];return Math.abs(n-h)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-f)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=c.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-g)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-m)<=c.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(u-v)<=c.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(l-y)<=c.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))}var Mr=n(31437)},35600:function(t,e,n){"use strict";n.r(e),n.d(e,{add:function(){return C},adjoint:function(){return d},clone:function(){return a},copy:function(){return s},create:function(){return i},determinant:function(){return p},equals:function(){return I},exactEquals:function(){return P},frob:function(){return A},fromMat2d:function(){return _},fromMat4:function(){return o},fromQuat:function(){return S},fromRotation:function(){return x},fromScaling:function(){return w},fromTranslation:function(){return b},fromValues:function(){return u},identity:function(){return l},invert:function(){return f},mul:function(){return L},multiply:function(){return g},multiplyScalar:function(){return N},multiplyScalarAndAdd:function(){return O},normalFromMat4:function(){return E},projection:function(){return M},rotate:function(){return v},scale:function(){return y},set:function(){return c},str:function(){return T},sub:function(){return D},subtract:function(){return k},translate:function(){return m},transpose:function(){return h}});var r=n(49685);function i(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function a(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function u(t,e,n,i,o,a,s,u,c){var l=new r.ARRAY_TYPE(9);return l[0]=t,l[1]=e,l[2]=n,l[3]=i,l[4]=o,l[5]=a,l[6]=s,l[7]=u,l[8]=c,l}function c(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function l(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function h(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=l*a-s*c,f=-l*o+s*u,d=c*o-a*u,p=n*h+r*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-l*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(l*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function d(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8];return t[0]=a*l-s*c,t[1]=i*c-r*l,t[2]=r*s-i*a,t[3]=s*u-o*l,t[4]=n*l-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function p(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function g(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=n[0],d=n[1],p=n[2],g=n[3],m=n[4],v=n[5],y=n[6],b=n[7],x=n[8];return t[0]=f*r+d*a+p*c,t[1]=f*i+d*s+p*l,t[2]=f*o+d*u+p*h,t[3]=g*r+m*a+v*c,t[4]=g*i+m*s+v*l,t[5]=g*o+m*u+v*h,t[6]=y*r+b*a+x*c,t[7]=y*i+b*s+x*l,t[8]=y*o+b*u+x*h,t}function m(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+d*a+c,t[7]=f*i+d*s+l,t[8]=f*o+d*u+h,t}function v(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*u,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*u-f*o,t[6]=c,t[7]=l,t[8]=h,t}function y(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function _(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function S(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,d=i*s,p=i*u,g=o*a,m=o*s,v=o*u;return t[0]=1-h-p,t[3]=l-v,t[6]=f+m,t[1]=l+v,t[4]=1-c-p,t[7]=d-g,t[2]=f-m,t[5]=d+g,t[8]=1-c-h,t}function E(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,_=r*c-o*s,S=i*c-o*u,E=l*g-h*p,M=l*m-f*p,T=l*v-d*p,A=h*m-f*g,C=h*v-d*g,k=f*v-d*m,N=y*k-b*C+x*A+w*T-_*M+S*E;return N?(N=1/N,t[0]=(s*k-u*C+c*A)*N,t[1]=(u*T-a*k-c*M)*N,t[2]=(a*C-s*T+c*E)*N,t[3]=(i*C-r*k-o*A)*N,t[4]=(n*k-i*T+o*M)*N,t[5]=(r*T-n*C-o*E)*N,t[6]=(g*S-m*_+v*w)*N,t[7]=(m*x-p*S-v*b)*N,t[8]=(p*_-g*x+v*y)*N,t):null}function M(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function T(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function A(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function C(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function k(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function N(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function O(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function I(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=e[0],d=e[1],p=e[2],g=e[3],m=e[4],v=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-f)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-g)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(u-v)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-y)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(l-b)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(h-x)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))}var L=g,D=k},31437:function(t,e,n){"use strict";n.r(e),n.d(e,{add:function(){return c},angle:function(){return R},ceil:function(){return d},clone:function(){return o},copy:function(){return s},create:function(){return i},cross:function(){return C},dist:function(){return W},distance:function(){return x},div:function(){return Z},divide:function(){return f},dot:function(){return A},equals:function(){return j},exactEquals:function(){return B},floor:function(){return p},forEach:function(){return X},fromValues:function(){return a},inverse:function(){return M},len:function(){return V},length:function(){return _},lerp:function(){return k},max:function(){return m},min:function(){return g},mul:function(){return G},multiply:function(){return h},negate:function(){return E},normalize:function(){return T},random:function(){return N},rotate:function(){return D},round:function(){return v},scale:function(){return y},scaleAndAdd:function(){return b},set:function(){return u},sqrDist:function(){return Y},sqrLen:function(){return q},squaredDistance:function(){return w},squaredLength:function(){return S},str:function(){return F},sub:function(){return H},subtract:function(){return l},transformMat2:function(){return O},transformMat2d:function(){return P},transformMat3:function(){return I},transformMat4:function(){return L},zero:function(){return z}});var r=n(49685);function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function l(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function h(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function f(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function m(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function _(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function T(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]}function C(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function k(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function N(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function O(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function P(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function I(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function L(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function D(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function R(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function z(t){return t[0]=0,t[1]=0,t}function F(t){return"vec2("+t[0]+", "+t[1]+")"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]}function j(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))}var U,V=_,H=l,G=h,Z=f,W=x,Y=w,q=S,X=(U=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function C(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function k(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function N(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),l=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*l,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*l,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*l,t}function O(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,l=3*o*s,h=3*u*a,f=u*o;return t[0]=e[0]*c+n[0]*l+r[0]*h+i[0]*f,t[1]=e[1]*c+n[1]*l+r[1]*h+i[1]*f,t[2]=e[2]*c+n[2]*l+r[2]*h+i[2]*f,t}function P(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI,i=2*r.RANDOM()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t}function I(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function L(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function D(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,h=o*s-r*c,f=r*u-i*s,d=i*f-o*h,p=o*l-r*f,g=r*h-i*l,m=2*a;return l*=m,h*=m,f*=m,d*=2,p*=2,g*=2,t[0]=s+l+d,t[1]=u+h+p,t[2]=c+f+g,t}function R(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function z(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function F(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&A(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function j(t){return t[0]=0,t[1]=0,t[2]=0,t}function U(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function H(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}var G,Z=h,W=f,Y=d,q=w,X=_,K=a,$=S,Q=(G=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;ao;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[r]=e,e._prev=a,e.parent=e._dp=t,e},kt=function(t,e,n,r){void 0===n&&(n="_first"),void 0===r&&(r="_last");var i=e._prev,o=e._next;i?i._next=o:t[n]===e&&(t[n]=o),o?o._prev=i:t[r]===e&&(t[r]=i),e._next=e._prev=e.parent=null},Nt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove(t),t._act=0},Ot=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},Pt=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},It=function(t,e,n,r){return t._startAt&&(a?t._startAt.revert(et):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},Lt=function t(e){return!e||e._ts&&t(e.parent)},Dt=function(t){return t._repeat?Rt(t._tTime,t=t.duration()+t._rDelay)*t:0},Rt=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},zt=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Ft=function(t){return t._end=mt(t._start+(t._tDur/Math.abs(t._ts||t._rts||S)||0))},Bt=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=mt(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ft(t),n._dirty||Ot(n,t)),t},jt=function(t,e){var n;if((e._time||e._initted&&!e._dur)&&(n=zt(t.rawTime(),e),(!e._dur||Qt(0,e.totalDuration(),n)-e._tTime>S)&&e.render(n,!0)),Ot(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-1e-8}},Ut=function(t,e,n,r){return e.parent&&Nt(e),e._start=mt((P(n)?n:n||t!==u?Xt(t,n,e):t._time)+e._delay),e._end=mt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Ct(t,e,"_first","_last",t._sort?"_start":0),Zt(e)||(t._recent=e),r||jt(t,e),t._ts<0&&Bt(t,t._tTime),t},Vt=function(t,e){return(Y.ScrollTrigger||K("scrollTrigger",e))&&Y.ScrollTrigger.create(e,t)},Ht=function(t,e,n,r,i){return qe(t,e,i),t._initted?!n&&t._pt&&!a&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&d!==Ae.frame?(it.push(t),t._lazy=[i,r],1):void 0:1},Gt=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},Zt=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},Wt=function(t,e,n,r){var i=t._repeat,o=mt(e)||0,a=t._tTime/t._tDur;return a&&!r&&(t._time*=o/t._dur),t._dur=o,t._tDur=i?i<0?1e10:mt(o*(i+1)+t._rDelay*i):o,a>0&&!r&&Bt(t,t._tTime=t._tDur*a),t.parent&&Ft(t),n||Ot(t.parent,t),t},Yt=function(t){return t instanceof Ve?Ot(t):Wt(t,t._dur)},qt={_start:0,endTime:J,totalDuration:J},Xt=function t(e,n,r){var i,o,a,s=e.labels,u=e._recent||qt,c=e.duration()>=_?u.endTime(!1):e._dur;return N(n)&&(isNaN(n)||n in s)?(o=n.charAt(0),a="%"===n.substr(-1),i=n.indexOf("="),"<"===o||">"===o?(i>=0&&(n=n.replace(/=/,"")),("<"===o?u._start:u.endTime(u._repeat>=0))+(parseFloat(n.substr(1))||0)*(a?(i<0?u:r).totalDuration()/100:1)):i<0?(n in s||(s[n]=c),s[n]):(o=parseFloat(n.charAt(i-1)+n.substr(i+1)),a&&r&&(o=o/100*(B(r)?r[0]:r).totalDuration()),i>1?t(e,n.substr(0,i-1),r)+o:c+o)):null==n?c:+n},Kt=function(t,e,n){var r,i,o=P(e[1]),a=(o?2:1)+(t<2?0:1),s=e[a];if(o&&(s.duration=e[1]),s.parent=n,t){for(r=s,i=n;i&&!("immediateRender"in r);)r=i.vars.defaults||{},i=D(i.vars.inherit)&&i.parent;s.immediateRender=D(r.immediateRender),t<2?s.runBackwards=1:s.startAt=e[a-1]}return new Je(e[0],s,e[a+1])},$t=function(t,e){return t||0===t?e(t):e},Qt=function(t,e,n){return ne?e:n},Jt=function(t,e){return N(t)&&(e=W.exec(t))?e[1]:""},te=[].slice,ee=function(t,e){return t&&L(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&L(t[0]))&&!t.nodeType&&t!==c},ne=function(t,e,n){return void 0===n&&(n=[]),t.forEach((function(t){var r;return N(t)&&!e||ee(t,1)?(r=n).push.apply(r,re(t)):n.push(t)}))||n},re=function(t,e,n){return s&&!e&&s.selector?s.selector(t):!N(t)||n||!l&&Ce()?B(t)?ne(t,n):ee(t)?te.call(t,0):t?[t]:[]:te.call((e||h).querySelectorAll(t),0)},ie=function(t){return t=re(t)[0]||$("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return re(e,n.querySelectorAll?n:n===t?$("Invalid scope")||h.createElement("div"):t)}},oe=function(t){return t.sort((function(){return.5-Math.random()}))},ae=function(t){if(O(t))return t;var e=L(t)?t:{each:t},n=De(e.ease),r=e.from||0,i=parseFloat(e.base)||0,o={},a=r>0&&r<1,s=isNaN(r)||a,u=e.axis,c=r,l=r;return N(r)?c=l={center:.5,edges:.5,end:1}[r]||0:!a&&s&&(c=r[0],l=r[1]),function(t,a,h){var f,d,p,g,m,v,y,b,x,w=(h||e).length,S=o[w];if(!S){if(!(x="auto"===e.grid?0:(e.grid||[1,_])[1])){for(y=-_;y<(y=h[x++].getBoundingClientRect().left)&&xy&&(y=m),mw?w-1:u?"y"===u?w/x:x:Math.max(x,w/x))||0)*("edges"===r?-1:1),S.b=w<0?i-w:i,S.u=Jt(e.amount||e.each)||0,n=n&&w<0?Ie(n):n}return w=(S[t]-S.min)/S.max||0,mt(S.b+(n?n(w):w)*S.v)+S.u}},se=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var r=mt(Math.round(parseFloat(n)/t)*t*e);return(r-r%1)/e+(P(n)?0:Jt(n))}},ue=function(t,e){var n,r,i=B(t);return!i&&L(t)&&(n=i=t.radius||_,t.values?(t=re(t.values),(r=!P(t[0]))&&(n*=n)):t=se(t.increment)),$t(e,i?O(t)?function(e){return r=t(e),Math.abs(r-e)<=n?r:e}:function(e){for(var i,o,a=parseFloat(r?e.x:e),s=parseFloat(r?e.y:0),u=_,c=0,l=t.length;l--;)(i=r?(i=t[l].x-a)*i+(o=t[l].y-s)*o:Math.abs(t[l]-a))(i=Math.abs(i))&&(o=r,s=i);return o},pe=function(t,e,n){var r,i,o,a=t.vars,u=a[e],c=s,l=t._ctx;if(u)return r=a[e+"Params"],i=a.callbackScope||t,n&&it.length&&bt(),l&&(s=l),o=r?u.apply(i,r):u.call(i),s=c,o},ge=function(t){return Nt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!a),t.progress()<1&&pe(t,"onInterrupt"),t},me=[],ve=function(t){if(R()){var e=(t=!t.name&&t.default||t).name,n=O(t),r=e&&!n&&t.init?function(){this._props=[]}:t,i={init:J,render:cn,add:We,kill:hn,modifier:ln,rawVars:0},o={targetTest:0,get:0,getSetter:on,aliases:{},register:0};if(Ce(),t!==r){if(at[e])return;St(r,St(Tt(t,i),o)),Et(r.prototype,Et(i,Tt(t,o))),at[r.prop=e]=r,t.targetTest&&(ct.push(r),rt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Q(e,r),t.register&&t.register(Tn,r,pn)}else me.push(t)},ye=255,be={aqua:[0,ye,ye],lime:[0,ye,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ye],navy:[0,0,128],white:[ye,ye,ye],olive:[128,128,0],yellow:[ye,ye,0],orange:[ye,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ye,0,0],pink:[ye,192,203],cyan:[0,ye,ye],transparent:[ye,ye,ye,0]},xe=function(t,e,n){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(n-e)*t*6:t<.5?n:3*t<2?e+(n-e)*(2/3-t)*6:e)*ye+.5|0},we=function(t,e,n){var r,i,o,a,s,u,c,l,h,f,d=t?P(t)?[t>>16,t>>8&ye,t&ye]:0:be.black;if(!d){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),be[t])d=be[t];else if("#"===t.charAt(0)){if(t.length<6&&(r=t.charAt(1),i=t.charAt(2),o=t.charAt(3),t="#"+r+r+i+i+o+o+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(d=parseInt(t.substr(1,6),16))>>16,d>>8&ye,d&ye,parseInt(t.substr(7),16)/255];d=[(t=parseInt(t.substr(1),16))>>16,t>>8&ye,t&ye]}else if("hsl"===t.substr(0,3))if(d=f=t.match(j),e){if(~t.indexOf("="))return d=t.match(U),n&&d.length<4&&(d[3]=1),d}else a=+d[0]%360/360,s=+d[1]/100,r=2*(u=+d[2]/100)-(i=u<=.5?u*(s+1):u+s-u*s),d.length>3&&(d[3]*=1),d[0]=xe(a+1/3,r,i),d[1]=xe(a,r,i),d[2]=xe(a-1/3,r,i);else d=t.match(j)||be.transparent;d=d.map(Number)}return e&&!f&&(r=d[0]/ye,i=d[1]/ye,o=d[2]/ye,u=((c=Math.max(r,i,o))+(l=Math.min(r,i,o)))/2,c===l?a=s=0:(h=c-l,s=u>.5?h/(2-c-l):h/(c+l),a=c===r?(i-o)/h+(is&&(d+=b-u),((l=(f=(p+=b)-d)-v)>0||x)&&(g=++r.frame,i=f-1e3*r.time,r.time=f/=1e3,v+=l+(l>=m?4:m-l),h=1),x||(t=e(n)),h)for(o=0;o=e&&o--},_listeners:y}}(),Ce=function(){return!g&&Ae.wake()},ke={},Ne=/^[\d.\-M][\d.\-,\s]/,Oe=/["']/g,Pe=function(t){for(var e,n,r,i={},o=t.substr(1,t.length-3).split(":"),a=o[0],s=1,u=o.length;s1&&a.config?a.config.apply(null,~t.indexOf("{")?[Pe(o[1])]:(e=t,n=e.indexOf("(")+1,r=e.indexOf(")"),i=e.indexOf("(",n),e.substring(n,~i&&i=1?n:1,o=(r||(e?.3:.45))/(n<1?n:1),a=o/E*(Math.asin(1/i)||0),s=function(t){return 1===t?1:i*Math.pow(2,-10*t)*k((t-a)*o)+1},u="out"===e?s:"in"===e?function(t){return 1-s(1-t)}:ze(s);return o=E/o,u.config=function(n,r){return t(e,n,r)},u},Be=function t(e,n){void 0===n&&(n=1.70158);var r=function(t){return t?--t*t*((n+1)*t+n)+1:0},i="out"===e?r:"in"===e?function(t){return 1-r(1-t)}:ze(r);return i.config=function(n){return t(e,n)},i};pt("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var n=e<5?e+1:e;Re(t+",Power"+(n-1),e?function(t){return Math.pow(t,n)}:function(t){return t},(function(t){return 1-Math.pow(1-t,n)}),(function(t){return t<.5?Math.pow(2*t,n)/2:1-Math.pow(2*(1-t),n)/2}))})),ke.Linear.easeNone=ke.none=ke.Linear.easeIn,Re("Elastic",Fe("in"),Fe("out"),Fe()),m=7.5625,y=1/(v=2.75),Re("Bounce",(function(t){return 1-b(1-t)}),b=function(t){return t0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Wt(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(Ce(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Bt(this,t),!n._dp||n.parent||jt(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t0||!this._tDur&&!t)&&Ut(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===S||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),xt(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Dt(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Dt(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},e.iteration=function(t,e){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*n,e):this._repeat?Rt(this._tTime,n)+1:1},e.timeScale=function(t){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?zt(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(Qt(-Math.abs(this._delay),this._tDur,e),!0),Ft(this),Pt(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ce(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==S&&(this._tTime-=S)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Ut(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(D(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?zt(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=nt);var e=a;return a=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),a=e,this},e.globalTime=function(t){for(var e=this,n=arguments.length?t:e.rawTime();e;)n=e._start+n/(e._ts||1),e=e._dp;return!this.parent&&this._sat?this._sat.vars.immediateRender?-1:this._sat.globalTime(t):n},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Yt(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,Yt(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(Xt(this,t),D(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,D(e))},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,n=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=n&&t1?(e?(r[t]=e,n&&(r[t+"Params"]=n),"onUpdate"===t&&(this._onUpdate=e)):delete r[t],this):r[t]},e.then=function(t){var e=this;return new Promise((function(n){var r=O(t)?t:_t,i=function(){var t=e.then;e.then=null,O(r)&&(r=r(e))&&(r.then||r===e)&&(e.then=t),n(r),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?i():e._prom=i}))},e.kill=function(){ge(this)},t}();St(Ue.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Ve=function(t){function e(e,n){var i;return void 0===e&&(e={}),(i=t.call(this,e)||this).labels={},i.smoothChildTiming=!!e.smoothChildTiming,i.autoRemoveChildren=!!e.autoRemoveChildren,i._sort=D(e.sortChildren),u&&Ut(e.parent||u,r(i),n),e.reversed&&i.reverse(),e.paused&&i.paused(!0),e.scrollTrigger&&Vt(r(i),e.scrollTrigger),i}i(e,t);var n=e.prototype;return n.to=function(t,e,n){return Kt(0,arguments,this),this},n.from=function(t,e,n){return Kt(1,arguments,this),this},n.fromTo=function(t,e,n,r){return Kt(2,arguments,this),this},n.set=function(t,e,n){return e.duration=0,e.parent=this,At(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Je(t,e,Xt(this,n),1),this},n.call=function(t,e,n){return Ut(this,Je.delayedCall(0,t,e),n)},n.staggerTo=function(t,e,n,r,i,o,a){return n.duration=e,n.stagger=n.stagger||r,n.onComplete=o,n.onCompleteParams=a,n.parent=this,new Je(t,n,Xt(this,i)),this},n.staggerFrom=function(t,e,n,r,i,o,a){return n.runBackwards=1,At(n).immediateRender=D(n.immediateRender),this.staggerTo(t,e,n,r,i,o,a)},n.staggerFromTo=function(t,e,n,r,i,o,a,s){return r.startAt=n,At(r).immediateRender=D(r.immediateRender),this.staggerTo(t,e,r,i,o,a,s)},n.render=function(t,e,n){var r,i,o,s,c,l,h,f,d,p,g,m,v=this._time,y=this._dirty?this.totalDuration():this._tDur,b=this._dur,x=t<=0?0:mt(t),w=this._zTime<0!=t<0&&(this._initted||!b);if(this!==u&&x>y&&t>=0&&(x=y),x!==this._tTime||n||w){if(v!==this._time&&b&&(x+=this._time-v,t+=this._time-v),r=x,d=this._start,l=!(f=this._ts),w&&(b||(v=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(g=this._yoyo,c=b+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*c+t,e,n);if(r=mt(x%c),x===y?(s=this._repeat,r=b):((s=~~(x/c))&&s===x/c&&(r=b,s--),r>b&&(r=b)),p=Rt(this._tTime,c),!v&&this._tTime&&p!==s&&this._tTime-p*c-this._dur<=0&&(p=s),g&&1&s&&(r=b-r,m=1),s!==p&&!this._lock){var _=g&&1&p,E=_===(g&&1&s);if(se)for(r=t._first;r&&r._start<=n;){if("isPause"===r.data&&r._start>e)return r;r=r._next}else for(r=t._last;r&&r._start>=n;){if("isPause"===r.data&&r._start=v&&t>=0)for(i=this._first;i;){if(o=i._next,(i._act||r>=i._start)&&i._ts&&h!==i){if(i.parent!==this)return this.render(t,e,n);if(i.render(i._ts>0?(r-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(r-i._start)*i._ts,e,n),r!==this._time||!this._ts&&!l){h=0,o&&(x+=this._zTime=-1e-8);break}}i=o}else{i=this._last;for(var M=t<0?t:r;i;){if(o=i._prev,(i._act||M<=i._end)&&i._ts&&h!==i){if(i.parent!==this)return this.render(t,e,n);if(i.render(i._ts>0?(M-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(M-i._start)*i._ts,e,n||a&&(i._initted||i._startAt)),r!==this._time||!this._ts&&!l){h=0,o&&(x+=this._zTime=M?-1e-8:S);break}}i=o}}if(h&&!e&&(this.pause(),h.render(r>=v?0:-1e-8)._zTime=r>=v?1:-1,this._ts))return this._start=d,Ft(this),this.render(t,e,n);this._onUpdate&&!e&&pe(this,"onUpdate",!0),(x===y&&this._tTime>=this.totalDuration()||!x&&v)&&(d!==this._start&&Math.abs(f)===Math.abs(this._ts)||this._lock||((t||!b)&&(x===y&&this._ts>0||!x&&this._ts<0)&&Nt(this,1),e||t<0&&!v||!x&&!v&&y||(pe(this,x===y&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(x0)&&this._prom())))}return this},n.add=function(t,e){var n=this;if(P(e)||(e=Xt(this,e,t)),!(t instanceof Ue)){if(B(t))return t.forEach((function(t){return n.add(t,e)})),this;if(N(t))return this.addLabel(t,e);if(!O(t))return this;t=Je.delayedCall(0,t)}return this!==t?Ut(this,t,e):this},n.getChildren=function(t,e,n,r){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===n&&(n=!0),void 0===r&&(r=-_);for(var i=[],o=this._first;o;)o._start>=r&&(o instanceof Je?e&&i.push(o):(n&&i.push(o),t&&i.push.apply(i,o.getChildren(!0,e,n)))),o=o._next;return i},n.getById=function(t){for(var e=this.getChildren(1,1,1),n=e.length;n--;)if(e[n].vars.id===t)return e[n]},n.remove=function(t){return N(t)?this.removeLabel(t):O(t)?this.killTweensOf(t):(kt(this,t),t===this._recent&&(this._recent=this._last),Ot(this))},n.totalTime=function(e,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=mt(Ae.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,n),this._forcing=0,this):this._tTime},n.addLabel=function(t,e){return this.labels[t]=Xt(this,e),this},n.removeLabel=function(t){return delete this.labels[t],this},n.addPause=function(t,e,n){var r=Je.delayedCall(0,e||J,n);return r.data="isPause",this._hasPause=1,Ut(this,r,Xt(this,t))},n.removePause=function(t){var e=this._first;for(t=Xt(this,t);e;)e._start===t&&"isPause"===e.data&&Nt(e),e=e._next},n.killTweensOf=function(t,e,n){for(var r=this.getTweensOf(t,n),i=r.length;i--;)He!==r[i]&&r[i].kill(t,e);return this},n.getTweensOf=function(t,e){for(var n,r=[],i=re(t),o=this._first,a=P(e);o;)o instanceof Je?yt(o._targets,i)&&(a?(!He||o._initted&&o._ts)&&o.globalTime(0)<=e&&o.globalTime(o.totalDuration())>e:!e||o.isActive())&&r.push(o):(n=o.getTweensOf(i,e)).length&&r.push.apply(r,n),o=o._next;return r},n.tweenTo=function(t,e){e=e||{};var n,r=this,i=Xt(r,t),o=e,a=o.startAt,s=o.onStart,u=o.onStartParams,c=o.immediateRender,l=Je.to(r,St({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:e.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale())||S,onStart:function(){if(r.pause(),!n){var t=e.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale());l._dur!==t&&Wt(l,t,0,1).render(l._time,!0,!0),n=1}s&&s.apply(l,u||[])}},e));return c?l.render(0):l},n.tweenFromTo=function(t,e,n){return this.tweenTo(e,St({startAt:{time:Xt(this,t)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(t){return void 0===t&&(t=this._time),de(this,Xt(this,t))},n.previousLabel=function(t){return void 0===t&&(t=this._time),de(this,Xt(this,t),1)},n.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+S)},n.shiftChildren=function(t,e,n){void 0===n&&(n=0);for(var r,i=this._first,o=this.labels;i;)i._start>=n&&(i._start+=t,i._end+=t),i=i._next;if(e)for(r in o)o[r]>=n&&(o[r]+=t);return Ot(this)},n.invalidate=function(e){var n=this._first;for(this._lock=0;n;)n.invalidate(e),n=n._next;return t.prototype.invalidate.call(this,e)},n.clear=function(t){void 0===t&&(t=!0);for(var e,n=this._first;n;)e=n._next,this.remove(n),n=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Ot(this)},n.totalDuration=function(t){var e,n,r,i=0,o=this,a=o._last,s=_;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-t:t));if(o._dirty){for(r=o.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),(n=a._start)>s&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ut(o,a,n-a._delay,1)._lock=0):s=n,n<0&&a._ts&&(i-=n,(!r&&!o._dp||r&&r.smoothChildTiming)&&(o._start+=n/o._ts,o._time-=n,o._tTime-=n),o.shiftChildren(-n,!1,-Infinity),s=0),a._end>i&&a._ts&&(i=a._end),a=e;Wt(o,o===u&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(t){if(u._ts&&(xt(u,zt(t,u)),d=Ae.frame),Ae.frame>=ut){ut+=x.autoSleep||120;var e=u._first;if((!e||!e._ts)&&x.autoSleep&&Ae._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Ae.sleep()}}},e}(Ue);St(Ve.prototype,{_lock:0,_hasPause:0,_forcing:0});var He,Ge,Ze=function(t,e,n,r,i,o,a){var s,u,c,l,h,f,d,p,g=new pn(this._pt,t,e,0,1,un,null,i),m=0,v=0;for(g.b=n,g.e=r,n+="",(d=~(r+="").indexOf("random("))&&(r=he(r)),o&&(o(p=[n,r],t,e),n=p[0],r=p[1]),u=n.match(H)||[];s=H.exec(r);)l=s[0],h=r.substring(m,s.index),c?c=(c+1)%5:"rgba("===h.substr(-5)&&(c=1),l!==u[v++]&&(f=parseFloat(u[v-1])||0,g._pt={_next:g._pt,p:h||1===v?h:",",s:f,c:"="===l.charAt(1)?vt(f,l)-f:parseFloat(l)-f,m:c&&c<4?Math.round:0},m=H.lastIndex);return g.c=m")})),c.duration();else{for(d in h={},E)"ease"===d||"easeEach"===d||Xe(d,E[d],h,E.easeEach);for(d in h)for(N=h[d].sort((function(t,e){return t.t-e.t})),R=0,l=0;lp-S&&!m?p:tg&&(r=g)),(c=this._yoyo&&1&o)&&(f=this._yEase,r=g-r),u=Rt(this._tTime,s),r===d&&!n&&this._initted)return this._tTime=v,this;o!==u&&(h&&this._yEase&&Le(h,c),!this.vars.repeatRefresh||c||this._lock||(this._lock=n=1,this.render(mt(s*o),!0).invalidate()._lock=0))}if(!this._initted){if(Ht(this,m?t:r,n,e,v))return this._tTime=0,this;if(d!==this._time)return this;if(g!==this._dur)return this.render(t,e,n)}if(this._tTime=v,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=l=(f||this._ease)(r/g),this._from&&(this.ratio=l=1-l),r&&!d&&!e&&!o&&(pe(this,"onStart"),this._tTime!==v))return this;for(i=this._pt;i;)i.r(l,i.d),i=i._next;h&&h.render(t<0?t:!r&&c?-1e-8:h._dur*h._ease(r/this._dur),e,n)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(m&&It(this,t,0,n),pe(this,"onUpdate")),this._repeat&&o!==u&&this.vars.onRepeat&&!e&&this.parent&&pe(this,"onRepeat"),v!==this._tDur&&v||this._tTime!==v||(m&&!this._onUpdate&&It(this,t,0,!0),(t||!g)&&(v===this._tDur&&this._ts>0||!v&&this._ts<0)&&Nt(this,1),e||m&&!d||!(v||d||c)||(pe(this,v===p?"onComplete":"onReverseComplete",!0),this._prom&&!(v0)&&this._prom()))}}else!function(t,e,n,r){var i,o,s,u=t.ratio,c=e<0||!e&&(!t._start&&Gt(t)&&(t._initted||!Zt(t))||(t._ts<0||t._dp._ts<0)&&!Zt(t))?0:1,l=t._rDelay,h=0;if(l&&t._repeat&&(h=Qt(0,t._tDur,e),o=Rt(h,l),t._yoyo&&1&o&&(c=1-c),o!==Rt(t._tTime,l)&&(u=1-c,t.vars.repeatRefresh&&t._initted&&t.invalidate())),c!==u||a||r||t._zTime===S||!e&&t._zTime){if(!t._initted&&Ht(t,e,r,n,h))return;for(s=t._zTime,t._zTime=e||(n?S:0),n||(n=e&&!s),t.ratio=c,t._from&&(c=1-c),t._time=0,t._tTime=h,i=t._pt;i;)i.r(c,i.d),i=i._next;e<0&&It(t,e,0,!0),t._onUpdate&&!n&&pe(t,"onUpdate"),h&&t._repeat&&!n&&t.parent&&pe(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===c&&(c&&Nt(t,1),n||a||(pe(t,c?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,n);return this},n.targets=function(){return this._targets},n.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},n.resetTo=function(t,e,n,r){g||Ae.wake(),this._ts||this.play();var i=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||qe(this,i),function(t,e,n,r,i,o,a){var s,u,c,l,h=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!h)for(h=t._ptCache[e]=[],c=t._ptLookup,l=t._targets.length;l--;){if((s=c[l][e])&&s.d&&s.d._pt)for(s=s.d._pt;s&&s.p!==e&&s.fp!==e;)s=s._next;if(!s)return Ge=1,t.vars[e]="+=0",qe(t,a),Ge=0,1;h.push(s)}for(l=h.length;l--;)(s=(u=h[l])._pt||u).s=!r&&0!==r||i?s.s+(r||0)+o*s.c:r,s.c=n-s.s,u.e&&(u.e=gt(n)+Jt(u.e)),u.b&&(u.b=s.s+Jt(u.b))}(this,t,e,n,r,this._ease(i/this._dur),i)?this.resetTo(t,e,n,r):(Bt(this,0),this.parent||Ct(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?ge(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,He&&!0!==He.vars.overwrite)._first||ge(this),this.parent&&n!==this.timeline.totalDuration()&&Wt(this,this._dur*this.timeline._tDur/n,0,1),this}var r,i,o,a,s,u,c,l=this._targets,h=t?re(t):l,f=this._ptLookup,d=this._pt;if((!e||"all"===e)&&function(t,e){for(var n=t.length,r=n===e.length;r&&n--&&t[n]===e[n];);return n<0}(l,h))return"all"===e&&(this._pt=0),ge(this);for(r=this._op=this._op||[],"all"!==e&&(N(e)&&(s={},pt(e,(function(t){return s[t]=1})),e=s),e=function(t,e){var n,r,i,o,a=t[0]?ft(t[0]).harness:0,s=a&&a.aliases;if(!s)return e;for(r in n=Et({},e),s)if(r in n)for(i=(o=s[r].split(",")).length;i--;)n[o[i]]=n[r];return n}(l,e)),c=l.length;c--;)if(~h.indexOf(l[c]))for(s in i=f[c],"all"===e?(r[c]=e,a=i,o={}):(o=r[c]=r[c]||{},a=e),a)(u=i&&i[s])&&("kill"in u.d&&!0!==u.d.kill(s)||kt(this,u,"_pt"),delete i[s]),"all"!==o&&(o[s]=1);return this._initted&&!this._pt&&d&&ge(this),this},e.to=function(t,n){return new e(t,n,arguments[2])},e.from=function(t,e){return Kt(1,arguments)},e.delayedCall=function(t,n,r,i){return new e(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},e.fromTo=function(t,e,n){return Kt(2,arguments)},e.set=function(t,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new e(t,n)},e.killTweensOf=function(t,e,n){return u.killTweensOf(t,e,n)},e}(Ue);St(Je.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),pt("staggerTo,staggerFrom,staggerFromTo",(function(t){Je[t]=function(){var e=new Ve,n=te.call(arguments,0);return n.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,n)}}));var tn=function(t,e,n){return t[e]=n},en=function(t,e,n){return t[e](n)},nn=function(t,e,n,r){return t[e](r.fp,n)},rn=function(t,e,n){return t.setAttribute(e,n)},on=function(t,e){return O(t[e])?en:I(t[e])&&t.setAttribute?rn:tn},an=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},sn=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},un=function(t,e){var n=e._pt,r="";if(!t&&e.b)r=e.b;else if(1===t&&e.e)r=e.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*t):Math.round(1e4*(n.s+n.c*t))/1e4)+r,n=n._next;r+=e.c}e.set(e.t,e.p,r,e)},cn=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},ln=function(t,e,n,r){for(var i,o=this._pt;o;)i=o._next,o.p===r&&o.modifier(t,e,n),o=i},hn=function(t){for(var e,n,r=this._pt;r;)n=r._next,r.p===t&&!r.op||r.op===t?kt(this,r,"_pt"):r.dep||(e=1),r=n;return!e},fn=function(t,e,n,r){r.mSet(t,e,r.m.call(r.tween,n,r.mt),r)},dn=function(t){for(var e,n,r,i,o=t._pt;o;){for(e=o._next,n=r;n&&n.pr>o.pr;)n=n._next;(o._prev=n?n._prev:i)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:i=o,o=e}t._pt=r},pn=function(){function t(t,e,n,r,i,o,a,s,u){this.t=e,this.s=r,this.c=i,this.p=n,this.r=o||an,this.d=a||this,this.set=s||tn,this.pr=u||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,n){this.mSet=this.mSet||this.set,this.set=fn,this.m=t,this.mt=n,this.tween=e},t}();pt(lt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return rt[t]=1})),Y.TweenMax=Y.TweenLite=Je,Y.TimelineLite=Y.TimelineMax=Ve,u=new Ve({sortChildren:!1,defaults:w,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),x.stringFilter=Te;var gn=[],mn={},vn=[],yn=0,bn=function(t){return(mn[t]||vn).map((function(t){return t()}))},xn=function(){var t=Date.now(),e=[];t-yn>2&&(bn("matchMediaInit"),gn.forEach((function(t){var n,r,i,o,a=t.queries,s=t.conditions;for(r in a)(n=c.matchMedia(a[r]).matches)&&(i=1),n!==s[r]&&(s[r]=n,o=1);o&&(t.revert(),i&&e.push(t))})),bn("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t)})),yn=t,bn("matchMedia"))},wn=function(){function t(t,e){this.selector=e&&ie(e),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,n){O(t)&&(n=e,e=t,t=O);var r=this,i=function(){var t,i=s,o=r.selector;return i&&i!==r&&i.data.push(r),n&&(r.selector=ie(n)),s=r,t=e.apply(r,arguments),O(t)&&r._r.push(t),s=i,r.selector=o,r.isReverted=!1,t};return r.last=i,t===O?i(r):t?r[t]=i:i},e.ignore=function(t){var e=s;s=null,t(this),s=e},e.getTweens=function(){var e=[];return this.data.forEach((function(n){return n instanceof t?e.push.apply(e,n.getTweens()):n instanceof Je&&!(n.parent&&"nested"===n.parent.data)&&e.push(n)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var n=this;if(t){var r=this.getTweens();this.data.forEach((function(t){"isFlip"===t.data&&(t.revert(),t.getChildren(!0,!0,!1).forEach((function(t){return r.splice(r.indexOf(t),1)})))})),r.map((function(t){return{g:t.globalTime(0),t:t}})).sort((function(t,e){return e.g-t.g||-1})).forEach((function(e){return e.t.revert(t)})),this.data.forEach((function(e){return!(e instanceof Ue)&&e.revert&&e.revert(t)})),this._r.forEach((function(e){return e(t,n)})),this.isReverted=!0}else this.data.forEach((function(t){return t.kill&&t.kill()}));if(this.clear(),e){var i=gn.indexOf(this);~i&&gn.splice(i,1)}},e.revert=function(t){this.kill(t||{})},t}(),_n=function(){function t(t){this.contexts=[],this.scope=t}var e=t.prototype;return e.add=function(t,e,n){L(t)||(t={matches:t});var r,i,o,a=new wn(0,n||this.scope),s=a.conditions={};for(i in this.contexts.push(a),e=a.add("onMatch",e),a.queries=t,t)"all"===i?o=1:(r=c.matchMedia(t[i]))&&(gn.indexOf(a)<0&&gn.push(a),(s[i]=r.matches)&&(o=1),r.addListener?r.addListener(xn):r.addEventListener("change",xn));return o&&e(a),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Sn={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n1){var r=t.map((function(t){return Tn.quickSetter(t,e,n)})),i=r.length;return function(t){for(var e=i;e--;)r[e](t)}}t=t[0]||{};var o=at[e],a=ft(t),s=a.harness&&(a.harness.aliases||{})[e]||e,u=o?function(e){var r=new o;p._pt=0,r.init(t,n?e+n:e,p,0,[t]),r.render(1,r),p._pt&&cn(1,p)}:a.set(t,s);return o?u:function(e){return u(t,s,n?e+n:e,a,1)}},quickTo:function(t,e,n){var r,i=Tn.to(t,Et(((r={})[e]="+=0.1",r.paused=!0,r),n||{})),o=function(t,n,r){return i.resetTo(e,t,n,r)};return o.tween=i,o},isTweening:function(t){return u.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=De(t.ease,w.ease)),Mt(w,t||{})},config:function(t){return Mt(x,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,r=t.plugins,i=t.defaults,o=t.extendTimeline;(r||"").split(",").forEach((function(t){return t&&!at[t]&&!Y[t]&&$(e+" effect requires "+t+" plugin.")})),st[e]=function(t,e,r){return n(re(t),St(e||{},i),r)},o&&(Ve.prototype[e]=function(t,n,r){return this.add(st[e](t,L(n)?n:(r=n)&&{},this),r)})},registerEase:function(t,e){ke[t]=De(e)},parseEase:function(t,e){return arguments.length?De(t,e):ke},getById:function(t){return u.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var n,r,i=new Ve(t);for(i.smoothChildTiming=D(t.smoothChildTiming),u.remove(i),i._dp=0,i._time=i._tTime=u._time,n=u._first;n;)r=n._next,!e&&!n._dur&&n instanceof Je&&n.vars.onComplete===n._targets[0]||Ut(i,n,n._start-n._delay),n=r;return Ut(u,i,0),i},context:function(t,e){return t?new wn(t,e):s},matchMedia:function(t){return new _n(t)},matchMediaRefresh:function(){return gn.forEach((function(t){var e,n,r=t.conditions;for(n in r)r[n]&&(r[n]=!1,e=1);e&&t.revert()}))||xn()},addEventListener:function(t,e){var n=mn[t]||(mn[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=mn[t],r=n&&n.indexOf(e);r>=0&&n.splice(r,1)},utils:{wrap:function t(e,n,r){var i=n-e;return B(e)?le(e,t(0,e.length),n):$t(r,(function(t){return(i+(t-e)%i)%i+e}))},wrapYoyo:function t(e,n,r){var i=n-e,o=2*i;return B(e)?le(e,t(0,e.length-1),n):$t(r,(function(t){return e+((t=(o+(t-e)%o)%o||0)>i?o-t:t)}))},distribute:ae,random:ce,snap:ue,normalize:function(t,e,n){return fe(t,e,0,1,n)},getUnit:Jt,clamp:function(t,e,n){return $t(n,(function(n){return Qt(t,e,n)}))},splitColor:we,toArray:re,selector:ie,mapRange:fe,pipe:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0)return;i._gsap.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(nr,n,"")),e=er}(o||n)&&this.props.push(e,n,o[e])},ir=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},or=function(){var t,e,n=this.props,r=this.target,i=r.style,o=r._gsap;for(t=0;t=0?cr[i]:"")+t},hr=function(){"undefined"!=typeof window&&window.document&&(An=window,Cn=An.document,kn=Cn.documentElement,On=sr("div")||{style:{}},sr("div"),er=lr(er),nr=er+"Origin",On.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ln=!!lr("perspective"),In=Tn.core.reverting,Nn=1)},fr=function t(e){var n,r=sr("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,a=this.style.cssText;if(kn.appendChild(r),r.appendChild(this),this.style.display="block",e)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(n=this._gsapBBox());return i&&(o?i.insertBefore(this,o):i.appendChild(this)),kn.removeChild(r),this.style.cssText=a,n},dr=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},pr=function(t){var e;try{e=t.getBBox()}catch(n){e=fr.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===fr||(e=fr.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+dr(t,["x","cx","x1"])||0,y:+dr(t,["y","cy","y1"])||0,width:0,height:0}},gr=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!pr(t))},mr=function(t,e){if(e){var n=t.style;e in Dn&&e!==nr&&(e=er),n.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty(e.replace(Bn,"-$1").toLowerCase())):n.removeAttribute(e)}},vr=function(t,e,n,r,i,o){var a=new pn(t._pt,e,n,0,1,o?qn:Yn);return t._pt=a,a.b=r,a.e=i,t._props.push(n),a},yr={deg:1,rad:1,turn:1},br={grid:1,flex:1},xr=function t(e,n,r,i){var o,a,s,u,c=parseFloat(r)||0,l=(r+"").trim().substr((c+"").length)||"px",h=On.style,f=jn.test(n),d="svg"===e.tagName.toLowerCase(),p=(d?"client":"offset")+(f?"Width":"Height"),g=100,m="px"===i,v="%"===i;return i===l||!c||yr[i]||yr[l]?c:("px"!==l&&!m&&(c=t(e,n,r,"px")),u=e.getCTM&&gr(e),!v&&"%"!==l||!Dn[n]&&!~n.indexOf("adius")?(h[f?"width":"height"]=g+(m?l:i),a=~n.indexOf("adius")||"em"===i&&e.appendChild&&!d?e:e.parentNode,u&&(a=(e.ownerSVGElement||{}).parentNode),a&&a!==Cn&&a.appendChild||(a=Cn.body),(s=a._gsap)&&v&&s.width&&f&&s.time===Ae.time&&!s.uncache?gt(c/s.width*g):((v||"%"===l)&&!br[ur(a,"display")]&&(h.position=ur(e,"position")),a===e&&(h.position="static"),a.appendChild(On),o=On[p],a.removeChild(On),h.position="absolute",f&&v&&((s=ft(a)).time=Ae.time,s.width=a[p]),gt(m?o*c/g:o&&c?g/o*c:0))):(o=u?e.getBBox()[f?"width":"height"]:e[p],gt(v?c/o*g:c/100*o)))},wr=function(t,e,n,r){var i;return Nn||hr(),e in Vn&&"transform"!==e&&~(e=Vn[e]).indexOf(",")&&(e=e.split(",")[0]),Dn[e]&&"transform"!==e?(i=Pr(t,r),i="transformOrigin"!==e?i[e]:i.svg?i.origin:Ir(ur(t,nr))+" "+i.zOrigin+"px"):(!(i=t.style[e])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=Mr[e]&&Mr[e](t,e,n)||ur(t,e)||dt(t,e)||("opacity"===e?1:0)),n&&!~(i+"").trim().indexOf(" ")?xr(t,e,i,n)+n:i},_r=function(t,e,n,r){if(!n||"none"===n){var i=lr(e,t,1),o=i&&ur(t,i,1);o&&o!==n?(e=i,n=o):"borderColor"===e&&(n=ur(t,"borderTopColor"))}var a,s,u,c,l,h,f,d,p,g,m,v=new pn(this._pt,t.style,e,0,1,un),y=0,b=0;if(v.b=n,v.e=r,n+="","auto"===(r+="")&&(t.style[e]=r,r=ur(t,e)||r,t.style[e]=n),Te(a=[n,r]),r=a[1],u=(n=a[0]).match(V)||[],(r.match(V)||[]).length){for(;s=V.exec(r);)f=s[0],p=r.substring(y,s.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),f!==(h=u[b++]||"")&&(c=parseFloat(h)||0,m=h.substr((c+"").length),"="===f.charAt(1)&&(f=vt(c,f)+m),d=parseFloat(f),g=f.substr((d+"").length),y=V.lastIndex-g.length,g||(g=g||x.units[e]||m,y===r.length&&(r+=g,v.e+=g)),m!==g&&(c=xr(t,e,h,g)||0),v._pt={_next:v._pt,p:p||1===b?p:",",s:c,c:d-c,m:l&&l<4||"zIndex"===e?Math.round:0});v.c=y-1;)n=s[i],Dn[n]&&(r=1,n="transformOrigin"===n?nr:er),mr(o,n);r&&(mr(o,er),u&&(u.svg&&o.removeAttribute("transform"),Pr(o,1),u.uncache=1,ir(a)))}},Mr={clearProps:function(t,e,n,r,i){if("isFromStart"!==i.data){var o=t._pt=new pn(t._pt,e,n,0,0,Er);return o.u=r,o.pr=-10,o.tween=i,t._props.push(n),1}}},Tr=[1,0,0,1,0,0],Ar={},Cr=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},kr=function(t){var e=ur(t,er);return Cr(e)?Tr:e.substr(7).match(U).map(gt)},Nr=function(t,e){var n,r,i,o,a=t._gsap||ft(t),s=t.style,u=kr(t);return a.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?Tr:u:(u!==Tr||t.offsetParent||t===kn||a.svg||(i=s.display,s.display="block",(n=t.parentNode)&&t.offsetParent||(o=1,r=t.nextElementSibling,kn.appendChild(t)),u=kr(t),i?s.display=i:mr(t,"display"),o&&(r?n.insertBefore(t,r):n?n.appendChild(t):kn.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},Or=function(t,e,n,r,i,o){var a,s,u,c=t._gsap,l=i||Nr(t,!0),h=c.xOrigin||0,f=c.yOrigin||0,d=c.xOffset||0,p=c.yOffset||0,g=l[0],m=l[1],v=l[2],y=l[3],b=l[4],x=l[5],w=e.split(" "),_=parseFloat(w[0])||0,S=parseFloat(w[1])||0;n?l!==Tr&&(s=g*y-m*v)&&(u=_*(-m/s)+S*(g/s)-(g*x-m*b)/s,_=_*(y/s)+S*(-v/s)+(v*x-y*b)/s,S=u):(_=(a=pr(t)).x+(~w[0].indexOf("%")?_/100*a.width:_),S=a.y+(~(w[1]||w[0]).indexOf("%")?S/100*a.height:S)),r||!1!==r&&c.smooth?(b=_-h,x=S-f,c.xOffset=d+(b*g+x*v)-b,c.yOffset=p+(b*m+x*y)-x):c.xOffset=c.yOffset=0,c.xOrigin=_,c.yOrigin=S,c.smooth=!!r,c.origin=e,c.originIsAbsolute=!!n,t.style[nr]="0px 0px",o&&(vr(o,c,"xOrigin",h,_),vr(o,c,"yOrigin",f,S),vr(o,c,"xOffset",d,c.xOffset),vr(o,c,"yOffset",p,c.yOffset)),t.setAttribute("data-svg-origin",_+" "+S)},Pr=function(t,e){var n=t._gsap||new je(t);if("x"in n&&!e&&!n.uncache)return n;var r,i,o,a,s,u,c,l,h,f,d,p,g,m,v,y,b,w,_,S,E,M,T,A,C,k,N,O,P,I,L,D,R=t.style,z=n.scaleX<0,F="px",B="deg",j=getComputedStyle(t),U=ur(t,nr)||"0";return r=i=o=u=c=l=h=f=d=0,a=s=1,n.svg=!(!t.getCTM||!gr(t)),j.translate&&("none"===j.translate&&"none"===j.scale&&"none"===j.rotate||(R[er]=("none"!==j.translate?"translate3d("+(j.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==j.rotate?"rotate("+j.rotate+") ":"")+("none"!==j.scale?"scale("+j.scale.split(" ").join(",")+") ":"")+("none"!==j[er]?j[er]:"")),R.scale=R.rotate=R.translate="none"),m=Nr(t,n.svg),n.svg&&(n.uncache?(C=t.getBBox(),U=n.xOrigin-C.x+"px "+(n.yOrigin-C.y)+"px",A=""):A=!e&&t.getAttribute("data-svg-origin"),Or(t,A||U,!!A||n.originIsAbsolute,!1!==n.smooth,m)),p=n.xOrigin||0,g=n.yOrigin||0,m!==Tr&&(w=m[0],_=m[1],S=m[2],E=m[3],r=M=m[4],i=T=m[5],6===m.length?(a=Math.sqrt(w*w+_*_),s=Math.sqrt(E*E+S*S),u=w||_?Fn(_,w)*Rn:0,(h=S||E?Fn(S,E)*Rn+u:0)&&(s*=Math.abs(Math.cos(h*zn))),n.svg&&(r-=p-(p*w+g*S),i-=g-(p*_+g*E))):(D=m[6],I=m[7],N=m[8],O=m[9],P=m[10],L=m[11],r=m[12],i=m[13],o=m[14],c=(v=Fn(D,P))*Rn,v&&(A=M*(y=Math.cos(-v))+N*(b=Math.sin(-v)),C=T*y+O*b,k=D*y+P*b,N=M*-b+N*y,O=T*-b+O*y,P=D*-b+P*y,L=I*-b+L*y,M=A,T=C,D=k),l=(v=Fn(-S,P))*Rn,v&&(y=Math.cos(-v),L=E*(b=Math.sin(-v))+L*y,w=A=w*y-N*b,_=C=_*y-O*b,S=k=S*y-P*b),u=(v=Fn(_,w))*Rn,v&&(A=w*(y=Math.cos(v))+_*(b=Math.sin(v)),C=M*y+T*b,_=_*y-w*b,T=T*y-M*b,w=A,M=C),c&&Math.abs(c)+Math.abs(u)>359.9&&(c=u=0,l=180-l),a=gt(Math.sqrt(w*w+_*_+S*S)),s=gt(Math.sqrt(T*T+D*D)),v=Fn(M,T),h=Math.abs(v)>2e-4?v*Rn:0,d=L?1/(L<0?-L:L):0),n.svg&&(A=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Cr(ur(t,er)),A&&t.setAttribute("transform",A))),Math.abs(h)>90&&Math.abs(h)<270&&(z?(a*=-1,h+=u<=0?180:-180,u+=u<=0?180:-180):(s*=-1,h+=h<=0?180:-180)),e=e||n.uncache,n.x=r-((n.xPercent=r&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-r)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+F,n.y=i-((n.yPercent=i&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+F,n.z=o+F,n.scaleX=gt(a),n.scaleY=gt(s),n.rotation=gt(u)+B,n.rotationX=gt(c)+B,n.rotationY=gt(l)+B,n.skewX=h+B,n.skewY=f+B,n.transformPerspective=d+F,(n.zOrigin=parseFloat(U.split(" ")[2])||0)&&(R[nr]=Ir(U)),n.xOffset=n.yOffset=0,n.force3D=x.force3D,n.renderTransform=n.svg?jr:Ln?Br:Dr,n.uncache=0,n},Ir=function(t){return(t=t.split(" "))[0]+" "+t[1]},Lr=function(t,e,n){var r=Jt(e);return gt(parseFloat(e)+parseFloat(xr(t,"x",n+"px",r)))+r},Dr=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Br(t,e)},Rr="0deg",zr="0px",Fr=") ",Br=function(t,e){var n=e||this,r=n.xPercent,i=n.yPercent,o=n.x,a=n.y,s=n.z,u=n.rotation,c=n.rotationY,l=n.rotationX,h=n.skewX,f=n.skewY,d=n.scaleX,p=n.scaleY,g=n.transformPerspective,m=n.force3D,v=n.target,y=n.zOrigin,b="",x="auto"===m&&t&&1!==t||!0===m;if(y&&(l!==Rr||c!==Rr)){var w,_=parseFloat(c)*zn,S=Math.sin(_),E=Math.cos(_);_=parseFloat(l)*zn,w=Math.cos(_),o=Lr(v,o,S*w*-y),a=Lr(v,a,-Math.sin(_)*-y),s=Lr(v,s,E*w*-y+y)}g!==zr&&(b+="perspective("+g+Fr),(r||i)&&(b+="translate("+r+"%, "+i+"%) "),(x||o!==zr||a!==zr||s!==zr)&&(b+=s!==zr||x?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+Fr),u!==Rr&&(b+="rotate("+u+Fr),c!==Rr&&(b+="rotateY("+c+Fr),l!==Rr&&(b+="rotateX("+l+Fr),h===Rr&&f===Rr||(b+="skew("+h+", "+f+Fr),1===d&&1===p||(b+="scale("+d+", "+p+Fr),v.style[er]=b||"translate(0, 0)"},jr=function(t,e){var n,r,i,o,a,s=e||this,u=s.xPercent,c=s.yPercent,l=s.x,h=s.y,f=s.rotation,d=s.skewX,p=s.skewY,g=s.scaleX,m=s.scaleY,v=s.target,y=s.xOrigin,b=s.yOrigin,x=s.xOffset,w=s.yOffset,_=s.forceCSS,S=parseFloat(l),E=parseFloat(h);f=parseFloat(f),d=parseFloat(d),(p=parseFloat(p))&&(d+=p=parseFloat(p),f+=p),f||d?(f*=zn,d*=zn,n=Math.cos(f)*g,r=Math.sin(f)*g,i=Math.sin(f-d)*-m,o=Math.cos(f-d)*m,d&&(p*=zn,a=Math.tan(d-p),i*=a=Math.sqrt(1+a*a),o*=a,p&&(a=Math.tan(p),n*=a=Math.sqrt(1+a*a),r*=a)),n=gt(n),r=gt(r),i=gt(i),o=gt(o)):(n=g,o=m,r=i=0),(S&&!~(l+"").indexOf("px")||E&&!~(h+"").indexOf("px"))&&(S=xr(v,"x",l,"px"),E=xr(v,"y",h,"px")),(y||b||x||w)&&(S=gt(S+y-(y*n+b*i)+x),E=gt(E+b-(y*r+b*o)+w)),(u||c)&&(a=v.getBBox(),S=gt(S+u/100*a.width),E=gt(E+c/100*a.height)),a="matrix("+n+","+r+","+i+","+o+","+S+","+E+")",v.setAttribute("transform",a),_&&(v.style[er]=a)},Ur=function(t,e,n,r,i){var o,a,s=360,u=N(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?Rn:1)-r,l=r+c+"deg";return u&&("short"===(o=i.split("_")[1])&&(c%=s)!==c%180&&(c+=c<0?s:-360),"cw"===o&&c<0?c=(c+36e9)%s-~~(c/s)*s:"ccw"===o&&c>0&&(c=(c-36e9)%s-~~(c/s)*s)),t._pt=a=new pn(t._pt,e,n,r,c,Gn),a.e=l,a.u="deg",t._props.push(n),a},Vr=function(t,e){for(var n in e)t[n]=e[n];return t},Hr=function(t,e,n){var r,i,o,a,s,u,c,l=Vr({},n._gsap),h=n.style;for(i in l.svg?(o=n.getAttribute("transform"),n.setAttribute("transform",""),h[er]=e,r=Pr(n,1),mr(n,er),n.setAttribute("transform",o)):(o=getComputedStyle(n)[er],h[er]=e,r=Pr(n,1),h[er]=o),Dn)(o=l[i])!==(a=r[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(s=Jt(o)!==(c=Jt(a))?xr(n,i,o,c):parseFloat(o),u=parseFloat(a),t._pt=new pn(t._pt,r,i,s,u-s,Hn),t._pt.u=c||0,t._props.push(i));Vr(r,l)};pt("padding,margin,Width,Radius",(function(t,e){var n="Top",r="Right",i="Bottom",o="Left",a=(e<3?[n,r,i,o]:[n+o,n+r,i+r,i+o]).map((function(n){return e<2?t+n:"border"+n+t}));Mr[e>1?"border"+t:t]=function(t,e,n,r,i){var o,s;if(arguments.length<4)return o=a.map((function(e){return wr(t,e,n)})),5===(s=o.join(" ")).split(o[0]).length?o[0]:s;o=(r+"").split(" "),s={},a.forEach((function(t,e){return s[t]=o[e]=o[e]||o[(e-1)/2|0]})),t.init(e,s,i)}}));var Gr,Zr,Wr,Yr={name:"css",register:hr,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,r,i){var o,a,s,u,c,l,h,f,d,p,g,m,v,y,b,w,_,S,E,M,T=this._props,A=t.style,C=n.vars.startAt;for(h in Nn||hr(),this.styles=this.styles||ar(t),w=this.styles.props,this.tween=n,e)if("autoRound"!==h&&(a=e[h],!at[h]||!Ye(h,e,n,r,t,i)))if(c=typeof a,l=Mr[h],"function"===c&&(c=typeof(a=a.call(n,r,t,i))),"string"===c&&~a.indexOf("random(")&&(a=he(a)),l)l(this,t,h,a,n)&&(b=1);else if("--"===h.substr(0,2))o=(getComputedStyle(t).getPropertyValue(h)+"").trim(),a+="",Ee.lastIndex=0,Ee.test(o)||(f=Jt(o),d=Jt(a)),d?f!==d&&(o=xr(t,h,o,d)+d):f&&(a+=f),this.add(A,"setProperty",o,a,r,i,0,0,h),T.push(h),w.push(h,0,A[h]);else if("undefined"!==c){if(C&&h in C?(o="function"==typeof C[h]?C[h].call(n,r,t,i):C[h],N(o)&&~o.indexOf("random(")&&(o=he(o)),Jt(o+"")||(o+=x.units[h]||Jt(wr(t,h))||""),"="===(o+"").charAt(1)&&(o=wr(t,h))):o=wr(t,h),u=parseFloat(o),(p="string"===c&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),s=parseFloat(a),h in Vn&&("autoAlpha"===h&&(1===u&&"hidden"===wr(t,"visibility")&&s&&(u=0),w.push("visibility",0,A.visibility),vr(this,A,"visibility",u?"inherit":"hidden",s?"inherit":"hidden",!s)),"scale"!==h&&"transform"!==h&&~(h=Vn[h]).indexOf(",")&&(h=h.split(",")[0])),g=h in Dn)if(this.styles.save(h),m||((v=t._gsap).renderTransform&&!e.parseTransform||Pr(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(m=this._pt=new pn(this._pt,A,er,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===h)this._pt=new pn(this._pt,v,"scaleY",v.scaleY,(p?vt(v.scaleY,p+s):s)-v.scaleY||0,Hn),this._pt.u=0,T.push("scaleY",h),h+="X";else{if("transformOrigin"===h){w.push(nr,0,A[nr]),S=void 0,E=void 0,M=void 0,S=(_=a).split(" "),E=S[0],M=S[1]||"50%","top"!==E&&"bottom"!==E&&"left"!==M&&"right"!==M||(_=E,E=M,M=_),S[0]=Sr[E]||E,S[1]=Sr[M]||M,a=S.join(" "),v.svg?Or(t,a,0,y,0,this):((d=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&vr(this,v,"zOrigin",v.zOrigin,d),vr(this,A,h,Ir(o),Ir(a)));continue}if("svgOrigin"===h){Or(t,a,1,y,0,this);continue}if(h in Ar){Ur(this,v,h,u,p?vt(u,p+a):a);continue}if("smoothOrigin"===h){vr(this,v,"smooth",v.smooth,a);continue}if("force3D"===h){v[h]=a;continue}if("transform"===h){Hr(this,a,t);continue}}else h in A||(h=lr(h)||h);if(g||(s||0===s)&&(u||0===u)&&!Un.test(a)&&h in A)s||(s=0),(f=(o+"").substr((u+"").length))!==(d=Jt(a)||(h in x.units?x.units[h]:f))&&(u=xr(t,h,o,d)),this._pt=new pn(this._pt,g?v:A,h,u,(p?vt(u,p+s):s)-u,g||"px"!==d&&"zIndex"!==h||!1===e.autoRound?Hn:Wn),this._pt.u=d||0,f!==d&&"%"!==d&&(this._pt.b=o,this._pt.r=Zn);else if(h in A)_r.call(this,t,h,o,p?p+a:a);else if(h in t)this.add(t,h,o||t[h],p?p+a:a,r,i);else if("parseTransform"!==h){K(h,a);continue}g||(h in A?w.push(h,0,A[h]):w.push(h,1,o||t[h])),T.push(h)}b&&dn(this)},render:function(t,e){if(e.tween._time||!In())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:wr,aliases:Vn,getSetter:function(t,e,n){var r=Vn[e];return r&&r.indexOf(",")<0&&(e=r),e in Dn&&e!==nr&&(t._gsap.x||wr(t,"x"))?n&&Pn===n?"scale"===e?Qn:$n:(Pn=n||{})&&("scale"===e?Jn:tr):t.style&&!I(t.style[e])?Xn:~e.indexOf("-")?Kn:on(t,e)},core:{_removeProperty:mr,_getMatrix:Nr}};Tn.utils.checkPrefix=lr,Tn.core.getStyleSaver=ar,Wr=pt((Gr="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Zr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){Dn[t]=1})),pt(Zr,(function(t){x.units[t]="deg",Ar[t]=1})),Vn[Wr[13]]=Gr+","+Zr,pt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");Vn[e[1]]=Wr[e[0]]})),pt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){x.units[t]="px"})),Tn.registerPlugin(Yr);var qr=Tn.registerPlugin(Yr)||Tn;qr.core.Tween},8679:function(t,e,n){"use strict";var r=n(59864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return r.isMemo(t)?a:s[t.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,r){if("string"!=typeof n){if(p){var i=d(n);i&&i!==p&&t(e,i,r)}var a=l(n);h&&(a=a.concat(h(n)));for(var s=u(e),g=u(n),m=0;m0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=i.Qc,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}()},11050:function(t,e,n){"use strict";n.d(e,{C8:function(){return a},HR:function(){return u},YR:function(){return s},jK:function(){return r},u_:function(){return o}});var r,i=n(15145);!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(r||(r={}));var o=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.code=n,i.originalMessage=r,i}return(0,i.ZT)(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),a=function(t){function e(e,n,i,o){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),r.INVALID_VALUE,o)||this}return(0,i.ZT)(e,t),e}(o),s=function(t){function e(e,n,i){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(n),r.INVALID_VALUE,i)||this}return(0,i.ZT)(e,t),e}(o),u=function(t){function e(e,n){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(n,'"'),r.MISSING_VALUE,n)||this}return(0,i.ZT)(e,t),e}(o)},61092:function(t,e,n){"use strict";n.d(e,{FK:function(){return s},Gt:function(){return a},du:function(){return r}});var r,i=n(35258),o=n(11050);function a(t){return"function"==typeof t}function s(t,e,n,u,c,l,h){if(1===t.length&&(0,i.O4)(t[0]))return[{type:r.literal,value:t[0].value}];for(var f=[],d=0,p=t;dl))return!1;var f=u.get(t),d=u.get(e);if(f&&d)return f==e&&d==t;var p=-1,g=!0,m=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++p-1&&t%1==0&&t-1}},54705:function(t,e,n){var r=n(18470);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},24785:function(t,e,n){var r=n(1989),i=n(38407),o=n(57071);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},11285:function(t,e,n){var r=n(45050);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},96e3:function(t,e,n){var r=n(45050);t.exports=function(t){return r(this,t).get(t)}},49916:function(t,e,n){var r=n(45050);t.exports=function(t){return r(this,t).has(t)}},95265:function(t,e,n){var r=n(45050);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},68776:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},94536:function(t,e,n){var r=n(10852)(Object,"create");t.exports=r},86916:function(t,e,n){var r=n(5569)(Object.keys,Object);t.exports=r},31167:function(t,e,n){t=n.nmd(t);var r=n(31957),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},2333:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:function(t){t.exports=function(t,e){return function(n){return t(e(n))}}},55639:function(t,e,n){var r=n(31957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},90619:function(t){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},72385:function(t){t.exports=function(t){return this.__data__.has(t)}},21814:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},37465:function(t,e,n){var r=n(38407);t.exports=function(){this.__data__=new r,this.size=0}},63779:function(t){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},67599:function(t){t.exports=function(t){return this.__data__.get(t)}},44758:function(t){t.exports=function(t){return this.__data__.has(t)}},34309:function(t,e,n){var r=n(38407),i=n(57071),o=n(83369);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},80346:function(t){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},67990:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},23279:function(t,e,n){var r=n(13218),i=n(7771),o=n(14841),a=Math.max,s=Math.min;t.exports=function(t,e,n){var u,c,l,h,f,d,p=0,g=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=u,r=c;return u=c=void 0,p=e,h=t.apply(r,n)}function b(t){return p=t,f=setTimeout(w,e),g?y(t):h}function x(t){var n=t-d;return void 0===d||n>=e||n<0||m&&t-p>=l}function w(){var t=i();if(x(t))return _(t);f=setTimeout(w,function(t){var n=e-(t-d);return m?s(n,l-(t-p)):n}(t))}function _(t){return f=void 0,v&&u?y(t):(u=c=void 0,h)}function S(){var t=i(),n=x(t);if(u=arguments,c=this,d=t,n){if(void 0===f)return b(d);if(m)return clearTimeout(f),f=setTimeout(w,e),y(d)}return void 0===f&&(f=setTimeout(w,e)),h}return e=o(e)||0,r(n)&&(g=!!n.leading,l=(m="maxWait"in n)?a(o(n.maxWait)||0,e):l,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==f&&clearTimeout(f),p=0,u=d=c=f=void 0},S.flush=function(){return void 0===f?h:_(i())},S}},77813:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},35694:function(t,e,n){var r=n(9454),i=n(37005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},1469:function(t){var e=Array.isArray;t.exports=e},98612:function(t,e,n){var r=n(23560),i=n(41780);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},44144:function(t,e,n){t=n.nmd(t);var r=n(55639),i=n(95062),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},18446:function(t,e,n){var r=n(90939);t.exports=function(t,e){return r(t,e)}},23560:function(t,e,n){var r=n(44239),i=n(13218);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},41780:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},81763:function(t,e,n){var r=n(44239),i=n(37005);t.exports=function(t){return"number"==typeof t||i(t)&&"[object Number]"==r(t)}},13218:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},37005:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},68630:function(t,e,n){var r=n(44239),i=n(85924),o=n(37005),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},33448:function(t,e,n){var r=n(44239),i=n(37005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},36719:function(t,e,n){var r=n(38749),i=n(7518),o=n(31167),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},3674:function(t,e,n){var r=n(14636),i=n(280),o=n(98612);t.exports=function(t){return o(t)?r(t):i(t)}},7771:function(t,e,n){var r=n(55639);t.exports=function(){return r.Date.now()}},70479:function(t){t.exports=function(){return[]}},95062:function(t){t.exports=function(){return!1}},14841:function(t,e,n){var r=n(27561),i=n(13218),o=n(33448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},43720:function(t){t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var i={},o={};function a(t,e){var n,r,a;return e?(a=0<=(t>>>=0)&&t<256)&&(r=o[t])?r:(n=u(t,(0|t)<0?-1:0,!0),a&&(o[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(r=i[t])?r:(n=u(t,t<0?-1:0,!1),a&&(i[t]=n),n)}function s(t,e){if(isNaN(t))return e?v:m;if(e){if(t<0)return v;if(t>=d)return _}else{if(t<=-p)return S;if(t+1>=p)return w}return t<0?s(-t,e).neg():u(t%f|0,t/f|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var c=Math.pow;function l(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return m;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return l(t.substring(1),e,n).neg();for(var i=s(c(n,8)),o=m,a=0;a>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},E.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((o=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},E.isOdd=function(){return 1==(1&this.low)},E.isEven=function(){return 0==(1&this.low)},E.equals=function(t){return r(t)||(t=h(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},E.eq=E.equals,E.notEquals=function(t){return!this.eq(t)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(t){return this.comp(t)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(t){return this.comp(t)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(t){return this.comp(t)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(t){return this.comp(t)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(t){if(r(t)||(t=h(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(y)},E.neg=E.negate,E.add=function(t){r(t)||(t=h(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,c=t.low>>>16,l=0,f=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,f+=(d+=i+c)>>>16,l+=(f+=n+s)>>>16,l+=e+a,u((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},E.subtract=function(t){return r(t)||(t=h(t)),this.add(t.neg())},E.sub=E.subtract,E.multiply=function(t){if(this.isZero())return m;if(r(t)||(t=h(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return m;if(this.eq(S))return t.isOdd()?S:m;if(t.eq(S))return this.isOdd()?S:m;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,a=65535&this.low,c=t.high>>>16,l=65535&t.high,f=t.low>>>16,d=65535&t.low,p=0,v=0,y=0,b=0;return y+=(b+=a*d)>>>16,v+=(y+=o*d)>>>16,y&=65535,v+=(y+=a*f)>>>16,p+=(v+=i*d)>>>16,v&=65535,p+=(v+=o*f)>>>16,v&=65535,p+=(v+=a*l)>>>16,p+=n*d+i*f+o*l+a*c,u((y&=65535)<<16|(b&=65535),(p&=65535)<<16|(v&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(t){if(r(t)||(t=h(t)),t.isZero())throw Error("division by zero");var n,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:m;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return b;o=v}else{if(this.eq(S))return t.eq(y)||t.eq(x)?S:t.eq(S)?y:(n=this.shr(1).div(t).shl(1)).eq(m)?t.isNegative()?y:x:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(S))return this.unsigned?v:m;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=m}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:c(2,a-48),f=s(n),d=f.mul(t);d.isNegative()||d.gt(i);)d=(f=s(n-=l,this.unsigned)).mul(t);f.isZero()&&(f=y),o=o.add(f),i=i.sub(d)}return o},E.div=E.divide,E.modulo=function(t){return r(t)||(t=h(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return u(~this.low,~this.high,this.unsigned)},E.and=function(t){return r(t)||(t=h(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},E.or=function(t){return r(t)||(t=h(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},E.xor=function(t){return r(t)||(t=h(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},E.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<>>32-t,this.unsigned):u(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},E.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},E.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},87388:function(){var t=function(t,r){var i=document.querySelector("#"+t+" > .particles-js-canvas-el");this.pJS={canvas:{el:i,w:i.offsetWidth,h:i.offsetHeight},particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}},array:[]},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}},mouse:{}},retina_detect:!1,fn:{interact:{},modes:{},vendors:{}},tmp:{}};var o=this.pJS;r&&Object.deepExtend(o,r),o.tmp.obj={size_value:o.particles.size.value,size_anim_speed:o.particles.size.anim.speed,move_speed:o.particles.move.speed,line_linked_distance:o.particles.line_linked.distance,line_linked_width:o.particles.line_linked.width,mode_grab_distance:o.interactivity.modes.grab.distance,mode_bubble_distance:o.interactivity.modes.bubble.distance,mode_bubble_size:o.interactivity.modes.bubble.size,mode_repulse_distance:o.interactivity.modes.repulse.distance},o.fn.retinaInit=function(){o.retina_detect&&window.devicePixelRatio>1?(o.canvas.pxratio=window.devicePixelRatio,o.tmp.retina=!0):(o.canvas.pxratio=1,o.tmp.retina=!1),o.canvas.w=o.canvas.el.offsetWidth*o.canvas.pxratio,o.canvas.h=o.canvas.el.offsetHeight*o.canvas.pxratio,o.particles.size.value=o.tmp.obj.size_value*o.canvas.pxratio,o.particles.size.anim.speed=o.tmp.obj.size_anim_speed*o.canvas.pxratio,o.particles.move.speed=o.tmp.obj.move_speed*o.canvas.pxratio,o.particles.line_linked.distance=o.tmp.obj.line_linked_distance*o.canvas.pxratio,o.interactivity.modes.grab.distance=o.tmp.obj.mode_grab_distance*o.canvas.pxratio,o.interactivity.modes.bubble.distance=o.tmp.obj.mode_bubble_distance*o.canvas.pxratio,o.particles.line_linked.width=o.tmp.obj.line_linked_width*o.canvas.pxratio,o.interactivity.modes.bubble.size=o.tmp.obj.mode_bubble_size*o.canvas.pxratio,o.interactivity.modes.repulse.distance=o.tmp.obj.mode_repulse_distance*o.canvas.pxratio},o.fn.canvasInit=function(){o.canvas.ctx=o.canvas.el.getContext("2d")},o.fn.canvasSize=function(){o.canvas.el.width=o.canvas.w,o.canvas.el.height=o.canvas.h,o&&o.interactivity.events.resize&&window.addEventListener("resize",(function(){o.canvas.w=o.canvas.el.offsetWidth,o.canvas.h=o.canvas.el.offsetHeight,o.tmp.retina&&(o.canvas.w*=o.canvas.pxratio,o.canvas.h*=o.canvas.pxratio),o.canvas.el.width=o.canvas.w,o.canvas.el.height=o.canvas.h,o.particles.move.enable||(o.fn.particlesEmpty(),o.fn.particlesCreate(),o.fn.particlesDraw(),o.fn.vendors.densityAutoParticles()),o.fn.vendors.densityAutoParticles()}))},o.fn.canvasPaint=function(){o.canvas.ctx.fillRect(0,0,o.canvas.w,o.canvas.h)},o.fn.canvasClear=function(){o.canvas.ctx.clearRect(0,0,o.canvas.w,o.canvas.h)},o.fn.particle=function(t,n,r){if(this.radius=(o.particles.size.random?Math.random():1)*o.particles.size.value,o.particles.size.anim.enable&&(this.size_status=!1,this.vs=o.particles.size.anim.speed/100,o.particles.size.anim.sync||(this.vs=this.vs*Math.random())),this.x=r?r.x:Math.random()*o.canvas.w,this.y=r?r.y:Math.random()*o.canvas.h,this.x>o.canvas.w-2*this.radius?this.x=this.x-this.radius:this.x<2*this.radius&&(this.x=this.x+this.radius),this.y>o.canvas.h-2*this.radius?this.y=this.y-this.radius:this.y<2*this.radius&&(this.y=this.y+this.radius),o.particles.move.bounce&&o.fn.vendors.checkOverlap(this,r),this.color={},"object"==typeof t.value)if(t.value instanceof Array){var i=t.value[Math.floor(Math.random()*o.particles.color.value.length)];this.color.rgb=e(i)}else null!=t.value.r&&null!=t.value.g&&null!=t.value.b&&(this.color.rgb={r:t.value.r,g:t.value.g,b:t.value.b}),null!=t.value.h&&null!=t.value.s&&null!=t.value.l&&(this.color.hsl={h:t.value.h,s:t.value.s,l:t.value.l});else"random"==t.value?this.color.rgb={r:Math.floor(256*Math.random())+0,g:Math.floor(256*Math.random())+0,b:Math.floor(256*Math.random())+0}:"string"==typeof t.value&&(this.color=t,this.color.rgb=e(this.color.value));this.opacity=(o.particles.opacity.random?Math.random():1)*o.particles.opacity.value,o.particles.opacity.anim.enable&&(this.opacity_status=!1,this.vo=o.particles.opacity.anim.speed/100,o.particles.opacity.anim.sync||(this.vo=this.vo*Math.random()));var a={};switch(o.particles.move.direction){case"top":a={x:0,y:-1};break;case"top-right":a={x:.5,y:-.5};break;case"right":a={x:1,y:-0};break;case"bottom-right":a={x:.5,y:.5};break;case"bottom":a={x:0,y:1};break;case"bottom-left":a={x:-.5,y:1};break;case"left":a={x:-1,y:0};break;case"top-left":a={x:-.5,y:-.5};break;default:a={x:0,y:0}}o.particles.move.straight?(this.vx=a.x,this.vy=a.y,o.particles.move.random&&(this.vx=this.vx*Math.random(),this.vy=this.vy*Math.random())):(this.vx=a.x+Math.random()-.5,this.vy=a.y+Math.random()-.5),this.vx_i=this.vx,this.vy_i=this.vy;var s=o.particles.shape.type;if("object"==typeof s){if(s instanceof Array){var u=s[Math.floor(Math.random()*s.length)];this.shape=u}}else this.shape=s;if("image"==this.shape){var c=o.particles.shape;this.img={src:c.image.src,ratio:c.image.width/c.image.height},this.img.ratio||(this.img.ratio=1),"svg"==o.tmp.img_type&&null!=o.tmp.source_svg&&(o.fn.vendors.createSvgImg(this),o.tmp.pushing&&(this.img.loaded=!1))}},o.fn.particle.prototype.draw=function(){var t=this;if(null!=t.radius_bubble)var e=t.radius_bubble;else e=t.radius;if(null!=t.opacity_bubble)var n=t.opacity_bubble;else n=t.opacity;if(t.color.rgb)var r="rgba("+t.color.rgb.r+","+t.color.rgb.g+","+t.color.rgb.b+","+n+")";else r="hsla("+t.color.hsl.h+","+t.color.hsl.s+"%,"+t.color.hsl.l+"%,"+n+")";switch(o.canvas.ctx.fillStyle=r,o.canvas.ctx.beginPath(),t.shape){case"circle":o.canvas.ctx.arc(t.x,t.y,e,0,2*Math.PI,!1);break;case"edge":o.canvas.ctx.rect(t.x-e,t.y-e,2*e,2*e);break;case"triangle":o.fn.vendors.drawShape(o.canvas.ctx,t.x-e,t.y+e/1.66,2*e,3,2);break;case"polygon":o.fn.vendors.drawShape(o.canvas.ctx,t.x-e/(o.particles.shape.polygon.nb_sides/3.5),t.y-e/.76,2.66*e/(o.particles.shape.polygon.nb_sides/3),o.particles.shape.polygon.nb_sides,1);break;case"star":o.fn.vendors.drawShape(o.canvas.ctx,t.x-2*e/(o.particles.shape.polygon.nb_sides/4),t.y-e/1.52,2*e*2.66/(o.particles.shape.polygon.nb_sides/3),o.particles.shape.polygon.nb_sides,2);break;case"image":if("svg"==o.tmp.img_type)var i=t.img.obj;else i=o.tmp.img_obj;i&&o.canvas.ctx.drawImage(i,t.x-e,t.y-e,2*e,2*e/t.img.ratio)}o.canvas.ctx.closePath(),o.particles.shape.stroke.width>0&&(o.canvas.ctx.strokeStyle=o.particles.shape.stroke.color,o.canvas.ctx.lineWidth=o.particles.shape.stroke.width,o.canvas.ctx.stroke()),o.canvas.ctx.fill()},o.fn.particlesCreate=function(){for(var t=0;t=o.particles.opacity.value&&(e.opacity_status=!1),e.opacity+=e.vo):(e.opacity<=o.particles.opacity.anim.opacity_min&&(e.opacity_status=!0),e.opacity-=e.vo),e.opacity<0&&(e.opacity=0)),o.particles.size.anim.enable&&(1==e.size_status?(e.radius>=o.particles.size.value&&(e.size_status=!1),e.radius+=e.vs):(e.radius<=o.particles.size.anim.size_min&&(e.size_status=!0),e.radius-=e.vs),e.radius<0&&(e.radius=0)),"bounce"==o.particles.move.out_mode)var i={x_left:e.radius,x_right:o.canvas.w,y_top:e.radius,y_bottom:o.canvas.h};else i={x_left:-e.radius,x_right:o.canvas.w+e.radius,y_top:-e.radius,y_bottom:o.canvas.h+e.radius};if(e.x-e.radius>o.canvas.w?(e.x=i.x_left,e.y=Math.random()*o.canvas.h):e.x+e.radius<0&&(e.x=i.x_right,e.y=Math.random()*o.canvas.h),e.y-e.radius>o.canvas.h?(e.y=i.y_top,e.x=Math.random()*o.canvas.w):e.y+e.radius<0&&(e.y=i.y_bottom,e.x=Math.random()*o.canvas.w),"bounce"===o.particles.move.out_mode)(e.x+e.radius>o.canvas.w||e.x-e.radius<0)&&(e.vx=-e.vx),(e.y+e.radius>o.canvas.h||e.y-e.radius<0)&&(e.vy=-e.vy);if(n("grab",o.interactivity.events.onhover.mode)&&o.fn.modes.grabParticle(e),(n("bubble",o.interactivity.events.onhover.mode)||n("bubble",o.interactivity.events.onclick.mode))&&o.fn.modes.bubbleParticle(e),(n("repulse",o.interactivity.events.onhover.mode)||n("repulse",o.interactivity.events.onclick.mode))&&o.fn.modes.repulseParticle(e),o.particles.line_linked.enable||o.particles.move.attract.enable)for(var a=t+1;a0){var s=o.particles.line_linked.color_rgb_line;o.canvas.ctx.strokeStyle="rgba("+s.r+","+s.g+","+s.b+","+a+")",o.canvas.ctx.lineWidth=o.particles.line_linked.width,o.canvas.ctx.beginPath(),o.canvas.ctx.moveTo(t.x,t.y),o.canvas.ctx.lineTo(e.x,e.y),o.canvas.ctx.stroke(),o.canvas.ctx.closePath()}}},o.fn.interact.attractParticles=function(t,e){var n=t.x-e.x,r=t.y-e.y;if(Math.sqrt(n*n+r*r)<=o.particles.line_linked.distance){var i=n/(1e3*o.particles.move.attract.rotateX),a=r/(1e3*o.particles.move.attract.rotateY);t.vx-=i,t.vy-=a,e.vx+=i,e.vy+=a}},o.fn.interact.bounceParticles=function(t,e){var n=t.x-e.x,r=t.y-e.y;Math.sqrt(n*n+r*r)<=t.radius+e.radius&&(t.vx=-t.vx,t.vy=-t.vy,e.vx=-e.vx,e.vy=-e.vy)},o.fn.modes.pushParticles=function(t,e){o.tmp.pushing=!0;for(var n=0;n=0&&"mousemove"==o.interactivity.status){if(o.interactivity.modes.bubble.size!=o.particles.size.value)if(o.interactivity.modes.bubble.size>o.particles.size.value){(u=t.radius+o.interactivity.modes.bubble.size*i)>=0&&(t.radius_bubble=u)}else{var s=t.radius-o.interactivity.modes.bubble.size,u=t.radius-s*i;t.radius_bubble=u>0?u:0}var c;if(o.interactivity.modes.bubble.opacity!=o.particles.opacity.value)if(o.interactivity.modes.bubble.opacity>o.particles.opacity.value)(c=o.interactivity.modes.bubble.opacity*i)>t.opacity&&c<=o.interactivity.modes.bubble.opacity&&(t.opacity_bubble=c);else(c=t.opacity-(o.particles.opacity.value-o.interactivity.modes.bubble.opacity)*i)=o.interactivity.modes.bubble.opacity&&(t.opacity_bubble=c)}}else a();"mouseleave"==o.interactivity.status&&a()}else if(o.interactivity.events.onclick.enable&&n("bubble",o.interactivity.events.onclick.mode)){if(o.tmp.bubble_clicking){e=t.x-o.interactivity.mouse.click_pos_x,r=t.y-o.interactivity.mouse.click_pos_y;var l=Math.sqrt(e*e+r*r),h=((new Date).getTime()-o.interactivity.mouse.click_time)/1e3;h>o.interactivity.modes.bubble.duration&&(o.tmp.bubble_duration_end=!0),h>2*o.interactivity.modes.bubble.duration&&(o.tmp.bubble_clicking=!1,o.tmp.bubble_duration_end=!1)}function f(e,n,r,i,a){if(e!=n)if(o.tmp.bubble_duration_end)null!=r&&(u=e+(e-(i-h*(i-e)/o.interactivity.modes.bubble.duration)),"size"==a&&(t.radius_bubble=u),"opacity"==a&&(t.opacity_bubble=u));else if(l<=o.interactivity.modes.bubble.distance){if(null!=r)var s=r;else s=i;if(s!=e){var u=i-h*(i-e)/o.interactivity.modes.bubble.duration;"size"==a&&(t.radius_bubble=u),"opacity"==a&&(t.opacity_bubble=u)}}else"size"==a&&(t.radius_bubble=void 0),"opacity"==a&&(t.opacity_bubble=void 0)}o.tmp.bubble_clicking&&(f(o.interactivity.modes.bubble.size,o.particles.size.value,t.radius_bubble,t.radius,"size"),f(o.interactivity.modes.bubble.opacity,o.particles.opacity.value,t.opacity_bubble,t.opacity,"opacity"))}},o.fn.modes.repulseParticle=function(t){if(o.interactivity.events.onhover.enable&&n("repulse",o.interactivity.events.onhover.mode)&&"mousemove"==o.interactivity.status){var e=t.x-o.interactivity.mouse.pos_x,r=t.y-o.interactivity.mouse.pos_y,i=Math.sqrt(e*e+r*r),a={x:e/i,y:r/i},s=o.interactivity.modes.repulse.distance,u=(p=1/s*(-1*Math.pow(i/s,2)+1)*s*100,g=0,m=50,Math.min(Math.max(p,g),m)),c={x:t.x+a.x*u,y:t.y+a.y*u};"bounce"==o.particles.move.out_mode?(c.x-t.radius>0&&c.x+t.radius0&&c.y+t.radiuso.canvas.w||n.x-t.radius<0)&&(t.vx=-t.vx),(n.y+t.radius>o.canvas.h||n.y-t.radius<0)&&(t.vy=-t.vy)}}()}else 0==o.tmp.repulse_clicking&&(t.vx=t.vx_i,t.vy=t.vy_i);var p,g,m},o.fn.modes.grabParticle=function(t){if(o.interactivity.events.onhover.enable&&"mousemove"==o.interactivity.status){var e=t.x-o.interactivity.mouse.pos_x,n=t.y-o.interactivity.mouse.pos_y,r=Math.sqrt(e*e+n*n);if(r<=o.interactivity.modes.grab.distance){var i=o.interactivity.modes.grab.line_linked.opacity-r/(1/o.interactivity.modes.grab.line_linked.opacity)/o.interactivity.modes.grab.distance;if(i>0){var a=o.particles.line_linked.color_rgb_line;o.canvas.ctx.strokeStyle="rgba("+a.r+","+a.g+","+a.b+","+i+")",o.canvas.ctx.lineWidth=o.particles.line_linked.width,o.canvas.ctx.beginPath(),o.canvas.ctx.moveTo(t.x,t.y),o.canvas.ctx.lineTo(o.interactivity.mouse.pos_x,o.interactivity.mouse.pos_y),o.canvas.ctx.stroke(),o.canvas.ctx.closePath()}}}},o.fn.vendors.eventsListeners=function(){"window"==o.interactivity.detect_on?o.interactivity.el=window:o.interactivity.el=o.canvas.el,(o.interactivity.events.onhover.enable||o.interactivity.events.onclick.enable)&&(o.interactivity.el.addEventListener("mousemove",(function(t){if(o.interactivity.el==window)var e=t.clientX,n=t.clientY;else e=t.offsetX||t.clientX,n=t.offsetY||t.clientY;o.interactivity.mouse.pos_x=e,o.interactivity.mouse.pos_y=n,o.tmp.retina&&(o.interactivity.mouse.pos_x*=o.canvas.pxratio,o.interactivity.mouse.pos_y*=o.canvas.pxratio),o.interactivity.status="mousemove"})),o.interactivity.el.addEventListener("mouseleave",(function(t){o.interactivity.mouse.pos_x=null,o.interactivity.mouse.pos_y=null,o.interactivity.status="mouseleave"}))),o.interactivity.events.onclick.enable&&o.interactivity.el.addEventListener("click",(function(){if(o.interactivity.mouse.click_pos_x=o.interactivity.mouse.pos_x,o.interactivity.mouse.click_pos_y=o.interactivity.mouse.pos_y,o.interactivity.mouse.click_time=(new Date).getTime(),o.interactivity.events.onclick.enable)switch(o.interactivity.events.onclick.mode){case"push":o.particles.move.enable||1==o.interactivity.modes.push.particles_nb?o.fn.modes.pushParticles(o.interactivity.modes.push.particles_nb,o.interactivity.mouse):o.interactivity.modes.push.particles_nb>1&&o.fn.modes.pushParticles(o.interactivity.modes.push.particles_nb);break;case"remove":o.fn.modes.removeParticles(o.interactivity.modes.remove.particles_nb);break;case"bubble":o.tmp.bubble_clicking=!0;break;case"repulse":o.tmp.repulse_clicking=!0,o.tmp.repulse_count=0,o.tmp.repulse_finish=!1,setTimeout((function(){o.tmp.repulse_clicking=!1}),1e3*o.interactivity.modes.repulse.duration)}}))},o.fn.vendors.densityAutoParticles=function(){if(o.particles.number.density.enable){var t=o.canvas.el.width*o.canvas.el.height/1e3;o.tmp.retina&&(t/=2*o.canvas.pxratio);var e=t*o.particles.number.value/o.particles.number.density.value_area,n=o.particles.array.length-e;n<0?o.fn.modes.pushParticles(Math.abs(n)):o.fn.modes.removeParticles(n)}},o.fn.vendors.checkOverlap=function(t,e){for(var n=0;n=o.particles.number.value?(o.fn.particlesDraw(),o.particles.move.enable?o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw):cancelRequestAnimFrame(o.fn.drawAnimFrame)):o.tmp.img_error||(o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw)):null!=o.tmp.img_obj?(o.fn.particlesDraw(),o.particles.move.enable?o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw):cancelRequestAnimFrame(o.fn.drawAnimFrame)):o.tmp.img_error||(o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw)):(o.fn.particlesDraw(),o.particles.move.enable?o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw):cancelRequestAnimFrame(o.fn.drawAnimFrame))},o.fn.vendors.checkBeforeDraw=function(){"image"==o.particles.shape.type?"svg"==o.tmp.img_type&&null==o.tmp.source_svg?o.tmp.checkAnimFrame=requestAnimFrame(check):(cancelRequestAnimFrame(o.tmp.checkAnimFrame),o.tmp.img_error||(o.fn.vendors.init(),o.fn.vendors.draw())):(o.fn.vendors.init(),o.fn.vendors.draw())},o.fn.vendors.init=function(){o.fn.retinaInit(),o.fn.canvasInit(),o.fn.canvasSize(),o.fn.canvasPaint(),o.fn.particlesCreate(),o.fn.vendors.densityAutoParticles(),o.particles.line_linked.color_rgb_line=e(o.particles.line_linked.color)},o.fn.vendors.start=function(){n("image",o.particles.shape.type)?(o.tmp.img_type=o.particles.shape.image.src.substr(o.particles.shape.image.src.length-3),o.fn.vendors.loadImg(o.tmp.img_type)):o.fn.vendors.checkBeforeDraw()},o.fn.vendors.eventsListeners(),o.fn.vendors.start()};function e(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}function n(t,e){return e.indexOf(t)>-1}Object.deepExtend=function(t,e){for(var n in e)e[n]&&e[n].constructor&&e[n].constructor===Object?(t[n]=t[n]||{},arguments.callee(t[n],e[n])):t[n]=e[n];return t},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},window.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout,window.pJSDom=[],window.particlesJS=function(e,n){"string"!=typeof e&&(n=e,e="particles-js"),e||(e="particles-js");var r=document.getElementById(e),i="particles-js-canvas-el",o=r.getElementsByClassName(i);if(o.length)for(;o.length>0;)r.removeChild(o[0]);var a=document.createElement("canvas");a.className=i,a.style.width="100%",a.style.height="100%",null!=document.getElementById(e).appendChild(a)&&pJSDom.push(new t(e,n))},window.particlesJS.load=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",e),r.onreadystatechange=function(e){if(4==r.readyState)if(200==r.status){var i=JSON.parse(e.currentTarget.response);window.particlesJS(t,i),n&&n()}else console.log("Error pJS - XMLHttpRequest status: "+r.status),console.log("Error pJS - File config not found")},r.send()}},50132:function(t,e,n){"use strict";var r=n(87462),i=n(4942),o=n(44925),a=n(1413),s=n(15671),u=n(43144),c=n(79340),l=n(98557),h=n(67294),f=n(94184),d=n.n(f),p=function(t){(0,c.Z)(n,t);var e=(0,l.Z)(n);function n(t){var r;(0,s.Z)(this,n),(r=e.call(this,t)).handleChange=function(t){var e=r.props,n=e.disabled,i=e.onChange;n||("checked"in r.props||r.setState({checked:t.target.checked}),i&&i({target:(0,a.Z)((0,a.Z)({},r.props),{},{checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))},r.saveInput=function(t){r.input=t};var i="checked"in t?t.checked:t.defaultChecked;return r.state={checked:i},r}return(0,u.Z)(n,[{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"render",value:function(){var t,e=this.props,n=e.prefixCls,a=e.className,s=e.style,u=e.name,c=e.id,l=e.type,f=e.disabled,p=e.readOnly,g=e.tabIndex,m=e.onClick,v=e.onFocus,y=e.onBlur,b=e.onKeyDown,x=e.onKeyPress,w=e.onKeyUp,_=e.autoFocus,S=e.value,E=e.required,M=(0,o.Z)(e,["prefixCls","className","style","name","id","type","disabled","readOnly","tabIndex","onClick","onFocus","onBlur","onKeyDown","onKeyPress","onKeyUp","autoFocus","value","required"]),T=Object.keys(M).reduce((function(t,e){return"aria-"!==e.substr(0,5)&&"data-"!==e.substr(0,5)&&"role"!==e||(t[e]=M[e]),t}),{}),A=this.state.checked,C=d()(n,a,(t={},(0,i.Z)(t,"".concat(n,"-checked"),A),(0,i.Z)(t,"".concat(n,"-disabled"),f),t));return h.createElement("span",{className:C,style:s},h.createElement("input",(0,r.Z)({name:u,id:c,type:l,required:E,readOnly:p,disabled:f,tabIndex:g,className:"".concat(n,"-input"),checked:!!A,onClick:m,onFocus:v,onBlur:y,onKeyUp:w,onKeyDown:b,onKeyPress:x,onChange:this.handleChange,autoFocus:_,ref:this.saveInput,value:S},T)),h.createElement("span",{className:"".concat(n,"-inner")}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){return"checked"in t?(0,a.Z)((0,a.Z)({},e),{},{checked:t.checked}):null}}]),n}(h.Component);p.defaultProps={prefixCls:"rc-checkbox",className:"",style:{},type:"checkbox",defaultChecked:!1,onFocus:function(){},onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){}},e.Z=p},6955:function(t,e,n){"use strict";n.d(e,{s:function(){return z},Z:function(){return V}});var r=n(87462),i=n(29439),o=n(67294),a=n.t(o,2),s=n(73935),u=n(98924),c=n(42550),l=o.createContext(null),h=n(93433),f=n(8410),d=[];var p,g=n(44958);function m(t){if("undefined"==typeof document)return 0;if(t||void 0===p){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(e),document.body.appendChild(n);var i=e.offsetWidth;n.style.overflow="scroll";var o=e.offsetWidth;i===o&&(o=n.clientWidth),document.body.removeChild(n),p=i-o}return p}var v="rc-util-locker-".concat(Date.now()),y=0;function b(t){var e=!!t,n=o.useState((function(){return y+=1,"".concat(v,"_").concat(y)})),r=(0,i.Z)(n,1)[0];(0,f.Z)((function(){if(e){var t=m(),n=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth;(0,g.hq)("\nhtml body {\n overflow-y: hidden;\n ".concat(n?"width: calc(100% - ".concat(t,"px);"):"","\n}"),r)}else(0,g.jL)(r);return function(){(0,g.jL)(r)}}),[e,r])}var x=!1;var w=function(t){return!1!==t&&((0,u.Z)()&&t?"string"==typeof t?document.querySelector(t):"function"==typeof t?t():t:null)};var _=o.forwardRef((function(t,e){var n=t.open,r=t.autoLock,a=t.getContainer,p=(t.debug,t.autoDestroy),g=void 0===p||p,m=t.children,v=o.useState(n),y=(0,i.Z)(v,2),_=y[0],S=y[1],E=_||n;o.useEffect((function(){(g||n)&&S(n)}),[n,g]);var M=o.useState((function(){return w(a)})),T=(0,i.Z)(M,2),A=T[0],C=T[1];o.useEffect((function(){var t=w(a);C(null!=t?t:null)}));var k=function(t,e){var n=o.useState((function(){return(0,u.Z)()?document.createElement("div"):null})),r=(0,i.Z)(n,1)[0],a=o.useContext(l),s=o.useState(d),c=(0,i.Z)(s,2),p=c[0],g=c[1],m=a||function(t){g((function(e){return[t].concat((0,h.Z)(e))}))};function v(){r.parentElement||document.body.appendChild(r)}function y(){var t;null===(t=r.parentElement)||void 0===t||t.removeChild(r)}return(0,f.Z)((function(){return t?a?a(v):v():y(),y}),[t]),(0,f.Z)((function(){p.length&&(p.forEach((function(t){return t()})),g(d))}),[p]),[r,m]}(E&&!A),N=(0,i.Z)(k,2),O=N[0],P=N[1],I=null!=A?A:O;b(r&&n&&(0,u.Z)()&&(I===O||I===document.body));var L=null;m&&(0,c.Yr)(m)&&e&&(L=m.ref);var D=(0,c.x1)(L,e);if(!E||!(0,u.Z)()||void 0===A)return null;var R,z=!1===I||("boolean"==typeof R&&(x=R),x),F=m;return e&&(F=o.cloneElement(m,{ref:D})),o.createElement(l.Provider,{value:P},z?F:(0,s.createPortal)(F,I))})),S=n(1413),E=n(94184),M=n.n(E),T=n(15105);var A=0;function C(t){var e=o.useState("ssr-id"),n=(0,i.Z)(e,2),r=n[0],s=n[1],u=(0,S.Z)({},a).useId,c=null==u?void 0:u();return o.useEffect((function(){if(!u){var t=A;A+=1,s("rc_unique_".concat(t))}}),[]),t||(c||r)}var k=n(94999),N=n(64217),O=n(63441);function P(t){var e=t.prefixCls,n=t.style,i=t.visible,a=t.maskProps,s=t.motionName;return o.createElement(O.Z,{key:"mask",visible:i,motionName:s,leavedClassName:"".concat(e,"-mask-hidden")},(function(t,i){var s=t.className,u=t.style;return o.createElement("div",(0,r.Z)({ref:i,style:(0,S.Z)((0,S.Z)({},u),n),className:M()("".concat(e,"-mask"),s)},a))}))}function I(t,e,n){var r=e;return!r&&n&&(r="".concat(t,"-").concat(n)),r}function L(t,e){var n=t["page".concat(e?"Y":"X","Offset")],r="scroll".concat(e?"Top":"Left");if("number"!=typeof n){var i=t.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}var D=o.memo((function(t){return t.children}),(function(t,e){return!e.shouldUpdate})),R={width:0,height:0,overflow:"hidden",outline:"none"};var z=o.forwardRef((function(t,e){var n=t.prefixCls,i=t.className,a=t.style,s=t.title,u=t.ariaId,c=t.footer,l=t.closable,h=t.closeIcon,f=t.onClose,d=t.children,p=t.bodyStyle,g=t.bodyProps,m=t.modalRender,v=t.onMouseDown,y=t.onMouseUp,b=t.holderRef,x=t.visible,w=t.forceRender,_=t.width,E=t.height,T=(0,o.useRef)(),A=(0,o.useRef)();o.useImperativeHandle(e,(function(){return{focus:function(){var t;null===(t=T.current)||void 0===t||t.focus()},changeActive:function(t){var e=document.activeElement;t&&e===A.current?T.current.focus():t||e!==T.current||A.current.focus()}}}));var C,k,N,O={};void 0!==_&&(O.width=_),void 0!==E&&(O.height=E),c&&(C=o.createElement("div",{className:"".concat(n,"-footer")},c)),s&&(k=o.createElement("div",{className:"".concat(n,"-header")},o.createElement("div",{className:"".concat(n,"-title"),id:u},s))),l&&(N=o.createElement("button",{type:"button",onClick:f,"aria-label":"Close",className:"".concat(n,"-close")},h||o.createElement("span",{className:"".concat(n,"-close-x")})));var P=o.createElement("div",{className:"".concat(n,"-content")},N,k,o.createElement("div",(0,r.Z)({className:"".concat(n,"-body"),style:p},g),d),C);return o.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":s?u:null,"aria-modal":"true",ref:b,style:(0,S.Z)((0,S.Z)({},a),O),className:M()(n,i),onMouseDown:v,onMouseUp:y},o.createElement("div",{tabIndex:0,ref:T,style:R,"aria-hidden":"true"}),o.createElement(D,{shouldUpdate:x||w},m?m(P):P),o.createElement("div",{tabIndex:0,ref:A,style:R,"aria-hidden":"true"}))})),F=o.forwardRef((function(t,e){var n=t.prefixCls,a=t.title,s=t.style,u=t.className,c=t.visible,l=t.forceRender,h=t.destroyOnClose,f=t.motionName,d=t.ariaId,p=t.onVisibleChanged,g=t.mousePosition,m=(0,o.useRef)(),v=o.useState(),y=(0,i.Z)(v,2),b=y[0],x=y[1],w={};function _(){var t,e,n,r,i,o=(t=m.current,e=t.getBoundingClientRect(),n={left:e.left,top:e.top},r=t.ownerDocument,i=r.defaultView||r.parentWindow,n.left+=L(i),n.top+=L(i,!0),n);x(g?"".concat(g.x-o.left,"px ").concat(g.y-o.top,"px"):"")}return b&&(w.transformOrigin=b),o.createElement(O.Z,{visible:c,onVisibleChanged:p,onAppearPrepare:_,onEnterPrepare:_,forceRender:l,motionName:f,removeOnLeave:h,ref:m},(function(i,c){var l=i.className,h=i.style;return o.createElement(z,(0,r.Z)({},t,{ref:e,title:a,ariaId:d,prefixCls:n,holderRef:c,style:(0,S.Z)((0,S.Z)((0,S.Z)({},h),s),w),className:M()(u,l)}))}))}));F.displayName="Content";var B=F;function j(t){var e=t.prefixCls,n=void 0===e?"rc-dialog":e,a=t.zIndex,s=t.visible,u=void 0!==s&&s,c=t.keyboard,l=void 0===c||c,h=t.focusTriggerAfterClose,f=void 0===h||h,d=t.wrapStyle,p=t.wrapClassName,g=t.wrapProps,m=t.onClose,v=t.afterClose,y=t.transitionName,b=t.animation,x=t.closable,w=void 0===x||x,_=t.mask,E=void 0===_||_,A=t.maskTransitionName,O=t.maskAnimation,L=t.maskClosable,D=void 0===L||L,R=t.maskStyle,z=t.maskProps,F=t.rootClassName,j=(0,o.useRef)(),U=(0,o.useRef)(),V=(0,o.useRef)(),H=o.useState(u),G=(0,i.Z)(H,2),Z=G[0],W=G[1],Y=C();function q(t){null==m||m(t)}var X=(0,o.useRef)(!1),K=(0,o.useRef)(),$=null;return D&&($=function(t){X.current?X.current=!1:U.current===t.target&&q(t)}),(0,o.useEffect)((function(){u&&(W(!0),(0,k.Z)(U.current,document.activeElement)||(j.current=document.activeElement))}),[u]),(0,o.useEffect)((function(){return function(){clearTimeout(K.current)}}),[]),o.createElement("div",(0,r.Z)({className:M()("".concat(n,"-root"),F)},(0,N.Z)(t,{data:!0})),o.createElement(P,{prefixCls:n,visible:E&&u,motionName:I(n,A,O),style:(0,S.Z)({zIndex:a},R),maskProps:z}),o.createElement("div",(0,r.Z)({tabIndex:-1,onKeyDown:function(t){if(l&&t.keyCode===T.Z.ESC)return t.stopPropagation(),void q(t);u&&t.keyCode===T.Z.TAB&&V.current.changeActive(!t.shiftKey)},className:M()("".concat(n,"-wrap"),p),ref:U,onClick:$,style:(0,S.Z)((0,S.Z)({zIndex:a},d),{},{display:Z?null:"none"})},g),o.createElement(B,(0,r.Z)({},t,{onMouseDown:function(){clearTimeout(K.current),X.current=!0},onMouseUp:function(){K.current=setTimeout((function(){X.current=!1}))},ref:V,closable:w,ariaId:Y,prefixCls:n,visible:u&&Z,onClose:q,onVisibleChanged:function(t){if(t)(0,k.Z)(U.current,document.activeElement)||null===(e=V.current)||void 0===e||e.focus();else{if(W(!1),E&&j.current&&f){try{j.current.focus({preventScroll:!0})}catch(t){}j.current=null}Z&&(null==v||v())}var e},motionName:I(n,y,b)}))))}var U=function(t){var e=t.visible,n=t.getContainer,a=t.forceRender,s=t.destroyOnClose,u=void 0!==s&&s,c=t.afterClose,l=o.useState(e),h=(0,i.Z)(l,2),f=h[0],d=h[1];return o.useEffect((function(){e&&d(!0)}),[e]),a||!u||f?o.createElement(_,{open:e||a||f,autoDestroy:!1,getContainer:n,autoLock:e||f},o.createElement(j,(0,r.Z)({},t,{destroyOnClose:u,afterClose:function(){null==c||c(),d(!1)}}))):null};U.displayName="Dialog";var V=U},51273:function(t,e,n){"use strict";n.d(e,{zb:function(){return y},RV:function(){return Ft}});var r=n(67294),i=n(87462),o=n(44925),a=n(4942),s=n(1413),u=n(93433),c=n(15671),l=n(43144),h=n(97326),f=n(79340),d=n(98557),p=n(50344),g=n(80334),m="RC_FORM_INTERNAL_HOOKS",v=function(){(0,g.ZP)(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},y=r.createContext({getFieldValue:v,getFieldsValue:v,getFieldError:v,getFieldWarning:v,getFieldsError:v,isFieldsTouched:v,isFieldTouched:v,isFieldValidating:v,isFieldsValidating:v,resetFields:v,setFields:v,setFieldValue:v,setFieldsValue:v,validateFields:v,submit:v,getInternalHooks:function(){return v(),{dispatch:v,initEntityValue:v,registerField:v,useSubscribe:v,setInitialValues:v,destroyForm:v,setCallbacks:v,registerWatch:v,getFields:v,setValidateMessages:v,setPreserve:v,getInitialValue:v}}});function b(t){return null==t?[]:Array.isArray(t)?t:[t]}var x=n(74165),w=n(15861);function _(){return _=Object.assign?Object.assign.bind():function(t){for(var e=1;e1?e-1:0),r=1;r=o)return t;switch(t){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(t){return"[Circular]"}break;default:return t}}));return a}return t}function O(t,e){return null==t||(!("array"!==e||!Array.isArray(t)||t.length)||!(!function(t){return"string"===t||"url"===t||"hex"===t||"email"===t||"date"===t||"pattern"===t}(e)||"string"!=typeof t||t))}function P(t,e,n){var r=0,i=t.length;!function o(a){if(a&&a.length)n(a);else{var s=r;r+=1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,j=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,U={integer:function(t){return U.number(t)&&parseInt(t,10)===t},float:function(t){return U.number(t)&&!U.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(t){return!1}},date:function(t){return"function"==typeof t.getTime&&"function"==typeof t.getMonth&&"function"==typeof t.getYear&&!isNaN(t.getTime())},number:function(t){return!isNaN(t)&&"number"==typeof t},object:function(t){return"object"==typeof t&&!U.array(t)},method:function(t){return"function"==typeof t},email:function(t){return"string"==typeof t&&t.length<=320&&!!t.match(B)},url:function(t){return"string"==typeof t&&t.length<=2048&&!!t.match(function(){if(z)return z;var t="[a-fA-F\\d:]",e=function(e){return e&&e.includeBoundaries?"(?:(?<=\\s|^)(?="+t+")|(?<="+t+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=("\n(?:\n(?:"+r+":){7}(?:"+r+"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:"+r+":){6}(?:"+n+"|:"+r+"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:"+r+":){5}(?::"+n+"|(?::"+r+"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:"+r+":){4}(?:(?::"+r+"){0,1}:"+n+"|(?::"+r+"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:"+r+":){3}(?:(?::"+r+"){0,2}:"+n+"|(?::"+r+"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:"+r+":){2}(?:(?::"+r+"){0,3}:"+n+"|(?::"+r+"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:"+r+":){1}(?:(?::"+r+"){0,4}:"+n+"|(?::"+r+"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::"+r+"){0,5}:"+n+"|(?::"+r+"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+n+"$)|(?:^"+i+"$)"),a=new RegExp("^"+n+"$"),s=new RegExp("^"+i+"$"),u=function(t){return t&&t.exact?o:new RegExp("(?:"+e(t)+n+e(t)+")|(?:"+e(t)+i+e(t)+")","g")};u.v4=function(t){return t&&t.exact?a:new RegExp(""+e(t)+n+e(t),"g")},u.v6=function(t){return t&&t.exact?s:new RegExp(""+e(t)+i+e(t),"g")};var c=u.v4().source,l=u.v6().source;return z=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+c+"|"+l+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(t){return"string"==typeof t&&!!t.match(j)}},V={required:F,whitespace:function(t,e,n,r,i){(/^\s+$/.test(e)||""===e)&&r.push(N(i.messages.whitespace,t.fullField))},type:function(t,e,n,r,i){if(t.required&&void 0===e)F(t,e,n,r,i);else{var o=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(o)>-1?U[o](e)||r.push(N(i.messages.types[o],t.fullField,t.type)):o&&typeof e!==t.type&&r.push(N(i.messages.types[o],t.fullField,t.type))}},range:function(t,e,n,r,i){var o="number"==typeof t.len,a="number"==typeof t.min,s="number"==typeof t.max,u=e,c=null,l="number"==typeof e,h="string"==typeof e,f=Array.isArray(e);if(l?c="number":h?c="string":f&&(c="array"),!c)return!1;f&&(u=e.length),h&&(u=e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),o?u!==t.len&&r.push(N(i.messages[c].len,t.fullField,t.len)):a&&!s&&ut.max?r.push(N(i.messages[c].max,t.fullField,t.max)):a&&s&&(ut.max)&&r.push(N(i.messages[c].range,t.fullField,t.min,t.max))},enum:function(t,e,n,r,i){t.enum=Array.isArray(t.enum)?t.enum:[],-1===t.enum.indexOf(e)&&r.push(N(i.messages.enum,t.fullField,t.enum.join(", ")))},pattern:function(t,e,n,r,i){if(t.pattern)if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(e)||r.push(N(i.messages.pattern.mismatch,t.fullField,e,t.pattern));else if("string"==typeof t.pattern){new RegExp(t.pattern).test(e)||r.push(N(i.messages.pattern.mismatch,t.fullField,e,t.pattern))}}},H=function(t,e,n,r,i){var o=t.type,a=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e,o)&&!t.required)return n();V.required(t,e,r,a,i,o),O(e,o)||V.type(t,e,r,a,i)}n(a)},G={string:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e,"string")&&!t.required)return n();V.required(t,e,r,o,i,"string"),O(e,"string")||(V.type(t,e,r,o,i),V.range(t,e,r,o,i),V.pattern(t,e,r,o,i),!0===t.whitespace&&V.whitespace(t,e,r,o,i))}n(o)},method:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i),void 0!==e&&V.type(t,e,r,o,i)}n(o)},number:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(""===e&&(e=void 0),O(e)&&!t.required)return n();V.required(t,e,r,o,i),void 0!==e&&(V.type(t,e,r,o,i),V.range(t,e,r,o,i))}n(o)},boolean:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i),void 0!==e&&V.type(t,e,r,o,i)}n(o)},regexp:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i),O(e)||V.type(t,e,r,o,i)}n(o)},integer:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i),void 0!==e&&(V.type(t,e,r,o,i),V.range(t,e,r,o,i))}n(o)},float:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i),void 0!==e&&(V.type(t,e,r,o,i),V.range(t,e,r,o,i))}n(o)},array:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(null==e&&!t.required)return n();V.required(t,e,r,o,i,"array"),null!=e&&(V.type(t,e,r,o,i),V.range(t,e,r,o,i))}n(o)},object:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i),void 0!==e&&V.type(t,e,r,o,i)}n(o)},enum:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i),void 0!==e&&V.enum(t,e,r,o,i)}n(o)},pattern:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e,"string")&&!t.required)return n();V.required(t,e,r,o,i),O(e,"string")||V.pattern(t,e,r,o,i)}n(o)},date:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e,"date")&&!t.required)return n();var a;if(V.required(t,e,r,o,i),!O(e,"date"))a=e instanceof Date?e:new Date(e),V.type(t,a,r,o,i),a&&V.range(t,a.getTime(),r,o,i)}n(o)},url:H,hex:H,email:H,required:function(t,e,n,r,i){var o=[],a=Array.isArray(e)?"array":typeof e;V.required(t,e,r,o,i,a),n(o)},any:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(O(e)&&!t.required)return n();V.required(t,e,r,o,i)}n(o)}};function Z(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var W=Z(),Y=function(){function t(t){this.rules=null,this._messages=W,this.define(t)}var e=t.prototype;return e.define=function(t){var e=this;if(!t)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof t||Array.isArray(t))throw new Error("Rules must be an object");this.rules={},Object.keys(t).forEach((function(n){var r=t[n];e.rules[n]=Array.isArray(r)?r:[r]}))},e.messages=function(t){return t&&(this._messages=R(Z(),t)),this._messages},e.validate=function(e,n,r){var i=this;void 0===n&&(n={}),void 0===r&&(r=function(){});var o=e,a=n,s=r;if("function"==typeof a&&(s=a,a={}),!this.rules||0===Object.keys(this.rules).length)return s&&s(null,o),Promise.resolve(o);if(a.messages){var u=this.messages();u===W&&(u=Z()),R(u,a.messages),a.messages=u}else a.messages=this.messages();var c={};(a.keys||Object.keys(this.rules)).forEach((function(t){var n=i.rules[t],r=o[t];n.forEach((function(n){var a=n;"function"==typeof a.transform&&(o===e&&(o=_({},o)),r=o[t]=a.transform(r)),(a="function"==typeof a?{validator:a}:_({},a)).validator=i.getValidationMethod(a),a.validator&&(a.field=t,a.fullField=a.fullField||t,a.type=i.getType(a),c[t]=c[t]||[],c[t].push({rule:a,value:r,source:o,field:t}))}))}));var l={};return L(c,a,(function(e,n){var r,i=e.rule,s=!("object"!==i.type&&"array"!==i.type||"object"!=typeof i.fields&&"object"!=typeof i.defaultField);function u(t,e){return _({},e,{fullField:i.fullField+"."+t,fullFields:i.fullFields?[].concat(i.fullFields,[t]):[t]})}function c(r){void 0===r&&(r=[]);var c=Array.isArray(r)?r:[r];!a.suppressWarning&&c.length&&t.warning("async-validator:",c),c.length&&void 0!==i.message&&(c=[].concat(i.message));var h=c.map(D(i,o));if(a.first&&h.length)return l[i.field]=1,n(h);if(s){if(i.required&&!e.value)return void 0!==i.message?h=[].concat(i.message).map(D(i,o)):a.error&&(h=[a.error(i,N(a.messages.required,i.field))]),n(h);var f={};i.defaultField&&Object.keys(e.value).map((function(t){f[t]=i.defaultField})),f=_({},f,e.rule.fields);var d={};Object.keys(f).forEach((function(t){var e=f[t],n=Array.isArray(e)?e:[e];d[t]=n.map(u.bind(null,t))}));var p=new t(d);p.messages(a.messages),e.rule.options&&(e.rule.options.messages=a.messages,e.rule.options.error=a.error),p.validate(e.value,e.rule.options||a,(function(t){var e=[];h&&h.length&&e.push.apply(e,h),t&&t.length&&e.push.apply(e,t),n(e.length?e:null)}))}else n(h)}if(s=s&&(i.required||!i.required&&e.value),i.field=e.field,i.asyncValidator)r=i.asyncValidator(i,e.value,c,e.source,a);else if(i.validator){try{r=i.validator(i,e.value,c,e.source,a)}catch(t){null==console.error||console.error(t),a.suppressValidatorError||setTimeout((function(){throw t}),0),c(t.message)}!0===r?c():!1===r?c("function"==typeof i.message?i.message(i.fullField||i.field):i.message||(i.fullField||i.field)+" fails"):r instanceof Array?c(r):r instanceof Error&&c(r.message)}r&&r.then&&r.then((function(){return c()}),(function(t){return c(t)}))}),(function(t){!function(t){for(var e,n,r=[],i={},a=0;a3&&void 0!==arguments[3]&&arguments[3];return e.length&&r&&void 0===n&&!$(t,e.slice(0,-1))?t:J(t,e,n,r)}function et(t){return Array.isArray(t)?function(t){return t.map((function(t){return et(t)}))}(t):"object"===(0,K.Z)(t)&&null!==t?function(t){if(Object.getPrototypeOf(t)===Object.prototype){var e={};for(var n in t)e[n]=et(t[n]);return e}return t}(t):t}var nt=et;function rt(t){return b(t)}function it(t,e){return $(t,e)}function ot(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=tt(t,e,n,r);return i}function at(t,e){var n={};return e.forEach((function(e){var r=it(t,e);n=ot(n,e,r)})),n}function st(t,e){return t&&t.some((function(t){return ht(t,e)}))}function ut(t){return"object"===(0,K.Z)(t)&&null!==t&&Object.getPrototypeOf(t)===Object.prototype}function ct(t,e){var n=Array.isArray(t)?(0,u.Z)(t):(0,s.Z)({},t);return e?(Object.keys(e).forEach((function(t){var r=n[t],i=e[t],o=ut(r)&&ut(i);n[t]=o?ct(r,i||{}):nt(i)})),n):n}function lt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r=r||n<0||n>=r)return t;var i=t[e],o=e-n;return o>0?[].concat((0,u.Z)(t.slice(0,n)),[i],(0,u.Z)(t.slice(n,e)),(0,u.Z)(t.slice(e+1,r))):o<0?[].concat((0,u.Z)(t.slice(0,e)),(0,u.Z)(t.slice(e+1,n+1)),[i],(0,u.Z)(t.slice(n+1,r))):t}var pt=Y;function gt(t,e){return t.replace(/\$\{\w+\}/g,(function(t){var n=t.slice(2,-1);return e[n]}))}var mt="CODE_LOGIC_ERROR";function vt(t,e,n,r,i){return yt.apply(this,arguments)}function yt(){return yt=(0,w.Z)((0,x.Z)().mark((function t(e,n,i,o,c){var l,h,f,d,p,g,m,v,y;return(0,x.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete(l=(0,s.Z)({},i)).ruleIndex,l.validator&&(h=l.validator,l.validator=function(){try{return h.apply(void 0,arguments)}catch(t){return console.error(t),Promise.reject(mt)}}),f=null,l&&"array"===l.type&&l.defaultField&&(f=l.defaultField,delete l.defaultField),d=new pt((0,a.Z)({},e,[l])),p=lt({},X,o.validateMessages),d.messages(p),g=[],t.prev=9,t.next=12,Promise.resolve(d.validate((0,a.Z)({},e,n),(0,s.Z)({},o)));case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(9),t.t0.errors&&(g=t.t0.errors.map((function(t,e){var n=t.message,i=n===mt?p.default:n;return r.isValidElement(i)?r.cloneElement(i,{key:"error_".concat(e)}):i})));case 17:if(g.length||!f){t.next=22;break}return t.next=20,Promise.all(n.map((function(t,n){return vt("".concat(e,".").concat(n),t,f,o,c)})));case 20:return m=t.sent,t.abrupt("return",m.reduce((function(t,e){return[].concat((0,u.Z)(t),(0,u.Z)(e))}),[]));case 22:return v=(0,s.Z)((0,s.Z)({},i),{},{name:e,enum:(i.enum||[]).join(", ")},c),y=g.map((function(t){return"string"==typeof t?gt(t,v):t})),t.abrupt("return",y);case 25:case"end":return t.stop()}}),t,null,[[9,14]])}))),yt.apply(this,arguments)}function bt(t,e,n,r,i,o){var a,u=t.join("."),c=n.map((function(t,e){var n=t.validator,r=(0,s.Z)((0,s.Z)({},t),{},{ruleIndex:e});return n&&(r.validator=function(t,e,r){var i=!1,o=n(t,e,(function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:St;if(i.validatePromise===r){var e;i.validatePromise=null;var n=[],o=[];null===(e=t.forEach)||void 0===e||e.call(t,(function(t){var e=t.rule.warningOnly,r=t.errors,i=void 0===r?St:r;e?o.push.apply(o,(0,u.Z)(i)):n.push.apply(n,(0,u.Z)(i))})),i.errors=n,i.warnings=o,i.triggerMetaEvent(),i.reRender()}})),f}));return i.validatePromise=r,i.dirty=!0,i.errors=St,i.warnings=St,i.triggerMetaEvent(),i.reRender(),r},i.isFieldValidating=function(){return!!i.validatePromise},i.isFieldTouched=function(){return i.touched},i.isFieldDirty=function(){return!(!i.dirty&&void 0===i.props.initialValue)||void 0!==(0,i.props.fieldContext.getInternalHooks(m).getInitialValue)(i.getNamePath())},i.getErrors=function(){return i.errors},i.getWarnings=function(){return i.warnings},i.isListField=function(){return i.props.isListField},i.isList=function(){return i.props.isList},i.isPreserve=function(){return i.props.preserve},i.getMeta=function(){return i.prevValidating=i.isFieldValidating(),{touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath()}},i.getOnlyChild=function(t){if("function"==typeof t){var e=i.getMeta();return(0,s.Z)((0,s.Z)({},i.getOnlyChild(t(i.getControlled(),e,i.props.fieldContext))),{},{isFunction:!0})}var n=(0,p.Z)(t);return 1===n.length&&r.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}},i.getValue=function(t){var e=i.props.fieldContext.getFieldsValue,n=i.getNamePath();return it(t||e(!0),n)},i.getControlled=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=i.props,n=e.trigger,r=e.validateTrigger,o=e.getValueFromEvent,u=e.normalize,c=e.valuePropName,l=e.getValueProps,h=e.fieldContext,f=void 0!==r?r:h.validateTrigger,d=i.getNamePath(),p=h.getInternalHooks,g=h.getFieldsValue,v=p(m),y=v.dispatch,x=i.getValue(),w=l||function(t){return(0,a.Z)({},c,t)},_=t[n],S=(0,s.Z)((0,s.Z)({},t),w(x));S[n]=function(){var t;i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var e=arguments.length,n=new Array(e),r=0;r=0&&e<=n.length?(l.keys=[].concat((0,u.Z)(l.keys.slice(0,e)),[l.id],(0,u.Z)(l.keys.slice(e))),o([].concat((0,u.Z)(n.slice(0,e)),[t],(0,u.Z)(n.slice(e))))):(l.keys=[].concat((0,u.Z)(l.keys),[l.id]),o([].concat((0,u.Z)(n),[t]))),l.id+=1},remove:function(t){var e=s(),n=new Set(Array.isArray(t)?t:[t]);n.size<=0||(l.keys=l.keys.filter((function(t,e){return!n.has(e)})),o(e.filter((function(t,e){return!n.has(e)}))))},move:function(t,e){if(t!==e){var n=s();t<0||t>=n.length||e<0||e>=n.length||(l.keys=dt(l.keys,t,e),o(dt(n,t,e)))}}},d=r||[];return Array.isArray(d)||(d=[]),i(d.map((function(t,e){var n=l.keys[e];return void 0===n&&(l.keys[e]=l.id,n=l.keys[e],l.id+=1),{name:e,key:n,isListField:!0}})),f,e)}))))},kt=n(29439);var Nt="__@field_split__";function Ot(t){return t.map((function(t){return"".concat((0,K.Z)(t),":").concat(t)})).join(Nt)}var Pt=function(){function t(){(0,c.Z)(this,t),this.kvs=new Map}return(0,l.Z)(t,[{key:"set",value:function(t,e){this.kvs.set(Ot(t),e)}},{key:"get",value:function(t){return this.kvs.get(Ot(t))}},{key:"update",value:function(t,e){var n=e(this.get(t));n?this.set(t,n):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(Ot(t))}},{key:"map",value:function(t){return(0,u.Z)(this.kvs.entries()).map((function(e){var n=(0,kt.Z)(e,2),r=n[0],i=n[1],o=r.split(Nt);return t({key:o.map((function(t){var e=t.match(/^([^:]*):(.*)$/),n=(0,kt.Z)(e,3),r=n[1],i=n[2];return"number"===r?Number(i):i})),value:i})}))}},{key:"toJSON",value:function(){var t={};return this.map((function(e){var n=e.key,r=e.value;return t[n.join(".")]=r,null})),t}}]),t}(),It=Pt,Lt=["name","errors"],Dt=(0,l.Z)((function t(e){var n=this;(0,c.Z)(this,t),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}},this.getInternalHooks=function(t){return t===m?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):((0,g.ZP)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(t){n.subscribable=t},this.prevWithoutPreserves=null,this.setInitialValues=function(t,e){if(n.initialValues=t||{},e){var r,i=lt({},t,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map((function(e){var n=e.key;i=ot(i,n,it(t,n))})),n.prevWithoutPreserves=null,n.updateStore(i)}},this.destroyForm=function(){var t=new It;n.getFieldEntities(!0).forEach((function(e){n.isMergedPreserve(e.isPreserve())||t.set(e.getNamePath(),!0)})),n.prevWithoutPreserves=t},this.getInitialValue=function(t){var e=it(n.initialValues,t);return t.length?nt(e):e},this.setCallbacks=function(t){n.callbacks=t},this.setValidateMessages=function(t){n.validateMessages=t},this.setPreserve=function(t){n.preserve=t},this.watchList=[],this.registerWatch=function(t){return n.watchList.push(t),function(){n.watchList=n.watchList.filter((function(e){return e!==t}))}},this.notifyWatch=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var e=n.getFieldsValue();n.watchList.forEach((function(n){n(e,t)}))}},this.timeoutId=null,this.warningUnhooked=function(){0},this.updateStore=function(t){n.store=t},this.getFieldEntities=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t?n.fieldEntities.filter((function(t){return t.getNamePath().length})):n.fieldEntities},this.getFieldsMap=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=new It;return n.getFieldEntities(t).forEach((function(t){var n=t.getNamePath();e.set(n,t)})),e},this.getFieldEntitiesForNamePathList=function(t){if(!t)return n.getFieldEntities(!0);var e=n.getFieldsMap(!0);return t.map((function(t){var n=rt(t);return e.get(n)||{INVALIDATE_NAME_PATH:rt(t)}}))},this.getFieldsValue=function(t,e){if(n.warningUnhooked(),!0===t&&!e)return n.store;var r=n.getFieldEntitiesForNamePathList(Array.isArray(t)?t:null),i=[];return r.forEach((function(n){var r,o="INVALIDATE_NAME_PATH"in n?n.INVALIDATE_NAME_PATH:n.getNamePath();if(t||!(null===(r=n.isListField)||void 0===r?void 0:r.call(n)))if(e){var a="getMeta"in n?n.getMeta():null;e(a)&&i.push(o)}else i.push(o)})),at(n.store,i.map(rt))},this.getFieldValue=function(t){n.warningUnhooked();var e=rt(t);return it(n.store,e)},this.getFieldsError=function(t){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(t).map((function(e,n){return e&&!("INVALIDATE_NAME_PATH"in e)?{name:e.getNamePath(),errors:e.getErrors(),warnings:e.getWarnings()}:{name:rt(t[n]),errors:[],warnings:[]}}))},this.getFieldError=function(t){n.warningUnhooked();var e=rt(t);return n.getFieldsError([e])[0].errors},this.getFieldWarning=function(t){n.warningUnhooked();var e=rt(t);return n.getFieldsError([e])[0].warnings},this.isFieldsTouched=function(){n.warningUnhooked();for(var t=arguments.length,e=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=new It,r=n.getFieldEntities(!0);r.forEach((function(t){var n=t.props.initialValue,r=t.getNamePath();if(void 0!==n){var i=e.get(r)||new Set;i.add({entity:t,value:n}),e.set(r,i)}}));var i,o=function(r){r.forEach((function(r){if(void 0!==r.props.initialValue){var i=r.getNamePath();if(void 0!==n.getInitialValue(i))(0,g.ZP)(!1,"Form already set 'initialValues' with path '".concat(i.join("."),"'. Field can not overwrite it."));else{var o=e.get(i);if(o&&o.size>1)(0,g.ZP)(!1,"Multiple Field with path '".concat(i.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(o){var a=n.getFieldValue(i);t.skipExist&&void 0!==a||n.updateStore(ot(n.store,i,(0,u.Z)(o)[0].value))}}}}))};t.entities?i=t.entities:t.namePathList?(i=[],t.namePathList.forEach((function(t){var n,r=e.get(t);r&&(n=i).push.apply(n,(0,u.Z)((0,u.Z)(r).map((function(t){return t.entity}))))}))):i=r,o(i)},this.resetFields=function(t){n.warningUnhooked();var e=n.store;if(!t)return n.updateStore(lt({},n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(e,null,{type:"reset"}),void n.notifyWatch();var r=t.map(rt);r.forEach((function(t){var e=n.getInitialValue(t);n.updateStore(ot(n.store,t,e))})),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(e,r,{type:"reset"}),n.notifyWatch(r)},this.setFields=function(t){n.warningUnhooked();var e=n.store,r=[];t.forEach((function(t){var i=t.name,a=(t.errors,(0,o.Z)(t,Lt)),s=rt(i);r.push(s),"value"in a&&n.updateStore(ot(n.store,s,a.value)),n.notifyObservers(e,[s],{type:"setField",data:t})})),n.notifyWatch(r)},this.getFields=function(){return n.getFieldEntities(!0).map((function(t){var e=t.getNamePath(),r=t.getMeta(),i=(0,s.Z)((0,s.Z)({},r),{},{name:e,value:n.getFieldValue(e)});return Object.defineProperty(i,"originRCField",{value:!0}),i}))},this.initEntityValue=function(t){var e=t.props.initialValue;if(void 0!==e){var r=t.getNamePath();void 0===it(n.store,r)&&n.updateStore(ot(n.store,r,e))}},this.isMergedPreserve=function(t){var e=void 0!==t?t:n.preserve;return null==e||e},this.registerField=function(t){n.fieldEntities.push(t);var e=t.getNamePath();if(n.notifyWatch([e]),void 0!==t.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[t],skipExist:!0}),n.notifyObservers(r,[t.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter((function(e){return e!==t})),!n.isMergedPreserve(i)&&(!r||o.length>1)){var a=r?void 0:n.getInitialValue(e);if(e.length&&n.getFieldValue(e)!==a&&n.fieldEntities.every((function(t){return!ht(t.getNamePath(),e)}))){var s=n.store;n.updateStore(ot(s,e,a,!0)),n.notifyObservers(s,[e],{type:"remove"}),n.triggerDependenciesUpdate(s,e)}}n.notifyWatch([e])}},this.dispatch=function(t){switch(t.type){case"updateValue":var e=t.namePath,r=t.value;n.updateValue(e,r);break;case"validateField":var i=t.namePath,o=t.triggerName;n.validateFields([i],{triggerName:o})}},this.notifyObservers=function(t,e,r){if(n.subscribable){var i=(0,s.Z)((0,s.Z)({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach((function(n){(0,n.onStoreChange)(t,e,i)}))}else n.forceRootUpdate()},this.triggerDependenciesUpdate=function(t,e){var r=n.getDependencyChildrenFields(e);return r.length&&n.validateFields(r),n.notifyObservers(t,r,{type:"dependenciesUpdate",relatedFields:[e].concat((0,u.Z)(r))}),r},this.updateValue=function(t,e){var r=rt(t),i=n.store;n.updateStore(ot(n.store,r,e)),n.notifyObservers(i,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var o=n.triggerDependenciesUpdate(i,r),a=n.callbacks.onValuesChange;a&&a(at(n.store,[r]),n.getFieldsValue());n.triggerOnFieldsChange([r].concat((0,u.Z)(o)))},this.setFieldsValue=function(t){n.warningUnhooked();var e=n.store;if(t){var r=lt(n.store,t);n.updateStore(r)}n.notifyObservers(e,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()},this.setFieldValue=function(t,e){n.setFields([{name:t,value:e}])},this.getDependencyChildrenFields=function(t){var e=new Set,r=[],i=new It;n.getFieldEntities().forEach((function(t){(t.props.dependencies||[]).forEach((function(e){var n=rt(e);i.update(n,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return e.add(t),e}))}))}));return function t(n){(i.get(n)||new Set).forEach((function(n){if(!e.has(n)){e.add(n);var i=n.getNamePath();n.isFieldDirty()&&i.length&&(r.push(i),t(i))}}))}(t),r},this.triggerOnFieldsChange=function(t,e){var r=n.callbacks.onFieldsChange;if(r){var i=n.getFields();if(e){var o=new It;e.forEach((function(t){var e=t.name,n=t.errors;o.set(e,n)})),i.forEach((function(t){t.errors=o.get(t.name)||t.errors}))}r(i.filter((function(e){var n=e.name;return st(t,n)})),i)}},this.validateFields=function(t,e){n.warningUnhooked();var r=!!t,i=r?t.map(rt):[],o=[];n.getFieldEntities(!0).forEach((function(a){if(r||i.push(a.getNamePath()),(null==e?void 0:e.recursive)&&r){var c=a.getNamePath();c.every((function(e,n){return t[n]===e||void 0===t[n]}))&&i.push(c)}if(a.props.rules&&a.props.rules.length){var l=a.getNamePath();if(!r||st(i,l)){var h=a.validateRules((0,s.Z)({validateMessages:(0,s.Z)((0,s.Z)({},X),n.validateMessages)},e));o.push(h.then((function(){return{name:l,errors:[],warnings:[]}})).catch((function(t){var e,n=[],r=[];return null===(e=t.forEach)||void 0===e||e.call(t,(function(t){var e=t.rule.warningOnly,i=t.errors;e?r.push.apply(r,(0,u.Z)(i)):n.push.apply(n,(0,u.Z)(i))})),n.length?Promise.reject({name:l,errors:n,warnings:r}):{name:l,errors:n,warnings:r}})))}}}));var a=function(t){var e=!1,n=t.length,r=[];return t.length?new Promise((function(i,o){t.forEach((function(t,a){t.catch((function(t){return e=!0,t})).then((function(t){n-=1,r[a]=t,n>0||(e&&o(r),i(r))}))}))})):Promise.resolve([])}(o);n.lastValidatePromise=a,a.catch((function(t){return t})).then((function(t){var e=t.map((function(t){return t.name}));n.notifyObservers(n.store,e,{type:"validateFinish"}),n.triggerOnFieldsChange(e,t)}));var c=a.then((function(){return n.lastValidatePromise===a?Promise.resolve(n.getFieldsValue(i)):Promise.reject([])})).catch((function(t){var e=t.filter((function(t){return t&&t.errors.length}));return Promise.reject({values:n.getFieldsValue(i),errorFields:e,outOfDate:n.lastValidatePromise!==a})}));return c.catch((function(t){return t})),c},this.submit=function(){n.warningUnhooked(),n.validateFields().then((function(t){var e=n.callbacks.onFinish;if(e)try{e(t)}catch(t){console.error(t)}})).catch((function(t){var e=n.callbacks.onFinishFailed;e&&e(t)}))},this.forceRootUpdate=e}));var Rt=function(t){var e=r.useRef(),n=r.useState({}),i=(0,kt.Z)(n,2)[1];if(!e.current)if(t)e.current=t;else{var o=new Dt((function(){i({})}));e.current=o.getForm()}return[e.current]},zt=r.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Ft=function(t){var e=t.validateMessages,n=t.onFormChange,i=t.onFormFinish,o=t.children,u=r.useContext(zt),c=r.useRef({});return r.createElement(zt.Provider,{value:(0,s.Z)((0,s.Z)({},u),{},{validateMessages:(0,s.Z)((0,s.Z)({},u.validateMessages),e),triggerFormChange:function(t,e){n&&n(t,{changedFields:e,forms:c.current}),u.triggerFormChange(t,e)},triggerFormFinish:function(t,e){i&&i(t,{values:e,forms:c.current}),u.triggerFormFinish(t,e)},registerForm:function(t,e){t&&(c.current=(0,s.Z)((0,s.Z)({},c.current),{},(0,a.Z)({},t,e))),u.registerForm(t,e)},unregisterForm:function(t){var e=(0,s.Z)({},c.current);delete e[t],c.current=e,u.unregisterForm(t)}})},o)},Bt=zt,jt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],Ut=function(t,e){var n=t.name,a=t.initialValues,c=t.fields,l=t.form,h=t.preserve,f=t.children,d=t.component,p=void 0===d?"form":d,g=t.validateMessages,v=t.validateTrigger,b=void 0===v?"onChange":v,x=t.onValuesChange,w=t.onFieldsChange,_=t.onFinish,S=t.onFinishFailed,E=(0,o.Z)(t,jt),M=r.useContext(Bt),T=Rt(l),A=(0,kt.Z)(T,1)[0],C=A.getInternalHooks(m),k=C.useSubscribe,N=C.setInitialValues,O=C.setCallbacks,P=C.setValidateMessages,I=C.setPreserve,L=C.destroyForm;r.useImperativeHandle(e,(function(){return A})),r.useEffect((function(){return M.registerForm(n,A),function(){M.unregisterForm(n)}}),[M,A,n]),P((0,s.Z)((0,s.Z)({},M.validateMessages),g)),O({onValuesChange:x,onFieldsChange:function(t){if(M.triggerFormChange(n,t),w){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;iNumber.MAX_SAFE_INTEGER)return String(m()?BigInt(t).toString():Number.MAX_SAFE_INTEGER);if(tNumber.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(r0&&void 0!==arguments[0])||arguments[0];return t?this.isInvalidate()?"":x(this.number):this.origin}}]),t}(),E=function(){function t(e){if((0,p.Z)(this,t),(0,i.Z)(this,"origin",""),(0,i.Z)(this,"negative",void 0),(0,i.Z)(this,"integer",void 0),(0,i.Z)(this,"decimal",void 0),(0,i.Z)(this,"decimalLen",void 0),(0,i.Z)(this,"empty",void 0),(0,i.Z)(this,"nan",void 0),_(e))this.empty=!0;else if(this.origin=String(e),"-"===e||Number.isNaN(e))this.nan=!0;else{var n=e;if(y(n)&&(n=Number(n)),w(n="string"==typeof n?n:x(n))){var r=v(n);this.negative=r.negative;var o=r.trimStr.split(".");this.integer=BigInt(o[0]);var a=o[1]||"0";this.decimal=BigInt(a),this.decimalLen=a.length}else this.nan=!0}}return(0,g.Z)(t,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(t){var e="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(t,"0"));return BigInt(e)}},{key:"negate",value:function(){var e=new t(this.toString());return e.negative=!e.negative,e}},{key:"add",value:function(e){if(this.isInvalidate())return new t(e);var n=new t(e);if(n.isInvalidate())return this;var r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),i=v((this.alignDecimal(r)+n.alignDecimal(r)).toString()),o=i.negativeStr,a=i.trimStr,s="".concat(o).concat(a.padStart(r+1,"0"));return new t("".concat(s.slice(0,-r),".").concat(s.slice(-r)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(t){return this.toString()===(null==t?void 0:t.toString())}},{key:"lessEquals",value:function(t){return this.add(t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.isInvalidate()?"":v("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),t}();function M(t){return m()?new E(t):new S(t)}function T(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===t)return"";var i=v(t),o=i.negativeStr,a=i.integerStr,s=i.decimalStr,u="".concat(e).concat(s),c="".concat(o).concat(a);if(n>=0){var l=Number(s[n]);if(l>=5&&!r){var h=M(t).add("".concat(o,"0.").concat("0".repeat(n)).concat(10-l));return T(h.toString(),e,n,r)}return 0===n?c:"".concat(c).concat(e).concat(s.padEnd(n,"0").slice(0,n))}return".0"===u?c:"".concat(c).concat(u)}var A=M,C=n(31131);function k(t){var e=t.prefixCls,n=t.upNode,o=t.downNode,a=t.upDisabled,s=t.downDisabled,c=t.onStep,h=u.useRef(),f=u.useRef();f.current=c;var d=function(t,e){t.preventDefault(),f.current(e),h.current=setTimeout((function t(){f.current(e),h.current=setTimeout(t,200)}),600)},p=function(){clearTimeout(h.current)};if(u.useEffect((function(){return p}),[]),(0,C.Z)())return null;var g="".concat(e,"-handler"),m=l()(g,"".concat(g,"-up"),(0,i.Z)({},"".concat(g,"-up-disabled"),a)),v=l()(g,"".concat(g,"-down"),(0,i.Z)({},"".concat(g,"-down-disabled"),s)),y={unselectable:"on",role:"button",onMouseUp:p,onMouseLeave:p};return u.createElement("div",{className:"".concat(g,"-wrap")},u.createElement("span",(0,r.Z)({},y,{onMouseDown:function(t){d(t,!0)},"aria-label":"Increase Value","aria-disabled":a,className:m}),n||u.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),u.createElement("span",(0,r.Z)({},y,{onMouseDown:function(t){d(t,!1)},"aria-label":"Decrease Value","aria-disabled":s,className:v}),o||u.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function N(t){var e="number"==typeof t?x(t):v(t).fullStr;return e.includes(".")?v(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:t+"0"}var O=n(80334);var P=n(75164),I=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],L=function(t,e){return t||e.isEmpty()?e.toString():e.toNumber()},D=function(t){var e=A(t);return e.isInvalidate()?null:e},R=u.forwardRef((function(t,e){var n,c=t.prefixCls,p=void 0===c?"rc-input-number":c,g=t.className,m=t.style,v=t.min,y=t.max,_=t.step,S=void 0===_?1:_,E=t.defaultValue,M=t.value,C=t.disabled,R=t.readOnly,z=t.upHandler,F=t.downHandler,B=t.keyboard,j=t.controls,U=void 0===j||j,V=t.stringMode,H=t.parser,G=t.formatter,Z=t.precision,W=t.decimalSeparator,Y=t.onChange,q=t.onInput,X=t.onPressEnter,K=t.onStep,$=(0,s.Z)(t,I),Q="".concat(p,"-input"),J=u.useRef(null),tt=u.useState(!1),et=(0,a.Z)(tt,2),nt=et[0],rt=et[1],it=u.useRef(!1),ot=u.useRef(!1),at=u.useRef(!1),st=u.useState((function(){return A(null!=M?M:E)})),ut=(0,a.Z)(st,2),ct=ut[0],lt=ut[1];var ht=u.useCallback((function(t,e){if(!e)return Z>=0?Z:Math.max(b(t),b(S))}),[Z,S]),ft=u.useCallback((function(t){var e=String(t);if(H)return H(e);var n=e;return W&&(n=n.replace(W,".")),n.replace(/[^\w.-]+/g,"")}),[H,W]),dt=u.useRef(""),pt=u.useCallback((function(t,e){if(G)return G(t,{userTyping:e,input:String(dt.current)});var n="number"==typeof t?x(t):t;if(!e){var r=ht(n,e);if(w(n)&&(W||r>=0))n=T(n,W||".",r)}return n}),[G,ht,W]),gt=u.useState((function(){var t=null!=E?E:M;return ct.isInvalidate()&&["string","number"].includes((0,o.Z)(t))?Number.isNaN(t)?"":t:pt(ct.toString(),!1)})),mt=(0,a.Z)(gt,2),vt=mt[0],yt=mt[1];function bt(t,e){yt(pt(t.isInvalidate()?t.toString(!1):t.toString(!e),e))}dt.current=vt;var xt,wt,_t,St,Et,Mt=u.useMemo((function(){return D(y)}),[y,Z]),Tt=u.useMemo((function(){return D(v)}),[v,Z]),At=u.useMemo((function(){return!(!Mt||!ct||ct.isInvalidate())&&Mt.lessEquals(ct)}),[Mt,ct]),Ct=u.useMemo((function(){return!(!Tt||!ct||ct.isInvalidate())&&ct.lessEquals(Tt)}),[Tt,ct]),kt=(xt=J.current,wt=nt,_t=(0,u.useRef)(null),[function(){try{var t=xt.selectionStart,e=xt.selectionEnd,n=xt.value,r=n.substring(0,t),i=n.substring(e);_t.current={start:t,end:e,value:n,beforeTxt:r,afterTxt:i}}catch(t){}},function(){if(xt&&_t.current&&wt)try{var t=xt.value,e=_t.current,n=e.beforeTxt,r=e.afterTxt,i=e.start,o=t.length;if(t.endsWith(r))o=t.length-_t.current.afterTxt.length;else if(t.startsWith(n))o=n.length;else{var a=n[i-1],s=t.indexOf(a,i-1);-1!==s&&(o=s+1)}xt.setSelectionRange(o,o)}catch(t){(0,O.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(t.message))}}]),Nt=(0,a.Z)(kt,2),Ot=Nt[0],Pt=Nt[1],It=function(t){return Mt&&!t.lessEquals(Mt)?Mt:Tt&&!Tt.lessEquals(t)?Tt:null},Lt=function(t){return!It(t)},Dt=function(t,e){var n,r=t,i=Lt(r)||r.isEmpty();if(r.isEmpty()||e||(r=It(r)||r,i=!0),!R&&!C&&i){var o=r.toString(),a=ht(o,e);return a>=0&&(r=A(T(o,".",a)),Lt(r)||(r=A(T(o,".",a,!0)))),r.equals(ct)||(n=r,void 0===M&<(n),null==Y||Y(r.isEmpty()?null:L(V,r)),void 0===M&&bt(r,e)),r}return ct},Rt=(St=(0,u.useRef)(0),Et=function(){P.Z.cancel(St.current)},(0,u.useEffect)((function(){return Et}),[]),function(t){Et(),St.current=(0,P.Z)((function(){t()}))}),zt=function t(e){if(Ot(),yt(e),!ot.current){var n=ft(e),r=A(n);r.isNaN()||Dt(r,!0)}null==q||q(e),Rt((function(){var n=e;H||(n=e.replace(/。/g,".")),n!==e&&t(n)}))},Ft=function(t){var e;if(!(t&&At||!t&&Ct)){it.current=!1;var n=A(at.current?N(S):S);t||(n=n.negate());var r=(ct||A(0)).add(n.toString()),i=Dt(r,!1);null==K||K(L(V,i),{offset:at.current?N(S):S,type:t?"up":"down"}),null===(e=J.current)||void 0===e||e.focus()}},Bt=function(t){var e=A(ft(vt)),n=e;n=e.isNaN()?ct:Dt(e,t),void 0!==M?bt(ct,!1):n.isNaN()||bt(n,!1)};return(0,f.o)((function(){ct.isInvalidate()||bt(ct,!1)}),[Z]),(0,f.o)((function(){var t=A(M);lt(t);var e=A(ft(vt));t.equals(e)&&it.current&&!G||bt(t,it.current)}),[M]),(0,f.o)((function(){G&&Pt()}),[vt]),u.createElement("div",{className:l()(p,g,(n={},(0,i.Z)(n,"".concat(p,"-focused"),nt),(0,i.Z)(n,"".concat(p,"-disabled"),C),(0,i.Z)(n,"".concat(p,"-readonly"),R),(0,i.Z)(n,"".concat(p,"-not-a-number"),ct.isNaN()),(0,i.Z)(n,"".concat(p,"-out-of-range"),!ct.isInvalidate()&&!Lt(ct)),n)),style:m,onFocus:function(){rt(!0)},onBlur:function(){Bt(!1),rt(!1),it.current=!1},onKeyDown:function(t){var e=t.which,n=t.shiftKey;it.current=!0,at.current=!!n,e===h.Z.ENTER&&(ot.current||(it.current=!1),Bt(!1),null==X||X(t)),!1!==B&&!ot.current&&[h.Z.UP,h.Z.DOWN].includes(e)&&(Ft(h.Z.UP===e),t.preventDefault())},onKeyUp:function(){it.current=!1,at.current=!1},onCompositionStart:function(){ot.current=!0},onCompositionEnd:function(){ot.current=!1,zt(J.current.value)},onBeforeInput:function(){it.current=!0}},U&&u.createElement(k,{prefixCls:p,upNode:z,downNode:F,upDisabled:At,downDisabled:Ct,onStep:Ft}),u.createElement("div",{className:"".concat(Q,"-wrap")},u.createElement("input",(0,r.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":v,"aria-valuemax":y,"aria-valuenow":ct.isInvalidate()?null:ct.toString(),step:S},$,{ref:(0,d.sQ)(J,e),className:Q,value:vt,onChange:function(t){zt(t.target.value)},disabled:C,readOnly:R}))))}));R.displayName="InputNumber";var z=R},27163:function(t,e,n){"use strict";n.d(e,{Z:function(){return x}});var r=n(4942),i=n(71002),o=n(67294),a=n(94184),s=n.n(a);function u(t){return!(!t.addonBefore&&!t.addonAfter)}function c(t){return!!(t.prefix||t.suffix||t.allowClear)}function l(t,e,n,r){if(n){var i=e;if("click"===e.type){var o=t.cloneNode(!0);return i=Object.create(e,{target:{value:o},currentTarget:{value:o}}),o.value="",void n(i)}if(void 0!==r)return i=Object.create(e,{target:{value:t},currentTarget:{value:t}}),t.value=r,void n(i);n(i)}}function h(t){return null==t?"":String(t)}var f=function(t){var e=t.inputElement,n=t.prefixCls,a=t.prefix,l=t.suffix,h=t.addonBefore,f=t.addonAfter,d=t.className,p=t.style,g=t.affixWrapperClassName,m=t.groupClassName,v=t.wrapperClassName,y=t.disabled,b=t.readOnly,x=t.focused,w=t.triggerFocus,_=t.allowClear,S=t.value,E=t.handleReset,M=t.hidden,T=(0,o.useRef)(null),A=(0,o.cloneElement)(e,{value:S,hidden:M});if(c(t)){var C,k="".concat(n,"-affix-wrapper"),N=s()(k,(C={},(0,r.Z)(C,"".concat(k,"-disabled"),y),(0,r.Z)(C,"".concat(k,"-focused"),x),(0,r.Z)(C,"".concat(k,"-readonly"),b),(0,r.Z)(C,"".concat(k,"-input-with-clear-btn"),l&&_&&S),C),!u(t)&&d,g),O=(l||_)&&o.createElement("span",{className:"".concat(n,"-suffix")},function(){var t;if(!_)return null;var e=!y&&!b&&S,a="".concat(n,"-clear-icon"),u="object"===(0,i.Z)(_)&&null!=_&&_.clearIcon?_.clearIcon:"✖";return o.createElement("span",{onClick:E,onMouseDown:function(t){return t.preventDefault()},className:s()(a,(t={},(0,r.Z)(t,"".concat(a,"-hidden"),!e),(0,r.Z)(t,"".concat(a,"-has-suffix"),!!l),t)),role:"button",tabIndex:-1},u)}(),l);A=o.createElement("span",{className:N,style:p,hidden:!u(t)&&M,onClick:function(t){var e;null!==(e=T.current)&&void 0!==e&&e.contains(t.target)&&(null==w||w())},ref:T},a&&o.createElement("span",{className:"".concat(n,"-prefix")},a),(0,o.cloneElement)(e,{style:null,value:S,hidden:null}),O)}if(u(t)){var P="".concat(n,"-group"),I="".concat(P,"-addon"),L=s()("".concat(n,"-wrapper"),P,v),D=s()("".concat(n,"-group-wrapper"),d,m);return o.createElement("span",{className:D,style:p,hidden:M},o.createElement("span",{className:L},h&&o.createElement("span",{className:I},h),(0,o.cloneElement)(A,{style:null,hidden:null}),f&&o.createElement("span",{className:I},f)))}return A},d=n(93433),p=n(87462),g=n(29439),m=n(44925),v=n(98423),y=n(21770),b=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],x=(0,o.forwardRef)((function(t,e){var n=t.autoComplete,a=t.onChange,x=t.onFocus,w=t.onBlur,_=t.onPressEnter,S=t.onKeyDown,E=t.prefixCls,M=void 0===E?"rc-input":E,T=t.disabled,A=t.htmlSize,C=t.className,k=t.maxLength,N=t.suffix,O=t.showCount,P=t.type,I=void 0===P?"text":P,L=t.inputClassName,D=(0,m.Z)(t,b),R=(0,y.Z)(t.defaultValue,{value:t.value}),z=(0,g.Z)(R,2),F=z[0],B=z[1],j=(0,o.useState)(!1),U=(0,g.Z)(j,2),V=U[0],H=U[1],G=(0,o.useRef)(null),Z=function(t){G.current&&function(t,e){if(t){t.focus(e);var n=(e||{}).cursor;if(n){var r=t.value.length;switch(n){case"start":t.setSelectionRange(0,0);break;case"end":t.setSelectionRange(r,r);break;default:t.setSelectionRange(0,r)}}}}(G.current,t)};(0,o.useImperativeHandle)(e,(function(){return{focus:Z,blur:function(){var t;null===(t=G.current)||void 0===t||t.blur()},setSelectionRange:function(t,e,n){var r;null===(r=G.current)||void 0===r||r.setSelectionRange(t,e,n)},select:function(){var t;null===(t=G.current)||void 0===t||t.select()},input:G.current}})),(0,o.useEffect)((function(){H((function(t){return(!t||!T)&&t}))}),[T]);var W,Y=function(e){void 0===t.value&&B(e.target.value),G.current&&l(G.current,e,a)},q=function(t){_&&"Enter"===t.key&&_(t),null==S||S(t)},X=function(t){H(!0),null==x||x(t)},K=function(t){H(!1),null==w||w(t)};return o.createElement(f,(0,p.Z)({},D,{prefixCls:M,className:C,inputElement:(W=(0,v.Z)(t,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]),o.createElement("input",(0,p.Z)({autoComplete:n},W,{onChange:Y,onFocus:X,onBlur:K,onKeyDown:q,className:s()(M,(0,r.Z)({},"".concat(M,"-disabled"),T),L,!u(t)&&!c(t)&&C),ref:G,size:A,type:I}))),handleReset:function(t){B(""),Z(),G.current&&l(G.current,t,a)},value:h(F),focused:V,triggerFocus:Z,suffix:function(){var t=Number(k)>0;if(N||O){var e=h(F),n=(0,d.Z)(e).length,a="object"===(0,i.Z)(O)?O.formatter({value:e,count:n,maxLength:k}):"".concat(n).concat(t?" / ".concat(k):"");return o.createElement(o.Fragment,null,!!O&&o.createElement("span",{className:s()("".concat(M,"-show-count-suffix"),(0,r.Z)({},"".concat(M,"-show-count-has-suffix"),!!N))},a),N)}return null}(),disabled:T}))}))},11688:function(t,e,n){"use strict";n.d(e,{iz:function(){return qt},ck:function(){return vt},BW:function(){return Yt},sN:function(){return vt},GP:function(){return Yt},Wd:function(){return jt},ZP:function(){return Kt},Xl:function(){return k}});var r=n(87462),i=n(4942),o=n(1413),a=n(93433),s=n(29439),u=n(44925),c=n(94184),l=n.n(c),h=n(19214),f=n(21770),d=n(80334),p=n(67294),g=n(73935),m=n(96774),v=n.n(m),y=p.createContext(null);function b(t,e){return void 0===t?null:"".concat(t,"-").concat(e)}function x(t){return b(p.useContext(y),t)}var w=n(56982),_=["children","locked"],S=p.createContext(null);function E(t){var e=t.children,n=t.locked,r=(0,u.Z)(t,_),i=p.useContext(S),a=(0,w.Z)((function(){return t=i,e=r,n=(0,o.Z)({},t),Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)})),n;var t,e,n}),[i,r],(function(t,e){return!(n||t[0]===e[0]&&v()(t[1],e[1]))}));return p.createElement(S.Provider,{value:a},e)}var M=[],T=p.createContext(null);function A(){return p.useContext(T)}var C=p.createContext(M);function k(t){var e=p.useContext(C);return p.useMemo((function(){return void 0!==t?[].concat((0,a.Z)(e),[t]):e}),[e,t])}var N=p.createContext(null),O=p.createContext({}),P=n(15105),I=n(75164),L=n(5110);function D(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,L.Z)(t)){var n=t.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||t.isContentEditable||"a"===n&&!!t.getAttribute("href"),i=t.getAttribute("tabindex"),o=Number(i),a=null;return i&&!Number.isNaN(o)?a=o:r&&null===a&&(a=0),r&&t.disabled&&(a=null),null!==a&&(a>=0||e&&a<0)}return!1}function R(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,a.Z)(t.querySelectorAll("*")).filter((function(t){return D(t,e)}));return D(t,e)&&n.unshift(t),n}var z=P.Z.LEFT,F=P.Z.RIGHT,B=P.Z.UP,j=P.Z.DOWN,U=P.Z.ENTER,V=P.Z.ESC,H=P.Z.HOME,G=P.Z.END,Z=[B,j,z,F];function W(t,e){return R(t,!0).filter((function(t){return e.has(t)}))}function Y(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!t)return null;var i=W(t,e),o=i.length,a=i.findIndex((function(t){return n===t}));return r<0?-1===a?a=o-1:a-=1:r>0&&(a+=1),i[a=(a+o)%o]}function q(t,e,n,r,o,a,s,u,c,l){var h=p.useRef(),f=p.useRef();f.current=e;var d=function(){I.Z.cancel(h.current)};return p.useEffect((function(){return function(){d()}}),[]),function(p){var g=p.which;if([].concat(Z,[U,V,H,G]).includes(g)){var m,v,y,x=function(){return m=new Set,v=new Map,y=new Map,a().forEach((function(t){var e=document.querySelector("[data-menu-id='".concat(b(r,t),"']"));e&&(m.add(e),y.set(e,t),v.set(t,e))})),m};x();var w=function(t,e){for(var n=t||document.activeElement;n;){if(e.has(n))return n;n=n.parentElement}return null}(v.get(e),m),_=y.get(w),S=function(t,e,n,r){var o,a,s,u,c="prev",l="next",h="children",f="parent";if("inline"===t&&r===U)return{inlineTrigger:!0};var d=(o={},(0,i.Z)(o,B,c),(0,i.Z)(o,j,l),o),p=(a={},(0,i.Z)(a,z,n?l:c),(0,i.Z)(a,F,n?c:l),(0,i.Z)(a,j,h),(0,i.Z)(a,U,h),a),g=(s={},(0,i.Z)(s,B,c),(0,i.Z)(s,j,l),(0,i.Z)(s,U,h),(0,i.Z)(s,V,f),(0,i.Z)(s,z,n?h:f),(0,i.Z)(s,F,n?f:h),s);switch(null===(u={inline:d,horizontal:p,vertical:g,inlineSub:d,horizontalSub:g,verticalSub:g}["".concat(t).concat(e?"":"Sub")])||void 0===u?void 0:u[r]){case c:return{offset:-1,sibling:!0};case l:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case h:return{offset:1,sibling:!1};default:return null}}(t,1===s(_,!0).length,n,g);if(!S&&g!==H&&g!==G)return;(Z.includes(g)||[H,G].includes(g))&&p.preventDefault();var E=function(t){if(t){var e=t,n=t.querySelector("a");null!=n&&n.getAttribute("href")&&(e=n);var r=y.get(t);u(r),d(),h.current=(0,I.Z)((function(){f.current===r&&e.focus()}))}};if([H,G].includes(g)||S.sibling||!w){var M,T,A=W(M=w&&"inline"!==t?function(t){for(var e=t;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}(w):o.current,m);T=g===H?A[0]:g===G?A[A.length-1]:Y(M,m,w,S.offset),E(T)}else if(S.inlineTrigger)c(_);else if(S.offset>0)c(_,!0),d(),h.current=(0,I.Z)((function(){x();var t=w.getAttribute("aria-controls"),e=Y(document.getElementById(t),m);E(e)}),5);else if(S.offset<0){var C=s(_,!0),k=C[C.length-2],N=v.get(k);c(k,!1),E(N)}}null==l||l(p)}}var X="__RC_UTIL_PATH_SPLIT__",K=function(t){return t.join(X)},$="rc-menu-more";function Q(){var t=p.useState({}),e=(0,s.Z)(t,2)[1],n=(0,p.useRef)(new Map),r=(0,p.useRef)(new Map),i=p.useState([]),o=(0,s.Z)(i,2),u=o[0],c=o[1],l=(0,p.useRef)(0),h=(0,p.useRef)(!1),f=(0,p.useCallback)((function(t,i){var o=K(i);r.current.set(o,t),n.current.set(t,o),l.current+=1;var a,s=l.current;a=function(){s===l.current&&(h.current||e({}))},Promise.resolve().then(a)}),[]),d=(0,p.useCallback)((function(t,e){var i=K(e);r.current.delete(i),n.current.delete(t)}),[]),g=(0,p.useCallback)((function(t){c(t)}),[]),m=(0,p.useCallback)((function(t,e){var r=n.current.get(t)||"",i=r.split(X);return e&&u.includes(i[0])&&i.unshift($),i}),[u]),v=(0,p.useCallback)((function(t,e){return t.some((function(t){return m(t,!0).includes(e)}))}),[m]),y=(0,p.useCallback)((function(t){var e="".concat(n.current.get(t)).concat(X),i=new Set;return(0,a.Z)(r.current.keys()).forEach((function(t){t.startsWith(e)&&i.add(r.current.get(t))})),i}),[]);return p.useEffect((function(){return function(){h.current=!0}}),[]),{registerPath:f,unregisterPath:d,refreshOverflowKeys:g,isSubPathKey:v,getKeyPath:m,getKeys:function(){var t=(0,a.Z)(n.current.keys());return u.length&&t.push($),t},getSubPathKeys:y}}function J(t){var e=p.useRef(t);e.current=t;var n=p.useCallback((function(){for(var t,n=arguments.length,r=new Array(n),i=0;i1&&(_.motionAppear=!1);var M=_.onVisibleChanged;return _.onVisibleChanged=function(t){return m.current||t||x(!0),null==M?void 0:M(t)},b?null:p.createElement(E,{mode:u,locked:!m.current},p.createElement(Dt.Z,(0,r.Z)({visible:w},_,{forceRender:h,removeOnLeave:!1,leavedClassName:"".concat(l,"-hidden")}),(function(t){var n=t.className,r=t.style;return p.createElement(wt,{id:e,className:n,style:r},a)})))}var zt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ft=["active"],Bt=function(t){var e,n=t.style,a=t.className,c=t.title,f=t.eventKey,d=(t.warnKey,t.disabled),g=t.internalPopupClose,m=t.children,v=t.itemIcon,y=t.expandIcon,b=t.popupClassName,w=t.popupOffset,_=t.onClick,M=t.onMouseEnter,T=t.onMouseLeave,A=t.onTitleClick,C=t.onTitleMouseEnter,P=t.onTitleMouseLeave,I=(0,u.Z)(t,zt),L=x(f),D=p.useContext(S),R=D.prefixCls,z=D.mode,F=D.openKeys,B=D.disabled,j=D.overflowDisabled,U=D.activeKey,V=D.selectedKeys,H=D.itemIcon,G=D.expandIcon,Z=D.onItemClick,W=D.onOpenChange,Y=D.onActive,q=p.useContext(O)._internalRenderSubMenuItem,X=p.useContext(N).isSubPathKey,K=k(),$="".concat(R,"-submenu"),Q=B||d,tt=p.useRef(),et=p.useRef();var nt=v||H,rt=y||G,it=F.includes(f),ot=!j&&it,at=X(V,f),ut=st(f,Q,C,P),ft=ut.active,dt=(0,u.Z)(ut,Ft),pt=p.useState(!1),gt=(0,s.Z)(pt,2),mt=gt[0],vt=gt[1],yt=function(t){Q||vt(t)},bt=p.useMemo((function(){return ft||"inline"!==z&&(mt||X([U],f))}),[z,ft,U,mt,f,X]),xt=ht(K.length),_t=J((function(t){null==_||_(ct(t)),Z(t)})),St=L&&"".concat(L,"-popup"),Et=p.createElement("div",(0,r.Z)({role:"menuitem",style:xt,className:"".concat($,"-title"),tabIndex:Q?null:-1,ref:tt,title:"string"==typeof c?c:null,"data-menu-id":j&&L?null:L,"aria-expanded":ot,"aria-haspopup":!0,"aria-controls":St,"aria-disabled":Q,onClick:function(t){Q||(null==A||A({key:f,domEvent:t}),"inline"===z&&W(f,!it))},onFocus:function(){Y(f)}},dt),c,p.createElement(lt,{icon:"horizontal"!==z?rt:null,props:(0,o.Z)((0,o.Z)({},t),{},{isOpen:ot,isSubMenu:!0})},p.createElement("i",{className:"".concat($,"-arrow")}))),Mt=p.useRef(z);if("inline"!==z&&K.length>1?Mt.current="vertical":Mt.current=z,!j){var Tt=Mt.current;Et=p.createElement(Lt,{mode:Tt,prefixCls:$,visible:!g&&ot&&"inline"!==z,popupClassName:b,popupOffset:w,popup:p.createElement(E,{mode:"horizontal"===Tt?"vertical":Tt},p.createElement(wt,{id:St,ref:et},m)),disabled:Q,onVisibleChange:function(t){"inline"!==z&&W(f,t)}},Et)}var At=p.createElement(h.Z.Item,(0,r.Z)({role:"none"},I,{component:"li",style:n,className:l()($,"".concat($,"-").concat(z),a,(e={},(0,i.Z)(e,"".concat($,"-open"),ot),(0,i.Z)(e,"".concat($,"-active"),bt),(0,i.Z)(e,"".concat($,"-selected"),at),(0,i.Z)(e,"".concat($,"-disabled"),Q),e)),onMouseEnter:function(t){yt(!0),null==M||M({key:f,domEvent:t})},onMouseLeave:function(t){yt(!1),null==T||T({key:f,domEvent:t})}}),Et,!j&&p.createElement(Rt,{id:St,open:ot,keyPath:K},m));return q&&(At=q(At,t,{selected:at,active:bt,open:ot,disabled:Q})),p.createElement(E,{onItemClick:_t,mode:"horizontal"===z?"vertical":z,itemIcon:nt,expandIcon:rt},At)};function jt(t){var e,n=t.eventKey,r=t.children,i=k(n),o=Mt(r,i),a=A();return p.useEffect((function(){if(a)return a.registerPath(n,i),function(){a.unregisterPath(n,i)}}),[i]),e=a?o:p.createElement(Bt,t,o),p.createElement(C.Provider,{value:i},e)}var Ut=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Vt=[],Ht=p.forwardRef((function(t,e){var n,c,d=t,m=d.prefixCls,x=void 0===m?"rc-menu":m,w=d.rootClassName,_=d.style,S=d.className,M=d.tabIndex,A=void 0===M?0:M,C=d.items,k=d.children,P=d.direction,I=d.id,L=d.mode,D=void 0===L?"vertical":L,R=d.inlineCollapsed,z=d.disabled,F=d.disabledOverflow,B=d.subMenuOpenDelay,j=void 0===B?.1:B,U=d.subMenuCloseDelay,V=void 0===U?.1:U,H=d.forceSubMenuRender,G=d.defaultOpenKeys,Z=d.openKeys,W=d.activeKey,Y=d.defaultActiveFirst,X=d.selectable,K=void 0===X||X,nt=d.multiple,rt=void 0!==nt&&nt,it=d.defaultSelectedKeys,ot=d.selectedKeys,at=d.onSelect,st=d.onDeselect,ut=d.inlineIndent,lt=void 0===ut?24:ut,ht=d.motion,ft=d.defaultMotions,dt=d.triggerSubMenuAction,pt=void 0===dt?"hover":dt,gt=d.builtinPlacements,mt=d.itemIcon,yt=d.expandIcon,bt=d.overflowedIndicator,xt=void 0===bt?"...":bt,wt=d.overflowedIndicatorPopupClassName,_t=d.getPopupContainer,St=d.onClick,Et=d.onOpenChange,Mt=d.onKeyDown,Tt=(d.openAnimation,d.openTransitionName,d._internalRenderMenuItem),Ct=d._internalRenderSubMenuItem,kt=(0,u.Z)(d,Ut),Nt=p.useMemo((function(){return At(k,C,Vt)}),[k,C]),Ot=p.useState(!1),Pt=(0,s.Z)(Ot,2),It=Pt[0],Lt=Pt[1],Dt=p.useRef(),Rt=function(t){var e=(0,f.Z)(t,{value:t}),n=(0,s.Z)(e,2),r=n[0],i=n[1];return p.useEffect((function(){et+=1;var t="".concat(tt,"-").concat(et);i("rc-menu-uuid-".concat(t))}),[]),r}(I),zt="rtl"===P;var Ft=(0,f.Z)(G,{value:Z,postState:function(t){return t||Vt}}),Bt=(0,s.Z)(Ft,2),Ht=Bt[0],Gt=Bt[1],Zt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(){Gt(t),null==Et||Et(t)}e?(0,g.flushSync)(n):n()},Wt=p.useState(Ht),Yt=(0,s.Z)(Wt,2),qt=Yt[0],Xt=Yt[1],Kt=p.useRef(!1),$t=p.useMemo((function(){return"inline"!==D&&"vertical"!==D||!R?[D,!1]:["vertical",R]}),[D,R]),Qt=(0,s.Z)($t,2),Jt=Qt[0],te=Qt[1],ee="inline"===Jt,ne=p.useState(Jt),re=(0,s.Z)(ne,2),ie=re[0],oe=re[1],ae=p.useState(te),se=(0,s.Z)(ae,2),ue=se[0],ce=se[1];p.useEffect((function(){oe(Jt),ce(te),Kt.current&&(ee?Gt(qt):Zt(Vt))}),[Jt,te]);var le=p.useState(0),he=(0,s.Z)(le,2),fe=he[0],de=he[1],pe=fe>=Nt.length-1||"horizontal"!==ie||F;p.useEffect((function(){ee&&Xt(Ht)}),[Ht]),p.useEffect((function(){return Kt.current=!0,function(){Kt.current=!1}}),[]);var ge=Q(),me=ge.registerPath,ve=ge.unregisterPath,ye=ge.refreshOverflowKeys,be=ge.isSubPathKey,xe=ge.getKeyPath,we=ge.getKeys,_e=ge.getSubPathKeys,Se=p.useMemo((function(){return{registerPath:me,unregisterPath:ve}}),[me,ve]),Ee=p.useMemo((function(){return{isSubPathKey:be}}),[be]);p.useEffect((function(){ye(pe?Vt:Nt.slice(fe+1).map((function(t){return t.key})))}),[fe,pe]);var Me=(0,f.Z)(W||Y&&(null===(n=Nt[0])||void 0===n?void 0:n.key),{value:W}),Te=(0,s.Z)(Me,2),Ae=Te[0],Ce=Te[1],ke=J((function(t){Ce(t)})),Ne=J((function(){Ce(void 0)}));(0,p.useImperativeHandle)(e,(function(){return{list:Dt.current,focus:function(t){var e,n,r,i,o=null!=Ae?Ae:null===(e=Nt.find((function(t){return!t.props.disabled})))||void 0===e?void 0:e.key;o&&(null===(n=Dt.current)||void 0===n||null===(r=n.querySelector("li[data-menu-id='".concat(b(Rt,o),"']")))||void 0===r||null===(i=r.focus)||void 0===i||i.call(r,t))}}}));var Oe=(0,f.Z)(it||[],{value:ot,postState:function(t){return Array.isArray(t)?t:null==t?Vt:[t]}}),Pe=(0,s.Z)(Oe,2),Ie=Pe[0],Le=Pe[1],De=J((function(t){null==St||St(ct(t)),function(t){if(K){var e,n=t.key,r=Ie.includes(n);e=rt?r?Ie.filter((function(t){return t!==n})):[].concat((0,a.Z)(Ie),[n]):[n],Le(e);var i=(0,o.Z)((0,o.Z)({},t),{},{selectedKeys:e});r?null==st||st(i):null==at||at(i)}!rt&&Ht.length&&"inline"!==ie&&Zt(Vt)}(t)})),Re=J((function(t,e){var n=Ht.filter((function(e){return e!==t}));if(e)n.push(t);else if("inline"!==ie){var r=_e(t);n=n.filter((function(t){return!r.has(t)}))}v()(Ht,n)||Zt(n,!0)})),ze=J(_t),Fe=q(ie,Ae,zt,Rt,Dt,we,xe,Ce,(function(t,e){var n=null!=e?e:!Ht.includes(t);Re(t,n)}),Mt);p.useEffect((function(){Lt(!0)}),[]);var Be=p.useMemo((function(){return{_internalRenderMenuItem:Tt,_internalRenderSubMenuItem:Ct}}),[Tt,Ct]),je="horizontal"!==ie||F?Nt:Nt.map((function(t,e){return p.createElement(E,{key:t.key,overflowDisabled:e>fe},t)})),Ue=p.createElement(h.Z,(0,r.Z)({id:I,ref:Dt,prefixCls:"".concat(x,"-overflow"),component:"ul",itemComponent:vt,className:l()(x,"".concat(x,"-root"),"".concat(x,"-").concat(ie),S,(c={},(0,i.Z)(c,"".concat(x,"-inline-collapsed"),ue),(0,i.Z)(c,"".concat(x,"-rtl"),zt),c),w),dir:P,style:_,role:"menu",tabIndex:A,data:je,renderRawItem:function(t){return t},renderRawRest:function(t){var e=t.length,n=e?Nt.slice(-e):null;return p.createElement(jt,{eventKey:$,title:xt,disabled:pe,internalPopupClose:0===e,popupClassName:wt},n)},maxCount:"horizontal"!==ie||F?h.Z.INVALIDATE:h.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(t){de(t)},onKeyDown:Fe},kt));return p.createElement(O.Provider,{value:Be},p.createElement(y.Provider,{value:Rt},p.createElement(E,{prefixCls:x,rootClassName:w,mode:ie,openKeys:Ht,rtl:zt,disabled:z,motion:It?ht:null,defaultMotions:It?ft:null,activeKey:Ae,onActive:ke,onInactive:Ne,selectedKeys:Ie,inlineIndent:lt,subMenuOpenDelay:j,subMenuCloseDelay:V,forceSubMenuRender:H,builtinPlacements:gt,triggerSubMenuAction:pt,getPopupContainer:ze,itemIcon:mt,expandIcon:yt,onItemClick:De,onOpenChange:Re},p.createElement(N.Provider,{value:Ee},Ue),p.createElement("div",{style:{display:"none"},"aria-hidden":!0},p.createElement(T.Provider,{value:Se},Nt)))))})),Gt=["className","title","eventKey","children"],Zt=["children"],Wt=function(t){var e=t.className,n=t.title,i=(t.eventKey,t.children),o=(0,u.Z)(t,Gt),a=p.useContext(S).prefixCls,s="".concat(a,"-item-group");return p.createElement("li",(0,r.Z)({},o,{onClick:function(t){return t.stopPropagation()},className:l()(s,e)}),p.createElement("div",{className:"".concat(s,"-title"),title:"string"==typeof n?n:void 0},n),p.createElement("ul",{className:"".concat(s,"-list")},i))};function Yt(t){var e=t.children,n=(0,u.Z)(t,Zt),r=Mt(e,k(n.eventKey));return A()?r:p.createElement(Wt,(0,at.Z)(n,["warnKey"]),r)}function qt(t){var e=t.className,n=t.style,r=p.useContext(S).prefixCls;return A()?null:p.createElement("li",{className:l()("".concat(r,"-item-divider"),e),style:n})}var Xt=Ht;Xt.Item=vt,Xt.SubMenu=jt,Xt.ItemGroup=Yt,Xt.Divider=qt;var Kt=Xt},63441:function(t,e,n){"use strict";n.d(e,{V:function(){return ct},Z:function(){return lt}});var r=n(4942),i=n(1413),o=n(29439),a=n(71002),s=n(67294),u=n(34203),c=n(42550),l=n(94184),h=n.n(l),f=n(98924);function d(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}var p,g,m,v=(p=(0,f.Z)(),g="undefined"!=typeof window?window:{},m={animationend:d("Animation","AnimationEnd"),transitionend:d("Transition","TransitionEnd")},p&&("AnimationEvent"in g||delete m.animationend.animation,"TransitionEvent"in g||delete m.transitionend.transition),m),y={};if((0,f.Z)()){var b=document.createElement("div");y=b.style}var x={};function w(t){if(x[t])return x[t];var e=v[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:2;e();var o=(0,F.Z)((function(){i<=1?r({isCanceled:function(){return o!==t.current}}):n(r,i-1)}));t.current=o},e]}(),c=(0,o.Z)(u,2),l=c[0],h=c[1];return B((function(){if(i!==P&&i!==R){var t=j.indexOf(i),n=j[t+1],r=e(i);false===r?a(n,!0):l((function(t){function e(){t.isCanceled()||a(n,!0)}!0===r?e():Promise.resolve(r).then(e)}))}}),[t,i]),s.useEffect((function(){return function(){h()}}),[]),[function(){a(I,!0)},i]};function H(t,e,n,a){var u=a.motionEnter,c=void 0===u||u,l=a.motionAppear,h=void 0===l||l,f=a.motionLeave,d=void 0===f||f,p=a.motionDeadline,g=a.motionLeaveImmediately,m=a.onAppearPrepare,v=a.onEnterPrepare,y=a.onLeavePrepare,b=a.onAppearStart,x=a.onEnterStart,w=a.onLeaveStart,_=a.onAppearActive,S=a.onEnterActive,E=a.onLeaveActive,A=a.onAppearEnd,P=a.onEnterEnd,R=a.onLeaveEnd,F=a.onVisibleChanged,j=(0,z.Z)(),H=(0,o.Z)(j,2),G=H[0],Z=H[1],W=(0,z.Z)(C),Y=(0,o.Z)(W,2),q=Y[0],X=Y[1],K=(0,z.Z)(null),$=(0,o.Z)(K,2),Q=$[0],J=$[1],tt=(0,s.useRef)(!1),et=(0,s.useRef)(null);function nt(){return n()}var rt=(0,s.useRef)(!1);function it(t){var e=nt();if(!t||t.deadline||t.target===e){var n,r=rt.current;q===k&&r?n=null==A?void 0:A(e,t):q===N&&r?n=null==P?void 0:P(e,t):q===O&&r&&(n=null==R?void 0:R(e,t)),q!==C&&r&&!1!==n&&(X(C,!0),J(null,!0))}}var ot=function(t){var e=(0,s.useRef)(),n=(0,s.useRef)(t);n.current=t;var r=s.useCallback((function(t){n.current(t)}),[]);function i(t){t&&(t.removeEventListener(T,r),t.removeEventListener(M,r))}return s.useEffect((function(){return function(){i(e.current)}}),[]),[function(t){e.current&&e.current!==t&&i(e.current),t&&t!==e.current&&(t.addEventListener(T,r),t.addEventListener(M,r),e.current=t)},i]}(it),at=(0,o.Z)(ot,1)[0],st=s.useMemo((function(){var t,e,n;switch(q){case k:return t={},(0,r.Z)(t,I,m),(0,r.Z)(t,L,b),(0,r.Z)(t,D,_),t;case N:return e={},(0,r.Z)(e,I,v),(0,r.Z)(e,L,x),(0,r.Z)(e,D,S),e;case O:return n={},(0,r.Z)(n,I,y),(0,r.Z)(n,L,w),(0,r.Z)(n,D,E),n;default:return{}}}),[q]),ut=V(q,(function(t){if(t===I){var e=st.prepare;return!!e&&e(nt())}var n;ht in st&&J((null===(n=st[ht])||void 0===n?void 0:n.call(st,nt(),null))||null);return ht===D&&(at(nt()),p>0&&(clearTimeout(et.current),et.current=setTimeout((function(){it({deadline:!0})}),p))),true})),ct=(0,o.Z)(ut,2),lt=ct[0],ht=ct[1],ft=U(ht);rt.current=ft,B((function(){Z(e);var n,r=tt.current;(tt.current=!0,t)&&(!r&&e&&h&&(n=k),r&&e&&c&&(n=N),(r&&!e&&d||!r&&g&&!e&&d)&&(n=O),n&&(X(n),lt()))}),[e]),(0,s.useEffect)((function(){(q===k&&!h||q===N&&!c||q===O&&!d)&&X(C)}),[h,c,d]),(0,s.useEffect)((function(){return function(){tt.current=!1,clearTimeout(et.current)}}),[]);var dt=s.useRef(!1);(0,s.useEffect)((function(){G&&(dt.current=!0),void 0!==G&&q===C&&((dt.current||G)&&(null==F||F(G)),dt.current=!0)}),[G,q]);var pt=Q;return st.prepare&&ht===L&&(pt=(0,i.Z)({transition:"none"},pt)),[q,ht,pt,null!=G?G:e]}var G=n(15671),Z=n(43144),W=n(79340),Y=n(98557),q=function(t){(0,W.Z)(n,t);var e=(0,Y.Z)(n);function n(){return(0,G.Z)(this,n),e.apply(this,arguments)}return(0,Z.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component),X=q;var K=function(t){var e=t;function n(t){return!(!t.motionName||!e)}"object"===(0,a.Z)(t)&&(e=t.transitionSupport);var l=s.forwardRef((function(t,e){var a=t.visible,l=void 0===a||a,f=t.removeOnLeave,d=void 0===f||f,p=t.forceRender,g=t.children,m=t.motionName,v=t.leavedClassName,y=t.eventProps,b=n(t),x=(0,s.useRef)(),w=(0,s.useRef)();var _=H(b,l,(function(){try{return x.current instanceof HTMLElement?x.current:(0,u.Z)(w.current)}catch(t){return null}}),t),S=(0,o.Z)(_,4),E=S[0],M=S[1],T=S[2],k=S[3],N=s.useRef(k);k&&(N.current=!0);var O,P=s.useCallback((function(t){x.current=t,(0,c.mH)(e,t)}),[e]),D=(0,i.Z)((0,i.Z)({},y),{},{visible:l});if(g)if(E!==C&&n(t)){var R,z;M===I?z="prepare":U(M)?z="active":M===L&&(z="start"),O=g((0,i.Z)((0,i.Z)({},D),{},{className:h()(A(m,E),(R={},(0,r.Z)(R,A(m,"".concat(E,"-").concat(z)),z),(0,r.Z)(R,m,"string"==typeof m),R)),style:T}),P)}else O=k?g((0,i.Z)({},D),P):!d&&N.current?g((0,i.Z)((0,i.Z)({},D),{},{className:v}),P):p?g((0,i.Z)((0,i.Z)({},D),{},{style:{display:"none"}}),P):null;else O=null;s.isValidElement(O)&&(0,c.Yr)(O)&&(O.ref||(O=s.cloneElement(O,{ref:P})));return s.createElement(X,{ref:w},O)}));return l.displayName="CSSMotion",l}(E),$=n(87462),Q=n(44925),J="add",tt="keep",et="remove",nt="removed";function rt(t){var e;return e=t&&"object"===(0,a.Z)(t)&&"key"in t?t:{key:t},(0,i.Z)((0,i.Z)({},e),{},{key:String(e.key)})}function it(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.map(rt)}function ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=e.length,a=it(t),s=it(e);a.forEach((function(t){for(var e=!1,a=r;a1}));return c.forEach((function(t){(n=n.filter((function(e){var n=e.key,r=e.status;return n!==t||r!==et}))).forEach((function(e){e.key===t&&(e.status=tt)}))})),n}var at=["component","children","onVisibleChanged","onAllRemoved"],st=["status"],ut=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];var ct=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K,n=function(t){(0,W.Z)(r,t);var n=(0,Y.Z)(r);function r(){var t;(0,G.Z)(this,r);for(var e=arguments.length,o=new Array(e),a=0;a0){var t=setTimeout((function(){E()}),1e3*c);return function(){clearTimeout(t)}}}),[c,_]);var M="".concat(n,"-notice");return a.createElement("div",(0,s.Z)({},v,{ref:e,className:f()(M,o,(0,d.Z)({},"".concat(M,"-closable"),p)),style:r,onMouseEnter:function(){S(!0)},onMouseLeave:function(){S(!1)},onClick:y}),a.createElement("div",{className:"".concat(M,"-content")},h),p&&a.createElement("a",{tabIndex:0,className:"".concat(M,"-close"),onClick:function(t){t.preventDefault(),t.stopPropagation(),E()}},m))}));var g=a.forwardRef((function(t,e){var n=t.prefixCls,o=void 0===n?"rc-notification":n,h=t.container,d=t.motion,g=t.maxCount,m=t.className,v=t.style,y=t.onAllRemoved,b=a.useState([]),x=(0,i.Z)(b,2),w=x[0],_=x[1],S=function(t){var e,n=w.find((function(e){return e.key===t}));null==n||null===(e=n.onClose)||void 0===e||e.call(n),_((function(e){return e.filter((function(e){return e.key!==t}))}))};a.useImperativeHandle(e,(function(){return{open:function(t){_((function(e){var n=(0,r.Z)(e),i=n.findIndex((function(e){return e.key===t.key}));return i>=0?n[i]=t:n.push(t),g>0&&n.length>g&&(n=n.slice(-g)),n}))},close:function(t){S(t)},destroy:function(){_([])}}}));var E=a.useState({}),M=(0,i.Z)(E,2),T=M[0],A=M[1];a.useEffect((function(){var t={};w.forEach((function(e){var n=e.placement,r=void 0===n?"topRight":n;r&&(t[r]=t[r]||[],t[r].push(e))})),Object.keys(T).forEach((function(e){t[e]=t[e]||[]})),A(t)}),[w]);var C=a.useRef(!1);if(a.useEffect((function(){Object.keys(T).length>0?C.current=!0:C.current&&(null==y||y(),C.current=!1)}),[T]),!h)return null;var k=Object.keys(T);return(0,c.createPortal)(a.createElement(a.Fragment,null,k.map((function(t){var e=T[t].map((function(t){return{config:t,key:t.key}})),n="function"==typeof d?d(t):d;return a.createElement(l.V,(0,s.Z)({key:t,className:f()(o,"".concat(o,"-").concat(t),null==m?void 0:m(t)),style:null==v?void 0:v(t),keys:e,motionAppear:!0},n,{onAllRemoved:function(){!function(t){A((function(e){var n=(0,u.Z)({},e);return(n[t]||[]).length||delete n[t],n}))}(t)}}),(function(t,e){var n=t.config,r=t.className,i=t.style,c=n.key,l=n.className,h=n.style;return a.createElement(p,(0,s.Z)({},n,{ref:e,prefixCls:o,className:f()(r,l),style:(0,u.Z)((0,u.Z)({},i),h),key:c,eventKey:c,onNoticeClose:S}))}))}))),h)})),m=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved"],v=function(){return document.body},y=0;function b(){for(var t={},e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=t.getContainer,n=void 0===e?v:e,s=t.motion,u=t.prefixCls,c=t.maxCount,l=t.className,h=t.style,f=t.onAllRemoved,d=(0,o.Z)(t,m),p=a.useState(),x=(0,i.Z)(p,2),w=x[0],_=x[1],S=a.useRef(),E=a.createElement(g,{container:w,ref:S,prefixCls:u,motion:s,maxCount:c,className:l,style:h,onAllRemoved:f}),M=a.useState([]),T=(0,i.Z)(M,2),A=T[0],C=T[1],k=a.useMemo((function(){return{open:function(t){var e=b(d,t);null!==e.key&&void 0!==e.key||(e.key="rc-notification-".concat(y),y+=1),C((function(t){return[].concat((0,r.Z)(t),[{type:"open",config:e}])}))},close:function(t){C((function(e){return[].concat((0,r.Z)(e),[{type:"close",key:t}])}))},destroy:function(){C((function(t){return[].concat((0,r.Z)(t),[{type:"destroy"}])}))}}}),[]);return a.useEffect((function(){_(n())})),a.useEffect((function(){S.current&&A.length&&(A.forEach((function(t){switch(t.type){case"open":S.current.open(t.config);break;case"close":S.current.close(t.key);break;case"destroy":S.current.destroy()}})),C([]))}),[A]),[k,E]}},19214:function(t,e,n){"use strict";n.d(e,{Z:function(){return P}});var r=n(87462),i=n(1413),o=n(29439),a=n(44925),s=n(67294),u=n(94184),c=n.n(u),l=n(48717),h=n(8410),f=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],d=void 0;function p(t,e){var n=t.prefixCls,o=t.invalidate,u=t.item,h=t.renderItem,p=t.responsive,g=t.responsiveDisabled,m=t.registerSize,v=t.itemKey,y=t.className,b=t.style,x=t.children,w=t.display,_=t.order,S=t.component,E=void 0===S?"div":S,M=(0,a.Z)(t,f),T=p&&!w;function A(t){m(v,t)}s.useEffect((function(){return function(){A(null)}}),[]);var C,k=h&&u!==d?h(u):x;o||(C={opacity:T?0:1,height:T?0:d,overflowY:T?"hidden":d,order:p?_:d,pointerEvents:T?"none":d,position:T?"absolute":d});var N={};T&&(N["aria-hidden"]=!0);var O=s.createElement(E,(0,r.Z)({className:c()(!o&&n,y),style:(0,i.Z)((0,i.Z)({},C),b)},N,M,{ref:e}),k);return p&&(O=s.createElement(l.Z,{onResize:function(t){A(t.offsetWidth)},disabled:g},O)),O}var g=s.forwardRef(p);g.displayName="Item";var m=g,v=n(75164),y=n(30470);var b=["component"],x=["className"],w=["className"],_=function(t,e){var n=s.useContext(T);if(!n){var i=t.component,o=void 0===i?"div":i,u=(0,a.Z)(t,b);return s.createElement(o,(0,r.Z)({},u,{ref:e}))}var l=n.className,h=(0,a.Z)(n,x),f=t.className,d=(0,a.Z)(t,w);return s.createElement(T.Provider,{value:null},s.createElement(m,(0,r.Z)({ref:e,className:c()(l,f)},h,d)))},S=s.forwardRef(_);S.displayName="RawItem";var E=S,M=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],T=s.createContext(null),A="responsive",C="invalidate";function k(t){return"+ ".concat(t.length," ...")}function N(t,e){var n=t.prefixCls,u=void 0===n?"rc-overflow":n,f=t.data,d=void 0===f?[]:f,p=t.renderItem,g=t.renderRawItem,b=t.itemKey,x=t.itemWidth,w=void 0===x?10:x,_=t.ssr,S=t.style,E=t.className,N=t.maxCount,O=t.renderRest,P=t.renderRawRest,I=t.suffix,L=t.component,D=void 0===L?"div":L,R=t.itemComponent,z=t.onVisibleChange,F=(0,a.Z)(t,M),B=function(){var t=(0,y.Z)({}),e=(0,o.Z)(t,2)[1],n=(0,s.useRef)([]),r=0,i=0;return function(t){var o=r;return r+=1,n.current.lengthN,At=(0,s.useMemo)((function(){var t=d;return Et?t=null===H&&j?d:d.slice(0,Math.min(d.length,Z/w)):"number"==typeof N&&(t=d.slice(0,N)),t}),[d,w,H,N,Et]),Ct=(0,s.useMemo)((function(){return Et?d.slice(mt+1):d.slice(At.length)}),[d,At,Et,mt]),kt=(0,s.useCallback)((function(t,e){var n;return"function"==typeof b?b(t):null!==(n=b&&(null==t?void 0:t[b]))&&void 0!==n?n:e}),[b]),Nt=(0,s.useCallback)(p||function(t){return t},[p]);function Ot(t,e,n){(pt!==t||void 0!==e&&e!==lt)&&(gt(t),n||(xt(tZ){Ot(r-1,t-i-at+nt);break}}I&&It(0)+at>Z&&ht(null)}}),[Z,q,nt,at,kt,At]);var Lt=bt&&!!Ct.length,Dt={};null!==lt&&Et&&(Dt={position:"absolute",left:lt,top:0});var Rt,zt={prefixCls:wt,responsive:Et,component:R,invalidate:Mt},Ft=g?function(t,e){var n=kt(t,e);return s.createElement(T.Provider,{key:n,value:(0,i.Z)((0,i.Z)({},zt),{},{order:e,item:t,itemKey:n,registerSize:Pt,display:e<=mt})},g(t,e))}:function(t,e){var n=kt(t,e);return s.createElement(m,(0,r.Z)({},zt,{order:e,key:n,item:t,renderItem:Nt,itemKey:n,registerSize:Pt,display:e<=mt}))},Bt={order:Lt?mt:Number.MAX_SAFE_INTEGER,className:"".concat(wt,"-rest"),registerSize:function(t,e){rt(e),J(nt)},display:Lt};if(P)P&&(Rt=s.createElement(T.Provider,{value:(0,i.Z)((0,i.Z)({},zt),Bt)},P(Ct)));else{var jt=O||k;Rt=s.createElement(m,(0,r.Z)({},zt,Bt),"function"==typeof jt?jt(Ct):jt)}var Ut=s.createElement(D,(0,r.Z)({className:c()(!Mt&&u,E),style:S,ref:e},F),At.map(Ft),Tt?Rt:null,I&&s.createElement(m,(0,r.Z)({},zt,{responsive:St,responsiveDisabled:!Et,order:mt,className:"".concat(wt,"-suffix"),registerSize:function(t,e){st(e)},display:!0,style:Dt}),I));return St&&(Ut=s.createElement(l.Z,{onResize:function(t,e){G(e.clientWidth)},disabled:!Et},Ut)),Ut}var O=s.forwardRef(N);O.displayName="Overflow",O.Item=E,O.RESPONSIVE=A,O.INVALIDATE=C;var P=O},62906:function(t,e){"use strict";e.Z={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"}},18758:function(t,e){"use strict";e.Z={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"}},43094:function(t,e,n){"use strict";n.d(e,{Cd:function(){return E}});var r=n(87462),i=n(44925),o=n(67294),a=n(94184),s=n.n(a),u={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},c=function(){var t=(0,o.useRef)([]),e=(0,o.useRef)(null);return(0,o.useEffect)((function(){var n=Date.now(),r=!1;t.current.forEach((function(t){if(t){r=!0;var i=t.style;i.transitionDuration=".3s, .3s, .3s, .06s",e.current&&n-e.current<100&&(i.transitionDuration="0s, 0s")}})),r&&(e.current=Date.now())})),t.current},l=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],h=function(t){var e=t.className,n=t.percent,a=t.prefixCls,u=t.strokeColor,h=t.strokeLinecap,f=t.strokeWidth,d=t.style,p=t.trailColor,g=t.trailWidth,m=t.transition,v=(0,i.Z)(t,l);delete v.gapPosition;var y=Array.isArray(n)?n:[n],b=Array.isArray(u)?u:[u],x=c(),w=f/2,_=100-f/2,S="M ".concat("round"===h?w:0,",").concat(w,"\n L ").concat("round"===h?_:100,",").concat(w),E="0 0 100 ".concat(f),M=0;return o.createElement("svg",(0,r.Z)({className:s()("".concat(a,"-line"),e),viewBox:E,preserveAspectRatio:"none",style:d},v),o.createElement("path",{className:"".concat(a,"-line-trail"),d:S,strokeLinecap:h,stroke:p,strokeWidth:g||f,fillOpacity:"0"}),y.map((function(t,e){var n=1;switch(h){case"round":n=1-f/100;break;case"square":n=1-f/2/100;break;default:n=1}var r={strokeDasharray:"".concat(t*n,"px, 100px"),strokeDashoffset:"-".concat(M,"px"),transition:m||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},i=b[e]||b[b.length-1];return M+=t,o.createElement("path",{key:e,className:"".concat(a,"-line-path"),d:S,strokeLinecap:h,stroke:i,strokeWidth:f,fillOpacity:"0",ref:function(t){x[e]=t},style:r})})))};h.defaultProps=u,h.displayName="Line";var f=n(71002),d=n(29439),p=n(98924),g=0,m=(0,p.Z)();var v=function(t){var e=o.useState(),n=(0,d.Z)(e,2),r=n[0],i=n[1];return o.useEffect((function(){var t;i("rc_progress_".concat((m?(t=g,g+=1):t="TEST_OR_SSR",t)))}),[]),t||r},y=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function b(t){return+t.replace("%","")}function x(t){var e=null!=t?t:[];return Array.isArray(e)?e:[e]}var w=100,_=function(t,e,n,r,i,o,a,s,u,c){var l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,h=n/100*360*((360-o)/360),f=0===o?0:{bottom:0,top:180,left:90,right:-90}[a],d=(100-r)/100*e;return"round"===u&&100!==r&&(d+=c/2)>=e&&(d=e-.01),{stroke:"string"==typeof s?s:void 0,strokeDasharray:"".concat(e,"px ").concat(t),strokeDashoffset:d+l,transform:"rotate(".concat(i+h+f,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},S=function(t){var e,n,a,u=t.id,l=t.prefixCls,h=t.steps,d=t.strokeWidth,p=t.trailWidth,g=t.gapDegree,m=void 0===g?0:g,S=t.gapPosition,E=t.trailColor,M=t.strokeLinecap,T=t.style,A=t.className,C=t.strokeColor,k=t.percent,N=(0,i.Z)(t,y),O=v(u),P="".concat(O,"-gradient"),I=50-d/2,L=2*Math.PI*I,D=m>0?90+m/2:-90,R=L*((360-m)/360),z="object"===(0,f.Z)(h)?h:{count:h,space:2},F=z.count,B=z.space,j=_(L,R,0,100,D,m,S,E,M,d),U=x(k),V=x(C),H=V.find((function(t){return t&&"object"===(0,f.Z)(t)})),G=c();return o.createElement("svg",(0,r.Z)({className:s()("".concat(l,"-circle"),A),viewBox:"".concat(-50," ").concat(-50," ").concat(w," ").concat(w),style:T,id:u,role:"presentation"},N),H&&o.createElement("defs",null,o.createElement("linearGradient",{id:P,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(H).sort((function(t,e){return b(t)-b(e)})).map((function(t,e){return o.createElement("stop",{key:e,offset:t,stopColor:H[t]})})))),!F&&o.createElement("circle",{className:"".concat(l,"-circle-trail"),r:I,cx:0,cy:0,stroke:E,strokeLinecap:M,strokeWidth:p||d,style:j}),F?(e=Math.round(F*(U[0]/100)),n=100/F,a=0,new Array(F).fill(null).map((function(t,r){var i=r<=e-1?V[0]:E,s=i&&"object"===(0,f.Z)(i)?"url(#".concat(P,")"):void 0,u=_(L,R,a,n,D,m,S,i,"butt",d,B);return a+=100*(R-u.strokeDashoffset+B)/R,o.createElement("circle",{key:r,className:"".concat(l,"-circle-path"),r:I,cx:0,cy:0,stroke:s,strokeWidth:d,opacity:1,style:u,ref:function(t){G[r]=t}})}))):function(){var t=0;return U.map((function(e,n){var r=V[n]||V[V.length-1],i=r&&"object"===(0,f.Z)(r)?"url(#".concat(P,")"):void 0,a=_(L,R,t,e,D,m,S,r,M,d);return t+=e,o.createElement("circle",{key:n,className:"".concat(l,"-circle-path"),r:I,cx:0,cy:0,stroke:i,strokeLinecap:M,strokeWidth:d,opacity:0===e?0:1,style:a,ref:function(t){G[n]=t}})})).reverse()}())};S.defaultProps=u,S.displayName="Circle";var E=S},48717:function(t,e,n){"use strict";n.d(e,{Z:function(){return x}});var r=n(87462),i=n(67294),o=n(50344),a=(n(80334),n(1413)),s=n(42550),u=n(34203),c=n(91033),l=new Map;var h=new c.Z((function(t){t.forEach((function(t){var e,n=t.target;null===(e=l.get(n))||void 0===e||e.forEach((function(t){return t(n)}))}))}));var f=n(15671),d=n(43144),p=n(79340),g=n(98557),m=function(t){(0,p.Z)(n,t);var e=(0,g.Z)(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(i.Component),v=i.createContext(null);function y(t){var e=t.children,n=t.disabled,r=i.useRef(null),o=i.useRef(null),c=i.useContext(v),f="function"==typeof e,d=f?e(r):e,p=i.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),g=!f&&i.isValidElement(d)&&(0,s.Yr)(d),y=g?d.ref:null,b=i.useMemo((function(){return(0,s.sQ)(y,r)}),[y,r]),x=i.useRef(t);x.current=t;var w=i.useCallback((function(t){var e=x.current,n=e.onResize,r=e.data,i=t.getBoundingClientRect(),o=i.width,s=i.height,u=t.offsetWidth,l=t.offsetHeight,h=Math.floor(o),f=Math.floor(s);if(p.current.width!==h||p.current.height!==f||p.current.offsetWidth!==u||p.current.offsetHeight!==l){var d={width:h,height:f,offsetWidth:u,offsetHeight:l};p.current=d;var g=u===Math.round(o)?o:u,m=l===Math.round(s)?s:l,v=(0,a.Z)((0,a.Z)({},d),{},{offsetWidth:g,offsetHeight:m});null==c||c(v,t,r),n&&Promise.resolve().then((function(){n(v,t)}))}}),[]);return i.useEffect((function(){var t,e,i=(0,u.Z)(r.current)||(0,u.Z)(o.current);return i&&!n&&(t=i,e=w,l.has(t)||(l.set(t,new Set),h.observe(t)),l.get(t).add(e)),function(){return function(t,e){l.has(t)&&(l.get(t).delete(e),l.get(t).size||(h.unobserve(t),l.delete(t)))}(i,w)}}),[r.current,n]),i.createElement(m,{ref:o},g?i.cloneElement(d,{ref:b}):d)}function b(t){var e=t.children;return("function"==typeof e?[e]:(0,o.Z)(e)).map((function(e,n){var o=(null==e?void 0:e.key)||"".concat("rc-observer-key","-").concat(n);return i.createElement(y,(0,r.Z)({},t,{key:o}),e)}))}b.Collection=function(t){var e=t.children,n=t.onBatchResize,r=i.useRef(0),o=i.useRef([]),a=i.useContext(v),s=i.useCallback((function(t,e,i){r.current+=1;var s=r.current;o.current.push({size:t,element:e,data:i}),Promise.resolve().then((function(){s===r.current&&(null==n||n(o.current),o.current=[])})),null==a||a(t,e,i)}),[n,a]);return i.createElement(v.Provider,{value:s},e)};var x=b},51488:function(t,e,n){"use strict";n.d(e,{Xo:function(){return ht},Wx:function(){return dt},ZP:function(){return qt}});var r=n(87462),i=n(93433),o=n(4942),a=n(1413),s=n(29439),u=n(44925),c=n(71002),l=n(21770),h=n(80334),f=n(67294),d=n(94184),p=n.n(d),g=n(8410),m=n(31131),v=n(15105),y=n(42550),b=f.createContext(null);function x(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,e=f.useRef(null),n=f.useRef(null);function r(r){(r||null===e.current)&&(e.current=r),window.clearTimeout(n.current),n.current=window.setTimeout((function(){e.current=null}),t)}return f.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return e.current},r]}var w=n(64217),_=n(19214),S=function(t){var e,n=t.className,r=t.customizeIcon,i=t.customizeIconProps,o=t.onMouseDown,a=t.onClick,s=t.children;return e="function"==typeof r?r(i):r,f.createElement("span",{className:n,onMouseDown:function(t){t.preventDefault(),o&&o(t)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==e?e:f.createElement("span",{className:p()(n.split(/\s+/).map((function(t){return"".concat(t,"-icon")})))},s))},E=function(t,e){var n,r,i=t.prefixCls,o=t.id,s=t.inputElement,u=t.disabled,c=t.tabIndex,l=t.autoFocus,d=t.autoComplete,g=t.editable,m=t.activeDescendantId,v=t.value,b=t.maxLength,x=t.onKeyDown,w=t.onMouseDown,_=t.onChange,S=t.onPaste,E=t.onCompositionStart,M=t.onCompositionEnd,T=t.open,A=t.attrs,C=s||f.createElement("input",null),k=C,N=k.ref,O=k.props,P=O.onKeyDown,I=O.onChange,L=O.onMouseDown,D=O.onCompositionStart,R=O.onCompositionEnd,z=O.style;return(0,h.Kp)(!("maxLength"in C.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),C=f.cloneElement(C,(0,a.Z)((0,a.Z)((0,a.Z)({type:"search"},O),{},{id:o,ref:(0,y.sQ)(e,N),disabled:u,tabIndex:c,autoComplete:d||"off",autoFocus:l,className:p()("".concat(i,"-selection-search-input"),null===(n=C)||void 0===n||null===(r=n.props)||void 0===r?void 0:r.className),role:"combobox","aria-expanded":T,"aria-haspopup":"listbox","aria-owns":"".concat(o,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(o,"_list"),"aria-activedescendant":m},A),{},{value:g?v:"",maxLength:b,readOnly:!g,unselectable:g?null:"on",style:(0,a.Z)((0,a.Z)({},z),{},{opacity:g?null:0}),onKeyDown:function(t){x(t),P&&P(t)},onMouseDown:function(t){w(t),L&&L(t)},onChange:function(t){_(t),I&&I(t)},onCompositionStart:function(t){E(t),D&&D(t)},onCompositionEnd:function(t){M(t),R&&R(t)},onPaste:S}))},M=f.forwardRef(E);M.displayName="Input";var T=M;function A(t){return Array.isArray(t)?t:void 0!==t?[t]:[]}var C="undefined"!=typeof window&&window.document&&window.document.documentElement;function k(t){return["string","number"].includes((0,c.Z)(t))}function N(t){var e=void 0;return t&&(k(t.title)?e=t.title.toString():k(t.label)&&(e=t.label.toString())),e}function O(t){var e;return null!==(e=t.key)&&void 0!==e?e:t.value}var P=function(t){t.preventDefault(),t.stopPropagation()},I=function(t){var e,n,r=t.id,i=t.prefixCls,a=t.values,u=t.open,c=t.searchValue,l=t.autoClearSearchValue,h=t.inputRef,d=t.placeholder,g=t.disabled,m=t.mode,v=t.showSearch,y=t.autoFocus,b=t.autoComplete,x=t.activeDescendantId,E=t.tabIndex,M=t.removeIcon,A=t.maxTagCount,k=t.maxTagTextLength,I=t.maxTagPlaceholder,L=void 0===I?function(t){return"+ ".concat(t.length," ...")}:I,D=t.tagRender,R=t.onToggleOpen,z=t.onRemove,F=t.onInputChange,B=t.onInputPaste,j=t.onInputKeyDown,U=t.onInputMouseDown,V=t.onInputCompositionStart,H=t.onInputCompositionEnd,G=f.useRef(null),Z=(0,f.useState)(0),W=(0,s.Z)(Z,2),Y=W[0],q=W[1],X=(0,f.useState)(!1),K=(0,s.Z)(X,2),$=K[0],Q=K[1],J="".concat(i,"-selection"),tt=u||"multiple"===m&&!1===l||"tags"===m?c:"",et="tags"===m||"multiple"===m&&!1===l||v&&(u||$);function nt(t,e,n,r,i){return f.createElement("span",{className:p()("".concat(J,"-item"),(0,o.Z)({},"".concat(J,"-item-disabled"),n)),title:N(t)},f.createElement("span",{className:"".concat(J,"-item-content")},e),r&&f.createElement(S,{className:"".concat(J,"-item-remove"),onMouseDown:P,onClick:i,customizeIcon:M},"×"))}e=function(){q(G.current.scrollWidth)},n=[tt],C?f.useLayoutEffect(e,n):f.useEffect(e,n);var rt=f.createElement("div",{className:"".concat(J,"-search"),style:{width:Y},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},f.createElement(T,{ref:h,open:u,prefixCls:i,id:r,inputElement:null,disabled:g,autoFocus:y,autoComplete:b,editable:et,activeDescendantId:x,value:tt,onKeyDown:j,onMouseDown:U,onChange:F,onPaste:B,onCompositionStart:V,onCompositionEnd:H,tabIndex:E,attrs:(0,w.Z)(t,!0)}),f.createElement("span",{ref:G,className:"".concat(J,"-search-mirror"),"aria-hidden":!0},tt," ")),it=f.createElement(_.Z,{prefixCls:"".concat(J,"-overflow"),data:a,renderItem:function(t){var e=t.disabled,n=t.label,r=t.value,i=!g&&!e,o=n;if("number"==typeof k&&("string"==typeof n||"number"==typeof n)){var a=String(o);a.length>k&&(o="".concat(a.slice(0,k),"..."))}var s=function(e){e&&e.stopPropagation(),z(t)};return"function"==typeof D?function(t,e,n,r,i){return f.createElement("span",{onMouseDown:function(t){P(t),R(!u)}},D({label:e,value:t,disabled:n,closable:r,onClose:i}))}(r,o,e,i,s):nt(t,o,e,i,s)},renderRest:function(t){var e="function"==typeof L?L(t):L;return nt({title:e},e,!1)},suffix:rt,itemKey:O,maxCount:A});return f.createElement(f.Fragment,null,it,!a.length&&!tt&&f.createElement("span",{className:"".concat(J,"-placeholder")},d))},L=function(t){var e=t.inputElement,n=t.prefixCls,r=t.id,i=t.inputRef,o=t.disabled,a=t.autoFocus,u=t.autoComplete,c=t.activeDescendantId,l=t.mode,h=t.open,d=t.values,p=t.placeholder,g=t.tabIndex,m=t.showSearch,v=t.searchValue,y=t.activeValue,b=t.maxLength,x=t.onInputKeyDown,_=t.onInputMouseDown,S=t.onInputChange,E=t.onInputPaste,M=t.onInputCompositionStart,A=t.onInputCompositionEnd,C=f.useState(!1),k=(0,s.Z)(C,2),O=k[0],P=k[1],I="combobox"===l,L=I||m,D=d[0],R=v||"";I&&y&&!O&&(R=y),f.useEffect((function(){I&&P(!1)}),[I,y]);var z=!("combobox"!==l&&!h&&!m)&&!!R,F=N(D);return f.createElement(f.Fragment,null,f.createElement("span",{className:"".concat(n,"-selection-search")},f.createElement(T,{ref:i,prefixCls:n,id:r,open:h,inputElement:e,disabled:o,autoFocus:a,autoComplete:u,editable:L,activeDescendantId:c,value:R,onKeyDown:x,onMouseDown:_,onChange:function(t){P(!0),S(t)},onPaste:E,onCompositionStart:M,onCompositionEnd:A,tabIndex:g,attrs:(0,w.Z)(t,!0),maxLength:I?b:void 0})),!I&&D&&!z&&f.createElement("span",{className:"".concat(n,"-selection-item"),title:F},D.label),function(){if(D)return null;var t=z?{visibility:"hidden"}:void 0;return f.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:t},p)}())};var D=function(t,e){var n=(0,f.useRef)(null),i=(0,f.useRef)(!1),o=t.prefixCls,a=t.open,u=t.mode,c=t.showSearch,l=t.tokenWithEnter,h=t.autoClearSearchValue,d=t.onSearch,p=t.onSearchSubmit,g=t.onToggleOpen,m=t.onInputKeyDown,y=t.domRef;f.useImperativeHandle(e,(function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}}));var b=x(0),w=(0,s.Z)(b,2),_=w[0],S=w[1],E=(0,f.useRef)(null),M=function(t){!1!==d(t,!0,i.current)&&g(!0)},T={inputRef:n,onInputKeyDown:function(t){var e,n=t.which;n!==v.Z.UP&&n!==v.Z.DOWN||t.preventDefault(),m&&m(t),n!==v.Z.ENTER||"tags"!==u||i.current||a||null==p||p(t.target.value),e=n,[v.Z.ESC,v.Z.SHIFT,v.Z.BACKSPACE,v.Z.TAB,v.Z.WIN_KEY,v.Z.ALT,v.Z.META,v.Z.WIN_KEY_RIGHT,v.Z.CTRL,v.Z.SEMICOLON,v.Z.EQUALS,v.Z.CAPS_LOCK,v.Z.CONTEXT_MENU,v.Z.F1,v.Z.F2,v.Z.F3,v.Z.F4,v.Z.F5,v.Z.F6,v.Z.F7,v.Z.F8,v.Z.F9,v.Z.F10,v.Z.F11,v.Z.F12].includes(e)||g(!0)},onInputMouseDown:function(){S(!0)},onInputChange:function(t){var e=t.target.value;if(l&&E.current&&/[\r\n]/.test(E.current)){var n=E.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");e=e.replace(n,E.current)}E.current=null,M(e)},onInputPaste:function(t){var e=t.clipboardData.getData("text");E.current=e},onInputCompositionStart:function(){i.current=!0},onInputCompositionEnd:function(t){i.current=!1,"combobox"!==u&&M(t.target.value)}},A="multiple"===u||"tags"===u?f.createElement(I,(0,r.Z)({},t,T)):f.createElement(L,(0,r.Z)({},t,T));return f.createElement("div",{ref:y,className:"".concat(o,"-selector"),onClick:function(t){t.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(t){var e=_();t.target===n.current||e||"combobox"===u||t.preventDefault(),("combobox"===u||c&&e)&&a||(a&&!1!==h&&d("",!0,!1),g())}},A)},R=f.forwardRef(D);R.displayName="Selector";var z=R,F=n(99224),B=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],j=function(t,e){var n=t.prefixCls,i=(t.disabled,t.visible),s=t.children,c=t.popupElement,l=t.containerWidth,h=t.animation,d=t.transitionName,g=t.dropdownStyle,m=t.dropdownClassName,v=t.direction,y=void 0===v?"ltr":v,b=t.placement,x=t.dropdownMatchSelectWidth,w=t.dropdownRender,_=t.dropdownAlign,S=t.getPopupContainer,E=t.empty,M=t.getTriggerDOMNode,T=t.onPopupVisibleChange,A=t.onPopupMouseEnter,C=(0,u.Z)(t,B),k="".concat(n,"-dropdown"),N=c;w&&(N=w(c));var O=f.useMemo((function(){return function(t){var e=!0===t?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:e,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:e,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:e,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:e,adjustY:1}}}}(x)}),[x]),P=h?"".concat(k,"-").concat(h):d,I=f.useRef(null);f.useImperativeHandle(e,(function(){return{getPopupElement:function(){return I.current}}}));var L=(0,a.Z)({minWidth:l},g);return"number"==typeof x?L.width=x:x&&(L.width=l),f.createElement(F.Z,(0,r.Z)({},C,{showAction:T?["click"]:[],hideAction:T?["click"]:[],popupPlacement:b||("rtl"===y?"bottomRight":"bottomLeft"),builtinPlacements:O,prefixCls:k,popupTransitionName:P,popup:f.createElement("div",{ref:I,onMouseEnter:A},N),popupAlign:_,popupVisible:i,getPopupContainer:S,popupClassName:p()(m,(0,o.Z)({},"".concat(k,"-empty"),E)),popupStyle:L,getTriggerDOMNode:M,onPopupVisibleChange:T}),s)},U=f.forwardRef(j);U.displayName="SelectTrigger";var V=U,H=n(84506);function G(t,e){var n,r=t.key;return"value"in t&&(n=t.value),null!=r?r:void 0!==n?n:"rc-index-key-".concat(e)}function Z(t,e){var n=t||{};return{label:n.label||(e?"children":"label"),value:n.value||"value",options:n.options||"options"}}function W(t){var e=(0,a.Z)({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return(0,h.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var Y=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],q=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function X(t){return"tags"===t||"multiple"===t}var K=f.forwardRef((function(t,e){var n,h,d=t.id,w=t.prefixCls,_=t.className,E=t.showSearch,M=t.tagRender,T=t.direction,A=t.omitDomProps,C=t.displayValues,k=t.onDisplayValuesChange,N=t.emptyOptions,O=t.notFoundContent,P=void 0===O?"Not Found":O,I=t.onClear,L=t.mode,D=t.disabled,R=t.loading,F=t.getInputElement,B=t.getRawInputElement,j=t.open,U=t.defaultOpen,G=t.onDropdownVisibleChange,Z=t.activeValue,W=t.onActiveValueChange,K=t.activeDescendantId,$=t.searchValue,Q=t.autoClearSearchValue,J=t.onSearch,tt=t.onSearchSplit,et=t.tokenSeparators,nt=t.allowClear,rt=t.showArrow,it=t.inputIcon,ot=t.clearIcon,at=t.OptionList,st=t.animation,ut=t.transitionName,ct=t.dropdownStyle,lt=t.dropdownClassName,ht=t.dropdownMatchSelectWidth,ft=t.dropdownRender,dt=t.dropdownAlign,pt=t.placement,gt=t.getPopupContainer,mt=t.showAction,vt=void 0===mt?[]:mt,yt=t.onFocus,bt=t.onBlur,xt=t.onKeyUp,wt=t.onKeyDown,_t=t.onMouseDown,St=(0,u.Z)(t,Y),Et=X(L),Mt=(void 0!==E?E:Et)||"combobox"===L,Tt=(0,a.Z)({},St);q.forEach((function(t){delete Tt[t]})),null==A||A.forEach((function(t){delete Tt[t]}));var At=f.useState(!1),Ct=(0,s.Z)(At,2),kt=Ct[0],Nt=Ct[1];f.useEffect((function(){Nt((0,m.Z)())}),[]);var Ot=f.useRef(null),Pt=f.useRef(null),It=f.useRef(null),Lt=f.useRef(null),Dt=f.useRef(null),Rt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=f.useState(!1),n=(0,s.Z)(e,2),r=n[0],i=n[1],o=f.useRef(null),a=function(){window.clearTimeout(o.current)};return f.useEffect((function(){return a}),[]),[r,function(e,n){a(),o.current=window.setTimeout((function(){i(e),n&&n()}),t)},a]}(),zt=(0,s.Z)(Rt,3),Ft=zt[0],Bt=zt[1],jt=zt[2];f.useImperativeHandle(e,(function(){var t,e;return{focus:null===(t=Lt.current)||void 0===t?void 0:t.focus,blur:null===(e=Lt.current)||void 0===e?void 0:e.blur,scrollTo:function(t){var e;return null===(e=Dt.current)||void 0===e?void 0:e.scrollTo(t)}}}));var Ut=f.useMemo((function(){var t;if("combobox"!==L)return $;var e=null===(t=C[0])||void 0===t?void 0:t.value;return"string"==typeof e||"number"==typeof e?String(e):""}),[$,L,C]),Vt="combobox"===L&&"function"==typeof F&&F()||null,Ht="function"==typeof B&&B(),Gt=(0,y.x1)(Pt,null==Ht||null===(n=Ht.props)||void 0===n?void 0:n.ref),Zt=(0,l.Z)(void 0,{defaultValue:U,value:j}),Wt=(0,s.Z)(Zt,2),Yt=Wt[0],qt=Wt[1],Xt=Yt,Kt=!P&&N;(D||Kt&&Xt&&"combobox"===L)&&(Xt=!1);var $t=!Kt&&Xt,Qt=f.useCallback((function(t){var e=void 0!==t?t:!Xt;D||(qt(e),Xt!==e&&(null==G||G(e)))}),[D,Xt,qt,G]),Jt=f.useMemo((function(){return(et||[]).some((function(t){return["\n","\r\n"].includes(t)}))}),[et]),te=function(t,e,n){var r=!0,o=t;null==W||W(null);var a=n?null:function(t,e){if(!e||!e.length)return null;var n=!1,r=function t(e,r){var o=(0,H.Z)(r),a=o[0],s=o.slice(1);if(!a)return[e];var u=e.split(a);return n=n||u.length>1,u.reduce((function(e,n){return[].concat((0,i.Z)(e),(0,i.Z)(t(n,s)))}),[]).filter((function(t){return t}))}(t,e);return n?r:null}(t,et);return"combobox"!==L&&a&&(o="",null==tt||tt(a),Qt(!1),r=!1),J&&Ut!==o&&J(o,{source:e?"typing":"effect"}),r};f.useEffect((function(){Xt||Et||"combobox"===L||te("",!1,!1)}),[Xt]),f.useEffect((function(){Yt&&D&&qt(!1),D&&Bt(!1)}),[D]);var ee=x(),ne=(0,s.Z)(ee,2),re=ne[0],ie=ne[1],oe=f.useRef(!1),ae=[];f.useEffect((function(){return function(){ae.forEach((function(t){return clearTimeout(t)})),ae.splice(0,ae.length)}}),[]);var se,ue=f.useState(null),ce=(0,s.Z)(ue,2),le=ce[0],he=ce[1],fe=f.useState({}),de=(0,s.Z)(fe,2)[1];(0,g.Z)((function(){if($t){var t,e=Math.ceil(null===(t=Ot.current)||void 0===t?void 0:t.offsetWidth);le===e||Number.isNaN(e)||he(e)}}),[$t]),Ht&&(se=function(t){Qt(t)}),function(t,e,n,r){var i=f.useRef(null);i.current={open:e,triggerOpen:n,customizedTrigger:r},f.useEffect((function(){function e(e){var n;if(null===(n=i.current)||void 0===n||!n.customizedTrigger){var r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),i.current.open&&t().filter((function(t){return t})).every((function(t){return!t.contains(r)&&t!==r}))&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[])}((function(){var t;return[Ot.current,null===(t=It.current)||void 0===t?void 0:t.getPopupElement()]}),$t,Qt,!!Ht);var pe,ge,me=f.useMemo((function(){return(0,a.Z)((0,a.Z)({},t),{},{notFoundContent:P,open:Xt,triggerOpen:$t,id:d,showSearch:Mt,multiple:Et,toggleOpen:Qt})}),[t,P,$t,Xt,d,Mt,Et,Qt]),ve=void 0!==rt?rt:R||!Et&&"combobox"!==L;ve&&(pe=f.createElement(S,{className:p()("".concat(w,"-arrow"),(0,o.Z)({},"".concat(w,"-arrow-loading"),R)),customizeIcon:it,customizeIconProps:{loading:R,searchValue:Ut,open:Xt,focused:Ft,showSearch:Mt}}));D||!nt||!C.length&&!Ut||"combobox"===L&&""===Ut||(ge=f.createElement(S,{className:"".concat(w,"-clear"),onMouseDown:function(){var t;null==I||I(),null===(t=Lt.current)||void 0===t||t.focus(),k([],{type:"clear",values:C}),te("",!1,!1)},customizeIcon:ot},"×"));var ye,be=f.createElement(at,{ref:Dt}),xe=p()(w,_,(h={},(0,o.Z)(h,"".concat(w,"-focused"),Ft),(0,o.Z)(h,"".concat(w,"-multiple"),Et),(0,o.Z)(h,"".concat(w,"-single"),!Et),(0,o.Z)(h,"".concat(w,"-allow-clear"),nt),(0,o.Z)(h,"".concat(w,"-show-arrow"),ve),(0,o.Z)(h,"".concat(w,"-disabled"),D),(0,o.Z)(h,"".concat(w,"-loading"),R),(0,o.Z)(h,"".concat(w,"-open"),Xt),(0,o.Z)(h,"".concat(w,"-customize-input"),Vt),(0,o.Z)(h,"".concat(w,"-show-search"),Mt),h)),we=f.createElement(V,{ref:It,disabled:D,prefixCls:w,visible:$t,popupElement:be,containerWidth:le,animation:st,transitionName:ut,dropdownStyle:ct,dropdownClassName:lt,direction:T,dropdownMatchSelectWidth:ht,dropdownRender:ft,dropdownAlign:dt,placement:pt,getPopupContainer:gt,empty:N,getTriggerDOMNode:function(){return Pt.current},onPopupVisibleChange:se,onPopupMouseEnter:function(){de({})}},Ht?f.cloneElement(Ht,{ref:Gt}):f.createElement(z,(0,r.Z)({},t,{domRef:Pt,prefixCls:w,inputElement:Vt,ref:Lt,id:d,showSearch:Mt,autoClearSearchValue:Q,mode:L,activeDescendantId:K,tagRender:M,values:C,open:Xt,onToggleOpen:Qt,activeValue:Z,searchValue:Ut,onSearch:te,onSearchSubmit:function(t){t&&t.trim()&&J(t,{source:"submit"})},onRemove:function(t){var e=C.filter((function(e){return e!==t}));k(e,{type:"remove",values:[t]})},tokenWithEnter:Jt})));return ye=Ht?we:f.createElement("div",(0,r.Z)({className:xe},Tt,{ref:Ot,onMouseDown:function(t){var e,n=t.target,r=null===(e=It.current)||void 0===e?void 0:e.getPopupElement();if(r&&r.contains(n)){var i=setTimeout((function(){var t,e=ae.indexOf(i);-1!==e&&ae.splice(e,1),jt(),kt||r.contains(document.activeElement)||null===(t=Lt.current)||void 0===t||t.focus()}));ae.push(i)}for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s=0;s-=1){var u=o[s];if(!u.disabled){o.splice(s,1),a=u;break}}a&&k(o,{type:"remove",values:[a]})}for(var c=arguments.length,l=new Array(c>1?c-1:0),h=1;h1?e-1:0),r=1;r1&&void 0!==arguments[1]&&arguments[1];return(0,rt.Z)(t).map((function(t,n){if(!f.isValidElement(t)||!t.type)return null;var r=t,i=r.type.isSelectOptGroup,o=r.key,s=r.props,c=s.children,l=(0,u.Z)(s,ot);return e||!i?at(t):(0,a.Z)((0,a.Z)({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},l),{},{options:st(c)})})).filter((function(t){return t}))}function ut(t,e,n,r,i){return f.useMemo((function(){var o=t;!t&&(o=st(e));var a=new Map,s=new Map,u=function(t,e,n){n&&"string"==typeof n&&t.set(e[n],e)};return function t(e){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;cn},t}return(0,xt.Z)(n,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(t){t.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var t=this.state,e=t.dragging,n=t.visible,r=this.props.prefixCls,i=this.getSpinHeight(),a=this.getTop(),s=this.showScroll(),u=s&&n;return f.createElement("div",{ref:this.scrollbarRef,className:p()("".concat(r,"-scrollbar"),(0,o.Z)({},"".concat(r,"-scrollbar-show"),s)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:u?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},f.createElement("div",{ref:this.thumbRef,className:p()("".concat(r,"-scrollbar-thumb"),(0,o.Z)({},"".concat(r,"-scrollbar-thumb-moving"),e)),style:{width:"100%",height:i,top:a,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),n}(f.Component);function Tt(t){var e=t.children,n=t.setRef,r=f.useCallback((function(t){n(t)}),[]);return f.cloneElement(e,{ref:r})}var At=n(34203),Ct=function(){function t(){(0,bt.Z)(this,t),this.maps=void 0,this.maps=Object.create(null)}return(0,xt.Z)(t,[{key:"set",value:function(t,e){this.maps[t]=e}},{key:"get",value:function(t){return this.maps[t]}}]),t}();function kt(t,e,n){var r=f.useState(t),i=(0,s.Z)(r,2),o=i[0],a=i[1],u=f.useState(null),c=(0,s.Z)(u,2),l=c[0],h=c[1];return f.useEffect((function(){var r=function(t,e,n){var r,i,o=t.length,a=e.length;if(0===o&&0===a)return null;o1&&void 0!==arguments[1]&&arguments[1],a=t<0&&o.current.top||t>0&&o.current.bottom;return e&&a?(clearTimeout(r.current),n.current=!1):a&&!n.current||i(),!n.current&&a}};var Pt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange"],It=[],Lt={overflowY:"auto",overflowAnchor:"none"};function Dt(t,e){var n=t.prefixCls,i=void 0===n?"rc-virtual-list":n,l=t.className,h=t.height,d=t.itemHeight,m=t.fullHeight,v=void 0===m||m,y=t.style,b=t.data,x=t.children,w=t.itemKey,_=t.virtual,S=t.component,E=void 0===S?"div":S,M=t.onScroll,T=t.onVisibleChange,A=(0,u.Z)(t,Pt),C=!(!1===_||!h||!d),k=C&&b&&d*b.length>h,N=(0,f.useState)(0),O=(0,s.Z)(N,2),P=O[0],I=O[1],L=(0,f.useState)(!1),D=(0,s.Z)(L,2),R=D[0],z=D[1],F=p()(i,l),B=b||It,j=(0,f.useRef)(),U=(0,f.useRef)(),V=(0,f.useRef)(),H=f.useCallback((function(t){return"function"==typeof w?w(t):null==t?void 0:t[w]}),[w]),G={getKey:H};function Z(t){I((function(e){var n=function(t){var e=t;Number.isNaN(ut.current)||(e=Math.min(e,ut.current));return e=Math.max(e,0)}("function"==typeof t?t(e):t);return j.current.scrollTop=n,n}))}var W=(0,f.useRef)({start:0,end:B.length}),Y=(0,f.useRef)(),q=kt(B,H),X=(0,s.Z)(q,1)[0];Y.current=X;var K=function(t,e,n){var r=f.useState(0),i=(0,s.Z)(r,2),o=i[0],a=i[1],u=(0,f.useRef)(new Map),c=(0,f.useRef)(new Ct),l=(0,f.useRef)();function h(){St.Z.cancel(l.current)}function d(){h(),l.current=(0,St.Z)((function(){u.current.forEach((function(t,e){if(t&&t.offsetParent){var n=(0,At.Z)(t),r=n.offsetHeight;c.current.get(e)!==r&&c.current.set(e,n.offsetHeight)}})),a((function(t){return t+1}))}))}return(0,f.useEffect)((function(){return h}),[]),[function(r,i){var o=t(r),a=u.current.get(o);i?(u.current.set(o,i),d()):u.current.delete(o),!a!=!i&&(i?null==e||e(r):null==n||n(r))},d,c.current,o]}(H,null,null),$=(0,s.Z)(K,4),Q=$[0],J=$[1],tt=$[2],et=$[3],nt=f.useMemo((function(){if(!C)return{scrollHeight:void 0,start:0,end:B.length-1,offset:void 0};var t;if(!k)return{scrollHeight:(null===(t=U.current)||void 0===t?void 0:t.offsetHeight)||0,start:0,end:B.length-1,offset:void 0};for(var e,n,r,i=0,o=B.length,a=0;a=P&&void 0===e&&(e=a,n=i),l>P+h&&void 0===r&&(r=a),i=l}return void 0===e&&(e=0,n=0,r=Math.ceil(h/d)),void 0===r&&(r=B.length-1),{scrollHeight:i,start:e,end:r=Math.min(r+1,B.length),offset:n}}),[k,C,P,B,et,h]),rt=nt.scrollHeight,it=nt.start,ot=nt.end,at=nt.offset;W.current.start=it,W.current.end=ot;var st=rt-h,ut=(0,f.useRef)(st);ut.current=st;var ct=P<=0,lt=P>=st,ht=Ot(ct,lt);var ft=function(t,e,n,r){var i=(0,f.useRef)(0),o=(0,f.useRef)(null),a=(0,f.useRef)(null),s=(0,f.useRef)(!1),u=Ot(e,n);return[function(e){if(t){St.Z.cancel(o.current);var n=e.deltaY;i.current+=n,a.current=n,u(n)||(Nt||e.preventDefault(),o.current=(0,St.Z)((function(){var t=s.current?10:1;r(i.current*t),i.current=0})))}},function(e){t&&(s.current=e.detail===a.current)}]}(C,ct,lt,(function(t){Z((function(e){return e+t}))})),dt=(0,s.Z)(ft,2),pt=dt[0],gt=dt[1];!function(t,e,n){var r,i=(0,f.useRef)(!1),o=(0,f.useRef)(0),a=(0,f.useRef)(null),s=(0,f.useRef)(null),u=function(t){if(i.current){var e=Math.ceil(t.touches[0].pageY),r=o.current-e;o.current=e,n(r)&&t.preventDefault(),clearInterval(s.current),s.current=setInterval((function(){(!n(r*=.9333333333333333,!0)||Math.abs(r)<=.1)&&clearInterval(s.current)}),16)}},c=function(){i.current=!1,r()},l=function(t){r(),1!==t.touches.length||i.current||(i.current=!0,o.current=Math.ceil(t.touches[0].pageY),a.current=t.target,a.current.addEventListener("touchmove",u),a.current.addEventListener("touchend",c))};r=function(){a.current&&(a.current.removeEventListener("touchmove",u),a.current.removeEventListener("touchend",c))},(0,g.Z)((function(){return t&&e.current.addEventListener("touchstart",l),function(){var t;null===(t=e.current)||void 0===t||t.removeEventListener("touchstart",l),r(),clearInterval(s.current)}}),[t])}(C,j,(function(t,e){return!ht(t,e)&&(pt({preventDefault:function(){},deltaY:t}),!0)})),(0,g.Z)((function(){function t(t){C&&t.preventDefault()}return j.current.addEventListener("wheel",pt),j.current.addEventListener("DOMMouseScroll",gt),j.current.addEventListener("MozMousePixelScroll",t),function(){j.current&&(j.current.removeEventListener("wheel",pt),j.current.removeEventListener("DOMMouseScroll",gt),j.current.removeEventListener("MozMousePixelScroll",t))}}),[C]);var mt=function(t,e,n,r,i,o,a,s){var u=f.useRef();return function(l){if(null!=l){if(St.Z.cancel(u.current),"number"==typeof l)a(l);else if(l&&"object"===(0,c.Z)(l)){var h,f=l.align;h="index"in l?l.index:e.findIndex((function(t){return i(t)===l.key}));var d=l.offset,p=void 0===d?0:d;!function s(c,l){if(!(c<0)&&t.current){var d=t.current.clientHeight,g=!1,m=l;if(d){for(var v=l||f,y=0,b=0,x=0,w=Math.min(e.length,h),_=0;_<=w;_+=1){var S=i(e[_]);b=y;var E=n.get(S);y=x=b+(void 0===E?r:E),_===h&&void 0===E&&(g=!0)}var M=null;switch(v){case"top":M=b-p;break;case"bottom":M=x-d+p;break;default:var T=t.current.scrollTop;bT+d&&(m="bottom")}null!==M&&M!==t.current.scrollTop&&a(M)}u.current=(0,St.Z)((function(){g&&o(),s(c-1,m)}))}}(3)}}else s()}}(j,B,tt,d,H,J,Z,(function(){var t;null===(t=V.current)||void 0===t||t.delayHidden()}));f.useImperativeHandle(e,(function(){return{scrollTo:mt}})),(0,g.Z)((function(){if(T){var t=B.slice(it,ot+1);T(t,B)}}),[it,ot,B]);var vt=function(t,e,n,r,i,o){var a=o.getKey;return t.slice(e,n+1).map((function(t,n){var o=i(t,e+n,{}),s=a(t);return f.createElement(Tt,{key:s,setRef:function(e){return r(t,e)}},o)}))}(B,it,ot,Q,x,G),bt=null;return h&&(bt=(0,a.Z)((0,o.Z)({},v?"height":"maxHeight",h),Lt),C&&(bt.overflowY="hidden",R&&(bt.pointerEvents="none"))),f.createElement("div",(0,r.Z)({style:(0,a.Z)((0,a.Z)({},y),{},{position:"relative"}),className:F},A),f.createElement(E,{className:"".concat(i,"-holder"),style:bt,ref:j,onScroll:function(t){var e=t.currentTarget.scrollTop;e!==P&&Z(e),null==M||M(t)}},f.createElement(yt,{prefixCls:i,height:rt,offset:at,onInnerResize:J,ref:U},vt)),C&&f.createElement(Mt,{ref:V,prefixCls:i,scrollTop:P,height:h,scrollHeight:rt,count:B.length,onScroll:function(t){Z(t)},onStartMove:function(){z(!0)},onStopMove:function(){z(!1)}}))}var Rt=f.forwardRef(Dt);Rt.displayName="List";var zt=Rt;var Ft=f.createContext(null),Bt=["disabled","title","children","style","className"];function jt(t){return"string"==typeof t||"number"==typeof t}var Ut=function(t,e){var n=f.useContext(b),a=n.prefixCls,c=n.id,l=n.open,h=n.multiple,d=n.mode,g=n.searchValue,m=n.toggleOpen,y=n.notFoundContent,x=n.onPopupScroll,_=f.useContext(Ft),E=_.flattenOptions,M=_.onActiveValue,T=_.defaultActiveFirstOption,A=_.onSelect,C=_.menuItemSelectedIcon,k=_.rawValues,N=_.fieldNames,O=_.virtual,P=_.listHeight,I=_.listItemHeight,L="".concat(a,"-item"),D=(0,gt.Z)((function(){return E}),[l,E],(function(t,e){return e[0]&&t[1]!==e[1]})),R=f.useRef(null),z=function(t){t.preventDefault()},F=function(t){R.current&&R.current.scrollTo("number"==typeof t?{index:t}:t)},B=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=D.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];H(t);var n={source:e?"keyboard":"mouse"},r=D[t];r?M(r.value,t,n):M(null,-1,n)};(0,f.useEffect)((function(){G(!1!==T?B(0):-1)}),[D.length,g]);var Z=f.useCallback((function(t){return k.has(t)&&"combobox"!==d}),[d,(0,i.Z)(k).toString(),k.size]);(0,f.useEffect)((function(){var t,e=setTimeout((function(){if(!h&&l&&1===k.size){var t=Array.from(k)[0],e=D.findIndex((function(e){return e.data.value===t}));-1!==e&&(G(e),F(e))}}));l&&(null===(t=R.current)||void 0===t||t.scrollTo(void 0));return function(){return clearTimeout(e)}}),[l,g]);var W=function(t){void 0!==t&&A(t,{selected:!k.has(t)}),h||m(!1)};if(f.useImperativeHandle(e,(function(){return{onKeyDown:function(t){var e=t.which,n=t.ctrlKey;switch(e){case v.Z.N:case v.Z.P:case v.Z.UP:case v.Z.DOWN:var r=0;if(e===v.Z.UP?r=-1:e===v.Z.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(e===v.Z.N?r=1:e===v.Z.P&&(r=-1)),0!==r){var i=B(V+r,r);F(i),G(i,!0)}break;case v.Z.ENTER:var o=D[V];o&&!o.data.disabled?W(o.value):W(void 0),l&&t.preventDefault();break;case v.Z.ESC:m(!1),l&&t.stopPropagation()}},onKeyUp:function(){},scrollTo:function(t){F(t)}}})),0===D.length)return f.createElement("div",{role:"listbox",id:"".concat(c,"_list"),className:"".concat(L,"-empty"),onMouseDown:z},y);var Y=Object.keys(N).map((function(t){return N[t]})),q=function(t){return t.label},X=function(t){var e=D[t];if(!e)return null;var n=e.data||{},i=n.value,o=e.group,a=(0,w.Z)(n,!0),s=q(e);return e?f.createElement("div",(0,r.Z)({"aria-label":"string"!=typeof s||o?null:s},a,{key:t,role:o?"presentation":"option",id:"".concat(c,"_list_").concat(t),"aria-selected":Z(i)}),i):null};return f.createElement(f.Fragment,null,f.createElement("div",{role:"listbox",id:"".concat(c,"_list"),style:{height:0,width:0,overflow:"hidden"}},X(V-1),X(V),X(V+1)),f.createElement(zt,{itemKey:"key",ref:R,data:D,height:P,itemHeight:I,fullHeight:!1,onMouseDown:z,onScroll:x,virtual:O},(function(t,e){var n,i=t.group,a=t.groupOption,s=t.data,c=t.label,l=t.value,h=s.key;if(i){var d,g=null!==(d=s.title)&&void 0!==d?d:jt(c)?c.toString():void 0;return f.createElement("div",{className:p()(L,"".concat(L,"-group")),title:g},void 0!==c?c:h)}var m=s.disabled,v=s.title,y=(s.children,s.style),b=s.className,x=(0,u.Z)(s,Bt),_=(0,pt.Z)(x,Y),E=Z(l),M="".concat(L,"-option"),T=p()(L,M,b,(n={},(0,o.Z)(n,"".concat(M,"-grouped"),a),(0,o.Z)(n,"".concat(M,"-active"),V===e&&!m),(0,o.Z)(n,"".concat(M,"-disabled"),m),(0,o.Z)(n,"".concat(M,"-selected"),E),n)),A=q(t),k=!C||"function"==typeof C||E,N="number"==typeof A?A:A||l,O=jt(N)?N.toString():void 0;return void 0!==v&&(O=v),f.createElement("div",(0,r.Z)({},(0,w.Z)(_),{"aria-selected":E,className:T,title:O,onMouseMove:function(){V===e||m||G(e)},onClick:function(){m||W(l)},style:y}),f.createElement("div",{className:"".concat(M,"-content")},N),f.isValidElement(C)||E,k&&f.createElement(S,{className:"".concat(L,"-option-state"),customizeIcon:C,customizeIconProps:{isSelected:E}},E?"✓":null))})))},Vt=f.forwardRef(Ut);Vt.displayName="OptionList";var Ht=Vt;var Gt=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],Zt=["inputValue"];var Wt=f.forwardRef((function(t,e){var n=t.id,h=t.mode,d=t.prefixCls,p=void 0===d?"rc-select":d,g=t.backfill,m=t.fieldNames,v=t.inputValue,y=t.searchValue,b=t.onSearch,x=t.autoClearSearchValue,w=void 0===x||x,_=t.onSelect,S=t.onDeselect,E=t.dropdownMatchSelectWidth,M=void 0===E||E,T=t.filterOption,C=t.filterSort,k=t.optionFilterProp,N=t.optionLabelProp,O=t.options,P=t.children,I=t.defaultActiveFirstOption,L=t.menuItemSelectedIcon,D=t.virtual,R=t.listHeight,z=void 0===R?200:R,F=t.listItemHeight,B=void 0===F?20:F,j=t.value,U=t.defaultValue,V=t.labelInValue,H=t.onChange,Y=(0,u.Z)(t,Gt),q=nt(n),K=X(h),J=!(O||!P),tt=f.useMemo((function(){return(void 0!==T||"combobox"!==h)&&T}),[T,h]),et=f.useMemo((function(){return Z(m,J)}),[JSON.stringify(m),J]),rt=(0,l.Z)("",{value:void 0!==y?y:v,postState:function(t){return t||""}}),it=(0,s.Z)(rt,2),ot=it[0],at=it[1],st=ut(O,P,et,k,N),lt=st.valueOptions,ht=st.labelOptions,ft=st.options,dt=f.useCallback((function(t){return A(t).map((function(t){var e,n,r,i,o,a;(function(t){return!t||"object"!==(0,c.Z)(t)})(t)?e=t:(r=t.key,n=t.label,e=null!==(a=t.value)&&void 0!==a?a:r);var s,u=lt.get(e);u&&(void 0===n&&(n=null==u?void 0:u[N||et.label]),void 0===r&&(r=null!==(s=null==u?void 0:u.key)&&void 0!==s?s:e),i=null==u?void 0:u.disabled,o=null==u?void 0:u.title);return{label:n,value:e,key:r,disabled:i,title:o}}))}),[et,N,lt]),pt=(0,l.Z)(U,{value:j}),gt=(0,s.Z)(pt,2),mt=gt[0],vt=gt[1],yt=function(t,e){var n=f.useRef({values:new Map,options:new Map});return[f.useMemo((function(){var r=n.current,i=r.values,o=r.options,s=t.map((function(t){var e;return void 0===t.label?(0,a.Z)((0,a.Z)({},t),{},{label:null===(e=i.get(t.value))||void 0===e?void 0:e.label}):t})),u=new Map,c=new Map;return s.forEach((function(t){u.set(t.value,t),c.set(t.value,e.get(t.value)||o.get(t.value))})),n.current.values=u,n.current.options=c,s}),[t,e]),f.useCallback((function(t){return e.get(t)||n.current.options.get(t)}),[e])]}(f.useMemo((function(){var t,e=dt(mt);return"combobox"!==h||null!==(t=e[0])&&void 0!==t&&t.value?e:[]}),[mt,dt,h]),lt),bt=(0,s.Z)(yt,2),xt=bt[0],wt=bt[1],_t=f.useMemo((function(){if(!h&&1===xt.length){var t=xt[0];if(null===t.value&&(null===t.label||void 0===t.label))return[]}return xt.map((function(t){var e;return(0,a.Z)((0,a.Z)({},t),{},{label:null!==(e=t.label)&&void 0!==e?e:t.value})}))}),[h,xt]),St=f.useMemo((function(){return new Set(xt.map((function(t){return t.value})))}),[xt]);f.useEffect((function(){if("combobox"===h){var t,e=null===(t=xt[0])||void 0===t?void 0:t.value;at(function(t){return null!=t}(e)?String(e):"")}}),[xt]);var Et=ct((function(t,e){var n,r=null!=e?e:t;return n={},(0,o.Z)(n,et.value,t),(0,o.Z)(n,et.label,r),n})),Mt=function(t,e,n,r,i){return f.useMemo((function(){if(!n||!1===r)return t;var s=e.options,u=e.label,c=e.value,l=[],h="function"==typeof r,f=n.toUpperCase(),d=h?r:function(t,e){return i?Q(e[i],f):e[s]?Q(e["children"!==u?u:"label"],f):Q(e[c],f)},p=h?function(t){return W(t)}:function(t){return t};return t.forEach((function(t){if(t[s])if(d(n,p(t)))l.push(t);else{var e=t[s].filter((function(t){return d(n,p(t))}));e.length&&l.push((0,a.Z)((0,a.Z)({},t),{},(0,o.Z)({},s,e)))}else d(n,p(t))&&l.push(t)})),l}),[t,r,i,n,e])}(f.useMemo((function(){if("tags"!==h)return ft;var t=(0,i.Z)(ft);return(0,i.Z)(xt).sort((function(t,e){return t.value1&&void 0!==arguments[1]?arguments[1]:{},n=e.fieldNames,r=e.childrenAsData,i=[],o=Z(n,!1),a=o.label,s=o.value,u=o.options;function c(t,e){t.forEach((function(t){var n=t[a];if(e||!(u in t)){var o=t[s];i.push({key:G(t,i.length),groupOption:e,data:t,label:n,value:o})}else{var l=n;void 0===l&&r&&(l=t.label),i.push({key:G(t,i.length),group:!0,data:t,label:l}),c(t[u],!0)}}))}return c(t,!1),i}(At,{fieldNames:et,childrenAsData:J})}),[At,et,J]),kt=function(t){var e=dt(t);if(vt(e),H&&(e.length!==xt.length||e.some((function(t,e){var n;return(null===(n=xt[e])||void 0===n?void 0:n.value)!==(null==t?void 0:t.value)})))){var n=V?e:e.map((function(t){return t.value})),r=e.map((function(t){return W(wt(t.value))}));H(K?n:n[0],K?r:r[0])}},Nt=f.useState(null),Ot=(0,s.Z)(Nt,2),Pt=Ot[0],It=Ot[1],Lt=f.useState(0),Dt=(0,s.Z)(Lt,2),Rt=Dt[0],zt=Dt[1],Bt=void 0!==I?I:"combobox"!==h,jt=f.useCallback((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.source,i=void 0===r?"keyboard":r;zt(e),g&&"combobox"===h&&null!==t&&"keyboard"===i&&It(String(t))}),[g,h]),Ut=function(t,e,n){var r=function(){var e,n=wt(t);return[V?{label:null==n?void 0:n[et.label],value:t,key:null!==(e=null==n?void 0:n.key)&&void 0!==e?e:t}:t,W(n)]};if(e&&_){var i=r(),o=(0,s.Z)(i,2),a=o[0],u=o[1];_(a,u)}else if(!e&&S&&"clear"!==n){var c=r(),l=(0,s.Z)(c,2),h=l[0],f=l[1];S(h,f)}},Vt=ct((function(t,e){var n,r=!K||e.selected;n=r?K?[].concat((0,i.Z)(xt),[t]):[t]:xt.filter((function(e){return e.value!==t})),kt(n),Ut(t,r),"combobox"===h?It(""):X&&!w||(at(""),It(""))})),Wt=f.useMemo((function(){var t=!1!==D&&!1!==M;return(0,a.Z)((0,a.Z)({},st),{},{flattenOptions:Ct,onActiveValue:jt,defaultActiveFirstOption:Bt,onSelect:Vt,menuItemSelectedIcon:L,rawValues:St,fieldNames:et,virtual:t,listHeight:z,listItemHeight:B,childrenAsData:J})}),[st,Ct,jt,Bt,Vt,L,St,et,D,M,z,B,J]);return f.createElement(Ft.Provider,{value:Wt},f.createElement($,(0,r.Z)({},Y,{id:q,prefixCls:p,ref:e,omitDomProps:Zt,mode:h,displayValues:_t,onDisplayValuesChange:function(t,e){kt(t);var n=e.type,r=e.values;"remove"!==n&&"clear"!==n||r.forEach((function(t){Ut(t.value,!1,n)}))},searchValue:ot,onSearch:function(t,e){if(at(t),It(null),"submit"!==e.source)"blur"!==e.source&&("combobox"===h&&kt(t),null==b||b(t));else{var n=(t||"").trim();if(n){var r=Array.from(new Set([].concat((0,i.Z)(St),[n])));kt(r),Ut(n,!0),at("")}}},autoClearSearchValue:w,onSearchSplit:function(t){var e=t;"tags"!==h&&(e=t.map((function(t){var e=ht.get(t);return null==e?void 0:e.value})).filter((function(t){return void 0!==t})));var n=Array.from(new Set([].concat((0,i.Z)(St),(0,i.Z)(e))));kt(n),n.forEach((function(t){Ut(t,!0)}))},dropdownMatchSelectWidth:M,OptionList:Ht,emptyOptions:!Ct.length,activeValue:Pt,activeDescendantId:"".concat(q,"_list_").concat(Rt)})))}));var Yt=Wt;Yt.Option=dt,Yt.OptGroup=ht;var qt=Yt},86928:function(t,e,n){"use strict";n.d(e,{Z:function(){return I}});var r=n(4942),i=n(93433),o=n(29439),a=n(71002),s=n(67294),u=n(94184),c=n.n(u),l=n(96774),h=n.n(l),f=n(21770),d=n(87462),p=n(44925),g=n(1413),m=n(15105),v=s.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0});function y(t,e,n){return(t-e)/(n-e)}function b(t,e,n,r){var i=y(e,n,r),o={};switch(t){case"rtl":o.right="".concat(100*i,"%"),o.transform="translateX(50%)";break;case"btt":o.bottom="".concat(100*i,"%"),o.transform="translateY(50%)";break;case"ttb":o.top="".concat(100*i,"%"),o.transform="translateY(-50%)";break;default:o.left="".concat(100*i,"%"),o.transform="translateX(-50%)"}return o}function x(t,e){return Array.isArray(t)?t[e]:t}var w=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"];var _=s.forwardRef((function(t,e){var n,i,o=t.prefixCls,a=t.value,u=t.valueIndex,l=t.onStartMove,h=t.style,f=t.render,y=t.dragging,_=t.onOffsetChange,S=(0,p.Z)(t,w),E=s.useContext(v),M=E.min,T=E.max,A=E.direction,C=E.disabled,k=E.range,N=E.tabIndex,O=E.ariaLabelForHandle,P=E.ariaLabelledByForHandle,I=E.ariaValueTextFormatterForHandle,L="".concat(o,"-handle"),D=function(t){C||l(t,u)},R=b(A,a,M,T),z=s.createElement("div",(0,d.Z)({ref:e,className:c()(L,(n={},(0,r.Z)(n,"".concat(L,"-").concat(u+1),k),(0,r.Z)(n,"".concat(L,"-dragging"),y),n)),style:(0,g.Z)((0,g.Z)({},R),h),onMouseDown:D,onTouchStart:D,onKeyDown:function(t){if(!C){var e=null;switch(t.which||t.keyCode){case m.Z.LEFT:e="ltr"===A||"btt"===A?-1:1;break;case m.Z.RIGHT:e="ltr"===A||"btt"===A?1:-1;break;case m.Z.UP:e="ttb"!==A?1:-1;break;case m.Z.DOWN:e="ttb"!==A?-1:1;break;case m.Z.HOME:e="min";break;case m.Z.END:e="max";break;case m.Z.PAGE_UP:e=2;break;case m.Z.PAGE_DOWN:e=-2}null!==e&&(t.preventDefault(),_(e,u))}},tabIndex:C?null:x(N,u),role:"slider","aria-valuemin":M,"aria-valuemax":T,"aria-valuenow":a,"aria-disabled":C,"aria-label":x(O,u),"aria-labelledby":x(P,u),"aria-valuetext":null===(i=x(I,u))||void 0===i?void 0:i(a)},S));return f&&(z=f(z,{index:u,prefixCls:o,value:a,dragging:y})),z})),S=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","draggingIndex"];var E=s.forwardRef((function(t,e){var n=t.prefixCls,r=t.style,i=t.onStartMove,o=t.onOffsetChange,a=t.values,u=t.handleRender,c=t.draggingIndex,l=(0,p.Z)(t,S),h=s.useRef({});return s.useImperativeHandle(e,(function(){return{focus:function(t){var e;null===(e=h.current[t])||void 0===e||e.focus()}}})),s.createElement(s.Fragment,null,a.map((function(t,e){return s.createElement(_,(0,d.Z)({ref:function(t){t?h.current[e]=t:delete h.current[e]},dragging:c===e,prefixCls:n,style:x(r,e),key:e,value:t,valueIndex:e,onStartMove:i,onOffsetChange:o,render:u},l))})))}));function M(t){var e="touches"in t?t.touches[0]:t;return{pageX:e.pageX,pageY:e.pageY}}function T(t){var e=t.prefixCls,n=t.style,r=t.start,i=t.end,o=t.index,a=t.onStartMove,u=s.useContext(v),l=u.direction,h=u.min,f=u.max,d=u.disabled,p=u.range,m="".concat(e,"-track"),b=y(r,h,f),x=y(i,h,f),w=function(t){!d&&a&&a(t,-1)},_={};switch(l){case"rtl":_.right="".concat(100*b,"%"),_.width="".concat(100*x-100*b,"%");break;case"btt":_.bottom="".concat(100*b,"%"),_.height="".concat(100*x-100*b,"%");break;case"ttb":_.top="".concat(100*b,"%"),_.height="".concat(100*x-100*b,"%");break;default:_.left="".concat(100*b,"%"),_.width="".concat(100*x-100*b,"%")}return s.createElement("div",{className:c()(m,p&&"".concat(m,"-").concat(o+1)),style:(0,g.Z)((0,g.Z)({},_),n),onMouseDown:w,onTouchStart:w})}function A(t){var e=t.prefixCls,n=t.style,r=t.values,i=t.startPoint,o=t.onStartMove,a=s.useContext(v),u=a.included,c=a.range,l=a.min,h=s.useMemo((function(){if(!c){if(0===r.length)return[];var t=null!=i?i:l,e=r[0];return[{start:Math.min(t,e),end:Math.max(t,e)}]}for(var n=[],o=0;o=0&&V}),[V,dt]),gt=s.useMemo((function(){return Object.keys(tt||{}).map((function(t){var e=tt[t],n={value:Number(t)};return e&&"object"===(0,a.Z)(e)&&!s.isValidElement(e)&&("label"in e||"style"in e)?(n.style=e.style,n.label=e.label):n.label=e,n})).filter((function(t){var e=t.label;return e||"number"==typeof e})).sort((function(t,e){return t.value-e.value}))}),[tt]),mt=function(t,e,n,r,o,a){var u=s.useCallback((function(n){var r=isFinite(n)?n:t;return r=Math.min(e,n),Math.max(t,r)}),[t,e]),c=s.useCallback((function(r){if(null!==n){var i=t+Math.round((u(r)-t)/n)*n,o=function(t){return(String(t).split(".")[1]||"").length},a=Math.max(o(n),o(e),o(t)),s=Number(i.toFixed(a));return t<=s&&s<=e?s:null}return null}),[n,t,e,u]),l=s.useCallback((function(i){var o=u(i),a=r.map((function(t){return t.value}));null!==n&&a.push(c(i)),a.push(t,e);var s=a[0],l=e-t;return a.forEach((function(t){var e=Math.abs(o-t);e<=l&&(s=t,l=e)})),s}),[t,e,r,n,u,c]),h=function o(a,s,u){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof s){var h,f=a[u],d=f+s,p=[];r.forEach((function(t){p.push(t.value)})),p.push(t,e),p.push(c(f));var g=s>0?1:-1;"unit"===l?p.push(c(f+g*n)):p.push(c(d)),p=p.filter((function(t){return null!==t})).filter((function(t){return s<0?t<=f:t>=f})),"unit"===l&&(p=p.filter((function(t){return t!==f})));var m="unit"===l?f:d;h=p[0];var v=Math.abs(h-m);if(p.forEach((function(t){var e=Math.abs(t-m);e1){var y=(0,i.Z)(a);return y[u]=h,o(y,s-g,u,l)}return h}return"min"===s?t:"max"===s?e:void 0},f=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",i=t[n],o=h(t,e,n,r);return{value:o,changed:o!==i}},d=function(t){return null===a&&0===t||"number"==typeof a&&t3&&void 0!==arguments[3]?arguments[3]:"unit",i=t.map(l),s=i[n],u=h(i,e,n,r);if(i[n]=u,!1===o){var c=a||0;n>0&&i[n-1]!==s&&(i[n]=Math.max(i[n],i[n-1]+c)),n0;v-=1)for(var y=!0;d(i[v]-i[v-1])&&y;){var b=f(i,-1,v-1);i[v-1]=b.value,y=b.changed}for(var x=i.length-1;x>0;x-=1)for(var w=!0;d(i[x]-i[x-1])&&w;){var _=f(i,-1,x-1);i[x-1]=_.value,w=_.changed}for(var S=0;S=0?D+1:2;for(n=n.slice(0,r);n.length=0&&ut.current.focus(t)}Pt(null)}),[Ot]);var It=s.useMemo((function(){return(!H||null!==dt)&&H}),[H,dt]),Lt=function(t,e,n,r,a,u,c,l,h){var f=s.useState(null),d=(0,o.Z)(f,2),p=d[0],g=d[1],m=s.useState(-1),v=(0,o.Z)(m,2),y=v[0],b=v[1],x=s.useState(n),w=(0,o.Z)(x,2),_=w[0],S=w[1],E=s.useState(n),T=(0,o.Z)(E,2),A=T[0],C=T[1],k=s.useRef(null),N=s.useRef(null);s.useEffect((function(){-1===y&&S(n)}),[n,y]),s.useEffect((function(){return function(){document.removeEventListener("mousemove",k.current),document.removeEventListener("mouseup",N.current),document.removeEventListener("touchmove",k.current),document.removeEventListener("touchend",N.current)}}),[]);var O=function(t,e){_.some((function(e,n){return e!==t[n]}))&&(void 0!==e&&g(e),S(t),c(t))},P=function(t,e){if(-1===t){var n=A[0],o=A[A.length-1],s=r-n,c=a-o,l=e*(a-r);l=Math.max(l,s),l=Math.min(l,c);var f=u(n+l);l=f-n;var d=A.map((function(t){return t+l}));O(d)}else{var p=(a-r)*e,g=(0,i.Z)(_);g[t]=A[t];var m=h(g,p,t,"dist");O(m.values,m.value)}},I=s.useRef(P);I.current=P;var L=s.useMemo((function(){var t=(0,i.Z)(n).sort((function(t,e){return t-e})),e=(0,i.Z)(_).sort((function(t,e){return t-e}));return t.every((function(t,n){return t===e[n]}))?_:n}),[n,_]);return[y,p,L,function(r,i){r.stopPropagation();var o=n[i];b(i),g(o),C(n);var a=M(r),s=a.pageX,u=a.pageY,c=function(n){n.preventDefault();var r,o=M(n),a=o.pageX,c=o.pageY,l=a-s,h=c-u,f=t.current.getBoundingClientRect(),d=f.width,p=f.height;switch(e){case"btt":r=-h/p;break;case"ttb":r=h/p;break;case"rtl":r=-l/d;break;default:r=l/d}I.current(i,r)},h=function t(e){e.preventDefault(),document.removeEventListener("mouseup",t),document.removeEventListener("mousemove",c),document.removeEventListener("touchend",t),document.removeEventListener("touchmove",c),k.current=null,N.current=null,b(-1),l()};document.addEventListener("mouseup",h),document.addEventListener("mousemove",c),document.addEventListener("touchend",h),document.addEventListener("touchmove",c),k.current=c,N.current=h}]}(ct,lt,Et,ht,ft,yt,At,(function(){null==F||F(Tt(Mt.current))}),bt),Dt=(0,o.Z)(Lt,4),Rt=Dt[0],zt=Dt[1],Ft=Dt[2],Bt=Dt[3],jt=function(t,e){Bt(t,e),null==z||z(Tt(Mt.current))},Ut=-1!==Rt;s.useEffect((function(){if(!Ut){var t=Et.lastIndexOf(zt);ut.current.focus(t)}}),[Ut]);var Vt=s.useMemo((function(){return(0,i.Z)(Ft).sort((function(t,e){return t-e}))}),[Ft]),Ht=s.useMemo((function(){return L?[Vt[0],Vt[Vt.length-1]]:[ht,Vt[0]]}),[Vt,L,ht]),Gt=(0,o.Z)(Ht,2),Zt=Gt[0],Wt=Gt[1];s.useImperativeHandle(e,(function(){return{focus:function(){ut.current.focus(0)},blur:function(){var t=document.activeElement;ct.current.contains(t)&&(null==t||t.blur())}}})),s.useEffect((function(){y&&ut.current.focus(0)}),[]);var Yt=s.useMemo((function(){return{min:ht,max:ft,direction:lt,disabled:m,step:dt,included:Y,includedStart:Zt,includedEnd:Wt,range:L,tabIndex:it,ariaLabelForHandle:ot,ariaLabelledByForHandle:at,ariaValueTextFormatterForHandle:st}}),[ht,ft,lt,m,dt,Y,Zt,Wt,L,it,ot,at,st]);return s.createElement(v.Provider,{value:Yt},s.createElement("div",{ref:ct,className:c()(l,d,(n={},(0,r.Z)(n,"".concat(l,"-disabled"),m),(0,r.Z)(n,"".concat(l,"-vertical"),Z),(0,r.Z)(n,"".concat(l,"-horizontal"),!Z),(0,r.Z)(n,"".concat(l,"-with-marks"),gt.length),n)),style:p,onMouseDown:function(t){t.preventDefault();var e,n=ct.current.getBoundingClientRect(),r=n.width,i=n.height,o=n.left,a=n.top,s=n.bottom,u=n.right,c=t.clientX,l=t.clientY;switch(lt){case"btt":e=(s-l)/i;break;case"ttb":e=(l-a)/i;break;case"rtl":e=(u-c)/r;break;default:e=(c-o)/r}Ct(yt(ht+e*(ft-ht)))}},s.createElement("div",{className:"".concat(l,"-rail"),style:$}),s.createElement(A,{prefixCls:l,style:X,values:Vt,startPoint:q,onStartMove:It?jt:null}),s.createElement(O,{prefixCls:l,marks:gt,dots:et,style:Q,activeStyle:J}),s.createElement(E,{ref:ut,prefixCls:l,style:K,values:Ft,draggingIndex:Rt,onStartMove:jt,onOffsetChange:function(t,e){if(!m){var n=bt(Et,t,e);null==z||z(Tt(Et)),At(n.values),null==F||F(Tt(n.values)),Pt(n.value)}},onFocus:b,onBlur:x,handleRender:nt}),s.createElement(k,{prefixCls:l,marks:gt,onClick:Ct})))}));var I=P},34084:function(t,e,n){"use strict";n.d(e,{Z:function(){return C}});var r,i=n(87462),o=n(15671),a=n(43144),s=n(79340),u=n(98557),c=n(67294),l=n(4942),h=n(1413),f=n(71002),d=n(29439),p=n(44925),g=n(48717),m=n(8410),v=n(75164),y=n(21770),b=n(94184),x=n.n(b),w="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n",_=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],S={};function E(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&S[n])return S[n];var r=window.getComputedStyle(t),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s=_.map((function(t){return"".concat(t,":").concat(r.getPropertyValue(t))})).join(";"),u={sizingStyle:s,paddingSize:o,borderSize:a,boxSizing:i};return e&&n&&(S[n]=u),u}var M=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],T=c.forwardRef((function(t,e){var n=t.prefixCls,o=void 0===n?"rc-textarea":n,a=(t.onPressEnter,t.defaultValue),s=t.value,u=t.autoSize,b=t.onResize,_=t.className,S=t.style,T=t.disabled,A=t.onChange,C=(t.onInternalAutoSize,(0,p.Z)(t,M)),k=(0,y.Z)(a,{value:s,postState:function(t){return null!=t?t:""}}),N=(0,d.Z)(k,2),O=N[0],P=N[1],I=c.useRef();c.useImperativeHandle(e,(function(){return{textArea:I.current}}));var L=c.useMemo((function(){return u&&"object"===(0,f.Z)(u)?[u.minRows,u.maxRows]:[]}),[u]),D=(0,d.Z)(L,2),R=D[0],z=D[1],F=!!u,B=c.useState(2),j=(0,d.Z)(B,2),U=j[0],V=j[1],H=c.useState(),G=(0,d.Z)(H,2),Z=G[0],W=G[1],Y=function(){V(0)};(0,m.Z)((function(){F&&Y()}),[s,R,z,F]),(0,m.Z)((function(){if(0===U)V(1);else if(1===U){var t=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),t.getAttribute("wrap")?r.setAttribute("wrap",t.getAttribute("wrap")):r.removeAttribute("wrap");var o=E(t,e),a=o.paddingSize,s=o.borderSize,u=o.boxSizing,c=o.sizingStyle;r.setAttribute("style","".concat(c,";").concat(w)),r.value=t.value||t.placeholder||"";var l,h=void 0,f=void 0,d=r.scrollHeight;if("border-box"===u?d+=s:"content-box"===u&&(d-=a),null!==n||null!==i){r.value=" ";var p=r.scrollHeight-a;null!==n&&(h=p*n,"border-box"===u&&(h=h+a+s),d=Math.max(h,d)),null!==i&&(f=p*i,"border-box"===u&&(f=f+a+s),l=d>f?"":"hidden",d=Math.min(f,d))}var g={height:d,overflowY:l,resize:"none"};return h&&(g.minHeight=h),f&&(g.maxHeight=f),g}(I.current,!1,R,z);V(2),W(t)}else!function(){try{if(document.activeElement===I.current){var t=I.current,e=t.selectionStart,n=t.selectionEnd,r=t.scrollTop;I.current.setSelectionRange(e,n),I.current.scrollTop=r}}catch(t){}}()}),[U]);var q=c.useRef(),X=function(){v.Z.cancel(q.current)};c.useEffect((function(){return X}),[]);var K=F?Z:null,$=(0,h.Z)((0,h.Z)({},S),K);return 0!==U&&1!==U||($.overflowY="hidden",$.overflowX="hidden"),c.createElement(g.Z,{onResize:function(t){2===U&&(null==b||b(t),u&&(X(),q.current=(0,v.Z)((function(){Y()}))))},disabled:!(u||b)},c.createElement("textarea",(0,i.Z)({},C,{ref:I,style:$,className:x()(o,_,(0,l.Z)({},"".concat(o,"-disabled"),T)),disabled:T,value:O,onChange:function(t){P(t.target.value),null==A||A(t)}})))})),A=T,C=function(t){(0,s.Z)(n,t);var e=(0,u.Z)(n);function n(t){var r;(0,o.Z)(this,n),(r=e.call(this,t)).resizableTextArea=void 0,r.focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(t){r.resizableTextArea=t},r.handleChange=function(t){var e=r.props.onChange;r.setValue(t.target.value),e&&e(t)},r.handleKeyDown=function(t){var e=r.props,n=e.onPressEnter,i=e.onKeyDown;13===t.keyCode&&n&&n(t),i&&i(t)};var i=void 0===t.value||null===t.value?t.defaultValue:t.value;return r.state={value:i},r}return(0,a.Z)(n,[{key:"setValue",value:function(t,e){"value"in this.props||this.setState({value:t},e)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return c.createElement(A,(0,i.Z)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(t){return"value"in t?{value:t.value}:null}}]),n}(c.Component)},26326:function(t,e,n){"use strict";n.d(e,{G:function(){return f},Z:function(){return p}});var r=n(87462),i=n(71002),o=n(1413),a=n(44925),s=n(67294),u=n(99224),c=n(43159),l=n(94184),h=n.n(l);function f(t){var e=t.showArrow,n=t.arrowContent,r=t.children,i=t.prefixCls,o=t.id,a=t.overlayInnerStyle,u=t.className,c=t.style;return s.createElement("div",{className:h()("".concat(i,"-content"),u),style:c},!1!==e&&s.createElement("div",{className:"".concat(i,"-arrow"),key:"arrow"},n),s.createElement("div",{className:"".concat(i,"-inner"),id:o,role:"tooltip",style:a},"function"==typeof r?r():r))}var d=function(t,e){var n=t.overlayClassName,l=t.trigger,h=void 0===l?["hover"]:l,d=t.mouseEnterDelay,p=void 0===d?0:d,g=t.mouseLeaveDelay,m=void 0===g?.1:g,v=t.overlayStyle,y=t.prefixCls,b=void 0===y?"rc-tooltip":y,x=t.children,w=t.onVisibleChange,_=t.afterVisibleChange,S=t.transitionName,E=t.animation,M=t.motion,T=t.placement,A=void 0===T?"right":T,C=t.align,k=void 0===C?{}:C,N=t.destroyTooltipOnHide,O=void 0!==N&&N,P=t.defaultVisible,I=t.getTooltipContainer,L=t.overlayInnerStyle,D=t.arrowContent,R=t.overlay,z=t.id,F=t.showArrow,B=(0,a.Z)(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),j=(0,s.useRef)(null);(0,s.useImperativeHandle)(e,(function(){return j.current}));var U=(0,o.Z)({},B);"visible"in t&&(U.popupVisible=t.visible);var V=!1,H=!1;if("boolean"==typeof O)V=O;else if(O&&"object"===(0,i.Z)(O)){var G=O.keepParent;V=!0===G,H=!1===G}return s.createElement(u.Z,(0,r.Z)({popupClassName:n,prefixCls:b,popup:function(){return s.createElement(f,{showArrow:F,arrowContent:D,key:"content",prefixCls:b,id:z,overlayInnerStyle:L},R)},action:h,builtinPlacements:c.C,popupPlacement:A,ref:j,popupAlign:k,getPopupContainer:I,onPopupVisibleChange:w,afterPopupVisibleChange:_,popupTransitionName:S,popupAnimation:E,popupMotion:M,defaultPopupVisible:P,destroyPopupOnHide:V,autoDestroy:H,mouseLeaveDelay:m,popupStyle:v,mouseEnterDelay:p},U),x)},p=(0,s.forwardRef)(d)},43159:function(t,e,n){"use strict";n.d(e,{C:function(){return o}});var r={adjustX:1,adjustY:1},i=[0,0],o={left:{points:["cr","cl"],overflow:r,offset:[-4,0],targetOffset:i},right:{points:["cl","cr"],overflow:r,offset:[4,0],targetOffset:i},top:{points:["bc","tc"],overflow:r,offset:[0,-4],targetOffset:i},bottom:{points:["tc","bc"],overflow:r,offset:[0,4],targetOffset:i},topLeft:{points:["bl","tl"],overflow:r,offset:[0,-4],targetOffset:i},leftTop:{points:["tr","tl"],overflow:r,offset:[-4,0],targetOffset:i},topRight:{points:["br","tr"],overflow:r,offset:[0,-4],targetOffset:i},rightTop:{points:["tl","tr"],overflow:r,offset:[4,0],targetOffset:i},bottomRight:{points:["tr","br"],overflow:r,offset:[0,4],targetOffset:i},rightBottom:{points:["bl","br"],overflow:r,offset:[4,0],targetOffset:i},bottomLeft:{points:["tl","bl"],overflow:r,offset:[0,4],targetOffset:i},leftBottom:{points:["br","bl"],overflow:r,offset:[-4,0],targetOffset:i}}},99224:function(t,e,n){"use strict";n.d(e,{Z:function(){return oe}});var r=n(1413),i=n(87462),o=n(15671),a=n(43144),s=n(97326),u=n(79340),c=n(98557),l=n(4942),h=n(67294),f=n(73935),d=n(75164),p=n(94999),g=n(34203),m=n(42550);function v(t,e,n,r){var i=f.unstable_batchedUpdates?function(t){f.unstable_batchedUpdates(n,t)}:n;return t.addEventListener&&t.addEventListener(e,i,r),{remove:function(){t.removeEventListener&&t.removeEventListener(e,i,r)}}}var y=n(98924),b=(0,h.forwardRef)((function(t,e){var n=t.didUpdate,r=t.getContainer,i=t.children,o=(0,h.useRef)(),a=(0,h.useRef)();(0,h.useImperativeHandle)(e,(function(){return{}}));var s=(0,h.useRef)(!1);return!s.current&&(0,y.Z)()&&(a.current=r(),o.current=a.current.parentNode,s.current=!0),(0,h.useEffect)((function(){null==n||n(t)})),(0,h.useEffect)((function(){return null===a.current.parentNode&&null!==o.current&&o.current.appendChild(a.current),function(){var t,e;null===(t=a.current)||void 0===t||null===(e=t.parentNode)||void 0===e||e.removeChild(a.current)}}),[]),a.current?f.createPortal(i,a.current):null})),x=n(94184),w=n.n(x);function _(t,e,n){return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}var S=n(29439),E=n(44925),M=n(31131),T=n(63441);function A(t){var e=t.prefixCls,n=t.motion,r=t.animation,i=t.transitionName;return n||(r?{motionName:"".concat(e,"-").concat(r)}:i?{motionName:i}:null)}function C(t){var e=t.prefixCls,n=t.visible,o=t.zIndex,a=t.mask,s=t.maskMotion,u=t.maskAnimation,c=t.maskTransitionName;if(!a)return null;var l={};return(s||c||u)&&(l=(0,r.Z)({motionAppear:!0},A({motion:s,prefixCls:e,transitionName:c,animation:u}))),h.createElement(T.Z,(0,i.Z)({},l,{visible:n,removeOnLeave:!0}),(function(t){var n=t.className;return h.createElement("div",{style:{zIndex:o},className:w()("".concat(e,"-mask"),n)})}))}var k,N=n(71002),O=n(5110);function P(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 I(t){for(var e=1;e=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function xt(t){var e,n,r;if(gt.isWindow(t)||9===t.nodeType){var i=gt.getWindow(t);e={left:gt.getWindowScrollLeft(i),top:gt.getWindowScrollTop(i)},n=gt.viewportWidth(i),r=gt.viewportHeight(i)}else e=gt.offset(t),n=gt.outerWidth(t),r=gt.outerHeight(t);return e.width=n,e.height=r,e}function wt(t,e){var n=e.charAt(0),r=e.charAt(1),i=t.width,o=t.height,a=t.left,s=t.top;return"c"===n?s+=o/2:"b"===n&&(s+=o),"c"===r?a+=i/2:"r"===r&&(a+=i),{left:a,top:s}}function _t(t,e,n,r,i){var o=wt(e,n[1]),a=wt(t,n[0]),s=[a.left-o.left,a.top-o.top];return{left:Math.round(t.left-s[0]+r[0]-i[0]),top:Math.round(t.top-s[1]+r[1]-i[1])}}function St(t,e,n){return t.leftn.right}function Et(t,e,n){return t.topn.bottom}function Mt(t,e,n){var r=[];return gt.each(t,(function(t){r.push(t.replace(e,(function(t){return n[t]})))})),r}function Tt(t,e){return t[e]=-t[e],t}function At(t,e){return(/%$/.test(t)?parseInt(t.substring(0,t.length-1),10)/100*e:parseInt(t,10))||0}function Ct(t,e){t[0]=At(t[0],e.width),t[1]=At(t[1],e.height)}function kt(t,e,n,r){var i=n.points,o=n.offset||[0,0],a=n.targetOffset||[0,0],s=n.overflow,u=n.source||t;o=[].concat(o),a=[].concat(a);var c={},l=0,h=bt(u,!(!(s=s||{})||!s.alwaysByViewport)),f=xt(u);Ct(o,f),Ct(a,e);var d=_t(f,e,i,o,a),p=gt.merge(f,d);if(h&&(s.adjustX||s.adjustY)&&r){if(s.adjustX&&St(d,f,h)){var g=Mt(i,/[lr]/gi,{l:"r",r:"l"}),m=Tt(o,0),v=Tt(a,0);(function(t,e,n){return t.left>n.right||t.left+e.widthn.bottom||t.top+e.height=n.left&&i.left+o.width>n.right&&(o.width-=i.left+o.width-n.right),r.adjustX&&i.left+o.width>n.right&&(i.left=Math.max(n.right-o.width,n.left)),r.adjustY&&i.top=n.top&&i.top+o.height>n.bottom&&(o.height-=i.top+o.height-n.bottom),r.adjustY&&i.top+o.height>n.bottom&&(i.top=Math.max(n.bottom-o.height,n.top)),gt.mix(i,o)}(d,f,h,c))}return p.width!==f.width&>.css(u,"width",gt.width(u)+p.width-f.width),p.height!==f.height&>.css(u,"height",gt.height(u)+p.height-f.height),gt.offset(u,{left:p.left,top:p.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:o,targetOffset:a,overflow:c}}function Nt(t,e,n){var r=n.target||e,i=xt(r),o=!function(t,e){var n=bt(t,e),r=xt(t);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return kt(t,i,n,o)}Nt.__getOffsetParent=vt,Nt.__getVisibleRectForElement=bt;var Ot=n(18446),Pt=n.n(Ot),It=n(91033);function Lt(t,e){var n=null,r=null;var i=new It.Z((function(t){var i=(0,S.Z)(t,1)[0].target;if(document.documentElement.contains(i)){var o=i.getBoundingClientRect(),a=o.width,s=o.height,u=Math.floor(a),c=Math.floor(s);n===u&&r===c||Promise.resolve().then((function(){e({width:u,height:c})})),n=u,r=c}}));return t&&i.observe(t),function(){i.disconnect()}}function Dt(t){return"function"!=typeof t?null:t()}function Rt(t){return"object"===(0,N.Z)(t)&&t?t:null}var zt=function(t,e){var n=t.children,r=t.disabled,i=t.target,o=t.align,a=t.onAlign,s=t.monitorWindowResize,u=t.monitorBufferTime,c=void 0===u?0:u,l=h.useRef({}),f=h.useRef(),d=h.Children.only(n),g=h.useRef({});g.current.disabled=r,g.current.target=i,g.current.align=o,g.current.onAlign=a;var y=function(t,e){var n=h.useRef(!1),r=h.useRef(null);function i(){window.clearTimeout(r.current)}return[function o(a){if(i(),n.current&&!0!==a)r.current=window.setTimeout((function(){n.current=!1,o()}),e);else{if(!1===t())return;n.current=!0,r.current=window.setTimeout((function(){n.current=!1}),e)}},function(){n.current=!1,i()}]}((function(){var t=g.current,e=t.disabled,n=t.target,r=t.align,i=t.onAlign;if(!e&&n){var o,a=f.current,s=Dt(n),u=Rt(n);l.current.element=s,l.current.point=u,l.current.align=r;var c=document.activeElement;return s&&(0,O.Z)(s)?o=Nt(a,s,r):u&&(o=function(t,e,n){var r,i,o=gt.getDocument(t),a=o.defaultView||o.parentWindow,s=gt.getWindowScrollLeft(a),u=gt.getWindowScrollTop(a),c=gt.viewportWidth(a),l=gt.viewportHeight(a),h={left:r="pageX"in e?e.pageX:s+e.clientX,top:i="pageY"in e?e.pageY:u+e.clientY,width:0,height:0},f=r>=0&&r<=s+c&&i>=0&&i<=u+l,d=[n.points[0],"cc"];return kt(t,h,I(I({},n),{},{points:d}),f)}(a,u,r)),function(t,e){t!==document.activeElement&&(0,p.Z)(e,t)&&"function"==typeof t.focus&&t.focus()}(c,a),i&&o&&i(a,o),!0}return!1}),c),b=(0,S.Z)(y,2),x=b[0],w=b[1],_=h.useRef({cancel:function(){}}),E=h.useRef({cancel:function(){}});h.useEffect((function(){var t,e,n=Dt(i),r=Rt(i);f.current!==E.current.element&&(E.current.cancel(),E.current.element=f.current,E.current.cancel=Lt(f.current,x)),l.current.element===n&&((t=l.current.point)===(e=r)||t&&e&&("pageX"in e&&"pageY"in e?t.pageX===e.pageX&&t.pageY===e.pageY:"clientX"in e&&"clientY"in e&&t.clientX===e.clientX&&t.clientY===e.clientY))&&Pt()(l.current.align,o)||(x(),_.current.element!==n&&(_.current.cancel(),_.current.element=n,_.current.cancel=Lt(n,x)))})),h.useEffect((function(){r?w():x()}),[r]);var M=h.useRef(null);return h.useEffect((function(){s?M.current||(M.current=v(window,"resize",x)):M.current&&(M.current.remove(),M.current=null)}),[s]),h.useEffect((function(){return function(){_.current.cancel(),E.current.cancel(),M.current&&M.current.remove(),w()}}),[]),h.useImperativeHandle(e,(function(){return{forceAlign:function(){return x(!0)}}})),h.isValidElement(d)&&(d=h.cloneElement(d,{ref:(0,m.sQ)(d.ref,f)})),d},Ft=h.forwardRef(zt);Ft.displayName="Align";var Bt=Ft,jt=n(8410),Ut=n(74165),Vt=n(15861),Ht=n(30470),Gt=["measure","alignPre","align",null,"motion"],Zt=h.forwardRef((function(t,e){var n=t.visible,o=t.prefixCls,a=t.className,s=t.style,u=t.children,c=t.zIndex,l=t.stretch,f=t.destroyPopupOnHide,p=t.forceRender,g=t.align,m=t.point,v=t.getRootDomNode,y=t.getClassNameFromAlign,b=t.onAlign,x=t.onMouseEnter,_=t.onMouseLeave,E=t.onMouseDown,M=t.onTouchStart,C=t.onClick,k=(0,h.useRef)(),N=(0,h.useRef)(),O=(0,h.useState)(),P=(0,S.Z)(O,2),I=P[0],L=P[1],D=function(t){var e=h.useState({width:0,height:0}),n=(0,S.Z)(e,2),r=n[0],i=n[1];return[h.useMemo((function(){var e={};if(t){var n=r.width,i=r.height;-1!==t.indexOf("height")&&i?e.height=i:-1!==t.indexOf("minHeight")&&i&&(e.minHeight=i),-1!==t.indexOf("width")&&n?e.width=n:-1!==t.indexOf("minWidth")&&n&&(e.minWidth=n)}return e}),[t,r]),function(t){var e=t.offsetWidth,n=t.offsetHeight,r=t.getBoundingClientRect(),o=r.width,a=r.height;Math.abs(e-o)<1&&Math.abs(n-a)<1&&(e=o,n=a),i({width:e,height:n})}]}(l),R=(0,S.Z)(D,2),z=R[0],F=R[1];var B=function(t,e){var n=(0,Ht.Z)(null),r=(0,S.Z)(n,2),i=r[0],o=r[1],a=(0,h.useRef)();function s(t){o(t,!0)}function u(){d.Z.cancel(a.current)}return(0,h.useEffect)((function(){s("measure")}),[t]),(0,h.useEffect)((function(){"measure"===i&&e(),i&&(a.current=(0,d.Z)((0,Vt.Z)((0,Ut.Z)().mark((function t(){var e,n;return(0,Ut.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=Gt.indexOf(i),(n=Gt[e+1])&&-1!==e&&s(n);case 3:case"end":return t.stop()}}),t)})))))}),[i]),(0,h.useEffect)((function(){return function(){u()}}),[]),[i,function(t){u(),a.current=(0,d.Z)((function(){s((function(t){switch(i){case"align":return"motion";case"motion":return"stable"}return t})),null==t||t()}))}]}(n,(function(){l&&F(v())})),j=(0,S.Z)(B,2),U=j[0],V=j[1],H=(0,h.useState)(0),G=(0,S.Z)(H,2),Z=G[0],W=G[1],Y=(0,h.useRef)();function q(){var t;null===(t=k.current)||void 0===t||t.forceAlign()}function X(t,e){var n=y(e);I!==n&&L(n),W((function(t){return t+1})),"align"===U&&(null==b||b(t,e))}(0,jt.Z)((function(){"alignPre"===U&&W(0)}),[U]),(0,jt.Z)((function(){"align"===U&&(Z<3?q():V((function(){var t;null===(t=Y.current)||void 0===t||t.call(Y)})))}),[Z]);var K=(0,r.Z)({},A(t));function $(){return new Promise((function(t){Y.current=t}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(t){var e=K[t];K[t]=function(t,n){return V(),null==e?void 0:e(t,n)}})),h.useEffect((function(){K.motionName||"motion"!==U||V()}),[K.motionName,U]),h.useImperativeHandle(e,(function(){return{forceAlign:q,getElement:function(){return N.current}}}));var Q=(0,r.Z)((0,r.Z)({},z),{},{zIndex:c,opacity:"motion"!==U&&"stable"!==U&&n?0:void 0,pointerEvents:n||"stable"===U?void 0:"none"},s),J=!0;null==g||!g.points||"align"!==U&&"stable"!==U||(J=!1);var tt=u;return h.Children.count(u)>1&&(tt=h.createElement("div",{className:"".concat(o,"-content")},u)),h.createElement(T.Z,(0,i.Z)({visible:n,ref:N,leavedClassName:"".concat(o,"-hidden")},K,{onAppearPrepare:$,onEnterPrepare:$,removeOnLeave:f,forceRender:p}),(function(t,e){var n=t.className,i=t.style,s=w()(o,a,I,n);return h.createElement(Bt,{target:m||v,key:"popup",ref:k,monitorWindowResize:!0,disabled:J,align:g,onAlign:X},h.createElement("div",{ref:e,className:s,onMouseEnter:x,onMouseLeave:_,onMouseDownCapture:E,onTouchStartCapture:M,onClick:C,style:(0,r.Z)((0,r.Z)({},i),Q)},tt))}))}));Zt.displayName="PopupInner";var Wt=Zt,Yt=h.forwardRef((function(t,e){var n=t.prefixCls,o=t.visible,a=t.zIndex,s=t.children,u=t.mobile,c=(u=void 0===u?{}:u).popupClassName,l=u.popupStyle,f=u.popupMotion,d=void 0===f?{}:f,p=u.popupRender,g=t.onClick,m=h.useRef();h.useImperativeHandle(e,(function(){return{forceAlign:function(){},getElement:function(){return m.current}}}));var v=(0,r.Z)({zIndex:a},l),y=s;return h.Children.count(s)>1&&(y=h.createElement("div",{className:"".concat(n,"-content")},s)),p&&(y=p(y)),h.createElement(T.Z,(0,i.Z)({visible:o,ref:m,removeOnLeave:!0},d),(function(t,e){var i=t.className,o=t.style,a=w()(n,c,i);return h.createElement("div",{ref:e,className:a,onClick:g,style:(0,r.Z)((0,r.Z)({},o),v)},y)}))}));Yt.displayName="MobilePopupInner";var qt=Yt,Xt=["visible","mobile"],Kt=h.forwardRef((function(t,e){var n=t.visible,o=t.mobile,a=(0,E.Z)(t,Xt),s=(0,h.useState)(n),u=(0,S.Z)(s,2),c=u[0],l=u[1],f=(0,h.useState)(!1),d=(0,S.Z)(f,2),p=d[0],g=d[1],m=(0,r.Z)((0,r.Z)({},a),{},{visible:c});(0,h.useEffect)((function(){l(n),n&&o&&g((0,M.Z)())}),[n,o]);var v=p?h.createElement(qt,(0,i.Z)({},m,{mobile:o,ref:e})):h.createElement(Wt,(0,i.Z)({},m,{ref:e}));return h.createElement("div",null,h.createElement(C,m),v)}));Kt.displayName="Popup";var $t=Kt,Qt=h.createContext(null);function Jt(){}function te(){return""}function ee(t){return t?t.ownerDocument:window.document}var ne=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var re,ie,oe=(re=b,ie=function(t){(0,u.Z)(n,t);var e=(0,c.Z)(n);function n(t){var r,a;return(0,o.Z)(this,n),r=e.call(this,t),(0,l.Z)((0,s.Z)(r),"popupRef",h.createRef()),(0,l.Z)((0,s.Z)(r),"triggerRef",h.createRef()),(0,l.Z)((0,s.Z)(r),"portalContainer",void 0),(0,l.Z)((0,s.Z)(r),"attachId",void 0),(0,l.Z)((0,s.Z)(r),"clickOutsideHandler",void 0),(0,l.Z)((0,s.Z)(r),"touchOutsideHandler",void 0),(0,l.Z)((0,s.Z)(r),"contextMenuOutsideHandler1",void 0),(0,l.Z)((0,s.Z)(r),"contextMenuOutsideHandler2",void 0),(0,l.Z)((0,s.Z)(r),"mouseDownTimeout",void 0),(0,l.Z)((0,s.Z)(r),"focusTime",void 0),(0,l.Z)((0,s.Z)(r),"preClickTime",void 0),(0,l.Z)((0,s.Z)(r),"preTouchTime",void 0),(0,l.Z)((0,s.Z)(r),"delayTimer",void 0),(0,l.Z)((0,s.Z)(r),"hasPopupMouseDown",void 0),(0,l.Z)((0,s.Z)(r),"onMouseEnter",(function(t){var e=r.props.mouseEnterDelay;r.fireEvents("onMouseEnter",t),r.delaySetPopupVisible(!0,e,e?null:t)})),(0,l.Z)((0,s.Z)(r),"onMouseMove",(function(t){r.fireEvents("onMouseMove",t),r.setPoint(t)})),(0,l.Z)((0,s.Z)(r),"onMouseLeave",(function(t){r.fireEvents("onMouseLeave",t),r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)})),(0,l.Z)((0,s.Z)(r),"onPopupMouseEnter",(function(){r.clearDelayTimer()})),(0,l.Z)((0,s.Z)(r),"onPopupMouseLeave",(function(t){var e;t.relatedTarget&&!t.relatedTarget.setTimeout&&(0,p.Z)(null===(e=r.popupRef.current)||void 0===e?void 0:e.getElement(),t.relatedTarget)||r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)})),(0,l.Z)((0,s.Z)(r),"onFocus",(function(t){r.fireEvents("onFocus",t),r.clearDelayTimer(),r.isFocusToShow()&&(r.focusTime=Date.now(),r.delaySetPopupVisible(!0,r.props.focusDelay))})),(0,l.Z)((0,s.Z)(r),"onMouseDown",(function(t){r.fireEvents("onMouseDown",t),r.preClickTime=Date.now()})),(0,l.Z)((0,s.Z)(r),"onTouchStart",(function(t){r.fireEvents("onTouchStart",t),r.preTouchTime=Date.now()})),(0,l.Z)((0,s.Z)(r),"onBlur",(function(t){r.fireEvents("onBlur",t),r.clearDelayTimer(),r.isBlurToHide()&&r.delaySetPopupVisible(!1,r.props.blurDelay)})),(0,l.Z)((0,s.Z)(r),"onContextMenu",(function(t){t.preventDefault(),r.fireEvents("onContextMenu",t),r.setPopupVisible(!0,t)})),(0,l.Z)((0,s.Z)(r),"onContextMenuClose",(function(){r.isContextMenuToShow()&&r.close()})),(0,l.Z)((0,s.Z)(r),"onClick",(function(t){if(r.fireEvents("onClick",t),r.focusTime){var e;if(r.preClickTime&&r.preTouchTime?e=Math.min(r.preClickTime,r.preTouchTime):r.preClickTime?e=r.preClickTime:r.preTouchTime&&(e=r.preTouchTime),Math.abs(e-r.focusTime)<20)return;r.focusTime=0}r.preClickTime=0,r.preTouchTime=0,r.isClickToShow()&&(r.isClickToHide()||r.isBlurToHide())&&t&&t.preventDefault&&t.preventDefault();var n=!r.state.popupVisible;(r.isClickToHide()&&!n||n&&r.isClickToShow())&&r.setPopupVisible(!r.state.popupVisible,t)})),(0,l.Z)((0,s.Z)(r),"onPopupMouseDown",(function(){var t;r.hasPopupMouseDown=!0,clearTimeout(r.mouseDownTimeout),r.mouseDownTimeout=window.setTimeout((function(){r.hasPopupMouseDown=!1}),0),r.context&&(t=r.context).onPopupMouseDown.apply(t,arguments)})),(0,l.Z)((0,s.Z)(r),"onDocumentClick",(function(t){if(!r.props.mask||r.props.maskClosable){var e=t.target,n=r.getRootDomNode(),i=r.getPopupDomNode();(0,p.Z)(n,e)&&!r.isContextMenuOnly()||(0,p.Z)(i,e)||r.hasPopupMouseDown||r.close()}})),(0,l.Z)((0,s.Z)(r),"getRootDomNode",(function(){var t=r.props.getTriggerDOMNode;if(t)return t(r.triggerRef.current);try{var e=(0,g.Z)(r.triggerRef.current);if(e)return e}catch(t){}return f.findDOMNode((0,s.Z)(r))})),(0,l.Z)((0,s.Z)(r),"getPopupClassNameFromAlign",(function(t){var e=[],n=r.props,i=n.popupPlacement,o=n.builtinPlacements,a=n.prefixCls,s=n.alignPoint,u=n.getPopupClassNameFromAlign;return i&&o&&e.push(function(t,e,n,r){for(var i=n.points,o=Object.keys(t),a=0;a0&&(e.percent=e.loaded/e.total*100),t.onProgress(e)});var n=new FormData;t.data&&Object.keys(t.data).forEach((function(e){var r=t.data[e];Array.isArray(r)?r.forEach((function(t){n.append("".concat(e,"[]"),t)})):n.append(e,r)})),t.file instanceof Blob?n.append(t.filename,t.file,t.file.name):n.append(t.filename,t.file),e.onerror=function(e){t.onError(e)},e.onload=function(){return e.status<200||e.status>=300?t.onError(function(t,e){var n="cannot ".concat(t.method," ").concat(t.action," ").concat(e.status,"'"),r=new Error(n);return r.status=e.status,r.method=t.method,r.url=t.action,r}(t,e),y(e)):t.onSuccess(y(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);var r=t.headers||{};return null!==r["X-Requested-With"]&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach((function(t){null!==r[t]&&e.setRequestHeader(t,r[t])})),e.send(n),{abort:function(){e.abort()}}}var x=+new Date,w=0;function _(){return"rc-upload-".concat(x,"-").concat(++w)}var S=n(80334),E=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),r=t.name||"",i=t.type||"",o=i.replace(/\/.*$/,"");return n.some((function(t){var e=t.trim();if(/^\*(\/\*)?$/.test(t))return!0;if("."===e.charAt(0)){var n=r.toLowerCase(),a=e.toLowerCase(),s=[a];return".jpg"!==a&&".jpeg"!==a||(s=[".jpg",".jpeg"]),s.some((function(t){return n.endsWith(t)}))}return/\/\*$/.test(e)?o===e.replace(/\/.*$/,""):i===e||!!/^\w+$/.test(e)&&((0,S.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(e,"'.Skip for check.")),!0)}))}return!0};var M=function(t,e,n){var r=function t(r,i){r.path=i||"",r.isFile?r.file((function(t){n(t)&&(r.fullPath&&!t.webkitRelativePath&&(Object.defineProperties(t,{webkitRelativePath:{writable:!0}}),t.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(t,{webkitRelativePath:{writable:!1}})),e([t]))})):r.isDirectory&&function(t,e){var n=t.createReader(),r=[];!function t(){n.readEntries((function(n){var i=Array.prototype.slice.apply(n);r=r.concat(i),i.length?t():e(r)}))}()}(r,(function(e){e.forEach((function(e){t(e,"".concat(i).concat(r.name,"/"))}))}))};t.forEach((function(t){r(t.webkitGetAsEntry())}))},T=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],A=function(t){(0,a.Z)(n,t);var e=(0,s.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=[];return r.Children.forEach(t,(function(t){(null!=t||e.keepEmpty)&&(Array.isArray(t)?n=n.concat(o(t)):(0,i.isFragment)(t)&&t.props?n=n.concat(o(t.props.children,e)):n.push(t))})),n}},98924:function(t,e,n){"use strict";function r(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}n.d(e,{Z:function(){return r}})},94999:function(t,e,n){"use strict";function r(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}n.d(e,{Z:function(){return r}})},44958:function(t,e,n){"use strict";n.d(e,{hq:function(){return m},jL:function(){return p}});var r=n(98924),i=n(94999),o="data-rc-order",a="rc-util-key",s=new Map;function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):a}function c(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function l(t){return"queue"===t?"prependQueue":t?"prepend":"append"}function h(t){return Array.from((s.get(t)||t).children).filter((function(t){return"STYLE"===t.tagName}))}function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,r.Z)())return null;var n=e.csp,i=e.prepend,a=document.createElement("style");a.setAttribute(o,l(i)),(null==n?void 0:n.nonce)&&(a.nonce=null==n?void 0:n.nonce),a.innerHTML=t;var s=c(e),u=s.firstChild;if(i){if("queue"===i){var f=h(s).filter((function(t){return["prepend","prependQueue"].includes(t.getAttribute(o))}));if(f.length)return s.insertBefore(a,f[f.length-1].nextSibling),a}s.insertBefore(a,u)}else s.appendChild(a);return a}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=c(e);return h(n).find((function(n){return n.getAttribute(u(e))===t}))}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=d(t,e);if(n){var r=c(e);r.removeChild(n)}}function g(t,e){var n=s.get(t);if(!n||!(0,i.Z)(document,n)){var r=f("",e),o=r.parentNode;s.set(t,o),t.removeChild(r)}}function m(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=c(n);g(r,n);var i=d(e,n);if(i){var o,a,s;if((null===(o=n.csp)||void 0===o?void 0:o.nonce)&&i.nonce!==(null===(a=n.csp)||void 0===a?void 0:a.nonce))i.nonce=null===(s=n.csp)||void 0===s?void 0:s.nonce;return i.innerHTML!==t&&(i.innerHTML=t),i}var l=f(t,n);return l.setAttribute(u(n),e),l}},34203:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(73935);function i(t){return t instanceof HTMLElement?t:r.findDOMNode(t)}},5110:function(t,e){"use strict";e.Z=function(t){if(!t)return!1;if(t instanceof HTMLElement&&t.offsetParent)return!0;if(t instanceof SVGGraphicsElement&&t.getBBox){var e=t.getBBox(),n=e.width,r=e.height;if(n||r)return!0}if(t instanceof HTMLElement&&t.getBoundingClientRect){var i=t.getBoundingClientRect(),o=i.width,a=i.height;if(o||a)return!0}return!1}},15105:function(t,e){"use strict";var n={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var e=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||e>=n.F1&&e<=n.F12)return!1;switch(e){case n.ALT:case n.CAPS_LOCK:case n.CONTEXT_MENU:case n.CTRL:case n.DOWN:case n.END:case n.ESC:case n.HOME:case n.INSERT:case n.LEFT:case n.MAC_FF_META:case n.META:case n.NUMLOCK:case n.NUM_CENTER:case n.PAGE_DOWN:case n.PAGE_UP:case n.PAUSE:case n.PRINT_SCREEN:case n.RIGHT:case n.SHIFT:case n.UP:case n.WIN_KEY:case n.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=n.ZERO&&t<=n.NINE)return!0;if(t>=n.NUM_ZERO&&t<=n.NUM_MULTIPLY)return!0;if(t>=n.A&&t<=n.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===t)return!0;switch(t){case n.SPACE:case n.QUESTION_MARK:case n.NUM_PLUS:case n.NUM_MINUS:case n.NUM_PERIOD:case n.NUM_DIVISION:case n.SEMICOLON:case n.DASH:case n.EQUALS:case n.COMMA:case n.PERIOD:case n.SLASH:case n.APOSTROPHE:case n.SINGLE_QUOTE:case n.OPEN_SQUARE_BRACKET:case n.BACKSLASH:case n.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};e.Z=n},38135:function(t,e,n){"use strict";var r;n.d(e,{s:function(){return m},v:function(){return x}});var i,o=n(74165),a=n(15861),s=n(71002),u=n(1413),c=n(73935),l=(0,u.Z)({},r||(r=n.t(c,2))),h=l.version,f=l.render,d=l.unmountComponentAtNode;try{Number((h||"").split(".")[0])>=18&&(i=l.createRoot)}catch(t){}function p(t){var e=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&"object"===(0,s.Z)(e)&&(e.usingClientEntryPoint=t)}var g="__rc_react_root__";function m(t,e){i?function(t,e){p(!0);var n=e[g]||i(e);p(!1),n.render(t),e[g]=n}(t,e):function(t,e){f(t,e)}(t,e)}function v(t){return y.apply(this,arguments)}function y(){return(y=(0,a.Z)((0,o.Z)().mark((function t(e){return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve().then((function(){var t;null===(t=e[g])||void 0===t||t.unmount(),delete e[g]})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function b(t){d(t)}function x(t){return w.apply(this,arguments)}function w(){return(w=(0,a.Z)((0,o.Z)().mark((function t(e){return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===i){t.next=2;break}return t.abrupt("return",v(e));case 2:b(e);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},66680:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(67294);function i(t){var e=r.useRef();e.current=t;var n=r.useCallback((function(){for(var t,n=arguments.length,r=new Array(n),i=0;i
    '),u=n?n.backgroundColor:void 0,l=n?n.padding:void 0;l?(0,x.isNumber)(l)&&(l=[l,l,l,l]):l=[0,0,0,0];var c=i+l[0]+l[2],h=o+l[1]+l[3],d={container:s,height:c,width:h,quickHit:!0},f="svg"===a?new Rh(d):new Ic(d),p=this.get("group").clone(),m=(0,x.clone)(p.getMatrix());m||(m=[1,0,0,0,1,0,0,0,1]);var g=(r.maxX+r.minX)/2,v=(r.maxY+r.minY)/2;m=Lf(m,[["t",-g,-v],["t",o/2+l[3],i/2+l[0]]]),p.resetMatrix(),p.setMatrix(m),f.add(p);var y=f.get("el"),b="";e||(e="image/png"),setTimeout((function(){if("svg"===a){var n=y.cloneNode(!0),r=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",r);i.replaceChild(n,i.documentElement);var o=(new XMLSerializer).serializeToString(i);b="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(o))}else{var s=void 0,l=y.getContext("2d"),d=void 0;if(u){var f="undefined"!=typeof window?window.devicePixelRatio:1;try{s=l.getImageData(0,0,h*f,c*f),d=l.globalCompositeOperation,l.globalCompositeOperation="destination-over",l.fillStyle=u,l.fillRect(0,0,h,c)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}b=y.toDataURL(e),u&&(l.clearRect(0,0,h,c),l.putImageData(s,0,0),l.globalCompositeOperation=d)}t&&t(b)}),16)},e.prototype.downloadFullImage=function(t,e,n){var r=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=Uh('
    '),l=document.querySelector(".g6-graph-watermarker"),c=n?n.backgroundColor:void 0,h=n?n.padding:void 0;h?(0,x.isNumber)(h)&&(h=[h,h,h,h]):h=[0,0,0,0];var d=o+h[0]+h[2],f=a+h[1]+h[3];if(l){var p=this.get("graphWaterMarker").cfg||{},m=p.width,g=p.height;d=Math.ceil(d/g)*g,f=Math.ceil(f/m)*m}var v,y,b={container:u,height:d,width:f},w="svg"===s?new Rh(b):new Ic(b),_=this.get("group"),S=(y=(v=_).clone(),Wd(v,y),y),E=(0,x.clone)(S.getMatrix());E||(E=[1,0,0,0,1,0,0,0,1]);var M=(i.maxX+i.minX)/2,A=(i.maxY+i.minY)/2;E=Lf(E,[["t",-M,-A],["t",a/2+h[3],o/2+h[0]]]),S.resetMatrix(),S.setMatrix(E),w.add(S);var C=w.get("el");e||(e="image/png"),this.asyncToDataUrl(e,c,(function(n){var i=document.createElement("a"),o=(t||"graph")+("svg"===s?".svg":".".concat(e.split("/")[1]));r.dataURLToImage(n,s,i,o);var a=document.createEvent("MouseEvents");a.initEvent("click",!1,!1),i.dispatchEvent(a)}),f,d,C)},e.prototype.downloadImage=function(t,e,n){var r=this,i=this;i.stopAnimate();var o=i.get("canvas").getRenderer();e||(e="image/png");var a=(t||"graph")+("svg"===o?".svg":".".concat(e.split("/")[1])),s=document.createElement("a");i.asyncToDataUrl(e,n,(function(t){r.dataURLToImage(t,o,s,a);var e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),s.dispatchEvent(e)}))},e.prototype.dataURLToImage=function(t,e,n,r){if(t&&"data:"!==t){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,l=new Uint8Array(u);u--;)l[u]=s.charCodeAt(u);var c=new Blob([l],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(c,r):n.addEventListener("click",(function(){n.download=r,n.href=window.URL.createObjectURL(c)}))}else n.addEventListener("click",(function(){n.download=r,n.href=t}))}else console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items")},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),n=e.indexOf(t);n>=0&&(t.destroyPlugin(),e.splice(n,1))},e.prototype.setImageWaterMarker=function(t,e){void 0===t&&(t=Gd.waterMarkerImage);var n=this.get("container");(0,x.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=(0,x.deepMix)({},Gd.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.image;if(!t){var l=s?n:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(r&&r.clear())}if(r)r.clear();else{var c={container:n,width:o,height:a,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h,window.devicePixelRatio=h),r=new Ic(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var d=r.get("context"),f=u.rotate,p=u.x,m=u.y;d.rotate(-f*Math.PI/180);var g=new Image;g.crossOrigin="anonymous",g.src=t,g.onload=function(){if(d.drawImage(g,p,m,u.width,u.height),d.rotate(f*Math.PI/180),s)n.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var t=document.querySelector(".g6-graph-watermarker");t||((t=document.createElement("div")).className="g6-graph-watermarker"),t.className="g6-graph-watermarker",r.destroyed||(t.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),n.appendChild(t))}}},e.prototype.setTextWaterMarker=function(t,e){var n=this.get("container");(0,x.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=(0,x.deepMix)({},Gd.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!(null==t?void 0:t.length)){var l=s?n:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(r&&r.clear())}if(r)r.clear();else{var c={container:n,width:o,height:a,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h,window.devicePixelRatio=h),r=new Ic(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var d=r.get("context"),f=u.rotate,p=u.fill,m=u.fontFamily,g=u.fontSize,v=u.baseline,y=u.x,b=u.y,w=u.lineHeight;d.rotate(-f*Math.PI/180),d.font="".concat(g,"px ").concat(m),d.fillStyle=p,d.textBaseline=v;for(var _=(0,x.isString)(t)?[t]:t,S=_.length-1;S>=0;S--)d.fillText(_[S],y,b+S*w);if(d.rotate(f*Math.PI/180),s)n.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var E=document.querySelector(".g6-graph-watermarker");E||((E=document.createElement("div")).className="g6-graph-watermarker"),E.style.cssText="background-image: url(".concat(r.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),n.appendChild(E)}},e.prototype.destroy=function(){var e,n,r,i;(0,x.each)(this.get("plugins"),(function(t){t.destroyPlugin()}));var o=this.get("tooltips");if(o)for(var a=0;a0)for(var l=u.length-1;l>=0;l--){var c=u[l].getModel();-1===e.indexOfChild(t.children||[],c.id)&&(i.innerRemoveChild(c.id,{x:t.x,y:t.y},r),u.splice(l,1))}o.get("originAttrs")&&(a=o.get("originAttrs").x,s=o.get("originAttrs").y);var h=o.getModel();r&&o.set("originAttrs",{x:h.x,y:h.y}),o.set("model",Object.assign(h,t.data)),a===t.x&&s===t.y||o.updatePosition({x:t.x,y:t.y})}else i.innerAddChild(t,n,r)},e.prototype.innerRemoveChild=function(t,e,n){var r=this,i=r.findById(t);if(i)if((0,x.each)(i.get("children"),(function(t){r.innerRemoveChild(t.getModel().id,e,n)})),n){var o=i.getModel();i.set("to",e),i.set("originAttrs",{x:o.x,y:o.y}),r.get("removeList").push(i)}else r.removeItem(i,!1)},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var n=this;this.getNodes().map((function(t){return n.clearItemStates(t)})),this.getEdges().map((function(t){return n.clearItemStates(t)})),e&&this.get("enabledStack")&&this.pushStack("changedata",{before:n.get("originData"),after:t||n.get("data")}),t?(n.data(t),n.render(!1)):n.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");this.updateLayout(t)},e.prototype.updateLayout=function(t,e,n,r){void 0===r&&(r=!0);var i=this;if(t){if(r&&this.get("enabledStack")&&this.pushStack("layout",{before:i.get("layout"),after:t}),i.set("layout",t),i.set("layoutMethod",i.getLayout()),i.layout(),e){var o=n;o||(o="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),o=this.getPointByCanvas(o.x,o.y);var a=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];o.x=o.x*a[0]+a[6],o.y=o.y*a[0]+a[7];var s=this.getGroup().getCanvasBBox(),u=s.minX,l=s.maxX,c=s.minY,h={x:(u+l)/2,y:(c+s.maxY)/2};"begin"===e&&(h.x=u,h.y=c),this.translate(o.x-h.x,o.y-h.y)}}else console.warn("layout cannot be null")},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");this.layout(t)},e.prototype.layout=function(t){var e=this,n=this,r=n.get("data"),i=n.get("layoutMethod"),o=n.get("layout"),a=r;if(null==o?void 0:o.excludeInvisibles){r=(0,x.clone)(n.get("data"));var s={};jf(r,(function(t){var n=t.children;if(!(null==n?void 0:n.length))return!0;for(var r=n.length-1;r>=0;r--){var i=e.findById(n[r].id);(i?!i.isVisible():!1===n[r].visible)&&(s[t.id]=s[t.id]||[],s[t.id].push({idx:r,child:n.splice(r,1)[0]}))}})),a=i?i(r,n.get("layout")):r,jf(a,(function(t){var e=s[t.id];if(null==e?void 0:e.length)for(var n=e.length-1;n>=0;n--){var r=e[n],i=r.idx,o=r.child;t.children.splice(i,0,o)}}))}else a=i?i(r,n.get("layout")):r;var u=n.get("animate");(n.emit("beforerefreshlayout",{data:r,layoutData:a}),n.emit("beforelayout"),n.innerUpdateChild(a,void 0,u),t)&&n.get("viewController").fitView();u?n.layoutAnimate(a):(n.refresh(),n.paint()),n.emit("afterrefreshlayout",{data:r,layoutData:a}),n.emit("afterlayout")},e.prototype.addChild=function(t,e,n){void 0===n&&(n=!0);var r=this;r.emit("beforeaddchild",{model:t,parent:e}),(0,x.isString)(e)||(e=e.get("id"));var i=r.findDataById(e);i&&(i.children||(i.children=[]),i.children.push(t),r.findById(e).refresh(),r.changeData(void 0,n))},e.prototype.updateChildren=function(t,e,n){void 0===n&&(n=!0);var r=this,i=r.findById(e);e&&i?(r.findDataById(e).children=t,i.refresh(),r.changeData(void 0,n)):console.warn("Update children failed! There is no node with id '".concat(e,"'"))},e.prototype.updateChild=function(t,n,r){void 0===r&&(r=!0);var i=this;if(n&&i.findById(n)){var o=i.findDataById(n),a=i.findById(t.id);if(o.children||(o.children=[]),a){var s=e.indexOfChild(o.children,t.id);s>-1&&(o.children[s]=t)}else o.children.push(t);var u=i.findById(n);null==u||u.refresh(),i.changeData(void 0,r)}else i.changeData(t,r)},e.prototype.removeChild=function(t,n){void 0===n&&(n=!0);var r,i=this,o=i.findById(t);if((r=o?null==o?void 0:o.get("parent"):i.getNodes().find((function(e){return!!(e.getModel().children||[]).find((function(e){return e.id===t}))})))&&!r.destroyed){var a=r.get("id"),s=i.findDataById(a),u=s&&s.children||[],l=e.indexOfChild(u,t);u.splice(l,1),r.refresh()}i.changeData(void 0,n)},e.prototype.findDataById=function(t,e){var n=this;if(e||(e=n.get("data")),t===e.id)return e;var r=null;return(0,x.each)(e.children||[],(function(e){return e.id===t?(r=e,!1):!(r=n.findDataById(t,e))&&void 0})),r},e.prototype.layoutAnimate=function(t,e){var n=this,r=this.get("animateCfg");n.emit("beforeanimate",{data:t}),n.getEdges().forEach((function(t){var e=t.get("model");e.sourceAnchor||(e.sourceAnchor=t.get("sourceAnchorIndex"))})),this.get("canvas").animate((function(r){jf(t,(function(i){var o=n.findById(i.id);if(o){var a=o.get("originAttrs"),s=o.get("model");if(a||(a={x:s.x,y:s.y},o.set("originAttrs",a)),e){var u=e(o,r,a,t);o.set("model",Object.assign(s,u))}else s.x=a.x+(i.x-a.x)*r,s.y=a.y+(i.y-a.y)*r}return!0})),(0,x.each)(n.get("removeList"),(function(t){var e=t.getModel(),n=t.get("originAttrs"),i=t.get("to");e.x=n.x+(i.x-n.x)*r,e.y=n.y+(i.y-n.y)*r})),n.refreshPositions()}),{duration:r.duration,easing:r.ease,callback:function(){(0,x.each)(n.getNodes(),(function(t){t.set("originAttrs",null)})),(0,x.each)(n.get("removeList"),(function(t){n.removeItem(t,!1)})),n.set("removeList",[]),r.callback&&r.callback(),n.emit("afteranimate",{data:t})},delay:r.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){void 0===t&&(t=!0);var e=this,n=e.get("data");if(!n||!(0,x.isObject)(n)||!Object.keys(n).length)throw new Error("data must be defined first");e.clear(),t&&this.get("enabledStack")&&this.clearStack(),e.emit("beforerender"),e.layout(this.get("fitView")),e.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(e){t.prototype.data.call(this,e),this.set("originData",Bf(e))},e}(Df);const Hf=Vf;function Gf(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}var Wf=function(){function t(t){this._cfgs=(0,x.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return t.prototype.getDefaultCfgs=function(){return{}},t.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var n=e.getEvents(),r={};(0,x.each)(n,(function(n,i){var o=(0,x.wrapBehavior)(e,n);r[i]=o,t.on(i,o)})),this._events=r,this.init()},t.prototype.getEvents=function(){return{}},t.prototype.get=function(t){var e;return null===(e=this._cfgs)||void 0===e?void 0:e[t]},t.prototype.set=function(t,e){this._cfgs[t]=e},t.prototype.destroy=function(){},t.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,x.each)(e,(function(e,n){t.off(n,e)})),this._events=null,this._cfgs=null,this.destroyed=!0},t}();const Xf=Wf;var Yf,qf=(Yf=function(t,e){return Yf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Yf(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Yf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),$f="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",Kf=function(t){function e(e){return t.call(this,e)||this}return qf(e,t),e.prototype.getDefaultCfgs=function(){return{img:$f,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),e=t.get("container"),n=t.get("canvas").get("el"),r=this.get("img")||$f;r.includes("url(")||(r='url("'.concat(r,'")'));var i=Uh("
    "),o=Uh(""));this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),e.insertBefore(i,n)},e.prototype.positionInit=function(){var t=this.get("graph"),e=t.get("minZoom"),n=t.get("width"),r=t.get("height");Gf(this.get("container"),{width:"".concat(n,"px"),height:"".concat(r,"px")});var i=80*n/e,o=80*r/e;Gf(this.get("gridContainer"),{width:"".concat(i,"px"),height:"".concat(o,"px"),left:"-".concat(i/2,"px"),top:"-".concat(o/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var e=this.get("gridContainer"),n=t.matrix;n||(n=[1,0,0,0,1,0,0,0,1]);var r=this.get("follow");Gf(e,{transform:"matrix(".concat(n[0],", ").concat(n[1],", ").concat(n[3],", ").concat(n[4],", ").concat(r?n[6]:"0",", ").concat(r?n[7]:"0",")")})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(Xf);const Zf=Kf;var Qf=n(79238),Jf=n.n(Qf),tp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();"undefined"!=typeof document&&Jf()("\n .g6-component-contextmenu {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .g6-contextmenu-ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n");var ep=function(t){function e(e){return t.call(this,e)||this}return tp(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n
      \n
    • 菜单项1
    • \n
    • 菜单项2
    • \n
    \n "},shouldBegin:function(t){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),e=Uh("
    "));Gf(e,{top:"0px",position:"absolute",visibility:"hidden"});var n=this.get("container");n||(n=this.get("graph").get("container")),(0,x.isString)(n)&&(n=document.getElementById(n)),n.appendChild(e),this.set("menu",e)},e.prototype.onMenuShow=function(t){var e=this;t.preventDefault();var n=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&-1===n.indexOf(t.item.getType()))return void e.onMenuHide()}else if(-1===n.indexOf("canvas"))return void e.onMenuHide();if(this.get("shouldBegin")(t)){var r=this.get("menu"),i=this.get("getContent"),o=this.get("graph"),a=i(t,o);(0,x.isString)(a)?r.innerHTML=a:r.innerHTML=a.outerHTML,this.removeMenuEventListener();var s=this.get("handleMenuClick");if(s){var u=function(e){s(e.target,t.item,o)};this.set("handleMenuClickWrapper",u),r.addEventListener("click",u)}var l=o.get("width"),c=o.get("height"),h=r.getBoundingClientRect(),d=this.get("offsetX")||0,f=this.get("offsetY")||0,p=o.getContainer().offsetTop,m=o.getContainer().offsetLeft,g=t.canvasX+m+d,v=t.canvasY+p+f;g+h.width>l&&(g=t.canvasX-h.width-d+m),v+h.height>c&&(v=t.canvasY-h.height-f+p),v<0&&(v=0),Gf(r,{top:"".concat(v,"px"),left:"".concat(g,"px"),visibility:"visible"});var y="click"===this.get("trigger"),b=function(t){y?y=!1:e.onMenuHide()};document.body.addEventListener("click",b),this.set("handler",b)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),e=this.get("handler");t&&(this.get("menu").removeEventListener("click",t),this.set("handleMenuClickWrapper",null));e&&document.body.removeEventListener("click",e)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&Gf(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,x.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(Xf);const np=ep;var rp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ip=function(){return ip=Object.assign||function(t){for(var e,n=1,r=arguments.length;n-1,a=navigator.userAgent.toLowerCase().indexOf("safari")>-1,s=Uh("\n ")),u=0,l=0,c=!1,h=0,d=0,f=0,p=0,m=0,g=0,v=a||o?"mousedown":"dragstart";s.addEventListener(v,(function(i){var o,a;if(i.dataTransfer){var v=new Image;v.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",null===(a=(o=i.dataTransfer).setDragImage)||void 0===a||a.call(o,v,0,0);try{i.dataTransfer.setData("text/html","view-port-minimap")}catch(t){i.dataTransfer.setData("text","view-port-minimap")}}if(e.refresh=!1,i.target===s){var y=s.style;h=parseInt(y.left,10),d=parseInt(y.top,10),f=parseInt(y.width,10),p=parseInt(y.height,10),f>n[0]||p>n[1]||(g=r.getZoom(),m=t.get("ratio"),c=!0,u=i.clientX,l=i.clientY)}}),!1);var y=function(t){if(c&&!(0,x.isNil)(t.clientX)&&!(0,x.isNil)(t.clientY)){var e=u-t.clientX,i=l-t.clientY;(h-e<0||h-e+f>=n[0])&&(e=0),(d-i<0||d-i+p>=n[1])&&(i=0),d-=i,Gf(s,{left:"".concat(h-=e,"px"),top:"".concat(d,"px")}),r.translate(e*g/m,i*g/m),u=t.clientX,l=t.clientY}};a||o||s.addEventListener("drag",y,!1);var b=function(){c=!1,e.refresh=!0},w=a||o?"mouseup":"dragend";s.addEventListener(w,b,!1),i.addEventListener("mouseleave",b),i.addEventListener("mouseup",b),(a||o)&&i.addEventListener("mousemove",y,!1),this.set("viewport",s),i.appendChild(s)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("totaldx"),n=this.get("totaldy"),r=this.get("graph"),i=this.get("size"),o=r.get("canvas").get("el"),a=r.get("width")||o.scrollWidth||500,s=r.get("height")||o.scrollHeight||500,u=r.getPointByCanvas(0,0),l=r.getPointByCanvas(a,s),c=this.get("viewport");c||this.initViewport();var h=(l.x-u.x)*t,d=(l.y-u.y)*t,f=u.x*t+e,p=u.y*t+n,m=f+h,g=p+d;f<0&&(h+=f,f=0),m>i[0]&&(h-=m-i[0]),p<0&&(d+=p,p=0),g>i[1]&&(d-=g-i[1]),this.set("ratio",t),Gf(c,{left:"".concat(f,"px"),top:"".concat(p,"px"),width:"".concat(h,"px"),height:"".concat(d,"px")})}},e.prototype.updateGraphShapes=function(){var t,e=this._cfgs.graph,n=this.get("canvas"),r=e.get("group");r.destroyed||(n.clear(),this.get("hideEdge")?(t=n.addGroup(),r.get("children").forEach((function(e){e.get("id").includes("-edge")||t.add(e.clone())}))):((t=r.clone()).resetMatrix(),n.add(t)),"svg"===e.get("renderer")&&this.updateVisible(t))},e.prototype.updateVisible=function(t){var e=this;if(t.isGroup()||t.get("visible")){var n=t.get("children");if(!n||!n.length)return;n.forEach((function(t){t.get("visible")||t.hide(),e.updateVisible(t)}))}else t.hide()},e.prototype.updateKeyShapes=function(){var t=this,e=this._cfgs.graph,n=this.get("canvas"),r=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,x.each)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),(0,x.each)(e.getNodes(),(function(e){t.updateOneNodeKeyShape(e,r)}));var i=e.getCombos();if(i&&i.length){var o=r.find((function(t){return"comboGroup"===t.get("name")}))||r.addGroup({name:"comboGroup"});setTimeout((function(){t.destroyed||((0,x.each)(i,(function(e){t.updateOneComboKeyShape(e,o)})),null==o||o.sort(),null==o||o.toBack(),t.updateCanvas())}),250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,e){if(!this.destroyed){var n=this.get("itemMap")||{},r=n[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};r?s=Object.assign(a,s):(r=o,e.add(r));var u=r.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),r.attr(s),t.isVisible()?r.show():r.hide(),r.exist=!0;var l=t.getModel().depth;isNaN(l)||r.set("zIndex",l),n[t.get("id")]=r,this.set("itemMap",n)}},e.prototype.updateOneNodeKeyShape=function(t,e){var n=this.get("itemMap")||{},r=n[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};r?(s=Object.assign(a,s),r.toFront()):(r=o,e.add(r));var u=r.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),r.attr(s),t.isVisible()?r.show():r.hide(),r.exist=!0;var l=t.getModel().depth;isNaN(l)||r.set("zIndex",l),n[t.get("id")]=r,this.set("itemMap",n)},e.prototype.updateDelegateShapes=function(){var t=this,e=this._cfgs.graph,n=this.get("canvas"),r=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,x.each)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e,r)})),(0,x.each)(e.getNodes(),(function(e){t.updateOneNodeDelegateShape(e,r)}));var i=e.getCombos();if(i&&i.length){var o=r.find((function(t){return"comboGroup"===t.get("name")}))||r.addGroup({name:"comboGroup"});setTimeout((function(){t.destroyed||((0,x.each)(i,(function(e){t.updateOneComboKeyShape(e,o)})),null==o||o.sort(),null==o||o.toBack(),t.updateCanvas())}),250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},e=Object.keys(t);if(e&&0!==e.length)for(var n=e.length-1;n>=0;n--){var r=t[e[n]],i=r.exist;r.exist=!1,i||(r.remove(),delete t[e[n]])}},e.prototype.updateOneEdgeKeyShape=function(t,e){var n=this.get("itemMap")||{},r=n[t.get("id")];if(r){var i=t.get("keyShape").attr("path");r.attr("path",i)}else r=t.get("keyShape").clone(),e.add(r);t.isVisible()?r.show():r.hide(),r.exist=!0,n[t.get("id")]=r,this.set("itemMap",n)},e.prototype.updateOneNodeDelegateShape=function(t,e){var n=this.get("delegateStyle"),r=this.get("itemMap")||{},i=r[t.get("id")],o=t.getBBox();if(i){var a={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(a),i.toFront()}else i=e.addShape("rect",{attrs:ip({x:o.minX,y:o.minY,width:o.width,height:o.height},n),name:"minimap-node-shape"});t.isVisible()?i.show():i.hide(),i.exist=!0,r[t.get("id")]=i,this.set("itemMap",r)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this,e=t.get("graph"),n=t.get("size"),r=t.get("className"),i=t.get("container"),o=Uh("
    "));(0,x.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(o):e.get("container").appendChild(o),t.set("container",o);var a,s=Uh('
    ');o.appendChild(s),s.addEventListener("dragenter",(function(t){t.preventDefault()})),s.addEventListener("dragover",(function(t){t.preventDefault()})),a="svg"===e.get("renderer")?new Rh({container:s,width:n[0],height:n[1]}):new Ic({container:s,width:n[0],height:n[1]}),t.set("canvas",a),t.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed&&this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("size"),n=this.get("canvas"),r=this.get("type"),i=this.get("padding");if(!n.destroyed){switch(r){case"default":this.updateGraphShapes();break;case"keyShape":this.updateKeyShapes();break;case"delegate":this.updateDelegateShapes()}var o=n.get("children")[0];if(o){o.resetMatrix();var a=o.getCanvasBBox(),s=t.get("canvas").getCanvasBBox(),u=t.getZoom()||1,l=s.width/u,c=s.height/u;Number.isFinite(a.width)&&(l=op(a.width,l),c=op(a.height,c)),l+=2*i,c+=2*i;var h=Math.min(e[0]/l,e[1]/c),d=[1,0,0,0,1,0,0,0,1],f=0,p=0;Number.isFinite(a.minX)&&(f=-a.minX),Number.isFinite(a.minY)&&(p=-a.minY);var m=(e[0]-(l-2*i)*h)/2,g=(e[1]-(c-2*i)*h)/2;d=ap(d,[["t",f,p],["s",h,h],["t",m,g]]),o.setMatrix(d),this.set("ratio",h),this.set("totaldx",m+f*h),this.set("totaldy",g+p*h),this.set("dx",m),this.set("dy",g),this.updateViewport()}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("container");(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)},e}(Xf);const up=sp;var lp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function cp(t,e,n){var r=t.x-e.x,i=t.y-e.y;return!n||Math.abs(r)>n||Math.abs(i)>n?Math.sqrt(r*r+i*i):n}function hp(t,e){var n=(e.source.y-e.target.y)/(e.source.x-e.target.x),r=(n*n*e.source.x+n*(t.y-e.source.y)+t.x)/(n*n+1);return{x:r,y:n*(r-e.source.x)+e.source.y}}var dp=function(t){function e(e){return t.call(this,e)||this}return lp(e,t),e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),e=this.get("onTick");this.set("tick",(function(){e&&e(),t.refreshPositions()}))},e.prototype.bundling=function(t){var e=this;if(e.set("data",t),!e.isTicking()){var n=t.edges||[],r=t.nodes||[],i={},o=!1;if(r.forEach((function(t){null!==t.x&&null!==!t.y&&void 0!==t.x&&void 0!==!t.y||(o=!0),i[t.id]=t})),o)throw new Error("please layout the graph or assign x and y for nodes first");e.set("nodeIdMap",i);var a=e.get("divisions"),s=e.get("divRate"),u=e.divideEdges(a);e.set("edgePoints",u);var l=e.getEdgeBundles();e.set("edgeBundles",l);for(var c=e.get("cycles"),h=e.get("iterations"),d=e.get("iterRate"),f=e.get("lambda"),p=0;pc;){var r=c/n,a={x:i[o][e-1].x,y:i[o][e-1].y};a.x+=r*(t.x-i[o][e-1].x),a.y+=r*(t.y-i[o][e-1].y),h.push(a),n-=c,c=l}c-=n}})),h.push({x:u.x,y:u.y}),i[o]=h}})),i},e.prototype.getEdgeLength=function(t){var e=0;return t.forEach((function(n,r){0!==r&&(e+=cp(n,t[r-1]))})),e},e.prototype.getEdgeBundles=function(){var t=this,e=t.get("data").edges||[],n=t.get("bundleThreshold"),r=t.get("nodeIdMap"),i=t.get("edgeBundles");return i||(i=[]),e.forEach((function(t,e){i[e]&&void 0!==i[e]||(i[e]=[])})),e.forEach((function(o,a){var s=r[o.source],u=r[o.target];e.forEach((function(e,o){if(!(o<=a)){var l=r[e.source],c=r[e.target];t.getBundleScore({source:s,target:u},{source:l,target:c})>=n&&(i[a].push(o),i[o].push(a))}}))})),i},e.prototype.getBundleScore=function(t,e){var n=this;return t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,t.length=cp({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=cp({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),n.getAngleScore(t,e)*n.getScaleScore(t,e)*n.getPositionScore(t,e)*n.getVisibilityScore(t,e)},e.prototype.getAngleScore=function(t,e){var n=function(t,e){return t.x*e.x+t.y*e.y}({x:t.vx,y:t.vy},{x:e.vx,y:e.vy});return n/(t.length*e.length)},e.prototype.getScaleScore=function(t,e){var n=(t.length+e.length)/2;return 2/(n/Math.min(t.length,e.length)+Math.max(t.length,e.length)/n)},e.prototype.getPositionScore=function(t,e){var n=(t.length+e.length)/2;return n/(n+cp({x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},{x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2}))},e.prototype.getVisibilityScore=function(t,e){var n=this.getEdgeVisibility(t,e),r=this.getEdgeVisibility(e,t);return nr||Math.abs(i.y)>r){var a=1/cp(o[n][t],o[e][t]);s.x+=i.x*a,s.y+=i.y*a}})),s},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),t.prototype.destroy.call(this)},e}(Xf);const fp=dp;var pp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mp=function(){return mp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n(a||r.get("height"))&&n>1||u<(s||.05*r.get("height"))&&n<1)&&(n=1),u*=n,e.set("r",u),e.set("r2",u*u);var l=e.get("d");e.set("molecularParam",(l+1)*u),e.set("delegateCenterDiff",void 0),e.magnify(t,o)}},e.prototype.scaleRByDrag=function(t){var e=this;if(t){var n,r=e.get("dragPrePos"),i=e.get("graph"),o=i.getPointByClient(t.clientX,t.clientY);n=t.x-r.x<0?.95:1/.95;var a=e.get("maxR"),s=e.get("minR"),u=e.get("r");(u>(a||i.get("height"))&&n>1||u<(s||.05*i.get("height"))&&n<1)&&(n=1),u*=n,e.set("r",u),e.set("r2",u*u);var l=e.get("d");e.set("molecularParam",(l+1)*u),e.magnify(t,o),e.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){var e=this;if(t||t.originalEvent){t.preventDefault&&t.preventDefault();var n=0;n=t.originalEvent.wheelDelta<0?-.1:.1;var r=e.get("d")+n,i=e.get("maxD"),o=e.get("minD");if(ro){e.set("d",r);var a=e.get("r");e.set("molecularParam",(r+1)*a);var s=e.get("delegate"),u=s?{x:s.attr("x"),y:s.attr("y")}:void 0;e.set("delegateCenterDiff",void 0),e.magnify(t,u)}}},e.prototype.scaleDByDrag=function(t){var e=this,n=e.get("dragPrePos"),r=t.x-n.x>0?.1:-.1,i=e.get("d")+r,o=e.get("maxD"),a=e.get("minD");if(ia){e.set("d",i);var s=e.get("r");e.set("molecularParam",(i+1)*s),e.magnify(t)}e.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,e){var n=this;n.restoreCache();var r=n.get("graph"),i=n.get("cachedMagnifiedModels"),o=n.get("cachedOriginPositions"),a=n.get("showLabel"),s=n.get("r"),u=n.get("r2"),l=n.get("d"),c=n.get("molecularParam"),h=r.getNodes(),d=h.length,f=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!n.get("dragging")||"mousemove"!==n.get("trigger")&&"click"!==n.get("trigger")||(f=n.get("cacheCenter"));var p=n.get("delegateCenterDiff");p&&(f.x+=p.x,f.y+=p.y),n.updateDelegate(f,s);for(var m=0;m\n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n \n '},zoomSensitivity:2}},e.prototype.init=function(){var t=this,e=this.get("graph"),n=this.get("getContent")(e),r=n;(0,x.isString)(n)&&(r=Uh(n));var i=this.get("className");r.setAttribute("class",i||"g6-component-toolbar");var o=this.get("container");o||(o=this.get("graph").get("container")),(0,x.isString)(o)&&(o=document.getElementById(o)),o.appendChild(r),this.set("toolBar",r);var a=this.get("handleClick");r.addEventListener("click",(function(n){var r=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],n=t.target;n;){if(e.push(n),"HTML"===n.tagName)return e.push(document,window),e;n=n.parentElement}return e}(n).filter((function(t){return"LI"===t.nodeName}));if(0!==r.length){var i=r[0].getAttribute("code");i&&(a?a(i,e):t.handleDefaultOperator(i))}}));var s=this.get("position");s&&Gf(r,{top:"".concat(s.y,"px"),left:"".concat(s.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),e=document.querySelector('.g6-component-toolbar li[code="undo"]'),n=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),r=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');e&&n&&r&&i&&(e.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4"),r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),t.on("stackchange",(function(t){var o=t.undoStack,a=t.redoStack,s=o.length,u=a.length;0===s?(e.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4")):(e.removeAttribute("style"),n.removeAttribute("style")),0===u?(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),i.removeAttribute("style"))})))},e.prototype.undo=function(){var t=this.get("graph"),e=t.getUndoStack();if(e&&0!==e.length){var n=e.pop();if(n){var r=n.action;t.pushStack(r,(0,x.clone)(n.data),"redo");var i=n.data.before;if("add"===r&&(i=n.data.after),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);delete e.id,t.updateItem(n,e,!1),"combo"===n.getType()&&t.updateCombo(n)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.removeItem(e.id,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}));break;case"createCombo":var o=n.data.after.combos,a=o[o.length-1];Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))})),t.removeItem(a.id,!1);break;case"uncombo":var s=i.combos[i.combos.length-1],u=i.nodes.concat(i.combos).map((function(t){return t.id})).filter((function(t){return t!==s.id}));t.createCombo(s,u,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.redo=function(){var t=this.get("graph"),e=t.getRedoStack();if(e&&0!==e.length){var n=e.pop();if(n){var r=n.action,i=n.data.after;if(t.pushStack(r,(0,x.clone)(n.data)),"delete"===r&&(i=n.data.before),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);delete e.id,t.updateItem(n,e,!1),"combo"===n.getType()&&t.updateCombo(n)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach((function(e){t.removeItem(e.id,!1)})),i.nodes&&i.nodes.forEach((function(e){t.removeItem(e.id,!1)})),i.combos&&i.combos.forEach((function(e){t.removeItem(e.id,!1)}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}));break;case"createCombo":var o=i.combos[i.combos.length-1];t.createCombo(o,o.children.map((function(t){return t.id})),!1);break;case"uncombo":var a=n.data.before.combos,s=a[a.length-1];t.uncombo(s.id,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),e=t.getZoom(),n=1/(1-.05*this.get("zoomSensitivity"));n*e>(this.get("maxZoom")||t.get("maxZoom"))||t.zoomTo(e*n)},e.prototype.zoomIn=function(){var t=this.get("graph"),e=t.getZoom(),n=1-.05*this.get("zoomSensitivity");n*e<(this.get("minZoom")||t.get("minZoom"))||t.zoomTo(e*n)},e.prototype.realZoom=function(){this.get("graph").zoomTo(1)},e.prototype.autoZoom=function(){this.get("graph").fitView([20,20])},e.prototype.handleDefaultOperator=function(t){switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom()}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,x.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}var n=this.get("handleClick");n&&t.removeEventListener("click",n)},e}(Xf);const wp=xp;var _p=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();"undefined"!=typeof document&&Jf()("\n .g6-component-tooltip {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n");var Sp=function(t){function e(e){return t.call(this,e)||this}return _p(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n

    类型:".concat(t.item.getType(),"

    \n ID:").concat(t.item.getID(),"\n ")},shouldBegin:function(t){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,e=t.get("className")||"g6-component-tooltip",n=Uh("
    ")),r=t.get("container");r||(r=t.get("graph").get("container")),(0,x.isString)(r)&&(r=document.getElementById(r)),Gf(n,{position:"absolute",visibility:"hidden",display:"none"}),r.appendChild(n),"click"!==t.get("trigger")&&(n.addEventListener("mouseenter",(function(t){Gf(n,{visibility:"visible",display:"unset"})})),n.addEventListener("mouseleave",(function(e){t.hideTooltip()}))),t.set("tooltip",n)},e.prototype.onClick=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=t.item,r=this.get("graph");this.currentTarget===n?(this.currentTarget=null,this.hideTooltip(),r.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=n,this.showTooltip(t),r.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=t.item,r=this.get("graph");this.currentTarget=n,this.showTooltip(t),r.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var e=this.get("itemTypes");t.item&&t.item.getType&&-1===e.indexOf(t.item.getType())||this.currentTarget&&t.item===this.currentTarget&&this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip(),this.get("graph").emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(t.item){var e=this.get("itemTypes");if(!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=this.get("tooltip"),r=this.get("getContent")(t);(0,x.isString)(r)?n.innerHTML=r:(this.clearContainer(),n.appendChild(r)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&Gf(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var e=this.get("shouldBegin"),n=this.get("tooltip");if(e(t)){var r=this.get("graph"),i=r.get("width"),o=r.get("height"),a=this.get("offsetX")||0,s=this.get("offsetY")||0,u=r.getPointByClient(t.clientX,t.clientY),l=this.get("fixToNode"),c=t.item;if(c.getType&&"node"===c.getType()&&l&&(0,x.isArray)(l)&&l.length>=2){var h=c.getBBox();u={x:h.minX+h.width*l[0],y:h.minY+h.height*l[1]}}var d=r.getCanvasByPoint(u.x,u.y),f=d.x,p=d.y,m=r.getContainer(),g={x:f+m.offsetLeft+a,y:p+m.offsetTop+s};Gf(n,{visibility:"visible",display:"unset"});var v=n.getBoundingClientRect();f+v.width+a>i&&(g.x-=v.width+a),p+v.height+s>o&&(g.y-=v.height+s,g.y<0&&(g.y=0)),Gf(n,{left:"".concat(g.x,"px"),top:"".concat(g.y,"px")})}else Gf(n,{visibility:"hidden",display:"none"})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,x.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(Xf);const Ep=Sp;var Mp="timebarstartplay",Ap="timebarendplay",Cp="valuechange",Tp="timebarConfigChanged",kp="playPauseBtn",Ip="nextStepBtn",Np="preStepBtn",Pp=function(){function t(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.container,a=t.text,s=t.padding,u=void 0===s?[4,4,4,4]:s,l=t.className,c=void 0===l?"g6-component-timebar-tooltip":l,h=t.backgroundColor,d=void 0===h?"#000":h,f=t.textColor,p=void 0===f?"#fff":f,m=t.opacity,g=void 0===m?.8:m,v=t.fontSize,y=void 0===v?12:v;this.container=o,this.className=c,this.backgroundColor=d,this.textColor=p,this.x=n,this.y=i,this.text=a,this.padding=u,this.opacity=g,this.fontSize=y,this.render()}return t.prototype.render=function(){var t=this,e=t.className,n=(t.x,t.y,t.backgroundColor),r=t.textColor,i=t.text,o=t.padding,a=t.opacity,s=t.fontSize,u=t.container,l=Uh("
    '));(0,x.isString)(u)&&(u=document.getElementById(u)),u.appendChild(l),t.parentHeight=u.offsetHeight,t.parentWidth=u.offsetWidth,Gf(l,{visibility:"hidden",top:0,left:0});var c=Uh("\n
    "));c.innerHTML=i,l.appendChild(c),t.backgroundDOM=c;var h=Uh("
    "));l.appendChild(h),t.arrowDOM=h,t.container=l},t.prototype.show=function(t){var e=this,n=t.text,r=t.x;t.y,t.clientX,t.clientY;e.backgroundDOM.innerHTML=n;var i=e.backgroundDOM.offsetWidth,o=e.backgroundDOM.offsetHeight,a=e.arrowDOM.offsetWidth,s=e.arrowDOM.offsetHeight;Gf(e.container,{top:"".concat(-o-s,"px"),left:"".concat(r,"px"),visibility:"visible"}),Gf(e.backgroundDOM,{marginLeft:"".concat(-i/2,"px")}),Gf(e.arrowDOM,{marginLeft:"".concat(-a/2,"px"),top:"".concat(o,"px")});var u=r-i/2,l=r+i/2;u<0?Gf(e.backgroundDOM,{marginLeft:"".concat(-i/2-u,"px")}):l>e.parentWidth&&Gf(e.backgroundDOM,{marginLeft:"".concat(-i/2-l+e.parentWidth+12,"px")})},t.prototype.hide=function(){Gf(this.container,{top:0,left:0,visibility:"hidden"})},t}();const Op=Pp;var Lp=function(){return Lp=Object.assign||function(t){for(var e,n=1,r=arguments.length;nn&&(o=n,i=e)}))}i=e.originalEvent.deltaY>0?Math.max(0,i-1):Math.min(t.speedAxisY.length-1,i+1);var a=t.speedAxisY[i]-r;n=Fp(n,[["t",0,a]]),t.speedPoint.setMatrix(n),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit(Tp,{speed:t.currentSpeed,type:t.currentType})})),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",(function(e){var n,r,i=e.target.get("isChecked");i?(t.checkedIcon.hide(),t.checkedText.attr("text",(null===(r=t.controllerCfg)||void 0===r?void 0:r.timePointControllerText)||"单一时间"),t.currentType=Yp):(t.checkedIcon.show(),t.checkedText.attr("text",(null===(n=t.controllerCfg)||void 0===n?void 0:n.timeRangeControllerText)||"时间范围"),t.currentType=Xp),e.target.set("isChecked",!i),t.group.emit(Tp,{type:t.currentType,speed:t.currentSpeed})}))},t.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},t}();const $p=qp;var Kp=function(){return Kp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=b&&r<=w?l:c,a=g.addShape("rect",{attrs:Kp({x:i+r*(m+2),y:i,width:m,height:f},o),draggable:!0,name:"tick-rect-".concat(r)}),s=g.addShape("rect",{attrs:{x:i+r*m+2*(2*r-1)/2,y:i,width:0===r||r===p-1?m+1:m+2,height:f,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(r)});s.toFront();var d,S=a.getBBox(),E=(S.minX+S.maxX)/2;if(v.push({rect:a,pickRect:s,value:e.date,x:E,y:S.minY}),u?(d=u(e),!(0,x.isString)(d)&&d&&(d=e.date)):r%Math.round(p/10)==0&&(d=e.date),d){y.push(d);var M=S.maxY+2*i;g.addShape("line",{attrs:{stroke:"#BFBFBF",x1:E,y1:M,x2:E,y2:M+4},name:"tick-line"});var A=M+4+i,C=g.addShape("text",{attrs:Kp({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:E,y:A,textAlign:"center",text:d,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},h),capture:!1,name:"tick-label"}),T=C.getBBox();if(T.maxX>n?C.attr("textAlign","right"):T.minX<0&&C.attr("textAlign","left"),(0,x.isNumber)(_)&&10!==y.length){var k=Zp([1,0,0,0,1,0,0,0,1],[["t",-E,-A],["r",_],["t",E-5,A+2]]);C.attr({textAlign:"left",matrix:k})}1===y.length?C.attr({textAlign:"left"}):10===y.length&&C.attr({textAlign:"right"})}})),this.tickRects=v;var S=this.group;this.currentSpeed=1,this.controllerBtnGroup=new $p(Kp({group:S,x:this.x,y:this.y+r+5,width:n,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},t.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",(function(e){var n=e.target;if("rect"===n.get("type")&&n.get("name")){var r=parseInt(n.get("name").split("-")[2],10);if(!isNaN(r)){var i=t.tickRects,o=t.unselectedTickStyle;i.forEach((function(t){t.rect.attr(o)}));var a=t.selectedTickStyle;i[r].rect.attr(a),t.startTickRectId=r,t.endTickRectId=r;var s=r/i.length;t.graph.emit(Cp,{value:[s,s]})}}})),e.on("dragstart",(function(e){var n=t.tickRects,r=t.unselectedTickStyle;n.forEach((function(t){t.rect.attr(r)}));var i=e.target,o=parseInt(i.get("name").split("-")[2],10),a=t.selectedTickStyle;n[o].rect.attr(a),t.startTickRectId=o;var s=o/n.length;t.graph.emit(Cp,{value:[s,s]}),t.dragging=!0})),e.on("dragover",(function(e){if(t.dragging&&"rect"===e.target.get("type")){for(var n=parseInt(e.target.get("name").split("-")[2],10),r=t.startTickRectId,i=t.tickRects,o=t.selectedTickStyle,a=t.unselectedTickStyle,s=0;s=r&&s<=n?o:a;i[s].rect.attr(u)}var l=i.length;t.endTickRectId=n;var c=r/l,h=n/l;t.graph.emit(Cp,{value:[c,h]})}})),e.on("drop",(function(e){if(t.dragging&&(t.dragging=!1,"rect"===e.target.get("type"))){var n=t.startTickRectId,r=parseInt(e.target.get("name").split("-")[2],10);if(!(r0?e.endTickRectId++:(n[e.endTickRectId].rect.attr(i),e.endTickRectId--),a!==e.startTickRectId)e.endTickRectIdthis.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;r1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(om);const sm=am;var um=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,lm="\\d\\d?",cm="\\d\\d",hm="[^\\s]+",dm=/\[([^]*?)\]/gm;function fm(t,e){for(var n=[],r=0,i=t.length;r-1?i:null}};function mm(t){for(var e=[],n=1;n3?0:(t-t%10!=10?1:0)*t%10]}},xm=mm({},bm),wm=function(t){return xm=mm(xm,t)},_m=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Sm=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+Sm(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Sm(Math.floor(Math.abs(e)/60),2)+":"+Sm(Math.abs(e)%60,2)}},Mm=function(t){return+t-1},Am=[null,lm],Cm=[null,hm],Tm=["isPm",hm,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],km=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],Im={D:["day",lm],DD:["day",cm],Do:["day",lm+hm,function(t){return parseInt(t,10)}],M:["month",lm,Mm],MM:["month",cm,Mm],YY:["year",cm,function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour",lm,void 0,"isPm"],hh:["hour",cm,void 0,"isPm"],H:["hour",lm],HH:["hour",cm],m:["minute",lm],mm:["minute",cm],s:["second",lm],ss:["second",cm],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond",cm,function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:Am,dd:Am,ddd:Cm,dddd:Cm,MMM:["month",hm,pm("monthNamesShort")],MMMM:["month",hm,pm("monthNames")],a:Tm,A:Tm,ZZ:km,Z:km},Nm={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Pm=function(t){return mm(Nm,t)},Om=function(t,e,n){if(void 0===e&&(e=Nm.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");e=Nm[e]||e;var r=[];e=e.replace(dm,(function(t,e){return r.push(e),"@@@"}));var i=mm(mm({},xm),n);return(e=e.replace(um,(function(e){return Em[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))};function Lm(t,e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=Nm[e]||e,t.length>1e3)return null;var r={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],o=[],a=e.replace(dm,(function(t,e){return o.push(_m(e)),"@@@"})),s={},u={};a=_m(a).replace(um,(function(t){var e=Im[t],n=e[0],r=e[1],o=e[3];if(s[n])throw new Error("Invalid format. "+n+" specified twice in format");return s[n]=!0,o&&(u[o]=!0),i.push(e),"("+r+")"})),Object.keys(u).forEach((function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")})),a=a.replace(/@@@/g,(function(){return o.shift()}));var l=t.match(new RegExp(a,"i"));if(!l)return null;for(var c,h=mm(mm({},xm),n),d=1;d11||r.month<0||r.day>31||r.day<1||r.hour>23||r.hour<0||r.minute>59||r.minute<0||r.second>59||r.second<0)return null;return c}const Rm={format:Om,parse:Lm,defaultI18n:bm,setGlobalDateI18n:wm,setGlobalDateMasks:Pm};var Dm="format";function zm(t,e){return(y[Dm]||Rm[Dm])(t,e)}function Fm(t){return(0,x.isString)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),(0,x.isDate)(t)&&(t=t.getTime()),t}var Bm=1e3,Um=6e4,jm=36e5,Vm=24*jm,Hm=31*Vm,Gm=365*Vm,Wm=[["HH:mm:ss",Bm],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",Um],["HH:mm",6e5],["HH:mm",18e5],["HH",jm],["HH",6*jm],["HH",12*jm],["YYYY-MM-DD",Vm],["YYYY-MM-DD",4*Vm],["YYYY-WW",7*Vm],["YYYY-MM",Hm],["YYYY-MM",4*Hm],["YYYY-MM",6*Hm],["YYYY",380*Vm]];function Xm(t,e,n){var r,i=(r=function(t){return t[1]},function(t,e,n,i){for(var o=(0,x.isNil)(n)?0:n,a=(0,x.isNil)(i)?t.length:i;o>>1;r(t[s])>e?a=s:o=s+1}return o})(Wm,(e-t)/n)-1,o=Wm[i];return i<0?o=Wm[0]:i>=Wm.length&&(o=(0,x.last)(Wm)),o}var Ym=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return(0,b.__extends)(e,t),e.prototype.translate=function(t){t=Fm(t);var e=this.values.indexOf(t);return-1===e&&(e=(0,x.isNumber)(t)&&t-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):zm(r,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;(0,x.each)(e,(function(t,n){e[n]=Fm(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(sm);const qm=Ym;var $m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return(0,b.__extends)(e,t),e.prototype.scale=function(t){if((0,x.isNil)(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=(0,x.head)(e),r=(0,x.last)(e);nthis.max&&(this.max=r),(0,x.isNil)(this.minLimit)||(this.min=n),(0,x.isNil)(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=(0,x.getRange)(this.values),e=t.min,n=t.max;(0,x.isNil)(this.min)&&(this.min=e),(0,x.isNil)(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=(0,x.filter)(n,(function(t){return t>=e.min&&t<=e.max}))),n},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;return(t-n)/(e-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(om);const Km=$m;var Zm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return(0,b.__extends)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(Km);const Qm=Zm;function Jm(t,e){var n=Math.E;return e>=0?Math.pow(n,Math.log(e)/t):-1*Math.pow(n,Math.log(-e)/t)}function tg(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function eg(t,e,n){(0,x.isNil)(n)&&(n=Math.max.apply(null,t));var r=n;return(0,x.each)(t,(function(t){t>0&&t1&&(r=1),r}var ng=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return(0,b.__extends)(e,t),e.prototype.invert=function(t){var e,n=this.base,r=tg(n,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(r-(e=tg(n,a/n)))*o;if(t=0?1:-1;return Math.pow(o,n)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent;return(Jm(r,t)-Jm(r,n))/(Jm(r,e)-Jm(r,n))},e}(Km);const og=ig;var ag=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return(0,b.__extends)(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):zm(n,this.mask)},e.prototype.scale=function(e){var n=e;return((0,x.isString)(n)||(0,x.isDate)(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return Fm(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if((0,x.isNil)(e)&&(0,x.isNumber)(e)||(this.min=this.translate(this.min)),(0,x.isNil)(n)&&(0,x.isNumber)(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,o=i,a=0;(0,x.each)(t,(function(t){var e=Fm(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a1&&(this.minTickInterval=o-i),(0,x.isNil)(e)&&(this.min=i),(0,x.isNil)(n)&&(this.max=a)}},e}(Qm);const sg=ag;var ug=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return(0,b.__extends)(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,r=this.getInvertPercent(t),i=Math.floor(r*(n-1));if(i>=n-1)return(0,x.last)(e);if(i<0)return(0,x.head)(e);var o=e[i],a=i/(n-1);return o+(r-a)/((i+1)/(n-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||((0,x.last)(e)!==this.max&&e.push(this.max),(0,x.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<(0,x.head)(e))return 0;if(t>(0,x.last)(e))return 1;var n=0;return(0,x.each)(e,(function(e,r){if(!(t>=e))return!1;n=r})),n/(e.length-1)},e}(Km);const lg=ug;const cg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return(0,b.__extends)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(lg);var hg={};function dg(t,e){if(function(t){return hg[t]}(t))throw new Error("type '"+t+"' existed.");hg[t]=e}var fg=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return(0,b.__extends)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,x.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},e}(om);const pg=fg;function mg(t){var e=t.values,n=t.tickInterval,r=t.tickCount,i=t.showLast;if((0,x.isNumber)(n)){var o=(0,x.filter)(e,(function(t,e){return e%n==0})),a=(0,x.last)(e);return i&&(0,x.last)(o)!==a&&o.push(a),o}var s=e.length,u=t.min,l=t.max;if((0,x.isNil)(u)&&(u=0),(0,x.isNil)(l)&&(l=e.length-1),!(0,x.isNumber)(r)||r>=s)return e.slice(u,l+1);if(r<=0||l<=0)return[];for(var c=1===r?s:Math.floor(s/(r-1)),h=[],d=u,f=0;f=l);f++)d=Math.min(u+f*c,l),f===r-1&&i?h.push(e[l]):h.push(e[d]);return h}var gg=Math.sqrt(50),vg=Math.sqrt(10),yg=Math.sqrt(2),bg=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,n;void 0===t&&(t=5);var r,i=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],u=this._domain[a];return u0?r=xg(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,t):r<0&&(r=xg(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,t)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,this.domain(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];(r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=gg?10:o>=vg?5:o>=yg?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=gg?10:o>=vg?5:o>=yg?2:1)}function wg(t,e,n){return("ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e))*e}function _g(t,e,n){var r=wg(t,n,"floor"),i=wg(e,n,"ceil");r=(0,x.fixedBase)(r,n),i=(0,x.fixedBase)(i,n);for(var o=[],a=Math.max((i-r)/(Math.pow(2,12)-1),n),s=r;s<=i;s+=a){var u=(0,x.fixedBase)(s,a);o.push(u)}return{min:r,max:i,ticks:o}}function Sg(t,e,n){var r,i=t.minLimit,o=t.maxLimit,a=t.min,s=t.max,u=t.tickCount,l=void 0===u?5:u,c=(0,x.isNil)(i)?(0,x.isNil)(e)?a:e:i,h=(0,x.isNil)(o)?(0,x.isNil)(n)?s:n:o;if(c>h&&(h=(r=[c,h])[0],c=r[1]),l<=2)return[c,h];for(var d=(h-c)/(l-1),f=[],p=0;p=0&&(u=1),1-s/(a-1)-n+u}function Tg(t,e,n){var r=(0,x.size)(e);return 1-(0,x.indexOf)(e,t)/(r-1)-n+1}function kg(t,e,n,r,i,o){var a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Ig(t,e){return t>=e?2-(t-1)/(e-1):1}function Ng(t,e,n,r){var i=e-t;return 1-.5*(Math.pow(e-r,2)+Math.pow(t-n,2))/Math.pow(.1*i,2)}function Pg(t,e,n){var r=e-t;if(n>r){var i=(n-r)/2;return 1-Math.pow(i,2)/Math.pow(.1*r,2)}return 1}function Og(t,e,n,r,i,o){void 0===n&&(n=5),void 0===r&&(r=!0),void 0===i&&(i=Mg),void 0===o&&(o=[.25,.2,.5,.05]);var a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===a)return{min:t,max:e,ticks:[t]};if(e-t>1e148){var s=(e-t)/(_=n||5);return{min:t,max:e,ticks:Array(_).fill(null).map((function(e,n){return Eg(t+s*n)}))}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},l=1;l<1/0;){for(var c=0;cu.score&&(!r||E<=t&&M>=e)&&(u.lmin=E,u.lmax=M,u.lstep=A,u.score=I)}g+=1}f+=1}}l+=1}var N=Eg(u.lmax),P=Eg(u.lmin),O=Eg(u.lstep),L=Math.floor(function(t){return Math.round(1e12*t)/1e12}((N-P)/O))+1,R=new Array(L);R[0]=Eg(P);for(c=1;c1&&(i*=Math.ceil(a)),r&&iGm)for(var u=Dg(n),l=Math.ceil(o/Gm),c=s;c<=u+l;c+=l)a.push(zg(c));else if(o>Hm){var h=Math.ceil(o/Hm),d=Fg(e),f=function(t,e){var n=Dg(t),r=Dg(e),i=Fg(t);return 12*(r-n)+(Fg(e)-i)%12}(e,n);for(c=0;c<=f+h;c+=h)a.push(Bg(s,c+d))}else if(o>Vm){var p=(b=new Date(e)).getFullYear(),m=b.getMonth(),g=b.getDate(),v=Math.ceil(o/Vm),y=function(t,e){return Math.ceil((e-t)/Vm)}(e,n);for(c=0;cjm){p=(b=new Date(e)).getFullYear(),m=b.getMonth(),v=b.getDate();var b,x=b.getHours(),w=Math.ceil(o/jm),_=function(t,e){return Math.ceil((e-t)/jm)}(e,n);for(c=0;c<=_+w;c+=w)a.push(new Date(p,m,v,x+c).getTime())}else if(o>Um){var S=function(t,e){return Math.ceil((e-t)/6e4)}(e,n),E=Math.ceil(o/Um);for(c=0;c<=S+E;c+=E)a.push(e+c*Um)}else{var M=o;M=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a})),rm("log",(function(t){var e,n=t.base,r=t.tickCount,i=t.min,o=t.max,a=t.values,s=tg(n,o);if(i>0)e=Math.floor(tg(n,i));else{var u=eg(a,n,o);e=Math.floor(tg(n,u))}for(var l=s-e,c=Math.ceil(l/r),h=[],d=e;d=0?1:-1;return Math.pow(t,e)*n}))})),rm("quantile",(function(t){var e=t.tickCount,n=t.values;if(!n||!n.length)return[];for(var r=n.slice().sort((function(t,e){return t-e})),i=[],o=0;op?(s.show(),l.show(),p=c.minX+c.width+10):(s.hide(),l.hide()),s})),this.controllerBtnGroup=new $p(nv({group:this.group,x:this.x,y:this.y+r+25,width:n,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),a.move(this.x,this.y),this.bindEvents(),this.currentMode===Xp&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},t.prototype.bindEvents=function(){var t=this,e=this.group.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var n=this.group.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),n.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat(kp,":click"),(function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()})),this.group.on("".concat(Ip,":click"),(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()})),this.group.on("".concat(Np,":click"),(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()})),this.group.on(Tp,(function(e){var n=e.type,r=e.speed;t.currentSpeed=r,t.currentMode=n,n===Xp?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):n===Yp&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())}))},t.prototype.adjustTickIndex=function(t){for(var e=0;e1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var e=this.x+this.start*this.width,n=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",n-e);var r=(0,x.get)(this.handlerStyle,"width",2);this.setText(this.minText,this.maxText);var i=this.dodgeText([e,n]),o=i[0],a=i[1];this.minHandlerShape.setX(e-r/2),(0,x.each)(o,(function(e,n){return t.minTextShape.attr(n,e)})),this.maxHandlerShape.setX(n-r/2),(0,x.each)(a,(function(e,n){return t.maxTextShape.attr(n,e)})),this.currentMode===Yp?this.graph.emit(Cp,{value:[this.start,this.end].sort()}):this.currentMode===Xp&&this.graph.emit(Cp,{value:[this.end,this.end]})},t.prototype.dodgeText=function(t){var e,n,r=(0,x.get)(this.handlerStyle,"width",2),i=this.minTextShape,o=this.maxTextShape,a=t[0],s=t[1],u=!1;a>s&&(a=(e=[s,a])[0],s=e[1],i=(n=[o,i])[0],o=n[1],u=!0);var l=i.getBBox(),c=o.getBBox(),h=null,d=null;return"trend"===this.timeBarType?(h=a-l.widththis.x+this.width?{x:s-r/2-2,textAlign:"right"}:{x:s+r/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(h=i.attr("x")>l.width?{x:a,textAlign:"center"}:{x:a,textAlign:"left"},d=o.attr("x")>this.width-c.width?{x:s,textAlign:"right"}:{x:s,textAlign:"center"}),u?[d,h]:[h,d]},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame((function(){var e=t,n=e.ticks,r=e.width,i=t.currentSpeed,o=r/n.length/(1e3*(10-i)/60),a=t.adjustOffsetRange(o/t.width);t.updateStartEnd(a),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())})):void 0},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(Mp,null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit(Ap,null))},t.prototype.destory=function(){this.graph.off(Cp,(function(){}));var t=this.group,e=t.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var n=t.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.off("maxHandlerShape-handler:mousedown"),n.off("maxHandlerShape-handler:touchstart"),n.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("".concat(kp,":click")),t.off("".concat(Ip,":click")),t.off("".concat(Np,":click")),t.off(Tp),t.destroy(),this.trendComponent&&this.trendComponent.destory()},t}();const dv=hv;var fv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pv=function(){return pv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n")),{position:"relative"}),a)&&this.get("graph").get("container").appendChild(t);this.set("timeBarContainer",t),e="SVG"===n.get("renderer")?new Rh({container:t,width:i,height:o}):new Ic({container:t,width:i,height:o}),this.get("containerCSS")&&Gf(t,this.get("containerCSS")),this.set("canvas",e)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas").addGroup({name:"timebar-group"});this.set("timeBarGroup",t),this.renderTrend(),this.initEvent();var e="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",e)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var e=this.get("timebar");e&&(e.isPlay=!!t,e.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,e=this._cfgs,n=e.width,r=e.x,i=e.y,o=e.padding,a=e.type,s=e.trend,u=e.slider,l=e.controllerCfg,c=e.textStyle,h=e.tick,d=e.backgroundStyle,f=e.foregroundStyle,p=s.data,m=mv(s,["data"]),g=n-2*o,v="trend"===a?26:4,y=this.get("graph"),b=this.get("timeBarGroup"),x=this.get("canvas"),w=null;if("trend"===a||"simple"===a){var _=this.get("getValue");w=new dv(pv(pv({graph:y,canvas:x,group:b,type:a,x:r+o,y:"trend"===a?i+o:i+o+15,width:g,height:v,padding:o,backgroundStyle:d,foregroundStyle:f,trendCfg:pv(pv({},m),{data:p.map((function(t){return(null==_?void 0:_(t))||t.value}))})},u),{tick:{ticks:p,tickLabelFormatter:h.tickLabelFormatter,tickLabelStyle:h.tickLabelStyle,tickLineStyle:h.tickLineStyle},handlerStyle:pv(pv({},u.handlerStyle),{height:u.height||v}),controllerCfg:l,textStyle:c}))}else"tick"===a&&(w=new em(pv({graph:y,canvas:x,group:b,x:r+o,y:i+o,width:n,height:42,padding:2,controllerCfg:l},h)));var S=function e(){var n=t.get("timebar");n.draggingHandler=!1,n.isPlay&&(n.isPlay=!1,n.currentHandler=n.maxHandlerShape,n.changePlayStatus()),document.removeEventListener("mouseup",e)};x.on("mousedown",(function(t){"maxHandlerShape-handler"!==t.target.get("name")&&"minHandlerShape-handler"!==t.target.get("name")&&t.target!==w.foregroundShape||document.addEventListener("mouseup",S)})),this.set("timebar",w)},e.prototype.filterData=function(t){var e,n=t.value;if(!n){n=[];var r=this._cfgs.type;r&&"trend"!==r&&"simple"!==r?"tick"===r&&(n[0]=this._cfgs.tick.start,n[1]=this._cfgs.tick.end):(n[0]=this._cfgs.slider.start,n[1]=this._cfgs.slider.end)}var i=null,o=this._cfgs.type;if("trend"===o||"simple"===o?i=this._cfgs.trend.data:"tick"===o&&(i=this._cfgs.tick.data),i&&0!==i.length){var a=this.get("rangeChange"),s=this.get("graph"),u=Math.round(i.length*n[0]),l=Math.round(i.length*n[1]);l=l>=i.length?i.length-1:l,u=u>=i.length?i.length-1:u;var c=null===(e=this._cfgs.tick)||void 0===e?void 0:e.tickLabelFormatter,h=c?c(i[u]):i[u].date,d=c?c(i[l]):i[l].date;if("tick"!==o)this.get("timebar").setText(h,d);if(a)a(s,h,d);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=s.get("data"));var f=this.get("filterItemTypes"),p=this.get("changeData"),m=this.get("getDate"),g=this.get("shouldIgnore"),v=i[u].date,y=i[l].date;if(p||void 0===p){var b=this.cacheGraphData.nodes,x=this.cacheGraphData.edges,w={},_={};s.getNodes().forEach((function(t){return w[t.getID()]=!0})),s.getEdges().forEach((function(t){return _[t.getID()]=!0})),f.includes("node")&&(null==b||b.forEach((function(t){var e=+((null==m?void 0:m(t))||t.date),n=e>=v&&e<=y||(null==g?void 0:g("node",t,{min:v,max:y})),r=w[t.id];r&&!n?(s.removeItem(t.id),w[t.id]=!1):!r&&n&&(s.addItem("node",t),w[t.id]=!0)})),null==x||x.forEach((function(t){var e=w[t.source]&&w[t.target]||(null==g?void 0:g("edge",t,{min:v,max:y})),n=!!s.findById(t.id);n&&!e?(s.removeItem(t.id),_[t.id]=!1):!n&&e?(s.addItem("edge",t),_[t.id]=!0):n||(_[t.id]=!1)}))),(this.get("filterEdge")||f.includes("edge"))&&(null==x||x.filter((function(t){var e=+((null==m?void 0:m(t))||t.date),n=e>=v&&e<=y||(null==g?void 0:g("edge",t,{min:v,max:y})),r=w[t.source]&&w[t.target],i=n&&r,o=_[t.id];o&&!i?(_[t.id]=!1,s.removeItem(t.id)):!o&&i&&(_[t.id]=!0,s.addItem("edge",t))})))}else f.includes("node")&&s.getNodes().forEach((function(t){var e=t.getModel();if(!(null==g?void 0:g("node",e,{min:v,max:y}))){var n=+((null==m?void 0:m(e))||e.date);ny?s.hideItem(t):s.showItem(t)}})),(this.get("filterEdge")||f.includes("edge"))&&s.getEdges().forEach((function(t){var e=t.getModel();if(!(null==g?void 0:g("edge",e,{min:i[u].date,max:i[l].date}))){var n=+((null==m?void 0:m(e))||e.date);if(ni[l].date)s.hideItem(t);else{var r=t.getSource().isVisible(),o=t.getTarget().isVisible();r&&o&&s.showItem(t)}}}))}}else console.warn("请配置 TimeBar 组件的数据")},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on(Cp,this.valueChangeListener)},e.prototype.destroy=function(){var e=this.get("graph");e.off("afterchangedata",this.changeData),e.off("afterrender",this.afterrenderListener),e.off(Cp,this.valueChangeListener);var n=this.get("timebar");n&&n.destory&&n.destory(),t.prototype.destroy.call(this);var r=this.get("timeBarContainer");if(r){var i=this.get("container");i||(i=this.get("graph").get("container")),(0,x.isString)(i)&&(i=document.getElementById(i)),i===r&&(i=i.parentElement),i.removeChild(r)}},e}(Xf);const vv=gv;var yv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bv=el.applyMatrix;var xv=function(t){function e(e){return t.call(this,e)||this}return yv(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,n=e.graph;if(!this.destroyed){var r=this.get("container");(0,x.isString)(r)&&(r=document.getElementById(r));var i=Uh("
    ")),o=0,a=0,s=!1,u=0,l=0,c=0,h=0,d=0,f=0;r.addEventListener("mousedown",(function(r){if(e.refresh=!1,r.target===i){var u=i.style;c=parseInt(u.width,10),h=parseInt(u.height,10);var l=t.get("width"),p=t.get("height");c>l||h>p||(f=n.getZoom(),d=t.get("ratio"),s=!0,o=r.clientX,a=r.clientY)}}),!1),r.addEventListener("mousemove",(function(e){if(s&&!(0,x.isNil)(e.clientX)&&!(0,x.isNil)(e.clientY)){var r=t.get("width"),p=t.get("height"),m=i.style;u=parseInt(m.left,10),l=parseInt(m.top,10),c=parseInt(m.width,10),h=parseInt(m.height,10);var g=o-e.clientX,v=a-e.clientY;u-g<0?g=u:u-g+c>=r&&(g=0),l-v<0?v=l:l-v+h>=p&&(v=0),l-=v,Gf(i,{left:"".concat(u-=g,"px"),top:"".concat(l,"px")}),n.translate(g*f/d,v*f/d),o=e.clientX,a=e.clientY}}),!1),r.addEventListener("mouseleave",(function(){s=!1,e.refresh=!0}),!1),r.addEventListener("mouseup",(function(){s=!1,e.refresh=!0}),!1),this.set("viewport",i),r.appendChild(i)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("width"),n=this.get("height"),r=this.get("graph"),i=r.get("width"),o=i/r.get("height"),a=r.getGroup(),s=a.getCanvasBBox(),u=[(s.minX+s.maxX)/2,(s.minY+s.maxY)/2],l=[s.maxX-s.minX,s.maxY-s.minY],c={centerX:u[0],centerY:u[1],width:0,height:0,minX:0,minY:0};s[0]/s[1]>o?(c.width=l[0],c.height=c.width/o):(c.height=l[1],c.width=c.height*o),c.minX=u[0]-c.width/2,c.minY=u[1]-c.height/2;var h=a.getMatrix();h||(h=[1,0,0,0,1,0,0,0,1]);var d=C.invert([1,0,0,0,1,0,0,0,1],h),f=bv({x:c.minX,y:c.minY},d),p=r.getCanvasByPoint(f.x,f.y),m=this.get("viewport");m||this.initViewport();var g=i/c.width,v=g*e,y=g*n,b=e*-p.x/c.width,x=n*-p.y/c.height,w=b+v,_=x+y;b<0&&(v+=b,b=0),w>e&&(v-=w-e),x<0&&(y+=x,x=0),_>n&&(y-=_-n),this.set("ratio",t),Gf(m,{left:"".concat(b,"px"),top:"".concat(x,"px"),width:"".concat(v,"px"),height:"".concat(y,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this,e=t.get("graph"),n=e.get("width"),r=e.get("height")/n,i=t.get("className"),o=t.get("container"),a=t.get("width"),s=t.get("height");a||s||(a=200),a?(s=r*a,t.set("height",s)):(a=1/r*s,t.set("width",a));var u=Uh("
    "));(0,x.isString)(o)&&(o=document.getElementById(o)),o?o.appendChild(u):e.get("container").appendChild(u),t.set("container",u);var l=Uh('
    ');u.appendChild(l);var c=Uh('');l.appendChild(c),t.set("containerDOM",l),t.set("containerSpan",c);var h=Uh(''));t.set("imgDOM",h),t.updateImgSize(),c.appendChild(h),t.updateCanvas()},e.prototype.updateImgSize=function(){var t=this,e=t.get("imgDOM"),n=t.get("width"),r=t.get("height");e.onload=function(){var t=function(t,e){var n,r;if(t.naturalWidth)n=t.naturalWidth,r=t.naturalHeight;else{var i=new Image;i.src=t.src,i.onload=function(){e&&e(i.width,i.height)}}return[n,r]}(e);t[0]>t[1]?e.width=n:e.height=r}},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("width")/t.get("canvas").getCanvasBBox().width;this.set("ratio",e),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){var e=this;e.get("imgDOM").remove(),e.set("graphImg",t);var n=Uh(''));e.set("imgDOM",n),n.src=t,e.updateImgSize(),e.get("containerSpan").appendChild(n),e.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(Xf);const wv=xv;var _v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sv=function(){return Sv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n(o||r.get("height"))&&n>1||s<(a||.05*r.get("height"))&&n<1)&&(n=1),s*=n,e.set("r",s),e.filter(t)}},e.prototype.filter=function(t){var e=this,n=e.get("graph"),r=n.getNodes(),i={},o=e.get("r"),a=e.get("type"),s={x:t.x,y:t.y};e.updateDelegate(s,o);var u=e.get("shouldShow"),l=e.get("vShapes");l&&l.forEach((function(t){t.remove(),t.destroy()})),l=[],r.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y;Ev({x:n,y:r},s)
    ");r.appendChild(i),this.set("container",i);var o=this.render();Gf(i,this.getContainerPos(o)),this.bindEvents()},e.prototype.getContainerPos=function(t){void 0===t&&(t=[0,0]);var e=this.get("graph"),n=this.get("offsetX"),r=this.get("offsetY"),i=this.get("margin"),o=this.get("position").split("-"),a={top:0,right:1,bottom:2,left:3},s={left:(e.getWidth()-t[0])/2+0,top:(e.getHeight()-t[1])/2+0};return o.forEach((function(n){var r=i[a[n]],o=n;switch(n){case"top":case"left":r+=0;break;case"bottom":r=e.getHeight()-t[1]-r+0,o="top";break;default:r=e.getWidth()-t[0]-r+0,o="left"}s[o]=r})),s.top+=r+e.getContainer().offsetTop,s.left+=n+e.getContainer().offsetLeft,Object.keys(s).forEach((function(t){s[t]="".concat(s[t],"px")})),s},e.prototype.bindEvents=function(){var t=this,e=t.get("filter");if(e&&e.enable){var n=e.trigger||"click";Rv.includes(n)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),n="click");var r=t.get("legendCanvas");"mouseenter"===n?(r.on("node-container:mouseenter",(function(e){return t.filterData(e)})),r.on("node-container:mouseleave",(function(e){t.clearFilter(),t.clearActiveLegend()}))):(r.on("node-container:click",(function(e){return t.filterData(e)})),r.on("click",(function(e){e.target&&e.target.isCanvas&&e.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())})))}},e.prototype.changeData=function(t){this.set("data",t);var e=this.render();Gf(this.get("container"),this.getContainerPos(e))},e.prototype.activateLegend=function(t){var e=this.get("filter");(null==e?void 0:e.multiple)||this.clearActiveLegend();var n=t.get("parent");n.get("active")?(n.set("active",!1),this.findLegendItemsByState("active").length&&n.set("inactive",!0)):(n.set("inactive",!1),n.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach((function(t){t.set("inactive",!0)})):this.clearActiveLegend();var r=(null==e?void 0:e.legendStateStyles)||{},i=(null==r?void 0:r.inactive)||{opacity:.5,"text-shape":{opacity:.5}},o=i["text-shape"]||{};this.findLegendItemsByState("inactive").forEach((function(t){var e=t.get("children"),n=e[0],r=e[1];n.attr(Lv(Lv({},n.get("oriAttrs")),i)),r.attr(Lv(Lv({},r.get("oriAttrs")),o))}));var a=(null==r?void 0:r.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},s=a["text-shape"]||{};this.findLegendItemsByState("active").forEach((function(t){var e=t.get("children"),n=e[0],r=e[1];n.attr(Lv(Lv({},n.get("oriAttrs")),a)),r.attr(Lv(Lv({},r.get("oriAttrs")),s))}))},e.prototype.findLegendItemsByState=function(t,e,n){void 0===e&&(e="all"),void 0===n&&(n=!0);var r=this.get("legendCanvas").find((function(t){return"root"===t.get("name")})),i=r.find((function(t){return"node-group"===t.get("name")})),o=r.find((function(t){return"edge-group"===t.get("name")}));return"node"===e?i.get("children").filter((function(e){return!!e.get(t)===n})):"edge"===e?o.get("children").filter((function(e){return!!e.get(t)===n})):i.get("children").filter((function(e){return!!e.get(t)===n})).concat(o.get("children").filter((function(e){return!!e.get(t)===n})))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas").find((function(t){return"root"===t.get("name")}));[t.find((function(t){return"node-group"===t.get("name")})),t.find((function(t){return"edge-group"===t.get("name")}))].forEach((function(t){t.get("children").forEach((function(t){t.set("active",!1),t.set("inactive",!1);var e=t.get("children"),n=e[0],r=e[1];n.attr(n.get("oriAttrs")),r.attr(r.get("oriAttrs"))}))}))},e.prototype.filterData=function(t){var e=this.get("filter"),n=null==e?void 0:e.filterFunctions;if(e&&n){var r=this.get("legendCanvas"),i=this.get("graph"),o=e.graphActiveState||"active",a=e.graphInactiveState||"inactive",s=e.multiple;this.clearFilter(),s||this.clearActiveLegend(),this.activateLegend(t.target);var u=r.find((function(t){return"root"===t.get("name")})),l=u.find((function(t){return"node-group"===t.get("name")})),c=u.find((function(t){return"edge-group"===t.get("name")})),h=l.get("children").filter((function(t){return t.get("active")})),d=c.get("children").filter((function(t){return t.get("active")})),f=0,p=["getNodes","getEdges"];p.forEach((function(t){i[t]().forEach((function(e){var r=!1;("getNodes"===t?h:d).forEach((function(t){var i=n[t.get("id")];r=r||i(e.getModel())})),r?(i.setItemState(e,a,!1),i.setItemState(e,o,!0),f++):(i.setItemState(e,o,!1),i.setItemState(e,a,!0))}))})),f||p.forEach((function(t){i[t]().forEach((function(t){i.clearItemStates(t,[a])}))}))}},e.prototype.clearFilter=function(){var t=this.get("graph"),e=this.get("filter");if(e){var n=e.graphActiveState||"active",r=e.graphInactiveState||"inactive";t.getNodes().forEach((function(e){t.clearItemStates(e,[n,r])})),t.getEdges().forEach((function(e){t.clearItemStates(e,[n,r])}))}},e.prototype.render=function(){var t=this;this.processData();var e=this.get("legendCanvas");e?e.clear():e=new Ic({container:this.get("container"),width:200,height:200});var n=e.addGroup({name:"root"}),r=n.addGroup({name:"node-group"}),i=n.addGroup({name:"edge-group"});this.set("legendCanvas",e);var o=this.get("itemsData"),a=[r,i];["nodes","edges"].forEach((function(e,n){o[e].forEach((function(r){var i,o,s=a[n].addGroup({id:r.id,name:"node-container"}),u=r.type,l=t.getShapeSize(r),c=l.width,h=l.height,d=l.r,f=t.getStyle(e.substr(0,4),r);switch(r.type){case"circle":default:o={r:d,x:0,y:0};break;case"rect":o={width:c,height:h,x:-c/2,y:-h/2};break;case"ellipse":o={rx:c,ry:h,x:0,y:0},u="ellipse";break;case"line":o={x1:-c/2,y1:0,x2:c/2,y2:0},u="line";break;case"quadratic":o={path:[["M",-c/2,0],["Q",0,c/2,c/2,0]]},u="path";break;case"cubic":o={path:[["M",-c/2,0],["C",-c/6,c/2,c/6,-c/2,c/2,0]]},u="path";break;case"diamond":o={path:[["M",0,-h],["L",c,0],["L",0,h],["L",-c,0],["Z"]]},u="path";break;case"triangle":o={path:[["M",-c,h],["L",0,-h],["L",c,h],["Z"]]},u="path";break;case"star":o={path:el.getStarPath(3*d,1.2*d)},u="path"}var p=s.addShape(u,{attrs:Lv(Lv({},o),f),name:"".concat(r.type,"-node-keyShape"),oriAttrs:Lv({opacity:1},f)});if(r.label){var m=p.getBBox(),g=(null===(i=r.labelCfg)||void 0===i?void 0:i.style)||{},v=Lv({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},g);s.addShape("text",{attrs:Lv({x:m.maxX+4,y:0,text:r.label},v),className:"legend-label",name:"".concat(r.type,"-node-text"),oriAttrs:v})}}))}));var s,u=this.get("padding"),l=n.find((function(t){return"title-container"===t.get("name")})),c={height:0,maxY:0,width:0};if(this.get("title")){l||(l=n.addGroup({name:"title-container"}));var h={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:u[0]},d=this.get("titleConfig")||{},f=Object.assign(h,d.style||{});s=l.addShape("text",{attrs:Lv({text:this.get("title")},f)}),c=l.getCanvasBBox(),l.setMatrix([1,0,0,0,1,0,d.offsetX,d.offsetY,1])}this.layoutItems();var p=n.getCanvasBBox(),m=r.getCanvasBBox(),g=m.minX<0?Math.abs(m.minX)+u[3]:u[3],v=c.maxYl.max&&(l.max=o[0]),f>c&&(c=f),t.setMatrix([1,0,0,0,1,0,p,m,1])}));var h=l.max-l.min,d={min:0,max:-1/0},f=s.getCanvasBBox();o[0]=0,o[1]="vertical"===r?f.maxX+e:f.maxY+n,u.get("children").forEach((function(t,i){0===i&&(d.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),l=u.width,c=u.height,h=0,f=0;"vertical"===r?(h=o[1],f=o[0],o[0]=f+s.height+n,t.setMatrix([1,0,0,0,1,0,0,f+c/2,1])):(h=o[0],f=o[1],o[0]=h+s.width+e,t.setMatrix([1,0,0,0,1,0,h+l/2,0,1])),o[0]>d.max&&(d.max=o[0])}));var p=d.max-d.min;if(i&&""!==i&&"left"!==i){var m=h-p,g="center"===i?Math.abs(m)/2:Math.abs(m);(m<0?s:u).get("children").forEach((function(t){var e=t.getMatrix()||[1,0,0,0,1,0,0,0,1];"vertical"===r?e[7]+=g:e[6]+=g,t.setMatrix(e)}))}},e.prototype.processData=function(){var t=this.get("data"),e={nodes:[],edges:[]};t.nodes&&(t.nodes.sort((function(t,e){return t.order-e.order})),t.nodes.forEach((function(t){var n,r,i,o,a,s=t.size||[(null===(n=t.style)||void 0===n?void 0:n.width)||(null===(r=t.style)||void 0===r?void 0:r.r)||8,(null===(i=t.style)||void 0===i?void 0:i.height)||(null===(o=t.style)||void 0===o?void 0:o.r)||8],u=(null===(a=t.labelCfg)||void 0===a?void 0:a.style)||{};e.nodes.push({id:t.id||(0,x.uniqueId)(),type:t.type||"circle",style:Lv({},t.style),order:t.order,label:t.label,itemType:"node",size:s,labelCfg:{position:"right",style:Lv({fontFamily:"Arial"},u)}})}))),t.edges&&(t.edges.sort((function(t,e){return t.order-e.order})),t.edges.forEach((function(t){var n,r,i=t.type||"line";"cubic-horizontal"===t.type&&(i="cubic");var o=(null===(n=t.labelCfg)||void 0===n?void 0:n.style)||{},a=t.size||[(null===(r=t.style)||void 0===r?void 0:r.width)||8,1];e.edges.push({id:t.id||(0,x.uniqueId)(),type:i,size:a,style:Lv({lineWidth:(0,x.isArray)(a)?a[1]:1},t.style),order:t.order,label:t.label,itemType:"edge",labelCfg:{position:"right",style:Lv({fontFamily:"Arial"},o)}})}))),this.set("itemsData",e)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var e=this.get(t);if((0,x.isNumber)(e))this.set(t,[e,e,e,e]);else if((0,x.isArray)(e))switch(e.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[e[0],e[0],e[0],e[0]]);break;case 2:this.set(t,[e[0],e[1],e[0],e[1]]);break;case 3:this.set(t,[e[0],e[1],e[2],e[1]])}return this.get(t)},e.prototype.getShapeSize=function(t){var e,n,r;return t.size&&((0,x.isArray)(t.size)?(e=t.size[0],n=t.size[1]||t.size[0],r=t.size[0]/2):(0,x.isNumber)(t.size)&&(e=t.size,n=t.size,r=t.size/2)),t.style&&(t.style.width&&(e=t.style.width),t.style.height&&(n=t.style.height),t.style.r&&(r=t.style.r)),r||(r=5),e||(e=r),n||(n=r),{width:e,height:n,r}},e.prototype.getStyle=function(t,e){return Lv(Lv({},"node"===t?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1}),e.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");null==t||t.destroy();var e=this.get("graph").get("container"),n=this.get("container");e.removeChild(n)},e}(Xf);const zv=Dv;var Fv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bv=function(){return Bv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n+

    ":"

    -

    ",c=e?"":"

    ".concat(a,"

    "),h=e?"".concat(u,"px"):"".concat(u,"px ").concat(u,"px 0 0");return'
    \n \n

    ").concat(i,"

    \n ").concat(l,"\n ").concat("

    x

    ","\n
    \n ").concat(c,"\n ")}},e.prototype.init=function(){var t=this;if(!t.destroyed){var e=t.get("graph").getContainer(),n=t.get("container");this.get("containerCfg")?(n=this.createContainer(),e.appendChild(n)):n=e,this.set("container",n);var r=e.getBoundingClientRect(),i=new Ic({container:e,width:r.right-r.left,height:r.bottom-r.top});Gf(i.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,x.debounce)((function(){return t.resizeCanvas(t)}),100));var o=i.addGroup({id:"annotation-link-group"});t.set("linkGroup",o),t.set("canvas",i),t.get("getTitle")||t.set("getTitle",(function(t){var e,n=(null===(e=null==t?void 0:t.getModel)||void 0===e?void 0:e.call(t))||{},r=n.label,i=n.id;return r||i||"-"})),t.get("getContent")||t.set("getContent",(function(t){var e,n;if(!t)return"-";var r=(null===(e=t.getModel)||void 0===e?void 0:e.call(t))||{},i=r.label,o=r.id,a=null===(n=t.getType)||void 0===n?void 0:n.call(t),s=a?"".concat(a,": "):"";return"".concat(s).concat(i||o||"")}));var a=t.get("defaultData");a&&this.readData(a)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var e=this.get("containerCfg"),n=this.get("graph"),r=n.getContainer(),i=r.getBoundingClientRect(),o=i.left,a=i.right,s=i.top,u=i.bottom-s,l=a-o,c=e.position,h=void 0===c?"top":c,d=e.offsetX,f=void 0===d?0:d,p=e.offsetY,m=void 0===p?0:p,g=Uv(e,["position","offsetX","offsetY"]),v=e.height,y=void 0===v?"fit-content":v,b=e.width,w=void 0===b?n.getWidth():b;"100%"===y&&(y=u),"100%"===w&&(w=l);var _="unset",S="unset",E={};switch(h){case"right":_="".concat(u,"px"),(E={top:0,right:0}).right+=o+f,E.top+=s+m;break;case"bottom":S="".concat(l,"px"),(E={bottom:0,left:0}).left+=o+f,E.bottom+=s+m;break;case"top":S="".concat(l,"px");case"left":_="".concat(u,"px");default:(E={top:0,left:0}).left+=o+f,E.top+=s+m}Object.keys(E).forEach((function(t){E[t]="".concat(E[t],"px")}));var M=Uh("
    "));return Gf(M,Bv(Bv({position:"absolute",display:"top"===h||"bottom"===h?"inline-flex":"unset",width:(0,x.isNumber)(w)?"".concat(w,"px"):w,height:(0,x.isNumber)(y)?"".concat(y,"px"):y,maxHeight:_,maxWidth:S,overflow:"scroll"},E),g)),r.appendChild(M),M.addEventListener("scroll",(function(e){t.updateLinks()})),M}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout((function(){if(t&&!t.destroyed){var e=t.get("container").getBoundingClientRect(),n=e.right-e.left,r=e.bottom-e.top;t.get("canvas").changeSize(n,r),t.updateOutsideCards(t)}}),250)},e.prototype.updateOutsideCards=function(t){var e=t||this,n=e.get("cardInfoMap")||{},r=e.get("graph"),i=r.getPointByCanvas(0,0),o=r.getPointByCanvas(r.getWidth(),r.getHeight()),a=r.getClientByPoint(i.x,i.y),s=a.x,u=a.y,l=r.getClientByPoint(o.x,o.y),c=l.x,h=l.y;Object.values(n).forEach((function(t){var e=t.card;if(e){var n=e.style,r=Gv(n.left),i=Gv(n.top),o=e.getBoundingClientRect(),a=o.width,l=o.height,d=r,f=i;r+a>c-s&&(d=c-s-a),r<0&&(d=0),i+l>h-u&&(f=h-u-l),i<0&&(f=0),Gf(e,{left:"".concat(d,"px"),top:"".concat(f,"px")})}})),e.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var e=t.item;this.toggleAnnotation(e)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var e=t.get("cardInfoMap")||{};Object.keys(e).forEach((function(e){t.hideCard(e)}))}},e.prototype.toggleAnnotation=function(t,e){var n,r;void 0===e&&(e={});var i=this;if(!i.destroyed){var o=i.get("cardInfoMap")||{},a=i.get("graph"),s=i.get("container"),u=i.get("containerCfg"),l=Object.assign({},i.get("cardCfg")||{},e),c=l.minHeight,h=l.minWidth,d=l.width,f=l.height,p=l.collapsed,m=void 0!==p&&p,g=l.x,v=l.y,y=l.title,b=l.content,w=l.maxTitleLength,_=l.defaultBegin,S=Uv(l,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),E=i.get("linkGroup"),M=this.get("rows")||[[]],A=null===(n=t.isCanvas)||void 0===n?void 0:n.call(t),C=A?jv:t.getID(),T=o[C]||{},k=T.card,I=T.link,N=T.x,P=T.y,O=T.title,L=T.content,R=this.get("getTitle"),D=this.get("getContent"),z=this.get("getContentPlaceholder")||function(){return""},F=this.get("getTitlePlaceHolder")||function(){return""},B=z(t),U=F(t),j=Uh(this.getDOMContent(Bv({itemId:C,collapsed:m,title:(null===(r=O||y||(null==R?void 0:R(t)))||void 0===r?void 0:r.substr(0,w))||U,content:L||b||(null==D?void 0:D(t))||B},S))),V=(0,x.isNumber)(c)?"".concat(c,"px"):c;Gf(j,{minHeight:m?"unset":V,minWidth:(0,x.isNumber)(h)?"".concat(h,"px"):h,height:f,width:d});var H,G=!!k;if(G?(null==I||I.remove(!0),s.replaceChild(j,k)):s.appendChild(j),!u){if(H=s.getBoundingClientRect()||{},void 0!==g&&void 0!==v)N=g,P=v;else if(!G&&!A){var W=H.top,X=_||{},Y=X.left,q=X.right,$=void 0===q?16:q,K=X.top,Z=void 0===K?8:K,Q=X.bottom,J=$,tt=Z;isNaN(Y)||(J=s.scrollWidth-Y),isNaN(Q)||(tt=s.scrollHeight-Q);var et=(0,x.isNumber)(h)?h:100;N=s.scrollWidth-j.scrollWidth-(M.length-1)*et-J;var nt=M[M.length-1],rt=(nt[nt.length-1]||{}).bbox;P=(null==rt?void 0:rt.bottom)-W||tt}Gf(j,{position:"absolute",left:"".concat(N,"px"),top:"".concat(P,"px"),cusor:u?"unset":"move"})}this.bindListener(j,C);var it=j.getBoundingClientRect();if(!A){var ot=Hv(t,it,a,this.get("canvas")),at=this.get("linkStyle");I=E.addShape("path",{attrs:Bv({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:ot},at)})}if(o[C]=Bv(Bv({},o[C]||{}),{id:C,collapsed:m,card:j,link:I,x:N,y:P,cardBBox:it,content:L||b,title:O||y,contentPlaceholder:B,titlePlaceholder:U,isCanvas:A}),i.set("cardInfoMap",o),u)this.updateCardPositionsInConatainer(),this.updateLinks();else{var st=!isNaN(g)&&!isNaN(v);if(!G&&!A&&!st){var ut=H.bottom,lt=void 0===ut?0:ut;W=H.top;M[M.length-1].push({id:C,bbox:it}),it.top>lt-W-it.height-16&&M.push([]),this.set("rows",M)}}this.updateCardSize(C);var ct=this.get("onAnnotationChange");null==ct||ct(o[C],G?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(t){var e=this.get("container"),n=this.get("containerCfg").position,r=e.getBoundingClientRect().width,i=getComputedStyle(e),o=Gv(i.paddingLeft)+Gv(i.paddingRight);r-=o,Object.values(t).forEach((function(t){var e=t.card,i=e.getBoundingClientRect().width;switch(n){case"right":Gf(e,{marginLeft:r?"".concat(r-i,"px"):"0px"});break;case"top":case"bottom":Gf(e,{marginLeft:"8px"})}}))}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var e=this.get("graph"),n=this.get("cardInfoMap");if(n){var r=n[t].collapsed,i=e.findById(t);if(i)"hide"!==this.get("cardCfg").collapseType||r?this.toggleAnnotation(i,{collapsed:!r}):this.hideCard(t),n[t]=Bv(Bv({},n[t]),{collapsed:!r})}}},e.prototype.hideCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e&&e[t]){var n=e[t],r=n.card,i=n.link;Gf(r,{display:"none"}),null==i||i.hide(),this.get("onAnnotationChange")(e[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var n=e[t],r=n.card,i=n.link;this.get("container").removeChild(r),null==i||i.remove(!0),delete e[t],this.get("onAnnotationChange")(n,"remove")}}},e.prototype.bindListener=function(t,e){var n=this;if(!this.destroyed){t.addEventListener("mousemove",(function(t){var r;if("g6-annotation-collapse"===t.target.className?r="collapse":"g6-annotation-expand"===t.target.className?r="expand":"g6-annotation-close"===t.target.className&&(r="close"),r){var i=n.get("cardCfg").onMouseEnterIcon;(void 0===i?function(){}:i)(t,e,r)}})),t.addEventListener("mouseout",(function(t){var r;if("g6-annotation-collapse"===t.target.className?r="collapse":"g6-annotation-expand"===t.target.className?r="expand":"g6-annotation-close"===t.target.className&&(r="close"),r){var i=n.get("cardCfg").onMouseLeaveIcon;(void 0===i?function(){}:i)(t,e,r)}})),t.addEventListener("mouseenter",(function(t){var r=n.get("cardInfoMap");if(r){var i=n.get("graph"),o=i.findById(e);if(o){var a=n.get("itemHighlightState");i.setItemState(o,a,!0)}var s=r[e].link;if(s){var u=n.get("linkHighlightStyle")||{};s.attr(u)}}})),t.addEventListener("mouseleave",(function(t){var r=n.get("cardInfoMap");if(r){var i=n.get("graph"),o=i.findById(e);if(o){var a=n.get("itemHighlightState");i.setItemState(o,a,!1)}var s=r[e].link;if(s){var u=n.get("linkHighlightStyle")||{};Object.keys(u).forEach((function(t){s.attr(t,void 0),s.attr(t,void 0)}));var l=n.get("linkStyle");s.attr(l)}}})),t.addEventListener("click",(function(t){var r=(n.get("cardCfg")||{}).onClickIcon;if("g6-annotation-collapse"===t.target.className||"g6-annotation-expand"===t.target.className)"hide"===n.get("cardCfg").collapseType?n.hideCard(e):n.handleExpandCollapseCard(e),null==r||r(t,e,"g6-annotation-collapse"===t.target.className?"collapse":"expand");else if("g6-annotation-close"===t.target.className){"remove"===n.get("cardCfg").closeType?n.removeCard(e):n.hideCard(e),null==r||r(t,e,"close")}})),this.get("editable")&&t.addEventListener("dblclick",(function(t){var r=n.get("cardInfoMap"),i=(n.get("cardCfg")||{}).maxTitleLength,o=void 0===i?20:i;if(r){var a=t.target,s=a.className;if("g6-annotation-title"===s||"g6-annotation-content"===s){var u="g6-annotation-title"===s?a.getBoundingClientRect():a.parentNode.getBoundingClientRect(),l=u.width,c=u.height,h=getComputedStyle(a),d=Uh("<".concat("g6-annotation-title"===s?"input":"textarea",' class="').concat(s,'-input" type="textarea" style="width:').concat(l,"px; height: ").concat(c,'px; min-width: 16px;"/>')),f=Uh('
    '));f.appendChild(d),a.parentNode.replaceChild(f,a);var p=r[e],m=p.contentPlaceholder,g=p.titlePlaceholder,v=p.content,y=p.title,b=v;"g6-annotation-title"===s?(d.name="title",d.maxLength=o,b=y):d.name="content",b?(d.innerHTML=a.innerHTML,d.value=a.innerHTML):d.placeholder="g6-annotation-title"===s?g:m,d.focus(),d.addEventListener("blur",(function(t){d.value&&(a.innerHTML=d.value,p[d.name||"title"]=d.value),f.parentNode.replaceChild(a,f),n.updateCardSize(e);var r=n.get("onAnnotationChange");null==r||r(p,"update")}))}}}));var r=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",(function(e){var i=e.target.className;if(!r.includes(i)){var o=t.style;n.set("dragging",{card:t,x:e.clientX,y:e.clientY,left:Gv(o.left),top:Gv(o.top)})}})),t.addEventListener("drag",(function(t){t.preventDefault();var r=n.get("cardInfoMap");if(r){var i=t.clientX,o=t.clientY,a=n.get("dragging");if(!isNaN(i)&&!isNaN(o)&&a){var s=a.x,u=a.y,l=a.left,c=a.top,h=a.card,d=i-s,f=o-u;l+=d,c+=f;var p=n.get("graph"),m=p.getPointByCanvas(0,0),g=p.getPointByCanvas(p.getWidth(),p.getHeight()),v=p.getClientByPoint(m.x,m.y),y=v.x,b=v.y,x=p.getClientByPoint(g.x,g.y),w=x.x,_=x.y,S=h.getBoundingClientRect();(l>w-y-(S.right-S.left)&&d>0||l<0&&d<0)&&(l-=d),(c>_-b-(S.bottom-S.top)&&f>0||c<0&&f<0)&&(c-=f),Gf(h,{left:"".concat(l,"px"),top:"".concat(c,"px"),visibility:"hidden"}),s=i,u=o;var E=(r[e]||{}).link;if(E){var M=p.findById(e);E.attr("path",Hv(M,S,p,n.get("canvas")))}n.set("dragging",{x:s,y:u,left:l,top:c,card:h})}}}));t.addEventListener("dragend",(function(t){var r=n.get("cardInfoMap");if(r){var i=n.get("dragging");if(i){var o=i.left,a=i.top,s=i.card;r[e].x=o,r[e].y=a,Gf(s,{visibility:"visible"}),n.set("dragging",!1);var u=n.get("rows");null==u||u.forEach((function(t){for(var n=t.length-1;n>=0;n--)t[n].id===e&&t.splice(n,1)}));var l=n.get("onAnnotationChange");null==l||l(r[e],"update")}}}))}},e.prototype.updateCardSize=function(t){var e=this.get("cardInfoMap");if(e){var n=e[t].card,r=n.getBoundingClientRect().width,i=n.getElementsByClassName("g6-annotation-title")[0];if(i){var o=getComputedStyle(i),a=Gv(o.marginLeft),s=i.getBoundingClientRect().width;Gf(i,{marginRight:"".concat(r-a-24-16-s,"px")})}}},e.prototype.updateLink=function(t){var e=t.item;if(e){var n=this.get("cardInfoMap");if(n){var r=this.get("canvas"),i=this.get("graph"),o=n[e.getID()]||{},a=o.link,s=o.card;if(a){var u=Hv(e,s.getBoundingClientRect(),i,r);a.attr("path",u)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var n=this.get("graph");Object.values(e).forEach((function(e){var r=e.id,i=n.findById(r);t.updateLink({item:i})}))}}},e.prototype.onGraphDataChange=function(){var t=this,e=this.get("cardInfoMap");if(e){var n=this.get("graph");Object.values(e).forEach((function(e){var r=e.id,i=e.card,o=e.isCanvas;if(i&&!o&&"none"!==i.style.display){var a=n.findById(r);a&&a.isVisible()?t.toggleAnnotation(a):t.hideCard(r)}}))}},e.prototype.onGraphItemVisibilityChange=function(t){var e=t.item,n=t.visible;if(e&&!e.destroyed){var r=this.get("cardInfoMap");if(r){var i=e.getID();r[i]&&(n||this.hideCard(i))}}},e.prototype.saveData=function(t){void 0===t&&(t=!1);var e=this.get("cardInfoMap");if(e){var n=this.get("graph"),r=this.get("getTitle"),i=this.get("getContent"),o=[];return Object.values(e).forEach((function(e){var a=e.title,s=e.content,u=e.x,l=e.y,c=e.id,h=e.collapsed,d=e.card;if(!d||"none"!==d.style.display||t){var f=n.findById(c)||n.get("canvas");o.push({id:c,x:u,y:l,collapsed:h,title:a||(null==r?void 0:r(f)),content:s||(null==i?void 0:i(f)),visible:d&&"none"!==d.style.display})}})),o}},e.prototype.readData=function(t){var e=this,n=this.get("graph");t.forEach((function(t){var r=t.id,i=t.x,o=t.y,a=t.title,s=t.content,u=t.collapsed,l=t.visible,c=n.findById(r);if(c||r!==jv||(c=n.get("canvas")),!c){var h=e.get("cardInfoMap")||{};return h[r]=t,void e.set("cardInfoMap",h)}e.toggleAnnotation(c,{x:i,y:o,title:a,content:s,collapsed:u}),l||e.hideCard(r)}))},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(t){var e=this.get("container");Object.values(t).forEach((function(t){var n=t.card,r=t.link;e.removeChild(n),null==r||r.remove(!0)})),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("graph");e&&!e.destroyed&&(this.get("containerCfg")&&e.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(Xf);var Hv=function(t,e,n,r){var i,o;if("edge"===t.getType())o=[t.getKeyShape().getPoint(.5)];else{var a=null===(i=t.getKeyShape)||void 0===i?void 0:i.call(t).getBBox(),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,h=t.getModel(),d=h.x,f=h.y;o={left:{x:s+=d,y:((u+=f)+(c+=f))/2},right:{x:l+=d,y:(u+c)/2},top:{x:(s+l)/2,y:u},bottom:{x:(s+l)/2,y:c}}}Object.keys(o).forEach((function(t){var e=o[t],i=e.x,a=e.y,s=n.getClientByPoint(i,a);o[t]=r.getPointByClient(s.x,s.y)}));var p=e.top,m=void 0===p?0:p,g=e.left,v=void 0===g?0:g,y=e.right,b=void 0===y?0:y,x=e.bottom,w=void 0===x?0:x,_={left:r.getPointByClient(v,(m+w)/2),right:r.getPointByClient(b,(m+w)/2),top:r.getPointByClient((v+b)/2,m),bottom:r.getPointByClient((v+b)/2,w)};return function(t,e){var n,r,i=1/0;Object.keys(t).forEach((function(o){var a=t[o];Object.keys(e).forEach((function(t){var o=e[t],s=a.x-o.x,u=a.y-o.y,l=s*s+u*u;i>l&&(i=l,n=a,r=o)}))}));var o=el.getControlPoint(n,r,.5,20);return[["M",n.x,n.y],["Q",o.x,o.y,r.x,r.y]]}(o,_)},Gv=function(t){return Number(t.replace(/\s+|px/gi,""))||0};const Wv={PluginBase:Xf,Menu:np,Grid:Zf,Minimap:up,Bundling:fp,ToolBar:wp,Tooltip:Ep,Fisheye:yp,TimeBar:vv,ImageMinimap:wv,EdgeFilterLens:Cv,SnapLine:Pv,Legend:zv,Annotation:Vv};al("circle",{options:{size:cl.defaultNode.size,style:{x:0,y:0,stroke:cl.defaultNode.style.stroke,fill:cl.defaultNode.style.fill,lineWidth:cl.defaultNode.style.lineWidth},labelCfg:{style:{fill:cl.nodeLabel.style.fill,fontSize:cl.nodeLabel.style.fontSize,fontFamily:cl.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:cl.defaultNode.linkPoints.size,lineWidth:cl.defaultNode.linkPoints.lineWidth,fill:cl.defaultNode.linkPoints.fill,stroke:cl.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},cl.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=(0,x.deepMix)({},r,t.icon),a="".concat(this.type,"-keyShape"),s=e.addShape("circle",{attrs:i,className:a,name:a,draggable:!0});e.shapeMap[a]=s;var u=o.width,l=o.height,c=o.show,h=o.text;if(c){var d="".concat(this.type,"-icon");e.shapeMap[d]=h?e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):e.addShape("image",{attrs:(0,b.__assign)({x:-u/2,y:-l/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(t,e),s},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints;if(n){var r=n||{},i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,l=r.r,c=(0,b.__rest)(r,["top","left","right","bottom","size","r"]),h=this.getSize(t)[0]/2;if(o){var d="link-point-left";e.shapeMap[d]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:-h,y:0,r:u/2||l||5}),className:d,name:d,isAnchorPoint:!0})}if(a){var f="link-point-right";e.shapeMap[f]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:h,y:0,r:u/2||l||5}),className:f,name:f,isAnchorPoint:!0})}if(i){var p="link-point-top";e.shapeMap[p]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:-h,r:u/2||l||5}),className:p,name:p,isAnchorPoint:!0})}if(s){var m="link-point-bottom";e.shapeMap[m]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:h,r:u/2||l||5}),className:m,name:m,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=(0,x.deepMix)({},e,n),i=this.getSize(t)[0]/2;return(0,b.__assign)({x:0,y:0,r:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getSize(t),o=(0,b.__assign)({},t.style);void 0===t.style.stroke&&t.color&&(o.stroke=t.color),void 0!==t.style.r||isNaN(i[0])||(o.r=i[0]/2),this.updateShape(t,e,o,!0,n),this.updateLinkPoints(t,r)}},"single-node"),al("rect",{options:{size:[100,30],style:{radius:0,stroke:cl.defaultNode.style.stroke,fill:cl.defaultNode.style.fill,lineWidth:cl.defaultNode.style.lineWidth},labelCfg:{style:{fill:cl.nodeLabel.style.fill,fontSize:cl.nodeLabel.style.fontSize,fontFamily:cl.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:cl.defaultNode.linkPoints.size,lineWidth:cl.defaultNode.linkPoints.lineWidth,fill:cl.defaultNode.linkPoints.fill,stroke:cl.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,b.__assign)({},cl.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t),r=e.addShape("rect",{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=r,this.drawLinkPoints(t,e),r},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,l=r.r,c=(0,b.__rest)(r,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0],f=h[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:-d/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:d/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:-f/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:f/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=(0,x.mix)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return(0,b.__assign)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a=e.get("keyShape");t.size||(o[0]=a.attr("width")||i.width,o[1]=a.attr("height")||i.height);var s={stroke:t.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=(0,x.mix)({},i,a.attr(),s);u=(0,x.mix)(u,t.style),this.updateShape(t,e,u,!1,n),this.updateLinkPoints(t,r)}},"single-node"),al("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:cl.defaultNode.style.stroke,fill:cl.defaultNode.style.fill,lineWidth:cl.defaultNode.style.lineWidth},labelCfg:{style:{fill:cl.nodeLabel.style.fill,fontSize:cl.nodeLabel.style.fontSize,fontFamily:cl.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:cl.defaultNode.linkPoints.size,lineWidth:cl.defaultNode.linkPoints.lineWidth,fill:cl.defaultNode.linkPoints.fill,stroke:cl.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},cl.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:i,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=o;var a=r.width,s=r.height,u=r.show,l=r.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},r),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,b.__assign)({x:-a/2,y:-s/2},r),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,l=r.r,c=(0,b.__rest)(r,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0]/2,f=h[1]/2;o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:-d,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:d,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:-f,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:f,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=(0,x.mix)({},e,n),i=this.getSize(t),o=i[0]/2,a=i[1]/2;return(0,b.__assign)({x:0,y:0,rx:o,ry:a},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a={stroke:t.color,rx:o[0]/2,ry:o[1]/2},s=e.get("keyShape"),u=(0,x.mix)({},i,s.attr(),a);u=(0,x.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)}},"single-node"),al("diamond",{options:{size:[80,80],style:{stroke:cl.defaultNode.style.stroke,fill:cl.defaultNode.style.fill,lineWidth:cl.defaultNode.style.lineWidth},labelCfg:{style:{fill:cl.nodeLabel.style.fill,fontSize:cl.nodeLabel.style.fontSize,fontFamily:cl.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:cl.defaultNode.linkPoints.size,lineWidth:cl.defaultNode.linkPoints.lineWidth,fill:cl.defaultNode.linkPoints.fill,stroke:cl.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},cl.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=r.width,s=r.height,u=r.show,l=r.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},r),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,b.__assign)({x:-a/2,y:-s/2},r),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,l=r.r,c=(0,b.__rest)(r,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0],f=h[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:-d/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:d/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:-f/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:f/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),n=e[0],r=e[1];return[["M",0,-r/2],["L",n/2,0],["L",0,r/2],["L",-n/2,0],["Z"]]},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=(0,x.mix)({},e,n),i=this.getPath(t);return(0,b.__assign)({path:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,x.mix)({},i,s.attr(),a);u=(0,x.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)}},"single-node"),al("triangle",{options:{size:40,direction:"up",style:{stroke:cl.defaultNode.style.stroke,fill:cl.defaultNode.style.fill,lineWidth:cl.defaultNode.style.lineWidth},labelCfg:{style:{fill:cl.nodeLabel.style.fill,fontSize:cl.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:cl.defaultNode.linkPoints.size,lineWidth:cl.defaultNode.linkPoints.lineWidth,fill:cl.defaultNode.linkPoints.fill,stroke:cl.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:(0,b.__assign)({},cl.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var n=this.mergeStyle||this.getOptions(t),r=n.icon,i=void 0===r?{}:r,o=n.direction,a=this.getShapeStyle(t),s=t.direction||o,u=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=i.width,c=i.height,h=i.show,d=i.offset,f=i.text;if(h)if(f)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var p=-l/2,m=-c/2;"up"!==s&&"down"!==s||(m+=d),"left"!==s&&"right"!==s||(p+=d),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,b.__assign)({x:p,y:m},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var n=this.mergeStyle||this.getOptions(t),r=n.linkPoints,i=void 0===r?{}:r,o=n.direction,a=t.direction||o,s=i.top,u=i.left,l=i.right,c=i.bottom,h=i.size,d=i.r,f=(0,b.__rest)(i,["top","left","right","bottom","size","r"]),p=this.getSize(t)[0];if(u){var m=null,g=p*Math.sin(1/3*Math.PI),v=p*Math.sin(1/3*Math.PI);"up"===a?m=[-v,g]:"down"===a?m=[-v,-g]:"left"===a&&(m=[-v,v-g]),m&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},f),{x:m[0],y:m[1],r:h/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var y=null;g=p*Math.sin(1/3*Math.PI),v=p*Math.sin(1/3*Math.PI);"up"===a?y=[v,g]:"down"===a?y=[v,-g]:"right"===a&&(y=[v,v-g]),y&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},f),{x:y[0],y:y[1],r:h/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(s){var x=null;g=p*Math.sin(1/3*Math.PI),v=p*Math.sin(1/3*Math.PI);"up"===a?x=[v-g,-g]:"left"===a?x=[v,-g]:"right"===a&&(x=[-v,-g]),x&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},f),{x:x[0],y:x[1],r:h/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var w=null;g=p*Math.sin(1/3*Math.PI),v=p*Math.sin(1/3*Math.PI);"down"===a?w=[-v+g,g]:"left"===a?w=[v,g]:"right"===a&&(w=[-v,g]),w&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},f),{x:w[0],y:w[1],r:h/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,n=t.direction||e,r=this.getSize(t)[0],i=r*Math.sin(1/3*Math.PI),o=r*Math.sin(1/3*Math.PI),a=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return"down"===n?a=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:"left"===n?a=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:"right"===n&&(a=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=(0,x.mix)({},e,n),i=this.getPath(t);return(0,b.__assign)({path:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,x.mix)({},i,s.attr(),a);u=(0,x.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)},updateLinkPoints:function(t,e){var n=this.getOptions({}),r=n.linkPoints,i=n.direction,o=t.direction||i,a=e.shapeMap["link-point-left"]||e.find((function(t){return"link-point-left"===t.get("className")})),s=e.shapeMap["link-point-right"]||e.find((function(t){return"link-point-right"===t.get("className")})),u=e.shapeMap["link-point-top"]||e.find((function(t){return"link-point-top"===t.get("className")})),l=e.shapeMap["link-point-bottom"]||e.find((function(t){return"link-point-bottom"===t.get("className")})),c=r,h=a||s||u||l;h&&(c=h.attr());var d=(0,x.mix)({},c,t.linkPoints),f=d.fill,p=d.stroke,m=d.lineWidth,g=d.size/2;g||(g=d.r);var v=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},y=v.left,w=v.right,_=v.top,S=v.bottom,E=this.getSize(t)[0],M={r:g,fill:f,stroke:p,lineWidth:m},A=null,C=E*Math.sin(1/3*Math.PI),T=E*Math.sin(1/3*Math.PI);"up"===o?A=[-T,C]:"down"===o?A=[-T,-C]:"left"===o&&(A=[-T,T-C]),A&&(a?y||void 0===y?a.attr((0,b.__assign)((0,b.__assign)({},M),{x:A[0],y:A[1]})):(a.remove(),delete e.shapeMap["link-point-left"]):y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},M),{x:A[0],y:A[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var k=null;"up"===o?k=[T,C]:"down"===o?k=[T,-C]:"right"===o&&(k=[T,T-C]),k&&(s?w||void 0===w?s.attr((0,b.__assign)((0,b.__assign)({},M),{x:k[0],y:k[1]})):(s.remove(),delete e.shapeMap["link-point-right"]):w&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},M),{x:k[0],y:k[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var I=null;"up"===o?I=[T-C,-C]:"left"===o?I=[T,-C]:"right"===o&&(I=[-T,-C]),I&&(u?_||void 0===_?u.attr((0,b.__assign)((0,b.__assign)({},M),{x:I[0],y:I[1]})):(u.remove(),delete e.shapeMap["link-point-top"]):_&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},M),{x:I[0],y:I[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var N=null;"down"===o?N=[-T+C,C]:"left"===o?N=[T,C]:"right"===o&&(N=[-T,C]),N&&(l?S||void 0===S?l.attr((0,b.__assign)((0,b.__assign)({},M),{x:N[0],y:N[1]})):(l.remove(),delete e.shapeMap["link-point-bottom"]):S&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},M),{x:N[0],y:N[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),al("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:cl.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:cl.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:cl.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).preRect,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=this.getSize(t),a=o[0],s=o[1],u=e.addShape("rect",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=r.show,c=(0,b.__rest)(r,["show"]);return l&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:(0,b.__assign)({x:-a/2,y:-s/2,height:s},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),u},drawLogoIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).logoIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,s=r.x,u=r.y,l=r.offset,c=r.text,h=(0,b.__rest)(r,["width","height","x","y","offset","text"]);e.shapeMap["rect-logo-icon"]=c?e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},h),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},h),{x:s||-i/2+o+l,y:u||-a/2,width:o,height:a}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).stateIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,s=r.x,u=r.y,l=r.offset,c=r.text,h=(0,b.__rest)(r,["width","height","x","y","offset","text"]);e.shapeMap["rect-state-icon"]=c?e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},h),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},h),{x:s||i/2-o+l,y:u||-a/2,width:o,height:a}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,l=r.r,c=(0,b.__rest)(r,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0],f=h[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:-d/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:d/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:-f/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},c),{x:0,y:f/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var n=this.getOptions(t),r=n.labelCfg,i=void 0===r?{}:r,o=n.logoIcon,a=void 0===o?{}:o,s=n.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t)[0],c=null,h=a.show,d=a.width,f=-l/2+i.offset;h&&(f=-l/2+d+i.offset);var p=i.style,m=u.style,g=u.paddingTop;return(0,x.isString)(t.description)?(c=e.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:f,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c,e.shapeMap["rect-description"]=e.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},m),{x:f,y:17+(g||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(c=e.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:f,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c),c},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=(0,x.mix)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return(0,b.__assign)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e){var n=this.mergeStyle||this.getOptions(t),r=n.style,i=void 0===r?{}:r,o=n.labelCfg,a=void 0===o?{}:o,s=n.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t),c=l[0],h=l[1];e.get("keyShape").attr((0,b.__assign)((0,b.__assign)({},i),{x:-c/2,y:-h/2,width:c,height:h}));var d=e.getContainer(),f=d.shapeMap["rect-logo-icon"]||d.find((function(t){return"rect-logo-icon"===t.get("className")})),p=f?f.attr():{},m=(0,x.mix)({},p,t.logoIcon),g=m.width;void 0===g&&(g=this.options.logoIcon.width);var v=t.logoIcon?t.logoIcon.show:void 0,y=a.offset,w=-c/2+g+y;v||void 0===v||(w=-c/2+y);var _=d.shapeMap["node-label"]||d.find((function(t){return"node-label"===t.get("className")})),S=d.shapeMap["rect-description"]||d.find((function(t){return"rect-description"===t.get("className")}));if(t.label)if(_){var E=t.labelCfg?t.labelCfg.style:{},M=(0,x.mix)({},_.attr(),E);t.label&&(M.text=t.label),M.x=w,(0,x.isString)(t.description)&&(M.y=-5),S&&(S.resetMatrix(),S.attr({x:w})),_.resetMatrix(),_.attr(M)}else d.shapeMap["node-label"]=d.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},a.style),{x:w,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});if((0,x.isString)(t.description)){var A=u.paddingTop;if(S){E=t.descriptionCfg?t.descriptionCfg.style:{};var C=(0,x.mix)({},S.attr(),E);(0,x.isString)(t.description)&&(C.text=t.description),C.x=w,S.resetMatrix(),S.attr((0,b.__assign)((0,b.__assign)({},C),{y:17+(A||0)}))}else d.shapeMap["rect-description"]=d.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},u.style),{x:w,y:17+(A||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})}var T=d.shapeMap["pre-rect"]||d.find((function(t){return"pre-rect"===t.get("className")}));if(T&&!T.destroyed){var k=(0,x.mix)({},T.attr(),t.preRect);T.attr((0,b.__assign)((0,b.__assign)({},k),{x:-c/2,y:-h/2,height:h}))}if(f&&!f.destroyed)if(v||void 0===v){var I=m.width,N=m.height,P=m.x,O=m.y,L=m.offset,R=(0,b.__rest)(m,["width","height","x","y","offset"]);f.attr((0,b.__assign)((0,b.__assign)({},R),{x:P||-c/2+I+L,y:O||-N/2,width:I,height:N}))}else f.remove(),delete d.shapeMap["pre-rect"];else v&&this.drawLogoIcon(t,d);var D=d.shapeMap["rect-state-icon"]||d.find((function(t){return"rect-state-icon"===t.get("className")})),z=D?D.attr():{},F=(0,x.mix)({},z,t.stateIcon);if(D){F.show||void 0===F.show||(D.remove(),delete d.shapeMap["rect-state-icon"]);var B=F.width,U=(N=F.height,P=F.x,O=F.y,F.offset),j=(0,b.__rest)(F,["width","height","x","y","offset"]);D.attr((0,b.__assign)((0,b.__assign)({},j),{x:P||c/2-B+U,y:O||-N/2,width:B,height:N}))}else F.show&&this.drawStateIcon(t,d);this.updateLinkPoints(t,d)},getOptions:function(t,e){return"move"===e?t:(0,x.deepMix)({},this.options,this.getCustomConfig(t)||{},t)}},"single-node"),al("star",{options:{size:60,style:{stroke:cl.defaultNode.style.stroke,fill:cl.defaultNode.style.fill,lineWidth:cl.defaultNode.style.lineWidth},labelCfg:{style:{fill:cl.nodeLabel.style.fill,fontSize:cl.nodeLabel.style.fontSize,fontFamily:cl.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:cl.defaultNode.linkPoints.size,lineWidth:cl.defaultNode.linkPoints.lineWidth,fill:cl.defaultNode.linkPoints.fill,stroke:cl.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},cl.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=r.width,s=r.height,u=r.show,l=r.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},r),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,b.__assign)({x:-a/2,y:-s/2},r),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.leftBottom,u=r.rightBottom,l=r.size,c=r.r,h=(0,b.__rest)(r,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(t)[0];if(a){var f=Math.cos(.1*Math.PI)*d,p=Math.sin(.1*Math.PI)*d;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},h),{x:f,y:-p,r:l/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(i){f=Math.cos(.5*Math.PI)*d,p=Math.sin(.5*Math.PI)*d;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},h),{x:f,y:-p,r:l/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){f=Math.cos(.9*Math.PI)*d,p=Math.sin(.9*Math.PI)*d;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},h),{x:f,y:-p,r:l/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(s){f=Math.cos(1.3*Math.PI)*d,p=Math.sin(1.3*Math.PI)*d;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},h),{x:f,y:-p,r:l/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){f=Math.cos(1.7*Math.PI)*d,p=Math.sin(1.7*Math.PI)*d;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},h),{x:f,y:-p,r:l/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t)[0],n=3*e/8,r=t.innerR||n;return el.getStarPath(e,r)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},r=(0,x.mix)({},e,n),i=this.getPath(t);return(0,b.__assign)({path:i},r)},update:function(t,e,n){var r=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,x.mix)({},i,s.attr(),a);u=(0,x.mix)(u,t.style),this.updateShape(t,e,u,!0,n),this.updateLinkPoints(t,r)},updateLinkPoints:function(t,e){var n=this.getOptions({}).linkPoints,r=e.shapeMap["link-point-left"]||e.find((function(t){return"link-point-left"===t.get("className")})),i=e.shapeMap["link-point-right"]||e.find((function(t){return"link-point-right"===t.get("className")})),o=e.shapeMap["link-point-top"]||e.find((function(t){return"link-point-top"===t.get("className")})),a=e.shapeMap["link-point-left-bottom"]||e.find((function(t){return"link-point-left-bottom"===t.get("className")})),s=e.shapeMap["link-point-left-bottom"]||e.find((function(t){return"link-point-right-bottom"===t.get("className")})),u=n,l=r||i||o||a||s;l&&(u=l.attr());var c=(0,x.mix)({},u,t.linkPoints),h=c.fill,d=c.stroke,f=c.lineWidth,p=c.size/2;p||(p=c.r);var m=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},g=m.left,v=m.right,y=m.top,w=m.leftBottom,_=m.rightBottom,S=this.getSize(t)[0],E={r:p,fill:h,stroke:d,lineWidth:f},M=Math.cos(.1*Math.PI)*S,A=Math.sin(.1*Math.PI)*S;i?v||void 0===v?i.attr((0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A})):(i.remove(),delete e.shapeMap["link-point-right"]):v&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),M=Math.cos(.5*Math.PI)*S,A=Math.sin(.5*Math.PI)*S,o?y||void 0===y?o.attr((0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A})):(o.remove(),delete e.shapeMap["link-point-top"]):y&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),M=Math.cos(.9*Math.PI)*S,A=Math.sin(.9*Math.PI)*S,r?g||void 0===g?r.attr((0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A})):(r.remove(),delete e.shapeMap["link-point-left"]):g&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),M=Math.cos(1.3*Math.PI)*S,A=Math.sin(1.3*Math.PI)*S,a?w||void 0===w?a.attr((0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A})):(a.remove(),delete e.shapeMap["link-point-left-bottom"]):w&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),M=Math.cos(1.7*Math.PI)*S,A=Math.sin(1.7*Math.PI)*S,s?_||void 0===_?s.attr((0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A})):(s.remove(),delete e.shapeMap["link-point-right-bottom"]):_&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},E),{x:M,y:-A}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var Xv=el.defaultSubjectColors,Yv="fan-shape-";al("donut",{options:{size:cl.defaultNode.size,style:{x:0,y:0,stroke:cl.defaultNode.style.stroke,fill:cl.defaultNode.style.fill,lineWidth:cl.defaultNode.style.lineWidth},labelCfg:{style:{fill:cl.nodeLabel.style.fill,fontSize:cl.nodeLabel.style.fontSize,fontFamily:cl.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:cl.defaultNode.linkPoints.size,lineWidth:cl.defaultNode.linkPoints.lineWidth,fill:cl.defaultNode.linkPoints.fill,stroke:cl.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},cl.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=(0,x.deepMix)({},r,t.icon),a=e.addShape("circle",{attrs:i,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=a;var s=o.width,u=o.height,l=o.show,c=o.text;return l&&(e.shapeMap["".concat(this.type,"-icon")]=c?e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,b.__assign)({x:-s/2,y:-u/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),qv(t,e,a),this.drawLinkPoints(t,e),a},updateShape:function(t,e,n,r,i){var o=e.get("keyShape");o.attr((0,b.__assign)({},n)),Kv(t,e,o),this.updateLabel(t,e,i),r&&this.updateIcon(t,e)}},"circle");var qv=function(t,e,n){var r=t.donutAttrs,i=void 0===r?{}:r,o=t.donutColorMap,a=void 0===o?{}:o,s=Object.keys(i).length;if(i&&s>1){var u=Zv(i,a),l=u.configs,c=u.totalValue;if(c){var h=Qv(n),d=h.lineWidth,f=h.arcR,p=[f,0],m=0;if(1===s)return void $v(e,{arcR:f,arcBegin:p,beginAngle:m,config:l[0],fanIndex:0,lineWidth:d,totalValue:c,drawWhole:!0});for(var g=0;g.999)n=[o,1e-4],i=1;else{var v=g*Math.PI*2;r=s+v,n=[o*Math.cos(r),-o*Math.sin(r)],i=v>Math.PI?1:0}var y={path:[["M",a[0],a[1]],["A",o,o,0,i,0,n[0],n[1]]],stroke:u.color||(null==m?void 0:m.attr("stroke"))||Xv[l%Xv.length],lineWidth:c};return m?m.attr(y):t.shapeMap["".concat(Yv).concat(l)]=t.addShape("path",{attrs:y,name:"".concat(Yv).concat(l),draggable:!0}),{beginAngle:r,arcBegin:n,shape:t.shapeMap["".concat(Yv).concat(l)],shouldEnd:f||g>.999}},Kv=function(t,e,n){var r=t.donutAttrs,i=t.donutColorMap,o=void 0===i?{}:i,a={},s=e.getContainer();if(r){var u=Zv(r,o),l=u.configs,c=u.totalValue;if(c)for(var h=Qv(n),d=h.lineWidth,f=h.arcR,p=[f,0],m=0,g=0;g=0;r--){var i=t[r];i.id="".concat(i.x,"|||").concat(i.y),n[i.id]||(n[i.id]=i,e.push(i))}return e},ey=function(t){return ty(t)},ny=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},ry=function(t,e,n){var r=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return 0===n&&0===r?0:n/e.width>r/e.height}(e,t);if(0===r){var i=t.centerX,o=t.centerY;return n.ye.x?i=t.maxX:n.xt.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},iy=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},oy=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},ay=function(t,e){var n=t.x,r=t.y;return ne.maxX||re.maxY},sy=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},uy=function(t,e,n,r,i){return sy(t,e)+sy(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,r,i])},ly=function t(e,n,r,i,o){void 0===o&&(o=0),e.unshift(n[i]),r[i]&&r[i]!==i&&o<=100&&t(e,n,r,r[i],o+1)},cy=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=r.x-t.x,s=r.y-t.y,u=n.x-e.x,l=n.y-e.y,c=r.x-e.x,h=r.y-e.y;return(i*s-o*a)*(u*h-l*c)<=0&&(i*l-o*u)*(a*h-s*c)<=0},hy=function(t,e,n){if(n.width||n.height){var r=oy(n),i=r[0],o=r[1],a=r[2],s=r[3];return cy(t,e,i,o)||cy(t,e,i,s)||cy(t,e,o,a)||cy(t,e,a,s)}return!1},dy=function(t,e,n,r){var i=[];return t.forEach((function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(hy(t,e,n)||hy(t,e,r))return;i.push(t)}})),ty(i)},fy=function(t,e){var n=[],r=t[0];return n.push("M".concat(r.x," ").concat(r.y)),t.forEach((function(r,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)}(r,o,a)){var s=function(t,e,n,r){var i=sy(t,e),o=sy(n,e);return it.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,S).filter((function(t){return ay(t,m)&&ay(t,g)})))})),[{x:v.x,y:y.y},{x:y.x,y:v.y}].forEach((function(t){ay(t,m)&&ay(t,g)&&_.push(t)})),_.unshift(v),_.push(y);var E=function(t,e,n,r,i,o,a){var s,u=[],l=((s={})[e.id]=e,s),c={},h={},d={};h[e.id]=0,d[e.id]=uy(e,n,e);var f=new my;f.add({id:e.id,value:d[e.id]});var p,m={};for(t.forEach((function(t){m[t.id]=t}));Object.keys(l).length;){var g=f.minId(!1);if(!g)break;if((p=l[g])===n){var v=[];return ly(v,m,c,n.id),v}delete l[p.id],f.remove(p.id),u.push(p),dy(t,p,r,i).forEach((function(t){if(-1===u.indexOf(t)){var r=t.id;l[r]||(l[r]=t);var i=d[p.id]+sy(p,t);h[r]&&i>=h[r]||(c[r]=p.id,h[r]=i,d[r]=h[r]+uy(t,n,e,o,a)),f.add({id:r,value:d[r]})}}))}return[e,n]}(_=ty(_),v,y,o,a,t,e);return E.unshift(t),E.push(e),ey(E)},my=function(){function t(){this.arr=[],this.map={},this.arr=[],this.map={}}return t.prototype._innerAdd=function(t,e){for(var n=[0,e-1];n[1]-n[0]>1;){var r=Math.floor((n[0]+n[1])/2);if(this.arr[r].value>t.value)n[1]=r;else{if(!(this.arr[r].value=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},t.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},t.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},t}(),gy={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,n,r,i){return ey(py(t,e,n,r,i.offset))}},vy=(Math.PI,function(t,e){var n=Math.round(Math.abs(t/e));return n<0?0:(t<0?-1:1)*n}),yy=function(t,e){var n=e.x-t.x,r=e.y-t.y;return n||r?Math.atan2(r,n):0},by=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},xy=function(t,e,n){for(var r=1/0,i=0,o=e.length;iu.minX&&e.xu.minY&&e.y0&&T>0;){var N=y.minId((T+1)%30==0);if(!N)break;if(_=f[N],I["".concat(_.x,"|||").concat(_.y)])return Sy(_,m,l,e,t,c,s);delete f[_.id],y.remove(_.id),p[_.id]=!0;for(b=0;bo.maxAllowedDirectionChange||u[P])){f[P]||(f[P]=E);var O=a[C];M=o.distFunc(_,E)+(isNaN(O)?s:O),A=g[_.id]+M;var L=g[P];L&&A>=L||(m[P]=_,g[P]=A,v[P]=A+xy(E,d,o.distFunc),y.add({id:P,value:v[P]}))}}T-=1}return o.fallbackRoute(t,e,n,r,o)};sl("polyline",{options:{color:cl.defaultEdge.color,size:cl.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:cl.defaultEdge.style.stroke,lineAppendWidth:cl.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:cl.edgeLabel.style.fill,fontSize:cl.edgeLabel.style.fontSize,fontFamily:cl.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:(0,b.__assign)({},cl.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);0===n.radius&&delete n.radius;var r=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return e.shapeMap["edge-shape"]=r,r},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=(0,x.mix)({},e,n,t.style);t=this.getPathPoints(t),this.radius=r.radius,this.offset=r.offset;var i=t.startPoint,o=t.endPoint,a=this.getControlPoints(t),s=[i];a&&(s=s.concat(a)),s.push(o);var u=t.sourceNode,l=t.targetNode,c=r.radius,h=this.options.routeCfg,d=(0,x.mix)({},h,t.routeCfg);d.offset=r.offset;var f=this.getPath(s,u,l,c,d,!Boolean(a));return((0,x.isArray)(f)&&f.length<=1||(0,x.isString)(f)&&-1===f.indexOf("L"))&&(f="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&(f="M0 0, L0 0"),(0,x.mix)({},cl.defaultEdge.style,r,{lineWidth:t.size,path:f})},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var r={stroke:t.color},i=n.shapeMap["edge-shape"]||n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),l=[a];u&&(l=l.concat(u)),l.push(s);var c=i.attr(),h=(0,x.mix)({},r,c,t.style),d=t.sourceNode,f=t.targetNode,p=h.radius,m=this.options.routeCfg,g=(0,x.mix)({},m,t.routeCfg);g.offset=h.offset;var v=this.getPath(l,d,f,p,g,!Boolean(u));((0,x.isArray)(v)&&v.length<=1||(0,x.isString)(v)&&-1===v.indexOf("L"))&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(v="M0 0, L0 0"),c.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),c.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""});var y=(0,x.mix)(r,i.attr(),{lineWidth:o,path:v},t.style);i&&i.attr(y)}},getPath:function(t,e,n,r,i,o){var a=i.offset,s=i.obstacles,u=i.simple;if(!a||t.length>2||!1===o){if(r)return fy(t,r);var l=[];return(0,x.each)(t,(function(t,e){0===e?l.push(["M",t.x,t.y]):l.push(["L",t.x,t.y])})),l}!1===u||(null==s?void 0:s.length)||(u=!0);var c=u?py(t[t.length-1],t[0],n,e,a):Ey(t[0],t[t.length-1],e,n,i);return c&&c.length?r?fy(c,r):(c=function(t){if(!(null==t?void 0:t.length))return t;for(var e=t[t.length-1],n={x:e.x,y:e.y},r=[e],i=[e],o=t.length-2;o>=0;o--){var a,s=t[o];s.x===n.x?r.push(s):(r=[s],n.x=s.x),s.y===n.y?i.push(s):(i=[s],n.y=s.y),r.length>2?(a=t.indexOf(r[1]))>-1&&t.splice(a,1):i.length>2&&(a=t.indexOf(i[1]))>-1&&t.splice(a,1)}return t}(c),el.pointsToPolygon(c)):"M0 0, L0 0"}},"single-edge");var My=hf.cloneEvent,Ay=hf.isNaN,Cy=Math.abs,Ty=["shift","ctrl","alt","control"];const ky={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,r=+t.clientY;if(!Ay(n)&&!Ay(r)){var i=n-e.x,o=r-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:n,y:r};var a=this.graph.get("width"),s=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),l=this.scalableRange,c=this.scalableRange;l<1&&l>-1&&(l*=a,c*=s),(u.minX<=a+l&&u.minX+i>a+l||u.maxX+l>=0&&u.maxX+l+i<0)&&(i=0),(u.minY<=s+c&&u.minY+o>s+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(i,o)}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];n&&r||(t.preventDefault(),this.mousedown=!0,this.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this,n=t.originalEvent;if((!n||"touchstart"===t.name||0===n.button)&&("touchstart"===t.name||"undefined"==typeof window||!window.event||window.event.buttons||window.event.button)&&this.shouldBegin(t,this)&&!e.keydown&&this.allowDrag(t)){if(e.origin={x:t.clientX,y:t.clientY},e.dragging=!1,this.enableOptimize){for(var r=this.graph,i=r.getEdges(),o=0,a=i.length;os)for(var d=r.getNodes(),f=0,p=d.length;f-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,n,r=t.target,i=r&&r.isCanvas&&r.isCanvas();if((0,x.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!i)return!1;if((0,x.isObject)(this.allowDragOnItem)){var o=this.allowDragOnItem,a=o.node,s=o.edge,u=o.combo,l=null===(n=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===n?void 0:n.call(e);if(!a&&"node"===l)return!1;if(!s&&"edge"===l)return!1;if(!u&&"combo"===l)return!1}return!0}},Iy={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onTouchStart:function(t){if(t.item){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,this.onDragStart(t)}},onTouchMove:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return void this.onDragEnd(t);t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},"undefined"==typeof window||this.windowEventBinded||(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,n;"node"===(null===(n=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===n?void 0:n.call(e))?this.mousedown&&(this.dragstart?this.onDrag((0,b.__assign)((0,b.__assign)({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t))):this.onDragEnd()},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,this.shouldBegin((0,b.__assign)((0,b.__assign)({},t),this.mousedown),this)){var n=this.mousedown,r=n.item,i=n.target;if(r&&!r.destroyed&&!r.hasLocked()){if(r.getContainer().set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(r),i)if(i.get("isAnchorPoint"))return;var o=this.graph;this.targets=[],this.targetCombo=null;var a=o.findAllByState("node",this.selectedState),s=r.get("id"),u=a.filter((function(t){var e=t.get("id");return s===e}));if(0===u.length?this.targets.push(r):a.length>1?a.forEach((function(t){t.hasLocked()||e.targets.push(t)})):this.targets.push(r),this.graph.get("enabledStack")&&this.enableStack){var l=[];this.targets.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y,i=e.id;l.push({x:n,y:r,id:i})})),this.set("beforeDragNodes",l)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach((function(t){t.getEdges().forEach((function(t){t.isVisible()&&(e.hidenEdge[t.getID()]=!0,t.hide())}))})),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(this.mousedown&&this.origin&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var n={};this.targets.map((function(r){e.update(r,t);var i=r.getModel().comboId;i&&(n[i]=e.graph.findById(i))})),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e,n=this;if(this.mousedown=!1,this.dragstart=!1,"undefined"!=typeof window&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),this.origin){null===(e=this.cachedCaptureItems)||void 0===e||e.forEach((function(t){t.getContainer().set("capture",!0)})),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach((function(t){t.getEdges().forEach((function(t){n.hidenEdge[t.getID()]&&t.show(),t.refresh()}))})),this.hidenEdge={};var r=this.graph;if(r.get("enabledStack")&&this.enableStack){var i={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach((function(t){i.before.nodes.push(t)})),this.targets.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y,o=e.id;i.after.nodes.push({x:n,y:r,id:o})})),r.pushStack("update",(0,x.clone)(i))}r.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&this.validationCombo(e)){var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var r=e.getModel();this.targets.map((function(t){t.getModel().comboId!==r.id&&n.updateComboTree(t,r.id)})),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),this.targets&&0!==this.targets.length&&this.currentShouldEnd&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map((function(t){t.getModel().comboId&&e.updateComboTree(t)})))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=this,n=t.item,r=e.graph,i=n.getModel().comboId,o=i?r.findById(i):void 0;if(this.currentShouldEnd=this.shouldEnd(t,o,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(i){var a=r.findById(i);e.comboActiveState&&r.setItemState(a,e.comboActiveState,!1),this.targets.map((function(t){var e=t.getModel();i!==e.comboId&&r.updateComboTree(t,i)})),r.updateCombo(a)}else this.targets.map((function(t){t.getModel().comboId&&r.updateComboTree(t)}));r.emit("dragnodeend",{items:this.targets,targetItem:n})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var n=this;this.targets&&0!==this.targets.length&&(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map((function(e){return n.update(e,t)})):this.targets.map((function(r){return n.update(r,t,e)})))},update:function(t,e,n){var r=this.origin,i=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:i.x||0,y:i.y||0});var a=e.x-r.x+this.point[o].x,s=e.y-r.y+this.point[o].y;n&&(a+=r.x-e.x,s+=r.y-e.y);var u={x:a,y:s};this.get("updateEdge")?this.graph.updateItem(t,u,!1):t.updatePosition(u)},debounceUpdate:(0,x.debounce)((function(t){var e=t.targets,n=t.graph,r=t.point,i=t.origin,o=t.evt,a=t.updateEdge,s=t.onlyChangeComboSize,u=t.updateParentCombos;e.map((function(t){var e=t.get("model"),s=t.get("id");r[s]||(r[s]={x:e.x||0,y:e.y||0});var u={x:o.x-i.x+r[s].x,y:o.y-i.y+r[s].y};a?n.updateItem(t,u,!1):t.updatePosition(u)})),s&&u(n,e)}),50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var n=t.x-this.origin.x+this.originPoint.minX,r=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:n,y:r})}else{var i=e.get("group"),o=(0,x.deepMix)({},Gd.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),s=a.x,u=a.y,l=a.width,c=a.height,h=a.minX,d=a.minY;this.originPoint={x:s,y:u,width:l,height:c,minX:h,minY:d},this.delegateRect=i.addShape("rect",{attrs:(0,b.__assign)({width:l,height:c,x:s,y:u},o),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;0===e.length&&e.push(t.item);for(var n=1/0,r=-1/0,i=1/0,o=-1/0,a=0;ar&&(r=c),h>o&&(o=h)}return{x:Math.floor(n),y:Math.floor(i),width:Math.ceil(r)-Math.floor(n),height:Math.ceil(o)-Math.floor(i),minX:n,minY:i}},updateParentCombos:function(t,e){var n=t||this.graph,r=e||this.targets,i={};null==r||r.forEach((function(t){var e=t.getModel().comboId;e&&(i[e]=n.findById(e))})),Object.values(i).forEach((function(t){t&&n.updateCombo(t)}))}};var Ny=null;const Py={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return"mouseenter"===this.get("trigger")?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.setAllItemStates(t)},clearOnTouchStart:function(t){try{var e=t.originalEvent.touches,n=e[0],r=e[1];if(n&&r)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this;this.shouldClearStatusOnSecond&&(Ny=null),this.timer=setTimeout((function(){e.throttleClearActiveState(t,e)}),50)},throttleSetAllItemStates:(0,x.throttle)((function(t,e){var n=t.item,r=e.graph;if(r&&!r.destroyed&&(e.item=n,e.shouldUpdate(t.item,{event:t,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,o=n.getModel().id;if(Ny===o&&i)return e.throttleClearActiveState(t,e),void(Ny=null);for(var a=e.activeState,s=e.inactiveState,u=r.getNodes(),l=r.getCombos(),c=r.getEdges(),h=r.get("vedges"),d=u.length,f=l.length,p=c.length,m=h.length,g=e.inactiveItems||{},v=e.activeItems||{},y=0;y-1||(this.trigger=Dy,console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,n=this.brush,r=this.selectOnCombo,i="combo"===(null==e?void 0:e.getType());i&&!r||!i&&e||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&this.updateBrush(t)},onMouseUp:function(t){this.graph;(this.brush||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this.graph,e=this.selectedState,n=t.findAllByState("node",e),r=t.findAllByState("edge",e),i=t.findAllByState("combo",e);n.forEach((function(n){return t.setItemState(n,e,!1)})),r.forEach((function(n){return t.setItemState(n,e,!1)})),i.forEach((function(n){return t.setItemState(n,e,!1)})),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,n,r,i){var o=t.getBBox();return o.centerX>=e&&o.centerX<=n&&o.centerY>=r&&o.centerY<=i},getSelectedNodes:function(t){var e=this,n=this,r=n.graph,i=n.originPoint,o=n.shouldUpdate,a=n.isBBoxCenterInRect,s=this.selectedState,u={x:t.x,y:t.y},l=r.getPointByCanvas(i.x,i.y),c=Oy(u.x,l.x),h=Ly(u.x,l.x),d=Oy(u.y,l.y),f=Ly(u.y,l.y),p=[],m=[];r.getNodes().forEach((function(t){if(t.isVisible()&&a(t,c,h,d,f)&&o(t,"select",e)){p.push(t);var n=t.getModel();m.push(n.id),r.setItemState(t,s,!0)}}));var g=[];this.includeEdges&&p.forEach((function(t){t.getOutEdges().forEach((function(t){if(t.isVisible()){var n=t.getModel(),i=n.source,a=n.target;m.includes(i)&&m.includes(a)&&o(t,"select",e)&&(g.push(t),r.setItemState(t,e.selectedState,!0))}}))}));var v=[];this.includeCombos&&r.getCombos().forEach((function(t){if(t.isVisible()&&a(t,c,h,d,f)&&o(t,"select",e)){v.push(t);var n=t.getModel();m.push(n.id),r.setItemState(t,s,!0)}})),this.selectedEdges=g,this.selectedNodes=p,this.selectedCombos=v,this.onSelect&&this.onSelect(p,g,v),r.emit("nodeselectchange",{selectedItems:{nodes:p,edges:g,combos:v},select:!0})},createBrush:function(){var t=this.graph.get("canvas").addShape("rect",{attrs:this.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:Ry(t.canvasX-e.x),height:Ry(t.canvasY-e.y),x:Oy(t.canvasX,e.x),y:Oy(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.keydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var By="shift",Uy=["shift","ctrl","alt","control"];const jy={getDefaultCfg:function(){return{multiple:!0,trigger:By,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return Uy.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=By,console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),t.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(n&&!n.destroyed){var r=n.getType(),i=e.graph,o=e.keydown,a=e.multiple,s=e.shouldUpdate;if((0,e.shouldBegin)(t,e)){if(!o||!a){var u=i.findAllByState("node",e.selectedState).concat(i.findAllByState("edge",e.selectedState)).concat(i.findAllByState("combo",e.selectedState));(0,x.each)(u,(function(t){t!==n&&i.setItemState(t,e.selectedState,!1)}))}if(function(){switch(r){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}())if(n.hasState(e.selectedState)){s(t,e)&&i.setItemState(n,e.selectedState,!1);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),h=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:n,selectedItems:{nodes:l,edges:c,combos:h},select:!1})}else{s(t,e)&&i.setItemState(n,e.selectedState,!0);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),h=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:n,selectedItems:{nodes:l,edges:c,combos:h},select:!0})}else{var l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),h=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{selectedItems:{nodes:l,edges:c,combos:h},select:!1})}}}},onCanvasClick:function(t){var e=this,n=this.graph;if((0,this.shouldBegin)(t,this)){var r=n.findAllByState("node",this.selectedState);(0,x.each)(r,(function(t){n.setItemState(t,e.selectedState,!1)}));var i=n.findAllByState("edge",this.selectedState);(0,x.each)(i,(function(t){n.setItemState(t,e.selectedState,!1)}));var o=n.findAllByState("combo",this.selectedState);(0,x.each)(o,(function(t){n.setItemState(t,e.selectedState,!1)})),n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()||"control"===e.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1}};var Vy=N,Hy=.05;const Gy={getDefaultCfg:function(){return this.isFireFox="firefox"===cf(),{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];t.preventDefault(),r&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,r&&(this.endPoint={pageX:r.pageX,pageY:r.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,n=e[0],r=e[1];if(r){this.endPoint||(this.endPoint={pageX:r.pageX,pageY:r.pageY});var i=function(t,e){return Math.hypot(e.x-t.x,e.y-t.y)},o=i({x:n.pageX,y:n.pageY},{x:r.pageX,y:r.pageY})/i({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),a=this.originScale*o;this.currentScale=a;var s=this.get("minZoom")||this.graph.get("minZoom");if(!(a>(this.get("maxZoom")||this.graph.get("maxZoom"))||a0||t.wheelDelta<0?1-Hy*o:1/(1-Hy*o):t.wheelDelta<0?1-Hy*o:1/(1-Hy*o));var u=this.get("minZoom")||n.get("minZoom"),l=this.get("maxZoom")||n.get("maxZoom");if(s>l?s=l:sr/2?l-=h.width:l+=this.offset,c>i/2?c-=h.height:c+=this.offset;var d="".concat(l,"px"),f="".concat(c,"px");Gf(this.container,{left:d,top:f,visibility:"visible"})}else Gf(o,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var n=Uh('
    '));return e.parentNode.appendChild(n),Gf(n,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}},Xy=(0,b.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Wy),Yy=(0,b.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Wy);var qy="click",$y=["click","dblclick"];const Ky={getDefaultCfg:function(){return{trigger:qy,onChange:function(){}}},getEvents:function(){var t,e;return $y.includes(this.trigger)?e=this.trigger:(e=qy,console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if("click"===this.trigger){if(this.timer)return clearTimeout(this.timer),void(this.timer=0);this.timer=setTimeout((function(){e.toggle(t),clearTimeout(e.timer),e.timer=0}),200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var n=this.graph.findDataById(e.get("id"));if(n){var r=n.children;if(r&&0!==r.length){var i=!n.collapsed;this.shouldBegin(t,i,this)&&(n.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i,this)&&(this.onChange(e,i,this),this.graph.layout()))}}}}};var Zy=hf.calculationItemsBBox,Qy=function t(e,n){if(!1!==n(e)&&e){var r=e.get("combos");if(0===r.length)return!1;(0,x.each)(r,(function(e){t(e,n)}))}};const Jy={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate(t,this)&&"combo"===e.getType())},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,n=this.graph,r=t.item;if(this.currentShouldEnd=!0,this.validationCombo(t)){this.targets=[];var i=n.findAllByState("combo",this.selectedState),o=r.get("id"),a=i.filter((function(t){var e=t.get("id");return o===e}));0===a.length?this.targets.push(r):this.targets=i;var s=[];this.targets.forEach((function(t){var e=t.getModel(),n=e.x,r=e.y,i=e.id;s.push({x:n,y:r,id:i})})),this.set("beforeDragItems",s),this.activeState&&this.targets.map((function(t){var r=t.getModel();if(r.parentId){var i=n.findById(r.parentId);i&&n.setItemState(i,e.activeState,!0)}})),this.point={},this.originPoint={},this.currentItemChildCombos=[],Qy(r,(function(t){if(t.destroyed)return!1;var n=t.getModel();return e.currentItemChildCombos.push(n.id),!0}))}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var n=this.graph,r=t.item,i=r.getModel(),o=n.getCombos(),a=r.getBBox(),s=a.centerX,u=a.centerY,l=a.width,c=o.filter((function(t){var n=t.getModel();return i.parentId,n.id!==i.id&&!e.currentItemChildCombos.includes(n.id)}));c.map((function(t){var r=t.getBBox(),i=r.centerX,o=r.centerY,a=r.width,c=s-i,h=u-o,d=2*Math.sqrt(c*c+h*h);l+a-d>.8*l?n.setItemState(t,e.activeState,!0):n.setItemState(t,e.activeState,!1)}))}(0,x.each)(this.targets,(function(n){e.updateCombo(n,t)})),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var n=this;(this.enableDelegate||e)&&(0,x.each)(this.targets,(function(r){n.updateCombo(r,t,e)}))},onDrop:function(t){var e=this,n=t.item;if(this.currentShouldEnd=this.shouldEnd(t,n,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&n&&this.targets&&!n.destroyed){var r=this.graph,i=n.getModel();this.targets.map((function(t){t.getModel().parentId!==i.id?(e.activeState&&r.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t,i.id,!1)):r.updateCombo(n)})),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){var n=this.graph,r=t.item.getModel().comboId,i=r?n.findById(r):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){var o;if(r){if(this.activeState){var a=n.findById(r);n.setItemState(a,this.activeState,!1)}this.targets.map((function(t){e.onlyChangeComboSize?n.updateCombo(t):r!==t.getID()&&(o=n.findById(r),r!==t.getModel().parentId&&n.updateComboTree(t,r,!1))}))}else this.targets.map((function(t){e.onlyChangeComboSize?n.updateCombo(t):t.getModel().comboId&&n.updateComboTree(t,void 0,!1)}));this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),r=this.graph;n&&this.activeState&&r.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var r=this.graph;if(this.delegateShape)r.get("delegateGroup").clear(),this.delegateShape=null;if(t&&this.activeState&&r.setItemState(t,this.activeState,!1),!t){var i=r.get("enabledStack")&&this.enableStack,o={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map((function(t){if(n.onlyChangeComboSize){r.updateCombo(t);var e=t.getModel(),a=e.x,s=e.y,u=e.id;o.after.combos.push({x:a,y:s,id:u}),r.pushStack("update",o)}else r.updateComboTree(t,void 0,i)}))}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,n){var r=this;if(void 0===n&&(n={}),!1!==e(t,n)&&t){var i=t.get("combos");(0,x.each)(i,(function(t){r.traverse(t,e,n)}));var o=t.get("nodes");(0,x.each)(o,(function(t){r.traverse(t,e,n)}))}},updateCombo:function(t,e,n){this.updateSingleItem(t,e,n);var r={};this.traverse(t,(function(t,e){return!t.destroyed&&(t.getEdges().forEach((function(t){return e[t.getID()]=t})),!0)}),r),Object.values(r).forEach((function(t){return t.refresh()}))},updateSingleItem:function(t,e,n){var r=this.origin,i=this.graph,o=t.getModel(),a=t.get("id");this.point[a]||(this.point[a]={x:o.x,y:o.y});var s=e.x-r.x+this.point[a].x,u=e.y-r.y+this.point[a].y;n&&(s+=r.x-e.x,u+=r.y-e.y),i.updateItem(t,{x:s,y:u},!1)},getParentCombo:function(t){var e=this.graph;if(t){var n=e.findById(t);if(n)return n}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var n=t.x-this.origin.x+this.originPoint.minX,r=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:n,y:r})}else{var i=e.get("delegateGroup"),o=null,a=(o=this.targets.length>1?Zy(this.targets):this.targets[0].getBBox()).x,s=o.y,u=o.width,l=o.height,c=o.minX,h=o.minY;this.originPoint={x:a,y:s,width:u,height:l,minX:c,minY:h};var d=(0,b.__assign)((0,b.__assign)({},Gd.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:(0,b.__assign)({width:o.width,height:o.height,x:o.x,y:o.y},d),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this.graph,e=this.targets,n={};null==e||e.forEach((function(e){var r=e.getModel().parentId;r&&(n[r]=t.findById(r))})),Object.values(n).forEach((function(e){e&&t.updateCombo(e)}))}};var tb="dblclick",eb=["click","dblclick"];const nb={getDefaultCfg:function(){return{trigger:tb,relayout:!0}},getEvents:function(){var t,e;return eb.includes(this.trigger)?e=this.trigger:(e=tb,console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this.graph,r=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(n.collapseExpandCombo(i),r&&n.get("layout")?n.layout():n.refreshPositions())}}};var rb=hf.isPolygonsIntersect,ib=hf.pathToPoints,ob="shift",ab=["drag","shift","ctrl","alt","control"];const sb={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:ob,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return ab.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=ob,console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso;t.item||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){(this.lasso||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach((function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){void 0===t&&(t="canvas:click");var e=this,n=e.graph,r=e.selectedState,i=e.shouldDeselect,o=n.findAllByState("node",r),a=n.findAllByState("edge",r);i&&!i({action:t,nodes:o,edges:a})||(o.forEach((function(t){return n.setItemState(t,r,!1)})),a.forEach((function(t){return n.setItemState(t,r,!1)}))),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this.graph,n=this.shouldUpdate,r=this.points.map((function(t){return[e.getCanvasByPoint(t.x,t.y).x,e.getCanvasByPoint(t.x,t.y).y]})),i=this.selectedState,o=[],a=[];e.getNodes().forEach((function(s){if(s.isVisible()&&function(t,e){var n,r=t.getKeyShape();if("path"===t.get("type"))n=ib(r.attr("path"));else{var i=r.getCanvasBBox();n=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return rb(e,n)}(s,r)&&n(s,"select",t)){o.push(s);var u=s.getModel();a.push(u.id),e.setItemState(s,i,!0)}}));var s=[];this.includeEdges&&o.forEach((function(r){r.getOutEdges().forEach((function(r){if(r.isVisible()){var i=r.getModel(),o=i.source,u=i.target;a.includes(o)&&a.includes(u)&&n(r,"select",t)&&(s.push(r),e.setItemState(r,t.selectedState,!0))}}))})),this.selectedEdges=s,this.selectedNodes=o,this.onSelect&&this.onSelect(o,s),e.emit("nodeselectchange",{selectedItems:{nodes:o,edges:s},select:!0})},createLasso:function(){var t=this.graph.get("delegateGroup").addShape("path",{attrs:(0,b.__assign)({path:[]},this.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(t){this.lasso.attr({path:this.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}};var ub="click",lb=["click","drag"],cb=void 0,hb=["shift","ctrl","control","alt","meta",void 0];const db={getDefaultCfg:function(){return{trigger:ub,key:cb,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t,e=this;return lb.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=ub,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),e.key&&-1===hb.indexOf(e.key.toLowerCase())&&(e.trigger=cb,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===e.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===e.trigger&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),e.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){var e=this;if(!e.key||e.keydown){var n=t.item;n&&n.getID()!==e.source&&"node"===n.getType()||e.cancelCreating({item:e.edge,x:t.x,y:t.y})}},onClick:function(t){var e=this;if(!e.key||e.keydown){var n=t.item,r=e.graph,i=n.getModel(),o=e.getEdgeConfig;if(e.addingEdge&&e.edge){if(!e.shouldEnd(t,e))return;var a=void 0;a=o&&(0,x.isFunction)(o)?o({source:e.source,target:i.id},e):e.edgeConfig;var s=(0,b.__assign)({target:i.id},a);if(e.source===i.id&&(s.type="loop"),r.emit("beforecreateedge",{}),r.updateItem(e.edge,s,!1),r.get("enabledStack")){var u=(0,b.__assign)((0,b.__assign)({},e.edge.getModel()),{itemType:"edge"}),l={};l.edges=[u],r.pushStack("add",{before:{},after:l})}r.emit("aftercreateedge",{edge:e.edge}),e.edge.getKeyShape().set("capture",!0),e.edge=null,e.addingEdge=!1}else{if(!e.shouldBegin(t,e))return;a=void 0;a=o&&(0,x.isFunction)(o)?o({source:i.id,target:i.id},e):e.edgeConfig,e.edge=r.addItem("edge",(0,b.__assign)({source:i.id,target:i.id},a),!1),e.source=i.id,e.addingEdge=!0,e.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){var e=this;if(!e.key||e.keydown){e.edge&&e.edge.destroyed&&e.cancelCreating({item:e.edge});var n={x:t.x,y:t.y};e.graph.findById(e.source)?e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:n},!1):e.addingEdge=!1}},cancelCreating:function(t){var e,n,r=this;if(!r.key||r.keydown){var i=r.graph,o=t.item;return r.addingEdge&&(r.edge===o||(null===(n=null===(e=t.target)||void 0===e?void 0:e.isCanvas)||void 0===n?void 0:n.call(e)))?(r.edge&&!r.edge.destroyed&&i.removeItem(r.edge,!1),r.edge=null,void(r.addingEdge=!1)):void 0}},onKeyDown:function(t){var e=this,n=t.key;n&&(n.toLowerCase()===e.key.toLowerCase()?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.addingEdge&&t.edge&&(t.graph.removeItem(t.edge,!1),t.addingEdge=!1,t.edge=null),this.keydown=!1}};var fb="ctrl",pb=["shift","ctrl","alt","control"];const mb={getDefaultCfg:function(){return{trigger:fb,combinedKey:"1",functionName:"fitView",functionParams:[]}},getEvents:function(){return pb.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=fb,console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(this.trigger,"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.triggerKeydown||(this.triggerKeydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n);var i=this.graph;if(!i[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(!this.triggerKeydown||this.combinedKey){var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(r===o||"control"===r&&"ctrl"===o||"ctrl"===r&&"control"===o)&&(this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]())}else this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]()}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var gb=["shift","ctrl","alt","control","meta"];const vb={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return this.zoomKey&&-1!==gb.indexOf(this.zoomKey)||(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var n=this.graph,r=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];if(r.includes("control")&&r.push("ctrl"),r.some((function(e){return t["".concat(e,"Key")]}))){var i=n.get("canvas").getPointByClient(t.clientX,t.clientY),o=n.getZoom();t.wheelDelta>0?o+=.05*o:o-=.05*o,n.zoomTo(o,{x:i.x,y:i.y})}else{var a=t.deltaX||t.movementX,s=t.deltaY||t.movementY;!s&&navigator.userAgent.indexOf("Firefox")>-1&&(s=125*-t.wheelDelta/3);var u=this.graph.get("width"),l=this.graph.get("height"),c=this.graph.get("canvas").getCanvasBBox(),h=this.scalableRange,d=this.scalableRange;h<1&&h>-1&&(h*=u,d*=l);var f=c.minX,p=c.maxX,m=c.minY,g=c.maxY;a>0?p<-h?a=0:p-a<-h&&(a=p+h):a<0&&(f>u+h?a=0:f-a>u+h&&(a=f-(u+h))),s>0?g<-d?s=0:g-s<-d&&(s=g+d):s<0&&(m>l+d?s=0:m-s>l+d&&(s=m-(l+d))),"x"===this.get("direction")?s=0:"y"===this.get("direction")&&(a=0),n.translate(-a,-s)}if(t.preventDefault(),this.get("enableOptimize")){var v=this.get("optimizeZoom"),y=this.get("optimized"),b=n.getNodes(),x=n.getEdges(),w=b.length,_=x.length;if(!y){for(var S=0;S{"use strict";n.r(e),n.d(e,{Graph:()=>w,GraphWithEvent:()=>T,algorithm:()=>r,comparision:()=>o,essence:()=>i,generate:()=>s});var r={};n.r(r),n.d(r,{components:()=>O,dfs:()=>R,dijkstra:()=>U,dijkstraAll:()=>j,findCycles:()=>H,floydWarshall:()=>it,isAcyclic:()=>tt,postorder:()=>et,preorder:()=>nt,prim:()=>P,tarjan:()=>V,topsort:()=>J});var i={};n.r(i),n.d(i,{hasSelfLoop:()=>bt,isGraph:()=>gt,isNullGraph:()=>yt,isSimpleGraph:()=>vt});var o={};n.r(o),n.d(o,{containAllSameEdges:()=>ht,containAllSameNodes:()=>ct,containSameEdges:()=>at,containSameNodes:()=>ot,getSameEdges:()=>ut,getSameNodes:()=>st,isGraphComplement:()=>xt,isGraphContainsAnother:()=>ft,isGraphOptionSame:()=>lt,isGraphSame:()=>dt});var a,s={};function u(t,e){var n=t.get(e)||0;t.set(e,n+1)}function l(t,e){var n=t.get(e);void 0!==n&&((n-=1)>0?t.set(e,n):t.delete(e))}function c(t,e,n,r){var i=String(e),o=String(n);if(!t&&i>o){var s=i;i=o,o=s}return i+a.EDGE_KEY_DELIM+o+a.EDGE_KEY_DELIM+(void 0===r?a.DEFAULT_EDGE_NAME:r)}function h(t,e,n,r){var i=String(e),o=String(n),a={v:e,w:n};if(!t&&i>o){var s=a.v;a.v=a.w,a.w=s}return void 0!==r&&(a.name=r),a}function d(t,e){return c(t,e.v,e.w,e.name)}function f(t){return"function"==typeof t}n.r(s),n.d(s,{getGraphComplement:()=>wt}),function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}(a||(a={}));var p=function(t){return t.nodes().map((function(e){var n={id:e,value:t.node(e),parent:t.parent(e)};return void 0===n.value&&delete n.value,void 0===n.parent&&delete n.parent,n}))},m=function(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w,value:n,name:e.name};return void 0===r.name&&delete r.name,void 0===r.value&&delete r.value,r}))};function g(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 v(t){for(var e=1;e0&&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),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=a.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return f(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.inEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.sinks=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.outEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.setNodes=function(t,n){return t.map((function(t){return e.setNode(t,n)})),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var n,r=null===(n=e.parentMap)||void 0===n?void 0:n.get(t);if(r!==e.GRAPH_NODE)return r}},this.removeFromParentsChildList=function(t){var n=e.parentMap.get(t);e.childrenMap.get(n).delete(t)},this.setParent=function(t,n){var r,i;e.checkCompound();for(var o=void 0===n?e.GRAPH_NODE:n,a=e.parent(o);a;){if(t===a)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");a=e.parent(a)}n&&e.setNode(n),e.setNode(t),e.removeFromParentsChildList(t),null===(r=e.parentMap)||void 0===r||r.set(t,o);var s=e.childrenMap.get(o);return s.set(t,!0),null===(i=e.childrenMap)||void 0===i||i.set(o,s),e},this.children=function(t){var n=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var r,i=null===(r=e.childrenMap)||void 0===r?void 0:r.get(n);return i?Array.from(i.keys()):void 0}return n===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var n=e.predecessorsMap.get(t);return n?Array.from(n.keys()):void 0},this.successors=function(t){var n=e.successorsMap.get(t);return n?Array.from(n.keys()):void 0},this.neighbors=function(t){var n;if(e.hasNode(t))return Array.from(new Set(null===(n=e.predecessors(t))||void 0===n?void 0:n.concat(e.successors(t))))},this.isLeaf=function(t){var n,r;return e.isDirected()?!(null===(r=e.successors(t))||void 0===r?void 0:r.length):!(null===(n=e.neighbors(t))||void 0===n?void 0:n.length)},this.filterNodes=function(n){var r=e.directed,i=e.multigraph,o=e.compound,a=new t({directed:r,multigraph:i,compound:o});if(a.setGraph(e.graph()),e.nodes().forEach((function(t){n(t)&&a.setNode(t,e.node(t))})),e.edges().forEach((function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))})),o){a.nodes().forEach((function(t){a.setParent(t,function(t){for(var n=e.parent(t);void 0!==n&&!a.hasNode(n);)n=e.parent(n);return n}(t))}))}return a},this.setDefaultEdgeLabel=function(t){return f(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,n){return e.setEdge(t.v,t.w,n,t.name)},this.setPath=function(t,n){return t.reduce((function(t,r){return e.setEdge(t,r,n),r})),e},this.edgeFromArgs=function(t,n,r){return e.edge({v:t,w:n,name:r})},this.edge=function(t){return e.edgesLabelsMap.get(d(e.isDirected(),t))},this.hasEdge=function(t,n,r){return e.edgesLabelsMap.has(d(e.isDirected(),{v:t,w:n,name:r}))},this.removeEdgeObj=function(t){var n=t.v,r=t.w,i=t.name;return e.removeEdge(n,r,i)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,n){var r=e.inEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.v===n}))},this.outEdges=function(t,n){var r=e.outEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.w===n}))},this.nodeEdges=function(t,n){var r;if(e.hasNode(t))return null===(r=e.inEdges(t,n))||void 0===r?void 0:r.concat(e.outEdges(t,n))},this.toJSON=function(){return void 0===(n={options:{directed:(t=e).isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:p(t),edges:m(t),value:t.graph()}).value&&delete n.value,n;var t,n},this.nodeInDegree=function(t){var n=e.inEdgesMap.get(t);return n?n.size:0},this.nodeOutDegree=function(t){var n=e.outEdgesMap.get(t);return n?n.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var r=v(v({},x),n);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,n,r;return e=t,(n=[{key:"setNode",value:function(t,e){var n,r=this.nodesLabelMap,i=this.defaultNodeLabelFn,o=this.isCompound,a=this.parentMap,s=this.childrenMap,u=this.inEdgesMap,l=this.outEdgesMap,c=this.predecessorsMap,h=this.successorsMap;return r.has(t)?(void 0!==e&&r.set(t,e),this):(r.set(t,e||i(t)),o()&&(null==a||a.set(t,this.GRAPH_NODE),null==s||s.set(t,new Map),(null==s?void 0:s.has(this.GRAPH_NODE))||null==s||s.set(this.GRAPH_NODE,new Map),null==s||null===(n=s.get(this.GRAPH_NODE))||void 0===n||n.set(t,!0)),[u,l,c,h].forEach((function(e){return e.set(t,new Map)})),this.nodeCountNum+=1,this)}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var n,r,i,o=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,s=this.outEdgesMap,u=this.predecessorsMap,l=this.successorsMap,c=this.nodesLabelMap;this.isCompound()&&(this.removeFromParentsChildList(t),null===(n=this.parentMap)||void 0===n||n.delete(t),null===(r=this.children(t))||void 0===r||r.forEach((function(t){return e.setParent(t)})),null===(i=this.childrenMap)||void 0===i||i.delete(t));var h=a.get(t),d=s.get(t);Array.from(h.values()).forEach((function(t){return o(t)})),Array.from(d.values()).forEach((function(t){return o(t)})),c.delete(t),a.delete(t),s.delete(t),u.delete(t),l.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,n,r){var i,o,a=h(this.isDirected(),t,e,r),s=d(this.isDirected(),a),l=a.v,c=a.w;if(this.edgesLabelsMap.has(s))return this.edgesLabelsMap.set(s,n),this;if(void 0!==r&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(c),this.edgesLabelsMap.set(s,n||this.defaultEdgeLabelFn(l,c,r)),Object.freeze(a),this.edgesMap.set(s,a);var f=this.predecessorsMap.get(c),p=this.successorsMap.get(l);return u(f,l),u(p,c),null===(i=this.inEdgesMap.get(c))||void 0===i||i.set(s,a),null===(o=this.outEdgesMap.get(l))||void 0===o||o.set(s,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,n){var r=c(this.isDirected(),t,e,n);if(this.edgesMap.get(r)){var i=h(this.isDirected(),t,e,n),o=i.v,a=i.w;this.edgesLabelsMap.delete(r),this.edgesMap.delete(r);var s=this.predecessorsMap.get(a),u=this.successorsMap.get(o);l(s,o),l(u,a),this.inEdgesMap.get(a).delete(r),this.outEdgesMap.get(o).delete(r),this.edgeCountNum-=1}return this}}])&&b(e.prototype,n),r&&b(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _(t){return _="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},_(t)}function S(t,e){for(var n=0;n-1&&this.eventPool[t].splice(n,1)}}},{key:"emitEvent",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r>1])||void 0===a?void 0:a.priority)e.arr[r].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[r].priority," New: ").concat(n));e.arr[r].priority=n,e.innerDecrease(r)}}));const P=function(t,e){var n,r=new w,i=new Map,o=new N;function a(t){var r=t.v===n?t.w:t.v,a=o.priority(r);if(void 0!==a){var s=e(t);s0;){var u;if(n=o.removeMin(),i.has(n))r.setEdge(n,i.get(n));else{if(s)throw new Error("Input graph is not connected: "+t.graph());s=!0}null===(u=t.nodeEdges(n))||void 0===u||u.forEach(a)}return r};const O=function(t){var e=new Set,n=[];return t.nodes().forEach((function(r){for(var i=[],o=[r];o.length>0;){var a,s,u=o.pop();if(!e.has(u))e.add(u),i.push(u),null===(a=t.successors(u))||void 0===a||a.forEach((function(t){return o.push(t)})),null===(s=t.predecessors(u))||void 0===s||s.forEach((function(t){return o.push(t)}))}i.length&&n.push(i)})),n};var L=function t(e,n,r,i,o,a){i.includes(n)||(i.push(n),r||a.push(n),o(n).forEach((function(n){return t(e,n,r,i,o,a)})),r&&a.push(n))};const R=function(t,e,n){var r=Array.isArray(e)?e:[e],i=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},o=[],a=[];return r.forEach((function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);L(t,e,"post"===n,a,i,o)})),o};function D(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)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(t,e)}(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 z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(i=s.removeMin(),!(o=a.get(i))||o.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(u);var l={};return Array.from(a.entries()).forEach((function(t){var e=D(t,2),n=e[0],r=e[1];return l[String(n)]=r,l})),l};const U=function(t,e,n,r){return B(t,e,n||F,r||function(e){return t.outEdges(e)})};const j=function(t,e,n){var r={};return t.nodes().forEach((function(i){return r[String(i)]=U(t,i,e,n),r})),r};const V=function(t){var e=0,n=[],r=new Map,i=[];function o(a){var s,u={onStack:!0,lowlink:e,index:e};if(r.set(a,u),e+=1,n.push(a),null===(s=t.successors(a))||void 0===s||s.forEach((function(t){var e;if(r.has(t)){if(null===(e=r.get(t))||void 0===e?void 0:e.onStack){var n=r.get(t);u.lowlink=Math.min(u.lowlink,n.index)}}else{o(t);var i=r.get(t);u.lowlink=Math.min(u.lowlink,i.lowlink)}})),u.lowlink===u.index){var l,c=[];do{l=n.pop(),r.get(l).onStack=!1,c.push(l)}while(a!==l);i.push(c)}}return t.nodes().forEach((function(t){r.has(t)||o(t)})),i};const H=function(t){return V(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};function G(t){return G="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},G(t)}function W(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1}},function(t,e,n){"use strict";e.a=function(t){return"object"==typeof t&&null!==t}},function(t,e,n){"use strict";var r=n(8),i=n(2),o=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return Object(r.a)(t,(function(n,r){Object(i.a)(t)&&"prototype"===r||e.push(n)})),e};e.a=o},function(t,e,n){"use strict";function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}e.a=function(t,e,n,i){return e&&r(t,e),n&&r(t,n),i&&r(t,i),t}},function(t,e,n){var r=n(35),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,n){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])n(t,e);else if(s===i[1])n(t,e),t.right2left();else if(s===i[2])n(t,e);else if(s===i[3])n(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=r(t,e),l=u.left,c=u.right;n(l,e),n(c,e),e.isHorizontal?l.right2left():l.bottom2top(),c.translate(l.x-c.x,l.y-c.y),t.x=l.x,t.y=c.y;var h=t.getBoundingBox();e.isHorizontal?h.top<0&&t.translate(0,-h.top):h.left<0&&t.translate(-h.left,0)}var d=e.fixedRoot;return void 0===d&&(d=!0),d&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},function(t,e,n){var r=n(6),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof o)return t;n.data=t;var r=e.getHGap(t),i=e.getVGap(t);return n.preH=e.getPreH(t),n.preV=e.getPreV(t),n.width=e.getWidth(t),n.height=e.getHeight(t),n.width+=n.preH,n.height+=n.preV,n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,i),n}r.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){var n=this;n.hgap+=t,n.vgap+=e,n.width+=2*t,n.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e,n.x+=n.preH,n.y+=n.preV}))},right2left:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.x=t.x-2*(t.x-e.left)-t.width})),t.translate(e.width,0)},bottom2top:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.y=t.y-2*(t.y-e.top)-t.height})),t.translate(0,e.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new o(t,e=r.assign({},i,e)),u=[s];if(!n&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var l=e.getChildren(a.data),c=l?l.length:0;if(a.children=new Array(c),l&&c)for(var h=0;h-1;)i.call(t,s,1);return t}},function(t,e,n){"use strict";var r=n(1),i=n(24);e.a=function(t,e){var n=[];if(!Object(r.a)(t))return n;for(var o=-1,a=[],s=t.length;++oe[r])return 1;if(t[r]n?n:t}},function(t,e,n){"use strict";e.a=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%1!=0}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%2==0}},function(t,e,n){"use strict";var r=n(5),i=Number.isInteger?Number.isInteger:function(t){return Object(r.a)(t)&&t%1==0};e.a=i},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t<0}},function(t,e,n){"use strict";e.a=function(t,e,n){return void 0===n&&(n=r),Math.abs(t-e)0}},function(t,e,n){"use strict";var r=n(0),i=n(2);e.a=function(t,e){if(Object(r.a)(t)){for(var n,o=-1/0,a=0;ao&&(n=s,o=u)}return n}}},function(t,e,n){"use strict";var r=n(0),i=n(2);e.a=function(t,e){if(Object(r.a)(t)){for(var n,o=1/0,a=0;ae?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l}},function(t,e,n){"use strict";var r=n(1);e.a=function(t){return Object(r.a)(t)?Array.prototype.slice.call(t):[]}},function(t,e,n){"use strict";var r={};e.a=function(t){return r[t=t||"g"]?r[t]+=1:r[t]=1,t+r[t]}},function(t,e,n){"use strict";e.a=function(){}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";e.a=function(t){return Object(r.a)(t)?0:Object(i.a)(t)?t.length:Object.keys(t).length};var r=n(7),i=n(1)},function(t,e,n){"use strict";e.a=function(){for(var t=0,e=0,n=arguments.length;eh&&u>h);)if(d.push(s),h-=u,!(c=c.substr(16)))return d.join("");for(;s=c.substr(0,1),!((u=Object(o.a)(s,n))+l>h);)if(d.push(s),h-=u,!(c=c.substr(1)))return d.join("");return""+d.join("")+a}},function(t,e,n){"use strict";var r=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();e.a=r},function(t,e){function n(t,e,n,r){void 0===r&&(r=[]);var i=this;i.w=t||0,i.h=e||0,i.y=n||0,i.x=0,i.c=r||[],i.cs=r.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e,n){n?t.y+=e:t.x+=e,t.children.forEach((function(t){r(t,e,n)}))}function i(t,e){var n=e?t.y:t.x;return t.children.forEach((function(t){n=Math.min(i(t,e),n)})),n}function o(t,e){r(t,-i(t,e),e)}function a(t,e,n){n?e.y=t.x:e.x=t.x,t.c.forEach((function(t,r){a(t,e.children[r],n)}))}function s(t,e,n){void 0===n&&(n=0),e?(t.x=n,n+=t.width):(t.y=n,n+=t.height),t.children.forEach((function(t){s(t,e,n)}))}n.fromNode=function(t,e){if(!t)return null;var r=[];return t.children.forEach((function(t){r.push(n.fromNode(t,e))})),e?new n(t.height,t.width,t.x,r):new n(t.width,t.height,t.y,r)},t.exports=function(t,e){void 0===e&&(e={});var r=e.isHorizontal;function i(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function u(t,e,n){for(var r=t.c[e-1],i=r.mod,o=t.c[e],a=o.mod;null!==r&&null!==o;){d(r)>n.low&&(n=n.nxt);var s=i+r.prelim+r.w-(a+o.prelim);s>0&&(a+=s,l(t,e,n.index,s));var u=d(r),f=d(o);u<=f&&null!==(r=h(r))&&(i+=r.mod),u>=f&&null!==(o=c(o))&&(a+=o.mod)}!r&&o?function(t,e,n,r){var i=t.c[0].el;i.tl=n;var o=r-n.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):r&&!o&&function(t,e,n,r){var i=t.c[e].er;i.tr=n;var o=r-n.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,i)}function l(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var i=e-n;t.c[n+1].shift+=r/i,t.c[e].shift-=r/i,t.c[e].change-=r-r/i}}(t,e,n,r)}function c(t){return 0===t.cs?t.tl:t.c[0]}function h(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function d(t){return t.y+t.h}function f(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}s(t,r);var p=n.fromNode(t,r);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=f(d(e.c[0].el),0,null),r=1;rs&&(s=e.depth);var n=e.children,r=n.length,o=new i(e.height,[]);return n.forEach((function(e,n){var i=t(e);o.children.push(i),0===n&&(o.leftChild=i),n===r-1&&(o.rightChild=i)})),o.originNode=e,o.isLeaf=e.isLeaf(),o}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=s;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(u),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(u),a(u,t,e.isHorizontal),t}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(11),o=n(123),a=n(35),s=n(6),u=["LR","RL","H"],l=u[0],c=function(t){var e,n;function i(){return t.apply(this,arguments)||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=void 0===n?20:n,i=t.dropCap,s=void 0===i||i,c=t.direction,h=void 0===c?l:c,d=t.align;if(h&&-1===u.indexOf(h))throw new TypeError("Invalid direction: "+h);if(h===u[0])o(e,r,s,d);else if(h===u[1])o(e,r,s,d),e.right2left();else if(h===u[2]){var f=a(e,t),p=f.left,m=f.right;o(p,r,s,d),p.right2left(),o(m,r,s,d);var g=p.getBoundingBox();m.translate(g.width,0),e.x=m.x-e.width/2}return e},i}(i),h={};t.exports=function(t,e){return e=s.assign({},h,e),new c(t,e).execute()}},function(t,e,n){var r=n(6);t.exports=function(t,e,n,i){var o=null;t.eachNode((function(t){!function(t,e,n,i,o){var a="function"==typeof n?n(t):n*t.depth;if(!i)try{if(t.id===t.parent.children[0].id)return t.x+=a,void(t.y=e?e.y:0)}catch(t){}if(t.x+=a,e){if(t.y=e.y+r.getHeight(e,t,o),e.parent&&t.parent.id!==e.parent.id){var s=e.parent,u=s.y+r.getHeight(s,t,o);t.y=u>t.y?u:t.y}}else t.y=0}(t,o,e,n,i),o=t}))}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(11),o=n(125),a=n(17),s=n(6),u=function(t){var e,n;function i(){return t.apply(this,arguments)||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.execute=function(){return a(this.rootNode,this.options,o)},i}(i),l={};t.exports=function(t,e){return e=s.assign({},l,e),new u(t,e).execute()}},function(t,e,n){var r=n(6);function i(t,e){var n=0;return t.children.length?t.children.forEach((function(t){n+=i(t,e)})):n=t.height,t._subTreeSep=e.getSubTreeSep(t.data),t.totalHeight=Math.max(t.height,n)+2*t._subTreeSep,t.totalHeight}function o(t){var e=t.children,n=e.length;if(n){e.forEach((function(t){o(t)}));var r=e[0],i=e[n-1],a=i.y-r.y+i.height,s=0;if(e.forEach((function(t){s+=t.totalHeight})),a>t.height)t.y=r.y+a/2-t.height/2;else if(1!==e.length||t.height>s){var u=t.y+(t.height-a)/2-r.y;e.forEach((function(t){t.translate(0,u)}))}else t.y=(r.y+r.height/2+i.y+i.height/2)/2-t.height/2}}var a={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},a,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,i(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var i=1;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Base=void 0;var n=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}();e.Base=n},33455:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircularLayout=void 0;var o=n(46271),a=n(81422);function s(t,e){var n=t.degree,r=e.degree;return nr?1:0}var u=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this,n=e.nodes,r=e.edges,i=n.length;if(0!==i){e.width||"undefined"==typeof window||(e.width=window.innerWidth),e.height||"undefined"==typeof window||(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var o=e.center;if(1===i)return n[0].x=o[0],n[0].y=o[1],void(e.onLayoutEnd&&e.onLayoutEnd());var s=e.radius,u=e.startRadius,l=e.endRadius,c=e.divisions,h=e.startAngle,d=e.endAngle,f=e.angleRatio,p=e.ordering,m=e.clockwise,g=e.nodeSpacing,v=e.nodeSize,y=(d-h)/i,b={};n.forEach((function(t,e){b[t.id]=e})),e.nodeMap=b;var x=(0,a.getDegree)(n.length,b,r);if(e.degrees=x,g){var w=(0,a.getFuncByUnknownType)(10,g),_=(0,a.getFuncByUnknownType)(10,v),S=-1/0;n.forEach((function(t){var e=_(t);Se.width?e.width/2:e.height/2;var M=y*f,A=[];A="topology"===p?e.topologyOrdering():"topology-directed"===p?e.topologyOrdering(!0):"degree"===p?e.degreeOrdering():n;for(var C=Math.ceil(i/c),T=0;T=0;E--)S(E);return{nodes:n,edges:r,combos:i,comboEdges:s}},e.prototype.getInnerGraphs=function(t){var e=this,n=e.comboTrees,r=e.nodeSize,i=e.edges,a=e.comboPadding,s=e.spacing,c={},h=this.innerLayout||new l.ConcentricLayout({type:"concentric",sortBy:"id"});return h.center=[0,0],h.preventOverlap=!0,h.nodeSpacing=s,(n||[]).forEach((function(e){(0,u.traverseTreeUp)(e,(function(e){var n,s=(null==a?void 0:a(e))||10;if((0,u.isArray)(s)&&(s=Math.max.apply(Math,s)),null===(n=e.children)||void 0===n?void 0:n.length){var l=e.children.map((function(e){if("combo"===e.itemType)return c[e.id];var n=t[e.id]||{};return o(o({},n),e)})),d=l.map((function(t){return t.id})),f={nodes:l,edges:i.filter((function(t){return d.includes(t.source)&&d.includes(t.target)}))},p=1/0;l.forEach((function(t){var e;t.size||(t.size=(null===(e=c[t.id])||void 0===e?void 0:e.size)||(null==r?void 0:r(t))||[30,30]),(0,u.isNumber)(t.size)&&(t.size=[t.size,t.size]),p>t.size[0]&&(p=t.size[0]),p>t.size[1]&&(p=t.size[1])})),h.layout(f);var m=(0,u.getLayoutBBox)(l),g=m.minX,v=m.minY,y=m.maxX,b=m.maxY,x={x:(y+g)/2,y:(b+v)/2};f.nodes.forEach((function(t){t.x-=x.x,t.y-=x.y}));var w=Math.max(y-g,p)+2*s,_=Math.max(b-v,p)+2*s;c[e.id]={id:e.id,nodes:l,size:[w,_]}}else if("combo"===e.itemType){var S=s?[2*s,2*s]:[30,30];c[e.id]={id:e.id,nodes:[],size:S}}return!0}))})),c},e.prototype.initVals=function(){var t,e,n=this,r=n.nodeSize,i=n.spacing;if(e=(0,u.isNumber)(i)?function(){return i}:(0,u.isFunction)(i)?i:function(){return 0},this.spacing=e,r)if((0,u.isFunction)(r))t=function(t){var n=r(t),i=e(t);return(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if((0,u.isArray)(r)){var o=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return o+e(t)/2}}else{var a=r/2;t=function(t){return a+e(t)/2}}else t=function(t){var n=e(t);return t.size?(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+n)/2:(0,u.isObject)(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+n)/2:(t.size+n)/2:10+n/2};this.nodeSize=t;var s,l=n.comboPadding;s=(0,u.isNumber)(l)?function(){return l}:(0,u.isArray)(l)?function(){return Math.max.apply(null,l)}:(0,u.isFunction)(l)?l:function(){return 0},this.comboPadding=s},e.prototype.getType=function(){return"comboCombined"},e}(s.Base);e.ComboCombinedLayout=c},42335:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ComboForceLayout=void 0;var o=n(46271),a=n(81422),s=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var s=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){(0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)&&(t.x+=r[e].x*i,t.y+=r[e].y*i)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;uv[1]?v[0]:v[1])/2;m=function(t){return b}}else{var x=v/2;m=function(t){return x}}else m=function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=m;var w,_=t.comboSpacing;w=(0,a.isNumber)(_)?function(){return _}:(0,a.isFunction)(_)?_:function(){return 0},this.comboSpacing=w;var S,E=t.comboPadding;S=(0,a.isNumber)(E)?function(){return E}:(0,a.isArray)(E)?function(){return Math.max.apply(null,E)}:(0,a.isFunction)(E)?E:function(){return 0},this.comboPadding=S;var M,A=this.linkDistance;A||(A=10),M=(0,a.isNumber)(A)?function(t){return A}:A,this.linkDistance=M;var C,T=this.edgeStrength;T||(T=1),C=(0,a.isNumber)(T)?function(t){return T}:T,this.edgeStrength=C;var k,I=this.nodeStrength;I||(I=30),k=(0,a.isNumber)(I)?function(t){return I}:I,this.nodeStrength=k},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,i=t[r];r&&i?(e.x=i.cx+100/(n+1),e.y=i.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,i={};return(n||[]).forEach((function(n){var o=[];(0,a.traverseTreeUp)(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===i[n.id]){var s={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};i[n.id]=s}var u=n.children;u&&u.forEach((function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)}));var l=i[n.id];if(l.cx=0,l.cy=0,0===o.length){l.empty=!0;var c=r[n.id];l.cx=c.x,l.cy=c.y}return o.forEach((function(t){if(l.count++,"node"!==t.itemType){var n=i[t.id];return(0,a.isNumber)(n.cx)&&(l.cx+=n.cx),void((0,a.isNumber)(n.cy)&&(l.cy+=n.cy))}var r=e[t.id];r&&((0,a.isNumber)(r.x)&&(l.cx+=r.x),(0,a.isNumber)(r.y)&&(l.cy+=r.y))})),l.cx/=l.count||1,l.cy/=l.count||1,l.children=o,!0}))})),i},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,i=this.alpha,o=e.comboTrees,s=e.indexMap,u=e.nodeMap,l=e.comboMap;(o||[]).forEach((function(e){(0,a.traverseTreeUp)(e,(function(e){if("node"===e.itemType)return!0;if(!l[e.id])return!0;var n=l[e.id],o=(n.depth+1)/10*.5,c=n.cx,h=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var d=l[e.id];return d&&(0,a.isNumber)(d.cx)&&(n.cx+=d.cx),void(d&&(0,a.isNumber)(d.cy)&&(n.cy+=d.cy))}var f=u[e.id],p=f.x-c||.005,m=f.y-h||.005,g=Math.sqrt(p*p+m*m),v=s[f.id],y=r*i/g*o;t[v].x-=p*y,t[v].y-=m*y,(0,a.isNumber)(f.x)&&(n.cx+=f.x),(0,a.isNumber)(f.y)&&(n.cy+=f.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,i={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(eo&&(l.minX=o),l.minY>a&&(l.minY=a),l.maxX1&&r.forEach((function(n,a){if("node"===n.itemType)return!1;var u=e[n.id];u&&r.forEach((function(r,l){if(a<=l)return!1;if("node"===r.itemType)return!1;var c=e[r.id];if(!c)return!1;var h=u.cx-c.cx||.005,d=u.cy-c.cy||.005,f=h*h+d*d,p=u.r||1,m=c.r||1,g=p+m,v=m*m,y=p*p;if(fi)){var v=e["".concat(f.id,"-").concat(n.id)],y=v.vx,b=v.vy,x=Math.log(Math.abs(n.depth-f.depth)/10)+1||1;x=x<1?1:x,n.comboId!==f.comboId&&(x+=1);var w=x?Math.pow(h,x):1,_=o(n)*a/m*w;if(t[p].x+=y*_,t[p].y+=b*_,p0){var e=Math.abs(v[0][n.sortBy]-t[n.sortBy]);n.maxLevelDiff&&e>=n.maxLevelDiff&&(v=[],g.push(v))}v.push(t)}));var y=u+(d||n.minNodeSpacing);if(!n.preventOverlap){var b=g.length>0&&g[0].length>1,x=(Math.min(n.width,n.height)/2-y)/(g.length+(b?1:0));y=Math.min(y,x)}var w=0;if(g.forEach((function(t){var e=n.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var r=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&n.preventOverlap){var i=Math.cos(r)-Math.cos(0),o=Math.sin(r)-Math.sin(0),a=Math.sqrt(y*y/(i*i+o*o));w=Math.max(a,w)}t.r=w,w+=y})),n.equidistant){for(var _=0,S=0,E=0;E{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FORCE_LAYOUT_TYPE_MAP=e.LAYOUT_MESSAGE=void 0,e.LAYOUT_MESSAGE={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"},e.FORCE_LAYOUT_TYPE_MAP={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0}},79829:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DagreLayout=void 0;var a=o(n(43038)),s=n(81422),u=n(46271),l=n(78326),c=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},e.prototype.execute=function(){var t,e,n,r,i=this,o=this,u=o.nodes,c=o.nodeSize,d=o.rankdir,f=o.combos,p=o.begin,m=o.radial,g=o.comboEdges,v=void 0===g?[]:g,y=o.vedges,b=void 0===y?[]:y;if(u){var x=o.edges||[],w=new l.Graph({multigraph:!0,compound:!0});o.nodeMap={};var _={};u.forEach((function(t){o.nodeMap[t.id]=t,t.comboId&&(_[t.comboId]=_[t.comboId]||[],_[t.comboId].push(t.id))}));var S,E=[],M={};(null===(t=o.nodeOrder)||void 0===t?void 0:t.length)?(o.nodeOrder.forEach((function(t){M[t]=!0,E.push(o.nodeMap[t])})),u.forEach((function(t){M[t.id]||E.push(t)}))):E=u,S=c?(0,s.isArray)(c)?function(){return c}:function(){return[c,c]}:function(t){return t.size?(0,s.isArray)(t.size)?t.size:(0,s.isObject)(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var A=(0,s.getFunc)(o.ranksep,50,o.ranksepFunc),C=(0,s.getFunc)(o.nodesep,50,o.nodesepFunc),T=C,k=A;"LR"!==d&&"RL"!==d||(T=A,k=C),w.setDefaultEdgeLabel((function(){return{}})),w.setGraph(o);var I={};this.sortByCombo&&f&&f.forEach((function(t){if(I[t.id]=t,t.collapsed){var e=S(t),n=k(t),r=T(t),i=e[0]+2*r,o=e[1]+2*n;w.setNode(t.id,{width:i,height:o})}t.parentId&&(I[t.parentId]||w.setNode(t.parentId,{}),w.setParent(t.id,t.parentId))})),E.filter((function(t){return!1!==t.layout})).forEach((function(t){var e=S(t),n=k(t),r=T(t),o=e[0]+2*r,a=e[1]+2*n,u=t.layer;(0,s.isNumber)(u)?w.setNode(t.id,{width:o,height:a,layer:u}):w.setNode(t.id,{width:o,height:a}),i.sortByCombo&&t.comboId&&(I[t.comboId]||(I[t.comboId]={id:t.comboId},w.setNode(t.comboId,{})),w.setParent(t.id,t.comboId))})),x.forEach((function(t){var e=(0,s.getEdgeTerminal)(t,"source"),n=(0,s.getEdgeTerminal)(t,"target");i.layoutNode(e)&&i.layoutNode(n)&&w.setEdge(e,n,{weight:t.weight||1})})),null===(e=null==v?void 0:v.concat(b||[]))||void 0===e||e.forEach((function(t){var e,n,r=t.source,i=t.target,o=(null===(e=I[r])||void 0===e?void 0:e.collapsed)?[r]:_[r]||[r],a=(null===(n=I[i])||void 0===n?void 0:n.collapsed)?[i]:_[i]||[i];o.forEach((function(e){a.forEach((function(n){w.setEdge(e,n,{weight:t.weight||1})}))}))}));var N=void 0;(null===(n=o.preset)||void 0===n?void 0:n.nodes)&&(N=new l.Graph({multigraph:!0,compound:!0}),o.preset.nodes.forEach((function(t){null==N||N.setNode(t.id,t)}))),a.default.layout(w,{prevGraph:N,edgeLabelSpace:o.edgeLabelSpace,keepNodeOrder:Boolean(!!o.nodeOrder),nodeOrder:o.nodeOrder});var P=[0,0];if(p){var O=1/0,L=1/0;w.nodes().forEach((function(t){var e=w.node(t);O>e.x&&(O=e.x),L>e.y&&(L=e.y)})),w.edges().forEach((function(t){var e;null===(e=w.edge(t).points)||void 0===e||e.forEach((function(t){O>t.x&&(O=t.x),L>t.y&&(L=t.y)}))})),P[0]=p[0]-O,P[1]=p[1]-L}var R="LR"===d||"RL"===d;if(m){var D=this,z=D.focusNode,F=D.ranksep,B=D.getRadialPos,U=(0,s.isString)(z)?z:null==z?void 0:z.id,j=U?null===(r=w.node(U))||void 0===r?void 0:r._rank:0,V=[],H=R?"y":"x",G=R?"height":"width",W=1/0,X=-1/0;w.nodes().forEach((function(t){var e=w.node(t);if(o.nodeMap[t]){var n=C(o.nodeMap[t]);if(0===j)V[e._rank]||(V[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),V[e._rank].nodes.push(t),V[e._rank].totalWidth+=2*n+e[G],V[e._rank].maxSizeX&&(X=s)}}));var Y=F||50,q={},$=(X-W)/.9,K=[.5*(W+X-$),.5*(W+X+$)],Z=function(t,e,n,r){void 0===n&&(n=-1/0),void 0===r&&(r=[0,1]);var i=n;return t.forEach((function(t){var n=w.node(t);q[t]=e;var a=B(n[H],K,$,e,r),s=a.x,u=a.y;if(o.nodeMap[t]){o.nodeMap[t].x=s+P[0],o.nodeMap[t].y=u+P[1],o.nodeMap[t]._order=n._order;var l=A(o.nodeMap[t]);i=i}))}:function(t,e,n){var r=Math.max(e.x,n.x),i=Math.min(e.x,n.x);return t.filter((function(t){return t.x<=r&&t.x>=i}))};w.edges().forEach((function(t){var e,n=w.edge(t),r=x.findIndex((function(e){var n=(0,s.getEdgeTerminal)(e,"source"),r=(0,s.getEdgeTerminal)(e,"target");return n===t.v&&r===t.w}));if(!(r<=-1)&&o.edgeLabelSpace&&o.controlPoints&&"loop"!==x[r].type){null===(e=null==n?void 0:n.points)||void 0===e||e.forEach((function(t){t.x+=P[0],t.y+=P[1]}));var i=o.nodeMap[t.v],a=o.nodeMap[t.w];x[r].controlPoints=h(null==n?void 0:n.points,i,a,et,R,nt,rt)}}))}return o.onLayoutEnd&&o.onLayoutEnd(),{nodes:u,edges:x}}},e.prototype.getRadialPos=function(t,e,n,r,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/n,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*r,y:Math.sin(a)*r}},e.prototype.getType=function(){return"dagre"},e}(u.Base);e.DagreLayout=c;var h=function(t,e,n,r,i,o,a){var s=(null==t?void 0:t.slice(1,t.length-1))||[];if(e&&n){var u=e.x,l=e.y,c=n.x,h=n.y;if(i&&(u=e.y,l=e.x,c=n.y,h=n.x),h!==l&&u!==c){var d=r.indexOf(l),f=r[d+1];if(f){var p=s[0],m=i?{x:(l+f)/2,y:(null==p?void 0:p.y)||c}:{x:(null==p?void 0:p.x)||c,y:(l+f)/2};p&&!o(p,m)||s.unshift(m)}var g=r.indexOf(h),v=Math.abs(g-d);if(1===v)(s=a(s,e,n)).length||s.push(i?{x:(l+h)/2,y:u}:{x:u,y:(l+h)/2});else if(v>1){var y=r[g-1];if(y){var b=s[s.length-1],x=i?{x:(h+y)/2,y:(null==b?void 0:b.y)||c}:{x:(null==b?void 0:b.x)||u,y:(h+y)/2};b&&!o(b,x)||s.push(x)}}}}return s}},69524:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;nt.x&&(i=t.x),o>t.y&&(o=t.y)})),e.forEach((function(t){t.points.forEach((function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)}))})),r[0]=n[0]-i,r[1]=n[1]-o}return r},e.prototype.updateNodePosition=function(t,e){var n=this,r=n.combos,i=n.nodes,o=n.edges,a=n.anchorPoint,s=n.graphSettings,l=this.getBegin(t,e);t.forEach((function(t){var n,c=t.x,h=t.y,d=t.id,f=t.type,p=t.coreBox;if(f===u.HierarchyNodeType.META&&d!==u.ROOT_NAME){var m=r.findIndex((function(t){return t.id===d})),g=null===(n=null==s?void 0:s.subScene)||void 0===n?void 0:n.meta;r[m].offsetX=c+l[0],r[m].offsetY=h+l[1],r[m].fixSize=[p.width,p.height],r[m].fixCollapseSize=[p.width,p.height],t.expanded?r[m].padding=[null==g?void 0:g.paddingTop,null==g?void 0:g.paddingRight,null==g?void 0:g.paddingBottom,null==g?void 0:g.paddingLeft]:r[m].padding=[0,0,0,0]}else if(f===u.HierarchyNodeType.OP){m=i.findIndex((function(t){return t.id===d}));if(i[m].x=c+l[0],i[m].y=h+l[1],a){var v=[],y=e.filter((function(t){return t.v===d})),b=e.filter((function(t){return t.w===d}));y.length>0&&y.forEach((function(e){var n=e.points[0],r=(n.x-c)/t.width+.5,i=(n.y-h)/t.height+.5;v.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.sourceAnchor=v.length-1)}))})),b.length>0&&b.forEach((function(e){var n=e.points[e.points.length-1],r=(n.x-c)/t.width+.5,i=(n.y-h)/t.height+.5;v.push([r,i]),e.baseEdgeList.forEach((function(t){var e=o.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.targetAnchor=v.length-1)}))})),i[m].anchorPoints=v.length>0?v:i[m].anchorPoints||[]}}}))},e.prototype.updateEdgePosition=function(t,e){var n=this,r=n.combos,i=n.edges,s=n.controlPoints,l=this.getBegin(t,e);s&&(r.forEach((function(t){t.inEdges=[],t.outEdges=[]})),i.forEach((function(e){var i,s,c,h,d=t.find((function(t){return t.id===e.source})),f=t.find((function(t){return t.id===e.target})),p=[],m=[];if(d&&f)m=(0,u.getEdges)(null==d?void 0:d.id,null==f?void 0:f.id,t);else if(!d||!f){var g=n.getNodePath(e.source),v=n.getNodePath(e.target),y=g.reverse().slice(d?0:1).find((function(e){return t.find((function(t){return t.id===e}))})),b=v.reverse().slice(f?0:1).find((function(e){return t.find((function(t){return t.id===e}))}));d=t.find((function(t){return t.id===y})),f=t.find((function(t){return t.id===b})),m=(0,u.getEdges)(null==d?void 0:d.id,null==f?void 0:f.id,t,{v:e.source,w:e.target})}if(p=(p=m.reduce((function(t,e){return a(a([],t,!0),e.points.map((function(t){return o(o({},t),{x:t.x+l[0],y:t.y+l[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=p,(null==f?void 0:f.type)===u.NodeType.META){var x=r.findIndex((function(t){return t.id===(null==f?void 0:f.id)}));if(!r[x]||(null===(i=r[x].inEdges)||void 0===i?void 0:i.some((function(t){return t.source===d.id&&t.target===f.id}))))return;null===(s=r[x].inEdges)||void 0===s||s.push({source:d.id,target:f.id,controlPoints:p})}if((null==d?void 0:d.type)===u.NodeType.META){x=r.findIndex((function(t){return t.id===(null==d?void 0:d.id)}));if(!r[x]||(null===(c=r[x].outEdges)||void 0===c?void 0:c.some((function(t){return t.source===d.id&&t.target===f.id}))))return;null===(h=r[x].outEdges)||void 0===h||h.push({source:d.id,target:f.id,controlPoints:p})}})))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every((function(t){return void 0!==t.layoutOrder}))||t.forEach((function(t,e){t.layoutOrder=e})),t.sort((function(t,e){return t.layoutOrder-e.layoutOrder}))},e}(s.Base);e.DagreCompoundLayout=c},78326:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(n(46888).Graph);e.Graph=o},43038:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(38733)),o=n(11519);e.default={layout:i.default,util:{time:o.time,notime:o.notime}}},99367:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(99952)),o=function(t){var e=[],n={},r={},i=function(o){var a;r[o]||(r[o]=!0,n[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach((function(t){n[t.w]?e.push(t):i(t.w)})),delete n[o])};return t.nodes().forEach(i),e};e.default={run:function(t){var e="greedy"===t.graph().acyclicer?(0,i.default)(t,function(t){return function(e){var n;return(null===(n=t.edge(e))||void 0===n?void 0:n.weight)||1}}(t)):o(t);null==e||e.forEach((function(e){var n=t.edge(e);t.removeEdgeObj(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-".concat(Math.random()))}))},undo:function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}}},82342:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11519),i=function(t,e,n,i,o,a){var s={rank:a,borderType:e,width:0,height:0},u=o[e][a-1],l=(0,r.addDummyNode)(t,"border",s,n);o[e][a]=l,t.setParent(l,i),u&&t.setEdge(u,l,{weight:1})};e.default=function(t){var e,n=function(e){var r=t.children(e),o=t.node(e);if((null==r?void 0:r.length)&&r.forEach((function(t){return n(t)})),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,s=o.maxRank+1;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){t.nodes().forEach((function(e){r(t.node(e))})),t.edges().forEach((function(e){r(t.edge(e))}))},r=function(t){var e=t.width;t.width=t.height,t.height=e},i=function(t){t.nodes().forEach((function(e){o(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return o(t)})),r.hasOwnProperty("y")&&o(r)}))},o=function(t){(null==t?void 0:t.y)&&(t.y=-t.y)},a=function(t){t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return s(t)})),r.hasOwnProperty("x")&&s(r)}))},s=function(t){var e=t.x;t.x=t.y,t.y=e};e.default={adjust:function(t){var e,r=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==r&&"rl"!==r||n(t)},undo:function(t){var e,r=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==r&&"rl"!==r||i(t),"lr"!==r&&"rl"!==r||(a(t),n(t))}}},57110:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){if("next"!==t&&"prev"!==t)return e},r=function(t){t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev},i=function(){function t(){var t={};t.prev=t,t.next=t.prev,this.shortcut=t}return t.prototype.dequeue=function(){var t=this.shortcut,e=t.prev;if(e&&e!==t)return r(e),e},t.prototype.enqueue=function(t){var e=this.shortcut;t.prev&&t.next&&r(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e},t.prototype.toString=function(){for(var t=[],e=this.shortcut,r=e.prev;r!==e;)t.push(JSON.stringify(r,n)),r=null==r?void 0:r.prev;return"[".concat(t.join(", "),"]")},t}();e.default=i},99952:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(n(57110)),s=n(46888),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(a.default),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(s.Graph),c=function(){return 1},h=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)d(t,e,n,r);for(;r=o.dequeue();)d(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){i=i.concat(d(t,e,n,r,!0));break}}return i},d=function(t,e,n,r,i){var o,a,s=[];return null===(o=t.inEdges(r.v))||void 0===o||o.forEach((function(r){var o=t.edge(r),a=t.node(r.v);i&&s.push({v:r.v,w:r.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=o,p(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var i=t.edge(r),o=r.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,p(e,n,a)})),t.removeNode(r.v),i?s:void 0},f=function(t,e){var n=new l,r=0,i=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var o=n.edge(t)||0,a=(null==e?void 0:e(t))||1,s=o+a;n.setEdge(t.v,t.w,s),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var o=[],a=i+r+3,s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11519),i=function(t,e,n,o,a,s,u){var l=t.children(u);if(null==l?void 0:l.length){var c=(0,r.addBorderNode)(t,"_bt"),h=(0,r.addBorderNode)(t,"_bb"),d=t.node(u);t.setParent(c,u),d.borderTop=c,t.setParent(h,u),d.borderBottom=h,null==l||l.forEach((function(r){i(t,e,n,o,a,s,r);var l=t.node(r),d=l.borderTop?l.borderTop:r,f=l.borderBottom?l.borderBottom:r,p=l.borderTop?o:2*o,m=d!==f?1:a-s[u]+1;t.setEdge(c,d,{minlen:m,weight:p,nestingEdge:!0}),t.setEdge(f,h,{minlen:m,weight:p,nestingEdge:!0})})),t.parent(u)||t.setEdge(e,c,{weight:0,minlen:a+s[u]})}else u!==e&&t.setEdge(e,u,{weight:0,minlen:n})},o=function(t){var e,n={},r=function(e,i){var o=t.children(e);null==o||o.forEach((function(t){return r(t,i+1)})),n[e]=i};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n},a=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e};e.default={run:function(t){var e,n=(0,r.addDummyNode)(t,"root",{},"_root"),s=o(t),u=Math.max.apply(Math,Object.values(s));Math.abs(u)===1/0&&(u=1);var l=u-1,c=2*l+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=c}));var h=a(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){i(t,n,c,h,l,s,e)})),t.graph().nodeRankFactor=c},cleanup:function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdgeObj(e)}))}}},67484:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11519),i=function(t,e){var n=e.v,i=t.node(n).rank,o=e.w,a=t.node(o).rank,s=e.name,u=t.edge(e),l=u.labelRank;if(a!==i+1){t.removeEdgeObj(e);var c,h,d,f=t.graph();for(d=0,++i;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e,n){var r,i={};null==n||n.forEach((function(n){for(var o,a,s=t.parent(n);s;){if((o=t.parent(s))?(a=i[o],i[o]=s):(a=r,r=s),a&&a!==s)return void e.setEdge(a,s);s=o}}))}},69843:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null==n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return null==n||n.forEach((function(e){var n=t.edge(e),i=t.node(e.v);r.sum+=n.weight*i.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}},43517:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(78326),i=function(t){for(var e;t.hasNode(e="_root".concat(Math.random())););return e};e.default=function(t,e,n){var o=i(t),a=new r.Graph({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(r){var i,s=t.node(r),u=t.parent(r);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(r),a.setParent(r,u||o),null===(i=t[n](r))||void 0===i||i.forEach((function(e){var n=e.v===r?e.w:e.v,i=a.edgeFromArgs(n,r),o=void 0!==i?i.weight:0;a.setEdge(n,r,{weight:t.edge(e).weight+o})})),s.hasOwnProperty("minRank")&&a.setNode(r,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},1294:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11519),i=function(t,e,n){for(var i=(0,r.zipObject)(n,n.map((function(t,e){return e}))),o=e.map((function(e){var n,r=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:i[e.w]||0,weight:t.edge(e).weight}}));return null==r?void 0:r.sort((function(t,e){return t.pos-e.pos}))})).flat().filter((function(t){return void 0!==t})),a=1;a0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;l+=t.weight*n}})),l};e.default=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);r+=1)n+=i(t,e[r-1],e[r]);return n}},96524:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(50497)),o=r(n(1294)),a=r(n(43517)),s=r(n(18319)),u=r(n(77749)),l=n(81422),c=n(78326),h=n(11519),d=function(t,e,n){return e.map((function(e){return(0,a.default)(t,e,n)}))},f=function(t,e,n,r){var i=new c.Graph;null==t||t.forEach((function(t){for(var o,a=t.graph().root,l=(0,u.default)(t,a,i,e,n,r),c=0;c<(null===(o=l.vs)||void 0===o?void 0:o.length);c++){var h=t.node(l.vs[c]);h&&(h.order=c)}(0,s.default)(t,i,l.vs)}))},p=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};e.default=function(t,e){for(var n=(0,h.maxRank)(t),r=[],a=[],s=1;s-1;s--)a.push(s);var u=d(t,r,"inEdges"),c=d(t,a,"outEdges"),m=(0,i.default)(t);p(t,m);for(var g,v=Number.POSITIVE_INFINITY,y=(s=0,0);y<4;++s,++y){f(s%2?u:c,s%4>=2,!1,e),m=(0,h.buildLayerMatrix)(t),(b=(0,o.default)(t,m))=2,!0,e),m=(0,h.buildLayerMatrix)(t),(b=(0,o.default)(t,m)){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){for(var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})).map((function(e){return t.node(e).rank})),r=Math.max.apply(Math,n),i=[],o=0;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(79987);e.default=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),i=n.map((function(e){return t.node(e).rank})),o=(0,r.max)(i),a=[],s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){for(var e,n,i=[],o=function(){var o=t.pop();i.push(o),null===(e=o.in.reverse())||void 0===e||e.forEach((function(t){return(e=o,function(t){t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&r(e,t)})(t);var e})),null===(n=o.out)||void 0===n||n.forEach((function(e){return(n=o,function(e){e.in.push(n),0==--e.indegree&&t.push(e)})(e);var n}))};null==t?void 0:t.length;)o();var a=i.filter((function(t){return!t.merged})),s=["vs","i","barycenter","weight"];return a.map((function(t){var e={};return null==s||s.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))},r=function(t,e){var n,r=0,i=0;t.weight&&(r+=t.barycenter*t.weight,i+=t.weight),e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};e.default=function(t,e){var r,i,o,a={};null==t||t.forEach((function(t,e){a[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var n=a[t.v];void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(r=e.edges())||void 0===r||r.forEach((function(t){var e=a[t.v],n=a[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(a[t.w]))}));var s=null===(o=(i=Object.values(a)).filter)||void 0===o?void 0:o.call(i,(function(t){return!t.indegree}));return n(s)}},77749:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(69843)),o=r(n(8406)),a=r(n(73462)),s=function(t,e,n,r,c,h){var d,f,p,m,g=t.children(e),v=t.node(e),y=v?v.borderLeft:void 0,b=v?v.borderRight:void 0,x={};y&&(g=null==g?void 0:g.filter((function(t){return t!==y&&t!==b})));var w=(0,i.default)(t,g||[]);null==w||w.forEach((function(e){var i;if(null===(i=t.children(e.v))||void 0===i?void 0:i.length){var o=s(t,e.v,n,r,h);x[e.v]=o,o.hasOwnProperty("barycenter")&&l(e,o)}}));var _=(0,o.default)(w,n);u(_,x),null===(d=_.filter((function(t){return t.vs.length>0})))||void 0===d||d.forEach((function(e){var n=t.node(e.vs[0]);n&&(e.fixorder=n.fixorder,e.order=n.order)}));var S=(0,a.default)(_,r,c,h);if(y&&(S.vs=[y,S.vs,b].flat(),null===(f=t.predecessors(y))||void 0===f?void 0:f.length)){var E=t.node((null===(p=t.predecessors(y))||void 0===p?void 0:p[0])||""),M=t.node((null===(m=t.predecessors(b))||void 0===m?void 0:m[0])||"");S.hasOwnProperty("barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+E.order+M.order)/(S.weight+2),S.weight+=2}return S},u=function(t,e){null==t||t.forEach((function(t){var n,r=null===(n=t.vs)||void 0===n?void 0:n.map((function(t){return e[t]?e[t].vs:t}));t.vs=r.flat()}))},l=function(t,e){void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)};e.default=s},73462:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11519),i=function(t,e,n){for(var r,i=n;e.length&&(r=e[e.length-1]).i<=i;)e.pop(),null==t||t.push(r.vs),i++;return i},o=function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenterr.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.orderr.order)return 1}return t?r.i-n.i:n.i-r.i}};e.default=function(t,e,n,a){var s=(0,r.partition)(t,(function(t){var e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return a?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")})),u=s.lhs,l=s.rhs.sort((function(t,e){return-t.i- -e.i})),c=[],h=0,d=0,f=0;null==u||u.sort(o(!!e,!!n)),f=i(c,l,f),null==u||u.forEach((function(t){var e;f+=null===(e=t.vs)||void 0===e?void 0:e.length,c.push(t.vs),h+=t.barycenter*t.weight,d+=t.weight,f=i(c,l,f)}));var p={vs:c.flat()};return d&&(p.barycenter=h/d,p.weight=d),p}},66873:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e,n=function(t){var e,n={},r=0,i=function(e){var o,a=r;null===(o=t.children(e))||void 0===o||o.forEach(i),n[e]={low:a,lim:r++}};return null===(e=t.children())||void 0===e||e.forEach(i),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,i,o=e,a=t.node(o),s=a.edgeObj;if(s)for(var u=function(t,e,n,r){var i,o,a=[],s=[],u=Math.min(e[n].low,e[r].low),l=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||l>e[i].lim));for(o=i,i=r;i&&i!==o;)s.push(i),i=t.parent(i);return{lca:o,path:a.concat(s.reverse())}}(t,n,s.v,s.w),l=u.path,c=u.lca,h=0,d=l[h],f=!0;o!==s.w;){if(a=t.node(o),f){for(;d!==c&&(null===(r=t.node(d))||void 0===r?void 0:r.maxRank)s)&&(0,e.addConflict)(r,n,c)})))}function o(t,e){var n=function(t){return JSON.stringify(t.slice(1))}(t);e.get(n)||(i.apply(void 0,t),e.set(n,!0))}return(null==n?void 0:n.length)&&n.reduce((function(e,n){var r,i=-1,a=0,s=new Map;return null==n||n.forEach((function(u,l){var c;if("border"===(null===(c=t.node(u))||void 0===c?void 0:c.dummy)){var h=t.predecessors(u)||[];h.length&&(r=t.node(h[0]).order,o([n,a,l,i,r],s),a=l,i=r)}o([n,a,n.length,r,e.length],s)})),n})),r};e.findOtherInnerSegmentNode=function(t,e){var n,r;if(null===(n=t.node(e))||void 0===n?void 0:n.dummy)return null===(r=t.predecessors(e))||void 0===r?void 0:r.find((function(e){return t.node(e).dummy}))};e.addConflict=function(t,e,n){var r=e,i=n;if(r>i){var o=r;r=i,i=o}var a=t[r];a||(t[r]=a={}),a[i]=!0};e.hasConflict=function(t,e,n){var r=e;r>n&&(r=n);return!!t[r]};e.verticalAlignment=function(t,n,r,i){var o={},a={},s={};return null==n||n.forEach((function(t){null==t||t.forEach((function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),null==n||n.forEach((function(t){var n=-1;null==t||t.forEach((function(t){var u=i(t);if(u.length)for(var l=((u=u.sort((function(t,e){return s[t]-s[e]}))).length-1)/2,c=Math.floor(l),h=Math.ceil(l);c<=h;++c){var d=u[c];a[t]===t&&n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.feasibleTreeWithLayer=e.feasibleTree=void 0;var r=n(53472),i=n(11519),o=n(78326),a=function(t){var e,n,i=new o.Graph({directed:!1}),a=t.nodes()[0],u=t.nodeCount();for(i.setNode(a,{});s(i,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.exchangeEdges=e.enterEdge=e.leaveEdge=e.initLowLimValues=e.calcCutValue=e.initCutValues=void 0;var r=n(75022),i=n(53472),o=n(11519),a=n(46888),s=a.algorithm.preorder,u=a.algorithm.postorder;e.initCutValues=function(t,e){var n=u(t,t.nodes());null==(n=null==n?void 0:n.slice(0,(null==n?void 0:n.length)-1))||n.forEach((function(n){l(t,e,n)}))};var l=function(t,n,r){var i=t.node(r).parent;t.edgeFromArgs(r,i).cutvalue=(0,e.calcCutValue)(t,n,r)};e.calcCutValue=function(t,e,n){var r,i=t.node(n).parent,o=!0,a=e.edgeFromArgs(n,i),s=0;return a||(o=!1,a=e.edgeFromArgs(i,n)),s=a.weight,null===(r=e.nodeEdges(n))||void 0===r||r.forEach((function(r){var a=r.v===n,u=a?r.w:r.v;if(u!==i){var l=a===o,c=e.edge(r).weight;if(s+=l?c:-c,d(t,n,u)){var h=t.edgeFromArgs(n,u).cutvalue;s+=l?-h:h}}})),s};e.initLowLimValues=function(t,e){void 0===e&&(e=t.nodes()[0]),c(t,{},1,e)};var c=function(t,e,n,r,i){var o,a=n,s=n,u=t.node(r);return e[r]=!0,null===(o=t.neighbors(r))||void 0===o||o.forEach((function(n){e[n]||(s=c(t,e,s,n,r))})),u.low=a,u.lim=s++,i?u.parent=i:delete u.parent,s};e.leaveEdge=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))};e.enterEdge=function(t,e,n){var r=n.v,a=n.w;e.hasEdge(r,a)||(r=n.w,a=n.v);var s=t.node(r),u=t.node(a),l=s,c=!1;s.lim>u.lim&&(l=u,c=!0);var h=e.edges().filter((function(e){return c===f(t,t.node(e.v),l)&&c!==f(t,t.node(e.w),l)}));return(0,o.minBy)(h,(function(t){return(0,i.slack)(e,t)}))};e.exchangeEdges=function(t,n,r,i){var o=r.v,a=r.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),(0,e.initLowLimValues)(t),(0,e.initCutValues)(t,n),h(t,n)};var h=function(t,e){var n=t.nodes().find((function(t){var n;return!(null===(n=e.node(t))||void 0===n?void 0:n.parent)})),r=s(t,n);null==(r=null==r?void 0:r.slice(1))||r.forEach((function(n){var r=t.node(n).parent,i=e.edgeFromArgs(n,r),o=!1;i||(i=e.edgeFromArgs(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))},d=function(t,e,n){return t.hasEdge(e,n)},f=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};e.default=function(t){var n=(0,o.simplify)(t);(0,i.longestPath)(n);var a,s,u=(0,r.feasibleTree)(n);for((0,e.initLowLimValues)(u),(0,e.initCutValues)(u,n);a=(0,e.leaveEdge)(u);)s=(0,e.enterEdge)(u,n,a),(0,e.exchangeEdges)(u,n,a,s)}},53472:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slack=e.longestPathWithLayer=e.longestPath=void 0;var n=function(t){var e,n={},r=function(e){var i,o,a=t.node(e);return a?n[e]?a.rank:(n[e]=!0,null===(i=t.outEdges(e))||void 0===i||i.forEach((function(e){var n=r(e.w)-t.edge(e).minlen;n&&(void 0===o||n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.minBy=e.notime=e.time=e.partition=e.maxRank=e.addBorderNode=e.removeEmptyRanks=e.normalizeRanks=e.buildLayerMatrix=e.intersectRect=e.predecessorWeights=e.successorWeights=e.zipObject=e.asNonCompoundGraph=e.simplify=e.addDummyNode=void 0;var r=n(81422),i=n(78326);e.addDummyNode=function(t,e,n,r){var i;do{i="".concat(r).concat(Math.random())}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i};e.simplify=function(t){var e=(new i.Graph).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e};e.asNonCompoundGraph=function(t){var e=new i.Graph({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){e.setEdgeObj(n,t.edge(n))})),e};e.zipObject=function(t,e){return null==t?void 0:t.reduce((function(t,n,r){return t[n]=e[r],t}),{})};e.successorWeights=function(t){var e={};return t.nodes().forEach((function(n){var r,i={};null===(r=t.outEdges(n))||void 0===r||r.forEach((function(e){var n;i[e.w]=(i[e.w]||0)+((null===(n=t.edge(e))||void 0===n?void 0:n.weight)||0)})),e[n]=i})),e};e.predecessorWeights=function(t){var n=t.nodes(),r=n.map((function(e){var n,r={};return null===(n=t.inEdges(e))||void 0===n||n.forEach((function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight})),r}));return(0,e.zipObject)(n,r)};e.intersectRect=function(t,e){var n,r,i=Number(t.x),o=Number(t.y),a=Number(e.x)-i,s=Number(e.y)-o,u=Number(t.width)/2,l=Number(t.height)/2;return a||s?(Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),n=l*a/s,r=l):(a<0&&(u=-u),n=u,r=u*s/a),{x:i+n,y:o+r}):{x:0,y:0}};e.buildLayerMatrix=function(t){for(var n=[],r=(0,e.maxRank)(t)+1,i=0;ie)&&(e=i)})),e||(e=0),e};e.partition=function(t,e){var n={lhs:[],rhs:[]};return null==t||t.forEach((function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n};e.time=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}};e.notime=function(t,e){return e()};e.minBy=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))}},84551:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1){var e=r({},t);delete e.size,s.push(e)}}));var d=[];i.forEach((function(t){var e=s.find((function(e){return e.id===t.source})),n=s.find((function(e){return e.id===t.target}));e&&n&&d.push(t)}));var f=new h.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:s,edges:d}).nodes;n.forEach((function(t){var e=(f||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||o/2,t.y=(null==e?void 0:e.y)||a/2}));var p=JSON.parse(JSON.stringify(n)),m=JSON.parse(JSON.stringify(i)),g=u.forceSimulation().nodes(p).force("link",u.forceLink(m).id((function(t){return t.id})).distance((function(t){return d.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",u.forceManyBody()).force("center",u.forceCenter(o/2,a/2)).force("x",u.forceX(o/2)).force("y",u.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise((function(t){g.on("end",(function(){n.forEach((function(t){var e=p.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var r=Math.min.apply(Math,n.map((function(t){return t.x}))),s=Math.max.apply(Math,n.map((function(t){return t.x}))),u=Math.min.apply(Math,n.map((function(t){return t.y}))),h=Math.max.apply(Math,n.map((function(t){return t.y}))),d=o/(s-r),f=a/(h-u);n.forEach((function(t){void 0!==t.x&&d<1&&(t.x=(t.x-r)*d),void 0!==t.y&&f<1&&(t.y=(t.y-u)*f)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),(0,c.default)(n,i),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),(0,l.default)({nodes:n,edges:i},e),t()}))}))}},56401:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(90244));e.default=function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,o=e.nodeMinGap,a=1e4,s=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;a=Math.min(e,a),s=Math.min(n,s)}));var u=new i.default;u.init(n,r,{CELL_H:s,CELL_W:a}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var l=0;la){for(var p=g=Math.ceil((c.size[0]+o)/a)-1,m=0;m-1)||u.cells[d+m+1][f].node)break;p--}u.insertColumn(d,p)}if(c.size[1]+o>s){var g;for(p=g=Math.ceil((c.size[1]+o)/s)-1,m=0;m-1)||u.cells[d][f+m+1].node)break;p--}u.insertRow(f,p)}}for(l=0;lt;r--)for(i=0;i=t&&(this.additionColumn[i]+=e);for(r=0;rt;r--)this.cells[i][r+e]=n(n({},this.cells[i][r]),{dx:i,dy:r+e,x:i*this.CELL_W,y:(r+e)*this.CELL_H}),this.cells[i][r]={dx:i,dy:r,x:i*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null};for(r=0;r=t&&(this.additionRow[r]+=e);for(i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=1200,r=800,i=1e7,o=10,a=3.141592653589793,s=1.5707963267948966,u=.375*a,l=.625*a,c=new Map,h=10,d=10,f=.8,p=.1,m=.5;function g(t,e){var n=(c.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],a=e.size[0]*e.size[1],h=r>a?e:t,d=r>a?t:e,f=h.x-h.size[0]/2,p=h.y-h.size[1]/2,m=h.x+h.size[0]/2,g=h.y+h.size[1]/2,v=d.x-d.size[0]/2,y=d.y-d.size[1]/2,b=d.x+d.size[0]/2,x=d.y+d.size[1]/2,w=h.x,_=h.y,S=d.x,E=d.y,M=0,A=0;if(m>=v&&b>=f&&g>=y&&x>=p){0===(A=Math.sqrt(Math.pow(S-w,2)+Math.pow(E-_,2)))&&(A=1e-7),M=1*o/A*100+((mv?f:v))*((gy?p:y)),M*=i}else{var C=!1,T=function(t,e,n){var r=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,c=e.x-e.size[0]/2,h=e.y-e.size[1]/2,d=e.x+e.size[0]/2,f=e.y+e.size[1]/2,p=t.x,m=t.y,g=e.x,v=e.y,y=g-p,b=Math.atan2(y,v-m),x=0,w=0,_=0,S=0;b>s?(w=i-f,x=c-o,_=parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)),S=parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2))):_=S=0(x=c-o)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):b<-s?(w=i-f)>(x=-(d-r))?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):(w=h-a)>(x=Math.abs(y)>(o-r)/2?r-d:y)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x&&0!==b?(x/Math.sin(b)).toFixed(2):w.toFixed(2));var E=parseFloat(b.toFixed(2)),M=n;return n&&(M=un||o.y>r)&&(e+=1e12);for(var a=i+1;a70&&c<110,f=h>70&&h<110;if((c<30||c>150)&&!(h<30||h>150)||c*h<0){s=!1;break}if(d&&!f||c*h<0){s=!1;break}if((l.x-t.x)*(l.x-e.x)<0){s=!1;break}if((l.y-t.y)*(l.y-e.y)<0){s=!1;break}}return s}function b(t,e){for(var n=!1,r=1*h,i=1*d,o=[r,-r,0,0],a=[0,0,i,-i],s=0;sp?(l=g,n=!0):(u.x-=o[c],u.y-=a[c])}}return f>p&&(f*=m),n?v(t):0}function x(t,e){var i=0;(t.x<0||t.y<0||t.x+t.size[0]+20>n||t.y+t.size[1]+20>r)&&(i+=1e12);for(var o=0;o0&&!(++a>=50);){var s=b(t,e);0!==s&&(o=s),i=o-n,n=o,0===i?--r:r=20}return t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2})),{nodes:t,edges:e}}},92727:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forceNBody=void 0;var r=n(30617);function i(t){var e=0,n=0,r=0;if(t.length){for(var i=0;i<4;i++){(o=t[i])&&o.weight&&(e+=o.weight,n+=o.x*o.weight,r+=o.y*o.weight)}t.x=n/e,t.y=r/e,t.weight=e}else{var o=t;t.x=o.data.x,t.y=o.data.y,t.weight=o.data.weight}}e.forceNBody=function(t,e,n,a,s){var u=n/a,l=t.map((function(t,n){var r=e[t.id],i=r.data,o=r.x,a=r.y,s=r.size,l=i.layout.force.nodeStrength;return{x:o,y:a,size:s,index:n,vx:0,vy:0,weight:u*l}})),c=(0,r.quadtree)(l,(function(t){return t.x}),(function(t){return t.y})).visitAfter(i);return l.forEach((function(t){!function(t,e){e.visit((function(e,n,r,i,a){return o(e,n,r,i,a,t)}))}(t,c)})),l.map((function(n,r){var i=e[t[r].id].data.layout.force.mass,o=void 0===i?1:i;s[2*r]=n.vx/o,s[2*r+1]=n.vy/o})),s};var o=function(t,e,n,r,i,o){var a=o.x-t.x||.1,s=o.y-t.y||.1,u=r-e,l=a*a+s*s,c=Math.sqrt(l)*l;if(u*u*.811&&(o=(0,s.getAvgNodePosition)(l))}else o=void 0;return{x:null==o?void 0:o.x,y:null==o?void 0:o.y}}}}if(r){t||(t=this.getSameTypeLeafMap());var f=Array.from(new Set(a.map((function(t,e){return t[i]})))).filter((function(t){return void 0!==t})),p={};f.forEach((function(t){var e=a.filter((function(e){return e[i]===t})).map((function(t){return u[t.id]}));p[t]=(0,s.getAvgNodePosition)(e)})),h={single:function(t){return c(t)},leaf:function(t){return c(t)},others:function(t){return c(t)},center:function(t,e,n){var r=p[t[i]];return{x:null==r?void 0:r.x,y:null==r?void 0:r.y}}}}this.centripetalOptions=o(o({},this.centripetalOptions),h);var m=this.centripetalOptions,g=m.leaf,v=m.single,y=m.others;g&&"function"!=typeof g&&(this.centripetalOptions.leaf=function(){return g}),v&&"function"!=typeof v&&(this.centripetalOptions.single=function(){return v}),y&&"function"!=typeof y&&(this.centripetalOptions.others=function(){return y})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var e=t.nodes,n=t.edges,r=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void t.onLayoutEnd([o({},e[0])]);t.degreesMap=(0,s.getDegreeMap)(e,n),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var n=1;(0,s.isNumber)(e.mass)&&(n=e.mass);var r=t.degreesMap[e.id].all;return!r||r<5?n:5*r*n};var a,u=t.nodeSize;if(t.preventOverlap){var c,h=t.nodeSpacing;c=(0,s.isNumber)(h)?function(){return h}:(0,s.isFunction)(h)?h:function(){return 0},a=u?(0,s.isArray)(u)?function(t){return Math.max(u[0],u[1])+c(t)}:function(t){return u+c(t)}:function(t){return t.size?(0,s.isArray)(t.size)?Math.max(t.size[0],t.size[1])+c(t):(0,s.isObject)(t.size)?Math.max(t.size.width,t.size.height)+c(t):t.size+c(t):10+c(t)}}t.nodeSize=a,t.linkDistance=l(t.linkDistance,1),t.nodeStrength=l(t.nodeStrength,1),t.edgeStrength=l(t.edgeStrength,1);var d={},f={};e.forEach((function(e,r){(0,s.isNumber)(e.x)||(e.x=Math.random()*t.width),(0,s.isNumber)(e.y)||(e.y=Math.random()*t.height);var i=t.degreesMap[e.id];d[e.id]=o(o({},e),{data:o(o({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:i.in,outDegree:i.out,degree:i.all,tDegree:i.in,sDegree:i.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,n)}}})}),f[e.id]=r})),t.nodeMap=d,t.nodeIdxMap=f,t.edgeInfos=[],null==n||n.forEach((function(e){var n=d[e.source],i=d[e.target];n&&i?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:r?r(o(o({},e),{source:n,target:i}),n,i):t.linkDistance(e,n,i)||1+(u(n)+u(n)||0)/2}):elf.edgeInfos.push({})})),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,n=t.nodes,r=t.edges,i=t.workerEnabled,o=t.minMovement,a=t.animate,s=t.nodeMap,u=t.height;if(t.currentMinY=0,t.currentMaxY=u,n){var l=[];if(n.forEach((function(t,e){l[2*e]=0,l[2*e+1]=0})),this.defSideCoe&&"function"==typeof this.defSideCoe){var c={};r.forEach((function(t){var e=t.source,n=t.target;c[e]=c[e]||[],c[e].push(t),c[n]=c[n]||[],c[n].push(t)})),this.relatedEdges=c}var h=e;if(i||!a){for(var d=0;(t.judgingDistance>o||d<1)&&d=h||t.judgingDistancea){var c=a/l;s*=c,u*=c}e[2*i]=s,e[2*i+1]=u}))},e.prototype.updatePosition=function(t,e){var n=this,r=n.nodes,i=n.distanceThresholdMode,o=n.nodeMap;if(null==r?void 0:r.length){var a=0;"max"===i?n.judgingDistance=-1/0:"min"===i&&(n.judgingDistance=1/0);var u=1/0,l=-1/0;r.forEach((function(r,c){var h=o[r.id];if((0,s.isNumber)(r.fx)&&(0,s.isNumber)(r.fy))return r.x=r.fx,r.y=r.fy,h.x=r.x,void(h.y=r.y);var d=t[2*c]*e,f=t[2*c+1]*e;r.x+=d,r.y+=f,h.x=r.x,h.y=r.y,r.yl&&(l=r.y);var p=Math.sqrt(d*d+f*f);switch(i){case"max":n.judgingDistancep&&(n.judgingDistance=p);break;default:a+=p}})),this.currentMinY=u,this.currentMaxY=l,i&&"mean"!==i||(n.judgingDistance=a/r.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,n=t.nodes,r=t.edges,i=t.nodeMap,o=t.degreesMap;if(null==n?void 0:n.length){var a={};return n.forEach((function(t,n){1===o[t.id].all&&(a[t.id]=(0,s.getCoreNodeAndRelativeLeafNodes)("leaf",t,r,e,o,i))})),a}},e}(a.Base);e.Force2Layout=c},23151:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();e.default=n},48991:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForceAtlas2Layout=void 0;var a=n(46271),s=n(81422),u=o(n(23151)),l=o(n(42784)),c=o(n(25980)),h=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,i=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var o=[],a=e.length,u=0;u250&&(t.barnesHut=!0),void 0===t.prune&&a>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(i=100,a<=200&&a>100?i=500:a>200&&(i=950),this.maxIteration=i):(i=250,a<=200&&a>100?i=1e3:a>200&&(i=1200),this.maxIteration=i),t.kr||(t.kr=50,a>100&&a<=500?t.kr=20:a>500&&(t.kr=1)),t.kg||(t.kg=20,a>100&&a<=500?t.kg=10:a>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(o),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,i=e.nodes,o=n.filter((function(t){return(0,s.getEdgeTerminal)(t,"source")!==(0,s.getEdgeTerminal)(t,"target")})),a=i.length,u=o.length,l=[],c={},h={},d=[],f=0;f0;){for(y=0;y50||!c)?this.getOptRepGraForces(m,v,i):this.getRepGraForces(p,50,m,100,o,i);var x=this.updatePos(m,g,f,i);s=x.nodes,f=x.sg,p--,a.tick&&a.tick()}return s},e.prototype.getAttrForces=function(t,e,n,r,i,o,a,s){for(var u=this,l=u.nodes,c=u.preventOverlap,h=u.dissuadeHubs,d=u.mode,f=u.prune,p=0;p0&&(w=x,_=x),s[2*r[m.id]]+=w*b[0],s[2*r[v.id]]-=_*b[0],s[2*r[m.id]+1]+=w*b[1],s[2*r[v.id]+1]-=_*b[1]}}return s},e.prototype.getRepGraForces=function(t,e,n,r,i,o){for(var a=this,s=a.nodes,u=a.preventOverlap,l=a.kr,c=a.kg,h=a.center,d=a.prune,f=s.length,p=0;p0&&(y=l*(o[p]+1)*(o[m]+1)/v),n[2*p]-=y*g[0],n[2*m]+=y*g[0],n[2*p+1]-=y*g[1],n[2*m+1]+=y*g[1]}var b=[s[p].x-h[0],s[p].y-h[1]],x=Math.hypot(b[0],b[1]);b[0]=b[0]/x,b[1]=b[1]/x;var w=c*(o[p]+1);n[2*p]-=w*b[0],n[2*p+1]-=w*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,i=r.nodes,o=r.kg,a=r.center,s=r.prune,u=i.length,h=9e10,d=-9e10,f=9e10,p=-9e10,m=0;m=d&&(d=i[m].x),i[m].x<=h&&(h=i[m].x),i[m].y>=p&&(p=i[m].y),i[m].y<=f&&(f=i[m].y));var g={xmid:(d+h)/2,ymid:(p+f)/2,length:Math.max(d-h,p-f),massCenter:a,mass:u},v=new l.default(g),y=new c.default(v);for(m=0;m1.5*w?1.5*w:n);for(g=0;gE?E:_)*t[2*g],A=_*t[2*g+1];o[g].x+=M,o[g].y+=A}return{nodes:o,sg:n}},e}(a.Base);e.ForceAtlas2Layout=h},42784:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();e.default=n},25980:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),r&&e.edgeForce)e.edgeForce.links(r);else if(r&&!e.edgeForce){d=l.forceLink().id((function(t){return t.id})).links(r);e.edgeStrength&&d.strength(e.edgeStrength),e.linkDistance&&d.distance(e.linkDistance),e.edgeForce=d,i.force("link",d)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{var u=l.forceManyBody();if(e.nodeStrength&&u.strength(e.nodeStrength),i=l.forceSimulation().nodes(n),e.clustering){var h=(0,c.default)();h.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&h.links(r),n&&h.nodes(n),h.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=h,i.force("group",h)}if(i.force("center",l.forceCenter(e.center[0],e.center[1])).force("charge",u).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var d=l.forceLink().id((function(t){return t.id})).links(r);e.edgeStrength&&d.strength(e.edgeStrength),e.linkDistance&&d.distance(e.linkDistance),e.edgeForce=d,i.force("link",d)}if(e.workerEnabled&&!m()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var p=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay()),o=Math.ceil(i);return o}(i),g=1;g<=p;g++)i.tick(),postMessage({nodes:n,currentTick:g,totalTicks:p,type:f.LAYOUT_MESSAGE.TICK},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,i=r.nodeSize,o=r.nodeSpacing,a=r.collideStrength;if(n=(0,h.isNumber)(o)?function(){return o}:(0,h.isFunction)(o)?o:function(){return 0},i)if((0,h.isFunction)(i))e=function(t){return i(t)+n(t)};else if((0,h.isArray)(i)){var s=(i[0]>i[1]?i[0]:i[1])/2;e=function(t){return s+n(t)}}else if((0,h.isNumber)(i)){var u=i/2;e=function(t){return u+n(t)}}else e=function(){return 10};else e=function(t){return t.size?(0,h.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):(0,h.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",l.forceCollide(e).strength(a))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(d.Base);function m(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}e.ForceLayout=p},24964:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(22127),e)},361:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FruchtermanLayout=void 0;var o=n(46271),a=n(81422),s=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.animate=!0,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=this,i=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),i&&0!==i.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var o=r.center;if(1===i.length)return i[0].x=o[0],i[0].y=o[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var s={},u={};return i.forEach((function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*n.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*n.height),s[t.id]=t,u[t.id]=e})),r.nodeMap=s,r.nodeIdxMap=u,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,s=e.animate,u={};if(a&&n.forEach((function(t){void 0===u[t.cluster]&&(u[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})})),o||!s){for(var l=0;l=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var i=n.edges,o=n.center,s=n.gravity,u=n.speed,l=n.clustering,c=n.height*n.width,h=Math.sqrt(c)/10,d=c/(r.length+1),f=Math.sqrt(d),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,i,p,f,d),l){for(var m in t)t[m].cx=0,t[m].cy=0,t[m].count=0;for(var m in r.forEach((function(e){var n=t[e.cluster];(0,a.isNumber)(e.x)&&(n.cx+=e.x),(0,a.isNumber)(e.y)&&(n.cy+=e.y),n.count++})),t)t[m].cx/=t[m].count,t[m].cy/=t[m].count;var g=n.clusterGravity||s;r.forEach((function(e,n){if((0,a.isNumber)(e.x)&&(0,a.isNumber)(e.y)){var r=t[e.cluster],i=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),o=f*g;p[n].x-=o*(e.x-r.cx)/i,p[n].y-=o*(e.y-r.cy)/i}}))}r.forEach((function(t,e){if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var n=.01*f*s;p[e].x-=n*(t.x-o[0]),p[e].y-=n*(t.y-o[1])}})),r.forEach((function(t,e){if((0,a.isNumber)(t.fx)&&(0,a.isNumber)(t.fy))return t.x=t.fx,void(t.y=t.fy);if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(h*(u/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,o){if(i!==o&&(0,a.isNumber)(r.x)&&(0,a.isNumber)(t.x)&&(0,a.isNumber)(r.y)&&(0,a.isNumber)(t.y)){var s=r.x-t.x,u=r.y-t.y,l=s*s+u*u;if(0===l){l=1;var c=i>o?1:-1;s=.01*c,u=.01*c}var h=n/l;e[i].x+=s*h,e[i].y+=u*h}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var i=(0,a.getEdgeTerminal)(t,"source"),o=(0,a.getEdgeTerminal)(t,"target");if(i&&o){var s=r.nodeIdxMap[i],u=r.nodeIdxMap[o];if(s!==u){var l=r.nodeMap[i],c=r.nodeMap[o];if((0,a.isNumber)(c.x)&&(0,a.isNumber)(l.x)&&(0,a.isNumber)(c.y)&&(0,a.isNumber)(l.y)){var h=c.x-l.x,d=c.y-l.y,f=Math.sqrt(h*h+d*d),p=f*f/n;e[u].x-=h/f*p,e[u].y-=d/f*p,e[s].x+=h/f*p,e[s].y+=d/f*p}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(o.Base);e.FruchtermanLayout=s},70238:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.GForceLayout=void 0;var o=n(46271),a=n(81422),s=function(t,e){return t?(0,a.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},u=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var i=n.center;if(1===r.length)return r[0].x=i[0],r[0].y=i[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var o={},u={};r.forEach((function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*n.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,u[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=u,n.linkDistance=s(n.linkDistance,1),n.nodeStrength=s(n.nodeStrength,1),n.edgeStrength=s(n.edgeStrength,1);var l,c=n.nodeSize;if(n.preventOverlap){var h,d=n.nodeSpacing;h=(0,a.isNumber)(d)?function(){return d}:(0,a.isFunction)(d)?d:function(){return 0},l=c?(0,a.isArray)(c)?function(t){return Math.max(c[0],c[1])+h(t)}:function(t){return c+h(t)}:function(t){return t.size?(0,a.isArray)(t.size)?Math.max(t.size[0],t.size[1])+h(t):(0,a.isObject)(t.size)?Math.max(t.size.width,t.size.height)+h(t):t.size+h(t):10+h(t)}}n.nodeSize=l;var f=n.edges;n.degrees=(0,a.getDegree)(r.length,n.nodeIdxMap,f),n.getMass||(n.getMass=function(t){return t.mass||n.degrees[n.nodeIdxMap[t.id]].all||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(r)if(i||!a){for(var s=0;s=n&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var i=t.x-e[n].x,o=t.y-e[n].y;r+=Math.sqrt(i*i+o*o)})),(r/=t.length)=d)){var f=n.x-e.x,p=n.y-e.y;0===f&&0===p&&(f=.01*Math.random(),p=.01*Math.random());var m=f*f+p*p,g=Math.sqrt(m),v=(g+.1)*o,y=f/g,b=p/g,x=.5*(l(n)+l(e))*i/(v*v),w=r?r(e):1;if(t[2*s]+=y*x,t[2*s+1]+=b*x,t[2*d]-=y*x,t[2*d+1]-=b*x,a&&(c(n)+c(e))/2>g){var _=u*(l(n)+l(e))*.5/m;t[2*s]+=y*_/h,t[2*s+1]+=b*_/h,t[2*d]-=y*_/w,t[2*d+1]-=b*_/w}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,i=n.nodeIdxMap,o=n.linkDistance,s=n.edgeStrength,u=n.nodeSize,l=n.getMass;e.forEach((function(e,n){var c=(0,a.getEdgeTerminal)(e,"source"),h=(0,a.getEdgeTerminal)(e,"target"),d=r[c],f=r[h],p=f.x-d.x,m=f.y-d.y;0===p&&0===m&&(p=.01*Math.random(),m=.01*Math.random());var g=Math.sqrt(p*p+m*m),v=p/g,y=m/g,b=((o(e,d,f)||1+(u(d)+u(f)||0)/2)-g)*s(e),x=i[c],w=i[h],_=l?l(d):1,S=l?l(f):1;t[2*x]-=v*b/_,t[2*x+1]-=y*b/_,t[2*w]+=v*b/S,t[2*w+1]+=y*b/S}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,i=n.gravity,o=n.degrees,s=e.length,u=0;ui.maxSpeed){var l=i.maxSpeed/u;a*=l,s*=l}e[2*r]=a,e[2*r+1]=s}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if((0,a.isNumber)(n.fx)&&(0,a.isNumber)(n.fy))return n.x=n.fx,void(n.y=n.fy);var i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(o.Base);e.GForceLayout=u},25444:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clusterBundle=e.clusterCode=e.fruchtermanBundle=e.fruchtermanCode=void 0,e.fruchtermanCode="\nimport { globalInvocationID } from 'g-webgpu';\nconst MAX_EDGE_PER_VERTEX;\nconst VERTEX_COUNT;\n@numthreads(1, 1, 1)\nclass Fruchterman {\n @in @out\n u_Data: vec4[];\n @in\n u_K: float;\n @in\n u_K2: float;\n \n @in\n u_Center: vec2;\n @in\n u_Gravity: float;\n @in\n u_ClusterGravity: float;\n @in\n u_Speed: float;\n @in\n u_MaxDisplace: float;\n @in\n u_Clustering: float;\n @in\n u_AttributeArray: vec4[];\n @in\n u_ClusterCenters: vec4[];\n calcRepulsive(i: int, currentNode: vec4): vec2 {\n let dx = 0, dy = 0;\n for (let j = 0; j < VERTEX_COUNT; j++) {\n if (i != j) {\n const nextNode = this.u_Data[j];\n const xDist = currentNode[0] - nextNode[0];\n const yDist = currentNode[1] - nextNode[1];\n const dist = (xDist * xDist + yDist * yDist) + 0.01;\n let param = this.u_K2 / dist;\n \n if (dist > 0.0) {\n dx += param * xDist;\n dy += param * yDist;\n if (xDist == 0 && yDist == 0) {\n const sign = i < j ? 1 : -1;\n dx += param * sign;\n dy += param * sign;\n }\n }\n }\n }\n return [dx, dy];\n }\n calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // \n let dx = 0, dy = 0;\n const vx = currentNode[0] - this.u_Center[0];\n const vy = currentNode[1] - this.u_Center[1];\n const gf = 0.01 * this.u_K * this.u_Gravity;\n dx = gf * vx;\n dy = gf * vy;\n if (this.u_Clustering == 1) {\n const clusterIdx = int(nodeAttributes[0]);\n const center = this.u_ClusterCenters[clusterIdx];\n const cvx = currentNode[0] - center[0];\n const cvy = currentNode[1] - center[1];\n const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;\n const parma = this.u_K * this.u_ClusterGravity / dist;\n dx += parma * cvx;\n dy += parma * cvy;\n }\n return [dx, dy];\n }\n calcAttractive(i: int, currentNode: vec4): vec2 {\n let dx = 0, dy = 0;\n const arr_offset = int(floor(currentNode[2] + 0.5));\n const length = int(floor(currentNode[3] + 0.5));\n const node_buffer: vec4;\n for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {\n if (p >= length) break;\n const arr_idx = arr_offset + p;\n // when arr_idx % 4 == 0 update currentNodedx_buffer\n const buf_offset = arr_idx - arr_idx / 4 * 4;\n if (p == 0 || buf_offset == 0) {\n node_buffer = this.u_Data[int(arr_idx / 4)];\n }\n const float_j = buf_offset == 0 ? node_buffer[0] :\n buf_offset == 1 ? node_buffer[1] :\n buf_offset == 2 ? node_buffer[2] :\n node_buffer[3];\n const nextNode = this.u_Data[int(float_j)];\n const xDist = currentNode[0] - nextNode[0];\n const yDist = currentNode[1] - nextNode[1];\n const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;\n let attractiveF = dist / this.u_K;\n \n if (dist > 0.0) {\n dx -= xDist * attractiveF;\n dy -= yDist * attractiveF;\n if (xDist == 0 && yDist == 0) {\n const sign = i < int(float_j) ? 1 : -1;\n dx -= sign * attractiveF;\n dy -= sign * attractiveF;\n }\n }\n }\n return [dx, dy];\n }\n @main\n compute() {\n const i = globalInvocationID.x;\n const currentNode = this.u_Data[i];\n let dx = 0, dy = 0;\n if (i >= VERTEX_COUNT) {\n this.u_Data[i] = currentNode;\n return;\n }\n\n // [gravity, fx, fy, 0]\n const nodeAttributes = this.u_AttributeArray[i];\n\n if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {\n // the node is fixed\n this.u_Data[i] = [\n nodeAttributes[1],\n nodeAttributes[2],\n currentNode[2],\n currentNode[3]\n ];\n return;\n }\n\n // repulsive\n const repulsive = this.calcRepulsive(i, currentNode);\n dx += repulsive[0];\n dy += repulsive[1];\n // attractive\n const attractive = this.calcAttractive(i, currentNode);\n dx += attractive[0];\n dy += attractive[1];\n // gravity\n const gravity = this.calcGravity(currentNode, nodeAttributes);\n dx -= gravity[0];\n dy -= gravity[1];\n // speed\n dx *= this.u_Speed;\n dy *= this.u_Speed;\n\n // move\n const distLength = sqrt(dx * dx + dy * dy);\n if (distLength > 0.0) {\n const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);\n this.u_Data[i] = [\n currentNode[0] + dx / distLength * limitedDist,\n currentNode[1] + dy / distLength * limitedDist,\n currentNode[2],\n currentNode[3]\n ];\n }\n }\n}\n",e.fruchtermanBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',e.clusterCode="\nimport { globalInvocationID } from 'g-webgpu';\nconst VERTEX_COUNT;\nconst CLUSTER_COUNT;\n@numthreads(1, 1, 1)\nclass CalcCenter {\n @in\n u_Data: vec4[];\n @in\n u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]\n @in @out\n u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]\n @main\n compute() {\n const i = globalInvocationID.x;\n const center = this.u_ClusterCenters[i];\n let sumx = 0;\n let sumy = 0;\n let count = 0;\n for (let j = 0; j < VERTEX_COUNT; j++) {\n const attributes = this.u_NodeAttributes[j];\n const clusterIdx = int(attributes[0]);\n const vertex = this.u_Data[j];\n if (clusterIdx == i) {\n sumx += vertex.x;\n sumy += vertex.y;\n count += 1;\n }\n }\n this.u_ClusterCenters[i] = [\n sumx / count,\n sumy / count,\n count,\n i\n ];\n }\n}\n",e.clusterBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}'},62121:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.aveMovementBundle=e.aveMovementCode=e.gForceBundle=e.gForceCode=void 0,e.gForceCode="\nimport { globalInvocationID } from 'g-webgpu';\n\nconst MAX_EDGE_PER_VERTEX;\nconst VERTEX_COUNT;\nconst SHIFT_20 = 1048576;\n\n@numthreads(1, 1, 1)\nclass GGForce {\n @in @out\n u_Data: vec4[];\n\n @in\n u_damping: float;\n \n @in\n u_maxSpeed: float;\n\n @in\n u_minMovement: float;\n\n @in\n u_AveMovement: vec4[];\n\n @in\n u_coulombDisScale: float;\n\n @in\n u_factor: float;\n\n @in\n u_NodeAttributeArray1: vec4[];\n\n @in\n u_NodeAttributeArray2: vec4[];\n\n @in\n u_interval: float;\n\n unpack_float(packedValue: float): ivec2 {\n const packedIntValue = int(packedValue);\n const v0 = packedIntValue / SHIFT_20;\n return [v0, packedIntValue - v0 * SHIFT_20];\n }\n\n calcRepulsive(i: int, currentNode: vec4): vec2 {\n let ax = 0, ay = 0;\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\n if (i != j) {\n const nextNode = this.u_Data[j];\n const vx = currentNode[0] - nextNode[0];\n const vy = currentNode[1] - nextNode[1];\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\n const n_dist = (dist + 0.1) * this.u_coulombDisScale;\n const direx = vx / dist;\n const direy = vy / dist;\n const attributesi = this.u_NodeAttributeArray1[i];\n const attributesj = this.u_NodeAttributeArray1[j];\n const massi = attributesi[0];\n const nodeStrengthi = attributesi[2];\n const nodeStrengthj = attributesj[2];\n const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;\n // const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);\n const param = nodeStrength * this.u_factor / (n_dist * n_dist);\n ax += direx * param;\n ay += direy * param;\n }\n }\n return [ax, ay];\n }\n\n calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {\n // note: attributes2 = [centerX, centerY, gravity, 0]\n\n const vx = currentNode[0] - attributes2[0];\n const vy = currentNode[1] - attributes2[1];\n \n const ax = vx * attributes2[2];\n const ay = vy * attributes2[2];\n \n return [ax, ay];\n }\n\n calcAttractive(i: int, currentNode: vec4, attributes1: vec4): vec2 {\n // note: attributes1 = [mass, degree, nodeSterngth, 0]\n\n const mass = attributes1[0];\n let ax = 0, ay = 0;\n // const arr_offset = int(floor(currentNode[2] + 0.5));\n // const length = int(floor(currentNode[3] + 0.5));\n\n const compressed = this.unpack_float(currentNode[2]);\n const length = compressed[0];\n const arr_offset = compressed[1];\n\n const node_buffer: vec4;\n for (let p: int = 0; p < MAX_EDGE_PER_VERTEX; p++) {\n if (p >= length) break;\n const arr_idx = arr_offset + 4 * p; // i 节点的第 p 条边开始的小格子位置\n const buf_offset = arr_idx - arr_idx / 4 * 4;\n if (p == 0 || buf_offset == 0) {\n node_buffer = this.u_Data[int(arr_idx / 4)]; // 大格子,大格子位置=小个子位置 / 4,\n }\n\n let float_j: float = node_buffer[0];\n\n const nextNode = this.u_Data[int(float_j)];\n const vx = nextNode[0] - currentNode[0];\n const vy = nextNode[1] - currentNode[1];\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\n const direx = vx / dist;\n const direy = vy / dist;\n const edgeLength = node_buffer[1];\n const edgeStrength = node_buffer[2];\n const diff: float = edgeLength - dist;//edgeLength\n // const param = diff * this.u_stiffness / mass; //\n const param = diff * edgeStrength / mass; // \n ax -= direx * param;\n ay -= direy * param;\n }\n return [ax, ay];\n }\n\n @main\n compute() {\n const i = globalInvocationID.x;\n const currentNode = this.u_Data[i];\n const movement = u_AveMovement[0];\n let ax = 0, ay = 0;\n\n if (i >= VERTEX_COUNT || movement.x < u_minMovement) {\n this.u_Data[i] = currentNode;\n return;\n }\n\n // 每个节点属性占两个数组中各一格\n // [mass, degree, nodeStrength, fx]\n const nodeAttributes1 = this.u_NodeAttributeArray1[i];\n // [centerX, centerY, centerGravity, fy]\n const nodeAttributes2 = this.u_NodeAttributeArray2[i];\n\n // repulsive\n const repulsive = this.calcRepulsive(i, currentNode);\n ax += repulsive[0];\n ay += repulsive[1];\n\n // attractive\n const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);\n ax += attractive[0];\n ay += attractive[1];\n\n // gravity\n const gravity = this.calcGravity(i, currentNode, nodeAttributes2);\n ax -= gravity[0];\n ay -= gravity[1];\n\n // speed\n const param = this.u_interval * this.u_damping;\n let vx = ax * param;\n let vy = ay * param;\n const vlength = sqrt(vx * vx + vy * vy) + 0.0001;\n if (vlength > this.u_maxSpeed) {\n const param2 = this.u_maxSpeed / vlength;\n vx = param2 * vx;\n vy = param2 * vy;\n }\n\n // move\n if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {\n this.u_Data[i] = [\n nodeAttributes1[3],\n nodeAttributes2[3],\n currentNode[2],\n 0\n ];\n } else {\n const distx = vx * this.u_interval;\n const disty = vy * this.u_interval;\n const distLength = sqrt(distx * distx + disty * disty);\n this.u_Data[i] = [\n currentNode[0] + distx,\n currentNode[1] + disty,\n currentNode[2],\n distLength\n ];\n }\n \n // the avarage move distance\n // need to share memory\n \n }\n}\n",e.gForceBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',e.aveMovementCode="\nconst VERTEX_COUNT;\n@numthreads(1, 1, 1)\nclass CalcAveMovement {\n @in\n u_Data: vec4[];\n @in\n u_iter: float;\n @in @out\n u_AveMovement: vec4[];\n @main\n compute() {\n let movement = 0;\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\n const vertex = this.u_Data[j];\n movement += vertex[3];\n }\n movement = movement / float(VERTEX_COUNT);\n this.u_AveMovement[0] = [movement, 0, 0, 0];\n }\n}\n",e.aveMovementBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}'},36010:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.GridLayout=void 0;var o=n(81422),a=function(t){function e(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=t.begin,i=e.length;if(0===i)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n};if(1===i)return e[0].x=r[0],e[0].y=r[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n};var a=t.sortBy,s=t.width,u=t.height,l=t.condense,c=t.preventOverlapPadding,h=t.preventOverlap,d=t.nodeSpacing,f=t.nodeSize,p=[];e.forEach((function(t){p.push(t)}));var m={};if(p.forEach((function(t,e){m[t.id]=e})),("degree"===a||!(0,o.isString)(a)||void 0===p[0][a])&&(a="degree",(0,o.isNaN)(e[0].degree))){var g=(0,o.getDegree)(p.length,m,n);p.forEach((function(t,e){t.degree=g[e].all}))}p.sort((function(t,e){return e[a]-t[a]})),s||"undefined"==typeof window||(s=window.innerWidth),u||"undefined"==typeof window||(u=window.innerHeight);var v=t.rows,y=null!=t.cols?t.cols:t.columns;if(t.cells=i,null!=v&&null!=y?(t.rows=v,t.cols=y):null!=v&&null==y?(t.rows=v,t.cols=Math.ceil(t.cells/t.rows)):null==v&&null!=y?(t.cols=y,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.rows=Math.max(t.rows,1),t.cols=Math.max(t.cols,1),t.cols*t.rows>t.cells)((x=t.small())-1)*(b=t.large())>=t.cells?t.small(x-1):(b-1)*x>=t.cells&&t.large(b-1);else for(;t.cols*t.rows=t.cells?t.large(b+1):t.small(x+1)}if(t.cellWidth=s/t.cols,t.cellHeight=u/t.rows,l&&(t.cellWidth=0,t.cellHeight=0),h||d){var w=(0,o.getFuncByUnknownType)(10,d),_=(0,o.getFuncByUnknownType)(30,f,!1);p.forEach((function(e){e.x&&e.y||(e.x=0,e.y=0);var n,r,i=_(e)||30;(0,o.isArray)(i)?(n=i[0],r=i[1]):(n=i,r=i);var a=void 0!==w?w(e):c,s=n+a,u=r+a;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)}))}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var S=0;S=e&&(t.col=0,t.row++)},e.prototype.getPos=function(t){var e,n,r=this,i=r.begin,o=r.cellWidth,a=r.cellHeight,s=r.id2manPos[t.id];if(s)e=s.col*o+o/2+i[0],n=s.row*a+a/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*o+o/2+i[0],n=r.row*a+a/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},e.prototype.getType=function(){return"grid"},e}(n(46271).Base);e.GridLayout=a},28352:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.ERLayout=e.ForceAtlas2Layout=e.ComboCombinedLayout=e.ComboForceLayout=e.GForceGPULayout=e.FruchtermanGPULayout=e.FruchtermanLayout=e.MDSLayout=e.ConcentricLayout=e.RadialLayout=e.DagreCompoundLayout=e.DagreLayout=e.CircularLayout=e.ForceLayout=e.Force2Layout=e.GForceLayout=e.RandomLayout=e.GridLayout=e.Layouts=e.Layout=void 0;var o=n(36010);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return o.GridLayout}});var a=n(68501);Object.defineProperty(e,"RandomLayout",{enumerable:!0,get:function(){return a.RandomLayout}});var s=n(70238);Object.defineProperty(e,"GForceLayout",{enumerable:!0,get:function(){return s.GForceLayout}});var u=n(1782);Object.defineProperty(e,"Force2Layout",{enumerable:!0,get:function(){return u.Force2Layout}});var l=n(24964);Object.defineProperty(e,"ForceLayout",{enumerable:!0,get:function(){return l.ForceLayout}});var c=n(33455);Object.defineProperty(e,"CircularLayout",{enumerable:!0,get:function(){return c.CircularLayout}});var h=n(79829);Object.defineProperty(e,"DagreLayout",{enumerable:!0,get:function(){return h.DagreLayout}});var d=n(69524);Object.defineProperty(e,"DagreCompoundLayout",{enumerable:!0,get:function(){return d.DagreCompoundLayout}});var f=n(13570);Object.defineProperty(e,"RadialLayout",{enumerable:!0,get:function(){return f.RadialLayout}});var p=n(58006);Object.defineProperty(e,"ConcentricLayout",{enumerable:!0,get:function(){return p.ConcentricLayout}});var m=n(7982);Object.defineProperty(e,"MDSLayout",{enumerable:!0,get:function(){return m.MDSLayout}});var g=n(361);Object.defineProperty(e,"FruchtermanLayout",{enumerable:!0,get:function(){return g.FruchtermanLayout}});var v=n(25444);Object.defineProperty(e,"FruchtermanGPULayout",{enumerable:!0,get:function(){return v.FruchtermanGPULayout}});var y=n(62121);Object.defineProperty(e,"GForceGPULayout",{enumerable:!0,get:function(){return y.GForceGPULayout}});var b=n(42335);Object.defineProperty(e,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var x=n(4193);Object.defineProperty(e,"ComboCombinedLayout",{enumerable:!0,get:function(){return x.ComboCombinedLayout}});var w=n(48991);Object.defineProperty(e,"ForceAtlas2Layout",{enumerable:!0,get:function(){return w.ForceAtlas2Layout}});var _=n(69474);Object.defineProperty(e,"ERLayout",{enumerable:!0,get:function(){return _.ERLayout}});var S=n(52316);Object.defineProperty(e,"Layout",{enumerable:!0,get:function(){return S.Layout}}),Object.defineProperty(e,"Layouts",{enumerable:!0,get:function(){return S.Layouts}}),i(n(82149),e)},52316:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var r=n(38119),i=n(36010),o=n(68501),a=n(1782),s=n(70238),u=n(24964),l=n(33455),c=n(79829),h=n(13570),d=n(58006),f=n(7982),p=n(361),m=n(25444),g=n(62121),v=n(42335),y=n(4193),b=n(48991),x=n(69474),w=n(69524),_=n(81422),S=function(){function t(t){var e=(0,r.getLayoutByName)(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null==t?void 0:t.length){var e=1/0,n=[];if(t.forEach((function(t){(0,_.isString)(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(n.push(t),t.layer{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7856),i=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,i=t.linkDistance;try{var o=r.Matrix.mul(r.Matrix.pow(n,2),-.5),a=o.mean("row"),s=o.mean("column"),u=o.mean();o.add(u).subRowVector(a).subColumnVector(s);var l=new r.SingularValueDecomposition(o),c=r.Matrix.sqrt(l.diagonalMatrix).diagonal();return l.leftSingularVectors.toJSON().map((function(t){return r.Matrix.mul([t],[c]).toJSON()[0].splice(0,e)}))}catch(t){for(var h=[],d=0;dr[0]?r[0]:b-r[0],_=x-r[1]>r[1]?r[1]:x-r[1];0===w&&(w=b/2),0===_&&(_=x/2);var S=_>w?w:_,E=Math.max.apply(Math,y),M=[];y.forEach((function(e,n){t.unitRadius||(t.unitRadius=S/E),M[n]=e*t.unitRadius})),t.radii=M;var A=t.eIdealDisMatrix();t.eIdealDistances=A;var C=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;iN[1]?N[0]:N[1])+O(t)}:function(t){return N+O(t)}:function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+O(t):(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+O(t):t.size+O(t):10+O(t)};var R={nodes:e,nodeSizeFunc:k,adjMatrix:m,positions:T,radii:M,height:x,width:b,strictRadial:P,focusID:p,iterations:t.maxPreventOverlapIteration||200,k:T.length/4.5},D=new l.default(R);T=D.layout()}return T.forEach((function(t,n){e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],i=t.eIdealDistances||[],o=t.radii||[],a=0;a<=e;a++){var s=a/e;t.oneIteration(s,n,o,i,r)}},e.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(s,u){var l=c(s,[0,0]),h=0===l?0:1/l;if(u!==a){var d=0,f=0,p=0;e.forEach((function(t,e){if(u!==e){var n=c(s,t),o=0===n?0:1/n,a=r[e][u];p+=i[u][e],d+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),f+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}}));var m=0===n[u]?0:1/n[u];p*=o,p+=t*m*m,d*=o,d+=t*m*s[0]*h,s[0]=d/p,f*=o,f+=t*m*s[1]*h,s[1]=f/p}}))},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var n=t.distances,r=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,s=[];return n&&n.forEach((function(n,u){var l=[];n.forEach((function(n,s){if(u===s)l.push(0);else if(i[u]===i[s])if("data"===t.sortBy)l.push(n*(Math.abs(u-s)*t.sortStrength)/(i[u]/o));else if(t.sortBy){var c=e[u][t.sortBy]||0,h=e[s][t.sortBy]||0;(0,a.isString)(c)&&(c=c.charCodeAt(0)),(0,a.isString)(h)&&(h=h.charCodeAt(0)),l.push(n*(Math.abs(c-h)*t.sortStrength)/(i[u]/o))}else l.push(n*r/(i[u]/o));else{var d=(r+o)/2;l.push(n*d)}})),s.push(l)})),s},e.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;in?t[e][r]:n);return n},e.prototype.getType=function(){return"radial"},e}(s.Base);e.RadialLayout=h},15470:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,i=t.width/10;t.maxDisplace=i,t.disp=n;for(var o=0;ou?1:-1;l=.01*d,c=.01*d}if(hMath.PI/2&&(c-=Math.PI/2,s*=-1,u*=-1);var h=Math.cos(c)*l;t.x=s*h,t.y=u*h}));var s=t.radii;e.forEach((function(t,u){if(u!==o){var l=Math.sqrt(n[u].x*n[u].x+n[u].y*n[u].y);if(l>0&&u!==o){var c=Math.min(a*(r/800),l);if(t[0]+=n[u].x/l*c,t[1]+=n[u].y/l*c,i){var h=t[0]-e[o][0],d=t[1]-e[o][1],f=Math.sqrt(h*h+d*d);h=h/f*s[u],d=d/f*s[u],t[0]=e[o][0]+h,t[1]=e[o][1]+d}}}}))},t}();e.default=n},68501:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(n(46271).Base);e.RandomLayout=o},82149:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},38119:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=n(46271),a=n(81422),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),(0,a.isObject)(e)){var n=function(t){function n(n){var r,i,o=r=t.call(this)||this,a={},s=Object.assign({},o.getDefaultCfg(),(null===(i=e.getDefaultCfg)||void 0===i?void 0:i.call(e))||{});return Object.assign(a,s,e,n),Object.keys(a).forEach((function(t){var e=a[t];o[t]=e})),r}return i(n,t),n}(o.Base);s.set(t,n)}else s.set(t,e);return s.get(t)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},86755:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},43380:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFuncByUnknownType=e.getFunc=e.isFunction=void 0;var r=n(81422),i=n(19937);e.isFunction=function(t){return"function"==typeof t};e.getFunc=function(t,e,n){return n||((0,i.isNumber)(t)?function(){return t}:function(){return e})};e.getFuncByUnknownType=function(t,n,o){return void 0===o&&(o=!0),n||0===n?(0,e.isFunction)(n)?n:(0,i.isNumber)(n)?function(){return n}:(0,r.isArray)(n)?function(){if(o){var e=Math.max.apply(Math,n);return isNaN(e)?t:e}return n}:(0,r.isObject)(n)?function(){if(o){var e=Math.max(n.width,n.height);return isNaN(e)?t:e}return[n.width,n.height]}:function(){return t}:function(e){return e.size?(0,r.isArray)(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:(0,r.isObject)(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}}},48196:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToTextureData=e.attributesToTextureData=e.buildTextureDataWithTwoEdgeAttr=e.buildTextureData=e.proccessToFunc=void 0;var r=n(81422),i=n(91922);e.proccessToFunc=function(t,e){return t?(0,r.isNumber)(t)?function(){return t}:t:function(){return e||1}};e.buildTextureData=function(t,e){var n=[],r=[],o={},a=0;for(a=0;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCoreNodeAndRelativeLeafNodes=e.getAvgNodePosition=e.getLayoutBBox=e.traverseTreeUp=e.scaleMatrix=e.getAdjMatrix=e.floydWarshall=e.getDegreeMap=e.getDegree=e.getEdgeTerminal=void 0;var r=n(86755),i=n(19937),o=n(15747);e.getEdgeTerminal=function(t,e){var n=t[e];return(0,o.isObject)(n)?n.cell:n};e.getDegree=function(t,n,r){for(var i=[],o=0;oe[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e};e.getAdjMatrix=function(t,n){var r=t.nodes,i=t.edges,o=[],a={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach((function(t,e){a[t.id]=e;o.push([])})),null==i||i.forEach((function(t){var r=(0,e.getEdgeTerminal)(t,"source"),i=(0,e.getEdgeTerminal)(t,"target"),s=a[r],u=a[i];void 0!==s&&void 0!==u&&(o[s][u]=1,n||(o[u][s]=1))})),o};e.scaleMatrix=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n};var a=function(t,e){if(t&&t.children)for(var n=t.children.length-1;n>=0;n--)if(!a(t.children[n],e))return;return!!e(t)};e.traverseTreeUp=function(t,e){"function"==typeof e&&a(t,e)};e.getLayoutBBox=function(t){var e=1/0,n=1/0,o=-1/0,a=-1/0;return t.forEach((function(t){var s=t.size;(0,r.isArray)(s)?1===s.length&&(s=[s[0],s[0]]):(0,i.isNumber)(s)?s=[s,s]:(void 0===s||isNaN(s))&&(s=[30,30]);var u=[s[0]/2,s[1]/2],l=t.x-u[0],c=t.x+u[0],h=t.y-u[1],d=t.y+u[1];e>l&&(e=l),n>h&&(n=h),o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNumber=e.isNaN=e.isNumber=void 0;e.isNumber=function(t){return"number"==typeof t};e.isNaN=function(t){return Number.isNaN(Number(t))};e.toNumber=function(t){var n=parseFloat(t);return(0,e.isNaN)(n)?t:n}},15747:function(t,e){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelize=e.isString=void 0;e.isString=function(t){return"string"==typeof t};var n,r,i=/-(\w)/g;e.camelize=(n=function(t){return t.replace(i,(function(t,e){return e?e.toUpperCase():""}))},r=Object.create(null),function(t){return r[t]||(r[t]=n(t))})},79987:(t,e,n)=>{"use strict";function r(t){return[parseInt(t.substr(1,2),16),parseInt(t.substr(3,2),16),parseInt(t.substr(5,2),16)]}function i(t){var e=Math.round(t).toString(16);return 1===e.length?"0"+e:e}function o(t){return"#"+i(t[0])+i(t[1])+i(t[2])}n.r(e),n.d(e,{Cache:()=>Vn,angleTo:()=>E,arcToCubic:()=>Y,assign:()=>dn,augment:()=>fn,clamp:()=>be,clearAnimationFrame:()=>cn,clone:()=>mn,clonePath:()=>J,contains:()=>St,createDOM:()=>Qn,debounce:()=>gn,deepMix:()=>bn,difference:()=>Mt,direction:()=>S,distanceSquareRoot:()=>et,each:()=>Nt,endsWith:()=>se,equalizeSegments:()=>wt,every:()=>ue,extend:()=>xn,filter:()=>Et,find:()=>Dt,findIndex:()=>zt,firstValue:()=>Ft,fixedBase:()=>xe,flatten:()=>Bt,flattenDeep:()=>jt,forIn:()=>Fe,get:()=>In,getDrawDirection:()=>gt,getPathArea:()=>mt,getPathBBox:()=>ht,getPathBBoxTotalLength:()=>ft,getPointAtLength:()=>vt,getRange:()=>Gt,getRotatedCurve:()=>pt,getTotalLength:()=>dt,getType:()=>Ke,getWrapBehavior:()=>pe,gradient:()=>d,group:()=>fe,groupBy:()=>he,groupToMap:()=>de,has:()=>Be,hasKey:()=>Ue,hasValue:()=>Ve,head:()=>ie,identity:()=>Un,includes:()=>St,indexOf:()=>wn,isArguments:()=>Ze,isArray:()=>kt,isArrayLike:()=>_t,isBoolean:()=>Qe,isDate:()=>Je,isDecimal:()=>_e,isElement:()=>un,isEmpty:()=>Sn,isEqual:()=>Mn,isEqualWith:()=>An,isError:()=>tn,isEven:()=>Se,isFinite:()=>en,isFunction:()=>a,isInteger:()=>Ee,isMatch:()=>Ot,isNegative:()=>Me,isNil:()=>At,isNull:()=>nn,isNumber:()=>we,isNumberEqual:()=>Ce,isObject:()=>It,isObjectLike:()=>Lt,isOdd:()=>Te,isPlainObject:()=>Rt,isPointInPolygon:()=>Xn,isPointInStroke:()=>bt,isPolygonsIntersect:()=>Zn,isPositive:()=>ke,isPrototype:()=>on,isRegExp:()=>an,isString:()=>Jt,isType:()=>Tt,isUndefined:()=>sn,keys:()=>Pt,last:()=>oe,lowerCase:()=>Ge,lowerFirst:()=>We,map:()=>Cn,mapValues:()=>kn,max:()=>Vt,maxBy:()=>Ie,memoize:()=>s,min:()=>Ht,minBy:()=>Ne,mix:()=>dn,mod:()=>Pe,modifyCSS:()=>Jn,noop:()=>Bn,normalizePath:()=>W,number2color:()=>ve,omit:()=>Ln,parseRadius:()=>ye,path2Absolute:()=>H,path2Array:()=>Q,path2Curve:()=>Z,path2String:()=>A,pick:()=>On,pull:()=>qt,pullAt:()=>Kt,reduce:()=>Zt,remove:()=>Qt,requestAnimationFrame:()=>ln,reverseCurve:()=>tt,rgb2arr:()=>r,set:()=>Nn,size:()=>jn,some:()=>le,sortBy:()=>te,startsWith:()=>ae,substitute:()=>Xe,throttle:()=>Rn,toArray:()=>Dn,toCSSGradient:()=>g,toDegree:()=>Le,toInteger:()=>Re,toRGB:()=>c,toRadian:()=>ze,toString:()=>He,transform:()=>w,union:()=>ne,uniq:()=>ee,uniqueId:()=>Fn,upperCase:()=>Ye,upperFirst:()=>qe,values:()=>je,valuesOfKey:()=>re,vertical:()=>M,wrapBehavior:()=>me});const a=function(t){return"function"==typeof t};const s=function(t,e,n){if(void 0===n&&(n=128),!a(t))throw new TypeError("Expected a function");var r=function(){for(var n=[],i=0;ii&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}(n),r};var u,l=/rgba?\(([\s.,0-9]+)\)/;var c=s((function(t){if("#"===t[0]&&7===t.length)return t;var e;u||((e=document.createElement("i")).title="Web Colour Picker",e.style.display="none",document.body.appendChild(e),u=e),u.style.color=t;var n=document.defaultView.getComputedStyle(u,"").getPropertyValue("color");return n=o(l.exec(n)[1].split(/\s*,\s*/).map((function(t){return Number(t)})))}),(function(t){return t}),256);function h(t,e,n,r){return t[r]+(e[r]-t[r])*n}function d(t){var e=("string"==typeof t?t.split("-"):t).map((function(t){return r(-1===t.indexOf("#")?c(t):t)}));return function(t){return function(t,e){var n=isNaN(Number(e))||e<0?0:e>1?1:Number(e),r=t.length-1,i=Math.floor(r*n),a=r*n-i,s=t[i],u=i===r?s:t[i+1];return o([h(s,u,a,0),h(s,u,a,1),h(s,u,a,2)])}(e,t)}}var f=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,p=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,m=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function g(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,n=void 0;if("l"===t[0]){var r=+(i=f.exec(t))[1]+90;n=i[2],e="linear-gradient("+r+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",n=(i=p.exec(t))[4]}var o=n.match(m);return o.forEach((function(t,n){var r=t.split(":");e+=r[1]+" "+100*Number(r[0])+"%",n!==o.length-1&&(e+=", ")})),e+=")"}return t}var v=n(91409);function y(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return v.fromRotation(r,n),v.multiply(t,r,e)}function b(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return v.fromScaling(r,n),v.multiply(t,r,e)}function x(t,e,n){return v.multiply(t,n,e)}function w(t,e){for(var n,r,i,o,a=t?[].concat(t):[1,0,0,0,1,0,0,0,1],s=0,u=e.length;s=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function M(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function A(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var n="number"==typeof e&&e>=1?Math.pow(10,e):1;return t.map((function(t){var r=t.slice(1).map(Number).map((function(t){return e?Math.round(t*n)/n:Math.round(t)}));return[t[0]].concat(r)}))}(t,e).map((function(t){return t[0]+t.slice(1).join(" ")})).join("")}var C=n(31635),T={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function k(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var I={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function N(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return I[e]===t.length-1&&"achlmqstvz".includes(e)}))}function P(t){return N(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function O(t){return P(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function L(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=I[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,I[n]))),I[n]););}function R(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function D(t){return t>=48&&t<=57||43===t||45===t||46===t}function z(t){return t>=48&&t<=57}function F(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),z(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function U(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=I[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,B(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?F(t):R(t),t.err.length)return;t.data.push(t.param),B(t),t.index=t.max)break;if(!D(n.charCodeAt(t.index)))break}L(t)}else L(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var j=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function V(t){if(N(t))return[].concat(t);var e=new j(t);for(B(e);e.index1&&(v*=A=Math.sqrt(A),y*=A);var C=v*v,T=y*y,k=(o===a?-1:1)*Math.sqrt(Math.abs((C*T-C*M*M-T*E*E)/(C*M*M+T*E*E)));f=k*v*M/y+(m+b)/2,p=k*-y*E/v+(g+x)/2,h=Math.asin(((g-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),d=Math.asin(((x-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),h=md&&(h-=2*Math.PI),!a&&d>h&&(d-=2*Math.PI)}var I=d-h;if(Math.abs(I)>w){var N=d,P=b,O=x;d=h+w*(a&&d>h?1:-1),S=Y(b=f+v*Math.cos(d),x=p+y*Math.sin(d),v,y,i,0,a,P,O,[d,N,f,p])}I=d-h;var L=Math.cos(h),R=Math.sin(h),D=Math.cos(d),z=Math.sin(d),F=Math.tan(I/4),B=4/3*v*F,U=4/3*y*F,j=[m,g],V=[m+B*R,g-U*L],H=[b+B*z,x-U*D],G=[b,x];if(V[0]=2*j[0]-V[0],V[1]=2*j[1]-V[1],l)return V.concat(H,G,S);for(var W=[],q=0,$=(S=V.concat(H,G,S)).length;q<$;q+=1)W[q]=q%2?X(S[q-1],S[q],_).y:X(S[q],S[q+1],_).x;return W}function q(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var $=function(t,e,n,r){var i=q([t,e],[n,r],.5);return(0,C.__spreadArray)((0,C.__spreadArray)([],i,!0),[n,r,n,r],!1)};function K(t,e){var n,r,i,o,a,s,u,l,c,h=t[0],d=t.slice(1).map(Number),f=d[0],p=d[1],m=e.x1,g=e.y1,v=e.x,y=e.y;switch("TQ".includes(h)||(e.qx=null,e.qy=null),h){case"M":return e.x=f,e.y=p,t;case"A":return n=[m,g].concat(d),["C"].concat(Y(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=f,e.qy=p,n=[m,g].concat(d),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],[(l=1/3)*r+(c=2/3)*o,l*i+c*a,l*s+c*o,l*u+c*a,s,u]));case"L":return["C"].concat($(m,g,f,p));case"Z":return m===v&&g===y?["C",m,g,v,y,v,y]:["C"].concat($(m,g,v,y))}return t}function Z(t,e){if(void 0===e&&(e=!1),function(t){return O(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=W(t),a=(0,C.__assign)({},T),s=[],u="",l=o.length,c=[],h=0;h=o)a={x:n,y:r};else{var s=q([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function rt(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function it(t,e,n,r,i,o,a,s,u,l){var c=Math.abs,h=Math.sin,d=Math.cos,f=Math.sqrt,p=Math.PI,m=c(n),g=c(r),v=(i%360+360)%360*(p/180);if(t===s&&e===u)return{x:t,y:e};if(0===m||0===g)return nt(t,e,s,u,l).point;var y=(t-s)/2,b=(e-u)/2,x={x:d(v)*y+h(v)*b,y:-h(v)*y+d(v)*b},w=Math.pow(x.x,2)/Math.pow(m,2)+Math.pow(x.y,2)/Math.pow(g,2);w>1&&(m*=f(w),g*=f(w));var _=(Math.pow(m,2)*Math.pow(g,2)-Math.pow(m,2)*Math.pow(x.y,2)-Math.pow(g,2)*Math.pow(x.x,2))/(Math.pow(m,2)*Math.pow(x.y,2)+Math.pow(g,2)*Math.pow(x.x,2)),S=(o!==a?1:-1)*f(_=_<0?0:_),E=S*(m*x.y/g),M=S*(-g*x.x/m),A=d(v)*E-h(v)*M+(t+s)/2,C=h(v)*E+d(v)*M+(e+u)/2,T={x:(x.x-E)/m,y:(x.y-M)/g},k=rt({x:1,y:0},T),I=rt(T,{x:(-x.x-E)/m,y:(-x.y-M)/g});!a&&I>0?I-=2*p:a&&I<0&&(I+=2*p);var N=k+(I%=2*p)*l,P=m*d(N),O=g*h(N);return{x:d(v)*P-h(v)*O+A,y:h(v)*P+d(v)*O+C}}function ot(t,e,n,r,i,o,a,s,u,l,c){var h,d=c.bbox,f=void 0===d||d,p=c.length,m=void 0===p||p,g=c.sampleSize,v=void 0===g?30:g,y="number"==typeof l,b=t,x=e,w=0,_=[b,x,w],S=[b,x],E={x:0,y:0},M=[{x:b,y:x}];y&&l<=0&&(E={x:b,y:x});for(var A=0;A<=v;A+=1){if(b=(h=it(t,e,n,r,i,o,a,s,u,A/v)).x,x=h.y,f&&M.push({x:b,y:x}),m&&(w+=et(S,[b,x])),S=[b,x],y&&w>=l&&l>_[2]){var C=(w-l)/(w-_[2]);E={x:S[0]*(1-C)+_[0]*C,y:S[1]*(1-C)+_[1]*C}}_=[b,x,w]}return y&&l>=w&&(E={x:s,y:u}),{length:w,point:E,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function at(t,e,n,r,i,o,a,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function st(t,e,n,r,i,o,a,s,u,l){var c,h=l.bbox,d=void 0===h||h,f=l.length,p=void 0===f||f,m=l.sampleSize,g=void 0===m?10:m,v="number"==typeof u,y=t,b=e,x=0,w=[y,b,x],_=[y,b],S={x:0,y:0},E=[{x:y,y:b}];v&&u<=0&&(S={x:y,y:b});for(var M=0;M<=g;M+=1){if(y=(c=at(t,e,n,r,i,o,a,s,M/g)).x,b=c.y,d&&E.push({x:y,y:b}),p&&(x+=et(_,[y,b])),_=[y,b],v&&x>=u&&u>w[2]){var A=(x-u)/(x-w[2]);S={x:_[0]*(1-A)+w[0]*A,y:_[1]*(1-A)+w[1]*A}}w=[y,b,x]}return v&&u>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function ut(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function lt(t,e,n,r,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,d=void 0===h||h,f=s.sampleSize,p=void 0===f?10:f,m="number"==typeof a,g=t,v=e,y=0,b=[g,v,y],x=[g,v],w={x:0,y:0},_=[{x:g,y:v}];m&&a<=0&&(w={x:g,y:v});for(var S=0;S<=p;S+=1){if(g=(u=ut(t,e,n,r,i,o,S/p)).x,v=u.y,c&&_.push({x:g,y:v}),d&&(y+=et(x,[g,v])),x=[g,v],m&&y>=a&&a>b[2]){var E=(y-a)/(y-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[g,v,y]}return m&&a>=y&&(w={x:i,y:o}),{length:y,point:w,min:{x:Math.min.apply(null,_.map((function(t){return t.x}))),y:Math.min.apply(null,_.map((function(t){return t.y})))},max:{x:Math.max.apply(null,_.map((function(t){return t.x}))),y:Math.max.apply(null,_.map((function(t){return t.y})))}}}function ct(t,e,n){for(var r,i,o,a,s,u,l,c,h,d=W(t),f="number"==typeof e,p=[],m=0,g=0,v=0,y=0,b=[],x=[],w=0,_={x:0,y:0},S=_,E=_,M=_,A=0,C=0,T=d.length;C=e&&(M=E),x.push(S),b.push(_),A+=w,m=(u="Z"!==c?h.slice(-2):[v,y])[0],g=u[1];return f&&e>=A&&(M={x:m,y:g}),{length:A,point:M,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function ht(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{length:!1})),r=n.min,i=r.x,o=r.y,a=n.max,s=a.x,u=a.y,l=s-i,c=u-o;return{width:l,height:c,x:i,y:o,x2:s,y2:u,cx:i+l/2,cy:o+c/2,cz:Math.max(l,c)+Math.min(l,c)/2}}function dt(t,e){return ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!1,length:!0})).length}function ft(t,e){if(!t)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var n=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!0,length:!0})),r=n.length,i=n.min,o=i.x,a=i.y,s=n.max,u=s.x,l=s.y,c=u-o,h=l-a;return{length:r,width:c,height:h,x:o,y:a,x2:u,y2:l,cx:o+c/2,cy:a+h/2,cz:Math.max(c,h)+Math.min(c,h)/2}}function pt(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=et(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function mt(t){var e=0,n=0,r=0;return Z(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],h=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,u,l,c,h),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}function gt(t){return mt(t)>=0}function vt(t,e,n){return ct(t,e,(0,C.__assign)((0,C.__assign)({},n),{bbox:!1,length:!0})).point}function yt(t,e){for(var n,r,i,o,a=V(t),s=W(a),u=dt(a),l=function(t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},c=8,h=0,d=0,f=1/0,p=0;p<=u;p+=c)(h=l(n=vt(s,p))).5;)v=l(i=vt(s,m=d-c)),y=l(o=vt(s,g=d+c)),m>=0&&v=i)return s=i-(a=dt(r=n.slice(0,-1))),{segment:n[o],index:o,length:s,lengthAtSegment:a};for(var h=[];o>0;)u=r[o],s=i-(a=dt(r=r.slice(0,-1))),i=a,h.push({segment:u,index:o,length:s,lengthAtSegment:a}),o-=1;return h.find((function(t){return t.lengthAtSegment<=e}))}(a,d);return{closest:r,distance:Math.sqrt(f),segment:b}}function bt(t,e){var n=yt(t,e).distance;return Math.abs(n)<.001}function xt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?st(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=q(n,r,e),s=q(r,i,e),u=q(i,o,e),l=q(a,s,e),c=q(s,u,e),h=q(l,c,e);return[["C"].concat(a,l,h),["C"].concat(c,u,o)]}(r):[t,t]:[t],l:i}}))}function wt(t,e,n){var r=xt(t),i=xt(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),d=[l,c],f=[h-o,h-a],p=0,m=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&f[e]&&t.l>=d[e],f[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return m[0].length===m[1].length?m:wt(m[0],m[1],h)}const _t=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)};const St=function(t,e){return!!_t(t)&&t.indexOf(e)>-1};const Et=function(t,e){if(!_t(t))return t;for(var n=[],r=0;r-1;)Xt.call(t,o,1);return t};var $t=Array.prototype.splice;const Kt=function(t,e){if(!_t(t))return[];for(var n=t?e.length:0,r=n-1;n--;){var i=void 0,o=e[n];n!==r&&o===i||(i=o,$t.call(t,o,1))}return t};const Zt=function(t,e,n){if(!kt(t)&&!Rt(t))return t;var r=n;return Nt(t,(function(t,n){r=e(r,t,n)})),r};const Qt=function(t,e){var n=[];if(!_t(t))return n;for(var r=-1,i=[],o=t.length;++re[i])return 1;if(t[i]n?n:t};const xe=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))};const we=function(t){return Tt(t,"Number")};const _e=function(t){return we(t)&&t%1!=0};const Se=function(t){return we(t)&&t%2==0};const Ee=Number.isInteger?Number.isInteger:function(t){return we(t)&&t%1==0};const Me=function(t){return we(t)&&t<0};var Ae=1e-5;function Ce(t,e,n){return void 0===n&&(n=Ae),Math.abs(t-e)0},Ie=function(t,e){if(kt(t)){for(var n,r=-1/0,i=0;ir&&(n=o,r=s)}return n}},Ne=function(t,e){if(kt(t)){for(var n,r=1/0,i=0;ie?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},Dn=function(t){return _t(t)?Array.prototype.slice.call(t):[]};var zn={};const Fn=function(t){return zn[t=t||"g"]?zn[t]+=1:zn[t]=1,t+zn[t]},Bn=function(){},Un=function(t){return t};function jn(t){return At(t)?0:_t(t)?t.length:Object.keys(t).length}const Vn=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();var Hn=1e-6;function Gn(t){return Math.abs(t)0!=Gn(s[1]-n)>0&&Gn(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var Yn=function(t,e,n){return t>=e&&t<=n};function qn(t){for(var e=[],n=t.length,r=0;r1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function $n(t,e){var n=!1;return t.forEach((function(t){if(function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,l=r.y-n.y,c=a*l-s*u,h=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var d=(i*l-o*u)/c,f=(i*s-o*a)/c;Yn(d,0,1)&&Yn(f,0,1)&&(h={x:t.x+d*a,y:t.y+d*s})}return h}(t.from,t.to,e.from,e.to))return n=!0,!1})),n}function Kn(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,n),maxY:Math.max.apply(null,n)}}function Zn(t,e){if(t.length<2||e.length<2)return!1;var n,r,i=Kn(t),o=Kn(e);if(n=i,(r=o).minX>n.maxX||r.maxXn.maxY||r.maxY{"use strict";n.r(e),n.d(e,{AbstractMatrix:()=>x,CHO:()=>Z,CholeskyDecomposition:()=>Z,EVD:()=>$,EigenvalueDecomposition:()=>$,LU:()=>D,LuDecomposition:()=>D,Matrix:()=>_,MatrixColumnSelectionView:()=>M,MatrixColumnView:()=>E,MatrixFlipColumnView:()=>A,MatrixFlipRowView:()=>C,MatrixRowSelectionView:()=>k,MatrixRowView:()=>T,MatrixSelectionView:()=>I,MatrixSubView:()=>N,MatrixTransposeView:()=>P,NIPALS:()=>Q,Nipals:()=>Q,QR:()=>F,QrDecomposition:()=>F,SVD:()=>B,SingularValueDecomposition:()=>B,WrapperMatrix1D:()=>O,WrapperMatrix2D:()=>L,correlation:()=>q,covariance:()=>Y,default:()=>_,determinant:()=>V,inverse:()=>U,linearDependencies:()=>W,pseudoInverse:()=>X,solve:()=>j,wrap:()=>R});const r=Object.prototype.toString;function i(t){const e=r.call(t);return e.endsWith("Array]")&&!e.includes("Big")}function o(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!i(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,a=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],u=r+1;u1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,a=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],u=r+1;us&&(s=t[u]);return s}(t);if(r===o)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=n.min,s=void 0===a?n.autoMinMax?r:0:a,u=n.max,l=void 0===u?n.autoMinMax?o:1:u;if(s>=l)throw new RangeError("min option must be smaller than max option");for(var c=(l-s)/(o-r),h=0;hr)throw new RangeError("Row index out of range")}function h(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function d(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function f(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function p(t,e,n){return{row:m(t,e),column:g(t,n)}}function m(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");if(e.some((e=>e<0||e>=t.rows)))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function g(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some((e=>e<0||e>=t.columns)))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function v(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(b("startRow",e),b("endRow",n),b("startColumn",r),b("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function y(t,e=0){let n=[];for(let r=0;r=i)throw new RangeError("min must be smaller than max");let a=i-r,s=new _(t,e);for(let n=0;nn?(i=!0,n=e):(r=!1,i=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;tn?(i=!0,n=e):(r=!1,i=!0);for(let n=e+1;nt.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let i=t.get(e,n);for(let r=n;r=0;)if(0===t.maxRow(r))r--;else{let i=0,o=!1;for(;it&&(t=this.get(e,n));return t}maxIndex(){let t=this.get(0,0),e=[0,0];for(let n=0;nt&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(){let t=this.get(0,0);for(let e=0;ee&&(e=this.get(t,n));return e}maxRowIndex(t){c(this,t);let e=this.get(t,0),n=[t,0];for(let r=1;re&&(e=this.get(t,r),n[1]=r);return n}minRow(t){c(this,t);let e=this.get(t,0);for(let n=1;ne&&(e=this.get(n,t));return e}maxColumnIndex(t){h(this,t);let e=this.get(0,t),n=[0,t];for(let r=1;re&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){h(this,t);let e=this.get(0,t);for(let n=1;n=n)throw new RangeError("min must be smaller than max");let r=new _(this.rows,this.columns);for(let t=0;t=n)throw new RangeError("min must be smaller than max");let r=new _(this.rows,this.columns);for(let t=0;tn||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new _(t.length,n-e+1);for(let i=0;i=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);r.set(i,o-e,this.get(t[i],o))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new _(n-e+1,t.length);for(let i=0;i=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);r.set(o-e,i,this.get(o,t[i]))}return r}setSubMatrix(t,e,n){v(this,e,e+(t=_.checkMatrix(t)).rows-1,n,n+t.columns-1);for(let r=0;r0){if(this.data=[],!(Number.isInteger(e)&&e>0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;tMath.abs(u[i])&&(i=e);if(i!==n){for(r=0;r=0;i--){for(r=0;re?r.set(i,e,t.get(i,e)):i===e?r.set(i,e,1):r.set(i,e,0);return r}get upperTriangularMatrix(){let t=this.LU,e=t.rows,n=t.columns,r=new _(e,n);for(let i=0;iMath.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class F{constructor(t){let e,n,r,i,o=(t=L.checkMatrix(t)).clone(),a=t.rows,s=t.columns,u=new Float64Array(s);for(r=0;r=0;o--){for(i=0;i=0;n--){for(t=0;t=0;t--)if(0!==f[t]){for(let e=t+1;e=0;t--){if(t0;){let t,e;for(t=S-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(f[t]+Math.abs(f[t+1]));if(Math.abs(g[t])<=e||Number.isNaN(g[t])){g[t]=0;break}}if(t===S-2)e=4;else{let n;for(n=S-1;n>=t&&n!==t;n--){let e=(n!==S?Math.abs(g[n]):0)+(n!==t+1?Math.abs(g[n-1]):0);if(Math.abs(f[n])<=A*e){f[n]=0;break}}n===t?e=3:n===S-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=g[S-2];g[S-2]=0;for(let n=S-2;n>=t;n--){let i=z(f[n],e),o=f[n]/i,a=e/i;if(f[n]=i,n!==t&&(e=-a*g[n-1],g[n-1]=o*g[n-1]),l)for(let t=0;t=f[t+1]);){let e=f[t];if(f[t]=f[t+1],f[t+1]=e,l&&te&&i.set(o,n,t.get(o,n)/this.s[n]);let o=this.U,a=o.rows,s=o.columns,u=new _(n,a);for(let t=0;tt&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return _.diag(this.s)}}function U(t,e=!1){return t=L.checkMatrix(t),e?new B(t).inverse():j(t,_.eye(t.rows))}function j(t,e,n=!1){return t=L.checkMatrix(t),e=L.checkMatrix(e),n?new B(t).solve(e):t.isSquare()?new D(t).solve(e):new F(t).solve(e)}function V(t){if((t=_.checkMatrix(t)).isSquare()){let e,n,r,i;if(2===t.columns)return e=t.get(0,0),n=t.get(0,1),r=t.get(1,0),i=t.get(1,1),e*i-n*r;if(3===t.columns){let i,o,a;return i=new I(t,[1,2],[1,2]),o=new I(t,[1,2],[0,2]),a=new I(t,[1,2],[0,1]),e=t.get(0,0),n=t.get(0,1),r=t.get(0,2),e*V(i)-n*V(o)+r*V(a)}return new D(t).determinant}throw Error("determinant can only be calculated for a square matrix")}function H(t,e){let n=[];for(let r=0;ri)return new Array(e.rows+1).fill(0);{let t=e.addRow(n,[0]);for(let e=0;ee?o[t]=1/o[t]:o[t]=0;return i.mmul(_.diag(o).mmul(r.transpose()))}function Y(t,e=t,n={}){t=new _(t);let r=!1;if("object"!=typeof e||_.isMatrix(e)||Array.isArray(e)?e=new _(e):(n=e,e=t,r=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0}=n;i&&(t=t.center("column"),r||(e=e.center("column")));const o=t.transpose().mmul(e);for(let e=0;e0;s--){for(h=0,a=0,l=0;l0&&(o=-o),e[s]=h*o,a-=i*o,n[s-1]=i-o,u=0;ul){x=0;do{for(x+=1,i=n[l],h=(n[l+1]-i)/(2*e[l]),d=z(h,1),h<0&&(d=-d),n[l]=e[l]/(h+d),n[l+1]=e[l]*(h+d),f=n[l+1],o=i-n[l],a=l+2;a=l;a--)for(g=m,m=p,b=y,i=p*e[a],o=p*h,d=z(h,e[a]),e[a+1]=y*d,y=e[a]/d,p=h/d,h=p*n[a]-y*i,n[a+1]=o+y*(p*i+y*n[a]),u=0;uS*_)}n[l]=n[l]+w,e[l]=0}for(a=0;a=l;s--)n[s]=e.get(s,l-1)/c,a+=n[s]*n[s];for(o=Math.sqrt(a),n[l]>0&&(o=-o),a-=n[l]*o,n[l]=n[l]-o,u=l;u=l;s--)i+=n[s]*e.get(s,u);for(i/=a,s=l;s<=d;s++)e.set(s,u,e.get(s,u)-i*n[s])}for(s=0;s<=d;s++){for(i=0,u=d;u>=l;u--)i+=n[u]*e.get(s,u);for(i/=a,u=l;u<=d;u++)e.set(s,u,e.get(s,u)-i*n[u])}n[l]=c*n[l],e.set(l,l-1,c*o)}}for(s=0;s=h+1;l--)if(0!==e.get(l,l-1)){for(s=l+1;s<=d;s++)n[s]=e.get(s,l-1);for(u=l;u<=d;u++){for(o=0,s=l;s<=d;s++)o+=n[s]*r.get(s,u);for(o=o/n[l]/e.get(l,l-1),s=l;s<=d;s++)r.set(s,u,r.get(s,u)+o*n[s])}}}(o,t,e,a),function(t,e,n,r,i){let o,a,s,u,l,c,h,d,f,p,m,g,v,y,b,x=t-1,w=0,_=t-1,S=Number.EPSILON,E=0,M=0,A=0,C=0,T=0,k=0,I=0,N=0;for(o=0;o_)&&(n[o]=i.get(o,o),e[o]=0),a=Math.max(o-1,0);a=w;){for(u=x;u>w&&(k=Math.abs(i.get(u-1,u-1))+Math.abs(i.get(u,u)),0===k&&(k=M),!(Math.abs(i.get(u,u-1))=0){for(I=A>=0?A+I:A-I,n[x-1]=d+I,n[x]=n[x-1],0!==I&&(n[x]=d-h/I),e[x-1]=0,e[x]=0,d=i.get(x,x-1),k=Math.abs(d)+Math.abs(I),A=d/k,C=I/k,T=Math.sqrt(A*A+C*C),A/=T,C/=T,a=x-1;a0)){for(k=Math.sqrt(k),f=u&&(I=i.get(l,l),T=d-I,k=f-I,A=(T*k-h)/i.get(l+1,l)+i.get(l,l+1),C=i.get(l+1,l+1)-I-T-k,T=i.get(l+2,l+1),k=Math.abs(A)+Math.abs(C)+Math.abs(T),A/=k,C/=k,T/=k,l!==u)&&!(Math.abs(i.get(l,l-1))*(Math.abs(C)+Math.abs(T))l+2&&i.set(o,o-3,0);for(s=l;s<=x-1&&(y=s!==x-1,s!==l&&(A=i.get(s,s-1),C=i.get(s+1,s-1),T=y?i.get(s+2,s-1):0,d=Math.abs(A)+Math.abs(C)+Math.abs(T),0!==d&&(A/=d,C/=d,T/=d)),0!==d);s++)if(k=Math.sqrt(A*A+C*C+T*T),A<0&&(k=-k),0!==k){for(s!==l?i.set(s,s-1,-k*d):u!==l&&i.set(s,s-1,-i.get(s,s-1)),A+=k,d=A/k,f=C/k,I=T/k,C/=A,T/=A,a=s;a=0;x--)if(A=n[x],C=e[x],0===C)for(u=x,i.set(x,x,1),o=x-1;o>=0;o--){for(h=i.get(o,o)-A,T=0,a=u;a<=x;a++)T+=i.get(o,a)*i.get(a,x);if(e[o]<0)I=h,k=T;else if(u=o,0===e[o]?i.set(o,x,0!==h?-T/h:-T/(S*M)):(d=i.get(o,o+1),f=i.get(o+1,o),C=(n[o]-A)*(n[o]-A)+e[o]*e[o],c=(d*k-I*T)/C,i.set(o,x,c),i.set(o+1,x,Math.abs(d)>Math.abs(I)?(-T-h*c)/d:(-k-f*c)/I)),c=Math.abs(i.get(o,x)),S*c*c>1)for(a=o;a<=x;a++)i.set(a,x,i.get(a,x)/c)}else if(C<0)for(u=x-1,Math.abs(i.get(x,x-1))>Math.abs(i.get(x-1,x))?(i.set(x-1,x-1,C/i.get(x,x-1)),i.set(x-1,x,-(i.get(x,x)-A)/i.get(x,x-1))):(b=K(0,-i.get(x-1,x),i.get(x-1,x-1)-A,C),i.set(x-1,x-1,b[0]),i.set(x-1,x,b[1])),i.set(x,x-1,0),i.set(x,x,1),o=x-2;o>=0;o--){for(p=0,m=0,a=u;a<=x;a++)p+=i.get(o,a)*i.get(a,x-1),m+=i.get(o,a)*i.get(a,x);if(h=i.get(o,o)-A,e[o]<0)I=h,T=p,k=m;else if(u=o,0===e[o]?(b=K(-p,-m,h,C),i.set(o,x-1,b[0]),i.set(o,x,b[1])):(d=i.get(o,o+1),f=i.get(o+1,o),g=(n[o]-A)*(n[o]-A)+e[o]*e[o]-C*C,v=2*(n[o]-A)*C,0===g&&0===v&&(g=S*M*(Math.abs(h)+Math.abs(C)+Math.abs(d)+Math.abs(f)+Math.abs(I))),b=K(d*T-I*p+C*m,d*k-I*m-C*p,g,v),i.set(o,x-1,b[0]),i.set(o,x,b[1]),Math.abs(d)>Math.abs(I)+Math.abs(C)?(i.set(o+1,x-1,(-p-h*i.get(o,x-1)+C*i.get(o,x))/d),i.set(o+1,x,(-m-h*i.get(o,x)-C*i.get(o,x-1))/d)):(b=K(-T-f*i.get(o,x-1),-k-f*i.get(o,x),I,C),i.set(o+1,x-1,b[0]),i.set(o+1,x,b[1]))),c=Math.max(Math.abs(i.get(o,x-1)),Math.abs(i.get(o,x))),S*c*c>1)for(a=o;a<=x;a++)i.set(a,x-1,i.get(a,x-1)/c),i.set(a,x,i.get(a,x)/c)}for(o=0;o_)for(a=o;a=w;a--)for(o=w;o<=_;o++){for(I=0,s=w;s<=Math.min(a,_);s++)I+=r.get(o,s)*i.get(s,a);r.set(o,a,I)}}(o,u,s,a,t)}this.n=o,this.e=u,this.d=s,this.V=a}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let t,e,n=this.n,r=this.e,i=this.d,o=new _(n,n);for(t=0;t0?o.set(t,t+1,r[t]):r[t]<0&&o.set(t,t-1,r[t])}return o}}function K(t,e,n,r){let i,o;return Math.abs(n)>Math.abs(r)?(i=r/n,o=n+i*r,[(t+i*e)/o,(e-i*t)/o]):(i=n/r,o=r+i*n,[(i*t+e)/o,(i*e-t)/o])}class Z{constructor(t){if(!(t=L.checkMatrix(t)).isSymmetric())throw new Error("Matrix is not symmetric");let e,n,r,i=t,o=i.rows,a=new _(o,o),s=!0;for(n=0;n0,a.set(n,n,Math.sqrt(Math.max(t,0))),r=n+1;r=0;o--)for(i=0;io;e++)l=t.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),l=l.div(l.norm()),s=t.mmul(l).div(l.transpose().mmul(l).get(0,0)),e>0&&(h=s.clone().sub(c).pow(2).sum()),c=s.clone(),n?(u=n.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),u=u.div(u.norm()),a=n.mmul(u).div(u.transpose().mmul(u).get(0,0))):a=s;if(n){let e=t.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0));e=e.div(e.norm());let r=t.clone().sub(s.clone().mmul(e.transpose())),i=a.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),o=n.clone().sub(s.clone().mulS(i.get(0,0)).mmul(u.transpose()));this.t=s,this.p=e.transpose(),this.w=l.transpose(),this.q=u,this.u=a,this.s=s.transpose().mmul(s),this.xResidual=r,this.yResidual=o,this.betas=i}else this.w=l.transpose(),this.s=s.transpose().mmul(s).sqrt(),this.t=r?s.clone().div(this.s.get(0,0)):s,this.xResidual=t.sub(s.mmul(l.transpose()))}}},47114:(t,e,n)=>{"use strict";var r=n(38274);function i(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.mat3.fromTranslation(i,n),r.mat3.multiply(t,i,e)}function o(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.mat3.fromRotation(i,n),r.mat3.multiply(t,i,e)}function a(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.mat3.fromScaling(i,n),r.mat3.multiply(t,i,e)}function s(t,e){return t[0]*e[1]-e[0]*t[1]}e.pd=function(t,e){for(var n,s,u,l=t?[].concat(t):[1,0,0,0,1,0,0,0,1],c=0,h=e.length;c{"use strict";n.r(e),n.d(e,{Cache:()=>Ce,assign:()=>Yt,augment:()=>qt,clamp:()=>et,clearAnimationFrame:()=>Wt,clone:()=>Kt,contains:()=>i,debounce:()=>Zt,deepMix:()=>te,difference:()=>a,each:()=>f,endsWith:()=>H,every:()=>G,extend:()=>ee,filter:()=>o,find:()=>y,findIndex:()=>b,firstValue:()=>x,fixedBase:()=>nt,flatten:()=>w,flattenDeep:()=>S,forIn:()=>xt,get:()=>he,getEllipsisText:()=>Ae,getRange:()=>A,getType:()=>Pt,getWrapBehavior:()=>K,group:()=>$,groupBy:()=>Y,groupToMap:()=>q,has:()=>wt,hasKey:()=>_t,hasValue:()=>Et,head:()=>U,identity:()=>we,includes:()=>i,indexOf:()=>ne,isArguments:()=>Ot,isArray:()=>h,isArrayLike:()=>r,isBoolean:()=>Lt,isDate:()=>Rt,isDecimal:()=>it,isElement:()=>Ht,isEmpty:()=>ie,isEqual:()=>ae,isEqualWith:()=>se,isError:()=>Dt,isEven:()=>ot,isFinite:()=>zt,isFunction:()=>l,isInteger:()=>at,isMatch:()=>m,isNegative:()=>st,isNil:()=>c,isNull:()=>Ft,isNumber:()=>rt,isNumberEqual:()=>lt,isObject:()=>d,isObjectLike:()=>g,isOdd:()=>ct,isPlainObject:()=>v,isPositive:()=>ht,isPrototype:()=>Ut,isRegExp:()=>jt,isString:()=>R,isType:()=>u,isUndefined:()=>Vt,keys:()=>p,last:()=>j,lowerCase:()=>At,lowerFirst:()=>Ct,map:()=>ue,mapValues:()=>ce,max:()=>E,maxBy:()=>dt,measureTextWidth:()=>Me,memoize:()=>Qt,min:()=>M,minBy:()=>ft,mix:()=>Yt,mod:()=>pt,noop:()=>xe,number2color:()=>J,omit:()=>me,parseRadius:()=>tt,pick:()=>pe,pull:()=>I,pullAt:()=>P,reduce:()=>O,remove:()=>L,requestAnimationFrame:()=>Gt,set:()=>de,size:()=>_e,some:()=>W,sortBy:()=>D,startsWith:()=>V,substitute:()=>Tt,throttle:()=>ge,toArray:()=>ve,toDegree:()=>gt,toInteger:()=>vt,toRadian:()=>bt,toString:()=>Mt,union:()=>F,uniq:()=>z,uniqueId:()=>be,upperCase:()=>kt,upperFirst:()=>It,values:()=>St,valuesOfKey:()=>B,wrapBehavior:()=>Z});const r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)};const i=function(t,e){return!!r(t)&&t.indexOf(e)>-1};const o=function(t,e){if(!r(t))return t;for(var n=[],i=0;i-1;)T.call(t,o,1);return t};var N=Array.prototype.splice;const P=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var o=void 0,a=e[n];n!==i&&a===o||(o=a,N.call(t,a,1))}return t};const O=function(t,e,n){if(!h(t)&&!v(t))return t;var r=n;return f(t,(function(t,n){r=e(r,t,n)})),r};const L=function(t,e){var n=[];if(!r(t))return n;for(var i=-1,o=[],a=t.length;++ie[i])return 1;if(t[i]n?n:t};const nt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))};const rt=function(t){return u(t,"Number")};const it=function(t){return rt(t)&&t%1!=0};const ot=function(t){return rt(t)&&t%2==0};const at=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0};const st=function(t){return rt(t)&&t<0};var ut=1e-5;function lt(t,e,n){return void 0===n&&(n=ut),Math.abs(t-e)0},dt=function(t,e){if(h(t)){for(var n,r=-1/0,i=0;ir&&(n=o,r=a)}return n}},ft=function(t,e){if(h(t)){for(var n,r=1/0,i=0;ie?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},ve=function(t){return r(t)?Array.prototype.slice.call(t):[]};var ye={};const be=function(t){return ye[t=t||"g"]?ye[t]+=1:ye[t]=1,t+ye[t]},xe=function(){},we=function(t){return t};function _e(t){return c(t)?0:r(t)?t.length:Object.keys(t).length}var Se,Ee=n(31635);const Me=Qt((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Se||(Se=document.createElement("canvas").getContext("2d")),Se.font=[o,a,i,n+"px",r].join(" "),Se.measureText(R(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),(0,Ee.__spreadArrays)([t],St(e)).join("")})),Ae=function(t,e,n,r){void 0===r&&(r="...");var i,o,a=Me(r,n),s=R(t)?t:Mt(t),u=e,l=[];if(Me(t,n)<=e)return t;for(;i=s.substr(0,16),!((o=Me(i,n))+a>u&&o>u);)if(l.push(i),u-=o,!(s=s.substr(16)))return l.join("");for(;i=s.substr(0,1),!((o=Me(i,n))+a>u);)if(l.push(i),u-=o,!(s=s.substr(1)))return l.join("");return""+l.join("")+r};const Ce=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},62456:(t,e,n)=>{"use strict";n.d(e,{H:()=>h,K6:()=>o,Me:()=>l,Ob:()=>c,YL:()=>s,_:()=>i,g8:()=>p,n6:()=>f,oS:()=>m,wE:()=>u});var r=n(89244);function i(t,e,n){return{r:255*(0,r.Cg)(t,255),g:255*(0,r.Cg)(e,255),b:255*(0,r.Cg)(n,255)}}function o(t,e,n){t=(0,r.Cg)(t,255),e=(0,r.Cg)(e,255),n=(0,r.Cg)(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),a=0,s=0,u=(i+o)/2;if(i===o)s=0,a=0;else{var l=i-o;switch(s=u>.5?l/(2-i-o):l/(i+o),i){case t:a=(e-n)/l+(e1&&(n-=1),n<1/6?t+6*n*(e-t):n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function s(t,e,n){var i,o,s;if(t=(0,r.Cg)(t,360),e=(0,r.Cg)(e,100),n=(0,r.Cg)(n,100),0===e)o=n,s=n,i=n;else{var u=n<.5?n*(1+e):n+e-n*e,l=2*n-u;i=a(l,u,t+1/3),o=a(l,u,t),s=a(l,u,t-1/3)}return{r:255*i,g:255*o,b:255*s}}function u(t,e,n){t=(0,r.Cg)(t,255),e=(0,r.Cg)(e,255),n=(0,r.Cg)(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),a=0,s=i,u=i-o,l=0===i?0:u/i;if(i===o)a=0;else{switch(i){case t:a=(e-n)/u+(e>16,g:(65280&t)>>8,b:255&t}}},42434:(t,e,n)=>{"use strict";n.d(e,{D:()=>r});var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},76250:(t,e,n)=>{"use strict";n.d(e,{RO:()=>a});var r=n(62456),i=n(42434),o=n(89244);function a(t){var e={r:0,g:0,b:0},n=1,a=null,s=null,u=null,l=!1,d=!1;return"string"==typeof t&&(t=function(t){if(t=t.trim().toLowerCase(),0===t.length)return!1;var e=!1;if(i.D[t])t=i.D[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};var n=c.rgb.exec(t);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=c.rgba.exec(t),n)return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=c.hsl.exec(t),n)return{h:n[1],s:n[2],l:n[3]};if(n=c.hsla.exec(t),n)return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=c.hsv.exec(t),n)return{h:n[1],s:n[2],v:n[3]};if(n=c.hsva.exec(t),n)return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=c.hex8.exec(t),n)return{r:(0,r.g8)(n[1]),g:(0,r.g8)(n[2]),b:(0,r.g8)(n[3]),a:(0,r.n6)(n[4]),format:e?"name":"hex8"};if(n=c.hex6.exec(t),n)return{r:(0,r.g8)(n[1]),g:(0,r.g8)(n[2]),b:(0,r.g8)(n[3]),format:e?"name":"hex"};if(n=c.hex4.exec(t),n)return{r:(0,r.g8)(n[1]+n[1]),g:(0,r.g8)(n[2]+n[2]),b:(0,r.g8)(n[3]+n[3]),a:(0,r.n6)(n[4]+n[4]),format:e?"name":"hex8"};if(n=c.hex3.exec(t),n)return{r:(0,r.g8)(n[1]+n[1]),g:(0,r.g8)(n[2]+n[2]),b:(0,r.g8)(n[3]+n[3]),format:e?"name":"hex"};return!1}(t)),"object"==typeof t&&(h(t.r)&&h(t.g)&&h(t.b)?(e=(0,r._)(t.r,t.g,t.b),l=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):h(t.h)&&h(t.s)&&h(t.v)?(a=(0,o.Px)(t.s),s=(0,o.Px)(t.v),e=(0,r.Me)(t.h,a,s),l=!0,d="hsv"):h(t.h)&&h(t.s)&&h(t.l)&&(a=(0,o.Px)(t.s),u=(0,o.Px)(t.l),e=(0,r.YL)(t.h,a,u),l=!0,d="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=(0,o.TV)(n),{ok:l,format:t.format||d,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var s="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),u="[\\s|\\(]+(".concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")\\s*\\)?"),l="[\\s|\\(]+(".concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")[,|\\s]+(").concat(s,")\\s*\\)?"),c={CSS_UNIT:new RegExp(s),rgb:new RegExp("rgb"+u),rgba:new RegExp("rgba"+l),hsl:new RegExp("hsl"+u),hsla:new RegExp("hsla"+l),hsv:new RegExp("hsv"+u),hsva:new RegExp("hsva"+l),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 h(t){return Boolean(c.CSS_UNIT.exec(String(t)))}},24978:(t,e,n)=>{"use strict";n.d(e,{q:()=>s});var r=n(62456),i=n(42434),o=n(76250),a=n(89244),s=function(){function t(e,n){var i;if(void 0===e&&(e=""),void 0===n&&(n={}),e instanceof t)return e;"number"==typeof e&&(e=(0,r.oS)(e)),this.originalInput=e;var a=(0,o.RO)(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(i=n.format)&&void 0!==i?i:a.format,this.gradientType=n.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.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,n=t.g/255,r=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=(0,a.TV)(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){return 0===this.toHsl().s},t.prototype.toHsv=function(){var t=(0,r.wE)(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=(0,r.wE)(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var t=(0,r.K6)(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=(0,r.K6)(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(t){return void 0===t&&(t=!1),(0,r.Ob)(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),(0,r.H)(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toHexShortString=function(t){return void 0===t&&(t=!1),1===this.a?this.toHexString(t):this.toHex8String(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(n,")"):"rgba(".concat(t,", ").concat(e,", ").concat(n,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var t=function(t){return"".concat(Math.round(100*(0,a.Cg)(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*(0,a.Cg)(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+(0,r.Ob)(this.r,this.g,this.b,!1),e=0,n=Object.entries(i.D);e=0;return e||!r||!t.startsWith("hex")&&"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()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=(0,a.J$)(n.l),new t(n)},t.prototype.brighten=function(e){void 0===e&&(e=10);var n=this.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))),new t(n)},t.prototype.darken=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=(0,a.J$)(n.l),new t(n)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=(0,a.J$)(n.s),new t(n)},t.prototype.saturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=(0,a.J$)(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){void 0===n&&(n=50);var r=this.toRgb(),i=new t(e).toRgb(),o=n/100;return new t({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})},t.prototype.analogous=function(e,n){void 0===e&&(e=6),void 0===n&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(new t(r));return o},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(new t({h:r,s:i,v:o})),o=(o+s)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb(),i=n.a+r.a*(1-n.a);return new t({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,i=[this],o=360/e,a=1;a{"use strict";function r(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=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function i(t){return Math.min(1,Math.max(0,t))}function o(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function a(t){return t<=1?"".concat(100*Number(t),"%"):t}function s(t){return 1===t.length?"0"+t:String(t)}n.d(e,{Cg:()=>r,J$:()=>i,Px:()=>a,TV:()=>o,wl:()=>s})},33672:(t,e,n)=>{"use strict";n.d(e,{V1:()=>r});function r(t,e,n){if(void 0===n&&(n=Error),!t)throw new n(e)}},54819:(t,e,n)=>{"use strict";function r(t,e){var n=e&&e.cache?e.cache:c,r=e&&e.serializer?e.serializer:u;return(e&&e.strategy?e.strategy:s)(t,{cache:n,serializer:r})}function i(t,e,n,r){var i,o=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),a=e.get(o);return void 0===a&&(a=t.call(this,r),e.set(o,a)),a}function o(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return void 0===o&&(o=t.apply(this,r),e.set(i,o)),o}function a(t,e,n,r,i){return n.bind(e,t,r,i)}function s(t,e){return a(t,this,1===t.length?i:o,e.cache.create(),e.serializer)}n.d(e,{B:()=>r,W:()=>h});var u=function(){return JSON.stringify(arguments)};function l(){this.cache=Object.create(null)}l.prototype.get=function(t){return this.cache[t]},l.prototype.set=function(t,e){this.cache[t]=e};var c={create:function(){return new l}},h={variadic:function(t,e){return a(t,this,o,e.cache.create(),e.serializer)},monadic:function(t,e){return a(t,this,i,e.cache.create(),e.serializer)}}},78786:(t,e,n)=>{"use strict";n.d(e,{ZE:()=>i,Im:()=>u,tv:()=>c,Tu:()=>v,eW:()=>s,oF:()=>l,N1:()=>g,N6:()=>f,jA:()=>p,Jp:()=>d,xm:()=>m,Qh:()=>h,qg:()=>ot});var r,i,o,a=n(31635);function s(t){return t.type===i.literal}function u(t){return t.type===i.argument}function l(t){return t.type===i.number}function c(t){return t.type===i.date}function h(t){return t.type===i.time}function d(t){return t.type===i.select}function f(t){return t.type===i.plural}function p(t){return t.type===i.pound}function m(t){return t.type===i.tag}function g(t){return!(!t||"object"!=typeof t||t.type!==o.number)}function v(t){return!(!t||"object"!=typeof t||t.type!==o.dateTime)}!function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(r||(r={})),function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"}(i||(i={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(o||(o={}));var y=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,b=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function x(t){var e={};return t.replace(b,(function(t){var n=t.length;switch(t[0]){case"G":e.era=4===n?"long":5===n?"narrow":"short";break;case"y":e.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=4===n?"long":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][n-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][n-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][n-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][n-1];break;case"s":e.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}var w=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var _=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,S=/^(@+)?(\+|#+)?[rs]?$/g,E=/(\*)(0+)|(#+)(0+)|(0+)/g,M=/^(0+)$/;function A(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(S,(function(t,n,r){return"string"!=typeof r?(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length):"+"===r?e.minimumSignificantDigits=n.length:"#"===n[0]?e.maximumSignificantDigits=n.length:(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),e}function C(t){switch(t){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function T(t){var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var n=t.slice(0,2);if("+!"===n?(e.signDisplay="always",t=t.slice(2)):"+?"===n&&(e.signDisplay="exceptZero",t=t.slice(2)),!M.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function k(t){var e=C(t);return e||{}}function I(t){for(var e={},n=0,r=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(E,(function(t,n,r,i,o,a){if(n)e.minimumIntegerDigits=r.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(M.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(_.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(_,(function(t,n,r,i,o,a){return"*"===r?e.minimumFractionDigits=n.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&a?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+a.length):(e.minimumFractionDigits=n.length,e.maximumFractionDigits=n.length),""}));var o=i.options[0];"w"===o?e=(0,a.__assign)((0,a.__assign)({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=(0,a.__assign)((0,a.__assign)({},e),A(o)))}else if(S.test(i.stem))e=(0,a.__assign)((0,a.__assign)({},e),A(i.stem));else{var s=C(i.stem);s&&(e=(0,a.__assign)((0,a.__assign)({},e),s));var u=T(i.stem);u&&(e=(0,a.__assign)((0,a.__assign)({},e),u))}}return e}var N,P={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function O(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=t.language;return"root"!==r&&(n=t.maximize().region),(P[n||""]||P[r||""]||P["".concat(r,"-001")]||P["001"])[0]}var L=new RegExp("^".concat(y.source,"*")),R=new RegExp("".concat(y.source,"*$"));function D(t,e){return{start:t,end:e}}var z=!!String.prototype.startsWith&&"_a".startsWith("a",1),F=!!String.fromCodePoint,B=!!Object.fromEntries,U=!!String.prototype.codePointAt,j=!!String.prototype.trimStart,V=!!String.prototype.trimEnd,H=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},G=!0;try{G="a"===(null===(N=Q("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===N?void 0:N[0])}catch(t){G=!1}var W,X=z?function(t,e,n){return t.startsWith(e,n)}:function(t,e,n){return t.slice(n,n+e.length)===e},Y=F?String.fromCodePoint:function(){for(var t=[],e=0;eo;){if((n=t[o++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},q=B?Object.fromEntries:function(t){for(var e={},n=0,r=t;n=n)){var r,i=t.charCodeAt(e);return i<55296||i>56319||e+1===n||(r=t.charCodeAt(e+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},K=j?function(t){return t.trimStart()}:function(t){return t.replace(L,"")},Z=V?function(t){return t.trimEnd()}:function(t){return t.replace(R,"")};function Q(t,e){return new RegExp(t,e)}if(G){var J=Q("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");W=function(t,e){var n;return J.lastIndex=e,null!==(n=J.exec(t)[1])&&void 0!==n?n:""}}else W=function(t,e){for(var n=[];;){var r=$(t,e);if(void 0===r||nt(r)||rt(r))break;n.push(r),e+=r>=65536?2:1}return Y.apply(void 0,n)};var tt=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,n){for(var o=[];!this.isEOF();){var a=this.char();if(123===a){if((s=this.parseArgument(t,n)).err)return s;o.push(s.val)}else{if(125===a&&t>0)break;if(35!==a||"plural"!==e&&"selectordinal"!==e){if(60===a&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(r.UNMATCHED_CLOSING_TAG,D(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&et(this.peek()||0)){if((s=this.parseTag(t,e)).err)return s;o.push(s.val)}else{var s;if((s=this.parseLiteral(t,e)).err)return s;o.push(s.val)}}else{var u=this.clonePosition();this.bump(),o.push({type:i.pound,location:D(u,this.clonePosition())})}}}return{val:o,err:null}},t.prototype.parseTag=function(t,e){var n=this.clonePosition();this.bump();var o=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:i.literal,value:"<".concat(o,"/>"),location:D(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(t+1,e,!0);if(a.err)return a;var s=a.val,u=this.clonePosition();if(this.bumpIf("")?{val:{type:i.tag,value:o,children:s,location:D(n,this.clonePosition())},err:null}:this.error(r.INVALID_TAG,D(u,this.clonePosition())))}return this.error(r.UNCLOSED_TAG,D(n,this.clonePosition()))}return this.error(r.INVALID_TAG,D(n,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(e);if(o)r+=o;else{var a=this.tryParseUnquoted(t,e);if(a)r+=a;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var u=D(n,this.clonePosition());return{val:{type:i.literal,value:r,location:u},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(et(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(n);this.bump()}return Y.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===e||"selectordinal"===e)||125===n&&t>0?null:(this.bump(),Y(n))},t.prototype.parseArgument=function(t,e){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,D(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(r.EMPTY_ARGUMENT,D(n,this.clonePosition()));var o=this.parseIdentifierIfPossible().value;if(!o)return this.error(r.MALFORMED_ARGUMENT,D(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,D(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:i.argument,value:o,location:D(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,D(n,this.clonePosition())):this.parseArgumentOptions(t,e,o,n);default:return this.error(r.MALFORMED_ARGUMENT,D(n,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),n=W(this.message,e),r=e+n.length;return this.bumpTo(r),{value:n,location:D(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,n,s){var u,l=this.clonePosition(),c=this.parseIdentifierIfPossible().value,h=this.clonePosition();switch(c){case"":return this.error(r.EXPECT_ARGUMENT_TYPE,D(l,h));case"number":case"date":case"time":this.bumpSpace();var d=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition();if((_=this.parseSimpleArgStyleIfPossible()).err)return _;if(0===(v=Z(_.val)).length)return this.error(r.EXPECT_ARGUMENT_STYLE,D(this.clonePosition(),this.clonePosition()));d={style:v,styleLocation:D(f,this.clonePosition())}}if((S=this.tryParseArgumentClose(s)).err)return S;var p=D(s,this.clonePosition());if(d&&X(null==d?void 0:d.style,"::",0)){var m=K(d.style.slice(2));if("number"===c)return(_=this.parseNumberSkeletonFromString(m,d.styleLocation)).err?_:{val:{type:i.number,value:n,location:p,style:_.val},err:null};if(0===m.length)return this.error(r.EXPECT_DATE_TIME_SKELETON,p);var g=m;this.locale&&(g=function(t,e){for(var n="",r=0;r>1),u=O(e);for("H"!=u&&"k"!=u||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=u+n}else n+="J"===i?"H":i}return n}(m,this.locale));var v={type:o.dateTime,pattern:g,location:d.styleLocation,parsedOptions:this.shouldParseSkeletons?x(g):{}};return{val:{type:"date"===c?i.date:i.time,value:n,location:p,style:v},err:null}}return{val:{type:"number"===c?i.number:"date"===c?i.date:i.time,value:n,location:p,style:null!==(u=null==d?void 0:d.style)&&void 0!==u?u:null},err:null};case"plural":case"selectordinal":case"select":var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(r.EXPECT_SELECT_ARGUMENT_OPTIONS,D(y,(0,a.__assign)({},y)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),w=0;if("select"!==c&&"offset"===b.value){if(!this.bumpIf(":"))return this.error(r.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,D(this.clonePosition(),this.clonePosition()));var _;if(this.bumpSpace(),(_=this.tryParseDecimalInteger(r.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,r.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return _;this.bumpSpace(),b=this.parseIdentifierIfPossible(),w=_.val}var S,E=this.tryParsePluralOrSelectOptions(t,c,e,b);if(E.err)return E;if((S=this.tryParseArgumentClose(s)).err)return S;var M=D(s,this.clonePosition());return"select"===c?{val:{type:i.select,value:n,options:q(E.val),location:M},err:null}:{val:{type:i.plural,value:n,options:q(E.val),offset:w,pluralType:"plural"===c?"cardinal":"ordinal",location:M},err:null};default:return this.error(r.INVALID_ARGUMENT_TYPE,D(l,h))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,D(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(r.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,D(n,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var n=[];try{n=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],n=0,r=t.split(w).filter((function(t){return t.length>0}));n=48&&a<=57))break;i=!0,o=10*o+(a-48),this.bump()}var s=D(r,this.clonePosition());return i?H(o*=n)?{val:o,err:null}:this.error(e,s):this.error(t,s)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=$(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(X(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&nt(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),n=this.message.charCodeAt(e+(t>=65536?2:1));return null!=n?n:null},t}();function et(t){return t>=97&&t<=122||t>=65&&t<=90}function nt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function rt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function it(t){t.forEach((function(t){if(delete t.location,d(t)||f(t))for(var e in t.options)delete t.options[e].location,it(t.options[e].value);else l(t)&&g(t.style)||(c(t)||h(t))&&v(t.style)?delete t.style.location:m(t)&&it(t.children)}))}function ot(t,e){void 0===e&&(e={}),e=(0,a.__assign)({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new tt(t,e).parse();if(n.err){var i=SyntaxError(r[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return(null==e?void 0:e.captureLocation)||it(n.val),n.val}},89160:(t,e,n)=>{"use strict";n.d(e,{Ho:()=>c,OC:()=>a,hr:()=>u,pg:()=>l,sb:()=>h,uo:()=>s});var r,i=n(31635);!function(t){t.FORMAT_ERROR="FORMAT_ERROR",t.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",t.INVALID_CONFIG="INVALID_CONFIG",t.MISSING_DATA="MISSING_DATA",t.MISSING_TRANSLATION="MISSING_TRANSLATION"}(r||(r={}));var o=function(t){function e(n,r,i){var o=this,a=i?i instanceof Error?i:new Error(String(i)):void 0;return(o=t.call(this,"[@formatjs/intl Error ".concat(n,"] ").concat(r,"\n").concat(a?"\n".concat(a.message,"\n").concat(a.stack):""))||this).code=n,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o,e),o}return(0,i.__extends)(e,t),e}(Error),a=function(t){function e(e,n){return t.call(this,r.UNSUPPORTED_FORMATTER,e,n)||this}return(0,i.__extends)(e,t),e}(o),s=function(t){function e(e,n){return t.call(this,r.INVALID_CONFIG,e,n)||this}return(0,i.__extends)(e,t),e}(o),u=function(t){function e(e,n){return t.call(this,r.MISSING_DATA,e,n)||this}return(0,i.__extends)(e,t),e}(o),l=function(t){function e(e,n,i){var o=t.call(this,r.FORMAT_ERROR,"".concat(e,"\nLocale: ").concat(n,"\n"),i)||this;return o.locale=n,o}return(0,i.__extends)(e,t),e}(o),c=function(t){function e(e,n,r,i){var o=t.call(this,"".concat(e,"\nMessageID: ").concat(null==r?void 0:r.id,"\nDefault Message: ").concat(null==r?void 0:r.defaultMessage,"\nDescription: ").concat(null==r?void 0:r.description,"\n"),n,i)||this;return o.descriptor=r,o.locale=n,o}return(0,i.__extends)(e,t),e}(l),h=function(t){function e(e,n){var i=t.call(this,r.MISSING_TRANSLATION,'Missing message: "'.concat(e.id,'" for locale "').concat(n,'", using ').concat(e.defaultMessage?"default message (".concat("string"==typeof e.defaultMessage?e.defaultMessage:e.defaultMessage.map((function(t){var e;return null!==(e=t.value)&&void 0!==e?e:JSON.stringify(t)})).join(),")"):"id"," as fallback."))||this;return i.descriptor=e,i}return(0,i.__extends)(e,t),e}(o)},87683:(t,e,n)=>{"use strict";n.d(e,{F3:()=>d,GT:()=>h,J9:()=>s,JF:()=>u,MT:()=>l});var r=n(31635),i=n(62587),o=n(54819),a=n(89160);function s(t,e,n){return void 0===n&&(n={}),e.reduce((function(e,r){return r in t?e[r]=t[r]:r in n&&(e[r]=n[r]),e}),{})}var u={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(t){0},onWarn:function(t){0}};function l(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function c(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}}}function h(t){void 0===t&&(t={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}});var e=Intl.RelativeTimeFormat,n=Intl.ListFormat,a=Intl.DisplayNames,s=(0,o.B)((function(){for(var t,e=[],n=0;n>>0)+"_",i=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;oe&&(e=Math.max(0,r+e)),(null==n||n>r)&&(n=r),0>(n=Number(n))&&(n=Math.max(0,r+n)),e=Number(e||0);e(e=e||0)&&(e=Math.max(e+r,0));e>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function O(){if(!N){N={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));I[n]=r;for(var i=0;i>2];a=e[(3&a)<<4|s>>4],s=e[(15&s)<<2|u>>6],u=e[63&u],n[o++]=l+a+s+u}switch(l=0,u=r,t.length-i){case 2:u=e[(15&(l=t[i+1]))<<2]||r;case 1:t=t[i],n[o]=e[t>>2]+e[(3&t)<<4|l>>4]+u+r}return n.join("")}for(e="";10240t,n=(t=Math.abs(t))>>>0;t=Math.floor((t-n)/4294967296),e&&(e=(n=s($(n,t))).next().value,t=n.next().value,n=e),G=n>>>0,W=t>>>0}var Y,q="function"==typeof BigInt;function $(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function K(t,e){this.i=t>>>0,this.h=e>>>0}function Z(t){if(!t)return Y||(Y=new K(0,0));if(!/^-?\d+$/.test(t))return null;if(16>t.length)X(Number(t));else if(q)t=BigInt(t),G=Number(t&BigInt(4294967295))>>>0,W=Number(t>>BigInt(32)&BigInt(4294967295));else{var e=+("-"===t[0]);W=G=0;for(var n=t.length,r=e,i=(n-e)%6+e;i<=n;r=i,i+=6)r=Number(t.slice(r,i)),W*=1e6,4294967296<=(G=1e6*G+r)&&(W+=G/4294967296|0,G%=4294967296);e&&(t=(e=s($(G,W))).next().value,e=e.next().value,G=t,W=e)}return new K(G,W)}function Q(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function J(){return Error("Failed to read varint, encoding is invalid.")}function tt(t,e){return Error("Tried to read past the end of the data "+e+" > "+t)}function et(){throw Error("Invalid UTF8")}function nt(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var rt,it,ot,at=void 0,st="undefined"!=typeof TextDecoder,ut="undefined"!=typeof TextEncoder;function lt(t){if(t!==V)throw Error("illegal external caller")}function ct(t,e){if(lt(e),this.V=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}function ht(){return ot||(ot=new ct(null,V))}function dt(t){lt(V);var e=t.V;return null==(e=null==e||L&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?U(e):null)?e:t.V=e}function ft(t,e){this.i=null,this.m=!1,this.h=this.j=this.l=0,pt(this,t,e)}function pt(t,e,n){n=void 0===n?{}:n,t.S=void 0!==n.S&&n.S,e&&(e=function(t){if("string"==typeof t)return{buffer:U(t),C:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),C:!1};if(t.constructor===Uint8Array)return{buffer:t,C:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),C:!1};if(t.constructor===ct)return{buffer:dt(t)||j(),C:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),C:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}(e),t.i=e.buffer,t.m=e.C,t.l=0,t.j=t.i.length,t.h=t.l)}function mt(t,e){if(t.h=e,e>t.j)throw tt(t.j,e)}function gt(t){var e=t.i,n=t.h,r=e[n++],i=127&r;if(128&r&&(i|=(127&(r=e[n++]))<<7,128&r&&(i|=(127&(r=e[n++]))<<14,128&r&&(i|=(127&(r=e[n++]))<<21,128&r&&(i|=(r=e[n++])<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw J();return mt(t,n),i}function vt(t,e){if(0>e)throw Error("Tried to read a negative byte length: "+e);var n=t.h,r=n+e;if(r>t.j)throw tt(e,t.j-n);return t.h=r,n}ft.prototype.reset=function(){this.h=this.l};var yt=[];function bt(){this.h=[]}function xt(t,e,n){for(;0>>7|n<<25)>>>0,n>>>=7;t.h.push(e)}function wt(t,e){for(;127>>=7;t.h.push(e)}function _t(t,e){if(yt.length){var n=yt.pop();pt(n,t,e),t=n}else t=new ft(t,e);this.h=t,this.j=this.h.h,this.i=this.l=-1,this.setOptions(e)}function St(t){var e=t.h;if(e.h==e.j)return!1;t.j=t.h.h;var n=gt(t.h)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw Q(n,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.l=e,t.i=n,!0}function Et(t){switch(t.i){case 0:if(0!=t.i)Et(t);else t:{for(var e=(t=t.h).h,n=e+10,r=t.i;e>>0,mt(t=t.h,t.h+e));break;case 5:mt(t=t.h,t.h+4);break;case 3:for(e=t.l;;){if(!St(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.l!=e)throw Error("Unmatched end-group tag");break}Et(t)}break;default:throw Q(t.i,t.j)}}bt.prototype.length=function(){return this.h.length},bt.prototype.end=function(){var t=this.h;return this.h=[],t},_t.prototype.setOptions=function(t){t=void 0===t?{}:t,this.ca=void 0!==t.ca&&t.ca},_t.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var Mt=[];function At(){this.j=[],this.i=0,this.h=new bt}function Ct(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}var Tt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function kt(t,e){return Tt?t[Tt]|=e:void 0!==t.A?t.A|=e:(Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}}),e)}function It(t,e){Tt?t[Tt]&&(t[Tt]&=~e):void 0!==t.A&&(t.A&=~e)}function Nt(t){var e;return null==(e=Tt?t[Tt]:t.A)?0:e}function Pt(t,e){Tt?t[Tt]=e:void 0!==t.A?t.A=e:Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}})}function Ot(t){return kt(t,1),t}function Lt(t,e){Pt(e,-51&t)}function Rt(t,e){Pt(e,-41&t|18)}var Dt={};function zt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}var Ft,Bt,Ut=[];function jt(t){if(2&Nt(t.o))throw Error("Cannot mutate an immutable Message")}function Vt(t){var e=t.length;(e=e?t[e-1]:void 0)&&zt(e)?e.g=1:(e={},t.push((e.g=1,e)))}function Ht(t){var e=t.i+t.G;return t.B||(t.B=t.o[e]={})}function Gt(t,e){return-1===e?null:e>=t.i?t.B?t.B[e]:void 0:t.o[e+t.G]}function Wt(t,e,n,r){jt(t),Xt(t,e,n,r)}function Xt(t,e,n,r){t.j&&(t.j=void 0),e>=t.i||r?Ht(t)[e]=n:(t.o[e+t.G]=n,(t=t.B)&&e in t&&delete t[e])}function Yt(t,e,n,r){var i=Gt(t,e);Array.isArray(i)||(i=Ft);var o=Nt(i);if(1&o||Ot(i),r)2&o||kt(i,2),1&n||Object.freeze(i);else{r=!(2&n);var a=2&o;1&n||!a?r&&16&o&&!a&&It(i,16):Xt(t,e,i=Ot(Array.prototype.slice.call(i)))}return i}function qt(t,e){var n=Gt(t,e),r=null==n?n:"number"==typeof n||"NaN"===n||"Infinity"===n||"-Infinity"===n?Number(n):void 0;return null!=r&&r!==n&&Xt(t,e,r),r}function $t(t,e,n,r,i){t.h||(t.h={});var o=t.h[n],a=Yt(t,n,3,i);if(!o){var s=a;o=[];var u=!!(16&Nt(t.o));a=!!(2&Nt(s));var l=s;!i&&a&&(s=Array.prototype.slice.call(s));for(var c=a,h=0;ha&&"number"!=typeof t[a]){var s=t[a++];n(e,s)}for(;a>>0)>>31)+1,o=a>>>23&255,a&=8388607,Wt(e,n,255==o?a?NaN:1/0*t:0==o?t*Math.pow(2,-149)*a:t*Math.pow(2,o-150)*(a+Math.pow(2,23))),!0}),(function(t,e,n){if(null!=(e=qt(e,n))){wt(t.h,8*n+5),t=t.h;var r=+e;0===r?0<1/r?G=W=0:(W=0,G=2147483648):isNaN(r)?(W=0,G=2147483647):34028234663852886e22<(r=(n=0>r?-2147483648:0)?-r:r)?(W=0,G=(2139095040|n)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),W=0,G=(n|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),16777216<=(r=Math.round(8388608*r))&&++e,W=0,G=(n|e+127<<23|8388607&r)>>>0),n=G,t.h.push(n>>>0&255),t.h.push(n>>>8&255),t.h.push(n>>>16&255),t.h.push(n>>>24&255)}})),ze=Re((function(t,e,n){if(0!==t.i)return!1;var r=t.h,i=0,o=t=0,a=r.i,s=r.h;do{var u=a[s++];i|=(127&u)<o&&128&u);for(32>4),o=3;32>o&&128&u;o+=7)t|=(127&(u=a[s++]))<u))throw J();return r=i>>>0,(t=2147483648&(u=t>>>0))&&(u=~u>>>0,0==(r=1+~r>>>0)&&(u=u+1>>>0)),r=4294967296*u+(r>>>0),Wt(e,n,t?-r:r),!0}),(function(t,e,n){null!=(e=Gt(e,n))&&("string"==typeof e&&Z(e),null!=e&&(wt(t.h,8*n),"number"==typeof e?(t=t.h,X(e),xt(t,G,W)):(n=Z(e),xt(t.h,n.i,n.h))))})),Fe=Re((function(t,e,n){return 0===t.i&&(Wt(e,n,gt(t.h)),!0)}),(function(t,e,n){if(null!=(e=Gt(e,n))&&null!=e)if(wt(t.h,8*n),t=t.h,0<=(n=e))wt(t,n);else{for(e=0;9>e;e++)t.h.push(127&n|128),n>>=7;t.h.push(1)}})),Be=Re((function(t,e,n){if(2!==t.i)return!1;var r=gt(t.h)>>>0,i=vt(t=t.h,r);if(t=t.i,st){var o,a=t;(o=rt)||(o=rt=new TextDecoder("utf-8",{fatal:!0})),t=i+r,a=0===i&&t===a.length?a:a.subarray(i,t);try{var s=o.decode(a)}catch(t){if(void 0===at){try{o.decode(new Uint8Array([128]))}catch(t){}try{o.decode(new Uint8Array([97])),at=!0}catch(t){at=!1}}throw!at&&(rt=void 0),t}}else{r=(s=i)+r,i=[];for(var u,l,c=null;s(u=t[s++])?i.push(u):224>u?s>=r?et():(l=t[s++],194>u||128!=(192&l)?(s--,et()):i.push((31&u)<<6|63&l)):240>u?s>=r-1?et():128!=(192&(l=t[s++]))||224===u&&160>l||237===u&&160<=l||128!=(192&(a=t[s++]))?(s--,et()):i.push((15&u)<<12|(63&l)<<6|63&a):244>=u?s>=r-2?et():128!=(192&(l=t[s++]))||l-144+(u<<28)>>30||128!=(192&(a=t[s++]))||128!=(192&(o=t[s++]))?(s--,et()):(u=(7&u)<<18|(63&l)<<12|(63&a)<<6|63&o,u-=65536,i.push(55296+(u>>10&1023),56320+(1023&u))):et(),8192<=i.length&&(c=nt(c,i),i.length=0);s=nt(c,i)}return Wt(e,n,s),!0}),(function(t,e,n){if(null!=(e=Gt(e,n))){var r=!1;if(r=void 0!==r&&r,ut){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(it||(it=new TextEncoder)).encode(e)}else{for(var i=0,o=new Uint8Array(3*e.length),a=0;as)o[i++]=s;else{if(2048>s)o[i++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&a=u){s=1024*(s-55296)+u-56320+65536,o[i++]=s>>18|240,o[i++]=s>>12&63|128,o[i++]=s>>6&63|128,o[i++]=63&s|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");s=65533}o[i++]=s>>12|224,o[i++]=s>>6&63|128}o[i++]=63&s|128}}e=i===o.length?o:o.subarray(0,i)}wt(t.h,8*n+2),wt(t.h,e.length),Ct(t,t.h.end()),Ct(t,e)}})),Ue=Re((function(t,e,n,r,i){if(2!==t.i)return!1;e=Qt(e,n,r),n=t.h.j,r=gt(t.h)>>>0;var o=t.h.h+r,a=o-n;if(0>=a&&(t.h.j=o,i(e,t,void 0,void 0,void 0),a=o-t.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.h.h=o,t.h.j=n,!0}),(function(t,e,n,r,i){if(null!=(e=Kt(e,r,n)))for(r=0;r>>=7,a.i++;o.push(s),a.i++}}));function je(t){return function(e,n){t:{if(Mt.length){var r=Mt.pop();r.setOptions(n),pt(r.h,e,n),e=r}else e=new _t(e,n);try{var i=Pe(t),o=Oe(new i.P,e,i);break t}finally{(i=e.h).i=null,i.m=!1,i.l=0,i.j=0,i.h=0,i.S=!1,e.l=-1,e.i=-1,100>Mt.length&&Mt.push(e)}o=void 0}return o}}function Ve(t){return function(){var e=new At;Le(this,e,Ae(t)),Ct(e,e.h.end());for(var n=new Uint8Array(e.i),r=e.j,i=r.length,o=0,a=0;a>>0)+"_",i=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;oe&&(e=Math.max(0,r+e)),(null==n||n>r)&&(n=r),0>(n=Number(n))&&(n=Math.max(0,r+n)),e=Number(e||0);e(e=e||0)&&(e=Math.max(e+r,0));e>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function O(){if(!N){N={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));I[n]=r;for(var i=0;i>2];a=e[(3&a)<<4|s>>4],s=e[(15&s)<<2|u>>6],u=e[63&u],n[o++]=l+a+s+u}switch(l=0,u=r,t.length-i){case 2:u=e[(15&(l=t[i+1]))<<2]||r;case 1:t=t[i],n[o]=e[t>>2]+e[(3&t)<<4|l>>4]+u+r}return n.join("")}for(e="";10240t,n=(t=Math.abs(t))>>>0;t=Math.floor((t-n)/4294967296),e&&(e=(n=s($(n,t))).next().value,t=n.next().value,n=e),G=n>>>0,W=t>>>0}var Y,q="function"==typeof BigInt;function $(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function K(t,e){this.i=t>>>0,this.h=e>>>0}function Z(t){if(!t)return Y||(Y=new K(0,0));if(!/^-?\d+$/.test(t))return null;if(16>t.length)X(Number(t));else if(q)t=BigInt(t),G=Number(t&BigInt(4294967295))>>>0,W=Number(t>>BigInt(32)&BigInt(4294967295));else{var e=+("-"===t[0]);W=G=0;for(var n=t.length,r=e,i=(n-e)%6+e;i<=n;r=i,i+=6)r=Number(t.slice(r,i)),W*=1e6,4294967296<=(G=1e6*G+r)&&(W+=G/4294967296|0,G%=4294967296);e&&(t=(e=s($(G,W))).next().value,e=e.next().value,G=t,W=e)}return new K(G,W)}function Q(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function J(){return Error("Failed to read varint, encoding is invalid.")}function tt(t,e){return Error("Tried to read past the end of the data "+e+" > "+t)}function et(){throw Error("Invalid UTF8")}function nt(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var rt,it,ot,at=void 0,st="undefined"!=typeof TextDecoder,ut="undefined"!=typeof TextEncoder;function lt(t){if(t!==V)throw Error("illegal external caller")}function ct(t,e){if(lt(e),this.V=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}function ht(){return ot||(ot=new ct(null,V))}function dt(t){lt(V);var e=t.V;return null==(e=null==e||L&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?U(e):null)?e:t.V=e}function ft(t,e){this.i=null,this.m=!1,this.h=this.j=this.l=0,pt(this,t,e)}function pt(t,e,n){n=void 0===n?{}:n,t.S=void 0!==n.S&&n.S,e&&(e=function(t){if("string"==typeof t)return{buffer:U(t),C:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),C:!1};if(t.constructor===Uint8Array)return{buffer:t,C:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),C:!1};if(t.constructor===ct)return{buffer:dt(t)||j(),C:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),C:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}(e),t.i=e.buffer,t.m=e.C,t.l=0,t.j=t.i.length,t.h=t.l)}function mt(t,e){if(t.h=e,e>t.j)throw tt(t.j,e)}function gt(t){var e=t.i,n=t.h,r=e[n++],i=127&r;if(128&r&&(i|=(127&(r=e[n++]))<<7,128&r&&(i|=(127&(r=e[n++]))<<14,128&r&&(i|=(127&(r=e[n++]))<<21,128&r&&(i|=(r=e[n++])<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw J();return mt(t,n),i}function vt(t,e){if(0>e)throw Error("Tried to read a negative byte length: "+e);var n=t.h,r=n+e;if(r>t.j)throw tt(e,t.j-n);return t.h=r,n}ft.prototype.reset=function(){this.h=this.l};var yt=[];function bt(){this.h=[]}function xt(t,e,n){for(;0>>7|n<<25)>>>0,n>>>=7;t.h.push(e)}function wt(t,e){for(;127>>=7;t.h.push(e)}function _t(t,e){if(yt.length){var n=yt.pop();pt(n,t,e),t=n}else t=new ft(t,e);this.h=t,this.j=this.h.h,this.i=this.l=-1,this.setOptions(e)}function St(t){var e=t.h;if(e.h==e.j)return!1;t.j=t.h.h;var n=gt(t.h)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw Q(n,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.l=e,t.i=n,!0}function Et(t){switch(t.i){case 0:if(0!=t.i)Et(t);else t:{for(var e=(t=t.h).h,n=e+10,r=t.i;e>>0,mt(t=t.h,t.h+e));break;case 5:mt(t=t.h,t.h+4);break;case 3:for(e=t.l;;){if(!St(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.l!=e)throw Error("Unmatched end-group tag");break}Et(t)}break;default:throw Q(t.i,t.j)}}bt.prototype.length=function(){return this.h.length},bt.prototype.end=function(){var t=this.h;return this.h=[],t},_t.prototype.setOptions=function(t){t=void 0===t?{}:t,this.ca=void 0!==t.ca&&t.ca},_t.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var Mt=[];function At(){this.j=[],this.i=0,this.h=new bt}function Ct(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}var Tt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function kt(t,e){return Tt?t[Tt]|=e:void 0!==t.A?t.A|=e:(Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}}),e)}function It(t,e){Tt?t[Tt]&&(t[Tt]&=~e):void 0!==t.A&&(t.A&=~e)}function Nt(t){var e;return null==(e=Tt?t[Tt]:t.A)?0:e}function Pt(t,e){Tt?t[Tt]=e:void 0!==t.A?t.A=e:Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}})}function Ot(t){return kt(t,1),t}function Lt(t,e){Pt(e,-51&t)}function Rt(t,e){Pt(e,-41&t|18)}var Dt={};function zt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}var Ft,Bt,Ut=[];function jt(t){if(2&Nt(t.o))throw Error("Cannot mutate an immutable Message")}function Vt(t){var e=t.length;(e=e?t[e-1]:void 0)&&zt(e)?e.g=1:(e={},t.push((e.g=1,e)))}function Ht(t){var e=t.i+t.G;return t.B||(t.B=t.o[e]={})}function Gt(t,e){return-1===e?null:e>=t.i?t.B?t.B[e]:void 0:t.o[e+t.G]}function Wt(t,e,n,r){jt(t),Xt(t,e,n,r)}function Xt(t,e,n,r){t.j&&(t.j=void 0),e>=t.i||r?Ht(t)[e]=n:(t.o[e+t.G]=n,(t=t.B)&&e in t&&delete t[e])}function Yt(t,e,n,r){var i=Gt(t,e);Array.isArray(i)||(i=Ft);var o=Nt(i);if(1&o||Ot(i),r)2&o||kt(i,2),1&n||Object.freeze(i);else{r=!(2&n);var a=2&o;1&n||!a?r&&16&o&&!a&&It(i,16):Xt(t,e,i=Ot(Array.prototype.slice.call(i)))}return i}function qt(t,e){var n=Gt(t,e),r=null==n?n:"number"==typeof n||"NaN"===n||"Infinity"===n||"-Infinity"===n?Number(n):void 0;return null!=r&&r!==n&&Xt(t,e,r),r}function $t(t,e,n,r,i){t.h||(t.h={});var o=t.h[n],a=Yt(t,n,3,i);if(!o){var s=a;o=[];var u=!!(16&Nt(t.o));a=!!(2&Nt(s));var l=s;!i&&a&&(s=Array.prototype.slice.call(s));for(var c=a,h=0;ha&&"number"!=typeof t[a]){var s=t[a++];n(e,s)}for(;a>>0)>>31)+1,o=a>>>23&255,a&=8388607,Wt(e,n,255==o?a?NaN:1/0*t:0==o?t*Math.pow(2,-149)*a:t*Math.pow(2,o-150)*(a+Math.pow(2,23))),!0}),(function(t,e,n){if(null!=(e=qt(e,n))){wt(t.h,8*n+5),t=t.h;var r=+e;0===r?0<1/r?G=W=0:(W=0,G=2147483648):isNaN(r)?(W=0,G=2147483647):34028234663852886e22<(r=(n=0>r?-2147483648:0)?-r:r)?(W=0,G=(2139095040|n)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),W=0,G=(n|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),16777216<=(r=Math.round(8388608*r))&&++e,W=0,G=(n|e+127<<23|8388607&r)>>>0),n=G,t.h.push(n>>>0&255),t.h.push(n>>>8&255),t.h.push(n>>>16&255),t.h.push(n>>>24&255)}})),ze=Re((function(t,e,n){if(0!==t.i)return!1;var r=t.h,i=0,o=t=0,a=r.i,s=r.h;do{var u=a[s++];i|=(127&u)<o&&128&u);for(32>4),o=3;32>o&&128&u;o+=7)t|=(127&(u=a[s++]))<u))throw J();return r=i>>>0,(t=2147483648&(u=t>>>0))&&(u=~u>>>0,0==(r=1+~r>>>0)&&(u=u+1>>>0)),r=4294967296*u+(r>>>0),Wt(e,n,t?-r:r),!0}),(function(t,e,n){null!=(e=Gt(e,n))&&("string"==typeof e&&Z(e),null!=e&&(wt(t.h,8*n),"number"==typeof e?(t=t.h,X(e),xt(t,G,W)):(n=Z(e),xt(t.h,n.i,n.h))))})),Fe=Re((function(t,e,n){return 0===t.i&&(Wt(e,n,gt(t.h)),!0)}),(function(t,e,n){if(null!=(e=Gt(e,n))&&null!=e)if(wt(t.h,8*n),t=t.h,0<=(n=e))wt(t,n);else{for(e=0;9>e;e++)t.h.push(127&n|128),n>>=7;t.h.push(1)}})),Be=Re((function(t,e,n){if(2!==t.i)return!1;var r=gt(t.h)>>>0,i=vt(t=t.h,r);if(t=t.i,st){var o,a=t;(o=rt)||(o=rt=new TextDecoder("utf-8",{fatal:!0})),t=i+r,a=0===i&&t===a.length?a:a.subarray(i,t);try{var s=o.decode(a)}catch(t){if(void 0===at){try{o.decode(new Uint8Array([128]))}catch(t){}try{o.decode(new Uint8Array([97])),at=!0}catch(t){at=!1}}throw!at&&(rt=void 0),t}}else{r=(s=i)+r,i=[];for(var u,l,c=null;s(u=t[s++])?i.push(u):224>u?s>=r?et():(l=t[s++],194>u||128!=(192&l)?(s--,et()):i.push((31&u)<<6|63&l)):240>u?s>=r-1?et():128!=(192&(l=t[s++]))||224===u&&160>l||237===u&&160<=l||128!=(192&(a=t[s++]))?(s--,et()):i.push((15&u)<<12|(63&l)<<6|63&a):244>=u?s>=r-2?et():128!=(192&(l=t[s++]))||l-144+(u<<28)>>30||128!=(192&(a=t[s++]))||128!=(192&(o=t[s++]))?(s--,et()):(u=(7&u)<<18|(63&l)<<12|(63&a)<<6|63&o,u-=65536,i.push(55296+(u>>10&1023),56320+(1023&u))):et(),8192<=i.length&&(c=nt(c,i),i.length=0);s=nt(c,i)}return Wt(e,n,s),!0}),(function(t,e,n){if(null!=(e=Gt(e,n))){var r=!1;if(r=void 0!==r&&r,ut){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(it||(it=new TextEncoder)).encode(e)}else{for(var i=0,o=new Uint8Array(3*e.length),a=0;as)o[i++]=s;else{if(2048>s)o[i++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&a=u){s=1024*(s-55296)+u-56320+65536,o[i++]=s>>18|240,o[i++]=s>>12&63|128,o[i++]=s>>6&63|128,o[i++]=63&s|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");s=65533}o[i++]=s>>12|224,o[i++]=s>>6&63|128}o[i++]=63&s|128}}e=i===o.length?o:o.subarray(0,i)}wt(t.h,8*n+2),wt(t.h,e.length),Ct(t,t.h.end()),Ct(t,e)}})),Ue=Re((function(t,e,n,r,i){if(2!==t.i)return!1;e=Qt(e,n,r),n=t.h.j,r=gt(t.h)>>>0;var o=t.h.h+r,a=o-n;if(0>=a&&(t.h.j=o,i(e,t,void 0,void 0,void 0),a=o-t.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.h.h=o,t.h.j=n,!0}),(function(t,e,n,r,i){if(null!=(e=Kt(e,r,n)))for(r=0;r>>=7,a.i++;o.push(s),a.i++}}));function je(t){return function(e,n){t:{if(Mt.length){var r=Mt.pop();r.setOptions(n),pt(r.h,e,n),e=r}else e=new _t(e,n);try{var i=Pe(t),o=Oe(new i.P,e,i);break t}finally{(i=e.h).i=null,i.m=!1,i.l=0,i.j=0,i.h=0,i.S=!1,e.l=-1,e.i=-1,100>Mt.length&&Mt.push(e)}o=void 0}return o}}function Ve(t){return function(){var e=new At;Le(this,e,Ae(t)),Ct(e,e.h.end());for(var n=new Uint8Array(e.i),r=e.j,i=r.length,o=0,a=0;a{"use strict";n.d(e,{A:()=>b});var r=n(5544),i=n(96540),o=n(40961),a=n(20998),s=(n(68210),n(8719));const u=i.createContext(null);var l=n(60436),c=n(30981),h=[];var d=n(85089);function f(t){var e="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=e;var r,i,o=n.style;if(o.position="absolute",o.left="0",o.top="0",o.width="100px",o.height="100px",o.overflow="scroll",t){var a=getComputedStyle(t);o.scrollbarColor=a.scrollbarColor,o.scrollbarWidth=a.scrollbarWidth;var s=getComputedStyle(t,"::-webkit-scrollbar"),u=parseInt(s.width,10),l=parseInt(s.height,10);try{var c=u?"width: ".concat(s.width,";"):"",h=l?"height: ".concat(s.height,";"):"";(0,d.BD)("\n#".concat(e,"::-webkit-scrollbar {\n").concat(c,"\n").concat(h,"\n}"),e)}catch(t){console.error(t),r=u,i=l}}document.body.appendChild(n);var f=t&&r&&!isNaN(r)?r:n.offsetWidth-n.clientWidth,p=t&&i&&!isNaN(i)?i:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),(0,d.m6)(e),{width:f,height:p}}var p="rc-util-locker-".concat(Date.now()),m=0;function g(t){var e=!!t,n=i.useState((function(){return m+=1,"".concat(p,"_").concat(m)})),o=(0,r.A)(n,1)[0];(0,c.A)((function(){if(e){var t=(r=document.body,"undefined"!=typeof document&&r&&r instanceof Element?f(r):{width:0,height:0}).width,n=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth;(0,d.BD)("\nhtml body {\n overflow-y: hidden;\n ".concat(n?"width: calc(100% - ".concat(t,"px);"):"","\n}"),o)}else(0,d.m6)(o);var r;return function(){(0,d.m6)(o)}}),[e,o])}var v=!1;var y=function(t){return!1!==t&&((0,a.A)()&&t?"string"==typeof t?document.querySelector(t):"function"==typeof t?t():t:null)};const b=i.forwardRef((function(t,e){var n=t.open,d=t.autoLock,f=t.getContainer,p=(t.debug,t.autoDestroy),m=void 0===p||p,b=t.children,x=i.useState(n),w=(0,r.A)(x,2),_=w[0],S=w[1],E=_||n;i.useEffect((function(){(m||n)&&S(n)}),[n,m]);var M=i.useState((function(){return y(f)})),A=(0,r.A)(M,2),C=A[0],T=A[1];i.useEffect((function(){var t=y(f);T(null!=t?t:null)}));var k=function(t,e){var n=i.useState((function(){return(0,a.A)()?document.createElement("div"):null})),o=(0,r.A)(n,1)[0],s=i.useRef(!1),d=i.useContext(u),f=i.useState(h),p=(0,r.A)(f,2),m=p[0],g=p[1],v=d||(s.current?void 0:function(t){g((function(e){return[t].concat((0,l.A)(e))}))});function y(){o.parentElement||document.body.appendChild(o),s.current=!0}function b(){var t;null===(t=o.parentElement)||void 0===t||t.removeChild(o),s.current=!1}return(0,c.A)((function(){return t?d?d(y):y():b(),b}),[t]),(0,c.A)((function(){m.length&&(m.forEach((function(t){return t()})),g(h))}),[m]),[o,v]}(E&&!C),I=(0,r.A)(k,2),N=I[0],P=I[1],O=null!=C?C:N;g(d&&n&&(0,a.A)()&&(O===N||O===document.body));var L=null;b&&(0,s.f3)(b)&&e&&(L=b.ref);var R=(0,s.xK)(L,e);if(!E||!(0,a.A)()||void 0===C)return null;var D,z=!1===O||("boolean"==typeof D&&(v=D),v),F=b;return e&&(F=i.cloneElement(b,{ref:R})),i.createElement(u.Provider,{value:P},z?F:(0,o.createPortal)(F,O))}))},62427:(t,e,n)=>{"use strict";n.d(e,{A:()=>V});var r=n(89379),i=n(5544),o=n(53986),a=n(72595),s=n(46942),u=n.n(s),l=n(18462),c=n(66588),h=n(72633),d=n(26956),f=n(56855),p=n(30981),m=n(68430),g=n(96540),v=n(58168),y=n(57557),b=n(8719);function x(t){var e=t.prefixCls,n=t.align,r=t.arrow,i=t.arrowPos,o=r||{},a=o.className,s=o.content,l=i.x,c=void 0===l?0:l,h=i.y,d=void 0===h?0:h,f=g.useRef();if(!n||!n.points)return null;var p={position:"absolute"};if(!1!==n.autoArrow){var m=n.points[0],v=n.points[1],y=m[0],b=m[1],x=v[0],w=v[1];y!==x&&["t","b"].includes(y)?"t"===y?p.top=0:p.bottom=0:p.top=d,b!==w&&["l","r"].includes(b)?"l"===b?p.left=0:p.right=0:p.left=c}return g.createElement("div",{ref:f,className:u()("".concat(e,"-arrow"),a),style:p},s)}function w(t){var e=t.prefixCls,n=t.open,r=t.zIndex,i=t.mask,o=t.motion;return i?g.createElement(y.Ay,(0,v.A)({},o,{motionAppear:!0,visible:n,removeOnLeave:!0}),(function(t){var n=t.className;return g.createElement("div",{style:{zIndex:r},className:u()("".concat(e,"-mask"),n)})})):null}const _=g.memo((function(t){return t.children}),(function(t,e){return e.cache}));const S=g.forwardRef((function(t,e){var n=t.popup,o=t.className,a=t.prefixCls,s=t.style,c=t.target,h=t.onVisibleChanged,d=t.open,f=t.keepDom,m=t.fresh,S=t.onClick,E=t.mask,M=t.arrow,A=t.arrowPos,C=t.align,T=t.motion,k=t.maskMotion,I=t.forceRender,N=t.getPopupContainer,P=t.autoDestroy,O=t.portal,L=t.zIndex,R=t.onMouseEnter,D=t.onMouseLeave,z=t.onPointerEnter,F=t.ready,B=t.offsetX,U=t.offsetY,j=t.offsetR,V=t.offsetB,H=t.onAlign,G=t.onPrepare,W=t.stretch,X=t.targetWidth,Y=t.targetHeight,q="function"==typeof n?n():n,$=d||f,K=(null==N?void 0:N.length)>0,Z=g.useState(!N||!K),Q=(0,i.A)(Z,2),J=Q[0],tt=Q[1];if((0,p.A)((function(){!J&&K&&c&&tt(!0)}),[J,K,c]),!J)return null;var et="auto",nt={left:"-1000vw",top:"-1000vh",right:et,bottom:et};if(F||!d){var rt,it=C.points,ot=C.dynamicInset||(null===(rt=C._experimental)||void 0===rt?void 0:rt.dynamicInset),at=ot&&"r"===it[0][1],st=ot&&"b"===it[0][0];at?(nt.right=j,nt.left=et):(nt.left=B,nt.right=et),st?(nt.bottom=V,nt.top=et):(nt.top=U,nt.bottom=et)}var ut={};return W&&(W.includes("height")&&Y?ut.height=Y:W.includes("minHeight")&&Y&&(ut.minHeight=Y),W.includes("width")&&X?ut.width=X:W.includes("minWidth")&&X&&(ut.minWidth=X)),d||(ut.pointerEvents="none"),g.createElement(O,{open:I||$,getContainer:N&&function(){return N(c)},autoDestroy:P},g.createElement(w,{prefixCls:a,open:d,zIndex:L,mask:E,motion:k}),g.createElement(l.A,{onResize:H,disabled:!d},(function(t){return g.createElement(y.Ay,(0,v.A)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:I,leavedClassName:"".concat(a,"-hidden")},T,{onAppearPrepare:G,onEnterPrepare:G,visible:d,onVisibleChanged:function(t){var e;null==T||null===(e=T.onVisibleChanged)||void 0===e||e.call(T,t),h(t)}}),(function(n,i){var l=n.className,c=n.style,h=u()(a,l,o);return g.createElement("div",{ref:(0,b.K4)(t,e,i),className:h,style:(0,r.A)((0,r.A)((0,r.A)((0,r.A)({"--arrow-x":"".concat(A.x||0,"px"),"--arrow-y":"".concat(A.y||0,"px")},nt),ut),c),{},{boxSizing:"border-box",zIndex:L},s),onMouseEnter:R,onMouseLeave:D,onPointerEnter:z,onClick:S},M&&g.createElement(x,{prefixCls:a,arrow:M,arrowPos:A,align:C}),g.createElement(_,{cache:!d&&!m},q))}))})))}));const E=g.forwardRef((function(t,e){var n=t.children,r=t.getTriggerDOMNode,i=(0,b.f3)(n),o=g.useCallback((function(t){(0,b.Xf)(e,r?r(t):t)}),[r]),a=(0,b.xK)(o,n.ref);return i?g.cloneElement(n,{ref:a}):n}));const M=g.createContext(null);function A(t){return t?Array.isArray(t)?t:[t]:[]}var C=n(42467);function T(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>2?arguments[2]:void 0)?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function k(t,e,n,r){return e||(n?{motionName:"".concat(t,"-").concat(n)}:r?{motionName:r}:null)}function I(t){return t.ownerDocument.defaultView}function N(t){for(var e=[],n=null==t?void 0:t.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=I(n).getComputedStyle(n);[i.overflowX,i.overflowY,i.overflow].some((function(t){return r.includes(t)}))&&e.push(n),n=n.parentElement}return e}function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(t)?e:t}function O(t){return P(parseFloat(t),0)}function L(t,e){var n=(0,r.A)({},t);return(e||[]).forEach((function(t){if(!(t instanceof HTMLBodyElement||t instanceof HTMLHtmlElement)){var e=I(t).getComputedStyle(t),r=e.overflow,i=e.overflowClipMargin,o=e.borderTopWidth,a=e.borderBottomWidth,s=e.borderLeftWidth,u=e.borderRightWidth,l=t.getBoundingClientRect(),c=t.offsetHeight,h=t.clientHeight,d=t.offsetWidth,f=t.clientWidth,p=O(o),m=O(a),g=O(s),v=O(u),y=P(Math.round(l.width/d*1e3)/1e3),b=P(Math.round(l.height/c*1e3)/1e3),x=(d-f-g-v)*y,w=(c-h-p-m)*b,_=p*b,S=m*b,E=g*y,M=v*y,A=0,C=0;if("clip"===r){var T=O(i);A=T*y,C=T*b}var k=l.x+E-A,N=l.y+_-C,L=k+l.width+2*A-E-M-x,R=N+l.height+2*C-_-S-w;n.left=Math.max(n.left,k),n.top=Math.max(n.top,N),n.right=Math.min(n.right,L),n.bottom=Math.min(n.bottom,R)}})),n}function R(t){var e="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),n=e.match(/^(.*)\%$/);return n?t*(parseFloat(n[1])/100):parseFloat(e)}function D(t,e){var n=e||[],r=(0,i.A)(n,2),o=r[0],a=r[1];return[R(t.width,o),R(t.height,a)]}function z(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[t[0],t[1]]}function F(t,e){var n,r=e[0],i=e[1];return n="t"===r?t.y:"b"===r?t.y+t.height:t.y+t.height/2,{x:"l"===i?t.x:"r"===i?t.x+t.width:t.x+t.width/2,y:n}}function B(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map((function(t,r){return r===e?n[t]||"c":t})).join("")}var U=n(60436);n(68210);var j=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];const V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.A;return g.forwardRef((function(e,n){var a=e.prefixCls,s=void 0===a?"rc-trigger-popup":a,v=e.children,y=e.action,b=void 0===y?"hover":y,x=e.showAction,w=e.hideAction,_=e.popupVisible,O=e.defaultPopupVisible,R=e.onPopupVisibleChange,V=e.afterPopupVisibleChange,H=e.mouseEnterDelay,G=e.mouseLeaveDelay,W=void 0===G?.1:G,X=e.focusDelay,Y=e.blurDelay,q=e.mask,$=e.maskClosable,K=void 0===$||$,Z=e.getPopupContainer,Q=e.forceRender,J=e.autoDestroy,tt=e.destroyPopupOnHide,et=e.popup,nt=e.popupClassName,rt=e.popupStyle,it=e.popupPlacement,ot=e.builtinPlacements,at=void 0===ot?{}:ot,st=e.popupAlign,ut=e.zIndex,lt=e.stretch,ct=e.getPopupClassNameFromAlign,ht=e.fresh,dt=e.alignPoint,ft=e.onPopupClick,pt=e.onPopupAlign,mt=e.arrow,gt=e.popupMotion,vt=e.maskMotion,yt=e.popupTransitionName,bt=e.popupAnimation,xt=e.maskTransitionName,wt=e.maskAnimation,_t=e.className,St=e.getTriggerDOMNode,Et=(0,o.A)(e,j),Mt=J||tt||!1,At=g.useState(!1),Ct=(0,i.A)(At,2),Tt=Ct[0],kt=Ct[1];(0,p.A)((function(){kt((0,m.A)())}),[]);var It=g.useRef({}),Nt=g.useContext(M),Pt=g.useMemo((function(){return{registerSubPopup:function(t,e){It.current[t]=e,null==Nt||Nt.registerSubPopup(t,e)}}}),[Nt]),Ot=(0,f.A)(),Lt=g.useState(null),Rt=(0,i.A)(Lt,2),Dt=Rt[0],zt=Rt[1],Ft=g.useRef(null),Bt=(0,d.A)((function(t){Ft.current=t,(0,c.f)(t)&&Dt!==t&&zt(t),null==Nt||Nt.registerSubPopup(Ot,t)})),Ut=g.useState(null),jt=(0,i.A)(Ut,2),Vt=jt[0],Ht=jt[1],Gt=g.useRef(null),Wt=(0,d.A)((function(t){(0,c.f)(t)&&Vt!==t&&(Ht(t),Gt.current=t)})),Xt=g.Children.only(v),Yt=(null==Xt?void 0:Xt.props)||{},qt={},$t=(0,d.A)((function(t){var e,n,r=Vt;return(null==r?void 0:r.contains(t))||(null===(e=(0,h.j)(r))||void 0===e?void 0:e.host)===t||t===r||(null==Dt?void 0:Dt.contains(t))||(null===(n=(0,h.j)(Dt))||void 0===n?void 0:n.host)===t||t===Dt||Object.values(It.current).some((function(e){return(null==e?void 0:e.contains(t))||t===e}))})),Kt=k(s,gt,bt,yt),Zt=k(s,vt,wt,xt),Qt=g.useState(O||!1),Jt=(0,i.A)(Qt,2),te=Jt[0],ee=Jt[1],ne=null!=_?_:te,re=(0,d.A)((function(t){void 0===_&&ee(t)}));(0,p.A)((function(){ee(_||!1)}),[_]);var ie=g.useRef(ne);ie.current=ne;var oe=g.useRef([]);oe.current=[];var ae=(0,d.A)((function(t){var e;re(t),(null!==(e=oe.current[oe.current.length-1])&&void 0!==e?e:ne)!==t&&(oe.current.push(t),null==R||R(t))})),se=g.useRef(),ue=function(){clearTimeout(se.current)},le=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;ue(),0===e?ae(t):se.current=setTimeout((function(){ae(t)}),1e3*e)};g.useEffect((function(){return ue}),[]);var ce=g.useState(!1),he=(0,i.A)(ce,2),de=he[0],fe=he[1];(0,p.A)((function(t){t&&!ne||fe(!0)}),[ne]);var pe=g.useState(null),me=(0,i.A)(pe,2),ge=me[0],ve=me[1],ye=g.useState([0,0]),be=(0,i.A)(ye,2),xe=be[0],we=be[1],_e=function(t){we([t.clientX,t.clientY])},Se=function(t,e,n,o,a,s,u){var l=g.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:a[o]||{}}),h=(0,i.A)(l,2),f=h[0],m=h[1],v=g.useRef(0),y=g.useMemo((function(){return e?N(e):[]}),[e]),b=g.useRef({});t||(b.current={});var x=(0,d.A)((function(){if(e&&n&&t){var l,h,d,f=e,p=f.ownerDocument,g=I(f).getComputedStyle(f),v=g.width,x=g.height,w=g.position,_=f.style.left,S=f.style.top,E=f.style.right,M=f.style.bottom,A=f.style.overflow,T=(0,r.A)((0,r.A)({},a[o]),s),k=p.createElement("div");if(null===(l=f.parentElement)||void 0===l||l.appendChild(k),k.style.left="".concat(f.offsetLeft,"px"),k.style.top="".concat(f.offsetTop,"px"),k.style.position=w,k.style.height="".concat(f.offsetHeight,"px"),k.style.width="".concat(f.offsetWidth,"px"),f.style.left="0",f.style.top="0",f.style.right="auto",f.style.bottom="auto",f.style.overflow="hidden",Array.isArray(n))d={x:n[0],y:n[1],width:0,height:0};else{var N=n.getBoundingClientRect();d={x:N.x,y:N.y,width:N.width,height:N.height}}var O=f.getBoundingClientRect(),R=p.documentElement,U=R.clientWidth,j=R.clientHeight,V=R.scrollWidth,H=R.scrollHeight,G=R.scrollTop,W=R.scrollLeft,X=O.height,Y=O.width,q=d.height,$=d.width,K={left:0,top:0,right:U,bottom:j},Z={left:-W,top:-G,right:V-W,bottom:H-G},Q=T.htmlRegion,J="visible",tt="visibleFirst";"scroll"!==Q&&Q!==tt&&(Q=J);var et=Q===tt,nt=L(Z,y),rt=L(K,y),it=Q===J?rt:nt,ot=et?rt:it;f.style.left="auto",f.style.top="auto",f.style.right="0",f.style.bottom="0";var at=f.getBoundingClientRect();f.style.left=_,f.style.top=S,f.style.right=E,f.style.bottom=M,f.style.overflow=A,null===(h=f.parentElement)||void 0===h||h.removeChild(k);var st=P(Math.round(Y/parseFloat(v)*1e3)/1e3),ut=P(Math.round(X/parseFloat(x)*1e3)/1e3);if(0===st||0===ut||(0,c.f)(n)&&!(0,C.A)(n))return;var lt=T.offset,ct=T.targetOffset,ht=D(O,lt),dt=(0,i.A)(ht,2),ft=dt[0],pt=dt[1],mt=D(d,ct),gt=(0,i.A)(mt,2),vt=gt[0],yt=gt[1];d.x-=vt,d.y-=yt;var bt=T.points||[],xt=(0,i.A)(bt,2),wt=xt[0],_t=z(xt[1]),St=z(wt),Et=F(d,_t),Mt=F(O,St),At=(0,r.A)({},T),Ct=Et.x-Mt.x+ft,Tt=Et.y-Mt.y+pt;function we(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:it,r=O.x+t,i=O.y+e,o=r+Y,a=i+X,s=Math.max(r,n.left),u=Math.max(i,n.top),l=Math.min(o,n.right),c=Math.min(a,n.bottom);return Math.max(0,(l-s)*(c-u))}var kt,It,Nt,Pt,Ot=we(Ct,Tt),Lt=we(Ct,Tt,rt),Rt=F(d,["t","l"]),Dt=F(O,["t","l"]),zt=F(d,["b","r"]),Ft=F(O,["b","r"]),Bt=T.overflow||{},Ut=Bt.adjustX,jt=Bt.adjustY,Vt=Bt.shiftX,Ht=Bt.shiftY,Gt=function(t){return"boolean"==typeof t?t:t>=0};function _e(){kt=O.y+Tt,It=kt+X,Nt=O.x+Ct,Pt=Nt+Y}_e();var Wt=Gt(jt),Xt=St[0]===_t[0];if(Wt&&"t"===St[0]&&(It>ot.bottom||b.current.bt)){var Yt=Tt;Xt?Yt-=X-q:Yt=Rt.y-Ft.y-pt;var qt=we(Ct,Yt),$t=we(Ct,Yt,rt);qt>Ot||qt===Ot&&(!et||$t>=Lt)?(b.current.bt=!0,Tt=Yt,pt=-pt,At.points=[B(St,0),B(_t,0)]):b.current.bt=!1}if(Wt&&"b"===St[0]&&(ktOt||Zt===Ot&&(!et||Qt>=Lt)?(b.current.tb=!0,Tt=Kt,pt=-pt,At.points=[B(St,0),B(_t,0)]):b.current.tb=!1}var Jt=Gt(Ut),te=St[1]===_t[1];if(Jt&&"l"===St[1]&&(Pt>ot.right||b.current.rl)){var ee=Ct;te?ee-=Y-$:ee=Rt.x-Ft.x-ft;var ne=we(ee,Tt),re=we(ee,Tt,rt);ne>Ot||ne===Ot&&(!et||re>=Lt)?(b.current.rl=!0,Ct=ee,ft=-ft,At.points=[B(St,1),B(_t,1)]):b.current.rl=!1}if(Jt&&"r"===St[1]&&(NtOt||oe===Ot&&(!et||ae>=Lt)?(b.current.lr=!0,Ct=ie,ft=-ft,At.points=[B(St,1),B(_t,1)]):b.current.lr=!1}_e();var se=!0===Vt?0:Vt;"number"==typeof se&&(Ntrt.right&&(Ct-=Pt-rt.right-ft,d.x>rt.right-se&&(Ct+=d.x-rt.right+se)));var ue=!0===Ht?0:Ht;"number"==typeof ue&&(ktrt.bottom&&(Tt-=It-rt.bottom-pt,d.y>rt.bottom-ue&&(Tt+=d.y-rt.bottom+ue)));var le=O.x+Ct,ce=le+Y,he=O.y+Tt,de=he+X,fe=d.x,pe=fe+$,me=d.y,ge=me+q,ve=(Math.max(le,fe)+Math.min(ce,pe))/2-le,ye=(Math.max(he,me)+Math.min(de,ge))/2-he;null==u||u(e,At);var be=at.right-O.x-(Ct+O.width),xe=at.bottom-O.y-(Tt+O.height);m({ready:!0,offsetX:Ct/st,offsetY:Tt/ut,offsetR:be/st,offsetB:xe/ut,arrowX:ve/st,arrowY:ye/ut,scaleX:st,scaleY:ut,align:At})}})),w=function(){m((function(t){return(0,r.A)((0,r.A)({},t),{},{ready:!1})}))};return(0,p.A)(w,[o]),(0,p.A)((function(){t||w()}),[t]),[f.ready,f.offsetX,f.offsetY,f.offsetR,f.offsetB,f.arrowX,f.arrowY,f.scaleX,f.scaleY,f.align,function(){v.current+=1;var t=v.current;Promise.resolve().then((function(){v.current===t&&x()}))}]}(ne,Dt,dt?xe:Vt,it,at,st,pt),Ee=(0,i.A)(Se,11),Me=Ee[0],Ae=Ee[1],Ce=Ee[2],Te=Ee[3],ke=Ee[4],Ie=Ee[5],Ne=Ee[6],Pe=Ee[7],Oe=Ee[8],Le=Ee[9],Re=Ee[10],De=function(t,e,n,r){return g.useMemo((function(){var i=A(null!=n?n:e),o=A(null!=r?r:e),a=new Set(i),s=new Set(o);return t&&(a.has("hover")&&(a.delete("hover"),a.add("click")),s.has("hover")&&(s.delete("hover"),s.add("click"))),[a,s]}),[t,e,n,r])}(Tt,b,x,w),ze=(0,i.A)(De,2),Fe=ze[0],Be=ze[1],Ue=Fe.has("click"),je=Be.has("click")||Be.has("contextMenu"),Ve=(0,d.A)((function(){de||Re()}));!function(t,e,n,r,i){(0,p.A)((function(){if(t&&e&&n){var o=n,a=N(e),s=N(o),u=I(o),l=new Set([u].concat((0,U.A)(a),(0,U.A)(s)));function c(){r(),i()}return l.forEach((function(t){t.addEventListener("scroll",c,{passive:!0})})),u.addEventListener("resize",c,{passive:!0}),r(),function(){l.forEach((function(t){t.removeEventListener("scroll",c),u.removeEventListener("resize",c)}))}}}),[t,e,n])}(ne,Vt,Dt,Ve,(function(){ie.current&&dt&&je&&le(!1)})),(0,p.A)((function(){Ve()}),[xe,it]),(0,p.A)((function(){!ne||null!=at&&at[it]||Ve()}),[JSON.stringify(st)]);var He=g.useMemo((function(){var t=function(t,e,n,r){for(var i=n.points,o=Object.keys(t),a=0;a1?a-1:0),u=1;u1?n-1:0),i=1;i1?n-1:0),i=1;i{"use strict"; +/** + * @remix-run/router v1.16.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;eO,HS:()=>L,Oi:()=>s,Rr:()=>d,TM:()=>a,pX:()=>B,pb:()=>k,rc:()=>i,tH:()=>F,ue:()=>m,yD:()=>P}),function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(i||(i={}));const o="popstate";function a(t){return void 0===t&&(t={}),f((function(t,e){let{pathname:n="/",search:r="",hash:i=""}=d(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),c("",{pathname:n,search:r,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let n=t.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let e=t.location.href,n=e.indexOf("#");r=-1===n?e:e.slice(0,n)}return r+"#"+("string"==typeof e?e:h(e))}),(function(t,e){u("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}function s(t,e){if(!1===t||null==t)throw new Error(e)}function u(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function l(t,e){return{usr:t.state,key:t.key,idx:e}}function c(t,e,n,i){return void 0===n&&(n=null),r({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?d(e):e,{state:n,key:e&&e.key||i||Math.random().toString(36).substr(2,8)})}function h(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&"?"!==n&&(e+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function d(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function f(t,e,n,a){void 0===a&&(a={});let{window:u=document.defaultView,v5Compat:d=!1}=a,f=u.history,p=i.Pop,m=null,g=v();function v(){return(f.state||{idx:null}).idx}function y(){p=i.Pop;let t=v(),e=null==t?null:t-g;g=t,m&&m({action:p,location:x.location,delta:e})}function b(t){let e="null"!==u.location.origin?u.location.origin:u.location.href,n="string"==typeof t?t:h(t);return n=n.replace(/ $/,"%20"),s(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==g&&(g=0,f.replaceState(r({},f.state,{idx:g}),""));let x={get action(){return p},get location(){return t(u,f)},listen(t){if(m)throw new Error("A history only accepts one active listener");return u.addEventListener(o,y),m=t,()=>{u.removeEventListener(o,y),m=null}},createHref:t=>e(u,t),createURL:b,encodeLocation(t){let e=b(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){p=i.Push;let r=c(x.location,t,e);n&&n(r,t),g=v()+1;let o=l(r,g),a=x.createHref(r);try{f.pushState(o,"",a)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;u.location.assign(a)}d&&m&&m({action:p,location:x.location,delta:1})},replace:function(t,e){p=i.Replace;let r=c(x.location,t,e);n&&n(r,t),g=v();let o=l(r,g),a=x.createHref(r);f.replaceState(o,"",a),d&&m&&m({action:p,location:x.location,delta:0})},go:t=>f.go(t)};return x}var p;!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(p||(p={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function m(t,e,n){void 0===n&&(n="/");let r=k(("string"==typeof e?d(e):e).pathname||"/",n);if(null==r)return null;let i=g(t);!function(t){t.sort(((t,e)=>t.score!==e.score?e.score-t.score:function(t,e){let n=t.length===e.length&&t.slice(0,-1).every(((t,n)=>t===e[n]));return n?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(i);let o=null;for(let t=0;null==o&&t{let a={relativePath:void 0===o?t.path||"":o,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};a.relativePath.startsWith("/")&&(s(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let u=L([r,a.relativePath]),l=n.concat(a);t.children&&t.children.length>0&&(s(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+u+'".'),g(t.children,e,l,u)),(null!=t.path||t.index)&&e.push({path:u,score:M(u,t.index),routesMeta:l})};return t.forEach(((t,e)=>{var n;if(""!==t.path&&null!=(n=t.path)&&n.includes("?"))for(let n of v(t.path))i(t,e,n);else i(t,e)})),e}function v(t){let e=t.split("/");if(0===e.length)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=v(r.join("/")),s=[];return s.push(...a.map((t=>""===t?o:[o,t].join("/")))),i&&s.push(...a),s.map((e=>t.startsWith("/")&&""===e?"/":e))}const y=/^:[\w-]+$/,b=3,x=2,w=1,_=10,S=-2,E=t=>"*"===t;function M(t,e){let n=t.split("/"),r=n.length;return n.some(E)&&(r+=S),e&&(r+=x),n.filter((t=>!E(t))).reduce(((t,e)=>t+(y.test(e)?b:""===e?w:_)),r)}function A(t,e){let{routesMeta:n}=t,r={},i="/",o=[];for(let t=0;t(r.push({paramName:e,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));t.endsWith("*")?(r.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))");let o=new RegExp(i,e?void 0:"i");return[o,r]}(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce(((t,e,n)=>{let{paramName:r,isOptional:i}=e;if("*"===r){let t=s[n]||"";a=o.slice(0,o.length-t.length).replace(/(.)\/+$/,"$1")}const u=s[n];return t[r]=i&&!u?void 0:(u||"").replace(/%2F/g,"/"),t}),{}),pathname:o,pathnameBase:a,pattern:t}}function T(t){try{return t.split("/").map((t=>decodeURIComponent(t).replace(/\//g,"%2F"))).join("/")}catch(e){return u(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+e+")."),t}}function k(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&"/"!==r?null:t.slice(n)||"/"}function I(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function N(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}function P(t,e){let n=N(t);return e?n.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)):n.map((t=>t.pathnameBase))}function O(t,e,n,i){let o;void 0===i&&(i=!1),"string"==typeof t?o=d(t):(o=r({},t),s(!o.pathname||!o.pathname.includes("?"),I("?","pathname","search",o)),s(!o.pathname||!o.pathname.includes("#"),I("#","pathname","hash",o)),s(!o.search||!o.search.includes("#"),I("#","search","hash",o)));let a,u=""===t||""===o.pathname,l=u?"/":o.pathname;if(null==l)a=n;else{let t=e.length-1;if(!i&&l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t-=1;o.pathname=e.join("/")}a=t>=0?e[t]:"/"}let c=function(t,e){void 0===e&&(e="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof t?d(t):t,o=n?n.startsWith("/")?n:function(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?n.length>1&&n.pop():"."!==t&&n.push(t)})),n.length>1?n.join("/"):"/"}(n,e):e;return{pathname:o,search:D(r),hash:z(i)}}(o,a),h=l&&"/"!==l&&l.endsWith("/"),f=(u||"."===l)&&n.endsWith("/");return c.pathname.endsWith("/")||!h&&!f||(c.pathname+="/"),c}const L=t=>t.join("/").replace(/\/\/+/g,"/"),R=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),D=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",z=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";class F extends Error{}function B(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}const U=["post","put","patch","delete"],j=(new Set(U),["get",...U]);new Set(j),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred")},67466:(t,e,n)=>{"use strict";n.d(e,{addImpl:()=>m,bincountImpl:()=>v,bincountReduceImpl:()=>y,bitwiseAndImpl:()=>b,castImpl:()=>h,ceilImpl:()=>S,concatImpl:()=>E,equalImpl:()=>M,expImpl:()=>A,expm1Impl:()=>C,floorDivImpl:()=>k,floorImpl:()=>T,gatherNdImpl:()=>I,gatherV2Impl:()=>N,greaterEqualImpl:()=>O,greaterImpl:()=>P,lessEqualImpl:()=>R,lessImpl:()=>L,linSpaceImpl:()=>D,logImpl:()=>z,maxImpl:()=>F,maximumImpl:()=>B,minimumImpl:()=>U,multiplyImpl:()=>j,negImpl:()=>H,notEqualImpl:()=>G,prodImpl:()=>X,raggedGatherImpl:()=>K,raggedRangeImpl:()=>Q,raggedTensorToTensorImpl:()=>rt,rangeImpl:()=>it,rsqrtImpl:()=>ot,scatterImpl:()=>at,sigmoidImpl:()=>st,simpleAbsImpl:()=>o,sliceImpl:()=>ut,sparseFillEmptyRowsImpl:()=>lt,sparseReshapeImpl:()=>ct,sparseSegmentReductionImpl:()=>ht,sqrtImpl:()=>dt,staticRegexReplaceImpl:()=>ft,stridedSliceImpl:()=>pt,stringNGramsImpl:()=>gt,stringSplitImpl:()=>yt,stringToHashBucketFastImpl:()=>bt,subImpl:()=>xt,tileImpl:()=>_t,topKImpl:()=>Mt,transposeImpl:()=>W,uniqueImpl:()=>At});var r=n(86748); +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function i(t,e){Array.isArray(t)||(t=[t]),t.forEach((t=>{null!=t&&r.util.assert("complex64"!==t.dtype,(()=>`${e} does not support complex64 tensors in the CPU backend.`))}))} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function o(t){const e=new Float32Array(t.length);for(let n=0;n{const s=r.backend_util.assertAndGetBroadcastShape(e,n),u=s.length,l=r.util.computeStrides(s),c=r.util.sizeFromShape(s),h=r.util.getTypedArrayFromDType(a,c),d=e.length,f=n.length,p=r.util.computeStrides(e),m=r.util.computeStrides(n),g=r.backend_util.getBroadcastDims(e,s),v=r.backend_util.getBroadcastDims(n,s);if(g.length+v.length===0)for(let e=0;ea[t]=0));const s=r.util.locToIndex(a,d,p),c=n.slice(-f);v.forEach((t=>c[t]=0));const y=r.util.locToIndex(c,f,m);h[e]=t(i[s],o[y])}return[h,s]}} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function s(t){const{inputs:e,backend:n}=t,{real:r,imag:i}=e,o=n.data.get(r.dataId).values,a=n.data.get(i.dataId).values,s=n.makeTensorInfo(r.shape,"complex64");return n.data.get(s.dataId).complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",o),imag:n.makeTensorInfo(i.shape,"float32",a)},s}r.Complex; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function u(t,e,n="float32"){if("complex64"===n){return s({inputs:{real:u(t,e,"float32"),imag:u(t,e,"float32")},backend:t})}const i=r.util.makeZerosTypedArray(r.util.sizeFromShape(e),n);return t.makeTensorInfo(e,n,i)} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function l(t){const{inputs:e,backend:n}=t,{x:r}=e;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}r.Identity; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function c(t){const{inputs:e,backend:n}=t,{input:r}=e,i=n.data.get(r.dataId).complexTensorInfos.real,o=n.data.get(i.dataId).values;return n.makeTensorInfo(i.shape,i.dtype,o)}r.Real; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function h(t,e,n,i){if("int32"===i){return[e,"int32",Int32Array.from(t)]}if("bool"===i){const i=r.util.toTypedArray([0],n),[o,s]=a(((t,e)=>t!==e?1:0))(e,[],t,i,"bool");return[s,"bool",o]}throw new Error(`Error in Cast: failed to cast ${n} to ${i}`)}function d(t){const{inputs:e,backend:n,attrs:i}=t,{x:o}=e,{dtype:a}=i;if("complex64"===a){if("complex64"===o.dtype)return l({inputs:{x:o},backend:n});const t=u(n,o.shape,o.dtype),e=d({inputs:{x:o},backend:n,attrs:{dtype:"float32"}}),r=s({inputs:{real:e,imag:t},backend:n});return n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(e),r}if("complex64"===o.dtype){const t=c({inputs:{input:o},backend:n}),e=d({inputs:{x:t},backend:n,attrs:{dtype:a}});return n.disposeIntermediateTensorInfo(t),e}if(!r.util.hasEncodingLoss(o.dtype,a)){const t=l({inputs:{x:o},backend:n});return{dataId:t.dataId,shape:t.shape,dtype:a}}const f=n.data.get(o.dataId).values,[p,m,g]=h(f,o.shape,o.dtype,a);return n.makeTensorInfo(p,m,g)}r.Cast; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function f(t,e,n,o){return null==n?({inputs:n,backend:a})=>{const{a:s,b:u}=n,l=a;i([s,u],t);const c=l.data.get(s.dataId).values,h=l.data.get(u.dataId).values,d="string"===s.dtype?r.backend_util.fromUint8ToStringArray(c):c,f="string"===s.dtype?r.backend_util.fromUint8ToStringArray(h):h,p=o||s.dtype,[m,g]=e(s.shape,u.shape,d,f,p);return l.makeTensorInfo(g,p,m)}:({inputs:t,backend:r})=>{const{a:i,b:a}=t,u=r;if("complex64"===i.dtype||"complex64"===a.dtype){const t=d({inputs:{x:i},backend:u,attrs:{dtype:"complex64"}}),e=u.data.get(t.dataId),r=e.complexTensorInfos.real,o=e.complexTensorInfos.imag,l=u.data.get(r.dataId).values,c=u.data.get(o.dataId).values,h=d({inputs:{x:a},backend:u,attrs:{dtype:"complex64"}}),f=u.data.get(h.dataId),p=f.complexTensorInfos.real,m=f.complexTensorInfos.imag,g=u.data.get(p.dataId).values,v=u.data.get(m.dataId).values,[y,b,x]=n(i.shape,a.shape,l,c,g,v),w=u.makeTensorInfo(x,"float32",y),_=u.makeTensorInfo(x,"float32",b),S=s({inputs:{real:w,imag:_},backend:u});return u.disposeIntermediateTensorInfo(t),u.disposeIntermediateTensorInfo(h),u.disposeIntermediateTensorInfo(w),u.disposeIntermediateTensorInfo(_),S}{const t=u.data.get(i.dataId).values,n=u.data.get(a.dataId).values,r=o||i.dtype,[s,l]=e(i.shape,a.shape,t,n,r);return u.makeTensorInfo(l,r,s)}}}function p(t){return(e,n,i,o,a,s)=>{const u=r.backend_util.assertAndGetBroadcastShape(e,n),l=r.util.sizeFromShape(u),c=u.length,h=r.util.computeStrides(u),d=r.util.getTypedArrayFromDType("float32",l),f=r.util.getTypedArrayFromDType("float32",l),p=r.backend_util.getBroadcastDims(e,u),m=r.backend_util.getBroadcastDims(n,u),g=r.backend_util.mergeRealAndImagArrays(i,o),v=r.backend_util.mergeRealAndImagArrays(a,s),y=e.length,b=r.util.computeStrides(e),x=n.length,w=r.util.computeStrides(n);if(p.length+m.length===0)for(let e=0;ei[t]=0));const o=r.util.locToIndex(i,y,b),a=n.slice(-x);m.forEach((t=>a[t]=0));const s=r.util.locToIndex(a,x,w),u=t(g[2*o],g[2*o+1],v[2*s],v[2*s+1]);d[e]=u.real,f[e]=u.imag}return[d,f,u]}} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const m=a(((t,e)=>t+e)),g=p(((t,e,n,r)=>({real:t+n,imag:e+r})));f(r.Add,m,g),r.Add; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function v(t,e,n,i,o){const a=r.util.sizeFromShape(i),s=r.util.makeZerosTypedArray(o,n);for(let n=0;n=o||(s[r]+=a>0?e[n]:1)}return s}function y(t,e,n,i=!1){const o=t.shape[0],a=t.shape[1],s=(0,r.buffer)([o,n],e.dtype);for(let r=0;r=n||(i?s.set(1,r,a):e.size>0?s.set(s.get(r,a)+e.get(r,o),r,a):s.set(s.get(r,a)+1,r,a))}return s} +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const b=a(((t,e)=>t&e));f(r.BitwiseAnd,b),r.BitwiseAnd; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function x(t){return(e,n,i)=>{const o=r.util.getArrayFromDType(n,e.length);for(let n=0;n{const{x:u}=o;i(u,t);const l=s,c=l.data.get(u.dataId).values;let h;if("string"===u.dtype){if(!Array.isArray(c))throw new Error("String tensor's value was not an instance of Array");h=r.backend_util.fromUint8ToStringArray(c)}else h=c;const d=n||u.dtype,f=e(h,d,a);return l.makeTensorInfo(u.shape,d,f)}} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const S=x((t=>Math.ceil(t)));_(r.Ceil,S),r.Ceil; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function E(t,e,n,i){const o=r.util.getArrayFromDType(n,r.util.sizeFromShape(e));if(i&&"string"!==n){let e=0;t.forEach((t=>{const n=r.util.sizeFromShape(t.shape);o.set(t.vals,e),e+=n}))}else{let i=0;t.forEach((t=>{const a="string"===n?r.backend_util.fromUint8ToStringArray(t.vals):t.vals;let s=0;for(let n=0;nt===e?1:0)),A=(f(r.Equal,M,null,"bool"),r.Equal,x((t=>Math.exp(t)))),C=(_(r.Exp,A,"float32"),r.Exp,x((t=>Math.expm1(t)))),T=(_(r.Expm1,C),r.Expm1,x((t=>Math.floor(t)))),k=(_(r.Floor,T),r.Floor,a(((t,e)=>Math.floor(t/e))));f(r.FloorDiv,k,null,"int32"),r.FloorDiv; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function I(t,e,n,i,o,a,s,u,l){const c=(0,r.buffer)([i,a],n);for(let n=0;n=l/a)throw new Error(`Invalid indices: ${r} does not index into ${u}`);for(let t=0;tt>e?1:0)),O=(f(r.Greater,P,null,"bool"),r.Greater,a(((t,e)=>t>=e?1:0))),L=(f(r.GreaterEqual,O,null,"bool"),r.GreaterEqual,a(((t,e)=>tt<=e?1:0)));f(r.LessEqual,R,null,"bool"),r.LessEqual; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function D(t,e,n){const i=(e-t)/(n-1),o=r.util.makeZerosTypedArray(n,"float32");o[0]=t;for(let t=1;tMath.log(t)));_(r.Log,z),r.Log; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function F(t,e,n,i){const o=r.util.getTypedArrayFromDType(i,r.util.sizeFromShape(n));for(let n=0;ni)&&(i=e)}o[n]=i}return o} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const B=a(((t,e)=>Math.max(t,e))),U=(f(r.Maximum,B),r.Maximum,a(((t,e)=>Math.min(t,e)))),j=(f(r.Minimum,U),r.Minimum,a(((t,e)=>t*e))),V=p(((t,e,n,r)=>({real:t*n-e*r,imag:t*r+e*n})));f(r.Multiply,j,V),r.Multiply; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function H(t,e,n){const i=r.util.createScalarValue(-1,n);return j([],e,i,t,n)}r.Neg;const G=a(((t,e)=>t!==e?1:0));f(r.NotEqual,G,null,"bool"),r.NotEqual; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function W(t,e,n,i,o){const a=e.length,s=r.util.sizeFromShape(e),u=r.util.computeStrides(e),l=r.util.computeStrides(o),c=r.util.getTypedArrayFromDType(n,r.util.sizeFromShape(o));for(let e=0;e[0]));!function(t,e){for(let n=0;ni)throw new Error("Ragged splits must not point past values");for(let t=1;tr[t])throw new Error("Ragged splits must be sorted in ascending order")}}(n,r);let u=1;for(let t=0;t=0){const t=s[i],e=t[t.length-1]-r[a];for(let t=a;t{if(t<0||t>=n){const o=r.util.indexToLoc(i,e.length,r.util.computeStrides(e)).join(",");throw new Error(`indices[${o}] = ${t} is not in [0, ${n})`)}}))}(a,s,e[0][0]-1),0===i.length)throw new Error("params.rank must be nonzero");const l=i[0],{outSplits:c,valueSlices:h,numValues:d}=Y(a,s,t,l),f=function(t){const e=[];for(let n=0;no[e]=t))}return e}(c),p=$(n,i,o,h,d);return[f,p[0],p[1]]} +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const Z=2147483647;function Q(t,e,n,i,o,a,s){if(e.length>1)throw new Error("starts must be a scalar or vector");if(o.length>1)throw new Error("limits must be a scalar or vector");if(s.length>1)throw new Error("deltas must be a scalar or vector");const u=0===e.length,l=0===o.length,c=0===s.length,h=[];u||h.push(e[0]),l||h.push(o[0]),c||h.push(s[0]);for(let t=1;t0&&rn)s=0;else if(s=Math.ceil(Math.abs((r-n)/o)),s>Z)throw new Error(`Requires ((limit - start) / delta) <= ${Z}`);f[e+1]=f[e]+s}const p=f[d],m=r.util.getArrayFromDType(n,p);let g=0;for(let e=0;en&&(n=e)}return n}static getMaxWidthValueRowID(t){const e=t.length;if(0===e)return 0;let n=0,r=t[0],i=0;for(let o=1;o"Final length of result must be equal to firstDimension.")),o}calculateOutputIndexRowSplit(t,e,n,r){const i=t.length,o=[];for(let a=0;a0&&o.length!==t[i-1])throw new Error("Invalid row split size.");return o}calculateOutputIndexValueRowID(t,e,n,r){const i=t.length,o=[];if(0===i)return[];let a=0,s=t[0];if(s>=e.length)throw new Error(`Got currentValueRowId=${s}, which is not less than ${e.length}`);let u=e[s];o.push(u);for(let l=1;l=0&&(++a,a=e.length)throw new Error(`Got nextValueRowId=${i} which is not less than ${e.length}`);u=e[i]}o.push(u)}if(o.length!==t.length)throw new Error("Invalid row ids.");return o}calculateOutputIndex(t,e,n,r){const i=this.getRowPartitionTensor(t),o=this.getRowPartitionTypeByDimension(t);switch(o){case J.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(i,e,n,r);case J.ROW_SPLITS:if(i.length-1>e.length)throw new Error(`Row partition size is greater than output size: ${i.length-1} > ${e.length}`);return this.calculateOutputIndexRowSplit(i,e,n,r);default:throw new Error(`Unsupported partition type: ${J[o]}`)}}getFirstDimensionSize(){const t=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw new Error("No row_partition_types given.");const e=this.rowPartitionTypes[0];switch(e){case J.FIRST_DIM_SIZE:return t[0];case J.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case J.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${J[e]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");const t=this.getFirstDimensionSize(),e=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let t=n.length-2;t>=0;--t)n[t]=n[t+1]*e[t+1];const i=nt(e,!1),o=r.util.getArrayFromDType(this.valuesDType,r.util.sizeFromShape(i));if(n[0]*e[0]>0){let r=this.calculateFirstParentOutputIndex(t,n[0],e[0]);for(let t=1;t<=this.raggedRank;++t){r=this.calculateOutputIndex(t-1,r,n[t],e[t])}this.setOutput(this.raggedRank,r,o,i)}return[i,o]}setOutput(t,e,n,i){if(0===n.length)return;const o=this.values,a=n;let s=i.slice();s=s.slice(t+1);const u=r.util.sizeFromShape(s),l=e.length;let c=this.defaultValue;if(c.length!==u&&1!==c.length){const t=this.defaultValueShape;(0,r.tidy)((()=>{const e=(0,r.reshape)(c,t),n=(0,r.broadcastTo)(e,s);c=n.dataSync()}))}let h=0,d=0,f=0;for(let t=0;t<=l;++t){let r=t=l){const t=n.length;r=Math.floor(t/u)}if(r>f)if(1===this.defaultValue.length)a.subarray(f*u,r*u).fill(this.defaultValue[0]),f=r;else for(;r>f;){et(a.slice(f*u),c,u),++f}r<0?(h=t+1,d=f):(h=t,d=f,f=d+1)}else++f}}}function et(t,e,n){for(let r=0;r= 0`);if(r<-1)throw new Error(`Dimension ${r} must be >= -1`);r=-1}n.push(r)}return n}function rt(t,e,n,r,i,o,a,s,u,l){return new tt(t,e,n,r,i,o,a,s,u,l).compute()} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function it(t,e,n,i){if(t===e||t1)return r.util.makeZerosTypedArray(0,i);const o=Math.abs(Math.ceil((e-t)/n)),a=r.util.makeZerosTypedArray(o,i);e1/Math.sqrt(t)));_(r.Rsqrt,ot),r.Rsqrt; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function at(t,e,n,i,o,a,s,u,l,c){const h=[i/o,o],d=t.values,f=e.values;if(0===i)return(0,r.buffer)(n,e.dtype);const p=l instanceof r.TensorBuffer?l:(0,r.buffer)(h,e.dtype);"string"==typeof l||"number"==typeof l?p.values.fill(l):"boolean"==typeof l&&p.values.fill(+l);for(let t=0;t=i/o)throw new Error(`Invalid indices: ${r} does not index into ${n}`);for(let n=0;n1/(1+Math.exp(-t))));w(r.Sigmoid,(t=>1/(1+Math.exp(-t)))),r.Sigmoid; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function ut(t,e,n,i,o){const a=r.slice_util.isSliceContinous(i,e,n),s=r.util.sizeFromShape(n),u=r.util.computeStrides(i);if(a){const n=r.slice_util.computeFlatOffset(e,u);return"string"===o?t.slice(n,n+s):t.subarray(n,n+s)}const l="string"===o?r.backend_util.fromUint8ToStringArray(t):t,c=(0,r.buffer)(i,o,l),h=(0,r.buffer)(n,o);for(let t=0;tt+e[n]));h.set(c.get(...r),...n)}return"string"===o?r.backend_util.fromStringArrayToUint8(h.values):h.values}r.Slice; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function lt(t,e,n,i,o,a,s){const u=e[0],l=a[0],c=new Array(l),h=new Array(u),d=e[1];if(0===l){if(0!==u)throw new Error(r.backend_util.getSparseFillEmptyRowsIndicesDenseShapeMismatch(u));return[r.util.getArrayFromDType(n,0),[0,d],r.util.getArrayFromDType(o,0),c,h]}let f=!0,p=0;const m=new Array(l).fill(0);for(let e=0;e=l)throw new Error(r.backend_util.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(e,n,l));++m[n],f=f&&n>=p,p=n}let g=!0;for(let t=0;t0&&(m[t]+=m[t-1])}if(g&&f){const e=t,n=i;for(let t=0;t0){f[d-1]=1;for(let t=d-2;t>=0;--t)f[t]=f[t+1]*i[t+1]}const p=[];if(u>0){p[u-1]=1;for(let t=u-2;t>=0;--t)p[t]=p[t+1]*l[t+1]}const m=r.util.getArrayFromDType(n,s*u);for(let e=0;e0?o[u-1]+1:0;if(h<0)throw new Error(r.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());const d=e.slice();d[0]=h;const f=d.reduce(((t,e)=>t*e),1),p=r.util.getArrayFromDType(n,f);if(0===u)return h>0&&p.fill(s),[p,d];if(h<=0)throw new Error(r.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=0,g=1,v=0,y=o[m];for(;;){let e=0;if(g=e)throw new Error(r.backend_util.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(y<0||y>=h)throw new Error(r.backend_util.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(y,h));y>v&&p.fill(s,v*c,y*c);for(let e=m;e=l[0])throw new Error(r.backend_util.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(e,i[e],l[0]));for(let e=0;eu)break}return vMath.sqrt(t))),ft=(w(r.Sqrt,(t=>Math.sqrt(t))),r.Sqrt,x(((t,e)=>{const{pattern:n,replaceGlobal:r,rewrite:i}=e;return t.replace(new RegExp(n,r?"g":""),i)})));_(r.StaticRegexReplace,ft),r.StaticRegexReplace; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function pt(t,e,n,i){const o=(0,r.buffer)(t,e.dtype);for(let t=0;t0?0:a-s);let d=0;d+=u*this.leftPad.length;for(let e=0;et.forEach((t=>f[p++]=t));for(let t=0;t0){m(t[h+c-1]);for(let t=0;t0){let t=e[0];if(0!==t)throw new Error(`First split value must be 0, got ${t}`);for(let r=1;r=t;if(i=i&&e[r]<=n,!i)throw new Error(`Invalid split value ${e[r]}, must be in [${t}, ${n}]`);t=e[r]}if(t!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${t}`)}const o=i-1,a=r.util.getArrayFromDType("int32",i);if(0===n||0===i){const t=new Array(n);for(let t=0;t<=o;++t)a[t]=0;return[t,a]}a[0]=0;for(let t=1;t<=o;++t){const n=e[t]-e[t-1];let r=0;this.nGramWidths.forEach((t=>{r+=this.getNumNGrams(n,t)})),this.preserveShort&&n>0&&0===r&&(r=1),a[t]=a[t-1]+r}const s=new Array(a[o]);for(let n=0;n{const a=e[n+1]-e[n],u=this.getNumNGrams(a,o);this.createNGrams(t,r,s,i,u,o),i+=u})),this.preserveShort&&i===a[n]){const o=e[n+1]-e[n];if(0===o)continue;const a=o+2*this.padWidth,u=1;this.createNGrams(t,r,s,i,u,a)}}return[s,a]}}function gt(t,e,n,r,i,o,a,s){return new mt(n,r,i,o,a,s).compute(t,e)} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function vt(t,e,n,r){if(!t.length)return;if(0===e.length){for(let e=0;et-e)),wt=p(((t,e,n,r)=>({real:t-n,imag:e-r})));f(r.Sub,xt,wt),r.Sub; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function _t(t,e){const n=new Array(t.rank);for(let r=0;r{const n=e.value-t.value;return 0===n?t.index-e.index:n};function Et(t,e,n=0,i=t.length-1){for(;i>n;){if(i-n>600){const r=i-n+1,o=e-n+1,a=Math.log(r),s=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*s*(r-s)/r)*Math.sign(o-r/2);Et(t,e,Math.max(n,Math.floor(e-o*s/r+u)),Math.min(i,Math.floor(e+(r-o)*s/r+u)))}const o=t[e];let a=n,s=i;for(r.util.swap(t,n,e),St(t[i],o)>0&&r.util.swap(t,n,i);a0;)s-=1}0===St(t[n],o)?r.util.swap(t,n,s):(s+=1,r.util.swap(t,s,i)),s<=e&&(n=s+1),e<=s&&(i=s-1)}}function Mt(t,e,n,i,o){const a=e[e.length-1],[s,u]=[t.length/a,a],l=r.util.getTypedArrayFromDType(n,s*i),c=r.util.getTypedArrayFromDType("int32",s*i);for(let e=0;ea[e]={value:t,index:e})),i{for(let n=0;n{"use strict";n.d(e,{l:()=>U,w:()=>r});var r={};n.r(r),n.d(r,{GPUBytesPerElement:()=>R,MatMulProgramType:()=>F,assertNotComplex:()=>z,computeDispatch:()=>I,computeWorkPerThreadForConv2d:()=>O,computeWorkgroupInfoForMatMul:()=>N,computeWorkgroupSizeForConv2d:()=>P,flatDispatchLayout:()=>L,isWebGPUSupported:()=>D,tilesFitEvenlyIntoShape:()=>k});var i=n(86748); +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const o=(0,i.env)();o.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE",(()=>15)),o.registerFlag("WEBGPU_CPU_FORWARD",(()=>!0)),o.registerFlag("WEBGPU_MATMUL_PROGRAM_TYPE",(()=>-1)),o.registerFlag("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE",(()=>!0)),o.registerFlag("WEBGPU_USE_LOW_POWER_GPU",(()=>!1)),o.registerFlag("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e3)),o.registerFlag("WEBGPU_USE_PROFILE_TOOL",(()=>!1)),o.registerFlag("WEBGPU_IMPORT_EXTERNAL_TEXTURE",(()=>!0)),o.registerFlag("WEBGPU_USE_NAIVE_CONV2D_DEBUG",(()=>!1)),o.registerFlag("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL",(()=>-1)),o.registerFlag("WEBGPU_CONV_SEPARATE_IM2COL_SHADER",(()=>!1)),o.registerFlag("WEBGPU_PRINT_SHADER",(()=>"")),o.registerFlag("WEBGPU_ENGINE_COMPILE_ONLY",(()=>!1)); +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class a{constructor(t){t&&(this.vendor=t.vendor,this.architecture=t.architecture,this.intelGPUGeneration=this.getIntelGPUGeneration())}getIntelGPUGeneration(){if(this.isIntel()){if(this.architecture.startsWith("gen"))return Number(this.architecture.match(/\d+/));if(this.architecture.startsWith("xe"))return 12}return 0}isIntel(){return"intel"===this.vendor}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class s{constructor(t){this.device=t,this.numUsedBuffers=0,this.numFreeBuffers=0,this.freeBuffers=new Map,this.usedBuffers=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireBuffer(t,e,n=!1,r=!0){let i;const o=u(t,e);return r?(this.freeBuffers.has(o)||this.freeBuffers.set(o,[]),this.freeBuffers.get(o).length>0?(i=this.freeBuffers.get(o).pop(),this.numFreeBuffers--):(i=this.device.createBuffer({size:t,usage:e,mappedAtCreation:n}),this.numBytesAllocated+=t)):(i=this.device.createBuffer({size:t,usage:e,mappedAtCreation:n}),this.numBytesAllocated+=t),this.usedBuffers.has(o)||this.usedBuffers.set(o,[]),this.usedBuffers.get(o).push(i),this.numUsedBuffers++,this.numBytesUsed+=t,i}releaseBuffer(t,e=!0){if(0===this.freeBuffers.size)return;const n=t.size,r=u(n,t.usage),i=this.usedBuffers.get(r),o=i.indexOf(t);if(o<0)throw new Error("Cannot find the buffer in buffer manager");i[o]=i[i.length-1],i.pop(),this.numUsedBuffers--,this.numBytesUsed-=n,e?(this.freeBuffers.get(r).push(t),this.numFreeBuffers++):(t.destroy(),this.numBytesAllocated-=n)}getNumUsedBuffers(){return this.numUsedBuffers}getNumFreeBuffers(){return this.numFreeBuffers}dispose(){this.freeBuffers.forEach(((t,e)=>{t.forEach((t=>{t.destroy()}))})),this.usedBuffers.forEach(((t,e)=>{t.forEach((t=>{t.destroy()}))})),this.freeBuffers=new Map,this.usedBuffers=new Map,this.numUsedBuffers=0,this.numFreeBuffers=0,this.numBytesUsed=0,this.numBytesAllocated=0}}function u(t,e){return`${t}_${e}`} +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class l{constructor(t){this.device=t,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures=new Map,this.usedTextures=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireTexture(t,e,n,r){const i=t*e*h(n),o=c(t,e,n,r);if(this.freeTextures.has(o)||this.freeTextures.set(o,[]),this.usedTextures.has(o)||this.usedTextures.set(o,[]),this.numBytesUsed+=i,this.numUsedTextures++,this.freeTextures.get(o).length>0){this.numFreeTextures--;const t=this.freeTextures.get(o).shift();return this.usedTextures.get(o).push(t),t}this.numBytesAllocated+=i;const a=this.device.createTexture({size:[t,e],format:n,usage:r});return this.usedTextures.get(o).push(a),a}releaseTexture(t){if(0===this.freeTextures.size)return;const e=t.width,n=t.height,r=t.format,i=c(e,n,r,t.usage);this.freeTextures.has(i)||this.freeTextures.set(i,[]),this.freeTextures.get(i).push(t),this.numFreeTextures++,this.numUsedTextures--;const o=this.usedTextures.get(i),a=o.indexOf(t);if(a<0)throw new Error("Cannot release a texture that was never provided by this texture manager");o.splice(a,1);const s=e*n*h(r);this.numBytesUsed-=s}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){this.freeTextures.forEach(((t,e)=>{t.forEach((t=>{t.destroy()}))})),this.usedTextures.forEach(((t,e)=>{t.forEach((t=>{t.destroy()}))})),this.freeTextures=new Map,this.usedTextures=new Map,this.numUsedTextures=0,this.numFreeTextures=0,this.numBytesUsed=0,this.numBytesAllocated=0}}function c(t,e,n,r){return`${t}_${e}_${n}_${r}`}function h(t){if("rgba8unorm"===t)return 16;throw new Error(`${t} is not supported!`)} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function d(t,e){if(Math.max(...t)>5)throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");const n=t.length,r=t.map((t=>`${e}.${"xyzwuv"[t]}`)),i=new Array(n-1);i[n-2]=r[n-1];for(let t=n-3;t>=0;--t)i[t]=`(${i[t+1]} * ${r[t+1]})`;return i}const f=(t,e,n)=>"int32"===n?`atomicAdd(${t}, bitcast(${e}));`:`\n {\n var oldValue = 0;\n loop {\n let newValueF32 = bitcast(oldValue) + (${e});\n let newValue = bitcast(newValueF32);\n let res = atomicCompareExchangeWeak(${t}, oldValue, newValue);\n if res.exchanged {\n break;\n }\n oldValue = res.old_value;\n }\n }`; +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +var p;!function(t){t[t.FROM_PIXELS=0]="FROM_PIXELS",t[t.DRAW=1]="DRAW"}(p||(p={}));const m=(t,e,n,r,o)=>{const a=function(t,e,n){const r=[],o=n.workgroupSize[0]*n.workgroupSize[1]*n.workgroupSize[2];if(n.outputComponent=n.outputComponent?n.outputComponent:1,r.push(`\n\n var localId: vec3;\n var localIndex: u32;\n var globalId: vec3;\n var numWorkgroups: vec3;\n var workgroupId: vec3;\n\n // Only used when the y/z dimension of workgroup size is 1.\n fn getGlobalIndex() -> i32 {\n ${M(n)?" return i32(globalId.x);":` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y +\n workgroupId.y * numWorkgroups.x + workgroupId.x) * ${o}u +\n localIndex);\n `}\n }\n `),null!=n.pixelsOpType){const i=n.pixelsOpType===p.FROM_PIXELS?`@group(0) @binding(0) var result: array<${A(e.dtype,n.outputComponent)}>;`:`@group(0) @binding(1) var inBuf : array<${A(t[0].dtype,n.outputComponent)}>;`,o=3===e.shape.length?"vec2":"i32";r.push(`\n struct Uniform {\n outShapeStrides : ${o},\n size : i32,\n numChannels : i32,\n alpha : f32,\n };\n\n ${i}\n @group(0) @binding(2) var uniforms: Uniform;\n `);const a=C(n);return[w,r.join("\n"),S(e.shape),n.getUserCode(),x(a,n)].join("\n")}let a,s,u="struct Uniforms { NAN : f32, INFINITY : f32, ";n.variableNames.forEach(((e,n)=>{const r=v(t[n].shape.length);u+=`${e.charAt(0).toLowerCase()+e.slice(1)}Shape : ${r}, `,a=t[n].shape.length-1,s=v(a),u+=`${e.charAt(0).toLowerCase()+e.slice(1)}ShapeStrides: ${s}, `}));const l=v(e.shape.length);u+=`outShape : ${l}, `,a=e.shape.length-1,s=v(a),u+=`\n outShapeStrides: ${s}, `,n.size&&(u+="size : i32, ");n.uniforms&&(u+=n.uniforms);u+="};",u=function(t){const e=/(\w+)\s*:\s*vec(5|6)/g;t=t.replace(e,(t=>"@align(16) "+t));const n=/vec(5|6)\s*,\s*(\w+)/g;return t=t.replace(n,((t,e,n)=>`vec${e}, @align(16) ${n}`))}(u),r.push(u),n.atomic?r.push("\n @group(0) @binding(0) var result: array>;\n "):r.push(`\n @group(0) @binding(0) var result: array<${A(e.dtype,n.outputComponent)}>;\n `);n.variableNames.forEach(((e,i)=>{r.push(`\n @group(0) @binding(${1+i}) var ${e}: array<${n.variableComponents?A(t[i].dtype,n.variableComponents[i]):A(t[i].dtype,n.outputComponent)}>;\n `)})),""!==u&&r.push(`\n @group(0) @binding(${1+n.variableNames.length}) var uniforms: Uniforms;\n `);const c=function(t,e){const{x:n,y:r=[],z:i=[]}=e,o=t.length,a=n.length+r.length+i.length;if(a!==o)return"";if(n.length===o){return`fn getOutputCoords() -> ${v(o)}{\n let globalIndex = getGlobalIndex();\n return getCoordsFromIndex(globalIndex);\n }\n `}let s="";const u=[n,r,i];for(let t=0;t ${c} {\n ${s}\n`;0===l.length?h+=`return ${c}(0); }`:h+=`return ${c}(${l.join(",")}); }`;return h}(e.shape,n.dispatchLayout),h=[w,r.join("\n")+_,S(e.shape),c,E(e.shape.length)];n.atomic||h.push(function(t,e,n){const r=t.length,i=A(e,n);let o=`fn setOutputAtIndex(flatIndex : i32, value : ${g(n)}) {\n result[flatIndex] = ${i}(value);\n }\n\n fn setOutputAtIndexI32(flatIndex : i32, value : ${g(n,"i32")}) {\n result[flatIndex] = ${i}(value);\n }\n `;if(r>=2){const t=["d0","d1","d2","d3","d4","d5"].slice(0,r),e=v(r);o+=`\n fn setOutputAtCoords(${t.map((t=>`${t} : i32`)).join(", ")}, value : ${g(n)}) {\n let flatIndex = getOutputIndexFromCoords(${e}(${t.join(", ")}));\n setOutputAtIndex(flatIndex${1===n?"":` / ${n}`}, value);\n }\n fn setOutputAtCoordsI32(${t.map((t=>`${t} : i32`)).join(", ")}, value : ${g(n,"i32")}) {\n let flatIndex = getOutputIndexFromCoords(${e}(${t.join(", ")}));\n setOutputAtIndexI32(flatIndex${1===n?"":` / ${n}`}, value);\n }\n `}return o}(e.shape,e.dtype,n.outputComponent));n.variableNames.forEach(((e,n)=>{h.push(`${S(t[n].shape,e)}`)}));const f=t.map(((t,r)=>function(t,e,n,r){let o=function(t,e){const n=t.name,r=t.shape.length,i=v(r),o="get"+n.charAt(0).toUpperCase()+n.slice(1),a=["d0","d1","d2","d3","d4","d5"].slice(0,r),s=a.map((t=>`${t} : i32`)).join(", ");if(r<1)return`\n fn ${o}() -> ${g(e)} {\n return ${g(e)}(${n}[0]);\n }\n `;const u=`uniforms.${n.charAt(0).toLowerCase()+n.slice(1)}Shape`;let l=`${r}D`;0===r&&(l="1D");return`\n fn ${o}(${s}) -> ${g(e)} {\n return ${g(e)}(${n}[getIndexFromCoords${l}(${i}(${a.join(",")}),\n ${u})${1===e?"":` / ${e}`}]);\n }\n `}(t,n);const a=t.shape;a.length<=e.length&&(o+=function(t,e,n,r){const o=t.name,a=o.charAt(0).toUpperCase()+o.slice(1),s="get"+a+"ByOutput",u=t.shape.length,l=e.length,c=v(l);if(i.util.arraysEqual(t.shape,e)&&r)return`\n fn ${s}Index(globalIndex : i32) -> ${g(n)} {\n return ${g(n)}(${o}[globalIndex]);\n }\n\n fn ${s}Coords(coords : ${c}) -> ${g(n)} {\n return ${g(n)}(${o}[${l>1?"getOutputIndexFromCoords(coords)":"coords"}${1===n?"":` / ${n}`}]);\n }\n `;const h=i.backend_util.getBroadcastDims(t.shape,e),d=l-u;let f="";if(0===u)return`\n fn ${s}Index(globalIndex : i32) -> ${g(n)}{\n return get${a}();\n }\n\n fn ${s}Coords(coords : ${c}) -> ${g(n)}{\n return get${a}();\n }\n `;f=l<2&&h.length>=1?"coords = 0;":h.map((t=>`coords.${y(t+d)} = 0;`)).join("\n");let p="";if(l<2&&u>0)p="coords";else if(l>1){const e=v(u),n=t.shape.map(((t,e)=>`coords.${y(e+d)}`)).join(", ");p=`${e}(${n})`}else p="coords";const m=`uniforms.${o.charAt(0).toLowerCase()+o.slice(1)}Shape`,b=`${u}D`;return`\n fn ${s}Index(globalIndex : i32) -> ${g(n)} {\n var coords = getCoordsFromIndex(globalIndex);\n ${f}\n return ${g(n)}(${o}[getIndexFromCoords${b}(${p}, ${m})${1===n?"":` / ${n}`}]);\n }\n\n fn ${s}Coords(coordsIn : ${c}) -> ${g(n)} {\n var coords = coordsIn;\n ${f}\n return ${g(n)}(${o}[getIndexFromCoords${b}(${p}, ${m})${1===n?"":` / ${n}`}]);\n }\n`}(t,e,n,r));return o}(t,e.shape,n.variableComponents?n.variableComponents[r]:n.outputComponent,n.dispatchLayout.x.length===e.shape.length))).join("\n");h.push(f),h.push(n.getUserCode());const m=C(n);h.push(x(m,n));const b=h.join("\n");return b}(n,{dtype:r.dtype,shape:r.shape},e),s=t.createShaderModule({code:a,label:e.constructor.name});let u=(0,i.env)().get("WEBGPU_PRINT_SHADER");if(""!==u){u=u.toLowerCase();const t=u.split(",");("all"===u||t.some((t=>e.shaderKey.toLowerCase().includes(t))))&&(console.group(e.shaderKey),console.debug(a),console.groupEnd())}return o?t.createComputePipelineAsync({compute:{module:s,entryPoint:"_start"},label:e.constructor.name,layout:"auto"}):t.createComputePipeline({compute:{module:s,entryPoint:"_start"},label:e.constructor.name,layout:"auto"})},g=(t,e="f32")=>{switch(t){case 1:return`${e}`;case 2:return`vec2<${e}>`;case 3:return`vec3<${e}>`;case 4:return`vec4<${e}>`;default:throw new Error(`${t}-component ${e} is not supported.`)}};function v(t){if(t<=1)return"i32";if(2===t)return"vec2";if(3===t)return"vec3";if(4===t)return"vec4";if(5===t)return"vec5";if(6===t)return"vec6";throw Error(`GPU for rank ${t} is not yet supported`)}function y(t){if(0===t)return"x";if(1===t)return"y";if(2===t)return"z";if(3===t)return"w";if(4===t)return"u";if(5===t)return"v";throw Error(`Index ${t} is not yet supported`)}function b(...t){let e;switch(t.length){case 0:e="\n fn main()\n ";break;case 1:e=`\n fn main(${t[0]} : i32)\n `;break;default:throw Error("Unreachable")}return e}function x(t,e){let n;return n=`\n ${function(t){return`\n @compute @workgroup_size(${t.workgroupSize[0]}, ${t.workgroupSize[1]}, ${t.workgroupSize[2]})\n`}(e)}\n fn _start(@builtin(local_invocation_id) LocalId : vec3,\n @builtin(global_invocation_id) GlobalId : vec3,\n @builtin(local_invocation_index) LocalIndex: u32,\n @builtin(workgroup_id) WorkgroupId : vec3,\n @builtin(num_workgroups) NumWorkgroups : vec3) {\n localId = LocalId;\n localIndex = LocalIndex;\n globalId = GlobalId;\n numWorkgroups = NumWorkgroups;\n workgroupId = WorkgroupId;\n ${t?"main(getGlobalIndex());":"main();"};\n }\n `,n}const w="\n struct vec5 {x: i32, y: i32, z: i32, w: i32, u: i32};\n struct vec6 {x: i32, y: i32, z: i32, w: i32, u: i32, v: i32};\n\n // Checks whether coordinates lie within the bounds of the shape.\n fn coordsInBounds2D(coord : vec2, shape : vec2) -> bool {\n return all(coord >= vec2(0)) && all(coord < shape);\n }\n fn coordsInBounds3D(coord : vec3, shape : vec3) -> bool {\n return all(coord >= vec3(0)) && all(coord < shape);\n }\n fn coordsInBounds4D(coord : vec4, shape : vec4) -> bool {\n return all(coord >= vec4(0)) && all(coord < shape);\n }\n\n fn getIndexFromCoords1D(coord : i32, shape : i32) -> i32 {\n return coord;\n }\n fn getIndexFromCoords2D(coords : vec2, shape : vec2) -> i32 {\n return dot(coords, vec2(shape.y, 1));\n }\n fn getIndexFromCoords3D(coords : vec3, shape : vec3) -> i32 {\n return dot(coords, vec3(shape.y * shape.z, shape.z, 1));\n }\n fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 {\n return dot(coords, vec4(\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\n }\n fn getIndexFromCoords5D(coords : vec5, shape : vec5) -> i32 {\n let shapeStrides: vec5 = vec5(shape.y * shape.z * shape.w * shape.u, shape.z * shape.w * shape.u, shape.w * shape.u, shape.u, 1);\n return coords.x*shapeStrides.x + coords.y*shapeStrides.y + coords.z*shapeStrides.z + coords.w*shapeStrides.w + coords.u*shapeStrides.u;\n }\n fn getIndexFromCoords6D(coords : vec6, shape : vec6) -> i32 {\n let shapeStrides: vec6 = vec6(shape.y * shape.z * shape.w * shape.u * shape.v, shape.z * shape.w * shape.u * shape.v, shape.w * shape.u * shape.v, shape.u * shape.v, shape.v, 1);\n return coords.x*shapeStrides.x + coords.y*shapeStrides.y + coords.z*shapeStrides.z + coords.w*shapeStrides.w + coords.u*shapeStrides.u + coords.v*shapeStrides.v;\n }\n\n // NaN defination in IEEE 754-1985 is :\n // - sign = either 0 or 1.\n // - biased exponent = all 1 bits.\n // - fraction = anything except all 0 bits (since all 0 bits represents infinity).\n // https://en.wikipedia.org/wiki/IEEE_754-1985#Representation_of_non-numbers\n fn isnan(val: f32) -> bool {\n let floatToUint: u32 = bitcast(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n fn isnanVec4(val : vec4) -> vec4 {\n let floatToUint: vec4 = bitcast>(val);\n return (floatToUint & vec4(0x7fffffffu)) > vec4(0x7f800000u);\n }\n",_="\n fn isinf(val: f32) -> bool {\n return abs(val) == uniforms.INFINITY;\n }\n";function S(t,e=""){const n=t.length,r=""!==e?`get${e.charAt(0).toUpperCase()+e.slice(1)}CoordsFromIndex`:"getCoordsFromIndex",o=""!==e?`${e.charAt(0).toLowerCase()+e.slice(1)}ShapeStrides`:"outShapeStrides";if(n<=1)return`fn ${r}(index : i32) -> i32 { return index; }`;const a=i.util.computeStrides(t),s=v(n),u=[];for(let t=0;t vec2 {\n let d0 = index / uniforms.${o}; let d1 = index - d0 * uniforms.${o};\n return vec2(d0, d1);\n }`;let l;return l="var index2 = index;"+a.map(((t,e)=>`${`let ${u[e]} = index2 / uniforms.${o}.${y(e)}`}; ${e===a.length-1?`let ${u[e+1]} = index2 - ${u[e]} * uniforms.${o}.${y(e)}`:`index2 = index2 - ${u[e]} * uniforms.${o}.${y(e)}`};`)).join(""),`\n fn ${r}(index : i32) -> ${s} {\n ${l}\n return ${s}(${u.join(",")});\n }\n `}function E(t){let e="";switch(t){case 0:case 1:e+="\n fn getOutputIndexFromCoords(coords : i32) -> i32 {\n return coords;\n }\n ";break;case 2:e+="\n fn getOutputIndexFromCoords(coords : vec2) -> i32 {\n return dot(coords, vec2(uniforms.outShapeStrides, 1));\n }\n ";break;case 3:e+="\n fn getOutputIndexFromCoords(coords : vec3) -> i32 {\n return dot(coords, vec3(uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, 1));\n }\n ";break;case 4:e+="\n fn getOutputIndexFromCoords(coords : vec4) -> i32 {\n return dot(coords, vec4(\n uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, uniforms.outShapeStrides.z, 1));\n }\n ";break;case 5:e+="\n fn getOutputIndexFromCoords(coords : vec5) -> i32 {\n return coords.x * uniforms.outShapeStrides.x +\n coords.y * uniforms.outShapeStrides.y +\n coords.z * uniforms.outShapeStrides.z +\n coords.w * uniforms.outShapeStrides.w +\n coords.u;\n }\n ";break;case 6:e+="\n fn getOutputIndexFromCoords(coords : vec6) -> i32 {\n return coords.x * uniforms.outShapeStrides.x +\n coords.y * uniforms.outShapeStrides.y +\n coords.z * uniforms.outShapeStrides.z +\n coords.w * uniforms.outShapeStrides.w +\n coords.u * uniforms.outShapeStrides.u +\n coords.v;\n }\n ";break;default:i.util.assert(!1,(()=>`Unsupported ${t}D shape`))}return e}function M(t){return 1===t.dispatch[1]&&1===t.dispatch[2]}function A(t,e=1){if("float32"===t)return g(e,"f32");if("int32"===t||"bool"===t)return g(e,"i32");throw new Error(`type ${t} is not supported.`)}function C(t){return(!t.dispatchLayout.hasOwnProperty("y")||0===t.dispatchLayout.y.length)&&(!t.dispatchLayout.hasOwnProperty("z")||0===t.dispatchLayout.z.length)} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const T=t=>{let e=1;for(let n=0;ne%t[n]==0))}function I(t,e,n=[1,1,1],r=[1,1,1]){const[i,o,a]=[Math.ceil(T(t.x.map((t=>e[t])))/(n[0]*r[0])),t.y?Math.ceil(T(t.y.map((t=>e[t])))/(n[1]*r[1])):1,t.z?Math.ceil(T(t.z.map((t=>e[t])))/(n[2]*r[2])):1];return[i,o,a]}function N(t,e,n,r=!1){const i=[8,8,1],o=[4,4,1];return r||(t<=8&&(o[1]=1),e<=16&&n<=16&&(i[0]=4)),{workgroupSize:i,elementsPerThread:o}}function P(t,e,n=!1){if(n)return[8,8,1];const r=T(t.x.map((t=>e[t]))),i=T(t.y.map((t=>e[t])));return r<=4?[4,16,1]:i<=4?[16,4,1]:[16,16,1]}function O(t,e,n=!1){if(n)return[4,4,1];const r=T(t.x.map((t=>e[t]))),i=T(t.y.map((t=>e[t])));return r<=4?[1,2,1]:i<=4?[2,1,1]:[2,2,1]}function L(t){return{x:t.map(((t,e)=>e))}}function R(t){if("float32"===t||"int32"===t||"bool"===t||"string"===t)return 4;if("complex64"===t)return 8;throw new Error(`Unknown dtype ${t}`)}function D(){return!("undefined"==typeof globalThis||!globalThis.navigator||!globalThis.navigator.gpu)}function z(t,e){Array.isArray(t)||(t=[t]),t.forEach((t=>{null!=t&&i.util.assert("complex64"!==t.dtype,(()=>`${e} does not support complex64 tensors in the WebGPU backend.`))}))}var F;!function(t){t[t.MatMulReduceProgram=0]="MatMulReduceProgram",t[t.MatMulSplitKProgram=1]="MatMulSplitKProgram",t[t.MatMulSmallOutputSizeProgram=2]="MatMulSmallOutputSizeProgram",t[t.MatMulPackedProgram=3]="MatMulPackedProgram",t[t.MatMulMax=4]="MatMulMax"}(F||(F={})); +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const B=(0,i.env)().getNumber("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD");class U extends i.KernelBackend{nextDataId(){return U.nextDataId++}constructor(t,e){if(super(),this.commandQueueOwnedIds=new WeakSet,this.dispatchCountInPass=0,this.disposed=!1,this.downloadWaitMs=0,this.tensorDataPendingDisposal=[],this.queryResolveBuffer=null,this.querySet=null,this.querySetCount=2,this.stagingPendingDisposal=[],this.uniformPendingDisposal=[],this.uploadWaitMs=0,this.hasReadSyncWarned=!1,this.hasTimestampQueryWarned=!1,!D())throw new Error("WebGPU is not supported on this device");this.pipelineCache={},this.device=t,this.queue=t.queue,this.commandEncoder=null,this.computePassEncoder=null,this.adapterInfo=new a(e),this.supportTimestampQuery=this.device.features.has("timestamp-query"),this.thresholdToIncreaseWorkgroups=this.adapterInfo.intelGPUGeneration>=12?16:8,this.bufferManager=new s(this.device),this.textureManager=new l(this.device),this.tensorMap=new i.DataStorage(this,(0,i.engine)()),(0,i.env)().getBool("WEBGPU_USE_PROFILE_TOOL")&&(this.dummyCanvas=document.createElement("canvas"),this.dummyCanvas.width=1,this.dummyCanvas.height=1,this.dummyContext=this.dummyCanvas.getContext("webgpu"),this.dummyContext.configure({device:t,format:"bgra8unorm"}),document.body.appendChild(this.dummyCanvas))}floatPrecision(){return 32}disposeData(t,e=!1){if(!this.tensorMap.has(t))return!0;const n=this.tensorMap.get(t);return e?n.refCount=0:n.refCount--,!(n.refCount>0)&&(null!=n.complexTensorInfos&&(this.disposeData(n.complexTensorInfos.real.dataId),this.disposeData(n.complexTensorInfos.imag.dataId)),this.commandQueueOwnedIds.has(t)?(this.tensorDataPendingDisposal.push(t),!0):(this.releaseResource(t),this.tensorMap.delete(t),!0))}memory(){return{numBytesInGPU:this.bufferManager.numBytesUsed,numBytesAllocatedInGPU:this.bufferManager.numBytesAllocated,unreliable:!1}}releaseResource(t){const e=this.tensorMap.get(t);e&&e.resource&&(e.external||(e.resource instanceof GPUBuffer?this.bufferManager.releaseBuffer(e.resource):e.resource instanceof GPUTexture&&this.textureManager.releaseTexture(e.resource)),e.resource=null)}refCount(t){if(this.tensorMap.has(t)){return this.tensorMap.get(t).refCount}return 0}incRef(t){this.tensorMap.get(t).refCount++}decRef(t){if(this.tensorMap.has(t)){this.tensorMap.get(t).refCount--}}write(t,e,n){if("complex64"===n&&null!=t)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const r={id:this.nextDataId()};return this.tensorMap.set(r,{dtype:n,shape:e,values:t,refCount:1}),r}move(t,e,n,r,i){if("complex64"===r)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.tensorMap.set(t,{dtype:r,shape:n,values:e,refCount:i})}submitQueue(){this.queue.submit([this.commandEncoder.finish()]),this.commandEncoder=null,this.dispatchCountInPass=0,this.commandQueueOwnedIds=new WeakSet,this.tensorDataPendingDisposal.forEach((t=>{this.releaseResource(t),this.tensorMap.delete(t)})),this.uniformPendingDisposal.forEach((t=>this.bufferManager.releaseBuffer(t))),this.stagingPendingDisposal.forEach((t=>this.bufferManager.releaseBuffer(t,!1))),this.tensorDataPendingDisposal=[],this.uniformPendingDisposal=[],this.stagingPendingDisposal=[]}ensureCommandEncoderReady(){this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder())}endComputePassEncoder(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}async checkCompileCompletionAsync(){let t;try{t=await Promise.all(Object.values(this.pipelineCache))}catch(t){throw new Error(t.message)}Object.keys(this.pipelineCache).map(((e,n)=>{this.pipelineCache[e]=t[n]}))}async getBufferData(t){if((0,i.env)().getBool("WEBGPU_ENGINE_COMPILE_ONLY"))return console.warn("The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false"),null;const e=t.size,n=this.bufferManager.acquireBuffer(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,n,0,e),this.submitQueue(),await n.mapAsync(GPUMapMode.READ);const r=n.getMappedRange().slice(0);return n.unmap(),null!=n&&this.bufferManager.releaseBuffer(n),(0,i.env)().getBool("WEBGPU_USE_PROFILE_TOOL")&&(i.util.assert(void 0!==this.dummyContext,(()=>"Fail to get context for profiling tool")),this.dummyContext.getCurrentTexture()),r}convertAndCacheOnCPU(t,e){const n=this.tensorMap.get(t);return n.values=e,n.values}readSync(t){const e=this.tensorMap.get(t),{values:n,complexTensorInfos:r}=e;if(null!=n||"string"===e.dtype)return n;if("complex64"===e.dtype){const e=this.readSync(r.real.dataId),n=this.readSync(r.imag.dataId),o=i.util.convertBackendValuesAndArrayBuffer(i.backend_util.mergeRealAndImagArrays(e,n).buffer,"float32");return this.convertAndCacheOnCPU(t,o),o}this.hasReadSyncWarned||(this.hasReadSyncWarned=!0,console.warn("The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead."));const o=["opaque","premultiplied"],a=e.resource,s=a.size;i.util.assert(s%4==0,(()=>"Because there is 4 bytes for one pixel, buffer size must be multiple of 4."));const u=s/4,l=new ArrayBuffer(s),c=256,h=256,d=o.map((t=>new OffscreenCanvas(c,h))),f=new OffscreenCanvas(c,h);this.endComputePassEncoder(),d.map(((t,e)=>{const n=t.getContext("webgpu");return n.configure({device:this.device,format:"bgra8unorm",usage:GPUTextureUsage.COPY_DST,alphaMode:o[e]}),n.getCurrentTexture()})).map(((t,e)=>{const n=(n,r,i)=>{this.ensureCommandEncoderReady(),this.commandEncoder.copyBufferToTexture({buffer:a,bytesPerRow:1024,offset:i},{texture:t},{width:n,height:r}),this.submitQueue();const s=f.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,n,r),s.drawImage(d[e],0,0);const u=s.getImageData(0,0,n,r).data,c=o[e],h=new Uint8ClampedArray(l,i,n*r*4);for(let t=0;t0&&(n(i,s,p),p+=1024*s),i=m%c,i>0&&n(i,1,p)}));const p=i.util.convertBackendValuesAndArrayBuffer(l,e.dtype);return this.convertAndCacheOnCPU(t,p),p}async read(t){if(!this.tensorMap.has(t))throw new Error(`Tensor ${t} was not registered!`);const e=this.tensorMap.get(t),{values:n}=e;if(null!=n)return n;let r;if("complex64"===e.dtype){const t=await Promise.all([this.read(e.complexTensorInfos.real.dataId),this.read(e.complexTensorInfos.imag.dataId)]),n=t[0],o=t[1];r=i.backend_util.mergeRealAndImagArrays(n,o)}else{const t=await this.getBufferData(e.resource);r=i.util.convertBackendValuesAndArrayBuffer(t,e.dtype)}return this.convertAndCacheOnCPU(t,r),r}copyBuffer(t){const e=t.size,n=t.usage,r=this.bufferManager.acquireBuffer(e,n);return this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,r,0,e),this.submitQueue(),r}createTensorFromGPUData(t,e,n){let r=t.buffer;if("complex64"===n)throw new Error("Cannot write to a complex64 dtype. ");const o={id:this.nextDataId()};this.tensorMap.set(o,{dtype:n,shape:e,values:null,refCount:1,external:t.zeroCopy});const a=this.tensorMap.get(o),s=R(a.dtype)*i.util.sizeFromShape(a.shape);if(t.buffer.sizei.util.decodeString(t)));return(0,i.buffer)(t.shape,t.dtype,n)}catch(t){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,i.buffer)(t.shape,t.dtype,e)}async time(t){this.supportTimestampQuery||this.hasTimestampQueryWarned||(console.warn("This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled."),this.hasTimestampQueryWarned=!0);const e=this.activeTimers,n=[];let r=!1;null==this.programTimersStack?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,t();const o=i.util.flatten(this.activeTimers.map((t=>t.query))).filter((t=>null!=t)),a=i.util.flatten(this.activeTimers.map((t=>t.name))).filter((t=>null!=t));this.activeTimers=e,r&&(this.programTimersStack=null);const s={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},u=await Promise.all(o);return s.kernelMs=i.util.sum(u),s.getExtraProfileInfo=()=>u.map(((t,e)=>({name:a[e],ms:t}))).map((t=>`${t.name}: ${t.ms}`)).join(", "),this.uploadWaitMs=0,this.downloadWaitMs=0,s}makeTensorInfo(t,e,n){"string"===e&&null!=n&&n.length>0&&i.util.isString(n[0])&&(n=n.map((t=>i.util.encodeString(t))));return{dataId:this.write(n,t,e),shape:t,dtype:e}}tensorToBinding(t){if(!t)return null;const e=this.tensorMap.get(t.dataId).resource;return e instanceof GPUBuffer?{buffer:e}:e instanceof GPUTexture?e.createView():e}uploadToGPU(t){const e=this.tensorMap.get(t);if(null!=e.resource)return;const n=R(e.dtype)*i.util.sizeFromShape(e.shape);let r;const o=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;if(e.values){if(r=this.bufferManager.acquireBuffer(n,o,!0),"unmapped"===r.mapState){const t=this.bufferManager.acquireBuffer(n,GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC,!0,!1),i=t.getMappedRange();"int32"===e.dtype||"bool"===e.dtype?new Int32Array(i).set(e.values):new Float32Array(i).set(e.values),t.unmap(),this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,r,0,n),this.stagingPendingDisposal.push(t)}else{const t=r.getMappedRange();"int32"===e.dtype||"bool"===e.dtype?new Int32Array(t).set(e.values):new Float32Array(t).set(e.values),r.unmap()}e.values=null}else r=this.bufferManager.acquireBuffer(n,o);e.resource=r}makeUniforms(t){let e=0,n=0;const r=[];let o=1;t.forEach((t=>{let a;switch(0===t.data.length&&(t.data=[1]),t.data.length){case 1:a=4;break;case 2:a=8;break;case 3:case 4:case 5:case 6:a=16;break;default:i.util.assert(!1,(()=>`Unsupported ${t.data.length}D shape`))}5!==n&&6!==n||(a=16),a>o&&(o=a),e=Math.ceil(e/a)*a,n=t.data.length,r.push(e),e+=4*t.data.length})),e=Math.ceil(e/o)*o;const a=new ArrayBuffer(e);t.forEach(((t,e)=>{const n=r[e];"int32"===t.type?new Int32Array(a,n,t.data.length).set(t.data):"uint32"===t.type?new Uint32Array(a,n,t.data.length).set(t.data):new Float32Array(a,n,t.data.length).set(t.data)}));const s=this.bufferManager.acquireBuffer(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);return this.queue.writeBuffer(s,0,a,0,e),this.uniformPendingDisposal.push(s),{offset:0,size:e,buffer:s}}runWebGPUProgram(t,e,n,r,o){if(o||(o=this.makeTensorInfo(t.outputShape,n)),0===i.util.sizeFromShape(o.shape))return this.tensorMap.get(o.dataId).values=i.util.getTypedArrayFromDType(o.dtype,0),o;this.uploadToGPU(o.dataId),t.dispatch=((t,e)=>{const n=t.limits.maxComputeWorkgroupsPerDimension,r=e.dispatchLayout,o=e.dispatch;if(o.every((t=>t<=n)))return o;i.util.assert(o[0]>n&&void 0===r.y&&void 0===r.z,(()=>"Dispatch size exceeds WebGPU limits in Y or Z dimension."));let a=Math.ceil(Math.sqrt(o[0]));return a>n?(a=Math.ceil(Math.cbrt(o[0])),i.util.assert(a<=n,(()=>"Total dispatch size exceeds WebGPU maximum.")),[a,a,a]):[a,a,1]})(this.device,t);const a=e.map(((e,n)=>{if("complex64"===e.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");return this.uploadToGPU(e.dataId),{dtype:this.tensorMap.get(e.dataId).dtype,shape:e.shape,name:t.variableNames[n]}}));t.shaderKey=function(t,e,n){let r=t.shaderKey;if(null!=t.pixelsOpType)return r;const o=[],a=[];e.forEach((t=>{o.push(t.shape),a.push(t.dtype)})),o.push(n.shape),a.push(n.dtype);const s=e.map((t=>i.backend_util.getBroadcastDims(t.shape,n.shape))),u=e.map((t=>i.util.arraysEqual(t.shape,n.shape))).join("_"),l=s.map((t=>t.join("_"))).join(";"),c=M(t)?"flatDispatch":"";return r+="_"+(t.workgroupSize?t.workgroupSize.join(","):"")+o.map((t=>t.length)).join(",")+a.join(",")+t.variableNames.join(",")+l+u+c,r}(t,a,o);const s=(0,i.env)().getBool("WEBGPU_ENGINE_COMPILE_ONLY");return t.shaderKey in this.pipelineCache||(this.pipelineCache[t.shaderKey]=m(this.device,t,a,o,s)),t.pipeline=this.pipelineCache[t.shaderKey],s||this.recordAndSubmit(t,o,e,r),o}recordAndSubmit(t,e,n,r){if(t.pipeline instanceof Promise)throw new Error("Please call checkCompileCompletionAsync to ensure parallel compilation is done!");let o=[],a=[];const s="int32";if(null==t.pixelsOpType){o.push({type:"float32",data:[NaN]},{type:"float32",data:[1/0]}),a=n.concat(e).map((t=>t.shape));const t="int32";a.map((e=>{o.push({type:t,data:e});const n=i.util.computeStrides(e);o.push({type:t,data:n})}))}else{const t=i.util.computeStrides(e.shape);o.push({type:s,data:t})}if(t.size){const e=i.util.sizeFromShape(t.outputShape);o.push({type:s,data:[t.outputComponent?e/t.outputComponent:e]})}r&&(o=[...o,...r]);const u=[this.tensorToBinding(e),...n.map((t=>this.tensorToBinding(t))),this.makeUniforms(o)];n.forEach((t=>{this.commandQueueOwnedIds.add(t.dataId)})),this.commandQueueOwnedIds.add(e.dataId);const l=this.device.createBindGroup({layout:t.pipeline.getBindGroupLayout(0),entries:u.map(((t,e)=>({binding:e,resource:t})))}),c=null!=this.activeTimers;this.ensureCommandEncoderReady();const h={};c&&this.supportTimestampQuery?(this.endComputePassEncoder(),null==this.querySet&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.querySetCount})),h.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1},this.computePassEncoder=this.commandEncoder.beginComputePass(h)):this.computePassEncoder||(this.computePassEncoder=this.commandEncoder.beginComputePass(h)),this.computePassEncoder.setPipeline(t.pipeline),this.computePassEncoder.setBindGroup(0,l),this.computePassEncoder.dispatchWorkgroups(t.dispatch[0],t.dispatch[1],t.dispatch[2]),this.dispatchCountInPass++,(c||(0,i.env)().get("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE")<=this.dispatchCountInPass||t.pixelsOpType===p.DRAW)&&(this.endComputePassEncoder(),c?this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime()}):this.submitQueue())}async getQueryTime(){if(!this.supportTimestampQuery)return 0;null==this.queryResolveBuffer&&(this.queryResolveBuffer=this.bufferManager.acquireBuffer(8*this.querySetCount,GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST|GPUBufferUsage.QUERY_RESOLVE)),this.commandEncoder.resolveQuerySet(this.querySet,0,this.querySetCount,this.queryResolveBuffer,0);const t=this.bufferManager.acquireBuffer(8*this.querySetCount,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,t,0,8*this.querySetCount),this.submitQueue(),await t.mapAsync(GPUMapMode.READ);const e=new BigUint64Array(t.getMappedRange()),n=Number(e[1]-e[0])/1e6;return t.unmap(),this.bufferManager.releaseBuffer(t),n}shouldExecuteOnCPU(t,e=B){return(0,i.env)().getBool("WEBGPU_CPU_FORWARD")&&t.every((t=>null==this.tensorMap.get(t.dataId).resource&&i.util.sizeFromShape(t.shape){const t={powerPreference:(0,i.env)().get("WEBGPU_USE_LOW_POWER_GPU")?"low-power":"high-performance"},e=await navigator.gpu.requestAdapter(t),n={},r=[];e.features.has("timestamp-query")&&r.push("timestamp-query"),e.features.has("bgra8unorm-storage")&&r.push(["bgra8unorm-storage"]),n.requiredFeatures=r;const o=e.limits;n.requiredLimits={maxComputeWorkgroupStorageSize:o.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:o.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:o.maxStorageBufferBindingSize,maxBufferSize:o.maxBufferSize,maxComputeWorkgroupSizeX:o.maxComputeWorkgroupSizeX,maxComputeInvocationsPerWorkgroup:o.maxComputeInvocationsPerWorkgroup};const a=await e.requestDevice(n),s=await e.requestAdapterInfo();return new U(a,s)}),3),function(t){t[t.ADD=0]="ADD",t[t.ATAN2=1]="ATAN2",t[t.COMPLEX_MULTIPLY_IMAG=2]="COMPLEX_MULTIPLY_IMAG",t[t.COMPLEX_MULTIPLY_REAL=3]="COMPLEX_MULTIPLY_REAL",t[t.DIV=4]="DIV",t[t.ELU_DER=5]="ELU_DER",t[t.EQUAL=6]="EQUAL",t[t.FLOOR_DIV=7]="FLOOR_DIV",t[t.GREATER=8]="GREATER",t[t.GREATER_EQUAL=9]="GREATER_EQUAL",t[t.LESS=10]="LESS",t[t.LESS_EQUAL=11]="LESS_EQUAL",t[t.LOGICAL_AND=12]="LOGICAL_AND",t[t.LOGICAL_OR=13]="LOGICAL_OR",t[t.MAX=14]="MAX",t[t.MIN=15]="MIN",t[t.MOD=16]="MOD",t[t.MUL=17]="MUL",t[t.NOT_EQUAL=18]="NOT_EQUAL",t[t.POW=19]="POW",t[t.PRELU=20]="PRELU",t[t.SQUARED_DIFFERENCE=21]="SQUARED_DIFFERENCE",t[t.SUB=22]="SUB"}(j||(j={}));const V="let resultTemp = a + b;",H="let resultTemp = atan2(a, b);",G="let resultTemp = areal * breal - aimag * bimag;",W="let resultTemp = areal * bimag + aimag * breal;",X="let resultTemp = a / b;",Y="let resultTemp = select(a * (b + 1.0), a, b >= b - b);",q="\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a == b);\n",$="\n let remainder =\n select(a % b, round(a % b), (round(a) == a) & (round(b) == b));\n let quotient = (a - remainder) / b;\n let resultTemp =\n round(select(quotient, quotient - 1, sign(remainder) == -sign(b)));\n",K="\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a > b);\n",Z="\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a >= b);\n",Q="\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a < b);\n",J="\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a <= b);\n",tt="return f32(a >= 1.0 && b >= 1.0);",et="return (vec4(a >= vec4(1.0)) *\n vec4(b >= vec4(1.0)));",nt="return f32(a >= 1.0 || b >= 1.0);",rt="return min(vec4(a >= vec4(1.0)) +\n vec4(b >= vec4(1.0)), vec4(1.0));",it="let resultTemp = max(a, b);",ot="let resultTemp = min(a, b);",at="\n let isNaN = b == 0.;\n var resultTemp = a % b;\n resultTemp = select((resultTemp + b) % b, resultTemp,\n (a < 0. && b < 0.) || (a >= 0. && b > 0.));\n",st="\n let isNaN = !vec4(b);\n var resultTemp = vec4(a % b);\n if (!((a[0] < 0. && b[0] < 0.) || (a[0] >= 0. && b[0] > 0.))) {\n resultTemp[0] = (resultTemp[0] + b[0]) % b[0];\n }\n if (!((a[1] < 0. && b[1] < 0.) || (a[1] >= 0. && b[1] > 0.))) {\n resultTemp[1] = (resultTemp[1] + b[1]) % b[1];\n }\n if (!((a[2] < 0. && b[2] < 0.) || (a[2] >= 0. && b[2] > 0.))) {\n resultTemp[2] = (resultTemp[2] + b[2]) % b[2];\n }\n if (!((a[3] < 0. && b[3] < 0.) || (a[3] >= 0. && b[3] > 0.))) {\n resultTemp[3] = (resultTemp[3] + b[3]) % b[3];\n }\n",ut="let resultTemp = a * b;",lt="\n var resultTemp = f32(a != b);\n let valueForNaN = 1.0;\n",ct="\n var resultTemp = vec4(a != b);\n let valueForNaN = 1.0;\n",ht="\n let isNaN = a < 0.0 && floor(b) < b;\n if (b == 0.0) {\n return 1.0;\n }\n var resultTemp = select(sign(a) * pow(abs(a), b), pow(abs(a), b),\n round(abs(b) % 2.0) != 1.0);\n",dt="\n let isModRound1Bool = vec4(round(abs(b) % vec4(2.0))) == vec4(1);\n let isModRound1 = vec4(isModRound1Bool);\n let multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n var resultTemp = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n let isExpZero = b == vec4(0.0);\n if (isExpZero.r) {\n resultTemp.r = 1.0;\n }\n if (isExpZero.g) {\n resultTemp.g = 1.0;\n }\n if (isExpZero.b) {\n resultTemp.b = 1.0;\n }\n if (isExpZero.a) {\n resultTemp.a = 1.0;\n }\n let isNaN = (a < vec4(0.0)) & (floor(b) < b);\n",ft="if (a < 0.0) { return b * a; } return a;",pt="\n let aLessThanZero = vec4(a < vec4(0.0));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",mt="let resultTemp = (a - b) * (a - b);",gt="let resultTemp = a - b;";function vt(t,e){let n;do{switch(t){case j.ATAN2:n=H;break;case j.MAX:n=it;break;case j.MIN:n=ot;break;case j.MOD:n=e?st:at;break;case j.NOT_EQUAL:n=e?ct:lt;break;case j.POW:n=e?dt:ht;break;default:continue}let r,i,o;return e?(r="isnanVec4",i="vec4",o="vec4"):(r="isnan",i="f32",o="bool"),`\n let aIsNaN = ${r}(a);\n let aPostLegalization = select(a, ${i}(42), aIsNaN);\n let bIsNaN = ${r}(b);\n let bPostLegalization = select(b, ${i}(42), bIsNaN);\n let isNaN = false;\n let valueForNaN = uniforms.NAN;\n {\n let a = aPostLegalization;\n let b = bPostLegalization;\n ${n}\n return select(\n resultTemp, ${i}(valueForNaN),\n ${o}(isNaN) | aIsNaN | bIsNaN);\n }\n `}while(0);switch(t){case j.ADD:n=V;break;case j.COMPLEX_MULTIPLY_IMAG:n=W;break;case j.COMPLEX_MULTIPLY_REAL:n=G;break;case j.DIV:n=X;break;case j.ELU_DER:n=Y;break;case j.EQUAL:n=q;break;case j.FLOOR_DIV:n=$;break;case j.GREATER:n=K;break;case j.GREATER_EQUAL:n=Z;break;case j.LESS:n=Q;break;case j.LESS_EQUAL:n=J;break;case j.LOGICAL_AND:return e?et:tt;case j.LOGICAL_OR:return e?rt:nt;case j.MUL:n=ut;break;case j.PRELU:return e?pt:ft;case j.SQUARED_DIFFERENCE:n=mt;break;case j.SUB:n=gt}return`\n ${n}\n return resultTemp;\n `} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +var yt;!function(t){t[t.ABS=0]="ABS",t[t.ACOS=1]="ACOS",t[t.ACOSH=2]="ACOSH",t[t.ASIN=3]="ASIN",t[t.ASINH=4]="ASINH",t[t.ATAN=5]="ATAN",t[t.ATANH=6]="ATANH",t[t.CEIL=7]="CEIL",t[t.COS=8]="COS",t[t.COSH=9]="COSH",t[t.ELU=10]="ELU",t[t.ERF=11]="ERF",t[t.EXP=12]="EXP",t[t.EXPM1=13]="EXPM1",t[t.FLOOR=14]="FLOOR",t[t.IS_FINITE=15]="IS_FINITE",t[t.IS_INF=16]="IS_INF",t[t.IS_NAN=17]="IS_NAN",t[t.LINEAR=18]="LINEAR",t[t.LOG=19]="LOG",t[t.LOG1P=20]="LOG1P",t[t.LOGICAL_NOT=21]="LOGICAL_NOT",t[t.NEG=22]="NEG",t[t.RELU=23]="RELU",t[t.RELU6=24]="RELU6",t[t.LEAKYRELU=25]="LEAKYRELU",t[t.RECIPROCAL=26]="RECIPROCAL",t[t.ROUND=27]="ROUND",t[t.RSQRT=28]="RSQRT",t[t.SELU=29]="SELU",t[t.SIGMOID=30]="SIGMOID",t[t.SIGN=31]="SIGN",t[t.SIN=32]="SIN",t[t.SINH=33]="SINH",t[t.SOFTPLUS=34]="SOFTPLUS",t[t.SQRT=35]="SQRT",t[t.SQUARE=36]="SQUARE",t[t.STEP=37]="STEP",t[t.TAN=38]="TAN",t[t.TANH=39]="TANH",t[t.TO_INT=40]="TO_INT"}(yt||(yt={}));const bt="return abs(a);",xt="\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n return acos(a);\n",wt="\n if (a < 1.) {\n return uniforms.NAN;\n }\n return acosh(a);\n",_t="\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n return asin(a);\n",St="return asinh(a);",Et="\n if (isnan(a)) {\n return uniforms.NAN;\n }\n return atan(a);\n",Mt="\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n if (a == 1.) {\n return uniforms.INFINITY;\n }\n if (a == -1.) {\n return -uniforms.INFINITY;\n }\n return atanh(a);\n",At="return ceil(a);",Ct="return cos(a);",Tt="\n let e2x = exp(-a);\n return (e2x + 1.0 / e2x) / 2.0;\n",kt="return exp(a) - 1.0;",It="if (a >= 0.0) { return a; } return (exp(a) - 1.0);",Nt="\n var resFloat = exp(a) - vec4(1.0);\n if (a.r >= 0.0) {\n resFloat.r = a.r;\n }\n if (a.g >= 0.0) {\n resFloat.g = a.g;\n }\n if (a.b >= 0.0) {\n resFloat.b = a.b;\n }\n if (a.a >= 0.0) {\n resFloat.a = a.a;\n }\n return resFloat;\n",Pt=`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n let p = ${i.backend_util.ERF_P};\n let a1 = ${i.backend_util.ERF_A1};\n let a2 = ${i.backend_util.ERF_A2};\n let a3 = ${i.backend_util.ERF_A3};\n let a4 = ${i.backend_util.ERF_A4};\n let a5 = ${i.backend_util.ERF_A5};\n\n let sign = sign(a);\n let absA = abs(a);\n let t = 1.0 / (1.0 + p * absA);\n return sign * (1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * exp(-absA * absA));\n`,Ot="return exp(a);",Lt="return floor(a);",Rt="return f32(!isnan(a) && !isinf(a));",Dt="return f32(isinf(a));",zt="return f32(isnan(a));",Ft="return a;",Bt="if (a < 0.0) { return uniforms.NAN; }\n return log(a);",Ut="\n if (isnan(a)) { return a; }\n return log(1.0 + a);\n",jt="return f32(!(a >= 1.0));",Vt="return -a;",Ht="if (a < 0.0) { return uniforms.alpha * a; } return a;",Gt="\n let aLessThanZero = vec4(a < vec4(0.0));\n return (aLessThanZero * (uniforms.alpha * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",Wt="return 1.0 / a;",Xt="return select(a, 0.0, a < 0.0);",Yt="return clamp(a, 0.0, 6.0);",qt="return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));",$t="\n return select(a, vec4(0.0), a < vec4(0.0));\n",Kt="return round(a);",Zt="return inverseSqrt(a);",Qt=`\n if (a >= 0.0) {\n return ${i.backend_util.SELU_SCALE} * a;\n } else {\n return ${i.backend_util.SELU_SCALEALPHA} * (exp(a) - 1.0);\n }\n`,Jt="return 1.0 / (1.0 + exp(-1.0 * a));",te="return sign(a);",ee="return sin(a);",ne="\n let e2x = exp(a);\n return (e2x - 1.0 / e2x) / 2.0;\n",re="\n let epsilon = 1.1920928955078125e-7;\n let threshold = log(epsilon) + 2.0;\n\n let too_large = a > -threshold;\n let too_small = a < threshold;\n let exp_a = exp(a);\n\n if (too_large) {\n return a;\n } else if (too_small) {\n return exp_a;\n } else {\n return log(exp_a + 1.0);\n }\n",ie="return sqrt(a);",oe="return a * a;",ae="\n if (isnan(a)) {\n return a;\n }\n\n return select(uniforms.stepAlpha, 1.0, a > 0.0);\n",se="return tan(a);",ue="\n let e2x = exp(-2.0 * abs(a));\n return sign(a) * (1.0 - e2x) / (1.0 + e2x);\n",le="return f32(i32((a)));";function ce(t,e){switch(t){case yt.ABS:return bt;case yt.ACOS:return xt;case yt.ACOSH:return wt;case yt.ASIN:return _t;case yt.ASINH:return St;case yt.ATAN:return Et;case yt.ATANH:return Mt;case yt.COS:return Ct;case yt.COSH:return Tt;case yt.CEIL:return At;case yt.ELU:return e?Nt:It;case yt.ERF:return Pt;case yt.EXP:return Ot;case yt.EXPM1:return kt;case yt.FLOOR:return Lt;case yt.IS_FINITE:return Rt;case yt.IS_INF:return Dt;case yt.IS_NAN:return zt;case yt.LINEAR:return Ft;case yt.LOG:return Bt;case yt.LOG1P:return Ut;case yt.LOGICAL_NOT:return jt;case yt.NEG:return Vt;case yt.LEAKYRELU:return e?Gt:Ht;case yt.RECIPROCAL:return Wt;case yt.RELU:return e?$t:Xt;case yt.RELU6:return e?qt:Yt;case yt.ROUND:return Kt;case yt.RSQRT:return Zt;case yt.SELU:return Qt;case yt.SIGMOID:return Jt;case yt.SIGN:return te;case yt.SIN:return ee;case yt.SINH:return ne;case yt.SOFTPLUS:return re;case yt.SQRT:return ie;case yt.SQUARE:return oe;case yt.STEP:return ae;case yt.TAN:return se;case yt.TANH:return ue;case yt.TO_INT:return le;default:throw new Error(`BinaryType ${t} is not implemented!`)}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function he(t,e=!1,n=!1,r=3){if(null===t)return"";let i="";if("linear"===t)i=ce(yt.LINEAR);else if("relu"===t)i=ce(yt.RELU,n);else if("elu"===t)i=ce(yt.ELU,n);else if("relu6"===t)i=ce(yt.RELU6,n);else if("prelu"===t)i=vt(j.PRELU,n);else if("sigmoid"===t)i=ce(yt.SIGMOID,n);else{if("leakyrelu"!==t)throw new Error(`Activation ${t} has not been implemented for the WebGPU backend.`);i=ce(yt.LEAKYRELU,n)}const o=g(n?4:1);let a="";return a=e?`\n fn activation(a : ${o}, coords : vec${r}) -> ${o} {\n let b = getPreluActivationWeightsByOutputCoords(coords);\n ${i}\n }`:`\n fn activation(a : ${o}, coords : vec${r}) -> ${o} {\n ${i}\n }`,a}function de(t,e){return`\n ${t?"value = value + getBiasByOutputCoords(coords);":""}\n ${e?"value = activation(value, coords);":""}\n `} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function fe(t,e,n=!1,r=!1,o=!1,a=1){i.util.assert(t&&1===a||!t,(()=>`transposeA ${t} is not compatible with component size ${a}`));const s=`\n ${t?"value = getA(batch, col, row);":"value = getA(batch, row, col);"}\n\n `,u=e?"value = getB(batch, col, row);":"value = getB(batch, row, col);";return`\n fn mm_readA(batch: i32, row: i32, col: i32) -> ${g(a)} {\n var value = ${g(a)}(0.0);\n ${n&&o?s:`\n ${t?"if(row < uniforms.dimAOuter && col < uniforms.dimInner)":"if(row < uniforms.aShape[1] && col < uniforms.aShape[2])"}\n {\n ${s}\n }\n `}\n return value;\n }\n\n fn mm_readB(batch: i32, row: i32, col: i32) -> ${g(a)} {\n var value = ${g(a)}(0.0);\n ${u}\n return value;\n }\n `}function pe(t,e,n,r,i=!1,o=!1,a=!1,s=1){return`\n ${fe(n,r,i,o,a,s)}\n fn mm_write(batch: i32, row: i32, col: i32, valueIn: ${g(s)}) {\n ${i&&o?"":"if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)"}\n {\n var value = valueIn;\n let coords = vec3(batch, row, col);\n ${de(t,e)}\n setOutputAtCoords(coords[0], coords[1], coords[2], value);\n }\n }\n `}function me(t,e,n=!1,r=32,o=!1,a=32,s=!1){const u=e[1]*t[1],l=e[0]*t[0],c=n?u:r,h=n?r:u,d=c/e[0],f=r/e[1],p=t[1],m=t[0];return i.util.assert((n&&4===d&&4===t[1]||!n&&(3===d||4===d))&&c%e[0]==0&&r%e[1]==0&&4===t[0],(()=>`If transposeA ${n} is true, innerElementSize ${d} and workPerThread[1] ${t[1]} must be 4.\n Otherwise, innerElementSize ${d} must be 3 or 4.\n tileAWidth ${c} must be divisible by workgroupSize[0]${e[0]}. tileInner ${r} must be divisible by workgroupSize[1] ${e[1]}. colPerThread ${t[0]} must be 4.`)),`\n var mm_Asub : array, ${c/d}>, ${h}>;\n var mm_Bsub : array, ${l/t[0]}>, ${r}>;\n\n ${b()} {\n let localRow = i32(localId.y);\n let tileRow = localRow * ${p};\n let tileCol = i32(localId.x);\n\n let globalRow = i32(globalId.y) * ${p};\n let globalCol = i32(globalId.x) * ${m};\n let batch = ${o?"0":"i32(globalId.z)"};\n let batchA = ${o||!s?"batch":"batch % uniforms.aShape[0]"};\n let batchB = ${o||!s?"batch":"batch % uniforms.bShape[0]"};\n let globalRowStart = i32(workgroupId.y) * ${u};\n\n let numTiles = ${o?`${Math.ceil(a/r)}`:`(uniforms.dimInner - 1) / ${r} + 1`};\n var kStart = ${o?`i32(globalId.z) * ${a}`:"0"};\n\n var acc: array, ${p}>;\n\n // Loop over shared dimension.\n let tileRowB = localRow * ${f};\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${p}; innerRow++) {\n let inputRow = tileRow + innerRow;\n let inputCol = tileCol;\n ${((t,e)=>t?`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n kStart + inputRow,\n globalRowStart + inputCol * ${e});\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n globalRow + innerRow,\n kStart + inputCol * ${e});\n `)(n,d)}\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${f}; innerRow++) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB, kStart + inputRow, globalCol);\n }\n kStart = kStart + ${r};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n ${((t,e,n,r)=>{if(t)return`\n for (var k = 0; k < ${r}; k++) {\n let BCached0 = mm_Bsub[k][tileCol];\n let ACached0 = mm_Asub[k][localRow];\n for (var i = 0; i < ${n}; i++) {\n acc[i] = fma(BCached0, vec4(ACached0[i]), acc[i]);\n }\n }`;{let t="",i="";for(let n=0;n(ACached[${n}]), acc[i]);`;return`\n for (var k = 0; k < ${r/e}; k++) {\n ${t}\n for (var i = 0; i < ${n}; i++) {\n let ACached = mm_Asub[tileRow + i][k];\n ${i}\n }\n }`}})(n,d,p,r)}\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < ${p}; innerRow++) {\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\n }\n }`}const ge=t=>t?"\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n kStart + inputRow,\n globalRowStart + inputCol);\n ":"\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n globalRowStart + inputRow,\n kStart + inputCol);\n ";function ve(t,e,n=!1,r=32,o=!1,a=32,s=!1,u=!1){const l=t[1]*e[1],c=t[0]*e[0],h=n?l:r,d=n?r:l;i.util.assert(d%e[1]==0&&h%e[0]==0&&r%e[1]==0,(()=>`tileAHight ${d} must be divisible by workgroupSize[1]${e[1]}, tileAWidth ${h} must be divisible by workgroupSize[0]${e[0]}, tileInner ${r} must be divisible by workgroupSize[1]${e[1]}`));const f=d/e[1],p=h/e[0],m=r/e[1],g=t[1],v=t[0],y=s?`\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n let globalRowStart = i32(workgroupId.y) * ${l};\n let globalColStart = i32(workgroupId.x) * ${c};\n\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var inputRow = localRow; inputRow < ${d}; inputRow = inputRow + ${e[1]}) {\n for (var inputCol = localCol; inputCol < ${h}; inputCol = inputCol + ${e[0]}) {\n ${ge(n)}\n }\n }\n // Load one tile of B into local memory.\n for (var inputRow = localRow; inputRow < ${r}; inputRow = inputRow + ${e[1]}) {\n for (var inputCol = localCol; inputCol < ${c}; inputCol = inputCol + ${e[0]}) {\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB,\n kStart + inputRow,\n globalColStart + inputCol);\n }\n }\n kStart = kStart + ${r};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array;\n for (var k = 0; k < ${r}; k++) {\n for (var inner = 0; inner < ${v}; inner++) {\n BCached[inner] = mm_Bsub[k][localCol + inner * ${e[0]}];\n }\n for (var innerRow = 0; innerRow < ${g}; innerRow++) {\n let ACached = ${n?`mm_Asub[k][localRow + innerRow * ${e[1]}];`:`mm_Asub[localRow + innerRow * ${e[1]}][k];`}\n for (var innerCol = 0; innerCol < ${v}; innerCol++) {\n acc[innerRow][innerCol] =\n fma(ACached, BCached[innerCol], acc[innerRow][innerCol]);\n }\n }\n }\n workgroupBarrier();\n }\n for (var innerRow = 0; innerRow < ${g}; innerRow++) {\n let gRow = globalRowStart + localRow + innerRow * ${e[1]};\n for (var innerCol = 0; innerCol < ${v}; innerCol++) {\n let gCol = globalColStart + localCol + innerCol * ${e[0]};\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\n }\n }\n `:`\n let tileRow = i32(localId.y) * ${g};\n let tileCol = i32(localId.x) * ${v};\n\n let globalRow = i32(globalId.y) * ${g};\n let globalCol = i32(globalId.x) * ${v};\n let globalRowStart = i32(workgroupId.y) * ${l};\n\n let tileRowA = i32(localId.y) * ${f};\n let tileColA = i32(localId.x) * ${p};\n let tileRowB = i32(localId.y) * ${m};\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${f}; innerRow++) {\n for (var innerCol = 0; innerCol < ${p}; innerCol++) {\n let inputRow = tileRowA + innerRow;\n let inputCol = tileColA + innerCol;\n ${ge(n)}\n }\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${m}; innerRow++) {\n for (var innerCol = 0; innerCol < ${v}; innerCol++) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol + innerCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB,\n kStart + inputRow,\n globalCol + innerCol);\n }\n }\n kStart = kStart + ${r};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array;\n for (var k = 0; k < ${r}; k++) {\n for (var inner = 0; inner < ${v}; inner++) {\n BCached[inner] = mm_Bsub[k][tileCol + inner];\n }\n\n for (var innerRow = 0; innerRow < ${g}; innerRow++) {\n ${(t=>t?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];")(n)}\n for (var innerCol = 0; innerCol < ${v}; innerCol++) {\n acc[innerRow][innerCol] =\n fma(ACached, BCached[innerCol], acc[innerRow][innerCol]);\n }\n }\n }\n\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < ${g}; innerRow++) {\n for (var innerCol = 0; innerCol < ${v}; innerCol++) {\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\n acc[innerRow][innerCol]);\n }\n }\n `;return`\n var mm_Asub : array, ${d}>;\n var mm_Bsub : array, ${r}>;\n\n ${b()} {\n let batch = ${o?"0":"i32(globalId.z)"};\n let batchA = ${o||!u?"batch":"batch % uniforms.aShape[0]"};\n let batchB = ${o||!u?"batch":"batch % uniforms.bShape[0]"};\n let numTiles = ${o?`${Math.ceil(a/r)}`:`(uniforms.dimInner - 1) / ${r} + 1`};\n var kStart = ${o?`i32(globalId.z) * ${a}`:"0"};\n\n var acc : array, ${g}>;\n\n // Without this initialization strange values show up in acc.\n for (var innerRow = 0; innerRow < ${g}; innerRow++) {\n for (var innerCol = 0; innerCol < ${v}; innerCol++) {\n acc[innerRow][innerCol] = 0.0;\n }\n }\n ${y}\n }\n `}class ye{constructor(t,e,n=!1,r=!1,i=null,o=null,a=null,s=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e,this.dispatchLayout={x:[2],y:[1],z:[0]};const u=n?t[1]:t[2];if(this.isVec4=(u%4==0&&!n||e[1]%4==0&&n)&&e[2]%4==0&&!r,this.outputComponent=this.isVec4?4:1,this.isVectorA=1===e[1]&&!n,!this.isVec4&&this.isVectorA)this.elementsPerThread=[1,1,1],this.workgroupSize=[32,1,1];else{const t=N(e[1],u,e[2],n);this.workgroupSize=t.workgroupSize,this.elementsPerThread=t.elementsPerThread}this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread);const l=null!=i,c=null!=a;l&&this.variableNames.push("bias"),c&&this.variableNames.push("preluActivationWeights"),this.sequentialAccessByThreads=s,this.transposeA=n,this.transposeB=r,this.addBias=l,this.activation=o,this.hasPreluActivationWeights=c,[this.fitAOuter,this.fitBOuter,this.fitInner]=this.getShapeFit(e[1],e[2],u),this.shaderKey=`matMulPacked_${this.elementsPerThread}_${n}_${r}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`}getShapeFit(t,e,n){const r=this.workgroupSize[1]*this.elementsPerThread[1],i=this.workgroupSize[0]*this.elementsPerThread[0];!this.isVec4&&this.isVectorA?this.tileInner=4*this.workgroupSize[0]:this.tileInner=i;return[t%r==0,e%i==0,n%this.tileInner==0]}getUserCode(){const t=`\n ${he(this.activation,this.hasPreluActivationWeights,this.isVec4)}\n ${pe(this.addBias,this.activation,!1,this.transposeB,this.fitAOuter,this.fitBOuter,this.fitInner,this.isVec4?4:1)}\n ${this.isVec4?me(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,!0):this.isVectorA?function(t,e=!1){i.util.assert(1===t[1]&&1===t[2],(()=>`A linear work group size is required. But got ${t}.`));const n=4*t[0];return`\n var mm_Asub : array, ${t[0]}>;\n\n ${b()} {\n let tileCol = i32(localId.x);\n let globalCol = i32(globalId.x);\n let globalRow = i32(globalId.y);\n\n let numTiles = (uniforms.dimInner - 1) / ${n} + 1;\n let batch = i32(globalId.z);\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n // Without this initialization strange values show up in acc.\n var acc = 0.0;\n\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n let colA = t * ${n} + tileCol * 4;\n mm_Asub[tileCol] = vec4(${(t=>t?"\n mm_readA(batchA, colA, globalRow),\n mm_readA(batchA, colA + 1, globalRow),\n mm_readA(batchA, colA + 2, globalRow),\n mm_readA(batchA, colA + 3, globalRow)\n ":"\n mm_readA(batchA, globalRow, colA),\n mm_readA(batchA, globalRow, colA + 1),\n mm_readA(batchA, globalRow, colA + 2),\n mm_readA(batchA, globalRow, colA + 3)\n ")(e)});\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n for (var k = 0; k < ${n/4}; k++) {\n let rowB = t * ${n} + k * 4;\n let BCached = vec4(mm_readB(batchB, rowB, globalCol),\n mm_readB(batchB, rowB + 1, globalCol),\n mm_readB(batchB, rowB + 2, globalCol),\n mm_readB(batchB, rowB + 3, globalCol));\n\n let ACached = mm_Asub[k];\n acc = acc + dot(ACached, BCached);\n }\n\n workgroupBarrier();\n }\n\n mm_write(batch, globalRow, globalCol, acc);\n }\n `}(this.workgroupSize,this.transposeA):ve(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,this.sequentialAccessByThreads,!0)}\n `;return t}}class be{constructor(t,e=!1,n=!1,r=null,i=null,o=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[256,1,1],this.outputShape=t,this.dispatchLayout={x:[],y:[1,2],z:[0]},this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize);const a=null!=r,s=null!=o;a&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),this.transposeA=e,this.transposeB=n,this.addBias=a,this.activation=i,this.hasPreluActivationWeights=s,this.shaderKey=`matMulReduce_${this.activation}_${e}_${n}`}getUserCode(){ +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +var t;return`\n ${he(this.activation,this.hasPreluActivationWeights)}\n ${pe(this.addBias,this.activation,this.transposeA,this.transposeB)}\n ${t=this.workgroupSize[0],`\n var sumValues : array;\n ${b()} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n let row = coords[1];\n let col = coords[2];\n var sum = 0.0;\n let Length = uniforms.dimInner;\n for (var k = i32(localId.x); k < Length; k = k + ${t}) {\n let dataA = mm_readA(batchA, row, k);\n let dataB = mm_readB(batchB, k, col);\n sum = sum + dataA * dataB;\n }\n sumValues[localId.x] = sum;\n workgroupBarrier();\n\n for(var currentSize = ${t/2}u; currentSize > 1u;\n currentSize = currentSize / 2u) {\n if (localId.x < currentSize)\n {\n sumValues[localId.x] = sumValues[localId.x] + sumValues[localId.x + currentSize];\n }\n workgroupBarrier();\n }\n\n if (localId.x == 0u) {\n sum = sumValues[0] + sumValues[1];\n mm_write(batch, row, col, sum);\n }\n }\n `}\n `}}class xe{constructor(t,e,n,r=!1,i=!1,o=null,a=null,s=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[16,8,1],this.outputShape=n,this.dispatchLayout={x:[2],y:[1],z:[0]},this.dispatch=[Math.ceil(n[2]/this.workgroupSize[0]),Math.ceil(n[1]/this.workgroupSize[1]),n[0]];const u=null!=o;u&&this.variableNames.push("bias");const l=null!=s;l&&this.variableNames.push("preluActivationWeights"),this.transposeA=r,this.transposeB=i,this.addBias=u,this.activation=a,this.hasPreluActivationWeights=l,this.shaderKey=`matMulSmallOutputSize_${this.activation}_${r}_${i}`}getUserCode(){return`\n ${he(this.activation,this.hasPreluActivationWeights)}\n ${pe(this.addBias,this.activation,this.transposeA,this.transposeB)}\n ${ +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const e=t[1],n=t[0],r=e>n?e:n;return`\n var mm_Asub : array, ${e}>;\n var mm_Bsub : array, ${r}>;\n\n // If the output size is small for matrix multiplication, avoid to use vec4\n // and handle some elements per thread to optimally utilize the ALU.\n // Read data from global memory to registers firstly, then store them into\n // shared memory, so it is instruction-Level parallelism for arithmetic\n // operations and others handle IO operations between barrier api, makes ALU\n // and load/store units work simultaneously, could improves the performance.\n ${b()} {\n let tileRow = i32(localId.y);\n let tileCol = i32(localId.x);\n let globalRow = i32(globalId.y);\n let globalCol = i32(globalId.x);\n let batch = i32(globalId.z);\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n\n // uniforms.dimInner should be greater than 0.\n let numTiles = (uniforms.dimInner - 1) / ${r} + 1;\n var acc = 0.0;\n\n var globalColA = tileCol;\n var globalRowB = 0;\n var regA = mm_readA(batchA, globalRow, globalColA);\n var regB0 = mm_readB(batchB, globalRowB + 2 * tileRow, globalCol);\n var regB1 = mm_readB(batchB, globalRowB + 2 * tileRow + 1, globalCol);\n globalColA = globalColA + ${r};\n globalRowB = globalRowB + ${r};\n\n for (var t = 0; t < numTiles; t = t + 1) {\n mm_Asub[tileRow][tileCol] = regA;\n mm_Bsub[2 * tileRow][tileCol] = regB0;\n mm_Bsub[2 * tileRow + 1][tileCol] = regB1;\n\n workgroupBarrier();\n\n regA = mm_readA(batchA, globalRow, globalColA);\n regB0 = mm_readB(batchB, globalRowB + 2 * tileRow, globalCol);\n regB1 = mm_readB(batchB, globalRowB + 2 * tileRow + 1, globalCol);\n globalColA = globalColA + ${r};\n globalRowB = globalRowB + ${r};\n\n for (var k = 0; k < ${r}; k = k + 1) {\n acc = acc + mm_Asub[tileRow][k] * mm_Bsub[k][tileCol];\n }\n workgroupBarrier();\n }\n\n mm_write(batch, globalRow, globalCol, acc);\n }\n `}(this.workgroupSize)}\n `}} +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class we{constructor(t,e,n=!1,r=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[8,8,1],this.atomic=!0,this.splitedDimInner=128,i.util.assert(1===t[0],(()=>"MatMulSplitKProgram only supports batch = 1.")),this.outputShape=t,this.dispatchLayout={x:[2],y:[1],z:[0,3]};const o=(n&&this.outputShape[1]%4==0||!n&&e%4==0)&&this.outputShape[2]%4==0;this.elementsPerThread=[4,4,this.splitedDimInner],this.outputComponent=o?4:1,o||(this.outputShape[1]<16&&(this.elementsPerThread[1]=1),this.outputShape[2]<16&&(this.elementsPerThread[0]=1)),this.dispatch=I(this.dispatchLayout,[this.outputShape[0],this.outputShape[1],this.outputShape[2],e],this.workgroupSize,this.elementsPerThread),this.transposeA=n,this.transposeB=r,this.shaderKey=`matMulSplitK_${n}_${r}_${this.elementsPerThread}_${this.outputComponent}`}getUserCode(){const t=this.outputComponent;return`\n ${fe(!1,this.transposeB,!1,!1,!1,t)}\n fn mm_write(batch: i32, row : i32, col : i32, value : ${g(t)}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) {\n let coords = vec3(batch, row, col);\n let flatIndex = getOutputIndexFromCoords(coords);\n // The problem is that we should initialize output to zero before using.\n // Otherwise, the original value will be added to the result.\n for (var i = 0; i < ${t}; i = i + 1) {\n ${f("&result[flatIndex + i]",""+(t>1?"value[i]":"value"),"float32")}\n }\n }\n }\n ${4===t?me(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner):ve(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner)}\n `}}class _e{constructor(t,e=null,n=null,r=null){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=null!=e,this.hasPreluActivationWeights=null!=r,this.activation=n,this.addBias&&this.variableNames.push("bias"),this.hasPreluActivationWeights&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`biasActivation_${n}`}getUserCode(){return`\n ${he(this.activation,this.hasPreluActivationWeights)}\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var value = getXByOutputIndex(index);\n ${de(this.addBias,this.activation)}\n setOutputAtIndex(index, value);\n }\n }\n `}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Se{constructor(t){this.variableNames=[],this.outputShape=[],this.uniforms="value : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="fill"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n setOutputAtIndex(index, uniforms.value);\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Ee(t){const{backend:e,attrs:n}=t,{shape:r,value:o}=n;let{dtype:a}=n;if(a=a||i.util.inferDtype(o),"string"===a){const t=i.util.getArrayFromDType(a,i.util.sizeFromShape(r));return t.fill(o),e.makeTensorInfo(r,a,t)}{const t=new Se(r),n=[{type:"float32",data:[o]}];return e.runWebGPUProgram(t,[],a,n)}}const Me={kernelName:i.Fill,backendName:"webgpu",kernelFunc:Ee}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Ae(t){const{inputs:e,attrs:n}=t,{x:r}=e,{shape:o}=n,a=i.util.sizeFromShape(r.shape),s=i.util.inferFromImplicitShape(o,a),u=i.util.sizeFromShape(s);return i.util.assert(a===u,(()=>`The new shape (${s}) has ${u} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`)),t.backend.incRef(r.dataId),{dataId:r.dataId,shape:s,dtype:r.dtype}}const Ce={kernelName:i.Reshape,backendName:"webgpu",kernelFunc:Ae}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Te({a:t,b:e,transposeA:n,transposeB:r,backend:o,bias:a=null,preluActivationWeights:s=null,leakyreluAlpha:u=0,activation:l=null}){const c=t.shape.length,h=e.shape.length,d=n?t.shape[c-2]:t.shape[c-1],f=r?e.shape[h-1]:e.shape[h-2],p=n?t.shape[c-1]:t.shape[c-2],m=r?e.shape[h-2]:e.shape[h-1],g=t.shape.slice(0,-2),v=e.shape.slice(0,-2),y=i.util.sizeFromShape(g),b=i.util.sizeFromShape(v),x=i.broadcast_util.assertAndGetBroadcastShape(t.shape.slice(0,-2),e.shape.slice(0,-2)).concat([p,m]);i.util.assert(d===f,(()=>`Error in matMul: inner shapes (${d}) and (${f}) of Tensors with shapes ${t.shape} and ${e.shape} and transposeA=${n} and transposeB=${r} must match.`));const w=n?[y,d,p]:[y,p,d],_=r?[b,m,f]:[b,f,m],S=Ae({inputs:{x:t},backend:o,attrs:{shape:w}}),E=Ae({inputs:{x:e},backend:o,attrs:{shape:_}}),M=[S,E],A=Math.max(y,b),C=[S,E],T=[{type:"int32",data:[p]},{type:"int32",data:[m]},{type:"int32",data:[d]}];let k,I;const N=[A,p,m];let P=(0,i.env)().get("WEBGPU_MATMUL_PROGRAM_TYPE");if(P<0){const t=(0,i.env)().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),e=t>0?t:o.thresholdToIncreaseWorkgroups,n=A*Math.ceil(p/32)*Math.ceil(m/32);P=n<=e||p<=8&&n<=2*e?A*p*m<=128?F.MatMulReduceProgram:1===A&&f>=2e3?F.MatMulSplitKProgram:F.MatMulSmallOutputSizeProgram:F.MatMulPackedProgram}switch(P){case F.MatMulReduceProgram:k=new be(N,n,r,a,l,s);break;case F.MatMulSplitKProgram:if(I=Ee({backend:o,attrs:{shape:N,value:0,dtype:t.dtype}}),k=new we(N,f,n,r),a||l){I=o.runWebGPUProgram(k,C,t.dtype,T,I);const e=new _e(I.shape,a,l,s);let n=null;const r=[I];a&&r.push(a),s&&r.push(s),"leakyrelu"===l&&(n=[{type:"float32",data:[u]}],e.uniforms+=" alpha : f32,");const i=o.runWebGPUProgram(e,r,I.dtype,n);M.push(I);const c=Ae({inputs:{x:i},backend:o,attrs:{shape:x}});M.push(i);for(const t of M)o.disposeData(t.dataId);return c}break;case F.MatMulSmallOutputSizeProgram:k=new xe(w,_,N,n,r,a,l,s);break;case F.MatMulPackedProgram:const e=o.adapterInfo.isIntel();k=new ye(w,N,n,r,a,l,s,e);break;default:throw new Error(`Unsupported MatMulProgramType ${P}.`)}a&&C.push(a),s&&C.push(s),"leakyrelu"===l&&(T.push({type:"float32",data:[u]}),k.uniforms+=" alpha : f32,"),I=o.runWebGPUProgram(k,C,t.dtype,T,I);const O=Ae({inputs:{x:I},backend:o,attrs:{shape:x}});M.push(I);for(const t of M)o.disposeData(t.dataId);return O}const ke={kernelName:i._FusedMatMul,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{a:i,b:o,bias:a,preluActivationWeights:s}=e,{transposeA:u,transposeB:l,activation:c,leakyreluAlpha:h}=r;return Te({a:i,b:o,transposeA:u,transposeB:l,backend:n,bias:a,preluActivationWeights:s,leakyreluAlpha:h,activation:c})}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ie{constructor(t,e,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.workgroupSize=[128,1,1],this.size=!0,this.outputShape=i.backend_util.assertAndGetBroadcastShape(e,n),this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`binaryOpComplex_${t}`,this.op=t}getUserCode(){return`\n fn binaryOpComplex(\n areal : f32, aimag : f32, breal : f32, bimag : f32) -> f32 {\n ${vt(this.op,!1)}\n }\n\n ${b("index")} {\n if(index < uniforms.size) {\n let areal = getARealByOutputIndex(index);\n let aimag = getAImagByOutputIndex(index);\n let breal = getBRealByOutputIndex(index);\n let bimag = getBImagByOutputIndex(index);\n setOutputAtIndex(index, binaryOpComplex(areal, aimag, breal, bimag));\n }\n }\n `}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ne{constructor(t,e,n){if(this.size=!0,this.variableNames=["A","B"],this.outputShape=i.backend_util.assertAndGetBroadcastShape(e,n),this.dispatchLayout=L(this.outputShape),this.op=t,this.useSharedMemoryWithA=e.length<=1&&n.length>1&&e[0]<128,this.useSharedMemoryWithB=n.length<=1&&e.length>1&&n[0]<128,this.useSharedMemoryWithA||this.useSharedMemoryWithB)this.outputComponent=1,this.variableComponents=[1,1],this.lastDimensionSize=this.useSharedMemoryWithB?n[0]:e[0],this.shaderKey=`binary_${t}_${this.lastDimensionSize}`,this.type="shared",this.workgroupSize=[256,1,1];else{const r=e.length>0&&e[e.length-1]%4==0,o=n.length>0&&n[n.length-1]%4==0;r&&o?(this.outputComponent=4,this.variableComponents=[4,4]):r&&(i.util.isScalarShape(n)||1===n[n.length-1])||o&&(i.util.isScalarShape(e)||1===e[e.length-1])?(this.outputComponent=4,this.variableComponents=r?[4,1]:[1,4]):(this.outputComponent=1,this.variableComponents=[1,1]),this.type="nonshared",this.shaderKey=`binary_${t}_${this.variableComponents}`,this.workgroupSize=[128,1,1]}this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.outputComponent,1,1])}getUserCode(){let t;const e=4===this.outputComponent?"vec4":"f32",n=`\n fn binaryOperation(a : ${e}, b : ${e}) -> ${e} {\n ${vt(this.op,4===this.outputComponent)}\n };\n `;if("shared"===this.type){const e=this.lastDimensionSize>1?`coords[${this.outputShape.length-1}]`:"0",r=this.useSharedMemoryWithB?`let a = getAByOutputIndex(index);\n let b = sharedBuf[${e}];`:`let a = sharedBuf[${e}];\n let b = getBByOutputIndex(index);`;t=`\n ${n}\n var sharedBuf : array;\n ${b("index")} {\n // Fill in the shared memory buffer.\n let localIndex = i32(localId.x);\n if(localIndex < ${this.lastDimensionSize}) {\n sharedBuf[localIndex] = f32(${this.useSharedMemoryWithB?"B":"A"}[localIndex]);\n }\n workgroupBarrier();\n\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n ${r}\n setOutputAtIndex(index, binaryOperation(a, b));\n }\n }\n `}else t=`\n ${n}\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index * ${this.outputComponent});\n let a = ${e}(getAByOutputCoords(coords));\n let b = ${e}(getBByOutputCoords(coords));\n setOutputAtIndex(index, binaryOperation(a, b));\n }\n }\n `;return t}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Pe(t){const{inputs:e}=t,{x:n}=e;return t.backend.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}const Oe={kernelName:i.Identity,backendName:"webgpu",kernelFunc:Pe}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Le(t){const{inputs:e,backend:n}=t,{real:r,imag:i}=e,o=n.makeTensorInfo(r.shape,"complex64"),a=n.tensorMap.get(o.dataId),s=Pe({inputs:{x:r},backend:n}),u=Pe({inputs:{x:i},backend:n});return a.complexTensorInfos={real:s,imag:u},o}const Re={kernelName:i.Complex,backendName:"webgpu",kernelFunc:Le}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class De{constructor(t,e,n=""){this.variableNames=["A"],this.size=!0;this.workgroupSize=[128,1,1],this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.op=e,""!==n&&(this.uniforms=n),this.shaderKey=`unary_${e}`}getUserCode(){return`\n fn unaryOperation(a : f32) -> f32 {\n ${ce(this.op,!1)}\n }\n ${b("index")} {\n if (index < uniforms.size) {\n let a = getAByOutputIndex(index);\n setOutputAtIndex(index, unaryOperation(a));\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function ze({opType:t,cpuKernelImpl:e,dtype:n}){return({inputs:r,backend:i})=>{const{x:o}=r,a=i,s=n||o.dtype;if(a.shouldExecuteOnCPU([o])&&null!=e){const t=a.tensorMap.get(o.dataId),n=e(t.values,s);return a.makeTensorInfo(o.shape,s,n)}const u=new De(o.shape,t);return a.runWebGPUProgram(u,[o],s)}}function Fe({opType:t,cpuKernelImpl:e,supportsComplex:n=!1,dtype:r}){return({inputs:o,backend:a})=>{const{a:s,b:u}=o,l=a;if(n&&"complex64"===s.dtype){const e=l.tensorMap.get(s.dataId),n=l.tensorMap.get(u.dataId);let r,o;if(t!==j.MUL)[r,o]=[[e.complexTensorInfos.real,n.complexTensorInfos.real],[e.complexTensorInfos.imag,n.complexTensorInfos.imag]].map((e=>{const[n,r]=e,o={dataId:n.dataId,dtype:n.dtype,shape:s.shape},a={dataId:r.dataId,dtype:r.dtype,shape:u.shape},c=new Ne(t,s.shape,u.shape);return l.runWebGPUProgram(c,[o,a],(0,i.upcastType)(n.dtype,r.dtype))}));else{const t=new Ie(j.COMPLEX_MULTIPLY_REAL,s.shape,u.shape),i=new Ie(j.COMPLEX_MULTIPLY_IMAG,s.shape,u.shape),a=[{dataId:e.complexTensorInfos.real.dataId,dtype:e.complexTensorInfos.real.dtype,shape:s.shape},{dataId:e.complexTensorInfos.imag.dataId,dtype:e.complexTensorInfos.imag.dtype,shape:s.shape},{dataId:n.complexTensorInfos.real.dataId,dtype:n.complexTensorInfos.real.dtype,shape:u.shape},{dataId:n.complexTensorInfos.imag.dataId,dtype:n.complexTensorInfos.imag.dtype,shape:u.shape}];r=l.runWebGPUProgram(t,a,"float32"),o=l.runWebGPUProgram(i,a,"float32")}const a=Le({inputs:{real:r,imag:o},backend:l});return l.disposeData(r.dataId),l.disposeData(o.dataId),a}const c=r||(0,i.upcastType)(s.dtype,u.dtype);if(("string"===s.dtype||"string"===u.dtype||l.shouldExecuteOnCPU([s,u]))&&null!=e){const t=l.tensorMap.get(s.dataId).values,n=l.tensorMap.get(u.dataId).values,r="string"===s.dtype?i.backend_util.fromUint8ToStringArray(t):t,o="string"===s.dtype?i.backend_util.fromUint8ToStringArray(n):n,[a,h]=e(s.shape,u.shape,r,o,c);return l.makeTensorInfo(h,c,a)}const h=new Ne(t,s.shape,u.shape);return l.runWebGPUProgram(h,[s,u],c)}}var Be=n(67466); +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const{addImpl:Ue,castImpl:je,ceilImpl:Ve,concatImpl:He,equalImpl:Ge,expImpl:We,expm1Impl:Xe,floorImpl:Ye,floorDivImpl:qe,gatherNdImpl:$e,gatherV2Impl:Ke,greaterEqualImpl:Ze,greaterImpl:Qe,lessEqualImpl:Je,lessImpl:tn,logImpl:en,maxImpl:nn,maximumImpl:rn,minimumImpl:on,multiplyImpl:an,negImpl:sn,notEqualImpl:un,prodImpl:ln,rangeImpl:cn,rsqrtImpl:hn,scatterImpl:dn,simpleAbsImpl:fn,sliceImpl:pn,stridedSliceImpl:mn,stringNGramsImpl:gn,subImpl:vn,tileImpl:yn,topKImpl:bn,transposeImpl:xn,uniqueImpl:wn}=Be,_n=ze({opType:yt.ABS,cpuKernelImpl:fn}),Sn={kernelName:i.Abs,backendName:"webgpu",kernelFunc:_n},En=ze({opType:yt.ACOS}),Mn={kernelName:i.Acos,backendName:"webgpu",kernelFunc:En},An=ze({opType:yt.ACOSH}),Cn={kernelName:i.Acosh,backendName:"webgpu",kernelFunc:An},Tn=Fe({opType:j.ADD,cpuKernelImpl:Ue,supportsComplex:!0}),kn={kernelName:i.Add,backendName:"webgpu",kernelFunc:Tn}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class In{constructor(t){this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t[0],this.variableNames=t.map(((t,e)=>`T${e}`)),this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="addN"}getUserCode(){const t=[];this.variableNames.forEach((e=>{t.push(`let v${e} = get${e}ByOutputCoords(coords);`)}));const e=this.variableNames.map((t=>`v${t}`)).join(" + ");return`\n ${b("index")} {\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let flatIndex = index * ${this.workPerThread} + i;\n if (flatIndex < uniforms.size) {\n let coords = getCoordsFromIndex(flatIndex);\n ${t.join("\n ")}\n setOutputAtIndex(flatIndex, ${e});\n }\n }\n }\n `}}const Nn={kernelName:i.AddN,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,r=e;if(1===r.length)return Pe({inputs:{x:r[0]},backend:n});const o=r.map((t=>t.dtype)).reduce(((t,e)=>(0,i.upcastType)(t,e))),a=r.map((t=>t.shape)),s=new In(a);return n.runWebGPUProgram(s,r,o)}}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Pn{constructor(t,e){this.variableNames=["A"],this.workgroupSize=[16,16,1];const n=new Array(t.length);for(let r=0;r`Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`));const t=this.workgroupSize[0];return`\n var tile : array, ${this.workgroupSize[0]}>;\n ${b()} {\n var x = i32(workgroupId.x) * ${t} + i32(localId.x);\n var y = i32(workgroupId.y) * ${t} + i32(localId.y);\n let width = uniforms.outShape[0];\n let height = uniforms.outShape[1];\n if (x < width && y < height) {\n tile[localId.y][localId.x] = f32(A[y * width + x]);\n }\n workgroupBarrier();\n\n x = i32(workgroupId.y) * ${t} + i32(localId.x);\n y = i32(workgroupId.x) * ${t} + i32(localId.y);\n if (x < height && y < width) {\n setOutputAtIndex((y * height + x), tile[localId.x]\n [localId.y]);\n }\n }\n `}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class On{constructor(t,e){this.variableNames=["A"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0;const n=new Array(t.length);for(let r=0;r6)throw Error(`Transpose for rank ${e} is not yet supported`);const n=new Array(e);for(let e=0;e=32768&&n>=512?this.workgroupSize=[512,1,1]:t.inSize>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,[1,1,1]),this.reduceType=e,this.shaderKey=`reduce_${e}`}getUserCode(){let t="",e="0.0";const n=this.workgroupSize[0];"min"===this.reduceType||"max"===this.reduceType?(t=`\n if (isnan(candidate)) {\n bestValue = uniforms.NAN;\n } else if (!isnan(bestValue) && candidate ${"min"===this.reduceType?"<":">"} bestValue)\n { bestValue = candidate; }`,e="f32(x[offset])"):"sum"===this.reduceType||"mean"===this.reduceType?t=" bestValue = bestValue + candidate; ":"prod"===this.reduceType?(t=" bestValue = bestValue * candidate; ",e="1.0"):"all"===this.reduceType?(t=" bestValue = f32(bestValue >= 1.0 && candidate >= 1.0); ",e="1.0"):"any"===this.reduceType&&(t=" bestValue = f32(bestValue >= 1.0 || candidate >= 1.0); ",e="0.0");const r="mean"===this.reduceType?"setOutputAtIndex(outputIndex, bestValue / f32(uniforms.reduceSize));":"setOutputAtIndex(outputIndex, bestValue);";return`\n fn DIV_CEIL(a : u32, b : u32) -> u32 {\n return ((a - 1u) / b + 1u);\n }\n\n ${`\n var xBestValues : array;\n `}\n fn getOffset(outputIndex : i32) -> i32 {\n let outputCoords = getCoordsFromIndex(outputIndex);\n let offset = ${1===this.outputShape.length?"outputCoords":"outputCoords[0]"} * uniforms.reduceSize;\n return offset;\n }\n ${b("index")} {\n let outputIndex = index / ${n};\n let offset = getOffset(outputIndex);\n var bestValue = ${e};\n let Length = uniforms.reduceSize;\n let WorkPerThread = DIV_CEIL(u32(Length), ${n}u);\n for (var k = i32(localId.x); k < Length && outputIndex < uniforms.size;\n k = k + ${n}) {\n let candidate = f32(x[offset + k]);\n ${t}\n }\n xBestValues[localId.x] = bestValue;\n workgroupBarrier();\n\n var reduceSize = min(u32(Length), ${n}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (localId.x < currentSize) {\n let candidate = xBestValues[localId.x + interval];\n ${t}\n xBestValues[localId.x] = bestValue;\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (localId.x == 0u && outputIndex < uniforms.size) {\n ${r}\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const Fn={mean:"float32",all:"bool",any:"bool"};function Bn(t,e,n,r,o){const a=t.shape.length,s=[],u=i.util.parseAxisParam(e,t.shape);let l=u;const c=i.backend_util.getAxesPermutation(l,a);let h=t;null!=c&&(h=Rn({inputs:{x:t},attrs:{perm:c},backend:o}),l=i.backend_util.getInnerMostAxes(l.length,a),s.push(h)),i.backend_util.assertAxesAreInnerMostDims(r,l,a);const[d,f]=i.backend_util.computeOutAndReduceShapes(h.shape,l);let p,m=d;if(n&&(m=i.backend_util.expandShapeToKeepDim(d,u)),"max"!==r&&"prod"!==r||!o.shouldExecuteOnCPU([h])){const e=i.util.sizeFromShape(f),n={windowSize:e,inSize:e,batchSize:i.util.sizeFromShape(h.shape)/e,outSize:1},a=Fn[r]||(0,i.sumOutType)(t.dtype),u=[{type:"int32",data:[e]}],l=new zn(n,r,o.device.limits.maxComputeWorkgroupSizeX),c=o.runWebGPUProgram(l,[h],a,u);s.push(c),p=Ae({inputs:{x:c},attrs:{shape:m},backend:o})}else{const e=o.tensorMap.get(h.dataId).values;switch(r){case"max":const n=nn(e,i.util.sizeFromShape(f),m,t.dtype);p=o.makeTensorInfo(m,t.dtype,n);break;case"prod":const{outVals:a,outShape:s,outDtype:u}=ln(h.shape,h.dtype,e,l);p=o.makeTensorInfo(s,u,a);break;default:throw new Error(`${r} CPU implementation is not yet supported.`)}}return s.forEach((t=>o.disposeData(t.dataId))),p}const Un={kernelName:i.All,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{keepDims:o,axis:a}=r;return Bn(i,a,o,"all",n)}};const jn={kernelName:i.Any,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{keepDims:o,axis:a}=r;return Bn(i,a,o,"any",n)}}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Vn{constructor(t,e,n){this.workgroupSize=[64,1,1],this.variableNames=["x"],this.uniforms="infinityValue : f32,",this.size=!0;const r=[e];this.op="min"===n?"<":">";const[o,a]=i.backend_util.computeOutAndReduceShapes(t,r);this.outputShape=0===o.length?[1]:o,this.dispatchLayout=L(this.outputShape),i.util.sizeFromShape(a)<32?(this.type="plain",this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize)):(this.type="shared",this.dispatch=I(this.dispatchLayout,this.outputShape,[1,1,1])),this.inputShape=t,this.shaderKey=`argMinMax_${this.op}_${this.type}`}getUserCode(){const t=this.workgroupSize[0],e=()=>1===this.inputShape.length?"uniforms.xShape":`uniforms.xShape.${y(this.inputShape.length-1)}`,n=()=>{let t="";if(1===this.outputShape.length)1!==this.inputShape.length&&(t+="outputCoords,");else for(let e=0;e u32 {\n return ((a - 1u) / b + 1u);\n }\n\n ${`\n var xBestIndices : array;\n var xBestValues : array;\n `}\n\n ${b("index")} {\n let outputIndex = index / ${t};\n let reduceLength = ${e()};\n\n var bestIndex = i32(localId.x);\n var bestValue = uniforms.infinityValue;\n let outputCoords = getCoordsFromIndex(outputIndex);\n for (var k = i32(localId.x); k < reduceLength && outputIndex < uniforms.size;\n k = k + ${t}) {\n let candidate = getX(${n()} k);\n if (!isnan(candidate) && candidate ${this.op} bestValue) {\n bestValue = candidate;\n bestIndex = k;\n }\n }\n xBestValues[localId.x] = bestValue;\n xBestIndices[localId.x] = bestIndex;\n workgroupBarrier();\n\n var reduceSize = min(u32(reduceLength), ${t}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (localId.x < currentSize) {\n let candidate = xBestValues[localId.x + interval];\n if (candidate ${this.op} bestValue) {\n bestValue = candidate;\n xBestValues[localId.x] = bestValue;\n xBestIndices[localId.x] = xBestIndices[localId.x + interval];\n }\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (localId.x == 0u && outputIndex < uniforms.size) {\n setOutputAtIndexI32(outputIndex, xBestIndices[localId.x]);\n }\n }\n `}return`\n ${b("index")} {\n if (index < uniforms.size) {\n let outputCoords = getCoordsFromIndex(index);\n var bestIndex = 0;\n var bestValue = getX(${n()} 0);\n let reduceLength = ${e()};\n for (var i = 1; i < reduceLength; i++) {\n let candidate = getX(${n()} i);\n if (candidate ${this.op} bestValue) {\n bestValue = candidate;\n bestIndex = i;\n }\n }\n setOutputAtIndexI32(index, bestIndex);\n }\n }\n `}}const Hn={kernelName:i.ArgMax,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{axis:a}=r;let s=i.util.parseAxisParam(a,o.shape);const u=i.backend_util.getAxesPermutation(s,o.shape.length);let l=o;const c=[];null!=u&&(l=Rn({inputs:{x:o},backend:n,attrs:{perm:u}}),c.push(l),s=i.backend_util.getInnerMostAxes(s.length,l.shape.length)),i.backend_util.assertAxesAreInnerMostDims("argMax",[s[0]],l.shape.length);const h=new Vn(l.shape,s[0],"max"),d=[{type:"float32",data:[Number.NEGATIVE_INFINITY]}],f=n.runWebGPUProgram(h,[l],"int32",d);return c.forEach((t=>n.disposeData(t.dataId))),f}};const Gn={kernelName:i.ArgMin,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{axis:a}=r;let s=i.util.parseAxisParam(a,o.shape);const u=i.backend_util.getAxesPermutation(s,o.shape.length);let l=o;const c=[];null!=u&&(l=Rn({inputs:{x:o},backend:n,attrs:{perm:u}}),c.push(l),s=i.backend_util.getInnerMostAxes(s.length,l.shape.length)),i.backend_util.assertAxesAreInnerMostDims("argMin",[s[0]],l.shape.length);const h=new Vn(l.shape,s[0],"min"),d=[{type:"float32",data:[Number.POSITIVE_INFINITY]}],f=n.runWebGPUProgram(h,[l],"int32",d);return c.forEach((t=>n.disposeData(t.dataId))),f}},Wn=ze({opType:yt.ASIN}),Xn={kernelName:i.Asin,backendName:"webgpu",kernelFunc:Wn},Yn=ze({opType:yt.ASINH}),qn={kernelName:i.Asinh,backendName:"webgpu",kernelFunc:Yn},$n=ze({opType:yt.ATAN}),Kn={kernelName:i.Atan,backendName:"webgpu",kernelFunc:$n},Zn=Fe({opType:j.ATAN2}),Qn={kernelName:i.Atan2,backendName:"webgpu",kernelFunc:Zn},Jn=ze({opType:yt.ATANH}),tr={kernelName:i.Atanh,backendName:"webgpu",kernelFunc:Jn}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class er{constructor(t){this.variableNames=["x"],this.uniforms="strides : vec2,",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="poolWithFilterSizeEqualsOne"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let xRCCorner = coords.yz * uniforms.strides;\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n\n let value = getX(batch, xRCorner, xCCorner, d);\n setOutputAtIndex(index, value);\n }\n }\n `}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class nr{constructor(t,e,n=!1,r=!1,i=!1){if(this.variableNames=["x"],this.uniforms="strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,",this.workgroupSize=[128,1,1],this.size=!0,"avg"===e&&n)throw new Error("Cannot compute positions for average pool.");this.outputShape=t.outShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=e,this.computePositions=n,this.flattenPositions=r,this.includeBatchIndex=i,this.shaderKey=`pool2D_${e}_${n}_${r}_${i}`}getUserCode(){let t;if("avg"===this.poolType)t="resultValue = resultValue + value; count = count + 1.0;";else if(this.computePositions){t=`let currMaxValue = mix(value, maxValue, maxValueFound);\n if (value >= currMaxValue) {\n maxValue = value;\n maxValueFound = 1.0;\n maxPosition = ${this.flattenPositions?this.includeBatchIndex?"((batch * uniforms.xShape[1] + xR) * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d":"(xR * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d":"wR * uniforms.filterDims.y + wC"};\n }`}else t="resultValue = max(value, resultValue);";let e="resultValue";"avg"===this.poolType&&(e="resultValue / max(count, 1.0)");return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n let xRCCorner = vec2(coords.yz) * uniforms.strides - uniforms.pads;\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n\n ${this.computePositions?"var maxValue = 0.0;\n var maxValueFound = 0.0;\n var maxPosition = 0;":`var resultValue = ${"avg"===this.poolType?"0.0":"-1.0 / pow(10.0, -20.0)"};`}\n\n var count = 0.0;\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + uniforms.dilations.x) {\n let xR = xRCorner + wR;\n\n if (xR < 0 || xR >= uniforms.convDims.x) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + uniforms.dilations.y) {\n let xC = xCCorner + wC;\n if (xC < 0 || xC >= uniforms.convDims.y) {\n continue;\n }\n\n let value = getX(batch, xR, xC, d);\n ${t}\n }\n }\n\n ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${e});`}\n }\n }\n `}}class rr{constructor(t,e,n=!1,r=!1,i=!1){if(this.variableNames=["x"],this.uniforms="strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,",this.workgroupSize=[128,1,1],this.size=!0,"avg"===e&&n)throw new Error("Cannot compute positions for average pool.");this.outputShape=t.outShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=e,this.computePositions=n,this.flattenPositions=r,this.includeBatchIndex=i,this.shaderKey=`pool3D_${e}_${n}_${r}_${i}`}getUserCode(){let t;if("avg"===this.poolType)t="resultValue += value; count += 1.0;";else if(this.computePositions){t=`let currMaxValue = mix(value, maxValue, maxValueFound);\n if (value >= currMaxValue) {\n maxValue = value;\n maxValueFound = 1.0;\n maxPosition = ${this.flattenPositions?this.includeBatchIndex?"(((batch * uniforms.xShape.y + xD) * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch":"((xD * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch":"wD * uniforms.filterDims.y * uniforms.filterDims.y + wR * uniforms.filterDims.z + wC"};\n }`}else t="resultValue = max(value, resultValue);";let e="resultValue";"avg"===this.poolType&&(e="resultValue / max(count, 1.0)");return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let xCorner = vec3(coords.y, coords.z, coords.w) * uniforms.strides - uniforms.pads;\n let xDCorner = xCorner.x;\n let xRCorner = xCorner.y;\n let xCCorner = xCorner.z;\n\n ${this.computePositions?"var maxValue = 0.0;\n var maxValueFound = 0.0;\n var maxPosition = 0;":`var resultValue = ${"avg"===this.poolType?"0.0":"-1.0 / pow(10.0, -20.0)"};`}\n\n var count = 0.0;\n for (var wD = 0; wD < uniforms.filterDims.x; wD++) {\n let xD = xDCorner + wD;\n if (xD < 0 || xD >= uniforms.convDims.x) {\n continue;\n }\n\n for (var wR = 0; wR < uniforms.filterDims.y; wR++) {\n let xR = xRCorner + wR;\n if (xR < 0 || xR >= uniforms.convDims.y) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims.z; wC++) {\n let xC = xCCorner + wC;\n if (xC < 0 || xC >= uniforms.convDims.z) {\n continue;\n }\n\n let value = getX(batch, xD, xR, xC, ch);\n ${t}\n }\n }\n }\n\n ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${e});`}\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function ir(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{reductionIndices:o,keepDims:a}=r;return Bn(i,o,a,"max",n)}const or={kernelName:i.Max,backendName:"webgpu",kernelFunc:ir}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function ar(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{keepDims:o,axis:a}=r;return Bn(i,a,o,"mean",n)}const sr={kernelName:i.Mean,backendName:"webgpu",kernelFunc:ar}; +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function ur(t,e,n,r){if(1===e.filterWidth&&1===e.filterHeight&&i.util.arraysEqual(e.inShape,e.outShape))return Pe({inputs:{x:t},backend:r});if(e.filterWidth===e.inWidth&&e.filterHeight===e.inHeight&&1===e.batchSize&&"VALID"===e.padInfo.type){const o=t.shape.length,a=Ae({inputs:{x:t},backend:r,attrs:{shape:[t.shape[o-3]*t.shape[o-2],t.shape[o-1]]}});let s;"avg"===n?s=ar({inputs:{x:a},backend:r,attrs:{axis:0,keepDims:!1}}):(i.util.assert("max"===n,(()=>`Invalid pool type ${n}`)),s=ir({inputs:{x:a},backend:r,attrs:{reductionIndices:0,keepDims:!1}}));const u=Ae({inputs:{x:s},backend:r,attrs:{shape:e.outShape}});return r.disposeData(a.dataId),r.disposeData(s.dataId),u}let o;const a=[{type:"int32",data:[e.strideHeight,e.strideWidth]}];return 1===e.filterHeight&&1===e.filterWidth?o=new er(e):("avg"===n?o=new nr(e,"avg"):(i.util.assert("max"===n,(()=>`Invalid pool type ${n}`)),o=new nr(e,"max")),a.push({type:"int32",data:[e.padInfo.top,e.padInfo.left]},{type:"int32",data:[e.dilationHeight,e.dilationWidth]},{type:"int32",data:[e.inHeight,e.inWidth]},{type:"int32",data:[e.effectiveFilterHeight,e.effectiveFilterWidth]})),r.runWebGPUProgram(o,[t],t.dtype,a)}const lr={kernelName:i.AvgPool,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{filterSize:a,strides:s,pad:u,dimRoundingMode:l}=r;return ur(o,i.backend_util.computePool2DInfo(o.shape,a,s,1,u,l),"avg",n)}};const cr={kernelName:i.AvgPool3D,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{filterSize:a,strides:s,pad:u,dataFormat:l,dimRoundingMode:c}=r,h=i.backend_util.computePool3DInfo(o.shape,a,s,[1,1,1],u,c,l),d=new rr(h,"avg"),f=[{type:"int32",data:[h.strideDepth,h.strideHeight,h.strideWidth]},{type:"int32",data:[h.padInfo.front,h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.inDepth,h.inHeight,h.inWidth]},{type:"int32",data:[h.effectiveFilterDepth,h.effectiveFilterHeight,h.effectiveFilterWidth]}];return n.runWebGPUProgram(d,[o],o.dtype,f)}}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class hr{constructor(t){this.variableNames=["dy"],this.uniforms="strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32, avgMultiplier : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool2DBackprop"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let dyRCCorner = vec2(coords.yz) - uniforms.pads;\n let dyRCorner = dyRCCorner.x;\n let dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR = wR + uniforms.dilations[0]) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC = wC + uniforms.dilations[1]) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyR, idyC, d);\n\n dotProd = dotProd + dyValue * uniforms.avgMultiplier;\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}class dr{constructor(t){this.variableNames=["dy"],this.uniforms="strides : vec3, pads : vec3, filterDims : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool3DBackprop"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyDCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wD = 0; wD < uniforms.filterDims[0]; wD++) {\n let dyD = f32(dyDCorner + wD) / f32(uniforms.strides[0]);\n\n if (dyD < 0.0 || dyD >= f32(uniforms.outDepth) || fract(dyD) > 0.0) {\n continue;\n }\n let idyD = i32(dyD);\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyD, idyR, idyC, ch);\n dotProd += dyValue * uniforms.avgMultiplier;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}const fr={kernelName:i.AvgPool3DGrad,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:o,input:a}=e,s=a,{filterSize:u,strides:l,pad:c,dimRoundingMode:h}=r,d=i.backend_util.computePool3DInfo(s.shape,u,l,1,c,h),f=new dr(d),p=1/(d.filterDepth*d.filterHeight*d.filterWidth),m=[{type:"int32",data:[d.strideDepth,d.strideHeight,d.strideWidth]},{type:"int32",data:[d.effectiveFilterDepth-1-d.padInfo.front,d.effectiveFilterHeight-1-d.padInfo.top,d.effectiveFilterWidth-1-d.padInfo.left]},{type:"int32",data:[d.effectiveFilterDepth,d.effectiveFilterHeight,d.effectiveFilterWidth]},{type:"int32",data:[d.outDepth]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]},{type:"float32",data:[p]}];return n.runWebGPUProgram(f,[o],s.dtype,m)}};const pr={kernelName:i.AvgPoolGrad,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:o,input:a}=e,s=a;z([o,a],"avgPoolGrad");const{filterSize:u,strides:l,pad:c}=r,h=i.backend_util.computePool2DInfo(s.shape,u,l,1,c),d=new hr(h),f=1/(h.filterHeight*h.filterWidth),p=[{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.effectiveFilterHeight-1-h.padInfo.top,h.effectiveFilterWidth-1-h.padInfo.left]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]},{type:"int32",data:[h.effectiveFilterHeight,h.effectiveFilterWidth]},{type:"int32",data:[h.outHeight]},{type:"int32",data:[h.outWidth]},{type:"float32",data:[f]}];return n.runWebGPUProgram(d,[o],s.dtype,p)}};const mr={kernelName:i.BatchMatMul,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{a:i,b:o}=e,{transposeA:a,transposeB:s}=r;return Te({a:i,b:o,transposeA:a,transposeB:s,backend:n})}}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class gr{constructor(t,e){this.variableNames=["source"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.rank=e.length,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.start=t,this.uniforms=`start : ${v(t.length)}, `,this.shaderKey="slice"}getUserCode(){const t=v(this.rank),e=function(t){if(1===t)return"sourceLoc";if(t<=6)return vr.slice(0,t).map((t=>`sourceLoc.${t}`)).join(",");throw Error(`Slicing for rank ${t} is not yet supported`)}(this.rank);let n;n=1===this.start.length?this.outputShape.map(((t,e)=>"sourceLoc = uniforms.start + coords;")):this.outputShape.map(((t,e)=>`sourceLoc.${vr[e]} = uniforms.start.${y(e)} + coords.${vr[e]};`));return`\n ${b("index")} {\n if (index < uniforms.size) {\n var sourceLoc : ${t};\n let coords = getCoordsFromIndex(index);\n ${n.join("\n")}\n setOutputAtIndex(index, getSource(${e}));\n }\n }\n `}}const vr=["x","y","z","w","u","v"]; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function yr(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{begin:a,size:s}=r,[u,l]=i.slice_util.parseSliceParams(o,a,s);if(i.slice_util.assertParamsValid(o,u,l),n.shouldExecuteOnCPU([o])||"string"===o.dtype){const t=n.tensorMap.get(o.dataId),e=pn(t.values,u,l,o.shape,o.dtype);return n.makeTensorInfo(l,o.dtype,e)}if(0===i.util.sizeFromShape(l))return n.makeTensorInfo(l,o.dtype,[]);const c=new gr(u,l),h=[{type:"int32",data:u}];return n.runWebGPUProgram(c,[o],o.dtype,h)}const br={kernelName:i.Slice,backendName:"webgpu",kernelFunc:yr},xr={kernelName:i.BatchToSpaceND,backendName:"webgpu",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{blockShape:a,crops:s}=r;i.util.assert(o.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet"));const u=a.reduce(((t,e)=>t*e)),l=i.backend_util.getReshaped(o.shape,a,u),c=i.backend_util.getPermuted(l.length,a.length),h=i.backend_util.getReshapedPermuted(o.shape,a,u),d=i.backend_util.getSliceBeginCoords(s,a.length),f=i.backend_util.getSliceSize(h,s,a.length),p=[],m=Ae({inputs:{x:o},backend:n,attrs:{shape:l}}),g=Rn({inputs:{x:m},backend:n,attrs:{perm:c}}),v=Ae({inputs:{x:g},backend:n,attrs:{shape:h}}),y=yr({inputs:{x:v},backend:n,attrs:{begin:d,size:f}});return p.push(m),p.push(g),p.push(v),p.forEach((t=>n.disposeData(t.dataId))),y}},wr=`\n fn bincount_write(index: i32, value: f32) {\n ${f("&result[index]","value","float32")}\n }\n`;class _r{constructor(t,e,n=!1){this.outputShape=[],this.variableNames=["x"],this.uniforms="binCountSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.hasWeights=!0,this.binaryOutput=!1,this.outputShape=t,this.rank=t.length,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.binaryOutput=n,n&&(this.atomic=!1),this.hasWeights=e,this.hasWeights&&this.variableNames.push("w"),this.shaderKey=`bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`}getUserCode(){return`\n ${this.binaryOutput?"\n fn bincount_write(index: i32, value: f32) {\n atomicStore(&result[index], bitcast(value));\n }\n":wr}\n ${b("index")} {\n ${1===this.rank?`if (index < uniforms.xShape) {\n let indexVal = i32(getX(index));\n if (indexVal < uniforms.binCountSize) {\n let value = ${this.binaryOutput?1:this.hasWeights?"getW(index)":"1."};\n bincount_write(indexVal, value);\n }\n }`:`let coord = getCoordsFromIndex(index);\n if (coordsInBounds2D(coord, uniforms.xShape)) {\n let indexVal = i32(getX(coord[0], coord[1]));\n if (indexVal < uniforms.binCountSize) {\n let value = ${this.binaryOutput?1:this.hasWeights?"getW(coord[0], coord[1])":"1."};\n bincount_write(coord.x * uniforms.binCountSize + indexVal, value);\n }\n }`}\n }\n `}}const Sr={kernelName:i.Bincount,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,weights:a}=e,{size:s}=r,u=i.util.sizeFromShape(o.shape),l=i.util.sizeFromShape(a.shape)>0,c=[s],h=a.dtype,d=Ee({backend:n,attrs:{shape:c,value:0,dtype:h}}),f=new _r([u],l),p=[{type:"int32",data:[s]}],m=l?[o,a]:[o];return n.runWebGPUProgram(f,m,h,p,d)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Er{constructor(t){this.outputShape=[],this.variableNames=["s0","s1"],this.uniforms="s0Size : i32, s1Size : i32, ",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="broadcastArgs"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n var s0 = 1.0;\n var s1 = 1.0;\n let indexS0 = index - uniforms.size + uniforms.s0Size;\n let indexS1 = index - uniforms.size + uniforms.s1Size;\n if (indexS0 >= 0) {\n s0 = getS0(indexS0);\n }\n if (indexS1 >= 0) {\n s1 = getS1(indexS1);\n }\n\n if (s0 == 1.0) {\n setOutputAtIndex(index, s1);\n } else if (s1 == 1.0) {\n setOutputAtIndex(index, s0);\n } else if (s0 != s1) {\n setOutputAtIndex(index, uniforms.NAN);\n } else {\n setOutputAtIndex(index, s0);\n }\n }\n }\n `}}const Mr={kernelName:i.BroadcastArgs,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{s0:r,s1:o}=e;if(n.shouldExecuteOnCPU([r,o])){const t=n.tensorMap.get(r.dataId),e=n.tensorMap.get(o.dataId),a=t.values,s=e.values,u=i.backend_util.assertAndGetBroadcastShape(Array.from(a),Array.from(s));return n.makeTensorInfo([u.length],"int32",Int32Array.from(u))}const a=i.util.sizeFromShape(r.shape),s=i.util.sizeFromShape(o.shape),u=Math.max(a,s),l=new Er(u),c=[{type:"int32",data:[a]},{type:"int32",data:[s]}];return n.runWebGPUProgram(l,[r,o],"int32",c)}},Ar=Fe({opType:j.NOT_EQUAL,dtype:"bool",cpuKernelImpl:un}),Cr={kernelName:i.NotEqual,backendName:"webgpu",kernelFunc:Ar}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Tr(t){const{inputs:e,backend:n}=t,{input:r}=e;return Pe({inputs:{x:n.tensorMap.get(r.dataId).complexTensorInfos.real},backend:n})}const kr={kernelName:i.Real,backendName:"webgpu",kernelFunc:Tr};const Ir={kernelName:i.Cast,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function t(e){const{inputs:n,backend:r,attrs:o}=e,{x:a}=n,{dtype:s}=o;if("complex64"===s){if("complex64"===a.dtype)return Pe({inputs:{x:a},backend:r});const e=i.zeros(a.shape),n=t({inputs:{x:a},backend:r,attrs:{dtype:"float32"}}),o=Le({inputs:{real:n,imag:e},backend:r});return e.dispose(),r.disposeData(n.dataId),o}if("complex64"===a.dtype){const e=Tr({inputs:{input:a},backend:r}),n=t({inputs:{x:e},backend:r,attrs:{dtype:s}});return r.disposeData(e.dataId),n}if(!i.util.hasEncodingLoss(a.dtype,s)){const t=Pe({inputs:{x:a},backend:r});return{dataId:t.dataId,shape:t.shape,dtype:s}}if(r.shouldExecuteOnCPU([a])){const t=r.tensorMap.get(a.dataId).values,[e,n,i]=je(t,a.shape,a.dtype,s);return r.makeTensorInfo(e,n,i)}if("int32"===s) +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +return function(t,e){const n=new De(t.shape,yt.TO_INT),r=e.runWebGPUProgram(n,[t],"int32");return{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}(a,r);if("bool"===s){const t=r.makeTensorInfo([],"bool",i.util.getTypedArrayFromDType("bool",1)),e=Ar({inputs:{a,b:t},backend:r});return r.disposeData(t.dataId),e}throw new Error(`Error in Cast: failed to cast ${a.dtype} to ${s}`)}},Nr=ze({opType:yt.CEIL,cpuKernelImpl:Ve}),Pr={kernelName:i.Ceil,backendName:"webgpu",kernelFunc:Nr}; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Or{constructor(t){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workPerThread=4,this.workgroupSize=[64,1,1],this.outputComponent=4,this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="clipVec4"}getUserCode(){return`\n ${b("index")} {\n if(index < uniforms.size) {\n let value = getAByOutputIndex(index);\n var clampedValue = clamp(\n value, vec4(uniforms.minVal), vec4(uniforms.maxVal));\n clampedValue = select(clampedValue, value, isnanVec4(value));\n setOutputAtIndex(index, clampedValue);\n }\n }\n `}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Lr{constructor(t){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="clip"}getUserCode(){return`\n ${b("index")} {\n if(index < uniforms.size) {\n let value = getAByOutputIndex(index);\n if (isnan(value)) {\n setOutputAtIndex(index, value);\n return;\n }\n setOutputAtIndex(index, clamp(value, uniforms.minVal, uniforms.maxVal));\n }\n }\n `}}const Rr={kernelName:i.ClipByValue,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{clipValueMin:a,clipValueMax:s}=r;let u;const l=[{type:"float32",data:[a]},{type:"float32",data:[s]}];return u=i.util.sizeFromShape(o.shape)%4==0?new Or(o.shape):new Lr(o.shape),n.runWebGPUProgram(u,[o],o.dtype,l)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Dr{constructor(t){this.outputShape=[],this.variableNames=["real","imag"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="complexAbs"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let re = abs(getRealByOutputIndex(index));\n let im = abs(getImagByOutputIndex(index));\n let mx = max(re, im);\n\n // The length function in wgsl may be not underflow-safe on some GPUs.\n // So the safe solution is to ensure underflow-safety in all cases.\n setOutputAtIndex(index, select(mx * length(vec2(1, min(re, im)/mx)), 0.0, mx == 0.0));\n }\n }\n `}} +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function zr(t,e){return{dataId:e.dataId,dtype:e.dtype,shape:t.shape}}const Fr={kernelName:i.ComplexAbs,backendName:"webgpu",kernelFunc:function(t){const{inputs:e,backend:n}=t,{x:r}=e,i=n.tensorMap.get(r.dataId),o=new Dr(r.shape),a=[zr(r,i.complexTensorInfos.real),zr(r,i.complexTensorInfos.imag)];return n.runWebGPUProgram(o,a,a[0].dtype)}}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Br{constructor(t){this.uniforms="",this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=i.backend_util.computeOutShape(t,1),this.variableNames=t.map(((t,e)=>`T${e}`)),this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.offsetLength=t.length-1;for(let t=0;t0){t.push("if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }");for(let e=1;eTr({inputs:{input:t},backend:n}))),i=t.map((t=>Ur({inputs:{input:t},backend:n}))),o=Vr(r,e,n),a=Vr(i,e,n),s=Le({inputs:{real:o,imag:a},backend:n});return r.forEach((t=>n.disposeData(t.dataId))),i.forEach((t=>n.disposeData(t.dataId))),n.disposeData(o.dataId),n.disposeData(a.dataId),s}let o=n.shouldExecuteOnCPU(t);if("string"===r&&(o=!0),o){const o=t.map((t=>{const r=i.util.sizeFromShape(t.shape.slice(e));return Ae({inputs:{x:t},backend:n,attrs:{shape:[-1,r]}})})),a=o.map((t=>({vals:n.readSync(t.dataId),shape:t.shape}))),s=i.backend_util.computeOutShape(o.map((t=>t.shape)),1),u=1===o[0].shape[0],l=He(a,s,r,u),c=i.backend_util.computeOutShape(t.map((t=>t.shape)),e),h=n.makeTensorInfo(c,r,l);return o.forEach((t=>n.disposeData(t.dataId))),h}const a=n.device.limits.maxStorageBuffersPerShaderStage-1;if(t.length>a){const r=[];for(let i=0;it.shape)),e),o=t.map((t=>Ae({inputs:{x:t},backend:n,attrs:{shape:[i.util.sizeFromShape(t.shape.slice(0,e)),i.util.sizeFromShape(t.shape.slice(e))]}})));return{tensors2D:o,outShape:r}}(t,e,n),l=s.map((t=>t.shape)),c=new Br(l),h=[],d=new Array(l.length-1);if(d.length>0){d[0]=l[0][1],h.push({type:"int32",data:[d[0]]});for(let t=1;tn.disposeData(t.dataId)));const p=Ae({inputs:{x:f},backend:n,attrs:{shape:u}});return n.disposeData(f.dataId),p} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Hr(t){const{inputs:e,backend:n,attrs:r}=t,{axis:o}=r,a=i.util.parseAxisParam(o,e[0].shape)[0],s=e.map((t=>t.shape));i.backend_util.assertParamsConsistent(s,a);const u=i.backend_util.computeOutShape(e.map((t=>t.shape)),a);if(0===i.util.sizeFromShape(u))return n.makeTensorInfo(u,e[0].dtype,[]);const l=e.filter((t=>i.util.sizeFromShape(t.shape)>0));return 1===l.length?Pe({inputs:{x:l[0]},backend:n}):Vr(l,a,n)}const Gr={kernelName:i.Concat,backendName:"webgpu",kernelFunc:Hr};class Wr{constructor(t,e,n,r,i=!1,o=null,a=!1,s=!1){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=t.outShape,this.isChannelsLast="channelsLast"===t.dataFormat,this.isVec4=((t.inChannels%4==0||t.inChannels%3==0)&&this.isChannelsLast||t.outWidth%4==0&&!this.isChannelsLast)&&t.outChannels%4==0,this.dispatchLayout=this.isChannelsLast?{x:[3],y:[1,2],z:[0]}:{x:[2,3],y:[1],z:[0]},this.workgroupSize=P(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=O(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4?(this.outputComponent=4,this.isChannelsLast&&t.inChannels%4!=0?(this.innerElementSize=3,this.variableComponents=[1,4]):(this.innerElementSize=4,this.variableComponents=[4,4]),i&&(this.variableNames.push("bias"),this.variableComponents.push(4)),a&&(this.variableNames.push("preluActivationWeights"),this.variableComponents.push(4))):(this.innerElementSize=this.elementsPerThread[0],i&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights")),this.sequentialAccessByThreads=s,this.addBias=i,this.activation=o,this.hasPreluActivationWeights=a,this.tileAOuter=this.workgroupSize[1]*this.elementsPerThread[1],this.tileBOuter=this.workgroupSize[0]*this.elementsPerThread[0],this.tileInner=Math.max(this.workgroupSize[0]*this.innerElementSize,this.workgroupSize[1]),this.fitAOuter=e%this.tileAOuter==0,this.fitBOuter=n%this.tileBOuter==0,this.fitInner=r%this.tileInner==0,this.shaderKey=`conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`}getUserCode(){const t=this.isVec4?me(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner):ve(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner,!1,null,this.sequentialAccessByThreads),e=this.isVec4?[this.innerElementSize,4,4]:[1,1,1];return`\n ${ +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t,e,n,r,i=!1,o=null,a=!1,s=4,u=4,l=4){const c=t?"\n let coord = vec4(batch, xRow, xCol, xCh);\n ":"\n let coord = vec4(batch, xCh, xRow, xCol);\n ",h=t?"\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n ":"\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n ",d=t?"uniforms.xShape[1]":"uniforms.xShape[2]",f=t?"uniforms.xShape[2]":"uniforms.xShape[3]",p=t?"row":"col",m=t?"col":"row",v=`\n let inChannels = uniforms.wShape[2];\n let outWidth = ${t?"uniforms.outShape[2]":"uniforms.outShape[3]"};\n let outRow = ${p} / outWidth;\n let outCol = ${p} % outWidth;\n\n let WRow = ${m} / (uniforms.filterDims[1] * inChannels);\n let WCol = ${m} / inChannels % uniforms.filterDims[1];\n let xRow = outRow * uniforms.strides[0] + uniforms.dilations[0] * WRow - uniforms.pads[0];\n let xCol = outCol * uniforms.strides[1] + uniforms.dilations[1] * WCol - uniforms.pads[1];\n let xCh = ${m} % inChannels;\n var resData = ${g(s)}(0.0);\n // The bounds checking is always needed since we use it to pad zero for\n // the 'same' padding type.\n if (xRow >= 0 && xRow < ${d} && xCol >= 0 && xCol < ${f}) {\n ${c}\n let xIndex = getIndexFromCoords4D(coord, uniforms.xShape);\n ${(t=>{switch(t){case 1:return"resData = f32(x[xIndex]);";case 3:return"resData = vec3(x[xIndex], x[xIndex + 1], x[xIndex + 2]);";case 4:return"resData = vec4(x[xIndex / 4]);";default:throw new Error(`innerElementSize ${t} is not supported.`)}})(s)}\n }\n return resData;`,y=t?e&&r?`\n ${v}`:`\n if (row < uniforms.dimAOuter && col < uniforms.dimInner) {\n ${v}\n }\n return ${g(s)}(0.0);`:r&&n?`\n ${v}`:`\n if (row < uniforms.dimInner && col < uniforms.dimBOuter) {\n ${v}\n }\n return ${g(s)}(0.0);`,b=`${(t=>{switch(t){case 1:return"return f32(W[row * uniforms.wShape[3] + col]);";case 4:return"return vec4(W[(row * uniforms.wShape[3] + col) / 4]);";default:throw new Error(`innerElementSize ${t} is not supported.`)}})(u)}`,x=g(l),w=g(t?s:u),_=g(t?u:s);return`\n ${he(o,a,4===l,4)}\n fn mm_readA(batch: i32, row : i32, col : i32) -> ${w} {\n ${t?y:b}\n }\n\n fn mm_readB(batch: i32, row : i32, col : i32) -> ${_} {\n ${t?b:y}\n }\n\n fn mm_write(batch: i32, row : i32, col : i32, valueIn : ${x}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)\n {\n var value = valueIn;\n let outWidth = ${t?"uniforms.outShape[2]":"uniforms.outShape[3]"};\n ${h}\n ${de(i,o)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }`}(this.isChannelsLast,this.fitAOuter,this.fitBOuter,this.fitInner,this.addBias,this.activation,this.hasPreluActivationWeights,e[0],e[1],e[2])}\n ${t}\n `}} +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Xr{constructor(t,e=!1,n=null,r=!1){this.variableNames=["x","W"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,",this.workgroupSize=[4,4,8],this.outputShape=t.outShape,this.isChannelsLast="channelsLast"===t.dataFormat,this.dispatchLayout=this.isChannelsLast?{x:[2],y:[1],z:[0,3]}:{x:[3],y:[2],z:[0,1]},this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=e,this.activation=n,this.hasPreluActivationWeights=r,e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`conv2dnaive_${this.activation}_${this.isChannelsLast}`}getUserCode(){return`\n ${he(this.activation,this.hasPreluActivationWeights,!1,4)}\n fn readInp(batch : i32, row : i32, col : i32, chan : i32) -> f32{\n let coords = vec4(batch, row, col, chan);\n if (coordsInBounds4D(coords, uniforms.xShape)) {\n return getX(batch, row, col, chan);\n } else {\n return 0.0;\n }\n }\n fn readFilt(row : i32, col : i32, xChannel : i32, outChannel : i32) -> f32{\n let coords = vec4(row, col, xChannel, outChannel);\n if(coordsInBounds4D(coords, uniforms.wShape)) {\n return getW(row, col, xChannel, outChannel);\n } else {\n return 0.0;\n }\n }\n fn writeResult(batch : i32, row : i32, col : i32, chan : i32, valueIn : f32) {\n let coords = ${this.isChannelsLast?"vec4(batch, row, col, chan);":"vec4(batch, chan, row, col);"}\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n var value = valueIn;\n ${de(this.addBias,this.activation)}\n setOutputAtCoords(coords.x, coords.y, coords.z, coords.w, value);\n }\n }\n ${b("index")} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let outChannel = ${this.isChannelsLast?"coords[3];":"coords[1];"}\n let outRow = ${this.isChannelsLast?"coords[1];":"coords[2];"}\n let outCol = ${this.isChannelsLast?"coords[2];":"coords[3];"}\n var acc : f32 = 0.0;\n for (var row = 0; row < uniforms.filterDims[0]; row = row + 1) {\n for (var col = 0; col < uniforms.filterDims[1]; col = col + 1) {\n let xRow = outRow * uniforms.strides[0] + uniforms.dilations[0] * row - uniforms.pads[0];\n let xCol = outCol * uniforms.strides[1] + uniforms.dilations[1] * col - uniforms.pads[1];\n for (var xChannel = 0; xChannel < ${this.isChannelsLast?"uniforms.xShape[3];":"uniforms.xShape[1];"} xChannel = xChannel + 1) {\n ${this.isChannelsLast?"let v = readInp(batch, xRow, xCol, xChannel);":"let v = readInp(batch, xChannel, xRow, xCol);"}\n let f = readFilt(row, col, xChannel, outChannel);\n acc = acc + v * f;\n }\n }\n }\n writeResult(batch, outRow, outCol, outChannel, acc);\n }\n `}} +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Yr{constructor(t,e){this.variableNames=["x"],this.uniforms="pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32,\n inChannels : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e,this.shaderKey=`im2col_${this.isChannelsLast}`}getUserCode(){const t=this.isChannelsLast?1:2,e=this.isChannelsLast?2:3,n=this.isChannelsLast?"coords[1]":"coords[2]",r=this.isChannelsLast?"coords[2]":"coords[1]",i=this.isChannelsLast?"getX(batch, xRow, xCol, ch)":"getX(batch, ch, xRow, xCol)";return`\n ${b("index")} {\n let coords = getCoordsFromIndex(index);\n if(index < uniforms.size) {\n let batch = coords[0];\n let row = ${n};\n let col = ${r};\n let offsetY = (row / uniforms.outWidth) * uniforms.strides[0] - uniforms.pads[0];\n let xRow = offsetY + uniforms.dilations[0] * (col / uniforms.itemsPerBlockRow);\n var value = 0.0;\n if(xRow < uniforms.xShape[${t}] && xRow >= 0) {\n let offsetX = (row % uniforms.outWidth) * uniforms.strides[1] -\n uniforms.pads[1];\n let xCol = offsetX + uniforms.dilations[1] * ((col %\n uniforms.itemsPerBlockRow) / uniforms.inChannels);\n let ch = col % uniforms.inChannels;\n if(xCol < uniforms.xShape[${e}] && xCol >= 0) {\n value = ${i};\n }\n }\n setOutputAtIndex(index, value);\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function qr(t,e){const n=t.length;return n>=3?e?[...t.slice(0,-3),t[n-3]*t[n-2],t[n-1]]:[...t.slice(0,-3),t[n-3],t[n-2]*t[n-1]]:!e&&1===n&&t[0]>1?[t[0],1]:null}function $r({x:t,filter:e,convInfo:n,backend:r,bias:o=null,preluActivationWeights:a=null,leakyreluAlpha:s=0,activation:u=null}){const l=null!=o,c=null!=a,h="channelsLast"===n.dataFormat,d=h&&n.filterHeight===n.inHeight&&n.filterWidth===n.inWidth&&"VALID"===n.padInfo.type,f=(0,i.env)().getBool("WEBGPU_USE_NAIVE_CONV2D_DEBUG");if(!f&&(d||1===n.filterHeight&&1===n.filterWidth&&1===n.dilationHeight&&1===n.dilationWidth&&1===n.strideHeight&&1===n.strideWidth&&("SAME"===n.padInfo.type||"VALID"===n.padInfo.type)))return function({x:t,filter:e,convInfo:n,backend:r,bias:i=null,preluActivationWeights:o=null,leakyreluAlpha:a=0,activation:s=null}){const u="channelsLast"===n.dataFormat,l=!u,c=[];let h,d;if(u&&n.filterHeight===n.inHeight&&n.filterWidth===n.inWidth&&"VALID"===n.padInfo.type){const i=n.inHeight*n.inWidth*n.inChannels;h=Ae({inputs:{x:t},backend:r,attrs:{shape:[1,n.batchSize,i]}}),d=Ae({inputs:{x:e},backend:r,attrs:{shape:[1,i,n.outChannels]}})}else h=Ae({inputs:{x:t},backend:r,attrs:{shape:u?[n.batchSize,n.inHeight*n.inWidth,n.inChannels]:[n.batchSize,n.inChannels,n.inHeight*n.inWidth]}}),d=Ae({inputs:{x:e},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}});if(c.push(h),c.push(d),null!=o){const t=qr(o.shape,u);null!=t&&(o=Ae({inputs:{x:o},backend:r,attrs:{shape:t}}),c.push(o))}if(null!=i){const t=qr(i.shape,u);null!=t&&(i=Ae({inputs:{x:i},backend:r,attrs:{shape:t}}),c.push(i))}const f=Te({a:u?h:d,b:u?d:h,transposeA:l,transposeB:!1,backend:r,bias:i,activation:s,preluActivationWeights:o,leakyreluAlpha:a}),p=Ae({inputs:{x:f},backend:r,attrs:{shape:n.outShape}});c.push(f);for(const t of c)r.disposeData(t.dataId);return p}({x:t,filter:e,convInfo:n,backend:r,bias:o,activation:u,preluActivationWeights:a,leakyreluAlpha:s});const p=(0,i.env)().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),m=p>-1?p:r.thresholdToIncreaseWorkgroups,g=n.batchSize*Math.ceil(n.outHeight*n.outWidth/32)*Math.ceil(n.outChannels/32);if((0,i.env)().getBool("WEBGPU_CONV_SEPARATE_IM2COL_SHADER")||g<=m)return function({x:t,filter:e,convInfo:n,backend:r,bias:i=null,preluActivationWeights:o=null,leakyreluAlpha:a=0,activation:s=null}){const{filterWidth:u,filterHeight:l,inChannels:c,strideWidth:h,strideHeight:d,padInfo:f,outWidth:p,outHeight:m,dilationWidth:g,dilationHeight:v,dataFormat:y}=n,b="channelsLast"===y,x=u*l*c,w=m*p,_=b?[n.batchSize,w,x]:[n.batchSize,x,w],S=new Yr(_,b),E=[{type:"int32",data:[f.top,f.left]},{type:"int32",data:[d,h]},{type:"int32",data:[v,g]},{type:"int32",data:[p]},{type:"int32",data:[c*u]},{type:"int32",data:[c]}],M=r.runWebGPUProgram(S,[t],t.dtype,E),A=[];A.push(M);const C=Ae({inputs:{x:e},backend:r,attrs:{shape:[1,x,-1]}});if(A.push(C),null!=o){const t=qr(o.shape,b);null!=t&&(o=Ae({inputs:{x:o},backend:r,attrs:{shape:t}}),A.push(o))}if(null!=i){const t=qr(i.shape,b);null!=t&&(i=Ae({inputs:{x:i},backend:r,attrs:{shape:t}}),A.push(i))}const T=Te({a:b?M:C,b:b?C:M,transposeA:!b,transposeB:!1,backend:r,bias:i,activation:s,preluActivationWeights:o,leakyreluAlpha:a}),k=Ae({inputs:{x:T},backend:r,attrs:{shape:n.outShape}});A.push(T);for(const t of A)r.disposeData(t.dataId);return k}({x:t,filter:e,convInfo:n,backend:r,bias:o,preluActivationWeights:a,leakyreluAlpha:s,activation:u});let v;const y=[n.padInfo.top,n.padInfo.left],b=[{type:"int32",data:[n.filterHeight,n.filterWidth]},{type:"int32",data:[...y]},{type:"int32",data:[n.strideHeight,n.strideWidth]},{type:"int32",data:[n.dilationHeight,n.dilationWidth]}];if(f)v=new Xr(n,l,u,c);else{const t=h?n.outHeight*n.outWidth:n.outChannels,e=h?n.outChannels:n.outHeight*n.outWidth,i=n.filterHeight*n.filterWidth*n.inChannels;b.push({type:"int32",data:[t]},{type:"int32",data:[e]},{type:"int32",data:[i]});const o=r.adapterInfo.isIntel();v=new Wr(n,t,e,i,l,u,c,o)}const x=[],w=[t,e];l&&(h||1!==o.shape.length||(o=Ae({inputs:{x:o},backend:r,attrs:{shape:[o.shape[0],1,1]}}),x.push(o)),w.push(o)),c&&(h||1!==a.shape.length||(a=Ae({inputs:{x:a},backend:r,attrs:{shape:[a.shape[0],1,1]}}),x.push(a)),w.push(a)),"leakyrelu"===u&&(b.push({type:"float32",data:[s]}),v.uniforms+=" alpha : f32,");const _=r.runWebGPUProgram(v,w,t.dtype,b);for(const t of x)r.disposeData(t.dataId);return _}const Kr={kernelName:i.Conv2D,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,attrs:n,backend:r}=t,{x:o,filter:a}=e,{strides:s,pad:u,dataFormat:l,dilations:c,dimRoundingMode:h}=n,d=i.backend_util.convertConv2DDataFormat(l);return $r({x:o,filter:a,convInfo:i.backend_util.computeConv2DInfo(o.shape,a.shape,s,c,u,h,!1,d),backend:r})}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Zr{constructor(t){this.variableNames=["dy","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,",this.workgroupSize=[64,1,1],this.size=!1,this.isVec4=!1,this.workPerThread=1,this.outputShape=t.inShape,this.isChannelsLast="channelsLast"===t.dataFormat,this.isVec4=this.isChannelsLast&&t.outChannels%4==0&&t.inChannels%4==0,this.isVec4?(this.workPerThread=2,this.outputComponent=4,this.workgroupSize=[4,4,4],this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[4,this.workPerThread,1])):(this.size=!0,this.workPerThread=1,this.workgroupSize=[64,1,1],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize)),this.shaderKey=`conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`}getUserCode(){const t=this.isChannelsLast?1:2,e=this.isChannelsLast?2:3,n=this.isChannelsLast?3:1,r=`\n ${b()} {\n let batch = i32(globalId.z) / uniforms.outShape[1];\n let r = i32(globalId.z) % uniforms.outShape[1];\n let c = i32(globalId.y) * ${this.workPerThread};\n let d1 = i32(globalId.x) * 4;\n\n let dyCorner = vec2(r, c) - uniforms.pads;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd: array, ${this.workPerThread}>;\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = vec4(0.0);\n }\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + 1) {\n let dyR = f32(dyCorner.x + wR) / f32(uniforms.strides.x);\n let wRPerm = uniforms.filterDims.x - 1 - wR;\n if (dyR < 0.0 || dyR >= f32(uniforms.outBackprop[1]) ||\n fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + 1) {\n let dyC = f32(dyCorner.y + wC) / f32(uniforms.strides.y);\n let dyC2 = f32(dyCorner.y + 1 + wC) / f32(uniforms.strides.y);\n let wCPerm = uniforms.filterDims.y - 1 - wC;\n var bDyCVal = true;\n var bDyCVal2 = true;\n if (dyC < 0.0 || dyC >= f32(uniforms.outBackprop[2]) ||\n fract(dyC) > 0.0) {\n bDyCVal = false;\n }\n if (dyC2 < 0.0 || dyC2 >= f32(uniforms.outBackprop[2]) ||\n fract(dyC2) > 0.0) {\n bDyCVal2 = false;\n }\n\n let idyC = i32(dyC);\n let idyC2 = i32(dyC2);\n if (bDyCVal && bDyCVal2) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n xValue = getDy(batch, idyR, idyC2, d2);\n dotProd[1] = dotProd[1] + vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n }\n } else if (bDyCVal) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n }\n } else if (bDyCVal2) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC2, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[1] = dotProd[1] + tmpval;\n }\n }\n }\n }\n\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let coords = vec4(batch, r, c + i, d1);\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], dotProd[i]);\n }\n }\n }\n `;return this.isVec4?`\n ${r}\n `:`\n ${b("index")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d1 = coords[${n}];\n\n let dyCorner = vec2(coords[${t}], coords[${e}]) - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + 1) {\n let dyR = (f32(dyRCorner) + f32(wR)) / f32(uniforms.strides.x);\n let wRPerm = uniforms.filterDims.x - 1 - wR;\n if (dyR < 0.0 || dyR >= f32(uniforms.outBackprop[1]) || fract(dyR) > 0.0 ||\n wRPerm < 0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + 1) {\n let dyC = (f32(dyCCorner) + f32(wC)) / f32(uniforms.strides.y);\n let wCPerm = uniforms.filterDims.y - 1 - wC;\n if (dyC < 0.0 || dyC >= f32(uniforms.outBackprop[2]) ||\n fract(dyC) > 0.0 || wCPerm < 0) {\n continue;\n }\n let idyC = i32(dyC);\n\n for (var d2 = 0; d2 < uniforms.outBackprop[3]; d2 = d2 + 1) {\n let xValue = ${this.isChannelsLast?"getDy(batch, idyR, idyC, d2)":"getDy(batch, d2, idyR, idyC)"};\n let wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd = dotProd + xValue * wValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}class Qr{constructor(t){this.variableNames=["x","dy"],this.uniforms="pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast="channelsLast"===t.dataFormat,this.shaderKey=`conv2DDerFilter_${this.isChannelsLast}`}getUserCode(){return`\n ${b("index")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wR = coords[0];\n let wC = coords[1];\n let d1 = coords[2];\n let d2 = coords[3];\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b = b + 1) {\n for (var yR = 0; yR < uniforms.outHeight; yR = yR + 1) {\n let xR = wR + yR * uniforms.strides[0] - uniforms.pads[0];\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC = yC + 1) {\n let xC = wC + yC * uniforms.strides[1] - uniforms.pads[1];\n\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n if (${this.isChannelsLast}) {\n let dyValue = getDy(b, yR, yC, d2);\n let xValue = getX(b, xR, xC, d1);\n dotProd = dotProd + xValue * dyValue;\n } else {\n let dyValue = getDy(b, d2, yR, yC);\n let xValue = getX(b, d1, xR, xC);\n dotProd = dotProd + xValue * dyValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}class Jr{constructor(t){this.variableNames=["x","dy"],this.uniforms="pads : vec3, strides : vec3, batchSize : i32, outDepth : i32,\n outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerFilter"}getUserCode(){return`\n ${b("index")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wF = coords.x;\n let wR = coords.y;\n let wC = coords.z;\n let d1 = coords.w;\n let d2 = coords.u;\n\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b++) {\n for (var yF = 0; yF < uniforms.outDepth; yF++) {\n let xF = wF + yF * uniforms.strides[0] - uniforms.pads[0];\n if (xF < 0 || xF >= uniforms.inDepth) {\n continue;\n }\n\n for (var yR = 0; yR < uniforms.outHeight; yR++) {\n let xR = wR + yR * uniforms.strides[1] - uniforms.pads[1];\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC++) {\n let xC = wC + yC * uniforms.strides[2] - uniforms.pads[2];\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n let dyValue = getDy(b, yF, yR, yC, d2);\n let xValue = getX(b, xF, xR, xC, d1);\n dotProd += xValue * dyValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}class ti{constructor(t){this.variableNames=["dy","W"],this.uniforms="filterDims : vec3, pads : vec3, strides : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerInput"}getUserCode(){return`\n ${b("index")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let d1 = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyFCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n var dotProd = 0.0;\n for (var wF = 0; wF < uniforms.filterDims[0]; wF++) {\n let dyF = f32(dyFCorner + wF) / f32(uniforms.strides[0]);\n if (dyF < 0.0 || dyF >= f32(uniforms.outDepth) || fract(dyF) > 0.0) {\n continue;\n }\n let idyF = i32(dyF);\n\n let wFPerm = uniforms.filterDims[0] - 1 - wF;\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n let wRPerm = uniforms.filterDims[1] - 1 - wR;\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let wCPerm = uniforms.filterDims[2] - 1 - wC;\n\n for (var d2 = 0; d2 < uniforms.outChannels; d2++) {\n let xValue = getDy(batch, idyF, idyR, idyC, d2);\n let wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}const ei={kernelName:i.Conv2DBackpropFilter,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,dy:a}=e,{strides:s,pad:u,dataFormat:l,dimRoundingMode:c,filterShape:h}=r,d=i.backend_util.convertConv2DDataFormat(l),f=i.backend_util.computeConv2DInfo(o.shape,h,s,1,u,c,!1,d),p=new Qr(f),m=[{type:"int32",data:[f.padInfo.top,f.padInfo.left]},{type:"int32",data:[f.strideHeight,f.strideWidth]},{type:"int32",data:[f.batchSize]},{type:"int32",data:[f.outHeight]},{type:"int32",data:[f.outWidth]},{type:"int32",data:[f.inHeight]},{type:"int32",data:[f.inWidth]}];return n.runWebGPUProgram(p,[o,a],o.dtype,m)}};class ni{constructor(t){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=t.inShape,i.util.assert("channelsLast"===t.dataFormat,(()=>"TODO: NCHW is unimplemented")),this.isVec4=t.inChannels%4==0&&t.outChannels%4==0,this.dispatchLayout={x:[3],y:[1,2],z:[0]},this.workgroupSize=P(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=O(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4&&(this.outputComponent=4,this.variableComponents=[4,1]),this.shaderKey=`conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`}getUserCode(){const t=this.isVec4?me(this.elementsPerThread,this.workgroupSize):ve(this.elementsPerThread,this.workgroupSize);return`\n ${ +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t=4){const e=`if (row < uniforms.dimAOuter && col < uniforms.dimInner) {\n \n let outRow = row / uniforms.outShape[2];\n let outCol = row % uniforms.outShape[2];\n\n let WRow = col / (uniforms.filterDims[1] * uniforms.outBackprop[3]);\n let WCol = col / uniforms.outBackprop[3] % uniforms.filterDims[1];\n let xR = f32(outRow - uniforms.pads[0] + WRow) / f32(uniforms.strides[0]);\n let xC = f32(outCol - uniforms.pads[1] + WCol) / f32(uniforms.strides[1]);\n if (xR < 0.0 || xR >= f32(uniforms.outBackprop[1]) || fract(xR) > 0.0) {\n return ${g(t)}(0.0);\n }\n if (xC < 0.0 || xC >= f32(uniforms.outBackprop[2]) || fract(xC) > 0.0) {\n return ${g(t)}(0.0);\n }\n let coord = vec4(\n batch,\n i32(xR),\n i32(xC),\n col % uniforms.outBackprop[3]);\n return x[getIndexFromCoords4D(coord, uniforms.xShape)/${t}];\n }\n return ${g(t)}(0.0);`;return`\n fn mm_readA(batch: i32, row : i32, col : i32) -> ${g(t)} {\n ${e}\n }\n\n fn mm_readB(batch: i32, row : i32, col : i32) -> ${g(t)} {\n let coordX = uniforms.filterDims.x - 1 -\n row / (uniforms.filterDims[1] * uniforms.outBackprop[3]);\n let coordY = uniforms.filterDims.y - 1 -\n (row / uniforms.outBackprop[3]) % uniforms.filterDims[1];\n if (row < uniforms.dimInner && col < uniforms.dimBOuter &&\n coordX >= 0 && coordY >= 0) {\n let rowInner = row % uniforms.outBackprop[3];\n let coord = vec4(coordX, coordY, col, rowInner);\n ${(t=>{switch(t){case 1:return"return W[getIndexFromCoords4D(coord, uniforms.wShape)];";case 4:return"\n let coord1 = vec4(coordX, coordY, col + 1, rowInner);\n let coord2 = vec4(coordX, coordY, col + 2, rowInner);\n let coord3 = vec4(coordX, coordY, col + 3, rowInner);\n let v0 = W[getIndexFromCoords4D(coord, uniforms.wShape)];\n let v1 = W[getIndexFromCoords4D(coord1, uniforms.wShape)];\n let v2 = W[getIndexFromCoords4D(coord2, uniforms.wShape)];\n let v3 = W[getIndexFromCoords4D(coord3, uniforms.wShape)];\n return vec4(v0, v1, v2, v3);\n ";default:throw new Error(`innerElementSize ${t} is not supported.`)}})(t)}\n }\n return ${g(t)}(0.0);\n }\n\n fn mm_write(batch: i32, row : i32, col : i32, valueInput : ${g(t)}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) {\n var value = valueInput;\n let outCoord = vec4(\n batch,\n row / uniforms.outShape[2],\n row % uniforms.outShape[2],\n col);\n result[getIndexFromCoords4D(outCoord, uniforms.outShape)/${t}] = value;\n }\n }`}(this.isVec4?4:1)}\n ${t}\n `}}const ri={kernelName:i.Conv2DBackpropInput,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:o,filter:a}=e,{inputShape:s,strides:u,pad:l,dataFormat:c,dimRoundingMode:h}=r,d=i.backend_util.convertConv2DDataFormat(c),f=i.backend_util.computeConv2DInfo(s,a.shape,u,1,l,h,!1,d),p=[{type:"int32",data:[f.filterHeight,f.filterWidth]},{type:"int32",data:[f.filterHeight-1-f.padInfo.top,f.filterWidth-1-f.padInfo.left]},{type:"int32",data:[f.strideHeight,f.strideWidth]},{type:"int32",data:[f.batchSize,f.outHeight,f.outWidth,f.outChannels]}];let m;if((0,i.env)().getBool("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE")||"channelsLast"!==f.dataFormat)m=new Zr(f);else{m=new ni(f);const t=f.inHeight*f.inWidth,e=f.inChannels,n=f.filterHeight*f.filterWidth*f.outChannels;p.push({type:"uint32",data:[t]},{type:"uint32",data:[e]},{type:"uint32",data:[n]})}return n.runWebGPUProgram(m,[o,a],"float32",p)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class ii{constructor(t){this.variableNames=["x","W"],this.uniforms="filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3dnaive"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords.x;\n let d2 = coords.u;\n\n let xFRCCorner = vec3(coords.y, coords.z, coords.w) * uniforms.strides - uniforms.pads;\n let xFCorner = xFRCCorner.x;\n let xRCorner = xFRCCorner.y;\n let xCCorner = xFRCCorner.z;\n\n let inputDepthNearestVec4 = (uniforms.xShape.u / 4) * 4;\n let inputDepthVec4Remainder = uniforms.xShape.u % 4;\n\n var dotProd = 0.0;\n for (var wF = 0; wF < uniforms.filterDims[0]; wF++) {\n let xF = xFCorner + wF * uniforms.dilations[0];\n if (xF < 0 || xF >= uniforms.xShape.y) {\n continue;\n }\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let xR = xRCorner + wR * uniforms.dilations[1];\n if (xR < 0 || xR >= uniforms.xShape.z) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let xC = xCCorner + wC * uniforms.dilations[2];\n if (xC < 0 || xC >= uniforms.xShape.w) {\n continue;\n }\n\n for (var d1 = 0; d1 < inputDepthNearestVec4; d1 += 4) {\n let xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n let wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (inputDepthVec4Remainder == 1) {\n dotProd += getX(batch, xF, xR, xC, inputDepthNearestVec4) *\n getW(wF, wR, wC, inputDepthNearestVec4, d2);\n } else if (inputDepthVec4Remainder == 2) {\n let xValues = vec2(\n getX(batch, xF, xR, xC, inputDepthNearestVec4),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)\n );\n let wValues = vec2(\n getW(wF, wR, wC, inputDepthNearestVec4, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (inputDepthVec4Remainder == 3) {\n let xValues = vec3(\n getX(batch, xF, xR, xC, inputDepthNearestVec4),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)\n );\n let wValues = vec3(\n getW(wF, wR, wC, inputDepthNearestVec4, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 1, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }`}}const oi={kernelName:i.Conv3D,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,filter:a}=e,{strides:s,pad:u,dilations:l}=r,c=i.backend_util.computeConv3DInfo(o.shape,a.shape,s,l,u),h=[c.padInfo.front,c.padInfo.top,c.padInfo.left],d=[{type:"int32",data:[c.filterDepth,c.filterHeight,c.filterWidth]},{type:"int32",data:[...h]},{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.dilationDepth,c.dilationHeight,c.dilationWidth]}],f=new ii(c),p=(0,i.upcastType)(o.dtype,a.dtype);return n.runWebGPUProgram(f,[o,a],p,d)}};const ai={kernelName:i.Conv3DBackpropFilterV2,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,dy:a}=e,{strides:s,pad:u,filterShape:l}=r,c=i.backend_util.computeConv3DInfo(o.shape,l,s,1,u),h=new Jr(c),d=[{type:"int32",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.batchSize]},{type:"int32",data:[c.outDepth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.inDepth]},{type:"int32",data:[c.inHeight]},{type:"int32",data:[c.inWidth]}];return n.runWebGPUProgram(h,[o,a],a.dtype,d)}};const si={kernelName:i.Conv3DBackpropInputV2,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:o,filter:a}=e,{strides:s,pad:u,inputShape:l}=r,c=i.backend_util.computeConv3DInfo(l,a.shape,s,1,u),h=new ti(c),d=[{type:"int32",data:[c.filterDepth,c.filterHeight,c.filterWidth]},{type:"int32",data:[c.filterDepth-1-c.padInfo.front,c.filterHeight-1-c.padInfo.top,c.filterWidth-1-c.padInfo.left]},{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.outDepth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.outChannels]}];return n.runWebGPUProgram(h,[o,a],o.dtype,d)}},ui=ze({opType:yt.COS}),li={kernelName:i.Cos,backendName:"webgpu",kernelFunc:ui},ci=ze({opType:yt.COSH}),hi={kernelName:i.Cosh,backendName:"webgpu",kernelFunc:ci}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class di{constructor(t,e,n,r){this.variableNames=["Image","Boxes","BoxInd"],this.uniforms="extrapolationValue : f32,",this.workgroupSize=[64,1,1],this.size=!0;const[i]=e;this.outputShape=[i,n[0],n[1],t],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.methodId="bilinear"===r?1:0,this.cropHeightBiggerThan1=this.outputShape[1]>1,this.cropWidthBiggerThan1=this.outputShape[2]>1,this.shaderKey=`cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`}getUserCode(){const[t,e]=["f32(uniforms.imageShape[1] - 1)","f32(uniforms.imageShape[2] - 1)"],[n,r,i]=this.cropHeightBiggerThan1?[`(${t} / f32(uniforms.outShape[1] - 1))`,"(y2-y1) * height_ratio",`y1*${t} + f32(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${t}`],[o,a,s]=this.cropWidthBiggerThan1?[`(${e} / f32(uniforms.outShape[2] - 1))`,"(x2-x1) * width_ratio",`x1*${e} + f32(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${e}`];return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let height_ratio = f32(${n});\n let width_ratio = f32(${o});\n let b = coords[0];\n let y = coords[1];\n let x = coords[2];\n let d = coords[3];\n // get box vals\n let y1 = getBoxes(b, 0);\n let x1 = getBoxes(b, 1);\n let y2 = getBoxes(b, 2);\n let x2 = getBoxes(b, 3);\n // get image in batch index\n let bInd = i32(round(getBoxInd(b)));\n if(bInd < 0 || bInd >= uniforms.outShape[0]) {\n return;\n }\n let height_scale = ${r};\n let width_scale = ${a};\n let in_y = ${i};\n if( in_y < 0.0 || in_y > ${t} ) {\n setOutputAtIndex(index, uniforms.extrapolationValue);\n return;\n }\n let in_x = ${s};\n if( in_x < 0.0 || in_x > ${e} ) {\n setOutputAtIndex(index, uniforms.extrapolationValue);\n return;\n }\n let sourceFracIndexCR = vec2(in_x,in_y);\n if(${this.methodId} == 1) {\n // Compute the four integer indices.\n let sourceFloorCR = vec2(sourceFracIndexCR);\n let sourceCeilCR = vec2(ceil(sourceFracIndexCR));\n let topLeft = getImage(bInd, sourceFloorCR.y, sourceFloorCR.x, d);\n let bottomLeft = getImage(bInd, sourceCeilCR.y, sourceFloorCR.x, d);\n let topRight = getImage(bInd, sourceFloorCR.y, sourceCeilCR.x, d);\n let bottomRight = getImage(bInd, sourceCeilCR.y, sourceCeilCR.x, d);\n let fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n let top = topLeft + (topRight - topLeft) * fracCR.x;\n let bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n let newValue = top + (bottom - top) * fracCR.y;\n setOutputAtIndex(index, newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n let sourceNearestCR = vec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n let newValue = getImage(\n bInd, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutputAtIndex(index, newValue);\n }\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const fi={kernelName:i.CropAndResize,backendName:"webgpu",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{image:i,boxes:o,boxInd:a}=e,{cropSize:s,method:u,extrapolationValue:l}=r,c=new di(i.shape[3],o.shape,s,u),h=[{type:"float32",data:[l]}];return n.runWebGPUProgram(c,[i,o,a],"float32",h)}}; +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +var pi;!function(t){t.Prod="*",t.Sum="+"}(pi||(pi={}));class mi{constructor(t,e,n,r){this.variableNames=["x"],this.uniforms="index : f32,",this.size=!0,this.workgroupSize=[128,1,1],this.outputShape=e,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.exclusive=n,this.reverse=r,this.op=t,this.shaderKey=`cum_${this.op}_${this.exclusive}_${this.reverse}`}getUserCode(){const t=this.outputShape.length,e=this.op===pi.Prod?"1.0":"0.0",n=this.exclusive?e:`getX(${gi(t,"coords",this.op)})`,r=this.outputShape[this.outputShape.length-1];let i="",o="";return this.exclusive?(i=this.reverse?"end != "+(r-1):"end != 0",o=this.reverse?"end + 1":"end - 1"):(i=this.reverse?`end + pow2 < ${r}`:"end >= pow2",o=this.reverse?"end + pow2":"end - pow2"),`\n ${b("index")} {\n if (index < uniforms.size) {\n var coords = getCoordsFromIndex(index);\n\n let end = ${vi(t,"coords",this.op)};\n var val = ${n};\n let pow2 = i32(pow(2.0, uniforms.index));\n if (${i}) {\n let idx = ${o};\n ${vi(t,"coords",this.op)} = idx;\n val ${this.op}= getX(${gi(t,"coords",this.op)});\n }\n setOutputAtIndex(index, val);\n }\n }\n `}}function gi(t,e,n){if(1===t)return`${e}`;if(2===t)return`${e}.x, ${e}.y`;if(3===t)return`${e}.x, ${e}.y, ${e}.z`;if(4===t)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw Error(`Cumulative ${n} for rank ${t} is not yet supported`)}function vi(t,e,n){if(1===t)return`${e}`;if(2===t)return`${e}.y`;if(3===t)return`${e}.z`;if(4===t)return`${e}.w`;throw Error(`Cumulative ${n} for rank ${t} is not yet supported`)} +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function yi(t,e,n,r,o,a){const s=e.shape.length,u=i.backend_util.getAxesPermutation([r],s);let l=e;null!=u&&(l=Rn({inputs:{x:e},backend:n,attrs:{perm:u}}));const c=i.backend_util.getInnerMostAxes(1,s)[0];if(c!==s-1)throw new Error(`WebGPU cumprod shader expects an inner-most axis=${e.shape.length-1} but got axis=${r}`);const h=l.shape[c];let d=Pe({inputs:{x:l},backend:n});for(let e=0;e<=Math.ceil(Math.log2(h))-1;e++){const r=new mi(t,l.shape,!1,a),i=d,o=[{type:"float32",data:[e]}];d=n.runWebGPUProgram(r,[d],d.dtype,o),n.disposeData(i.dataId)}if(o){const e=new mi(t,l.shape,o,a),r=d,i=[{type:"float32",data:[0]}];d=n.runWebGPUProgram(e,[d],d.dtype,i),n.disposeData(r.dataId)}if(null!=u){const t=Rn({inputs:{x:d},backend:n,attrs:{perm:i.backend_util.getUndoAxesPermutation(u)}});return n.disposeData(d.dataId),n.disposeData(l.dataId),t}return d}const bi={kernelName:i.Cumprod,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,exclusive:a,reverse:s}=r;return yi(pi.Prod,i,n,o,a,s)}};const xi={kernelName:i.Cumsum,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,exclusive:a,reverse:s}=r;return yi(pi.Sum,i,n,o,a,s)}};const wi={kernelName:i.DenseBincount,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,weights:a}=e,{size:s,binaryOutput:u}=r,l=1===o.shape.length,c=i.util.sizeFromShape(a.shape)>0,h=a.dtype,d=l?[o.shape[0]]:[o.shape[0],o.shape[1]],f=Ee({backend:n,attrs:{shape:l?[s]:[o.shape[0],s],value:0,dtype:h}}),p=new _r(d,c,u),m=[{type:"int32",data:[s]}],g=c?[o,a]:[o];return n.runWebGPUProgram(p,g,h,m,f)}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class _i{constructor(t,e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.uniforms="blockSize : i32,",this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`depthToSpace_${e}`,this.dataFormat=e}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let h = ${this.getHeightCoordString()};\n let w = ${this.getWidthCoordString()};\n let d = ${this.getDepthCoordString()};\n\n let in_h = h / uniforms.blockSize;\n let offset_h = h % uniforms.blockSize;\n let in_w = w / uniforms.blockSize;\n let offset_w = w % uniforms.blockSize;\n let offset_d = (offset_h * uniforms.blockSize + offset_w) *\n ${this.getOutputDepthSize()};\n let in_d = d + offset_d;\n\n let rlt = ${this.getInputSamplingString()};\n setOutputAtIndex(index, rlt);\n }\n }`}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?"uniforms.outShape[3]":"uniforms.outShape[1]"}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}const Si={kernelName:i.DepthToSpace,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{blockSize:o,dataFormat:a}=r,s=i.shape[0],u=("NHWC"===a?i.shape[1]:i.shape[2])*o,l=("NHWC"===a?i.shape[2]:i.shape[3])*o,c=("NHWC"===a?i.shape[3]:i.shape[1])/(o*o),h=[{type:"int32",data:[o]}],d=new _i("NHWC"===a?[s,u,l,c]:[s,c,u,l],a);return n.runWebGPUProgram(d,[i],i.dtype,h)}}; +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ei{constructor(t,e,n,r=!1,i=null,o=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2,",this.workgroupSize=[16,16,1],this.outputShape=t,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),r&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),this.addBias=r,this.activation=i,this.hasPreluActivation=o,this.filterHeight=e,this.filterWidth=n,this.shaderKey=`depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`}getUserCode(){const t=this.filterWidth*this.filterHeight,e=this.workgroupSize[0]*this.workgroupSize[1]*this.workgroupSize[2],n=this.workgroupSize[1]+this.filterHeight-1,r=this.workgroupSize[0]+this.filterWidth-1;return`\n ${he(this.activation,this.hasPreluActivation,!1,4)}\n\n var mm_Asub : array, ${n}>;\n var mm_Bsub : array, ${this.filterHeight}>;\n fn readX(batch : i32, channel : i32, row : i32, col : i32) -> f32 {\n var value = 0.0;\n if (row >=0 && row < uniforms.inDims[0] && col >=0 && col < uniforms.inDims[1])\n {\n value = getX(batch, channel, row, col);\n }\n return value;\n }\n\n ${b()} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let xRCCorner = vec2(coords.zw) - uniforms.pads;\n let channelMul = uniforms.wShape[3];\n let d1 = coords[1] / channelMul;\n let q = coords[1] % channelMul;\n\n let inputRowStart = xRCCorner.x;\n let inputColStart = xRCCorner.y;\n\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n\n // Load one tile of X into local memory.\n for (var inputRow = localRow; inputRow < ${n}; inputRow = inputRow + ${this.workgroupSize[1]}) {\n for (var inputCol = localCol; inputCol < ${r}; inputCol = inputCol + ${this.workgroupSize[0]}) {\n let rowOffset = inputRow - localRow;\n let colOffset = inputCol - localCol;\n mm_Asub[inputRow][inputCol] = readX(batch, d1, inputRowStart + rowOffset, inputColStart + colOffset);\n }\n }\n\n // Load one tile of W into local memory.\n var wIndex = i32(localIndex);\n ${t, inDims : vec2, virtualWidth : i32,",this.workgroupSize=[64,1,1],this.workPerThread=4,this.outputComponent=4,this.outputShape=t.outShape,this.virtualWidth=Math.ceil(this.outputShape[2]/this.workPerThread)*this.workPerThread;const o=[this.outputShape[0],this.outputShape[1],this.virtualWidth,this.outputShape[3]];this.dispatchLayout=L(o),this.dispatch=I(this.dispatchLayout,o,this.workgroupSize,[this.outputComponent*this.workPerThread,1,1]),i.util.assert("channelsLast"===t.dataFormat,(()=>"TODO: NCHW is unimplemented")),e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.convInfo=t,this.addBias=e,this.activation=n,this.hasPreluActivation=r,this.shaderKey=`depthwiseVec4_${n}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`}getUserCode(){const t=(this.workPerThread-1)*this.convInfo.strideWidth+this.convInfo.filterWidth,e=this.convInfo.strideHeight,n=this.convInfo.strideWidth;return`\n ${he(this.activation,this.hasPreluActivation,!0,4)}\n fn readX(batch : i32, row : i32, col : i32, channel : i32) -> vec4 {\n var value = vec4(0.0);\n if (col >=0 && col < uniforms.inDims[1]) {\n value = getX(batch, row, col, channel);\n }\n return value;\n }\n\n ${b("index")} {\n let width0 = uniforms.outShape[3] / ${this.outputComponent};\n let d1 = (index % width0) * ${this.outputComponent};\n var index1 = index / width0;\n let width1 = uniforms.virtualWidth / ${this.workPerThread};\n let c = (index1 % width1) * ${this.workPerThread};\n index1 = index1 / width1;\n let r = index1 % uniforms.outShape[1];\n let batch = index1 / uniforms.outShape[1];\n\n let xRCCorner = vec2(r, c) * vec2(${e}, ${n}) - uniforms.pads;\n\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n var xVals : array, ${t}>;\n var dotProd : array, ${this.workPerThread}>;\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = vec4(0.0);\n }\n\n // Use constant instead of uniform can give better performance.\n for (var wR = 0; wR < ${this.convInfo.filterHeight}; wR = wR + 1) {\n let xR = xRCorner + wR;\n if (xR >=0 && xR < uniforms.inDims[0]) {\n for (var i = 0; i < ${t}; i++) {\n xVals[i] = readX(batch, xR, xCCorner + i, d1);\n }\n for (var wC = 0; wC < ${this.convInfo.filterWidth}; wC = wC + 1) {\n let wValue = getW(wR, wC, d1, 0);\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = fma(xVals[i * ${n} + wC], wValue, dotProd[i]);\n }\n }\n }\n }\n\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let coords = vec4(batch, r, c + i, d1);\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n var value = dotProd[i];\n ${de(this.addBias,this.activation)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }\n }\n `}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ai{constructor(t,e=!1,n=null,r=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2, filterHeight : i32,\n filterWidth : i32, strides : vec2, dilations : vec2,",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast="channelsLast"===t.dataFormat,e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.convInfo=t,this.addBias=e,this.activation=n,this.hasPreluActivation=r,this.shaderKey=`depthwise_${this.activation}_${this.isChannelsLast}`}getUserCode(){const t=this.isChannelsLast?"getX(batch, xR, xC, d1);":"getX(batch, d1, xR, xC);";return`\n ${he(this.activation,this.hasPreluActivation,!1,4)}\n\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords[0];\n let xRCCorner = vec2(coords.${this.isChannelsLast?"yz":"zw"}) * uniforms.strides - uniforms.pads;\n let d2 = coords[${this.isChannelsLast?3:1}];\n let channelMul = uniforms.wShape[3];\n let d1 = d2 / channelMul;\n let q = d2 % channelMul;\n\n let inputRowStart = xRCCorner.x;\n let inputColStart = xRCCorner.y;\n let inputRowEnd = inputRowStart + uniforms.filterHeight *\n uniforms.dilations[0];\n let inputColEnd = inputColStart + uniforms.filterWidth *\n uniforms.dilations[1];\n\n // Convolve x(?, ?, d1)|x(d1, ?, ?) with w(:, :, d1, q) to get\n // y(yR, yC, d2)|y(d2, yR, yC). ? = to be determined. : = across all\n // values in that axis. x(?, ?, d1) and y(yR, yC, d2) is for NHWC.\n // x(d1, ?, ?) and y(d2, yR, yC) is for NCHW.\n var value = 0.0;\n\n // Extract if checking out of for loop for performance.\n if (inputRowStart >= 0 && inputColStart >= 0 &&\n inputRowEnd < uniforms.inDims[0] &&\n inputColEnd < uniforms.inDims[1]) {\n for (var wR = 0; wR < uniforms.filterHeight; wR = wR + 1) {\n let xR = inputRowStart + wR * uniforms.dilations[0];\n\n for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) {\n let xC = inputColStart + wC * uniforms.dilations[1];\n\n let xVal = ${t};\n let wVal = getW(wR, wC, d1, q);\n value = value + xVal * wVal;\n }\n }\n } else {\n for (var wR = 0; wR < uniforms.filterHeight; wR = wR + 1) {\n let xR = inputRowStart + wR * uniforms.dilations[0];\n\n if (xR < 0 || xR >= uniforms.inDims[0]) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) {\n let xC = inputColStart + wC * uniforms.dilations[1];\n\n if (xC < 0 || xC >= uniforms.inDims[1]) {\n continue;\n }\n\n let xVal = ${t};\n let wVal = getW(wR, wC, d1, q);\n value = value + xVal * wVal;\n }\n }\n }\n ${de(this.addBias,this.activation)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }\n `}}const Ci={kernelName:i.DepthwiseConv2dNative,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,filter:a}=e,{strides:s,pad:u,dataFormat:l,dilations:c,dimRoundingMode:h}=r,d=i.backend_util.convertConv2DDataFormat(l);let f=c;null==f&&(f=[1,1]);const p=i.backend_util.computeConv2DInfo(o.shape,a.shape,s,f,u,h,!0,d),m=[{type:"int32",data:[p.padInfo.top,p.padInfo.left]},{type:"int32",data:[p.inHeight,p.inWidth]}],g="channelsLast"===p.dataFormat;let v;return!g&&p.inHeight>16&&p.inWidth>16&&1===p.strideHeight&&1===p.strideWidth&&1===p.dilationWidth&&1===p.dilationHeight&&p.inChannels===p.outChannels?v=new Ei(p.outShape,p.filterHeight,p.filterWidth):g&&p.outHeight>4&&p.outWidth>4&&p.strideWidth<=2&&p.inChannels===p.outChannels&&1===p.dilationHeight&&1===p.dilationWidth&&p.inChannels%4==0?(v=new Mi(p),m.push({type:"int32",data:[v.virtualWidth]})):(v=new Ai(p),m.push({type:"int32",data:[p.filterHeight]},{type:"int32",data:[p.filterWidth]},{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.dilationHeight,p.dilationWidth]})),n.runWebGPUProgram(v,[o,a],o.dtype,m)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ti{constructor(t){this.variableNames=["x","dy"],this.uniforms="strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32,\n outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_filter"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wR = coords[0];\n let wC = coords[1];\n let d1 = coords[2];\n let dm = coords[3];\n let d2 = d1 * uniforms.channelMul + dm;\n\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b++) {\n for (var yR = 0; yR < uniforms.outHeight; yR++) {\n let xR = wR + yR * uniforms.strides[0] - uniforms.pads[0];\n\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC++) {\n let xC = wC + yC * uniforms.strides[1] - uniforms.pads[1];\n\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n let dyValue = getDy(b, yR, yC, d2);\n let xValue = getX(b, xR, xC, d1);\n dotProd += xValue * dyValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}class ki{constructor(t){this.variableNames=["dy","W"],this.uniforms="strides : vec2, pads : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32, channelMul : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_input"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d1 = coords[3];\n let dyCorner = coords.yz - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n\n let idyR = i32(dyR);\n let wRPerm = uniforms.filterDims[0] - 1 - wR;\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n\n let idyC = i32(dyC);\n let wCPerm = uniforms.filterDims[1] - 1 - wC;\n\n for (var dm = 0; dm < uniforms.channelMul; dm++) {\n let d2 = d1 * uniforms.channelMul + dm;\n let xValue = getDy(batch, idyR, idyC, d2);\n let wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}const Ii={kernelName:i.DepthwiseConv2dNativeBackpropFilter,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,dy:a}=e,{strides:s,dilations:u,pad:l,dimRoundingMode:c,filterShape:h}=r,d=i.backend_util.computeConv2DInfo(o.shape,h,s,u,l,c,!0),f=new Ti(d),p=[{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.filterHeight,d.filterWidth]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]},{type:"int32",data:[d.inHeight]},{type:"int32",data:[d.inWidth]},{type:"int32",data:[d.batchSize]},{type:"int32",data:[d.outChannels/d.inChannels]}];return n.runWebGPUProgram(f,[o,a],"float32",p)}};const Ni={kernelName:i.DepthwiseConv2dNativeBackpropInput,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:o,filter:a}=e,{strides:s,dilations:u,pad:l,dimRoundingMode:c,inputShape:h}=r,d=i.backend_util.computeConv2DInfo(h,a.shape,s,u,l,c,!0),f=new ki(d),p=[{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.filterHeight-1-d.padInfo.top,d.filterWidth-1-d.padInfo.left]},{type:"int32",data:[d.filterHeight,d.filterWidth]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]},{type:"int32",data:[d.outChannels/d.inChannels]}];return n.runWebGPUProgram(f,[o,a],o.dtype,p)}}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Pi{constructor(t){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,t],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="diag"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let value = select(0.0, getX(coords[0]), coords[0] == coords[1]);\n setOutputAtIndex(index, value);\n }\n }\n `}}const Oi={kernelName:i.Diag,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{x:r}=e,o=[...r.shape,...r.shape],a=i.util.sizeFromShape(r.shape),s=Ae({inputs:{x:r},backend:n,attrs:{shape:[a]}}),u=new Pi(a),l=n.runWebGPUProgram(u,[s],s.dtype),c=Ae({inputs:{x:l},backend:n,attrs:{shape:o}});return n.disposeData(s.dataId),n.disposeData(l.dataId),c}}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Li{constructor(t){this.variableNames=["x","w"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="dilation2d"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let neg_infinity = -3.4e38;\n let coords = getOutputCoords();\n let batch = coords.x;\n let d1 = coords.w;\n let outTopLeftCorner = coords.yz * uniforms.strides - uniforms.pads;\n let hBeg = outTopLeftCorner.x;\n let wBeg = outTopLeftCorner.y;\n\n var curVal = neg_infinity;\n for (var h = 0; h < uniforms.filterDims[0]; h = h + 1) {\n let hIn = hBeg + h * uniforms.dilations[0];\n\n if (hIn >= 0 && hIn < uniforms.xShape[1]) {\n for (var w = 0; w < uniforms.filterDims[1]; w = w + 1) {\n let wIn = wBeg + w * uniforms.dilations[1];\n\n if (wIn >= 0 && wIn < uniforms.xShape[2]) {\n let val = getX(batch, hIn, wIn, d1) + getW(h, w, d1);\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n setOutputAtIndex(index, curVal);\n }\n }\n `}}const Ri={kernelName:i.Dilation2D,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,filter:a}=e,{strides:s,pad:u,dilations:l}=r,c=i.backend_util.computeDilation2DInfo(o.shape,a.shape,s,u,"NHWC",l),h=[c.padInfo.top,c.padInfo.left],d=[{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[...h]},{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.dilationHeight,c.dilationWidth]}],f=new Li(c);return n.runWebGPUProgram(f,[o,a],o.dtype,d)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Di{constructor(t,e){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t.inShape,this.dispatchLayout=L(t.outShape),this.dispatch=I(this.dispatchLayout,t.outShape,this.workgroupSize),"float32"!==e&&"int32"!==e)throw new Error(`Dilation2DBackpropInput only supports float32 and int32\n types, does not support ${e} type.`);this.type=e,this.shaderKey="dilation2DBackpropInput"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.dySize) {\n let coords = getDyCoordsFromIndex(index);\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let dyCorner = vec2(r, c) * uniforms.strides - uniforms.pads;\n var curVal = -3.4e38; // neg_infinity\n var xRMax = 0;\n var xCMax = 0;\n\n // In the case of multiple argmax branches, we only back-propagate\n // along the last branch, i.e., the one with largest value of\n // 'wR * uniforms.filterDims[1] + wC', similarly to the max-pooling\n // backward routines.\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let xR = dyCorner.x + wR * uniforms.dilations[0];\n\n if (xR >= 0 && xR < uniforms.xShape[1]) {\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let xC = dyCorner.y + wC * uniforms.dilations[1];\n\n if (xC >= 0 && xC < uniforms.xShape[2]) {\n let val = getX(b, xR, xC, d) + getW(wR, wC, d);\n if (val > curVal) {\n curVal = val;\n xRMax = xR;\n xCMax = xC;\n }\n }\n }\n }\n }\n\n let flatIndexIn = d + uniforms.xShape[3] *\n (xCMax + uniforms.xShape[2] * (xRMax + uniforms.xShape[1] * b));\n let value = getDy(b, r, c, d);\n ${f("&result[flatIndexIn]","value",this.type)}\n }\n }\n `}}class zi{constructor(t,e,n){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t.filterShape,this.dispatchLayout=L(t.outShape),this.dispatch=I(this.dispatchLayout,t.outShape,this.workgroupSize),"float32"!==n&&"int32"!==n)throw new Error(`Dilation2DBackpropFilter only supports float32 and int32\n types, does not support ${n} type.`);this.type=n,this.shaderKey="dilation2DBackpropFilter"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.dySize) {\n let coords = getDyCoordsFromIndex(index);\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let dyCorner = vec2(r, c) * uniforms.strides - uniforms.pads;\n var curVal = -3.4e38; // neg_infinity\n var wRMax = 0;\n var wCMax = 0;\n\n // In the case of multiple argmax branches, we only back-propagate\n // along the last branch, i.e., the one with largest value of\n // 'wR * uniforms.filterDims[1] + wC', similarly to the max-pooling\n // backward routines.\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let xR = dyCorner.x + wR * uniforms.dilations[0];\n\n if (xR >= 0 && xR < uniforms.xShape[1]) {\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let xC = dyCorner.y + wC * uniforms.dilations[1];\n\n if (xC >= 0 && xC < uniforms.xShape[2]) {\n let val = getX(b, xR, xC, d) + getW(wR, wC, d);\n if (val > curVal) {\n curVal = val;\n wRMax = wR;\n wCMax = wC;\n }\n }\n }\n }\n }\n\n let flatIndexIn = d + uniforms.wShape[2] * (wCMax + wRMax * uniforms.wShape[1]);\n let value = getDy(b, r, c, d);\n ${f("&result[flatIndexIn]","value",this.type)}\n }\n }\n `}}const Fi={kernelName:i.Dilation2DBackpropFilter,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,filter:a,dy:s}=e,{strides:u,pad:l,dilations:c}=r,h=i.backend_util.computeDilation2DInfo(o.shape,a.shape,u,l,"NHWC",c),d=a.dtype,f=new zi(h,a.shape,d),p=[{type:"int32",data:[h.filterHeight,h.filterWidth]},{type:"int32",data:[h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]},{type:"int32",data:[i.util.sizeFromShape(h.outShape)]}],m=Ee({backend:n,attrs:{shape:a.shape,value:0,dtype:d}});return n.runWebGPUProgram(f,[o,a,s],d,p,m)}};const Bi={kernelName:i.Dilation2DBackpropInput,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,filter:a,dy:s}=e,{strides:u,pad:l,dilations:c}=r,h=i.backend_util.computeDilation2DInfo(o.shape,a.shape,u,l,"NHWC",c),d=o.dtype,f=new Di(h,d),p=[{type:"int32",data:[h.filterHeight,h.filterWidth]},{type:"int32",data:[h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]},{type:"int32",data:[i.util.sizeFromShape(h.outShape)]}],m=Ee({backend:n,attrs:{shape:h.inShape,value:0,dtype:d}});return n.runWebGPUProgram(f,[o,a,s],d,p,m)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ui{constructor(t,e,n){this.variableNames=["Image"],this.uniforms="alpha: f32,",this.workgroupSize=[64,1,1],this.pixelsOpType=p.DRAW,this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.type=e,this.textureFormat=n,this.shaderKey=`draw_${e}_${n}`}getUserCode(){let t;const e="float32"===this.type?"value":"value / 255.0";t=`\n if (uniforms.numChannels == 1) {\n rgba[0] = ${e};\n rgba[1] = ${e};\n rgba[2] = ${e};\n } else {\n rgba[d] = ${e};\n }`;return`\n @group(0) @binding(0) var outImage : texture_storage_2d<${this.textureFormat}, write>;\n ${b("index")} {\n if (index < uniforms.size) {\n var rgba = vec4(0.0, 0.0, 0.0, uniforms.alpha);\n for (var d = 0; d < uniforms.numChannels; d = d + 1) {\n let value = f32(inBuf[index * uniforms.numChannels + d]);\n ${t}\n }\n rgba.x = rgba.x * rgba.w;\n rgba.y = rgba.y * rgba.w;\n rgba.z = rgba.z * rgba.w;\n let coords = getCoordsFromIndex(index);\n textureStore(outImage, vec2(coords.yx), rgba);\n }\n }\n `}}const ji={kernelName:i.Draw,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use backend file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{image:i}=e,{canvas:o,options:a}=r,[s,u]=i.shape.slice(0,2),{imageOptions:l}=a||{},c=(null==l?void 0:l.alpha)||1,h=n.device.features.has("bgra8unorm-storage")?"bgra8unorm":"rgba8unorm",d=[s,u],f=new Ui(d,i.dtype,h);o.width=u,o.height=s;const p="webgpu";let m,g=o.getContext(p);g||(m=new OffscreenCanvas(u,s),g=m.getContext(p));const v=3===i.shape.length?i.shape[2]:1;g.configure({device:n.device,format:h,usage:GPUTextureUsage.STORAGE_BINDING,alphaMode:"premultiplied"});const y="int32",b=n.makeTensorInfo(d,y),x=n.tensorMap.get(b.dataId);x.resource=g.getCurrentTexture(),x.external=!0;const w=[{type:"uint32",data:[v]},{type:"float32",data:[c]}];if(n.runWebGPUProgram(f,[i],y,w,b),m){const t=o.getContext("2d");if(!t)throw new Error("Please make sure this canvas has only been used for 2d or webgpu context!");t.drawImage(m,0,0)}return n.disposeData(b.dataId),i}},Vi=Fe({opType:j.MUL,cpuKernelImpl:an,supportsComplex:!0}),Hi={kernelName:i.Multiply,backendName:"webgpu",kernelFunc:Vi}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Gi(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r;return Bn(i,o,a,"sum",n)}const Wi={kernelName:i.Sum,backendName:"webgpu",kernelFunc:Gi};const Xi={kernelName:i.Einsum,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{equation:o}=r,a=e,{allDims:s,summedDims:u,idDims:l}=i.backend_util.decodeEinsumEquation(o,a.length);i.backend_util.checkEinsumDimSizes(s.length,l,a);const{path:c,steps:h}=i.backend_util.getEinsumComputePath(u,l),d=h.length;let f=null,p=s.length;const m=[];for(let t=0;t=0&&(f=Gi({inputs:{x:f},backend:n,attrs:{axis:c[t]-(s.length-p),keepDims:!1}}),m.push(f)),p--)}for(const t of m)t!==f&&n.disposeData(t.dataId);return f}},Yi=ze({opType:yt.ELU}),qi={kernelName:i.Elu,backendName:"webgpu",kernelFunc:Yi},$i={kernelName:i.EluGrad,backendName:"webgpu",kernelFunc:t=>{const{inputs:e,backend:n}=t,{dy:r,y:i}=e,o=new Ne(j.ELU_DER,r.shape,i.shape);return n.runWebGPUProgram(o,[r,i],r.dtype)}},Ki=Fe({opType:j.EQUAL,dtype:"bool",cpuKernelImpl:Ge}),Zi={kernelName:i.Equal,backendName:"webgpu",kernelFunc:Ki},Qi=ze({opType:yt.ERF}),Ji={kernelName:i.Erf,backendName:"webgpu",kernelFunc:Qi},to=ze({opType:yt.EXP,cpuKernelImpl:We,dtype:"float32"}),eo={kernelName:i.Exp,backendName:"webgpu",kernelFunc:to}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function no(t){const{inputs:e,attrs:n,backend:r}=t,{dim:o}=n,{input:a}=e,s=a.shape.length,u=a.shape.slice();let l=o;return o<0&&(i.util.assert(-(s+1)<=o,(()=>`Axis must be in the interval [${-(s+1)}, ${s}]`)),l=s+o+1),u.splice(l,0,1),Ae({inputs:{x:a},backend:r,attrs:{shape:u}})}const ro={kernelName:i.ExpandDims,backendName:"webgpu",kernelFunc:no},io=ze({opType:yt.EXPM1,cpuKernelImpl:Xe}),oo={kernelName:i.Expm1,backendName:"webgpu",kernelFunc:io}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class ao{constructor(t,e){this.variableNames=["real","imag"],this.outputShape=[],this.uniforms="exponentMultiplier : f32, denominator: f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.component=t,this.shaderKey=`fft_${t}`}getUserCode(){return`\n fn unaryOpComplex(real: f32, expR: f32, imag: f32, expI: f32) -> f32 {\n ${"real"===this.component?"return real * expR - imag * expI;":"return real * expI + imag * expR;"}\n }\n\n fn mulMatDFT(batch: i32, index: i32) -> f32 {\n let indexRatio = f32(index) / f32(uniforms.realShape[1]);\n let exponentMultiplierTimesIndexRatio =\n uniforms.exponentMultiplier * indexRatio;\n\n var result = 0.0;\n\n for (var i = 0; i < uniforms.realShape[1]; i = i + 1) {\n // x = (-2|2 * PI / N) * index * i;\n let x = exponentMultiplierTimesIndexRatio * f32(i);\n let expR = cos(x);\n let expI = sin(x);\n let real = getReal(batch, i);\n let imag = getImag(batch, i);\n\n result = result +\n unaryOpComplex(real, expR, imag, expI) / uniforms.denominator;\n }\n\n return result;\n }\n\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n setOutputAtIndex(index, mulMatDFT(coords[0], coords[1]));\n }\n }\n `}} +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function so(t,e,n){const r=n.tensorMap.get(t.dataId),o=i.util.sizeFromShape(t.shape),a=t.shape[t.shape.length-1],s=[],u=Ae({inputs:{x:t},backend:n,attrs:{shape:[o/a,a]}});s.push(u);const l=u.shape,c=new ao("real",l),h=new ao("imag",l),d=[{dataId:r.complexTensorInfos.real.dataId,dtype:r.complexTensorInfos.real.dtype,shape:l},{dataId:r.complexTensorInfos.imag.dataId,dtype:r.complexTensorInfos.imag.dtype,shape:l}],f=[{type:"float32",data:[e?2*Math.PI:-2*Math.PI]},{type:"float32",data:[e?l[1]:1]}],p=n.runWebGPUProgram(c,d,"float32",f);s.push(p);const m=n.runWebGPUProgram(h,d,"float32",f);s.push(m);const g=Le({inputs:{real:p,imag:m},backend:n});s.push(g);const v=Ae({inputs:{x:g},backend:n,attrs:{shape:t.shape}});return s.forEach((t=>n.disposeData(t.dataId))),v}const uo={kernelName:i.FFT,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{input:r}=e;return so(r,!1,n)}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class lo{constructor(t){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="flipLeftRight"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let coordX = uniforms.xShape[2] - coords[2] - 1;\n let outputValue = getX(coords[0], coords[1], coordX, coords[3]);\n setOutputAtIndex(index, outputValue);\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const co={kernelName:i.FlipLeftRight,backendName:"webgpu",kernelFunc:({inputs:t,backend:e})=>{const{image:n}=t,r=e,i=new lo(n.shape);return r.runWebGPUProgram(i,[n],n.dtype)}},ho=ze({opType:yt.FLOOR,cpuKernelImpl:Ye}),fo={kernelName:i.Floor,backendName:"webgpu",kernelFunc:ho},po=Fe({opType:j.FLOOR_DIV,cpuKernelImpl:qe,dtype:"int32"}),mo={kernelName:i.FloorDiv,backendName:"webgpu",kernelFunc:po}; +/** + * @license + * Copyright 2022 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class go{constructor(t,e,n=!1){this.pixelsOpType=p.FROM_PIXELS,this.outputShape=[0],this.variableNames=[],this.workgroupSize=[256,1,1],this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[e,1,1]),this.importVideo=n,this.shaderKey=`fromPixels_${this.importVideo}`}getUserCode(){const t=this.importVideo?"textureLoad(src, vec2(coords.yx));":"textureLoad(src, vec2(coords.yx), 0)";return`\n @binding(1) @group(0) var src: ${this.importVideo?"texture_external":"texture_2d"};\n ${b("index")} {\n let flatIndex = index * uniforms.numChannels;\n if (flatIndex < uniforms.size) {\n let coords = getCoordsFromIndex(flatIndex);\n let values = ${t};\n for (var i = 0; i < uniforms.numChannels; i = i + 1) {\n result[flatIndex + i] = i32(floor(255.0 * values[i]));\n }\n }\n }\n `}} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use backend file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const vo={kernelName:i.FromPixels,backendName:"webgpu",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t;let{pixels:o}=e;const{numChannels:a}=r;if(null==o)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");const s="undefined"!=typeof HTMLVideoElement&&o instanceof HTMLVideoElement,u="undefined"!=typeof HTMLImageElement&&o instanceof HTMLImageElement,l="undefined"!=typeof HTMLCanvasElement&&o instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&o instanceof OffscreenCanvas,c="undefined"!=typeof ImageBitmap&&o instanceof ImageBitmap,[h,d]=s?[o.videoWidth,o.videoHeight]:[o.width,o.height],f=[d,h,a],p=(0,i.env)().getBool("WEBGPU_IMPORT_EXTERNAL_TEXTURE")&&s,m=s||u;if(c||l||m){let t;if(p)t=n.device.importExternalTexture({source:o});else{if(m){const t=(0,i.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=yo&&t===bo||(bo=t,yo=document.createElement("canvas").getContext("2d",{willReadFrequently:bo})),yo.canvas.width=h,yo.canvas.height=d,yo.drawImage(o,0,0,h,d),o=yo.canvas}const e=GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING,r="rgba8unorm",a=n.textureManager.acquireTexture(f[1],f[0],r,e);n.queue.copyExternalImageToTexture({source:o},{texture:a},[f[1],f[0]]),t=a}const e=i.util.sizeFromShape(f),r=i.util.computeStrides(f),s=new go(f,a,p),u=[{type:"uint32",data:[e]},{type:"uint32",data:[a]},{type:"uint32",data:[...r]}],l=n.makeTensorInfo([d,h],"int32");n.tensorMap.get(l.dataId).resource=t;const c=n.runWebGPUProgram(s,[l],"int32",u);return n.disposeData(l.dataId),c}const g=o.data;let v=g;if(null!=a&&4!==a){v=new Uint8Array(o.width*o.height*a);const t=g.length;let e=0;for(let n=0;n(xValue, -meanValue, offsetValue), vec3(inv, inv, 1.0)));\n }\n }\n `}} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const wo={kernelName:i.FusedBatchNorm,backendName:"webgpu",kernelFunc:({inputs:t,attrs:e,backend:n})=>{const{x:r,scale:i,offset:o,mean:a,variance:s}=t,{varianceEpsilon:u}=e,l=n,c=[r,a,s];let h=null;null!=o&&(h=o.shape,c.push(o));let d=null;null!=i&&(d=i.shape,c.push(i));const f=new xo(r.shape,a.shape,s.shape,h,d),p=[{type:"float32",data:[u]}];return l.runWebGPUProgram(f,c,r.dtype,p)}};const _o={kernelName:i.FusedConv2D,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,filter:a,bias:s,preluActivationWeights:u}=e,{strides:l,pad:c,dataFormat:h,dilations:d,dimRoundingMode:f,activation:p,leakyreluAlpha:m}=r,g=i.backend_util.convertConv2DDataFormat(h);return $r({x:o,filter:a,convInfo:i.backend_util.computeConv2DInfo(o.shape,a.shape,l,d,c,f,!1,g),backend:n,bias:s,preluActivationWeights:u,leakyreluAlpha:m,activation:p})}};const So={kernelName:i.FusedDepthwiseConv2D,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,filter:a,bias:s,preluActivationWeights:u}=e,{strides:l,pad:c,dilations:h,dimRoundingMode:d,activation:f,leakyreluAlpha:p}=r;let m=h;null==m&&(m=[1,1]),i.util.assert(i.backend_util.eitherStridesOrDilationsAreOne(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=i.backend_util.computeConv2DInfo(o.shape,a.shape,l,m,c,d,!0),v=[o,a],y=null!=s,b=null!=u;y&&v.push(s),b&&v.push(u);const x=[{type:"int32",data:[g.padInfo.top,g.padInfo.left]},{type:"int32",data:[g.inHeight,g.inWidth]}];let w;return g.outHeight>4&&g.outWidth>4&&g.strideWidth<=2&&g.inChannels===g.outChannels&&1===g.dilationHeight&&1===g.dilationWidth&&g.inChannels%4==0?(w=new Mi(g,y,f,b),x.push({type:"int32",data:[w.virtualWidth]})):(w=new Ai(g,y,f,b),x.push({type:"int32",data:[g.filterHeight]},{type:"int32",data:[g.filterWidth]},{type:"int32",data:[g.strideHeight,g.strideWidth]},{type:"int32",data:[g.dilationHeight,g.dilationWidth]})),"leakyrelu"===f&&(x.push({type:"float32",data:[p]}),w.uniforms+=" alpha : f32,"),n.runWebGPUProgram(w,v,"float32",x)}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Eo{constructor(t,e){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`gathernd_${t}`,this.sliceDim=t,this.uniforms=`sliceDim : i32, strides : ${v(t)},`}getUserCode(){let t;t=this.sliceDim>1?"uniforms.strides[j]":"uniforms.strides";return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var flattenIndex = 0;\n for (var j = 0; j < uniforms.sliceDim; j = j + 1) {\n let indexTemp = i32(round(getIndices(coords[0], j)));\n let strideNum = ${t};\n flattenIndex = flattenIndex + indexTemp * strideNum;\n }\n\n setOutputAtIndex(index, getA(flattenIndex, coords[1]));\n }\n }\n `}}const Mo={kernelName:i.GatherNd,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{params:r,indices:o}=e,a=o.shape,s=a[a.length-1],u=i.util.sizeFromShape(r.shape),[l,c,h,d]=i.backend_util.prepareAndValidate(r,o),f=Ae({inputs:{x:o},backend:n,attrs:{shape:[c,s]}}),p=Ae({inputs:{x:r},backend:n,attrs:{shape:[i.util.sizeFromShape(r.shape)/h,h]}});if(n.shouldExecuteOnCPU([r,o])||"string"===r.dtype){const t=n.readSync(o.dataId),e=n.bufferSync(r),i=$e(t,e,r.dtype,c,s,h,d,r.shape,u);return n.makeTensorInfo(l,r.dtype,i.values)}const m=new Eo(s,[c,h]),g=[{type:"int32",data:[s]},{type:"int32",data:d}],v=n.runWebGPUProgram(m,[p,f],p.dtype,g),y=Ae({inputs:{x:v},backend:n,attrs:{shape:l}});return n.disposeData(f.dataId),n.disposeData(p.dataId),n.disposeData(v.dataId),y}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ao{constructor(t,e){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.slice(),this.aShape=t,this.outputShape=e,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="gather"}getUserCode(){const t=function(t){const e=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let r=0;r= 0 && indexZ < uniforms.aShape[2]);\n setOutputAtIndex(index, inBounds * getA(${t}));\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Co(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,indices:a}=e,{axis:s,batchDims:u}=r,l=i.util.parseAxisParam(s,o.shape)[0],c=i.backend_util.segment_util.collectGatherOpShapeInfo(o,a,l,u),h=i.util.sizeFromShape(a.shape),d=[],f=Ae({inputs:{x:o},backend:n,attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]}}),p=Ae({inputs:{x:a},backend:n,attrs:{shape:[c.batchSize,h/c.batchSize]}});d.push(f),d.push(p);const m=[c.batchSize,c.outerSize,h/c.batchSize,c.sliceSize];if(n.shouldExecuteOnCPU([o,a])){const t=n.tensorMap.get(p.dataId).values,e=(0,i.buffer)(p.shape,p.dtype,t),r=n.tensorMap.get(f.dataId).values,o=(0,i.buffer)(f.shape,f.dtype,r),a=Ke(o,e,m);return d.forEach((t=>n.disposeData(t.dataId))),n.makeTensorInfo(c.outputShape,a.dtype,a.values)}const g=new Ao(f.shape,m),v=n.runWebGPUProgram(g,[f,p],f.dtype);d.push(v);const y=Ae({inputs:{x:v},backend:n,attrs:{shape:c.outputShape}});return d.forEach((t=>n.disposeData(t.dataId))),y}const To={kernelName:i.GatherV2,backendName:"webgpu",kernelFunc:Co},ko=Fe({opType:j.GREATER,cpuKernelImpl:Qe,dtype:"bool"}),Io={kernelName:i.Greater,backendName:"webgpu",kernelFunc:ko},No=Fe({opType:j.GREATER_EQUAL,dtype:"bool",cpuKernelImpl:Ze}),Po={kernelName:i.GreaterEqual,backendName:"webgpu",kernelFunc:No};const Oo={kernelName:i.IFFT,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{input:r}=e;return so(r,!0,n)}},Lo=ze({opType:yt.IS_FINITE,dtype:"bool"}),Ro={kernelName:i.IsFinite,backendName:"webgpu",kernelFunc:Lo},Do=ze({opType:yt.IS_INF,dtype:"bool"}),zo={kernelName:i.IsInf,backendName:"webgpu",kernelFunc:Do},Fo=ze({opType:yt.IS_NAN,dtype:"bool"}),Bo={kernelName:i.IsNan,backendName:"webgpu",kernelFunc:Fo};const Uo={kernelName:i.LeakyRelu,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{alpha:o}=r,a=[{type:"float32",data:[o]}],s=new De(i.shape,yt.LEAKYRELU,"alpha : f32,");return n.runWebGPUProgram(s,[i],"float32",a)}},jo=Fe({opType:j.LESS,dtype:"bool",cpuKernelImpl:tn}),Vo={kernelName:i.Less,backendName:"webgpu",kernelFunc:jo},Ho=Fe({opType:j.LESS_EQUAL,dtype:"bool",cpuKernelImpl:Je}),Go={kernelName:i.LessEqual,backendName:"webgpu",kernelFunc:Ho}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Wo{constructor(t){this.variableNames=[],this.outputShape=[],this.uniforms="start : f32, step : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="linSpace"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n setOutputAtIndex(index, uniforms.start + f32(index) * uniforms.step);\n }\n }\n `}}const Xo={kernelName:i.LinSpace,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{backend:e,attrs:n}=t,{start:r,stop:i,num:o}=n,a=(i-r)/(o-1),s=new Wo(o),u=[{type:"float32",data:[r]},{type:"float32",data:[a]}];return e.runWebGPUProgram(s,[],"float32",u)}},Yo=ze({opType:yt.LOG,cpuKernelImpl:en}),qo={kernelName:i.Log,backendName:"webgpu",kernelFunc:Yo},$o=ze({opType:yt.LOG1P}),Ko={kernelName:i.Log1p,backendName:"webgpu",kernelFunc:$o},Zo=Fe({opType:j.LOGICAL_AND,dtype:"bool"}),Qo={kernelName:i.LogicalAnd,backendName:"webgpu",kernelFunc:Zo},Jo=ze({opType:yt.LOGICAL_NOT}),ta={kernelName:i.LogicalNot,backendName:"webgpu",kernelFunc:Jo},ea=Fe({opType:j.LOGICAL_OR}),na={kernelName:i.LogicalOr,backendName:"webgpu",kernelFunc:ea},ra="\n var powValue = 0.0;\n let basis = uniforms.bias + uniforms.alpha * sum;\n if (uniforms.beta == 0.5) {\n powValue = inverseSqrt(basis);\n } else if (uniforms.beta == 1.0) {\n powValue = 1.0 / basis;\n } else {\n powValue = exp(log(basis) * (-uniforms.beta));\n }\n";class ia{constructor(t){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let x = getX(b, r, c, d);\n var sum = 0.0;\n for (var i = -uniforms.radius; i <= uniforms.radius; i = i + 1) {\n let idx = d + i;\n if (idx >= 0 && idx < uniforms.xShape[3]) {\n let z = getX(b, r, c, idx);\n sum = sum + z * z;\n }\n }\n ${ra}\n\n setOutputAtIndex(index, x * powValue);\n }\n }\n `}}class oa{constructor(t,e){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[256,1,1],this.maxAllowRadius=16,i.util.assert(e<=this.maxAllowRadius,(()=>`Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${e}`)),this.outputShape=t,this.elementsPerWorkgroup=this.workgroupSize[0]-2*this.maxAllowRadius,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=I(this.dispatchLayout,this.outputShape,[this.elementsPerWorkgroup,this.workgroupSize[1],this.workgroupSize[2]]),this.shaderKey="lrn_shared"}getUserCode(){return`\n var lrnSub: array;\n const elementsPerWorkgroup = ${this.elementsPerWorkgroup};\n const maxAllowRadius = ${this.maxAllowRadius};\n\n ${b()} {\n let localDepth = i32(localId.x);\n let workgroupDepth = i32(workgroupId.x) * elementsPerWorkgroup;\n let xDepth = workgroupDepth + localDepth - maxAllowRadius;\n let b = i32(globalId.z) / uniforms.xShape[1];\n let r = i32(globalId.z) - b * uniforms.xShape[1];\n let c = i32(globalId.y);\n let d = workgroupDepth + localDepth;\n\n var x = 0.0;\n if (xDepth >= 0 && xDepth < uniforms.xShape[3]) {\n x = getX(b, r, c, xDepth);\n }\n lrnSub[localDepth] = x;\n workgroupBarrier();\n\n if (localDepth < elementsPerWorkgroup && d < uniforms.outShape[3]) {\n var sum = 0.0;\n let index = localDepth + maxAllowRadius;\n for (var i = -uniforms.radius; i <= uniforms.radius; i = i + 1) {\n let z = lrnSub[index + i];\n sum = sum + z * z;\n }\n ${ra}\n\n setOutputAtCoords(b, r, c, d, lrnSub[index] * powValue);\n }\n } `}}const aa={kernelName:i.LRN,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{depthRadius:o,bias:a,alpha:s,beta:u}=r;let l;l=o>16?new ia(i.shape):new oa(i.shape,o);const c=[{type:"int32",data:[o]},{type:"float32",data:[a]},{type:"float32",data:[s]},{type:"float32",data:[u]}];return n.runWebGPUProgram(l,[i],i.dtype,c)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class sa{constructor(t){this.outputShape=[],this.variableNames=["inputImage","outputImage","dy"],this.uniforms="depthRadius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn_grad"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n\n let MIN_DEPTH_BEGIN = 0;\n let MAX_DEPTH_END = uniforms.outShape[3];\n var result = 0.0;\n for (var d = MIN_DEPTH_BEGIN; d < MAX_DEPTH_END; d++) {\n let depthBegin = max(MIN_DEPTH_BEGIN, d - uniforms.depthRadius);\n let depthEnd = min(MAX_DEPTH_END, d + uniforms.depthRadius + 1);\n\n var norm = 0.0;\n for (var k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; k++) {\n if (k < depthBegin) {\n continue;\n } else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n } else {\n break;\n }\n }\n\n norm = uniforms.alpha * norm + uniforms.bias;\n\n for (var k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; k++) {\n if (k < depthBegin) {\n continue;\n } else if (k >= depthBegin && k < depthEnd) {\n var dyi = -2.0 * uniforms.alpha * uniforms.beta\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d) / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * uniforms.beta);\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n } else {\n break;\n }\n }\n }\n\n setOutputAtIndex(index, result);\n }\n }\n `}}const ua={kernelName:i.LRNGrad,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,y:o,dy:a}=e,{depthRadius:s,bias:u,alpha:l,beta:c}=r,h=new sa(i.shape),d=[{type:"int32",data:[s]},{type:"float32",data:[u]},{type:"float32",data:[l]},{type:"float32",data:[c]}];return n.runWebGPUProgram(h,[i,o,a],i.dtype,d)}},la=Fe({opType:j.MAX,cpuKernelImpl:rn}),ca={kernelName:i.Maximum,backendName:"webgpu",kernelFunc:la};const ha={kernelName:i.MaxPool,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{filterSize:a,strides:s,pad:u,dimRoundingMode:l}=r;return ur(o,i.backend_util.computePool2DInfo(o.shape,a,s,1,u,l),"max",n)}};const da={kernelName:i.MaxPool3D,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{filterSize:a,strides:s,pad:u,dataFormat:l,dimRoundingMode:c}=r,h=i.backend_util.computePool3DInfo(o.shape,a,s,[1,1,1],u,c,l),d=new rr(h,"max"),f=[{type:"int32",data:[h.strideDepth,h.strideHeight,h.strideWidth]},{type:"int32",data:[h.padInfo.front,h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.inDepth,h.inHeight,h.inWidth]},{type:"int32",data:[h.effectiveFilterDepth,h.effectiveFilterHeight,h.effectiveFilterWidth]}];return n.runWebGPUProgram(d,[o],o.dtype,f)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class fa{constructor(t){this.variableNames=["dy","maxPos"],this.uniforms="strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool2DBackprop"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let dyRCCorner = vec2(coords.yz) - uniforms.pads;\n let dyRCorner = dyRCCorner.x;\n let dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n let lastIndex = uniforms.filterDims[0] * uniforms.filterDims[1] - 1;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR += uniforms.dilations[0]) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC += uniforms.dilations[1]) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyR, idyC, d);\n let maxPosValue = lastIndex - i32(getMaxPos(batch, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n let curPosValue = wR * uniforms.filterDims[1] + wC;\n let mask = select(0.0, 1.0, maxPosValue == curPosValue);\n dotProd += dyValue * mask;\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}class pa{constructor(t){this.variableNames=["dy","maxPos"],this.uniforms="strides : vec3, pads : vec3, filterDims : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool3DBackprop"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyDCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n let lastIndex = uniforms.filterDims[0] * uniforms.filterDims[1] * uniforms.filterDims[2] - 1;\n\n for (var wD = 0; wD < uniforms.filterDims[0]; wD++) {\n let dyD = f32(dyDCorner + wD) / f32(uniforms.strides[0]);\n\n if (dyD < 0.0 || dyD >= f32(uniforms.outDepth) || fract(dyD) > 0.0) {\n continue;\n }\n let idyD = i32(dyD);\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyD, idyR, idyC, ch);\n let maxPosValue = lastIndex - i32(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n let curPosValue = wD * uniforms.filterDims[1] * uniforms.filterDims[2] + wR * uniforms.filterDims[2] + wC;\n let mask = select(0.0, 1.0, maxPosValue == curPosValue);\n dotProd += dyValue * mask;\n }\n }\n }\n\n setOutputAtIndex(index, dotProd);\n }\n }\n `}}const ma={kernelName:i.MaxPool3DGrad,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:o,input:a}=e,s=a,{filterSize:u,strides:l,pad:c,dimRoundingMode:h}=r,d=i.backend_util.computePool3DInfo(s.shape,u,l,[1,1,1],c,h),f=new rr(d,"max",!0);let p=[{type:"int32",data:[d.strideDepth,d.strideHeight,d.strideWidth]},{type:"int32",data:[d.padInfo.front,d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.inDepth,d.inHeight,d.inWidth]},{type:"int32",data:[d.effectiveFilterDepth,d.effectiveFilterHeight,d.effectiveFilterWidth]}];const m=n.runWebGPUProgram(f,[s],"int32",p),g=new pa(d);p=[{type:"int32",data:[d.strideDepth,d.strideHeight,d.strideWidth]},{type:"int32",data:[d.effectiveFilterDepth-1-d.padInfo.front,d.effectiveFilterHeight-1-d.padInfo.top,d.effectiveFilterWidth-1-d.padInfo.left]},{type:"int32",data:[d.effectiveFilterDepth,d.effectiveFilterHeight,d.effectiveFilterWidth]},{type:"int32",data:[d.outDepth]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]}];const v=n.runWebGPUProgram(g,[o,m],s.dtype,p);return n.disposeData(m.dataId),v}};const ga={kernelName:i.MaxPoolGrad,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:o,input:a,output:s}=e,u=a;z([a,s],"maxPoolGrad");const{filterSize:l,strides:c,pad:h,dimRoundingMode:d}=r,f=i.backend_util.computePool2DInfo(u.shape,l,c,1,h,d),p=new nr(f,"max",!0);let m=[{type:"int32",data:[f.strideHeight,f.strideWidth]},{type:"int32",data:[f.padInfo.top,f.padInfo.left]},{type:"int32",data:[f.dilationHeight,f.dilationWidth]},{type:"int32",data:[f.inHeight,f.inWidth]},{type:"int32",data:[f.effectiveFilterHeight,f.effectiveFilterWidth]}];const g=n.runWebGPUProgram(p,[u],"int32",m),v=new fa(f);m=[{type:"int32",data:[f.strideHeight,f.strideWidth]},{type:"int32",data:[f.effectiveFilterHeight-1-f.padInfo.top,f.effectiveFilterWidth-1-f.padInfo.left]},{type:"int32",data:[f.dilationHeight,f.dilationWidth]},{type:"int32",data:[f.effectiveFilterHeight,f.effectiveFilterWidth]},{type:"int32",data:[f.outHeight]},{type:"int32",data:[f.outWidth]}];const y=n.runWebGPUProgram(v,[o,g],u.dtype,m);return n.disposeData(g.dataId),y}};const va={kernelName:i.MaxPoolWithArgmax,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{filterSize:o,strides:a,pad:s,includeBatchInIndex:u}=r,{x:l}=e;i.util.assert(4===l.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${l.shape.length}.`));const c=[1,1];i.util.assert(i.backend_util.eitherStridesOrDilationsAreOne(a,c),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${c}'`));const h=i.backend_util.computePool2DInfo(l.shape,o,a,c,s),d=[{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]},{type:"int32",data:[h.inHeight,h.inWidth]},{type:"int32",data:[h.effectiveFilterHeight,h.effectiveFilterWidth]}];let f=new nr(h,"max",!1);const p=n.runWebGPUProgram(f,[l],l.dtype,d);return f=new nr(h,"max",!0,!0,u),[p,n.runWebGPUProgram(f,[l],"int32",d)]}};const ya={kernelName:i.Min,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r;return Bn(i,o,a,"min",n)}},ba=Fe({opType:j.MIN,cpuKernelImpl:on}),xa={kernelName:i.Minimum,backendName:"webgpu",kernelFunc:ba}; +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class wa{constructor(t,e,n){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.map(((e,n)=>e[0]+t[n]+e[1])),this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.xShape=t,e.map(((t,e)=>{this.uniforms+=` pad${e} : vec2,`})),this.offset="reflect"===n?0:1,this.shaderKey=`mirrorPad_${n}`}getUserCode(){const t=this.xShape.length,e=this.xShape.map(((t,e)=>`uniforms.pad${e}[0]`)).join(","),n=this.xShape.map(((e,n)=>`uniforms.pad${n}[0] + uniforms.xShape${t>1?`[${n}]`:""}`)).join(","),r=1===t?"start":"start[i]",i=1===t?"end":"end[i]",o=1===t?"outC":"outC[i]",a=v(t),s=t>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,t):"coords";return`\n ${b("index")} {\n if (index < uniforms.size) {\n let start = ${a}(${e});\n let end = ${a}(${n});\n var outC = getCoordsFromIndex(index);\n for (var i = 0; i < ${t}; i = i + 1) {\n if (${o} < ${r}) {\n ${o} = ${r} * 2 - ${o} - ${this.offset};\n } else if(${o} >= ${i}) {\n ${o} = (${i} - 1) * 2 - ${o} + ${this.offset};\n }\n }\n let coords = outC - start;\n setOutputAtIndex(index, getX(${s}));\n }\n }\n `}} +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const _a={kernelName:i.MirrorPad,backendName:"webgpu",kernelFunc:({inputs:t,attrs:e,backend:n})=>{const{x:r}=t,{paddings:i,mode:o}=e,a=n,s=i.map((t=>({type:"int32",data:[t[0],t[1]]}))),u=new wa(r.shape,i,o);return a.runWebGPUProgram(u,[r],r.dtype,s)}},Sa=Fe({opType:j.MOD}),Ea={kernelName:i.Mod,backendName:"webgpu",kernelFunc:Sa}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Ma{constructor(t,e){this.variableNames=["probs"],this.outputShape=[],this.uniforms="seed : f32, numOutcomes: i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,e],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="multinomial"}getUserCode(){return`\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n fn random (seed : f32, resultUV : vec2) -> f32 {\n let HASHSCALE1 = 443.8975;\n let p = resultUV * seed;\n var p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 = p3 + dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords[0];\n\n let resUV = vec2(f32(coords[1]) / f32(uniforms.outShape[1]),\n f32(coords[0]) / f32(uniforms.outShape[0]));\n let r = random(uniforms.seed, resUV);\n var cdf = 0.0;\n for (var i = 0; i < uniforms.numOutcomes - 1; i = i + 1) {\n cdf = cdf + getProbs(batch, i);\n\n if (r < cdf) {\n setOutputAtIndexI32(index, i);\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutputAtIndexI32(index, uniforms.numOutcomes - 1);\n }\n }\n `}} +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Aa{constructor(t){this.variableNames=["logits"],this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=[this.outputShape[0],1,1],this.outputShape[1]>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.shaderKey="softmax"}getUserCode(){return`\n var buf : array;\n var rowMaxShared : f32;\n var rowSumShared : f32;\n const blockSize = ${this.workgroupSize[0]};\n ${b("index")} {\n let row = index / blockSize;\n let tid = i32(localId.x);\n let cols = uniforms.outShape[1];\n\n var threadMax = -3.402823e+38f;\n for (var col = tid; col < cols; col += blockSize) {\n let value = getLogits(row, col);\n threadMax = max(threadMax, value);\n }\n if (tid < cols) {\n buf[tid] = threadMax;\n }\n workgroupBarrier();\n\n var reduceSize = min(cols, blockSize);\n for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) {\n reduceSize = currSize + (reduceSize & 1);\n if (tid < currSize) {\n buf[tid] = max(buf[tid], buf[tid + reduceSize]);\n }\n workgroupBarrier();\n }\n\n if (tid == 0) {\n rowMaxShared = buf[0];\n }\n workgroupBarrier();\n\n var threadSum = 0.0;\n for (var col = tid; col < cols; col += blockSize) {\n let subExp = exp(getLogits(row, col) - rowMaxShared);\n threadSum += subExp;\n }\n buf[tid] = threadSum;\n workgroupBarrier();\n\n for (var currSize = blockSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (tid < currSize) {\n buf[tid] = buf[tid] + buf[tid + currSize];\n }\n workgroupBarrier();\n }\n\n if (tid == 0) {\n rowSumShared = buf[0];\n }\n workgroupBarrier();\n\n for (var col = tid; col < cols; col += blockSize) {\n let value = exp(getLogits(row, col) - rowMaxShared) / rowSumShared;\n setOutputAtCoords(row, col, value);\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Ca(t){const{inputs:e,backend:n,attrs:r}=t,{logits:o}=e,{dim:a}=r,s=Ae({inputs:{x:o},backend:n,attrs:{shape:[i.util.sizeFromShape(o.shape)/o.shape[a],o.shape[a]]}}),u=new Aa(s.shape),l=n.runWebGPUProgram(u,[s],o.dtype),c=Ae({inputs:{x:l},backend:n,attrs:{shape:o.shape}});return n.disposeData(s.dataId),n.disposeData(l.dataId),c}const Ta={kernelName:i.Softmax,backendName:"webgpu",kernelFunc:Ca};const ka={kernelName:i.Multinomial,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{logits:i}=e,{numSamples:o,seed:a,normalized:s}=r,u=s?i:Ca({inputs:{logits:i},backend:n,attrs:{dim:i.shape.length-1}}),l=u.shape[0],c=u.shape[1],h=new Ma(l,o),d=[{type:"float32",data:[a]},{type:"int32",data:[c]}],f=n.runWebGPUProgram(h,[u],"int32",d);return s||n.disposeData(u.dataId),f}};const Ia={kernelName:i.Neg,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{x:r}=e;if(n.shouldExecuteOnCPU([r])){const t=n.tensorMap.get(r.dataId),[e,i]=sn(t.values,r.shape,r.dtype);return n.makeTensorInfo(i,r.dtype,e)}const i=new De(r.shape,yt.NEG);return n.runWebGPUProgram(i,[r],r.dtype)}};const Na={kernelName:i.NonMaxSuppressionV3,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:r}=t,{boxes:o,scores:a}=e,{maxOutputSize:s,iouThreshold:u,scoreThreshold:l}=r,c=n.readSync(o.dataId),h=n.readSync(a.dataId),{selectedIndices:d}=i.kernel_impls.nonMaxSuppressionV3Impl(c,h,s,u,l);return n.makeTensorInfo([d.length],"int32",new Int32Array(d))}};const Pa={kernelName:i.NonMaxSuppressionV5,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:r}=t,{boxes:o,scores:a}=e,{maxOutputSize:s,iouThreshold:u,scoreThreshold:l,softNmsSigma:c}=r,h=n.readSync(o.dataId),d=n.readSync(a.dataId),f=s,p=u,m=l,g=c,{selectedIndices:v,selectedScores:y}=i.kernel_impls.nonMaxSuppressionV5Impl(h,d,f,p,m,g);return[n.makeTensorInfo([v.length],"int32",new Int32Array(v)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Oa{constructor(t,e){this.variableNames=["x"],this.uniforms="onValue : f32, offValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,e],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="onehot"}getUserCode(){return`\n ${b("index")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n setOutputAtIndex(index, mix(uniforms.offValue, uniforms.onValue,\n f32(i32(round(getX(coords.x))) == coords.y)));\n }\n }\n `}}const La={kernelName:i.OneHot,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{indices:o}=e,{dtype:a,depth:s,onValue:u,offValue:l}=r,c=i.util.sizeFromShape(o.shape),h=new Oa(c,s),d=Ae({inputs:{x:o},backend:n,attrs:{shape:[c]}}),f=[{type:"float32",data:[u]},{type:"float32",data:[l]}],p=n.runWebGPUProgram(h,[d],a,f);n.disposeData(d.dataId);const m=Ae({inputs:{x:p},backend:n,attrs:{shape:[...o.shape,s]}});return n.disposeData(p.dataId),m}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Ra(t){const{inputs:e,backend:n}=t,{x:r}=e;if("complex64"===r.dtype){const t=Tr({inputs:{input:r},backend:n}),e=Ra({inputs:{x:t},backend:n}),i=Ur({inputs:{input:r},backend:n}),o=Ra({inputs:{x:i},backend:n}),a=Le({inputs:{real:e,imag:o},backend:n});return n.disposeData(t.dataId),n.disposeData(e.dataId),n.disposeData(i.dataId),n.disposeData(o.dataId),a}return Ee({attrs:{shape:r.shape,dtype:r.dtype,value:"string"===r.dtype?"":0},backend:n})}const Da={kernelName:i.ZerosLike,backendName:"webgpu",kernelFunc:Ra};const za={kernelName:i.OnesLike,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function t(e){const{inputs:n,backend:r}=e,{x:i}=n;if("string"===i.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===i.dtype){const e=Tr({inputs:{input:i},backend:r}),n=t({inputs:{x:e},backend:r}),o=Ur({inputs:{input:i},backend:r}),a=Ra({inputs:{x:o},backend:r}),s=Le({inputs:{real:n,imag:a},backend:r});return r.disposeData(e.dataId),r.disposeData(n.dataId),r.disposeData(o.dataId),r.disposeData(a.dataId),s}return Ee({attrs:{shape:i.shape,dtype:i.dtype,value:1},backend:r})}};const Fa={kernelName:i.Pack,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{axis:o}=r;if(1===e.length)return no({inputs:{input:e[0]},backend:n,attrs:{dim:o}});const a=e[0].shape,s=e[0].dtype;e.forEach((t=>{i.util.assertShapesMatch(a,t.shape,"All tensors passed to stack must have matching shapes"),i.util.assert(s===t.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const u=[],l=Hr({inputs:e.map((t=>{const e=no({inputs:{input:t},backend:n,attrs:{dim:o}});return u.push(e),e})),backend:n,attrs:{axis:o}});return u.forEach((t=>n.disposeData(t.dataId))),l}}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Ba(t,e=!1){const n=t.length,r=v(n),i=t.map(((t,e)=>`uniforms.pad${e}[0]`)).join(","),o=t.map(((t,e)=>`uniforms.pad${e}[0] + uniforms.xShape${n>1?`[${e}]`:""}`)).join(",");return`\n let start = ${n>1?`${r}(${i})`:`${i}`};\n let end = ${n>1?`${r}(${o})`:`${o}`};\n if (${n>1?"any(paddedCoords < start)":"paddedCoords < start"} || ${n>1?"any(paddedCoords >= end)":"paddedCoords >= end"}) {\n setOutputAtIndex(index, ${e?0:"uniforms.constantValue"});\n } else {\n let coords = paddedCoords - start;\n setOutputAtIndex(index, getX(${n>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n):"coords"}));\n }\n `}class Ua{constructor(t,e){this.variableNames=["x"],this.uniforms="constantValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.map(((e,n)=>e[0]+t[n]+e[1])),this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),e.map(((t,e)=>{this.uniforms+=` pad${e} : vec2,`})),this.xShape=t,this.shaderKey="pad"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let paddedCoords = getCoordsFromIndex(index);\n ${Ba(this.xShape)}\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const ja={kernelName:i.PadV2,backendName:"webgpu",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{paddings:a,constantValue:s}=r;if(a.every((t=>i.util.arraysEqual(t,[0,0]))))return Pe({inputs:{x:o},backend:n});if(0===i.util.sizeFromShape(o.shape)){return Ee({backend:n,attrs:{shape:a.map(((t,e)=>t[0]+o.shape[e]+t[1])),value:s,dtype:o.dtype}})}const u=[{type:"float32",data:[s]}];a.map((t=>u.push({type:"int32",data:[t[0],t[1]]})));const l=new Ua(o.shape,a);return n.runWebGPUProgram(l,[o],o.dtype,u)}},Va=Fe({opType:j.POW}),Ha={kernelName:i.Pow,backendName:"webgpu",kernelFunc:Va};const Ga={kernelName:i.Prelu,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{x:r,alpha:i}=e,o=new Ne(j.PRELU,r.shape,i.shape);return n.runWebGPUProgram(o,[r,i],"float32")}};const Wa={kernelName:i.Prod,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r;return Bn(i,o,a,"prod",n)}},Xa={kernelName:i.Range,backendName:"webgpu",kernelFunc:t=>{const{backend:e,attrs:n}=t,{start:r,stop:i,step:o,dtype:a}=n,s=cn(r,i,o,a);return e.makeTensorInfo([s.length],a,s)}},Ya=Fe({opType:j.DIV}),qa={kernelName:i.RealDiv,backendName:"webgpu",kernelFunc:Ya},$a=ze({opType:yt.RECIPROCAL}),Ka={kernelName:i.Reciprocal,backendName:"webgpu",kernelFunc:$a},Za=ze({opType:yt.RELU}),Qa={kernelName:i.Relu,backendName:"webgpu",kernelFunc:Za},Ja=ze({opType:yt.RELU6}),ts={kernelName:i.Relu6,backendName:"webgpu",kernelFunc:Ja}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class es{constructor(t,e,n){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, halfPixelCenters : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t[0],e,n,t[3]],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="resizeBilinear"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let d = coords[3];\n let rc = coords.yz;\n\n let effectiveInSize = vec2(\n f32(uniforms.xShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.xShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveOutSize = vec2(\n f32(uniforms.outShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.outShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveInputOverOutputRatioRC =\n effectiveInSize / effectiveOutSize;\n\n // Fractional source index\n let sourceFracIndexRC =\n (vec2(rc) + vec2(uniforms.halfPixelCenters)) *\n effectiveInputOverOutputRatioRC - vec2(uniforms.halfPixelCenters);\n\n // Compute the four integer indices.\n let sourceFloorRC = vec2(sourceFracIndexRC);\n let sourceCeilRC = vec2(\n min(vec2(uniforms.xShape.yz) - vec2(1.0), ceil(sourceFracIndexRC)));\n\n let topLeft = getX(b, sourceFloorRC.x, sourceFloorRC.y, d);\n let bottomLeft = getX(b, sourceCeilRC.x, sourceFloorRC.y, d);\n let topRight = getX(b, sourceFloorRC.x, sourceCeilRC.y, d);\n let bottomRight = getX(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n let fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n let top = topLeft + (topRight - topLeft) * fracRC.y;\n let bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n let newValue = top + (bottom - top) * fracRC.x;\n\n setOutputAtIndex(index, newValue);\n }\n }\n `}}const ns={kernelName:i.ResizeBilinear,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i}=e,{alignCorners:o,size:a,halfPixelCenters:s}=r,[u,l]=a,c=[{type:"float32",data:[o&&u>1?1:0,o&&l>1?1:0]},{type:"float32",data:[s?.5:0]}],h=new es(i.shape,u,l);return n.runWebGPUProgram(h,[i],"float32",c)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class rs{constructor(t,e){this.variableNames=["dy"],this.uniforms="effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32,\n invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=e,this.shaderKey=`resizeBilinearBackprop_${e}`}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let d = coords[3];\n let r = coords[1];\n let c = coords[2];\n\n var accumulator = 0.0;\n\n // Compute bounds for where in dy we will look\n let startRLerp = floor(f32(r) * uniforms.invHeightScale);\n let startDyR = i32(startRLerp - f32(uniforms.winHeight / 2));\n\n let startCLerp = floor(f32(c) * uniforms.invWidthScale);\n let startDyC = i32(startCLerp - f32(uniforms.winWidth / 2));\n\n // Loop over dy\n for (var dyROffset = 0; dyROffset < uniforms.winHeight; dyROffset++) {\n let dyR = startDyR + dyROffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= uniforms.dyShape[1]) {\n continue;\n }\n\n for (var dyCOffset = 0; dyCOffset < uniforms.winWidth; dyCOffset++) {\n let dyC = startDyC + dyCOffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= uniforms.dyShape[2]) {\n continue;\n }\n\n let dxR = f32(dyR) * uniforms.heightScale;\n let topDxRIndex = i32(floor(dxR));\n let bottomDxRIndex = i32(min(ceil(dxR), f32(uniforms.outShape[1] - 1)));\n let dxRLerp = dxR - f32(topDxRIndex);\n let inverseDxRLerp = 1.0 - dxRLerp;\n\n let dxC = f32(dyC) * uniforms.widthScale;\n let leftDxCIndex = i32(floor(dxC));\n let rightDxCIndex = i32(min(ceil(dxC), f32(uniforms.outShape[2] - 1)));\n let dxCLerp = dxC - f32(leftDxCIndex);\n let inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutputAtIndex(index, accumulator);\n }\n }\n `}}const is={kernelName:i.ResizeBilinearGrad,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i,dy:o}=e,{alignCorners:a}=r,[,s,u]=i.shape,[,l,c]=o.shape,h=[a&&l>1?s-1:s,a&&c>1?u-1:u],d=[a&&l>1?l-1:l,a&&c>1?c-1:c],f=h[0]/d[0],p=h[1]/d[1],m=1/f,g=1/p,v=2*Math.ceil(m)+2,y=2*Math.ceil(g)+2,b=new rs(i.shape,a),x=[{type:"int32",data:h},{type:"int32",data:d},{type:"float32",data:[f]},{type:"float32",data:[p]},{type:"float32",data:[m]},{type:"float32",data:[g]},{type:"int32",data:[v]},{type:"int32",data:[y]}];return n.runWebGPUProgram(b,[o],o.dtype,x)}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class os{constructor(t,e,n,r){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, roundBase : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t[0],e,n,t[3]],this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.halfPixelCenters=r,this.shaderKey=`resizeNearest_${r}`}getUserCode(){let t;t=this.halfPixelCenters?"max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(rc) * effectiveInputOverOutputRatioRC";return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let d = coords[3];\n let rc = coords.yz;\n\n let effectiveInSize = vec2(\n f32(uniforms.xShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.xShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveOutSize = vec2(\n f32(uniforms.outShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.outShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveInputOverOutputRatioRC =\n effectiveInSize / effectiveOutSize;\n\n // Fractional source index\n let sourceFracIndexRC = ${t};\n\n // Compute the coordinators of nearest neighbor point.\n let inputShapeRC = vec2(f32(uniforms.xShape.y), f32(uniforms.xShape.z));\n let sourceNearestRC = vec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + uniforms.roundBase)));\n let newValue = getX(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutputAtIndex(index, newValue);\n }\n }\n `}}const as={kernelName:i.ResizeNearestNeighbor,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i}=e,{alignCorners:o,halfPixelCenters:a,size:s}=r,[u,l]=s,c=[{type:"float32",data:[o&&u>1?1:0,o&&l>1?1:0]},{type:"float32",data:[o?.5:0]}],h=new os(i.shape,u,l,a);return n.runWebGPUProgram(h,[i],i.dtype,c)}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class ss{constructor(t,e){this.variableNames=["dy"],this.uniforms="effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32,\n winHeight : i32, winWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=e,this.shaderKey=`resizeNearestNeigborBackprop_${e}`}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let d = coords[3];\n let r = coords[1];\n let c = coords[2];\n\n var accumulator = 0.0;\n\n // Compute bounds for where in dy we will look\n let startRLerp = floor(f32(r) * uniforms.invHeightScale);\n let startDyR = i32(floor(startRLerp - f32(uniforms.winHeight / 2)));\n\n let startCLerp = floor(f32(c) * uniforms.invWidthScale);\n let startDyC = i32(floor(startCLerp - f32(uniforms.winWidth / 2)));\n\n // Loop over dy\n for (var dyROffset = 0; dyROffset < uniforms.winHeight; dyROffset++) {\n let dyR = startDyR + dyROffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= uniforms.dyShape[1]) {\n continue;\n }\n\n for (var dyCOffset = 0; dyCOffset < uniforms.winWidth; dyCOffset++) {\n let dyC = startDyC + dyCOffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= uniforms.dyShape[2]) {\n continue;\n }\n\n let sourceFracRow = f32(uniforms.effectiveXSize[0]) *\n (f32(dyR) / f32(uniforms.effectiveYSize[0]));\n\n let sourceFracCol = f32(uniforms.effectiveXSize[1]) *\n (f32(dyC) / f32(uniforms.effectiveYSize[1]));\n\n let sourceNearestRow =\n i32(min(f32(uniforms.outShape[1] - 1),\n ${this.alignCorners?"floor(sourceFracRow + 0.5)":"floor(sourceFracRow)"}));\n\n let sourceNearestCol =\n i32(min(f32(uniforms.outShape[2] - 1),\n ${this.alignCorners?"floor(sourceFracCol + 0.5)":"floor(sourceFracCol)"}));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutputAtIndex(index, accumulator);\n }\n }\n `}}const us={kernelName:i.ResizeNearestNeighborGrad,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i,dy:o}=e,{alignCorners:a}=r,[,s,u]=i.shape,[,l,c]=o.shape,h=[a&&l>1?s-1:s,a&&c>1?u-1:u],d=[a&&l>1?l-1:l,a&&c>1?c-1:c],f=1/(h[0]/d[0]),p=1/(h[1]/d[1]),m=2*Math.ceil(f)+2,g=2*Math.ceil(p)+2,v=new ss(i.shape,a),y=[{type:"int32",data:h},{type:"int32",data:d},{type:"float32",data:[f]},{type:"float32",data:[p]},{type:"int32",data:[m]},{type:"int32",data:[g]}];return n.runWebGPUProgram(v,[o],o.dtype,y)}}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class ls{constructor(t){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=" axis : vec4,",this.shaderKey="reverse"}getUserCode(){return`\n \n // Using uniform variables as judging conditions, so the function has\n // coherent execution within all threads.\n fn getReverseCoords(coords : vec4) -> vec4 {\n var reverseCoords = coords;\n if (uniforms.axis[0] == 1) {\n reverseCoords[0] = uniforms.xShape[0] - coords[0] - 1;\n }\n if (uniforms.axis[1] == 1) {\n reverseCoords[1] = uniforms.xShape[1] - coords[1] - 1;\n }\n if (uniforms.axis[2] == 1) {\n reverseCoords[2] = uniforms.xShape[2] - coords[2] - 1;\n }\n if (uniforms.axis[3] == 1) {\n reverseCoords[3] = uniforms.xShape[3] - coords[3] - 1;\n }\n\n return reverseCoords;\n }\n \n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let reverseCoords = getReverseCoords(coords);\n setOutputAtIndex(index, getX(reverseCoords[0],\n reverseCoords[1], reverseCoords[2], reverseCoords[3]));\n }\n }\n `}}const cs={kernelName:i.Reverse,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{dims:a}=r,s=o.shape.length;if(0===s)return Pe({inputs:{x:o},backend:n});const u=o.shape,l=[1,1,1,1];u.forEach(((t,e)=>{l[e+4-s]=t}));const c=i.util.parseAxisParam(a,o.shape),h=[0,0,0,0];c.forEach((t=>{h[t+4-s]=1}));const d=[{type:"int32",data:h}],f=Ae({inputs:{x:o},backend:n,attrs:{shape:l}}),p=new ls(l),m=n.runWebGPUProgram(p,[f],f.dtype,d);n.disposeData(f.dataId);const g=Ae({inputs:{x:m},backend:n,attrs:{shape:u}});return n.disposeData(m.dataId),g}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class hs{constructor(t,e){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms="centerX : f32, centerY : f32, sinRadians : f32,\n cosRadians : f32,",this.shaderKey="rotate",this.outputShape=t,"number"==typeof e?(this.uniforms+=" fillValue : f32,",this.fillSnippet="var outputValue = uniforms.fillValue;",this.shaderKey+="_float"):(this.uniforms+=" fillValue : vec3,",this.fillSnippet="var outputValue = uniforms.fillValue[coords[3]];",this.shaderKey+="_vec3")}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let coordXFloat = (f32(coords[2]) - uniforms.centerX) *\n uniforms.cosRadians - (f32(coords[1]) - uniforms.centerY) *\n uniforms.sinRadians;\n let coordYFloat = (f32(coords[2]) - uniforms.centerX) *\n uniforms.sinRadians + (f32(coords[1]) - uniforms.centerY) *\n uniforms.cosRadians;\n let coordX = i32(round(coordXFloat + uniforms.centerX));\n let coordY = i32(round(coordYFloat + uniforms.centerY));\n ${this.fillSnippet}\n if(coordX >= 0 && coordX < uniforms.xShape[2] && coordY >= 0 &&\n coordY < uniforms.xShape[1]) {\n outputValue = getX(coords[0], coordY, coordX, coords[3]);\n }\n setOutputAtIndex(index, outputValue);\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const ds={kernelName:i.RotateWithOffset,backendName:"webgpu",kernelFunc:({inputs:t,attrs:e,backend:n})=>{const{image:r}=t,{radians:o,fillValue:a,center:s}=e,u=n,l=new hs(r.shape,a),[c,h]=i.backend_util.getImageCenter(s,r.shape[1],r.shape[2]),d=[{type:"float32",data:[c]},{type:"float32",data:[h]},{type:"float32",data:[Math.sin(o)]},{type:"float32",data:[Math.cos(o)]}];"number"==typeof a?d.push({type:"float32",data:[Number.parseFloat(a.toFixed(2))]}):d.push({type:"float32",data:a});return u.runWebGPUProgram(l,[r],r.dtype,d)}},fs=ze({opType:yt.ROUND}),ps={kernelName:i.Round,backendName:"webgpu",kernelFunc:fs},ms=ze({opType:yt.RSQRT,cpuKernelImpl:hn}),gs={kernelName:i.Rsqrt,backendName:"webgpu",kernelFunc:ms}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class vs{constructor(t,e,n,r,i,o,a,s=!0){this.variableNames=["updates","indices"],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=o,this.type=a,this.sumDupeIndices=s,this.dispatchLayout=L(t),this.dispatch=I(this.dispatchLayout,t,this.workgroupSize),this.sliceDimGreaterThanOne=e>1,this.shaderKey=`scatter_${n}_${r}_${this.sliceDimGreaterThanOne}_${a}_${s}_${i.length}`;const u=v(i.length);this.uniforms=`sliceDim : i32, strides: ${u}, updatesSize: i32,`,this.updatesRank=r,this.indicesRank=n}getUserCode(){let t="";1===this.indicesRank?t="coords[0]":2===this.indicesRank&&(t="coords[0], j");const e=`getIndices(${t})`,n=this.sliceDimGreaterThanOne?"uniforms.strides[j]":"uniforms.strides";let r="",i="";1===this.dispatchLayout.x.length?(r="flattenedIndex",i="\n fn getUpdatesCoordsFromFlatIndex(index : i32) -> i32 {\n return index;\n }\n "):2===this.dispatchLayout.x.length&&(r="vec2(flattenedIndex, coords[1])",i="\n fn getUpdatesCoordsFromFlatIndex(index : i32) -> vec2 {\n // N.B. |updates| could be a scalar tensor, conceptually representing a\n // 2D tensor with all values equal to that. By design, its size must be\n // the same as |outShape[1]| in one dimension, and |indicesShape[0]|\n // gives the other.\n let sliceSize = uniforms.outShape[1];\n let d0 = index / sliceSize;\n let d1 = index - d0 * sliceSize;\n return vec2(d0, d1);\n }\n ");const o=`getUpdates(${Array.from({length:this.updatesRank},((t,e)=>`coords[${e}]`)).join(", ")})`;return`\n ${i}\n ${b("index")} {\n if (index < uniforms.updatesSize) {\n let coords = getUpdatesCoordsFromFlatIndex(index);\n var flattenedIndex = 0;\n for (var j = 0; j < uniforms.sliceDim; j = j + 1) {\n let indexInside = i32(round(${e}));\n flattenedIndex = flattenedIndex + indexInside * ${n};\n }\n let updateValue =\n ${A(this.type)}(${o});\n let flatIndex = getOutputIndexFromCoords(${r});\n\n ${this.sumDupeIndices?f("&result[flatIndex]","updateValue",this.type):"atomicStore(&result[flatIndex], bitcast(updateValue));"}\n }\n }`}}const ys={kernelName:i.ScatterNd,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{indices:o,updates:a}=e,{shape:s}=r,{sliceRank:u,numUpdates:l,sliceSize:c,strides:h,outputSize:d}=i.backend_util.calculateShapes(a,o,s),f=[d/c,c];if(0===d)return n.makeTensorInfo(s,o.dtype);const p=Ae({inputs:{x:o},backend:n,attrs:{shape:[l,u]}}),m=Ae({inputs:{x:a},backend:n,attrs:{shape:[l,c]}}),g=m.dtype,v=Ee({backend:n,attrs:{shape:f,value:0,dtype:g}}),y=[{type:"int32",data:[u]},{type:"int32",data:h},{type:"int32",data:[i.util.sizeFromShape(m.shape)]}],b=new vs(m.shape,u,p.shape.length,m.shape.length,h,f,g),x=n.runWebGPUProgram(b,[m,p],g,y,v),w=Ae({inputs:{x},backend:n,attrs:{shape:s}});return n.disposeData(p.dataId),n.disposeData(m.dataId),n.disposeData(x.dataId),w}}; +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class bs{constructor(t,e){this.outputShape=[],this.variableNames=["sortedSequence","values"],this.uniforms="numInputs : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.side=e,this.shaderKey=`search_sorted_${e}`}getUserCode(){return`\n fn findBound(batch: i32, value: f32) -> i32 {\n var left = i32(0);\n var right = uniforms.numInputs;\n while (left < right) {\n var mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${"left"===this.side?"<":"<="} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let value = getValuesByOutputIndex(index);\n setOutputAtIndexI32(index, findBound(coords[0], value));\n }\n }\n `}}const xs={kernelName:i.SearchSorted,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{sortedSequence:i,values:o}=e,{side:a}=r,s=new bs([o.shape[0],o.shape[1]],a),u=[{type:"int32",data:[i.shape[1]]}];return n.runWebGPUProgram(s,[i,o],"int32",u)}}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class ws{constructor(t,e,n){this.variableNames=["c","a","b"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.cRank=t,this.rank=n,this.shaderKey="select"}getUserCode(){let t,e;if(this.rank>4)throw Error(`Where for rank ${this.rank} is not yet supported`);if(1===this.rank)e="resRC",t="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],r=[],i=[];for(let t=0;t= 1.0) {\n setOutputAtIndex(index, getA(${e}));\n } else {\n setOutputAtIndex(index, getB(${e}));\n }\n }\n }\n `}}const _s={kernelName:i.Select,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{condition:r,t:o,e:a}=e,s=new ws(r.shape.length,o.shape,o.shape.length);return n.runWebGPUProgram(s,[r,o,a],(0,i.upcastType)(o.dtype,a.dtype))}},Ss=ze({opType:yt.SELU}),Es={kernelName:i.Selu,backendName:"webgpu",kernelFunc:Ss},Ms=ze({opType:yt.SIGMOID}),As={kernelName:i.Sigmoid,backendName:"webgpu",kernelFunc:Ms},Cs=ze({opType:yt.SIGN}),Ts={kernelName:i.Sign,backendName:"webgpu",kernelFunc:Cs},ks=ze({opType:yt.SIN}),Is={kernelName:i.Sin,backendName:"webgpu",kernelFunc:ks},Ns=ze({opType:yt.SINH}),Ps={kernelName:i.Sinh,backendName:"webgpu",kernelFunc:Ns},Os=ze({opType:yt.SOFTPLUS}),Ls={kernelName:i.Softplus,backendName:"webgpu",kernelFunc:Os}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Rs{constructor(t,e,n,r,i,o){this.variableNames=["x"],this.outputShape=[],this.uniforms="",this.workgroupSize=[64,1,1],this.size=!0;const a=new Array(r.length);for(let t=0;t{this.uniforms+=` pad${e} : vec2,`})),this.shaderKey=`spaceToBatchND_${i}`}getUserCode(){const t=v(this.outputShape.length),e=Ln(this.newDim);return`\n ${S(this.paddedXShape,"PaddedX")}\n ${b("index")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${t}(${e}), uniforms.reshapedPaddedXShape);\n let paddedCoords = getPaddedXCoordsFromIndex(switchedIndex);\n ${Ba(this.xShape,!0)}\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const Ds={kernelName:i.SpaceToBatchND,backendName:"webgpu",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{blockShape:a,paddings:s}=r;i.util.assert(o.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet"));const u=a.reduce(((t,e)=>t*e)),l=[[0,0]];l.push(...s);for(let t=1+a.length;tt[0]+o.shape[e]+t[1])),h=i.backend_util.getReshaped(c,a,u,!1),d=i.backend_util.getPermuted(h.length,a.length,!1),f=i.backend_util.getReshapedPermuted(c,a,u,!1),p=i.util.computeStrides(c),m=new Rs(o.shape,c,l,h,d,p.length),g=[{type:"int32",data:h},{type:"int32",data:p}];l.map((t=>g.push({type:"int32",data:[t[0],t[1]]})));const v=n.runWebGPUProgram(m,[o],o.dtype,g),y=Ae({inputs:{x:v},backend:n,attrs:{shape:f}});return n.disposeData(v.dataId),y}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class zs{constructor(t,e,n){this.variableNames=["input","indices","segmentIds"],this.outputShape=[],this.uniforms="segmentSize : i32, sparseSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t,this.type=n,this.dispatchLayout=L([e]),this.dispatch=I(this.dispatchLayout,[e],this.workgroupSize),this.shaderKey="sparseSegmentSum"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.sparseSize) {\n let indexInSegmentIds = index / uniforms.segmentSize;\n let indexInSegment = index % uniforms.segmentSize;\n let indexInInput = indices[indexInSegmentIds];\n let segmentId = segmentIds[indexInSegmentIds];\n\n let value = input[indexInInput * uniforms.segmentSize + indexInSegment];\n let outIndex = segmentId * uniforms.segmentSize + indexInSegment;\n ${f("&result[outIndex]","value",this.type)}\n }\n }\n `}}class Fs{constructor(t,e){this.variableNames=["segmentIds"],this.outputShape=[],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=[t],this.dispatchLayout=L(e),this.dispatch=I(this.dispatchLayout,e,this.workgroupSize),this.shaderKey="sparseSegmentIdCountProgram"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.segmentIdsShape) {\n let segmentId = segmentIds[index];\n ${f("&result[segmentId]","1","int32")}\n }\n }\n `}}class Bs{constructor(t,e){this.variableNames=["segmentSum","sameSegmentIdCount"],this.outputShape=[],this.uniforms="segmentSize : i32",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.type=e,this.dispatchLayout=L(t),this.dispatch=I(this.dispatchLayout,t,this.workgroupSize),this.shaderKey="sparseSegmentMean"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let segmentId = index / uniforms.segmentSize;\n let count = sameSegmentIdCount[segmentId];\n if (count != 0) {\n ${"float32"===this.type?"setOutputAtIndex(index, segmentSum[index] / f32(count));":"setOutputAtIndexI32(index, segmentSum[index] / count);"}\n }\n }\n }\n `}} +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function Us(t,e,n,r=!1,o){const a=i.util.sizeFromShape(t.shape)/t.shape[0],s=t.dtype,u=i.util.sizeFromShape(e.shape),l=o.readSync(n.dataId),c=u>0?l[u-1]+1:0;let h;const d=t.shape.slice();d[0]=c;const f=u*a,p=Ee({backend:o,attrs:{shape:d,value:0,dtype:s}});h=new zs(d,f,s);let m=[{type:"int32",data:[a]},{type:"int32",data:[f]}];const g=o.runWebGPUProgram(h,[t,e,n],s,m,p);if(r)return g;const v=Ee({backend:o,attrs:{shape:[c],value:0,dtype:"int32"}});h=new Fs(c,n.shape);const y=o.runWebGPUProgram(h,[n],"int32",null,v),b=Ee({backend:o,attrs:{shape:d,value:0,dtype:s}});h=new Bs(d,s),m=[{type:"int32",data:[a]}];const x=o.runWebGPUProgram(h,[g,y],s,m,b);return o.disposeData(g.dataId),o.disposeData(y.dataId),x}const js={kernelName:i.SparseSegmentMean,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{data:r,indices:i,segmentIds:o}=e;return Us(r,i,o,!1,n)}};const Vs={kernelName:i.SparseSegmentSum,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n}=t,{data:r,indices:i,segmentIds:o}=e;return Us(r,i,o,!0,n)}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Hs{constructor(t,e){this.variableNames=["A"],this.workgroupSize=[64,1,1],this.size=!0;const n=new Array(t.length);for(let r=0;r=5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`(resRC % ${e}aShape)`;const n=["resRC.x","resRC.y","resRC.z","resRC.w"],r=[];for(let i=0;i=5){const t=n.readSync(o.dataId),e="string"===o.dtype?t.map((t=>i.util.decodeString(t))):t,r=(0,i.buffer)(o.shape,o.dtype,e),s=yn(r,a);return n.makeTensorInfo(s.shape,s.dtype,s.values)}const s=new Hs(o.shape,a);return n.runWebGPUProgram(s,[o],o.dtype)}const Ws={kernelName:i.Tile,backendName:"webgpu",kernelFunc:Gs};const Xs={kernelName:i.SparseToDense,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{sparseIndices:o,sparseValues:a,defaultValue:s}=e,{outputShape:u}=r,{sliceRank:l,numUpdates:c,sliceSize:h,strides:d,outputSize:f}=i.backend_util.calculateShapes(a,o,u),p=!1;if("string"===a.dtype){const t=n.bufferSync(o),e=n.bufferSync(a),r=i.util.decodeString(n.readSync(s.dataId)[0]),m=dn(t,e,u,f,h,c,l,d,r,p);return n.makeTensorInfo(u,m.dtype,m.values)}const m=[f/h,h],g=Ae({inputs:{x:o},backend:n,attrs:{shape:[c,l]}}),v=a.shape.length?Ae({inputs:{x:a},backend:n,attrs:{shape:[c,h]}}):Pe({inputs:{x:a},backend:n}),y=v.dtype,b=n.makeTensorInfo([],y,i.util.makeZerosTypedArray(1,y)),x=Ae({inputs:{x:s},backend:n,attrs:{shape:Array(m.length).fill(1)}}),w=Gs({inputs:{x},backend:n,attrs:{reps:m}}),_=[{type:"int32",data:[l]},{type:"int32",data:d},{type:"int32",data:[i.util.sizeFromShape([c,h])]}];switch(c){case 0:break;case 1:{const t=new vs([c,h],l,g.shape.length,v.shape.length,d,m,y,p);n.runWebGPUProgram(t,[v,g],y,_,w)}break;default:{const t=new vs([c,h],l,g.shape.length,b.shape.length,d,m,y,p);n.runWebGPUProgram(t,[b,g],y,_,w)}{const t=new vs([c,h],l,g.shape.length,v.shape.length,d,m,y);n.runWebGPUProgram(t,[v,g],y,_,w)}}const S=Ae({inputs:{x:w},backend:n,attrs:{shape:u}});return n.disposeData(g.dataId),n.disposeData(v.dataId),n.disposeData(x.dataId),n.disposeData(b.dataId),n.disposeData(w.dataId),S}};const Ys={kernelName:i.SplitV,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{numOrSizeSplits:a,axis:s}=r,u=i.util.parseAxisParam(s,o.shape)[0],l=i.backend_util.prepareSplitSize(o,a,u),c=o.shape.length,h=new Array(c).fill(0),d=o.shape.slice();return l.map((t=>{const e=[...d];e[u]=t;const r=yr({inputs:{x:o},backend:n,attrs:{begin:h,size:e}});return h[u]+=t,r}))}},qs=ze({opType:yt.SQRT}),$s={kernelName:i.Sqrt,backendName:"webgpu",kernelFunc:qs},Ks={kernelName:i.Square,backendName:"webgpu",kernelFunc:({inputs:t,backend:e})=>{const{x:n}=t,r=e,i=new De(n.shape,yt.SQUARE);return r.runWebGPUProgram(i,[n],n.dtype)}},Zs=Fe({opType:j.SQUARED_DIFFERENCE}),Qs={kernelName:i.SquaredDifference,backendName:"webgpu",kernelFunc:Zs};const Js={kernelName:i.Step,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2022 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function({inputs:t,attrs:e,backend:n}){const{x:r}=t,i=new De(r.shape,yt.STEP,"stepAlpha : f32,"),o=[{type:"float32",data:[e.alpha]}];return n.runWebGPUProgram(i,[r],r.dtype,o)}}; +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class tu{constructor(t){this.variableNames=["x"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]);const e=v(this.outputShape.length);this.uniforms=`begin : ${e}, strides : ${e}, `,this.shaderKey="stridedSlice"}getUserCode(){let t="";if(1===this.outputShape.length)t="coords * uniforms.strides + uniforms.begin";else{let e=0;t=this.outputShape.map(((t,n)=>(e++,1===this.outputShape.length?`coords * uniforms.strides[${n}] + uniforms.begin[${n}]`:`coords[${e-1}] * uniforms.strides[${n}] + uniforms.begin[${n}]`))).join(",")}return`\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n setOutputAtIndex(index, getX(${t}));\n }\n }\n `}}const eu={kernelName:i.StridedSlice,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o}=e,{begin:a,end:s,strides:u,beginMask:l,endMask:c,ellipsisMask:h,newAxisMask:d,shrinkAxisMask:f}=r,{finalShapeSparse:p,finalShape:m,isIdentity:g,sliceDim0:v,isSimpleSlice:y,begin:b,end:x,strides:w}=i.slice_util.sliceInfo(o.shape,a,s,u,l,c,h,d,f);let _;if(g)_=Ae({inputs:{x:o},backend:n,attrs:{shape:m}});else if(v||y){i.util.assert(o.shape.length>=1,(()=>`Input must have rank at least 1, got: ${o.shape.length}`));const t=i.slice_util.computeOutShape(b,x,w),e=yr({inputs:{x:o},backend:n,attrs:{begin:b,size:t}});_=Ae({inputs:{x:e},backend:n,attrs:{shape:m}}),n.disposeData(e.dataId)}else{if(n.shouldExecuteOnCPU([o])){const t=n.readSync(o.dataId),e=(0,i.buffer)(o.shape,o.dtype,t),r=mn(p,e,w,b);_=n.makeTensorInfo(m,o.dtype,r.values)}else{const t=new tu(p),e=[{type:"int32",data:b},{type:"int32",data:w}],r=n.runWebGPUProgram(t,[o],o.dtype,e);_=Ae({inputs:{x:r},backend:n,attrs:{shape:m}}),n.disposeData(r.dataId)}}return _}};const nu={kernelName:i.StringNGrams,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{separator:i,nGramWidths:o,leftPad:a,rightPad:s,padWidth:u,preserveShortSequences:l}=r,{data:c,dataSplits:h}=e,d=n.readSync(c.dataId),f=n.readSync(h.dataId),[p,m]=gn(d,f,i,o,a,s,u,l);return[n.makeTensorInfo([p.length],"string",p),n.makeTensorInfo(h.shape,"int32",m)]}},ru=Fe({opType:j.SUB,cpuKernelImpl:vn,supportsComplex:!0}),iu={kernelName:i.Sub,backendName:"webgpu",kernelFunc:ru},ou=ze({opType:yt.TAN}),au={kernelName:i.Tan,backendName:"webgpu",kernelFunc:ou},su=ze({opType:yt.TANH}),uu={kernelName:i.Tanh,backendName:"webgpu",kernelFunc:su};const lu={kernelName:i.TensorScatterUpdate,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{tensor:o,indices:a,updates:s}=e,{}=r,{sliceRank:u,numUpdates:l,sliceSize:c,strides:h,outputSize:d}=i.backend_util.calculateShapes(s,a,o.shape),f=[d/c,c];if(0===d)return n.makeTensorInfo(o.shape,a.dtype);const p=[],m=Ae({inputs:{x:a},backend:n,attrs:{shape:[l,u]}});p.push(m);const g=Ae({inputs:{x:s},backend:n,attrs:{shape:[l,c]}});p.push(g);const v=Ae({inputs:{x:o},backend:n,attrs:{shape:f}});p.push(v);const y=Gs({inputs:{x:v},backend:n,attrs:{reps:Array(f.length).fill(1)}}),b=new vs([l,c],u,m.shape.length,g.shape.length,h,f,o.dtype,!1),x=[{type:"int32",data:[u]},{type:"int32",data:h},{type:"int32",data:[i.util.sizeFromShape([l,c])]}],w=n.runWebGPUProgram(b,[g,m],v.dtype,x,y);p.push(w);const _=Ae({inputs:{x:w},backend:n,attrs:{shape:o.shape}});return p.forEach((t=>n.disposeData(t.dataId))),_}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class cu{constructor(t){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms="inputSize : i32, firstPass : i32, negativeInf : f32,\n dir : i32, inc : i32,",this.shaderKey="swap"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let outC = getCoordsFromIndex(index);\n let batch = outC[0];\n let elemIdx = outC[1];\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced\n // above, Figure5(a) shows that element[1] is in the second half of\n // the group when group size is 2, but it is in the first half of\n // the group when group size is 4.\n let isFirstInPair = elemIdx % (2 * uniforms.inc) < uniforms.inc;\n var i = 0;\n if (isFirstInPair) {\n i = elemIdx;\n } else {\n i = elemIdx - uniforms.inc;\n }\n\n var i0 = 0;\n if (uniforms.firstPass == 1) {\n i0 = i;\n } else {\n i0 = i32(getIndices(batch, i));\n }\n\n var i1 = 0;\n if (uniforms.firstPass == 1) {\n i1 = i + uniforms.inc;\n } else {\n i1 = i32(getIndices(batch, i + uniforms.inc));\n }\n\n var x0 = f32(0.0);\n var x1 = f32(0.0);\n if (i0 < uniforms.inputSize) {\n x0 = getX(batch, i0);\n } else {\n x0 = uniforms.negativeInf;\n }\n if (i1 < uniforms.inputSize) {\n x1 = getX(batch, i1);\n } else {\n x1 = uniforms.negativeInf;\n }\n\n let reverse = elemIdx % (2 * uniforms.dir) >= uniforms.dir;\n let isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) {\n // Elements in opposite order of direction\n let iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutputAtIndex(index, f32(i0));\n } else {\n setOutputAtIndex(index, f32(i1));\n }\n }\n }\n `}}class hu{constructor(t){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms="inputSize : i32, firstPass : i32, k : i32,",this.shaderKey="merge"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.size) {\n let outC = getCoordsFromIndex(index);\n let batch = outC[0];\n let elemIdx = outC[1];\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _\n // (k=4), we only need to output the indices at positions |, the\n // indices at positions _ can be thrown away, see Figure5(b) After\n // Phase 2 (Merge phase) in the Bitonic Top K paper referenced\n // above.\n // For example, the paper shows we only need to output the orange\n // bars. The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back to\n // the previous sequence to find the corresponding value, we need\n // to double the index. When we double the index, we basically\n // interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k\n // position of each 2k positions by - elemIdx % k. E.g. for output\n // at index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n var i = 0;\n if (elemIdx < uniforms.k) {\n i = elemIdx;\n } else {\n i = elemIdx * 2 - elemIdx % uniforms.k;\n }\n var i0 = 0;\n if (uniforms.firstPass == 1) {\n i0 = i;\n } else {\n i0 = i32(getIndices(batch, i));\n }\n var i1 = 0;\n if (uniforms.firstPass == 1) {\n i1 = i + uniforms.k;\n } else {\n i1 = i32(getIndices(batch, i + uniforms.k));\n }\n\n let x0 = getX(batch, i0);\n var x1 = f32(0.0);\n if (i1 < uniforms.inputSize) {\n x1 = getX(batch, i1);\n } else {\n x1 = x0;\n }\n\n if (x0 >= x1) {\n setOutputAtIndex(index, f32(i0));\n } else {\n setOutputAtIndex(index, f32(i1));\n }\n }\n }\n `}} +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function du(t,e){null!==e&&t.disposeData(e.dataId)}function fu(t){let e=1;for(;enull===p?[h,h]:[h,p],g=(t,e,r)=>{const i=m(),o=new cu(r),a=[{type:"int32",data:[l]},{type:"int32",data:[null===p?1:0]},{type:"float32",data:[Number.NEGATIVE_INFINITY]},{type:"int32",data:[t]},{type:"int32",data:[e]}],s=p;p=n.runWebGPUProgram(o,i,"int32",a),du(n,s)};for(let t=1;t=1;n/=2)g(e,n,[c,f])}for(let t=f;t>d;t/=2){const e=m(),r=new hu([c,t/2]),i=[{type:"int32",data:[l]},{type:"int32",data:[null===p?1:0]},{type:"int32",data:[d]}],o=p;p=n.runWebGPUProgram(r,e,"int32",i),du(n,o);const a=d/2,s=2*a;for(let t=a;t>=1;t/=2)g(s,t,p.shape)}let v=p;p=yr({inputs:{x:p},backend:n,attrs:{begin:0,size:[c,a]}}),du(n,v);let y=Co({inputs:{x:h,indices:p},backend:n,attrs:{axis:1,batchDims:1}});du(n,h);const b=u.slice(0,-1);b.push(a),v=p,p=Ae({inputs:{x:p},attrs:{shape:b},backend:n}),du(n,v);const x=y;return y=Ae({inputs:{x:y},attrs:{shape:b},backend:n}),du(n,x),[y,p]}}; +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class mu{constructor(t){this.variableNames=["Image","Transforms"],this.uniforms="interpolationModeId : i32, fillModeId : i32, fillValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=L(this.outputShape),this.dispatch=I(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="transform"}getUserCode(){return`\n fn mapCoord(outCoord : f32, len : f32) -> f32{\n var inCoord = outCoord;\n if(uniforms.fillModeId == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * f32(i32(f32(-inCoord / sz2))) +\n inCoord;\n }\n if (inCoord < -len) {\n inCoord = inCoord + sz2;\n } else {\n inCoord = -inCoord - 1.0;\n }\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz2 = 2.0 * len;\n inCoord = inCoord - sz2 * f32(i32(f32(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (uniforms.fillModeId == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz = len - 1.0;\n inCoord = inCoord + len * (f32(i32(f32(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz = len - 1.0;\n inCoord = inCoord - len * f32(i32(f32(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (uniforms.fillModeId == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n }\n return outCoord;\n }\n fn readWithFillValue(batch : i32, coordY : i32, coordX : i32,\n channel : i32) -> f32 {\n var outputValue : f32;\n if (0 <= coordY && coordY < uniforms.imageShape[1] && 0 <= coordX && coordX < uniforms.imageShape[2]) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = uniforms.fillValue;\n }\n return outputValue;\n }\n\n ${b("index")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var outputValue : f32;\n let batch = coords[0];\n let x = coords[2];\n let y = coords[1];\n let channel = coords[3];\n let xf = f32(x);\n let yf = f32(y);\n let a1 = getTransforms(batch, 0);\n let a2 = getTransforms(batch, 1);\n let a3 = getTransforms(batch, 2);\n let b1 = getTransforms(batch, 3);\n let b2 = getTransforms(batch, 4);\n let b3 = getTransforms(batch, 5);\n let c1 = getTransforms(batch, 6);\n let c2 = getTransforms(batch, 7);\n let projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = uniforms.fillValue;\n } else {\n let inX = (a1 * xf + a2 * yf + a3) / projection;\n let inY = (b1 * xf + b2 * yf + b3) / projection;\n let mapX = mapCoord(inX, f32(uniforms.imageShape[2]));\n let mapY = mapCoord(inY, f32(uniforms.imageShape[1]));\n\n if (uniforms.interpolationModeId == 1) {\n let coordY = i32(round(mapY));\n let coordX = i32(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n let yFloor = floor(mapY);\n let xFloor = floor(mapX);\n let yCeil = yFloor + 1.0;\n let xCeil = xFloor + 1.0;\n let valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, i32(yFloor), i32(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, i32(yFloor), i32(xCeil), channel);\n let valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, i32(yCeil), i32(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, i32(yCeil), i32(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutputAtIndex(index, outputValue);\n }\n }\n `}}const gu={kernelName:i.Transform,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{image:i,transforms:o}=e,{interpolation:a,fillMode:s,fillValue:u,outputShape:l}=r,[c,h,d,f]=i.shape,[p,m]=null!=l?l:[h,d],g=new mu([c,p,m,f]),v="nearest"===a?1:2;let y;switch(s){case"constant":default:y=1;break;case"reflect":y=2;break;case"wrap":y=3;break;case"nearest":y=4}const b=[{type:"int32",data:[v]},{type:"int32",data:[y]},{type:"float32",data:[u]}];return n.runWebGPUProgram(g,[i,o],"float32",b)}};const vu={kernelName:i.Unpack,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2021 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{value:i}=e;let{axis:o}=r;o<0&&(o+=i.shape.length);const a=i,s=a.shape.length,u=i.shape[o],l=new Array(s-1);let c=0;for(let t=0;tn.disposeData(t.dataId))),p}}; +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class yu{constructor(t,e,n){if(this.outputShape=[],this.variableNames=["x","segmentIds"],this.uniforms="numSegments : i32, xSize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e,this.dispatchLayout=L(t),this.dispatch=I(this.dispatchLayout,t,this.workgroupSize),"float32"!==n&&"int32"!==n)throw new Error(`UnsortedSegmentSum only supports float32 and int32\n types, does not support ${n} type.`);this.type=n,this.shaderKey="unsortedSegmentSum"}getUserCode(){return`\n ${b("index")} {\n if (index < uniforms.xSize) {\n let coords = getXCoordsFromIndex(index);\n let b = coords[0];\n let inCol = coords[1];\n\n let segmentId = i32(getSegmentIds(inCol));\n if (segmentId >= 0) {\n let flatIndex = b * uniforms.numSegments + segmentId % uniforms.numSegments;\n let value = getX(b, inCol);\n\n ${f("&result[flatIndex]","value",this.type)}\n }\n }\n }\n `}}const bu=[ke,Sn,Mn,Cn,kn,Nn,Un,jn,Hn,Gn,Xn,qn,Kn,Qn,tr,lr,cr,fr,pr,mr,xr,Sr,Mr,Ir,Pr,Rr,Re,Fr,Gr,Kr,ei,ri,oi,ai,si,li,hi,fi,bi,xi,wi,Si,Ii,Ni,Ci,Oi,Ri,Fi,Bi,ji,Xi,qi,$i,Zi,Ji,eo,ro,oo,uo,Me,co,vo,fo,mo,wo,_o,So,Mo,To,Io,Po,Oe,Oo,jr,Ro,zo,Bo,Uo,Vo,Go,Xo,Ko,qo,Qo,ta,na,aa,ua,or,ca,ha,ga,da,ma,va,sr,ya,xa,_a,Ea,ka,Hi,Ia,Na,Pa,Cr,La,za,Fa,ja,Ha,Ga,Wa,Xa,kr,qa,Ka,Qa,ts,Ce,ns,is,as,us,cs,ds,ps,gs,ys,xs,_s,Es,As,Ts,Is,Ps,br,Js,eu,nu,Ta,Ls,Ds,js,Vs,Xs,Ys,$s,Ks,Qs,iu,Wi,au,uu,lu,Ws,pu,gu,Dn,vu,{kernelName:i.UnsortedSegmentSum,backendName:"webgpu",kernelFunc: +/** + * @license + * Copyright 2023 Google LLC. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function(t){const{inputs:e,backend:n,attrs:r}=t,{x:o,segmentIds:a}=e,{numSegments:s}=r,u=o.shape.length,l=[];let c=0;const h=i.backend_util.getAxesPermutation([c],u);let d=o;null!=h&&(d=Rn({inputs:{x:o},backend:n,attrs:{perm:h}}),l.push(d),c=i.backend_util.getInnerMostAxes(1,u)[0]);const f=i.backend_util.segment_util.computeOutShape(d.shape,c,s),p=i.util.sizeFromShape([d.shape[c]]),m=Ae({inputs:{x:d},backend:n,attrs:{shape:[-1,p]}});l.push(m);const g=o.dtype,v=[m.shape[0],s],y=Ee({backend:n,attrs:{shape:v,value:0,dtype:g}}),b=new yu(m.shape,v,g),x=[{type:"int32",data:[s]},{type:"int32",data:[i.util.sizeFromShape(m.shape)]}],w=n.runWebGPUProgram(b,[m,a],g,x,y),_=Ae({inputs:{x:w},backend:n,attrs:{shape:f}});l.push(w);let S=_;if(null!=h){l.push(_);const t=i.backend_util.getUndoAxesPermutation(h);S=Rn({inputs:{x:S},backend:n,attrs:{perm:t}})}return l.forEach((t=>n.disposeData(t.dataId))),S}},Da];for(const t of bu)(0,i.registerKernel)(t)} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */,5805:(t,e,n)=>{"use strict";n.d(e,{ox:()=>Wt});var r={};n.r(r),n.d(r,{json:()=>R});var i={};n.r(i),n.d(i,{json:()=>D});var o={};n.r(o),n.d(o,{json:()=>z});var a={};n.r(a),n.d(a,{json:()=>F});var s={};n.r(s),n.d(s,{json:()=>B});var u={};n.r(u),n.d(u,{json:()=>U});var l={};n.r(l),n.d(l,{json:()=>j});var c={};n.r(c),n.d(c,{json:()=>V});var h={};n.r(h),n.d(h,{json:()=>H});var d={};n.r(d),n.d(d,{json:()=>G});var f={};n.r(f),n.d(f,{json:()=>W});var p={};n.r(p),n.d(p,{json:()=>X});var m={};n.r(m),n.d(m,{json:()=>Y});var g={};n.r(g),n.d(g,{json:()=>q});var v={};n.r(v),n.d(v,{json:()=>$});var y={};n.r(y),n.d(y,{json:()=>K});var b={};n.r(b),n.d(b,{json:()=>Z});var x={};n.r(x),n.d(x,{json:()=>Q});var w={};n.r(w),n.d(w,{json:()=>J});var _=n(86748); +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============================================================================= + */ +var S,E;(0,_.env)().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(t=>{t&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")})),function(t){t[t.DT_INVALID=0]="DT_INVALID",t[t.DT_FLOAT=1]="DT_FLOAT",t[t.DT_DOUBLE=2]="DT_DOUBLE",t[t.DT_INT32=3]="DT_INT32",t[t.DT_UINT8=4]="DT_UINT8",t[t.DT_INT16=5]="DT_INT16",t[t.DT_INT8=6]="DT_INT8",t[t.DT_STRING=7]="DT_STRING",t[t.DT_COMPLEX64=8]="DT_COMPLEX64",t[t.DT_INT64=9]="DT_INT64",t[t.DT_BOOL=10]="DT_BOOL",t[t.DT_QINT8=11]="DT_QINT8",t[t.DT_QUINT8=12]="DT_QUINT8",t[t.DT_QINT32=13]="DT_QINT32",t[t.DT_BFLOAT16=14]="DT_BFLOAT16",t[t.DT_QINT16=15]="DT_QINT16",t[t.DT_QUINT16=16]="DT_QUINT16",t[t.DT_UINT16=17]="DT_UINT16",t[t.DT_COMPLEX128=18]="DT_COMPLEX128",t[t.DT_HALF=19]="DT_HALF",t[t.DT_RESOURCE=20]="DT_RESOURCE",t[t.DT_VARIANT=21]="DT_VARIANT",t[t.DT_UINT32=22]="DT_UINT32",t[t.DT_UINT64=23]="DT_UINT64",t[t.DT_FLOAT_REF=101]="DT_FLOAT_REF",t[t.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",t[t.DT_INT32_REF=103]="DT_INT32_REF",t[t.DT_UINT8_REF=104]="DT_UINT8_REF",t[t.DT_INT16_REF=105]="DT_INT16_REF",t[t.DT_INT8_REF=106]="DT_INT8_REF",t[t.DT_STRING_REF=107]="DT_STRING_REF",t[t.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",t[t.DT_INT64_REF=109]="DT_INT64_REF",t[t.DT_BOOL_REF=110]="DT_BOOL_REF",t[t.DT_QINT8_REF=111]="DT_QINT8_REF",t[t.DT_QUINT8_REF=112]="DT_QUINT8_REF",t[t.DT_QINT32_REF=113]="DT_QINT32_REF",t[t.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",t[t.DT_QINT16_REF=115]="DT_QINT16_REF",t[t.DT_QUINT16_REF=116]="DT_QUINT16_REF",t[t.DT_UINT16_REF=117]="DT_UINT16_REF",t[t.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",t[t.DT_HALF_REF=119]="DT_HALF_REF",t[t.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",t[t.DT_VARIANT_REF=121]="DT_VARIANT_REF",t[t.DT_UINT32_REF=122]="DT_UINT32_REF",t[t.DT_UINT64_REF=123]="DT_UINT64_REF"}(S||(S={})),function(t){let e;!function(t){t[t.LEGACY=0]="LEGACY",t[t.V1=1]="V1",t[t.V2=2]="V2"}(e=t.CheckpointFormatVersion||(t.CheckpointFormatVersion={}))}(E||(E={})); +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const M={};function A(t){return M[t]} +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function C(t,e,n,r,i){const o=e.inputParams[t];if(o&&void 0!==o.inputIndexStart){const t=o.inputIndexStart,a=0===o.inputIndexEnd?void 0:void 0===o.inputIndexEnd?t+1:o.inputIndexEnd,s=t<0?e.inputNames.length+t:t;if("tensor"===o.type)return T(e.inputNames[s],n,r,i);if("tensors"===o.type){const o=e.inputs.slice(t,a);return e.inputNames.slice(t,a).filter(((t,e)=>{var n;return"NoOp"!==(null===(n=o[e])||void 0===n?void 0:n.op)})).map((t=>T(t,n,r,i)))}const u=T(e.inputNames[s],n,r,i),l=u.dataSync();return"number"===o.type?l[0]:_.util.toNestedArray(u.shape,l)}const a=e.attrParams[t];return a&&a.value}function T(t,e,n,r){const[i,o]=P(t,n);if(null!=r){const t=r.getHashTableHandleByName(i);if(null!=t)return t}const a=n.currentContextIds.find((t=>!!e[N(i,t)]));return void 0!==a?e[N(i,a)][o]:void 0}function k(t,e,n){return e[N(t,n.currentContextId)]}function I(t,e){const[n,r,i]=P(t,e);return[N(n,e&&e.currentContextId),r,i]}function N(t,e){return e?`${t}-${e}`:t}function P(t,e){if(""===t)return["",0,void 0];const n=null!=e&&null!=e.parseNodeNameCache;if(n){const n=e.parseNodeNameCache.get(t);if(null!=n)return n}const r=t.split(":");let i;if(1===r.length)i=[t,0,void 0];else{const t=r[0],e=3===r.length?r[1]:void 0;i=[t,Number(r[r.length-1]),e]}return n&&e.parseNodeNameCache.set(t,i),i}function O(t,e,n){let r=C("pad",t,e,n);if("explicit"===r){r=C("explicitPaddings",t,e,n);const i=[[0,0],[0,0],[0,0],[0,0]];for(let t=0;t<4;t++)i[t][0]=r[2*t],i[t][1]=r[2*t+1];return i}return r}function L(t){return t.kept?t:(0,_.clone)(t)} +/** + * @license + * Copyright 2023 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const R=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],D=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],z=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcatV2",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],F=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],B=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],U=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],j=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],V=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],H=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],G=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],W=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],X=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],Y=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]}],q=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],$=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],K=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],Z=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],Q=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],J=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"EnsureShape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}]; +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class tt{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const t=[].concat(...[r,i,o,a,s,u,l,c,h,d,f,p,m,g,v,y,b,x,w].map((t=>t.json)));this.opMappers=t.reduce(((t,e)=>(t[e.tfOpName]=e,t)),{})}transformGraph(t,e={}){const n=t.node,r=[],i=[],o=[],a=n.reduce(((t,e)=>(t[e.name]=this.mapNode(e),e.op.startsWith("Placeholder")?r.push(t[e.name]):"Const"===e.op?i.push(t[e.name]):null!=e.input&&0!==e.input.length||o.push(t[e.name]),t)),{});let s=[];const u=[];let l={},c={};null!=e&&(l=this.mapSignatureEntries(e.inputs),c=this.mapSignatureEntries(e.outputs));const h=Object.keys(a);h.forEach((t=>{const e=a[t];e.inputNames.forEach(((t,n)=>{const[r,,i]=I(t),o=a[r];if(null!=o.outputs){const t=o.outputs.indexOf(i);if(-1!==t){const i=`${r}:${t}`;e.inputNames[n]=i}}e.inputs.push(o),o.children.push(e)}))})),0===Object.keys(c).length?h.forEach((t=>{const e=a[t];0===e.children.length&&u.push(e)})):Object.keys(c).forEach((t=>{const[e]=I(t),n=a[e];null!=n&&(n.signatureKey=c[t],u.push(n))})),Object.keys(l).length>0?Object.keys(l).forEach((t=>{const[e]=I(t),n=a[e];n&&(n.signatureKey=l[t],s.push(n))})):s=r;let d={};null!=t.library&&null!=t.library.function&&(d=t.library.function.reduce(((t,e)=>(t[e.signature.name]=this.mapFunction(e),t)),{}));const f={nodes:a,inputs:s,outputs:u,weights:i,placeholders:r,signature:e,functions:d};return o.length>0&&(f.initNodes=o),f}mapSignatureEntries(t){return Object.keys(t||{}).reduce(((e,n)=>(e[t[n].name]=n,e)),{})}mapNode(t){const e=A(t.op)||this.opMappers[t.op]||{};null==t.attr&&(t.attr={});const n={name:t.name,op:t.op,category:e.category,inputNames:(t.input||[]).map((t=>t.startsWith("^")?t.slice(1):t)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:t.attr,outputs:e.outputs};return null!=e.inputs&&(n.inputParams=e.inputs.reduce(((t,e)=>(t[e.name]={type:e.type,inputIndexStart:e.start,inputIndexEnd:e.end},t)),{})),null!=e.attrs&&(n.attrParams=e.attrs.reduce(((e,n)=>{const r=n.type;let i;switch(n.type){case"string":i=nt(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=nt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":i=dt(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=dt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":i=it(t.attr,n.tfName,n.defaultValue||0),void 0===i&&n.tfDeprecatedName&&(i=it(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":i=ht(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ht(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":i=rt(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=rt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":i=pt(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=pt(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":i=ct(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ct(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":i=ft(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ft(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":i=st(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=st(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":i=ut(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=ut(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":i=at(t.attr,n.tfName,n.defaultValue),void 0===i&&n.tfDeprecatedName&&(i=at(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${t.op}`)}return e[n.name]={value:i,type:r},e}),{})),n}mapFunction(t){const e=t.nodeDef,n=[];let r={};null!=e&&(r=e.reduce(((t,e)=>(t[e.name]=this.mapNode(e),"Const"===e.op&&n.push(t[e.name]),t)),{}));const i=[],o=[];t.signature.inputArg.forEach((t=>{const[e]=I(t.name),n={name:e,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:ot(t.type),type:"dtype"}},children:[]};n.signatureKey=t.name,i.push(n),r[e]=n}));Object.keys(r).forEach((t=>{const e=r[t];e.inputNames.forEach(((t,n)=>{const[i,,o]=I(t),a=r[i];if(null!=a.outputs){const t=a.outputs.indexOf(o);if(-1!==t){const r=`${i}:${t}`;e.inputNames[n]=r}}e.inputs.push(a),a.children.push(e)}))}));const a=t.ret;t.signature.outputArg.forEach((t=>{const[e,n]=I(a[t.name]),i=r[e];null!=i&&(i.defaultOutput=n,o.push(i))}));const s=this.mapArgsToSignature(t);return{nodes:r,inputs:i,outputs:o,weights:n,placeholders:[],signature:s}}mapArgsToSignature(t){return{methodName:t.signature.name,inputs:t.signature.inputArg.reduce(((t,e)=>(t[e.name]=this.mapArgToTensorInfo(e),t)),{}),outputs:t.signature.outputArg.reduce(((e,n)=>(e[n.name]=this.mapArgToTensorInfo(n,t.ret),e)),{})}}mapArgToTensorInfo(t,e){let n=t.name;return null!=e&&(n=e[n]),{name:n,dtype:t.type}}}function et(t,e){const n=Array.isArray(t)?String.fromCharCode.apply(null,t):function(t){const e=(0,_.env)().global;if(void 0!==e.atob)return e.atob(t);if("undefined"!=typeof Buffer)return new Buffer(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(t);return e?n:n.toLowerCase()}function nt(t,e,n,r=!1){const i=t[e];return null!=i?et(i.s,r):n}function rt(t,e,n){const r=t[e];return r?r.b:n}function it(t,e,n){const r=t[e]||{},i=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof i?i:parseInt(i,10)}function ot(t){switch("string"==typeof t&&(t=S[t]),t){case S.DT_FLOAT:case S.DT_HALF:return"float32";case S.DT_INT32:case S.DT_INT64:case S.DT_INT8:case S.DT_UINT8:return"int32";case S.DT_BOOL:return"bool";case S.DT_DOUBLE:return"float32";case S.DT_STRING:return"string";case S.DT_COMPLEX64:case S.DT_COMPLEX128:return"complex64";default:return null}}function at(t,e,n){const r=t[e];return r&&r.func?r.func.name:n}function st(t,e,n){const r=t[e];return r&&r.type?ot(r.type):n}function ut(t,e,n){const r=t[e];return r&&r.list&&r.list.type?r.list.type.map((t=>ot(t))):n}function lt(t){if(!t.unknownRank)return null!=t.dim?t.dim.map((t=>"number"==typeof t.size?t.size:parseInt(t.size,10))):[]}function ct(t,e,n){const r=t[e];return r&&r.shape?lt(r.shape):n}function ht(t,e,n){const r=t[e];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map((t=>"number"==typeof t?t:parseInt(t,10))):n}function dt(t,e,n,r=!1){const i=t[e];return i&&i.list&&i.list.s?i.list.s.map((t=>et(t,r))):n}function ft(t,e,n){const r=t[e];return r&&r.list&&r.list.shape?r.list.shape.map((t=>lt(t))):n}function pt(t,e,n){const r=t[e];return r&&r.list&&r.list.b?r.list.b:n} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class mt{constructor(t,e,n){this.node=t,this.tensorMap=e,this.context=n,this.inputs=[],this.attrs={},this.inputs=t.inputNames.map((t=>this.getInput(t))),null!=t.rawAttrs&&(this.attrs=Object.keys(t.rawAttrs).reduce(((t,e)=>(t[e]=this.getAttr(e),t)),{}))}getInput(t){return T(t,this.tensorMap,this.context)}getAttr(t,e){const n=this.node.rawAttrs[t];if(null!=n.tensor)return T(t,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return it(this.node.rawAttrs,t,e);if(null!=n.s)return nt(this.node.rawAttrs,t,e);if(null!=n.b)return rt(this.node.rawAttrs,t,e);if(null!=n.shape)return ct(this.node.rawAttrs,t,e);if(null!=n.type)return st(this.node.rawAttrs,t,e);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return ht(this.node.rawAttrs,t,e);if(null!=n.list.s)return dt(this.node.rawAttrs,t,e);if(null!=n.list.shape)return ft(this.node.rawAttrs,t,e);if(null!=n.list.b)return pt(this.node.rawAttrs,t,e);if(null!=n.list.type)return ut(this.node.rawAttrs,t,e)}return e}}var gt=n(9951); +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function vt(t,e,n=""){if("number"!=typeof t&&"number"!=typeof e){_.util.assert(t.length===e.length,(()=>n+` Shapes ${t} and ${e} must match`));for(let r=0;rn+` Shapes ${t} and ${e} must match`))}}}function yt(t){return"number"!=typeof t&&!t.some((t=>t<0))}function bt(t,e,n){let r=xt(t,n);const i=!yt(r);if(i&&0===e.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(i&&e.forEach((t=>{r=xt(t.shape,r)})),!yt(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function xt(t,e){if("number"==typeof t)return e;if("number"==typeof e)return t;if(t.length!==e.length)throw new Error(`Incompatible ranks during merge: ${t} vs. ${e}`);const n=[];for(let r=0;r=0&&o>=0&&i!==o)throw new Error(`Incompatible shape during merge: ${t} vs. ${e}`);n[r]=i>=0?i:o}return n} +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class wt{constructor(t,e,n,r,i,o,a){this.name=t,this.dtype=e,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=i,this.dynamicSize=o,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=(0,_.scalar)(0),(0,_.keep)(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(t){this.tensors.forEach((e=>{null!=t&&t.has(e.tensor.id)||e.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||t>=this.size())throw new Error(`Tried to read from index ${t}, but array size is: ${this.size()}`);const e=this.tensors[t];if(e.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${t} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(e.cleared=!0),e.read=!0,e.tensor}readMany(t){return t.map((t=>this.read(t)))}write(t,e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||!this.dynamicSize&&t>=this.maxSize)throw new Error(`Tried to write to index ${t}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[t]||{};if(e.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t},\n because the value dtype is ${e.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=e.shape),vt(this.elementShape,e.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${t}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been written.`);n.tensor=e,(0,_.keep)(e),n.written=!0,this.tensors[t]=n}writeMany(t,e){if(t.length!==e.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${t.length} is not the same as tensors size: ${e.length}.`);t.forEach(((t,n)=>this.write(t,e[n])))}gather(t,e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${e}`);if(t)t=t.slice(0,this.size());else{t=[];for(let e=0;e=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(t,(0,_.unstack)(e,0))}split(t,e){if(e.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`);let n=0;const r=t.map((t=>(n+=t,n)));if(n!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${e.shape}`);if(!this.dynamicSize&&t.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${t.length}), and the TensorArray is not marked as dynamically resizeable`);const i=0===n?0:e.size/n,o=[];(0,_.tidy)((()=>{e=(0,_.reshape)(e,[1,n,i]);for(let n=0;n{if(n!==t.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${t.dtype}`);vt(e,t.shape,"TensorList shape mismatch: "),(0,_.keep)(t)})),this.idTensor=(0,_.scalar)(0),this.maxNumElements=r,(0,_.keep)(this.idTensor)}copy(){return new _t([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(t){this.tensors.forEach((e=>{null!=t&&t.has(e.id)||e.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(t,e,n=-1){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);vt(t,this.elementShape,"TensorList shape mismatch: ");const r=bt(this.elementShape,this.tensors,t);return(0,_.tidy)((()=>{const t=this.tensors.map((t=>(0,_.reshape)(t,r)));return(0,_.stack)(t,0)}))}popBack(t,e){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=bt(this.elementShape,this.tensors,t),r=this.tensors.pop();return r.kept=!1,vt(r.shape,t,"TensorList shape mismatch: "),(0,_.reshape)(r,n)}pushBack(t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(vt(t.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");(0,_.keep)(t),this.tensors.push(t)}resize(t){if(t<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${t}`);if(-1!==this.maxNumElements&&t>this.maxNumElements)throw new Error(`TensorListResize input size ${t} is greater maxNumElement ${this.maxNumElements}.`);const e=new _t([],this.elementShape,this.elementDtype,this.maxNumElements);e.tensors.length=t;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${t} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[t])throw new Error(`element at index ${t} is null.`);vt(this.tensors[t].shape,e,"TensorList shape mismatch: ");const r=bt(this.elementShape,this.tensors,e);return(0,_.reshape)(this.tensors[t],r)}setItem(t,e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(t<0||-1!==this.maxNumElements&&t>=this.maxNumElements)throw new Error(`Trying to set element ${t} in a list with max ${this.maxNumElements} elements.`);vt(this.elementShape,e.shape,"TensorList shape mismatch: "),(0,_.keep)(e),null!=this.tensors[t]&&(this.tensors[t].kept=!1),this.tensors[t]=e}gather(t,e,n){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);vt(this.elementShape,n,"TensorList shape mismatch: "),t=t.slice(0,this.size());const r=bt(this.elementShape,this.tensors,n);return 0===t.length?(0,_.tensor)([],[0].concat(r)):(0,_.tidy)((()=>{const e=t.map((t=>(0,_.reshape)(this.tensors[t],r)));return(0,_.stack)(e,0)}))}concat(t,e){if(t&&t!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t}`);vt(this.elementShape,e,"TensorList shape mismatch: ");const n=bt(this.elementShape,this.tensors,e);return 0===this.size()?(0,_.tensor)([],[0].concat(n)):(0,_.tidy)((()=>{const t=this.tensors.map((t=>(0,_.reshape)(t,n)));return(0,_.concat)(t,0)}))}} +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const St=async(t,e,n)=>{switch(t.op){case"If":case"StatelessIf":{const r=C("thenBranch",t,e,n),i=C("elseBranch",t,e,n),o=C("cond",t,e,n),a=C("args",t,e,n);return(await o.data())[0]?n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[i].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=C("body",t,e,n),i=C("cond",t,e,n),o=C("args",t,e,n),a=await n.functionMap[i].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap),s=o.map((t=>t.id));let u=await a[0].data();a.forEach((t=>{t.kept||-1!==s.indexOf(t.id)||t.dispose()}));let l=o;for(;u[0];){const t=l;l=await n.functionMap[r].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);const e=l.map((t=>t.id));t.forEach((t=>{t.kept||-1!==s.indexOf(t.id)||-1!==e.indexOf(t.id)||t.dispose()}));const o=await n.functionMap[i].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);u=await o[0].data(),o.forEach((t=>{t.kept||-1!==s.indexOf(t.id)||-1!==e.indexOf(t.id)||t.dispose()}))}return l}case"LoopCond":return[L(C("pred",t,e,n))];case"Switch":{const r=C("pred",t,e,n);let i=C("data",t,e,n);return i.kept||(i=L(i)),(await r.data())[0]?[void 0,i]:[i,void 0]}case"Merge":{const r=t.inputNames.find((t=>void 0!==T(t,e,n)));if(r){return[L(T(r,e,n))]}return}case"Enter":{const r=C("frameName",t,e,n),i=C("tensor",t,e,n);return n.enterFrame(r),[L(i)]}case"Exit":{const r=C("tensor",t,e,n);return n.exitFrame(),[L(r)]}case"NextIteration":{const r=C("tensor",t,e,n);return n.nextIteration(),[L(r)]}case"TensorArrayV3":{const r=C("size",t,e,n),i=C("dtype",t,e,n),o=C("elementShape",t,e,n),a=C("dynamicSize",t,e,n),s=C("clearAfterRead",t,e,n),u=C("identicalElementShapes",t,e,n),l=C("name",t,e,n),c=new wt(l,i,r,o,u,a,s);return n.addTensorArray(c),[c.idTensor,(0,_.scalar)(1)]}case"TensorArrayWriteV3":{const r=C("tensorArrayId",t,e,n),i=C("index",t,e,n),o=C("tensor",t,e,n),a=n.getTensorArray(r.id);return a.write(i,o),[a.idTensor]}case"TensorArrayReadV3":{const r=C("tensorArrayId",t,e,n),i=C("index",t,e,n);return[n.getTensorArray(r.id).read(i)]}case"TensorArrayGatherV3":{const r=C("tensorArrayId",t,e,n),i=C("indices",t,e,n),o=C("dtype",t,e,n);return[n.getTensorArray(r.id).gather(i,o)]}case"TensorArrayScatterV3":{const r=C("tensorArrayId",t,e,n),i=C("indices",t,e,n),o=C("tensor",t,e,n),a=n.getTensorArray(r.id);return a.scatter(i,o),[a.idTensor]}case"TensorArrayConcatV3":{const r=C("tensorArrayId",t,e,n),i=n.getTensorArray(r.id),o=C("dtype",t,e,n);return[i.concat(o)]}case"TensorArraySplitV3":{const r=C("tensorArrayId",t,e,n),i=C("tensor",t,e,n),o=C("lengths",t,e,n),a=n.getTensorArray(r.id);return a.split(o,i),[a.idTensor]}case"TensorArraySizeV3":{const r=C("tensorArrayId",t,e,n),i=n.getTensorArray(r.id);return[(0,_.scalar)(i.size(),"int32")]}case"TensorArrayCloseV3":{const r=C("tensorArrayId",t,e,n),i=n.getTensorArray(r.id);return i.clearAndClose(),[i.idTensor]}case"TensorListSetItem":{const r=C("tensorListId",t,e,n),i=C("index",t,e,n),o=C("tensor",t,e,n),a=n.getTensorList(r.id);return a.setItem(i,o),[a.idTensor]}case"TensorListGetItem":{const r=C("tensorListId",t,e,n),i=C("index",t,e,n),o=C("elementShape",t,e,n),a=C("elementDType",t,e,n);return[n.getTensorList(r.id).getItem(i,o,a)]}case"TensorListScatterV2":case"TensorListScatter":{const r=C("indices",t,e,n),i=function(t,e,n,r){if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const i=Math.max(...e);if(null!=r&&-1!==r&&i>=r)throw new Error(`Max index must be < array size (${i} vs. ${r})`);const o=new _t([],n,t.dtype,r),a=(0,_.unstack)(t,0);return e.forEach(((t,e)=>{o.setItem(t,a[e])})),o}(C("tensor",t,e,n),r,C("elementShape",t,e,n),C("numElements",t,e,n));return n.addTensorList(i),[i.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=C("elementShape",t,e,n),i=C("elementDType",t,e,n);let o;o="TensorListReserve"===t.op?"numElements":"maxNumElements";const a=C(o,t,e,n),s=function(t,e,n,r){return new _t([],t,e,r)}(r,i,0,"TensorListReserve"===t.op?-1:a);return n.addTensorList(s),[s.idTensor]}case"TensorListGather":{const r=C("tensorListId",t,e,n),i=C("indices",t,e,n),o=C("elementShape",t,e,n),a=C("elementDType",t,e,n);return[n.getTensorList(r.id).gather(i,a,o)]}case"TensorListStack":{const r=C("tensorListId",t,e,n),i=C("elementShape",t,e,n),o=C("elementDType",t,e,n),a=C("numElements",t,e,n);return[n.getTensorList(r.id).stack(i,o,a)]}case"TensorListFromTensor":{const r=function(t,e,n){const r=t.dtype;if(t.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${t.shape}`);if(t.dtype!==n)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${n}`);vt(t.shape.slice(1),e,"TensorList shape mismatch: ");const i=(0,_.unstack)(t);return new _t(i,e,r)}(C("tensor",t,e,n),C("elementShape",t,e,n),C("elementDType",t,e,n));return n.addTensorList(r),[r.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const r=C("tensorListId",t,e,n),i=n.getTensorList(r.id),o=C("dtype",t,e,n),a=C("elementShape",t,e,n);return[i.concat(o,a)]}case"TensorListPushBack":{const r=C("tensorListId",t,e,n),i=C("tensor",t,e,n),o=n.getTensorList(r.id);return o.pushBack(i),[o.idTensor]}case"TensorListPopBack":{const r=C("tensorListId",t,e,n),i=C("elementShape",t,e,n),o=C("elementDType",t,e,n);return[n.getTensorList(r.id).popBack(i,o)]}case"TensorListSplit":{const r=C("tensor",t,e,n),i=C("elementShape",t,e,n),o=function(t,e,n){let r=0;const i=e.map((t=>(r+=t,r)));if(r!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${r}, and tensor's shape is: ${t.shape}`);const o=xt(t.shape.slice(1),n),a=0===r?0:t.size/r,s=(0,_.tidy)((()=>{const n=[];t=(0,_.reshape)(t,[1,r,a]);for(let r=0;rt.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return At.d(this.size(),"int32")}async import(t,e){this.checkKeyAndValueTensor(t,e);const n=await t.data();return this.tensorMap.forEach((t=>t.dispose())),this.tensorMap.clear(),(0,_.tidy)((()=>{const t=(0,_.unstack)(e),r=n.length,i=t.length;_.util.assert(r===i,(()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${i} elements.`));for(let e=0;e{const t=[];for(let r=0;r{switch(t.category){case"arithmetic":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"BiasAdd":case"AddV2":case"Add":return[r.add(C("a",t,e,n),C("b",t,e,n))];case"AddN":return[r.addN(C("tensors",t,e,n))];case"FloorMod":case"Mod":return[r.mod(C("a",t,e,n),C("b",t,e,n))];case"Mul":return[r.mul(C("a",t,e,n),C("b",t,e,n))];case"RealDiv":case"Div":return[r.div(C("a",t,e,n),C("b",t,e,n))];case"DivNoNan":return[r.divNoNan(C("a",t,e,n),C("b",t,e,n))];case"FloorDiv":return[r.floorDiv(C("a",t,e,n),C("b",t,e,n))];case"Sub":return[r.sub(C("a",t,e,n),C("b",t,e,n))];case"Minimum":return[r.minimum(C("a",t,e,n),C("b",t,e,n))];case"Maximum":return[r.maximum(C("a",t,e,n),C("b",t,e,n))];case"Pow":return[r.pow(C("a",t,e,n),C("b",t,e,n))];case"SquaredDifference":return[r.squaredDifference(C("a",t,e,n),C("b",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"basic_math":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Abs":case"ComplexAbs":return[r.abs(C("x",t,e,n))];case"Acos":return[r.acos(C("x",t,e,n))];case"Acosh":return[r.acosh(C("x",t,e,n))];case"Asin":return[r.asin(C("x",t,e,n))];case"Asinh":return[r.asinh(C("x",t,e,n))];case"Atan":return[r.atan(C("x",t,e,n))];case"Atan2":return[r.atan2(C("x",t,e,n),C("y",t,e,n))];case"Atanh":return[r.atanh(C("x",t,e,n))];case"Ceil":return[r.ceil(C("x",t,e,n))];case"Complex":return[r.complex(C("real",t,e,n),C("imag",t,e,n))];case"Cos":return[r.cos(C("x",t,e,n))];case"Cosh":return[r.cosh(C("x",t,e,n))];case"Elu":return[r.elu(C("x",t,e,n))];case"Erf":return[r.erf(C("x",t,e,n))];case"Exp":return[r.exp(C("x",t,e,n))];case"Expm1":return[r.expm1(C("x",t,e,n))];case"Floor":return[r.floor(C("x",t,e,n))];case"Log":return[r.log(C("x",t,e,n))];case"Log1p":return[r.log1p(C("x",t,e,n))];case"Imag":return[r.imag(C("x",t,e,n))];case"Neg":return[r.neg(C("x",t,e,n))];case"Reciprocal":return[r.reciprocal(C("x",t,e,n))];case"Real":return[r.real(C("x",t,e,n))];case"Relu":return[r.relu(C("x",t,e,n))];case"Round":return[r.round(C("x",t,e,n))];case"Selu":return[r.selu(C("x",t,e,n))];case"Sigmoid":return[r.sigmoid(C("x",t,e,n))];case"Sin":return[r.sin(C("x",t,e,n))];case"Sign":return[r.sign(C("x",t,e,n))];case"Sinh":return[r.sinh(C("x",t,e,n))];case"Softplus":return[r.softplus(C("x",t,e,n))];case"Sqrt":return[r.sqrt(C("x",t,e,n))];case"Square":return[r.square(C("x",t,e,n))];case"Tanh":return[r.tanh(C("x",t,e,n))];case"Tan":return[r.tan(C("x",t,e,n))];case"ClipByValue":return[r.clipByValue(C("x",t,e,n),C("clipValueMin",t,e,n),C("clipValueMax",t,e,n))];case"Relu6":return[r.relu6(C("x",t,e,n))];case"Rsqrt":return[r.rsqrt(T(t.inputNames[0],e,n))];case"LeakyRelu":return[r.leakyRelu(C("x",t,e,n),C("alpha",t,e,n))];case"Prelu":return[r.prelu(C("x",t,e,n),C("alpha",t,e,n))];case"IsNan":return[r.isNaN(T(t.inputNames[0],e,n))];case"IsInf":return[r.isInf(T(t.inputNames[0],e,n))];case"IsFinite":return[r.isFinite(T(t.inputNames[0],e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"control":return St(t,e,n);case"convolution":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Conv1D":{const i=C("stride",t,e,n),o=C("pad",t,e,n),a=C("dataFormat",t,e,n).toUpperCase(),s=C("dilation",t,e,n);return[r.conv1d(C("x",t,e,n),C("filter",t,e,n),i,o,a,s)]}case"Conv2D":{const i=C("strides",t,e,n),o=O(t,e,n),a=C("dataFormat",t,e,n).toUpperCase(),s=C("dilations",t,e,n);return[r.conv2d(C("x",t,e,n),C("filter",t,e,n),[i[1],i[2]],o,a,[s[1],s[2]])]}case"_FusedConv2D":{const{stride:i,pad:o,dataFormat:a,dilations:s,biasArg:u,preluArg:l,activationFunc:c,leakyreluAlpha:h}=Et(t,e,n);return[r.fused.conv2d({x:C("x",t,e,n),filter:C("filter",t,e,n),strides:[i[1],i[2]],pad:o,dataFormat:a,dilations:[s[1],s[2]],bias:u,activation:c,preluActivationWeights:l,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:i,pad:o,dataFormat:a,dilations:s,biasArg:u,preluArg:l,activationFunc:c,leakyreluAlpha:h}=Et(t,e,n);return[r.fused.depthwiseConv2d({x:C("x",t,e,n),filter:C("filter",t,e,n),strides:[i[1],i[2]],pad:o,dataFormat:a,dilations:[s[1],s[2]],bias:u,activation:c,preluActivationWeights:l,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const i=C("outputShape",t,e,n),o=C("strides",t,e,n),a=O(t,e,n);return[r.conv2dTranspose(C("x",t,e,n),C("filter",t,e,n),i,[o[1],o[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const i=C("strides",t,e,n),o=O(t,e,n),a=C("dilations",t,e,n),s=C("dataFormat",t,e,n).toUpperCase();return[r.depthwiseConv2d(C("input",t,e,n),C("filter",t,e,n),[i[1],i[2]],o,s,[a[1],a[2]])]}case"Conv3D":{const i=C("strides",t,e,n),o=C("pad",t,e,n),a=C("dataFormat",t,e,n).toUpperCase(),s=C("dilations",t,e,n);return[r.conv3d(C("x",t,e,n),C("filter",t,e,n),[i[1],i[2],i[3]],o,a,[s[1],s[2],s[3]])]}case"AvgPool":{const i=C("strides",t,e,n),o=C("pad",t,e,n),a=C("kernelSize",t,e,n);return[r.avgPool(C("x",t,e,n),[a[1],a[2]],[i[1],i[2]],o)]}case"MaxPool":{const i=C("strides",t,e,n),o=C("pad",t,e,n),a=C("kernelSize",t,e,n);return[r.maxPool(C("x",t,e,n),[a[1],a[2]],[i[1],i[2]],o)]}case"MaxPoolWithArgmax":{const i=C("strides",t,e,n),o=C("pad",t,e,n),a=C("kernelSize",t,e,n),s=C("includeBatchInIndex",t,e,n),{result:u,indexes:l}=r.maxPoolWithArgmax(C("x",t,e,n),[a[1],a[2]],[i[1],i[2]],o,s);return[u,l]}case"AvgPool3D":{const i=C("strides",t,e,n),o=C("pad",t,e,n),a=C("kernelSize",t,e,n);return[r.avgPool3d(C("x",t,e,n),[a[1],a[2],a[3]],[i[1],i[2],i[3]],o)]}case"MaxPool3D":{const i=C("strides",t,e,n),o=C("pad",t,e,n),a=C("kernelSize",t,e,n);return[r.maxPool3d(C("x",t,e,n),[a[1],a[2],a[3]],[i[1],i[2],i[3]],o)]}case"Dilation2D":{const i=C("strides",t,e,n),o=C("pad",t,e,n),a=C("dilations",t,e,n),s=i[1],u=i[2],l=a[1],c=a[2];return[r.dilation2d(C("x",t,e,n),C("filter",t,e,n),[s,u],o,[l,c],"NHWC")]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"creation":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Fill":{const i=C("shape",t,e,n),o=C("dtype",t,e,n),a=C("value",t,e,n);return[r.fill(i,a,o)]}case"LinSpace":{const i=C("start",t,e,n),o=C("stop",t,e,n),a=C("num",t,e,n);return[r.linspace(i,o,a)]}case"Multinomial":{const i=C("logits",t,e,n),o=C("numSamples",t,e,n),a=C("seed",t,e,n);return[r.multinomial(i,o,a)]}case"OneHot":{const i=C("indices",t,e,n),o=C("depth",t,e,n),a=C("onValue",t,e,n),s=C("offValue",t,e,n),u=C("dtype",t,e,n);return[r.oneHot(i,o,a,s,u)]}case"Ones":return[r.ones(C("shape",t,e,n),C("dtype",t,e,n))];case"OnesLike":return[r.onesLike(C("x",t,e,n))];case"RandomStandardNormal":return[r.randomStandardNormal(C("shape",t,e,n),C("dtype",t,e,n),C("seed",t,e,n))];case"RandomUniform":return[r.randomUniform(C("shape",t,e,n),C("minval",t,e,n),C("maxval",t,e,n),C("dtype",t,e,n))];case"RandomUniformInt":return[r.randomUniformInt(C("shape",t,e,n),C("minval",t,e,n),C("maxval",t,e,n),C("seed",t,e,n))];case"Range":{const i=C("start",t,e,n),o=C("stop",t,e,n),a=C("step",t,e,n);return[r.range(i,o,a,C("dtype",t,e,n))]}case"TruncatedNormal":{const i=C("shape",t,e,n),o=C("mean",t,e,n),a=C("stdDev",t,e,n),s=C("seed",t,e,n);return[r.truncatedNormal(i,o,a,C("dtype",t,e,n),s)]}case"Zeros":return[r.zeros(C("shape",t,e,n),C("dtype",t,e,n))];case"ZerosLike":return[r.zerosLike(C("x",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"dynamic":return(async(t,e,n,r,i=gt)=>{switch(t.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:o,maxOutputSize:a,iouThreshold:s,scoreThreshold:u,softNmsSigma:l}=Mt(t,e,n),c=await i.image.nonMaxSuppressionWithScoreAsync(r,o,a,s,u,l);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:o,maxOutputSize:a,iouThreshold:s,scoreThreshold:u}=Mt(t,e,n),l=C("padToMaxOutputSize",t,e,n),c=await i.image.nonMaxSuppressionPaddedAsync(r,o,a,s,u,l);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:o,maxOutputSize:a,iouThreshold:s,scoreThreshold:u}=Mt(t,e,n);return[await i.image.nonMaxSuppressionAsync(r,o,a,s,u)]}case"Where":{const r=i.cast(C("condition",t,e,n),"bool"),o=[await i.whereAsync(r)];return r.dispose(),o}case"ListDiff":return i.setdiff1dAsync(C("x",t,e,n),C("y",t,e,n));default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n);case"evaluation":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"LowerBound":{const i=C("sortedSequence",t,e,n),o=C("values",t,e,n);return[r.lowerBound(i,o)]}case"TopKV2":{const i=C("x",t,e,n),o=C("k",t,e,n),a=C("sorted",t,e,n),s=r.topk(i,o,a);return[s.values,s.indices]}case"UpperBound":{const i=C("sortedSequence",t,e,n),o=C("values",t,e,n);return[r.upperBound(i,o)]}case"Unique":{const i=C("x",t,e,n),o=r.unique(i);return[o.values,o.indices]}case"UniqueV2":{const i=C("x",t,e,n),o=C("axis",t,e,n),a=r.unique(i,o);return[a.values,a.indices]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"image":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"ResizeBilinear":{const i=C("images",t,e,n),o=C("size",t,e,n),a=C("alignCorners",t,e,n),s=C("halfPixelCenters",t,e,n);return[r.image.resizeBilinear(i,[o[0],o[1]],a,s)]}case"ResizeNearestNeighbor":{const i=C("images",t,e,n),o=C("size",t,e,n),a=C("alignCorners",t,e,n),s=C("halfPixelCenters",t,e,n);return[r.image.resizeNearestNeighbor(i,[o[0],o[1]],a,s)]}case"CropAndResize":{const i=C("image",t,e,n),o=C("boxes",t,e,n),a=C("boxInd",t,e,n),s=C("cropSize",t,e,n),u=C("method",t,e,n),l=C("extrapolationValue",t,e,n);return[r.image.cropAndResize(i,o,a,s,u,l)]}case"ImageProjectiveTransformV3":{const i=C("images",t,e,n),o=C("transforms",t,e,n),a=C("outputShape",t,e,n),s=C("fillValue",t,e,n),u=C("interpolation",t,e,n),l=C("fillMode",t,e,n);return[r.image.transform(i,o,u.toLowerCase(),l.toLowerCase(),s,a)]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"graph":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Const":return e[t.name];case"PlaceholderWithDefault":const i=C("default",t,e,n);return[T(t.name,e,n)||i];case"Placeholder":return[T(t.name,e,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[L(C("x",t,e,n))];case"IdentityN":return C("x",t,e,n).map((t=>L(t)));case"Shape":return[r.tensor1d(C("x",t,e,n).shape,"int32")];case"ShapeN":return C("x",t,e,n).map((t=>r.tensor1d(t.shape)));case"Size":return[r.scalar(C("x",t,e,n).size,"int32")];case"Rank":return[r.scalar(C("x",t,e,n).rank,"int32")];case"NoOp":return[r.scalar(1)];case"Print":const o=C("x",t,e,n),a=C("data",t,e,n),s=C("message",t,e,n),u=C("summarize",t,e,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(s);for(let t=0;t((t,e,n,r=gt)=>{switch(t.op){case"Equal":return[r.equal(C("a",t,e,n),C("b",t,e,n))];case"NotEqual":return[r.notEqual(C("a",t,e,n),C("b",t,e,n))];case"Greater":return[r.greater(C("a",t,e,n),C("b",t,e,n))];case"GreaterEqual":return[r.greaterEqual(C("a",t,e,n),C("b",t,e,n))];case"Less":return[r.less(C("a",t,e,n),C("b",t,e,n))];case"LessEqual":return[r.lessEqual(C("a",t,e,n),C("b",t,e,n))];case"LogicalAnd":return[r.logicalAnd(C("a",t,e,n),C("b",t,e,n))];case"LogicalNot":return[r.logicalNot(C("a",t,e,n))];case"LogicalOr":return[r.logicalOr(C("a",t,e,n),C("b",t,e,n))];case"Select":case"SelectV2":return[r.where(C("condition",t,e,n),C("a",t,e,n),C("b",t,e,n))];case"BitwiseAnd":return[r.bitwiseAnd(C("a",t,e,n),C("b",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"matrices":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[r.matMul(C("a",t,e,n),C("b",t,e,n),C("transposeA",t,e,n),C("transposeB",t,e,n))];case"Einsum":return[r.einsum(C("equation",t,e,n),...C("tensors",t,e,n))];case"Transpose":return[r.transpose(C("x",t,e,n),C("perm",t,e,n))];case"_FusedMatMul":const[i,o]=C("fusedOps",t,e,n),a="biasadd"===i,s="prelu"===o,u=C("numArgs",t,e,n),l=C("leakyreluAlpha",t,e,n);if(a){if(s&&2!==u)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!s&&1!==u)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,h]=C("args",t,e,n);return[r.fused.matMul({a:C("a",t,e,n),b:C("b",t,e,n),transposeA:C("transposeA",t,e,n),transposeB:C("transposeB",t,e,n),bias:c,activation:o,preluActivationWeights:h,leakyreluAlpha:l})];case"MatrixBandPart":return[r.linalg.bandPart(C("a",t,e,n),C("numLower",t,e,n),C("numUpper",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"normalization":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"EuclideanNorm":return[r.euclideanNorm(C("x",t,e,n),C("axis",t,e,n),C("keepDims",t,e,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[r.batchNorm(C("x",t,e,n),C("mean",t,e,n),C("variance",t,e,n),C("offset",t,e,n),C("scale",t,e,n),C("epsilon",t,e,n))];case"LRN":return[r.localResponseNormalization(C("x",t,e,n),C("radius",t,e,n),C("bias",t,e,n),C("alpha",t,e,n),C("beta",t,e,n))];case"Softmax":return[r.softmax(C("x",t,e,n))];case"LogSoftmax":return[r.logSoftmax(C("x",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"ragged":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"RaggedGather":{const{outputNestedSplits:i,outputDenseValues:o}=r.raggedGather(C("paramsNestedSplits",t,e,n),C("paramsDenseValues",t,e,n),C("indices",t,e,n),C("outputRaggedRank",t,e,n));return i.concat(o)}case"RaggedRange":{const{rtNestedSplits:i,rtDenseValues:o}=r.raggedRange(C("starts",t,e,n),C("limits",t,e,n),C("splits",t,e,n));return[i,o]}case"RaggedTensorToTensor":return[r.raggedTensorToTensor(C("shape",t,e,n),C("values",t,e,n),C("defaultValue",t,e,n),C("rowPartitionTensors",t,e,n),C("rowPartitionTypes",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"reduction":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Max":{const i=C("axis",t,e,n),o=C("keepDims",t,e,n);return[r.max(C("x",t,e,n),i,o)]}case"Mean":{const i=C("axis",t,e,n),o=C("keepDims",t,e,n);return[r.mean(C("x",t,e,n),i,o)]}case"Min":{const i=C("axis",t,e,n),o=C("keepDims",t,e,n);return[r.min(C("x",t,e,n),i,o)]}case"Sum":{const i=C("axis",t,e,n),o=C("keepDims",t,e,n);return[r.sum(C("x",t,e,n),i,o)]}case"All":{const i=C("axis",t,e,n),o=C("keepDims",t,e,n);return[r.all(C("x",t,e,n),i,o)]}case"Any":{const i=C("axis",t,e,n),o=C("keepDims",t,e,n);return[r.any(C("x",t,e,n),i,o)]}case"ArgMax":{const i=C("axis",t,e,n);return[r.argMax(C("x",t,e,n),i)]}case"ArgMin":{const i=C("axis",t,e,n);return[r.argMin(C("x",t,e,n),i)]}case"Prod":{const i=C("axis",t,e,n),o=C("keepDims",t,e,n);return[r.prod(C("x",t,e,n),i,o)]}case"Cumprod":{const i=C("axis",t,e,n),o=C("exclusive",t,e,n),a=C("reverse",t,e,n);return[r.cumprod(C("x",t,e,n),i,o,a)]}case"Cumsum":{const i=C("axis",t,e,n),o=C("exclusive",t,e,n),a=C("reverse",t,e,n);return[r.cumsum(C("x",t,e,n),i,o,a)]}case"Bincount":const i=C("x",t,e,n),o=C("weights",t,e,n),a=C("size",t,e,n);return[r.bincount(i,o,a)];case"DenseBincount":{const i=C("x",t,e,n),o=C("weights",t,e,n),a=C("size",t,e,n),s=C("binaryOutput",t,e,n);return[r.denseBincount(i,o,a,s)]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"slice_join":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"ConcatV2":case"Concat":{const i=C("n",t,e,n),o=C("axis",t,e,n);let a=C("tensors",t,e,n);return a=a.slice(0,i),[r.concat(a,o)]}case"Gather":{const i=C("x",t,e,n),o=C("indices",t,e,n);return[r.gather(i,r.cast(o,"int32"),0)]}case"GatherV2":{const i=C("axis",t,e,n),o=C("batchDims",t,e,n),a=C("x",t,e,n),s=C("indices",t,e,n);return[r.gather(a,r.cast(s,"int32"),i,o)]}case"Reverse":{const i=C("dims",t,e,n),o=[];for(let t=0;t{const i=C("axis",t,e,n),o=C("tensors",t,e,n),a=o[0].shape,s=r.squeeze(o[0]).shape,u=o.map((t=>{const e=_.util.arraysEqual(t.shape,a);if(!e&&!_.util.arraysEqual(r.squeeze(t).shape,s))throw new Error("the input tensors shape does not match");return e?t:r.reshape(t,a)}));return[r.stack(u,i)]}));case"Unpack":{const i=C("axis",t,e,n),o=C("tensor",t,e,n);return r.unstack(o,i)}case"Tile":{const i=C("reps",t,e,n);return[r.tile(C("x",t,e,n),i)]}case"Split":case"SplitV":{const i=C("axis",t,e,n),o=C("numOrSizeSplits",t,e,n),a=C("x",t,e,n);return r.split(a,o,i)}case"ScatterNd":{const i=C("indices",t,e,n),o=C("values",t,e,n),a=C("shape",t,e,n);return[r.scatterND(i,o,a)]}case"GatherNd":{const i=C("x",t,e,n),o=C("indices",t,e,n);return[r.gatherND(i,o)]}case"SparseToDense":{const i=C("sparseIndices",t,e,n),o=C("outputShape",t,e,n),a=C("sparseValues",t,e,n),s=C("defaultValue",t,e,n);return[r.sparseToDense(i,a,o,a.dtype===s.dtype?s:r.cast(s,a.dtype))]}case"TensorScatterUpdate":{const i=C("indices",t,e,n),o=C("values",t,e,n),a=C("tensor",t,e,n);return[r.tensorScatterUpdate(a,i,o)]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"sparse":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"SparseFillEmptyRows":{const{outputIndices:i,outputValues:o,emptyRowIndicator:a,reverseIndexMap:s}=r.sparse.sparseFillEmptyRows(C("indices",t,e,n),C("values",t,e,n),C("denseShape",t,e,n),C("defaultValue",t,e,n));return[i,o,a,s]}case"SparseReshape":{const{outputIndices:i,outputShape:o}=r.sparse.sparseReshape(C("inputIndices",t,e,n),C("inputShape",t,e,n),C("newShape",t,e,n));return[i,o]}case"SparseSegmentMean":return[r.sparse.sparseSegmentMean(C("data",t,e,n),C("indices",t,e,n),C("segmentIds",t,e,n))];case"SparseSegmentSum":return[r.sparse.sparseSegmentSum(C("data",t,e,n),C("indices",t,e,n),C("segmentIds",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"spectral":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"FFT":return[r.fft(C("x",t,e,n))];case"IFFT":return[r.ifft(C("x",t,e,n))];case"RFFT":return[r.rfft(C("x",t,e,n))];case"IRFFT":return[r.irfft(C("x",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"string":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"StaticRegexReplace":return[r.string.staticRegexReplace(C("input",t,e,n),C("pattern",t,e,n),C("rewrite",t,e,n),C("replaceGlobal",t,e,n))];case"StringNGrams":{const{nGrams:i,nGramsSplits:o}=r.string.stringNGrams(C("data",t,e,n),C("dataSplits",t,e,n),C("separator",t,e,n),C("nGramWidths",t,e,n),C("leftPad",t,e,n),C("rightPad",t,e,n),C("padWidth",t,e,n),C("preserveShortSequences",t,e,n));return[i,o]}case"StringSplit":{const{indices:i,values:o,shape:a}=r.string.stringSplit(C("input",t,e,n),C("delimiter",t,e,n),C("skipEmpty",t,e,n));return[i,o,a]}case"StringToHashBucketFast":return[r.string.stringToHashBucketFast(C("input",t,e,n),C("numBuckets",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"transformation":return i((()=>((t,e,n,r=gt)=>{switch(t.op){case"Cast":return[r.cast(C("x",t,e,n),C("dtype",t,e,n))];case"ExpandDims":{const i=C("axis",t,e,n);return[r.expandDims(C("x",t,e,n),i)]}case"Squeeze":{const i=C("axis",t,e,n);return[r.squeeze(C("x",t,e,n),i)]}case"Reshape":return[r.reshape(C("x",t,e,n),C("shape",t,e,n))];case"EnsureShape":return[r.ensureShape(C("x",t,e,n),C("shape",t,e,n))];case"MirrorPad":return[r.mirrorPad(C("x",t,e,n),C("padding",t,e,n),C("mode",t,e,n))];case"PadV2":case"Pad":return[r.pad(C("x",t,e,n),C("padding",t,e,n),C("constantValue",t,e,n))];case"SpaceToBatchND":{const i=C("blockShape",t,e,n),o=C("paddings",t,e,n);return[r.spaceToBatchND(C("x",t,e,n),i,o)]}case"BatchToSpaceND":{const i=C("blockShape",t,e,n),o=C("crops",t,e,n);return[r.batchToSpaceND(C("x",t,e,n),i,o)]}case"DepthToSpace":{const i=C("blockSize",t,e,n),o=C("dataFormat",t,e,n).toUpperCase();return[r.depthToSpace(C("x",t,e,n),i,o)]}case"BroadcastTo":return[r.broadcastTo(C("x",t,e,n),C("shape",t,e,n))];case"BroadcastArgs":return[r.broadcastArgs(C("s0",t,e,n),C("s1",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n)));case"hash_table":return(async(t,e,n,r)=>{switch(t.op){case"HashTable":case"HashTableV2":{const i=r.getHashTableHandleByName(t.name);if(null!=i)return[i];{const i=C("keyDType",t,e,n),o=C("valueDType",t,e,n),a=new Ct(i,o);return r.addHashTable(t.name,a),[a.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const i=C("tableHandle",t,e,n,r),o=C("keys",t,e,n),a=C("values",t,e,n),s=r.getHashTableById(i.id);return[await s.import(o,a)]}case"LookupTableFind":case"LookupTableFindV2":{const i=C("tableHandle",t,e,n,r),o=C("keys",t,e,n),a=C("defaultValue",t,e,n),s=r.getHashTableById(i.id);return[await s.find(o,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const i=C("tableHandle",t,e,n,r);return[r.getHashTableById(i.id).tensorSize()]}default:throw TypeError(`Node type ${t.op} is not implemented`)}})(t,e,n,r);case"custom":const o=A(t.op);if(o&&o.customExecutor)return o.customExecutor(new mt(t,e,n));throw TypeError(`Custom op ${t.op} is not registered.`);default:throw TypeError(`Unknown op '${t.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(t,e,n);return _.util.isPromise(o)?o.then((t=>[].concat(t))):[].concat(o)}class kt{constructor(t={},e={},n={},r={},i){this.weightMap=t,this.tensorArrayMap=e,this.tensorListMap=n,this.functionMap=r,this.parseNodeNameCache=i,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(t,e){return{id:t,frameName:e,iterationId:0}}set currentContext(t){this.contexts!==t&&(this.contexts=t,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const t=[];for(let e=0;e0===t.id&&0===t.iterationId?"":`${t.frameName}-${t.iterationId}`)).join("/"):""}enterFrame(t){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,t)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const t=Object.assign({},this.contexts[this.contexts.length-1]);t.iterationId+=1,t.id=this.lastId,this.contexts.splice(-1,1,t),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(t){return this.weightMap[t]}addTensorArray(t){this.tensorArrayMap[t.id]=t}getTensorArray(t){return this.tensorArrayMap[t]}addTensorList(t){this.tensorListMap[t.id]=t}getTensorList(t){return this.tensorListMap[t]}dispose(t){for(const e in this.tensorArrayMap)this.tensorArrayMap[e].clearAndClose(t);for(const e in this.tensorListMap)this.tensorListMap[e].clearAndClose(t)}} +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +function It(t,e,n,r){const i=new Set,o=[];let a=null,s=null;const u=new Set,l=new Set(Object.keys(t).map((t=>P(t)[0])));r=r||[];const c=new Set(r.map((t=>P(t.name)[0]))),h=[...e];for(;h.length>0;){const t=h.pop();(Dt(t)||zt(t)||Ft(t))&&null==a&&(a=t,s=a.children.map((t=>t.name)).filter((t=>i.has(t)))),i.add(t.name),null==n[t.name]&&(l.has(t.name)||c.has(t.name)||(0!==t.inputs.length?t.inputs.forEach((t=>{u.has(t.name)||(u.add(t.name),h.push(t))})):o.push(t.name)))}return{inputs:t,outputs:e,usedNodes:i,missingInputs:o,dynamicNode:a,syncInputs:s}}function Nt(t,e){const{usedNodes:n,inputs:r}=e,i=Object.keys(r).map((t=>P(t)[0])).map((e=>t.nodes[e])),o=t.initNodes||[],a=t=>n.has("string"==typeof t?t:t.name);function s(t){return[...new Map(t.map((t=>[t.name,t]))).values()]}const u=s([...i,...t.weights,...o]).filter(a),l=s([...u,...Object.values(t.nodes)]).filter(a),c=new Map(l.map((t=>[t.name,t]))),h={};for(const t of l){h[t.name]=h[t.name]||0;for(const e of t.children)a(e)||(h[e.name]=Number.POSITIVE_INFINITY),h[e.name]=(h[e.name]||0)+1}const d=Object.entries(h).filter((([,t])=>0===t)).map((([t])=>t)),f=[...d];for(;d.length>0;){const t=d.pop(),e=c.get(t);for(const t of e.children.filter(a))0==--h[t.name]&&(f.push(t.name),d.push(t.name))}const p=function(t,e){const n=new Map(t.map((t=>[t.name,t]))),r=e.map((t=>t.name)),i=new Set(r);for(;r.length>0;){const t=r.pop(),e=n.get(t);for(const t of e.children)n.has(t.name)&&!i.has(t.name)&&(i.add(t.name),r.push(t.name))}const o=t.filter((t=>i.has(t.name)));return o}(f.map((t=>c.get(t))),u);return function(t,e){const n=new Map(t.map(((t,e)=>[t.name,e]))),r=new Set(e.map((t=>t.name))),i=t=>r.has("string"==typeof t?t:t.name),o=new Set(t.map((t=>t.name))),a=t=>o.has("string"==typeof t?t:t.name);for(const e of t){for(const t of e.children.filter(a)){if(!n.has(t.name))throw new Pt(`Child ${t.name} of node ${e.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new Pt(`Node ${e.name} is scheduled to run after its child ${t.name}.`)}if(!i(e))for(const t of e.inputs){if(!n.has(t.name))throw new Pt(`Input ${t.name} of node ${e.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new Pt(`Node ${e.name} is scheduled to run before its input ${t.name}.`)}}}(p,u),p}class Pt extends Error{constructor(t){super(`NodesExecutionOrderError: ${t}`)}}const Ot=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),Lt=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),Rt=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function Dt(t){return Ot.has(t.op)}function zt(t){return Lt.has(t.op)}function Ft(t){return Rt.has(t.op)} +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +class Bt{get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(t){const e=Object.keys(t).map((e=>t[e].map((t=>t.id))));this._weightIds=[].concat(...e),this._weightMap=t}set resourceManager(t){this._resourceManager=t}get inputs(){return this._inputs.map((t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((t=>t.signatureKey||t.name))}get outputNodes(){return this._outputs.map((t=>{const e=t.signatureKey||t.name;return t.defaultOutput?`${e}:${t.defaultOutput}`:e}))}get functions(){return Object.keys(this._functions).reduce(((t,e)=>(t[e]=this._functions[e].signature,t)),{})}constructor(t,e){this.graph=t,this.parent=e,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,null!=t.functions&&Object.keys(t.functions).forEach((e=>{this._functionExecutorMap[e]=new Bt(t.functions[e],this)}))}getCompilationKey(t,e){const n=t.map((t=>t.name)).sort(),r=e.map((t=>t.name)).sort();return n.join(this.SEPARATOR)+"--"+r.join(this.SEPARATOR)}compile(t,e){const n=It(t,e,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:i,syncInputs:o}=n;if(null!=i)throw new Error(`This execution contains the node '${i.name}', which has the dynamic op '${i.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${o}]`);if(r.length>0){const n=e.map((t=>t.name)),i=Object.keys(t);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${i}]. Missing the following inputs: [${r}]`)}const a=Nt(this.graph,n),s=function(t){const e=new Map(t.map(((t,e)=>[t.name,e]))),n=Number.MAX_SAFE_INTEGER,r=t.map(((t,e)=>Dt(t)?n:e)),i=t=>{const n=r[e.get(t.name)];return null==n?-1:n},o=t.map(((t,e)=>t.children.map(i).reduce(((t,e)=>Math.max(t,e)),r[e]))),a=new Map;for(let e=0;ethis.cloneAndKeepTensor(t)))}cloneTensorMap(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,this.cloneTensorList(e)])))}execute(t,e){this.disposeIntermediateTensors(),t=this.mapInputs(t);const n=Object.keys(t).sort();this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e);const r=n.map((t=>this.graph.nodes[P(t)[0]])),i=e.map((t=>P(t)[0])),o=new Set(i);let a=i.map((t=>this.graph.nodes[t]));0===a.length&&(a=this._outputs);const s=this.getCompilationKey(r,a);let u=this.compiledMap.get(s);null==u&&(u=this.compile(t,a),this.compiledMap.set(s,u));try{this.keepIntermediateTensors=(0,_.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(t){this.keepIntermediateTensors=!1,console.warn(t.message)}const l={},c={};return(0,_.tidy)((()=>{const n=new kt(this.weightMap,l,c,this.functionExecutorMap,this.parseNodeNameCache),r=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(t).forEach((e=>{const[i,o]=P(e,n),a=[];a[o]=t[e],r[i]=a,this.keepIntermediateTensors&&(this.clonedTensorsMap[i]=this.cloneTensorList(a))}));const i=this.getFrozenTensorIds(r),{orderedNodes:a,nodeLiveUntilMap:s}=u;for(const t of a){if(r[t.name])continue;const e=Tt(t,r,n,this._resourceManager);if(_.util.isPromise(e))throw new Error(`The execution of the op '${t.op}' returned a promise. Please use model.executeAsync() instead.`);r[t.name]=e,this.keepIntermediateTensors&&(this.clonedTensorsMap[t.name]=this.cloneTensorList(e)),this.checkTensorForDisposalWithNodeLiveUntilInfo(t,r,n,i,o,s.get(t.name))}return null==this.parent&&n.dispose(i),e.map((t=>T(t,r,n)))}))}getFrozenTensorIds(t){const e=[].concat.apply([],Object.keys(t).map((e=>t[e])).map((t=>t.map((t=>t.id)))));return new Set(e)}checkTensorForDisposal(t,e,n,r,i,o,a){if(!Dt(e)&&!o.has(t)){for(const r of n[t])null!=r&&(a[r.id]=(a[r.id]||0)+e.children.length);for(const t of e.inputs){if(Dt(t))continue;const e=k(t.name,n,r);if(null!=e)for(const t of e){if(!t||t.kept||i.has(t.id))continue;const e=a[t.id];1===e?(t.dispose(),delete a[t.id]):null!=e&&a[t.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(t,e,n,r,i,o){function a(t){return Dt(t)||i.has(t.name)}if(!Dt(t)&&null!=o)for(const t of o){if(a(t))continue;const i=k(t.name,e,n);for(const t of i)!t||t.kept||r.has(t.id)||t.dispose()}}async executeAsync(t,e){return this._executeAsync(t,e)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach((t=>{for(const e of t)e&&!e.isDisposed&&e.dispose()})),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(t,e,n=!1,r={},i={}){this.disposeIntermediateTensors(),n||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e));try{this.keepIntermediateTensors=(0,_.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(t){this.keepIntermediateTensors=!1,console.warn(t.message)}const o=new kt(this.weightMap,r,i,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const a=await this.executeWithControlFlow(t,o,e,n),s=e.map((t=>T(t,a,o))),u=s.map((t=>t.id)),l=Object.keys(t).map((e=>t[e].id)),c=new Set([...u,...l,...this.weightIds]);return Object.values(a).forEach((t=>{t.forEach((t=>{!t||t.isDisposed||c.has(t.id)||t.dispose()}))})),null==this.parent&&o.dispose(c),s}async executeFunctionAsync(t,e,n){const r=t.reduce(((t,e,n)=>(t[this.inputs[n].name]=e,t)),{});return this._executeAsync(r,this.outputNodes,!0,e,n)}async executeWithControlFlow(t,e,n,r){const i=Object.keys(t),o=i.map((t=>this.graph.nodes[P(t)[0]])),a=n.map((t=>P(t)[0])),s=new Set(a);let u=a.map((t=>this.graph.nodes[t]));0===u.length&&(u=this._outputs);const{usedNodes:l,missingInputs:c,dynamicNode:h,syncInputs:d}=It(t,u,this.weightMap,this._initNodes),f=[...o,...this.graph.weights,...this._initNodes||[]].map((t=>({node:t,contexts:e.currentContext}))),p=Object.assign({},this.weightMap);Object.keys(t).forEach((e=>{const[n,r]=P(e),i=[];i[r]=t[e],p[n]=i}));const m={},g=this.getFrozenTensorIds(p),v={};for(;f.length>0;){const t=this.processStack(o,f,e,p,v,g,s,m,l);await Promise.all(t)}null!=h||r||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const y=u.filter((t=>!Dt(t)&&!T(t.name,p,e))).map((t=>t.name));if(y.length>0){let t="";throw null!=h&&(t=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${i}]. Consider providing the following inputs: [${c}]. ${t}`)}return p}processStack(t,e,n,r,i,o,a,s,u){const l=[];for(;e.length>0;){const t=e.pop();n.currentContext=t.contexts;let c="";if("Enter"===t.node.op&&C("isConstant",t.node,r,n)&&([c]=I(t.node.name,n)),null==r[t.node.name]){const h=Tt(t.node,r,n,this._resourceManager);c||([c]=I(t.node.name,n));const d=n.currentContext;_.util.isPromise(h)?l.push(h.then((l=>(r[c]=l,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(l)),n.currentContext=d,this.checkTensorForDisposal(c,t.node,r,n,o,a,s),this.processChildNodes(t.node,e,n,r,i,u),l)))):(r[c]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(h)),this.checkTensorForDisposal(c,t.node,r,n,o,a,s),this.processChildNodes(t.node,e,n,r,i,u))}else this.processChildNodes(t.node,e,n,r,i,u)}return l}processChildNodes(t,e,n,r,i,o){t.children.forEach((t=>{const[a]=I(t.name,n);!i[a]&&o.has(t.name)&&("Merge"===t.op?t.inputNames.some((t=>!!T(t,r,n)))&&(i[a]=!0,e.push({contexts:n.currentContext,node:t})):t.inputNames.every((t=>!!T(t,r,n)))&&(i[a]=!0,e.push({contexts:n.currentContext,node:t})))}))}dispose(){Object.keys(this.weightMap).forEach((t=>this.weightMap[t].forEach((t=>t.dispose()))))}checkInputShapeAndType(t){Object.keys(t).forEach((e=>{const n=t[e],[r]=P(e),i=this.graph.nodes[r];if(i.attrParams.shape&&i.attrParams.shape.value){const t=i.attrParams.shape.value,e=t.length===n.shape.length&&n.shape.every(((e,n)=>-1===t[n]||t[n]===e));_.util.assert(e,(()=>`The shape of dict['${i.name}'] provided in model.execute(dict) must be [${t}], but was [${n.shape}]`))}i.attrParams.dtype&&i.attrParams.dtype.value&&_.util.assert(n.dtype===i.attrParams.dtype.value,(()=>`The dtype of dict['${i.name}'] provided in model.execute(dict) must be ${i.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(t){var e,n;const r={};for(const i in t){const o=null===(n=null===(e=this._signature)||void 0===e?void 0:e.inputs)||void 0===n?void 0:n[i];null!=o?r[o.name]=t[i]:r[i]=t[i]}return r}checkInputs(t){const e=Object.keys(t).filter((t=>{const[e]=P(t);return null==this.graph.nodes[e]}));if(e.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${e}] that are not part of graph`)}mapOutputs(t){return t.map((t=>{var e,n;const r=null===(n=null===(e=this._signature)||void 0===e?void 0:e.outputs)||void 0===n?void 0:n[t];return null!=r?r.name:t}),{})}checkOutputs(t){t.forEach((t=>{const[e]=P(t);if(!this.graph.nodes[e])throw new Error(`The output '${t}' is not found in the graph`)}))}}class Ut{constructor(t={},e={}){this.hashTableNameToHandle=t,this.hashTableMap=e}addHashTable(t,e){this.hashTableNameToHandle[t]=e.handle,this.hashTableMap[e.id]=e}getHashTableHandleByName(t){return this.hashTableNameToHandle[t]}getHashTableById(t){return this.hashTableMap[t]}dispose(){for(const t in this.hashTableMap)this.hashTableMap[t].clearAndClose(),delete this.hashTableMap[t];for(const t in this.hashTableNameToHandle)this.hashTableNameToHandle[t].dispose(),delete this.hashTableNameToHandle[t]}}var jt=n(77084); +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +const Vt="?tfjs-format=file",Ht="model.json";class Gt{get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(t,e={},n=_.io){this.modelUrl=t,this.loadOptions=e,this.version="n/a",this.io=n,null==e&&(this.loadOptions={}),this.resourceManager=new Ut}findIOHandler(){const t=this.modelUrl;if(null!=t.load)this.handler=t;else if(null!=this.loadOptions.requestInit)this.handler=this.io.browserHTTPRequest(t,this.loadOptions);else{const e=this.io.getLoadHandlers(t,this.loadOptions);if(0===e.length)e.push(this.io.browserHTTPRequest(t,this.loadOptions));else if(e.length>1)throw new Error(`Found more than one (${e.length}) load handlers for URL '${[t]}'`);this.handler=e[0]}}load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const t=this.handler.load();return _.util.isPromise(t)?t.then((t=>null==t.getWeightStream?this.loadSync(t):this.loadStreaming(t))):this.loadSync(t)}loadSync(t){const e=this.io.decodeWeights(t.weightData,t.weightSpecs);return this.loadWithWeightMap(t,e)}async loadStreaming(t){if(null==t.getWeightStream)throw new Error("Model artifacts missing streamWeights function");const e=await(0,jt.s5)(t.getWeightStream(),t.weightSpecs);return this.loadWithWeightMap(t,e)}loadWithWeightMap(t,e){this.artifacts=t;const n=this.artifacts.modelTopology;let r=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const t=this.artifacts.userDefinedMetadata;null!=t.signature&&(r=t.signature),null!=t.structuredOutputKeys&&(this.structuredOutputKeys=t.structuredOutputKeys)}if(this.signature=r,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new Bt(tt.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(e),this.executor.resourceManager=this.resourceManager,null!=t.modelInitializer&&null!=t.modelInitializer.node){const e=tt.Instance.transformGraph(t.modelInitializer);this.initializer=new Bt(e),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=t.initializerSignature}return!0}async save(t,e){if("string"==typeof t){const e=this.io.getSaveHandlers(t);if(0===e.length)throw new Error(`Cannot find any save handlers for URL '${t}'`);if(e.length>1)throw new Error(`Found more than one (${e.length}) save handlers for URL '${t}'`);t=e[0]}if(null==t.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return t.save(this.artifacts)}addStructuredOutputNames(t){if(this.structuredOutputKeys){const e=t instanceof _.Tensor?[t]:t,n={};return e.forEach(((t,e)=>n[this.structuredOutputKeys[e]]=t)),n}return t}predict(t,e){const n=this.execute(t,this.outputNodes);return this.addStructuredOutputNames(n)}async predictAsync(t,e){const n=await this.executeAsync(t,this.outputNodes);return this.addStructuredOutputNames(n)}normalizeInputs(t){var e;if(!(t instanceof _.Tensor||Array.isArray(t))){const n=null===(e=this.signature)||void 0===e?void 0:e.inputs;if(null!=n)for(const e in n){const r=n[e];null!=r.resourceId&&(t[e]=this.resourceIdToCapturedInput[r.resourceId])}return t}t=Array.isArray(t)?t:[t];const n=Object.keys(this.resourceIdToCapturedInput).length;if(t.length+n!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-n} non-resource placeholders, while there are ${t.length} input tensors provided.`);let r=0;return this.inputNodes.reduce(((e,n)=>{var i,o,a;const s=null===(a=null===(o=null===(i=this.signature)||void 0===i?void 0:i.inputs)||void 0===o?void 0:o[n])||void 0===a?void 0:a.resourceId;return e[n]=null!=s?this.resourceIdToCapturedInput[s]:t[r++],e}),{})}normalizeOutputs(t){return t=t||this.outputNodes,Array.isArray(t)?t:[t]}executeInitializerGraph(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return null==this.initializer?[]:null==this.initializerSignature?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(t){if(this.resourceIdToCapturedInput={},this.initializerSignature){const e=this.initializerSignature.outputs,n=Object.keys(e);for(let r=0;r1?n:n[0]}async executeAsync(t,e){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),t=this.normalizeInputs(t),e=this.normalizeOutputs(e);const n=await this.executor.executeAsync(t,e);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(t){return Object.keys(t).reduce(((e,n)=>(e[n]=[t[n]],e)),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&(0,_.dispose)(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function Wt(t,e={},n=_.io){if(null==t)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==e&&(e={}),e.fromTFHub&&"string"==typeof t&&(t=function(t){t.endsWith("/")||(t+="/");return`${t}${Ht}${Vt}`}(t));const r=new Gt(t,e,n);return await r.load(),r}} +/** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */,79045:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(31635),i=n(38221),o=n.n(i),a=n(96540);const s=function(t){var e=(0,a.useRef)(t);return e.current=t,e};const u=function(t){var e=s(t);(0,a.useEffect)((function(){return function(){e.current()}}),[])};const l=function(t,e){var n,i=s(t),l=null!==(n=null==e?void 0:e.wait)&&void 0!==n?n:1e3,c=(0,a.useMemo)((function(){return o()((function(){for(var t=[],e=0;e{"use strict";n.d(e,{HK:()=>dr,Zc:()=>ce,az:()=>M,eB:()=>o,nB:()=>L});class r{constructor(t){void 0===t&&(t=[0,0,0,0,0,0,0,0,0]),this.elements=t}identity(){const t=this.elements;t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1}setZero(){const t=this.elements;t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0}setTrace(t){const e=this.elements;e[0]=t.x,e[4]=t.y,e[8]=t.z}getTrace(t){void 0===t&&(t=new o);const e=this.elements;return t.x=e[0],t.y=e[4],t.z=e[8],t}vmult(t,e){void 0===e&&(e=new o);const n=this.elements,r=t.x,i=t.y,a=t.z;return e.x=n[0]*r+n[1]*i+n[2]*a,e.y=n[3]*r+n[4]*i+n[5]*a,e.z=n[6]*r+n[7]*i+n[8]*a,e}smult(t){for(let e=0;e0){const t=1/r;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return r}unit(t){void 0===t&&(t=new o);const e=this.x,n=this.y,r=this.z;let i=Math.sqrt(e*e+n*n+r*r);return i>0?(i=1/i,t.x=e*i,t.y=n*i,t.z=r*i):(t.x=1,t.y=0,t.z=0),t}length(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}lengthSquared(){return this.dot(this)}distanceTo(t){const e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z;return Math.sqrt((i-e)*(i-e)+(o-n)*(o-n)+(a-r)*(a-r))}distanceSquared(t){const e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z;return(i-e)*(i-e)+(o-n)*(o-n)+(a-r)*(a-r)}scale(t,e){void 0===e&&(e=new o);const n=this.x,r=this.y,i=this.z;return e.x=t*n,e.y=t*r,e.z=t*i,e}vmul(t,e){return void 0===e&&(e=new o),e.x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e}addScaledVector(t,e,n){return void 0===n&&(n=new o),n.x=this.x+t*e.x,n.y=this.y+t*e.y,n.z=this.z+t*e.z,n}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(t){return void 0===t&&(t=new o),t.x=-this.x,t.y=-this.y,t.z=-this.z,t}tangents(t,e){const n=this.length();if(n>0){const r=a,i=1/n;r.set(this.x*i,this.y*i,this.z*i);const o=s;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,t)):(o.set(0,1,0),r.cross(o,t)),r.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}lerp(t,e,n){const r=this.x,i=this.y,o=this.z;n.x=r+(t.x-r)*e,n.y=i+(t.y-i)*e,n.z=o+(t.z-o)*e}almostEquals(t,e){return void 0===e&&(e=1e-6),!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)}almostZero(t){return void 0===t&&(t=1e-6),!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)}isAntiparallelTo(t,e){return this.negate(u),u.almostEquals(t,e)}clone(){return new o(this.x,this.y,this.z)}}o.ZERO=new o(0,0,0),o.UNIT_X=new o(1,0,0),o.UNIT_Y=new o(0,1,0),o.UNIT_Z=new o(0,0,1);const a=new o,s=new o,u=new o;class l{constructor(t){void 0===t&&(t={}),this.lowerBound=new o,this.upperBound=new o,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}setFromPoints(t,e,n,r){const i=this.lowerBound,o=this.upperBound,a=n;i.copy(t[0]),a&&a.vmult(i,i),o.copy(i);for(let e=1;eo.x&&(o.x=n.x),n.xo.y&&(o.y=n.y),n.yo.z&&(o.z=n.z),n.z=i.x&&e.y<=r.y&&n.y>=i.y&&e.z<=r.z&&n.z>=i.z}getCorners(t,e,n,r,i,o,a,s){const u=this.lowerBound,l=this.upperBound;t.copy(u),e.set(l.x,u.y,u.z),n.set(l.x,l.y,u.z),r.set(u.x,l.y,l.z),i.set(l.x,u.y,l.z),o.set(u.x,l.y,u.z),a.set(u.x,u.y,l.z),s.copy(l)}toLocalFrame(t,e){const n=h,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=n[7];this.getCorners(r,i,o,a,s,u,l,c);for(let e=0;8!==e;e++){const r=n[e];t.pointToLocal(r,r)}return e.setFromPoints(n)}toWorldFrame(t,e){const n=h,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=n[7];this.getCorners(r,i,o,a,s,u,l,c);for(let e=0;8!==e;e++){const r=n[e];t.pointToWorld(r,r)}return e.setFromPoints(n)}overlapsRay(t){const{direction:e,from:n}=t,r=1/e.x,i=1/e.y,o=1/e.z,a=(this.lowerBound.x-n.x)*r,s=(this.upperBound.x-n.x)*r,u=(this.lowerBound.y-n.y)*i,l=(this.upperBound.y-n.y)*i,c=(this.lowerBound.z-n.z)*o,h=(this.upperBound.z-n.z)*o,d=Math.max(Math.max(Math.min(a,s),Math.min(u,l)),Math.min(c,h)),f=Math.min(Math.min(Math.max(a,s),Math.max(u,l)),Math.max(c,h));return!(f<0)&&!(d>f)}}const c=new o,h=[new o,new o,new o,new o,new o,new o,new o,new o];class d{constructor(){this.matrix=[]}get(t,e){let{index:n}=t,{index:r}=e;if(r>n){const t=r;r=n,n=t}return this.matrix[(n*(n+1)>>1)+r-1]}set(t,e,n){let{index:r}=t,{index:i}=e;if(i>r){const t=i;i=r,r=t}this.matrix[(r*(r+1)>>1)+i-1]=n?1:0}reset(){for(let t=0,e=this.matrix.length;t!==e;t++)this.matrix[t]=0}setNumObjects(t){this.matrix.length=t*(t-1)>>1}}class f{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;return void 0===n[t]&&(n[t]=[]),n[t].includes(e)||n[t].push(e),this}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return!(void 0===n[t]||!n[t].includes(e))}hasAnyEventListener(t){if(void 0===this._listeners)return!1;return void 0!==this._listeners[t]}removeEventListener(t,e){if(void 0===this._listeners)return this;const n=this._listeners;if(void 0===n[t])return this;const r=n[t].indexOf(e);return-1!==r&&n[t].splice(r,1),this}dispatchEvent(t){if(void 0===this._listeners)return this;const e=this._listeners[t.type];if(void 0!==e){t.target=this;for(let n=0,r=e.length;n.499&&(n=2*Math.atan2(o,u),r=Math.PI/2,i=0),t<-.499&&(n=-2*Math.atan2(o,u),r=-Math.PI/2,i=0),void 0===n){const e=o*o,l=a*a,c=s*s;n=Math.atan2(2*a*u-2*o*s,1-2*l-2*c),r=Math.asin(2*t),i=Math.atan2(2*o*u-2*a*s,1-2*e-2*c)}}t.y=n,t.z=r,t.x=i}setFromEuler(t,e,n,r){void 0===r&&(r="XYZ");const i=Math.cos(t/2),o=Math.cos(e/2),a=Math.cos(n/2),s=Math.sin(t/2),u=Math.sin(e/2),l=Math.sin(n/2);return"XYZ"===r?(this.x=s*o*a+i*u*l,this.y=i*u*a-s*o*l,this.z=i*o*l+s*u*a,this.w=i*o*a-s*u*l):"YXZ"===r?(this.x=s*o*a+i*u*l,this.y=i*u*a-s*o*l,this.z=i*o*l-s*u*a,this.w=i*o*a+s*u*l):"ZXY"===r?(this.x=s*o*a-i*u*l,this.y=i*u*a+s*o*l,this.z=i*o*l+s*u*a,this.w=i*o*a-s*u*l):"ZYX"===r?(this.x=s*o*a-i*u*l,this.y=i*u*a+s*o*l,this.z=i*o*l-s*u*a,this.w=i*o*a+s*u*l):"YZX"===r?(this.x=s*o*a+i*u*l,this.y=i*u*a+s*o*l,this.z=i*o*l-s*u*a,this.w=i*o*a-s*u*l):"XZY"===r&&(this.x=s*o*a-i*u*l,this.y=i*u*a-s*o*l,this.z=i*o*l+s*u*a,this.w=i*o*a+s*u*l),this}clone(){return new p(this.x,this.y,this.z,this.w)}slerp(t,e,n){void 0===n&&(n=new p);const r=this.x,i=this.y,o=this.z,a=this.w;let s,u,l,c,h,d=t.x,f=t.y,m=t.z,g=t.w;return u=r*d+i*f+o*m+a*g,u<0&&(u=-u,d=-d,f=-f,m=-m,g=-g),1-u>1e-6?(s=Math.acos(u),l=Math.sin(s),c=Math.sin((1-e)*s)/l,h=Math.sin(e*s)/l):(c=1-e,h=e),n.x=c*r+h*d,n.y=c*i+h*f,n.z=c*o+h*m,n.w=c*a+h*g,n}integrate(t,e,n,r){void 0===r&&(r=new p);const i=t.x*n.x,o=t.y*n.y,a=t.z*n.z,s=this.x,u=this.y,l=this.z,c=this.w,h=.5*e;return r.x+=h*(i*c+o*l-a*u),r.y+=h*(o*c+a*s-i*l),r.z+=h*(a*c+i*u-o*s),r.w+=h*(-i*s-o*u-a*l),r}}const m=new o,g=new o;class v{constructor(t){void 0===t&&(t={}),this.id=v.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw`computeBoundingSphereRadius() not implemented for shape type ${this.type}`}volume(){throw`volume() not implemented for shape type ${this.type}`}calculateLocalInertia(t,e){throw`calculateLocalInertia() not implemented for shape type ${this.type}`}calculateWorldAABB(t,e,n,r){throw`calculateWorldAABB() not implemented for shape type ${this.type}`}}v.idCounter=0,v.types={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class y{constructor(t){void 0===t&&(t={}),this.position=new o,this.quaternion=new p,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return y.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return y.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,n,r){return void 0===r&&(r=new o),n.vsub(t,r),e.conjugate(b),b.vmult(r,r),r}static pointToWorldFrame(t,e,n,r){return void 0===r&&(r=new o),e.vmult(n,r),r.vadd(t,r),r}static vectorToWorldFrame(t,e,n){return void 0===n&&(n=new o),t.vmult(e,n),n}static vectorToLocalFrame(t,e,n,r){return void 0===r&&(r=new o),e.w*=-1,e.vmult(n,r),e.w*=-1,r}}const b=new p;class x extends v{constructor(t){void 0===t&&(t={});const{vertices:e=[],faces:n=[],normals:r=[],axes:i,boundingSphereRadius:o}=t;super({type:v.types.CONVEXPOLYHEDRON}),this.vertices=e,this.faces=n,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=i?i.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const t=this.faces,e=this.vertices,n=this.uniqueEdges;n.length=0;const r=new o;for(let i=0;i!==t.length;i++){const o=t[i],a=o.length;for(let t=0;t!==a;t++){const i=(t+1)%a;e[o[t]].vsub(e[o[i]],r),r.normalize();let s=!1;for(let t=0;t!==n.length;t++)if(n[t].almostEquals(r)||n[t].almostEquals(r)){s=!0;break}s||n.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let t=0;td&&(d=e,h=t)}const f=[];for(let t=0;t=0&&this.clipFaceAgainstHull(a,t,e,f,s,u,l)}findSeparatingAxis(t,e,n,r,i,a,s,u){const l=new o,c=new o,h=new o,d=new o,f=new o,p=new o;let m=Number.MAX_VALUE;const g=this;if(g.uniqueAxes)for(let o=0;o!==g.uniqueAxes.length;o++){n.vmult(g.uniqueAxes[o],l);const s=g.testSepAxis(l,t,e,n,r,i);if(!1===s)return!1;s0&&a.negate(a),!0}testSepAxis(t,e,n,r,i,o){x.project(this,t,n,r,w),x.project(e,t,i,o,_);const a=w[0],s=w[1],u=_[0],l=_[1];if(ae.x&&(e.x=i.x),i.ye.y&&(e.y=i.y),i.ze.z&&(e.z=i.z)}}computeWorldFaceNormals(t){const e=this.faceNormals.length;for(;this.worldFaceNormals.lengtht&&(t=r)}this.boundingSphereRadius=Math.sqrt(t)}calculateWorldAABB(t,e,n,r){const i=this.vertices;let a,s,u,l,c,h,d=new o;for(let n=0;nl)&&(l=r.x),(void 0===s||r.yc)&&(c=r.y),(void 0===u||r.zh)&&(h=r.z)}n.set(a,s,u),r.set(l,c,h)}volume(){return 4*Math.PI*this.boundingSphereRadius/3}getAveragePointLocal(t){void 0===t&&(t=new o);const e=this.vertices;for(let n=0;n0||c>0&&d<0)return!1}return-1}static project(t,e,n,r,i){const o=t.vertices.length,a=S;let s=0,u=0;const l=E,c=t.vertices;l.setZero(),y.vectorToLocalFrame(n,r,e,a),y.pointToLocalFrame(n,r,l,l);const h=l.dot(a);u=s=c[0].dot(a);for(let t=1;ts&&(s=e),es){const t=u;u=s,s=t}i[0]=s,i[1]=u}}const w=[],_=[],S=(new o,new o),E=new o;class M extends v{constructor(t){super({type:v.types.BOX}),this.halfExtents=t,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}updateConvexPolyhedronRepresentation(){const t=this.halfExtents.x,e=this.halfExtents.y,n=this.halfExtents.z,r=o,i=[new r(-t,-e,-n),new r(t,-e,-n),new r(t,e,-n),new r(-t,e,-n),new r(-t,-e,n),new r(t,-e,n),new r(t,e,n),new r(-t,e,n)],a=[new r(0,0,1),new r(0,1,0),new r(1,0,0)],s=new x({vertices:i,faces:[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],axes:a});this.convexPolyhedronRepresentation=s,s.material=this.material}calculateLocalInertia(t,e){return void 0===e&&(e=new o),M.calculateInertia(this.halfExtents,t,e),e}static calculateInertia(t,e,n){const r=t;n.x=1/12*e*(2*r.y*2*r.y+2*r.z*2*r.z),n.y=1/12*e*(2*r.x*2*r.x+2*r.z*2*r.z),n.z=1/12*e*(2*r.y*2*r.y+2*r.x*2*r.x)}getSideNormals(t,e){const n=t,r=this.halfExtents;if(n[0].set(r.x,0,0),n[1].set(0,r.y,0),n[2].set(0,0,r.z),n[3].set(-r.x,0,0),n[4].set(0,-r.y,0),n[5].set(0,0,-r.z),void 0!==e)for(let t=0;t!==n.length;t++)e.vmult(n[t],n[t]);return n}volume(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z}updateBoundingSphereRadius(){this.boundingSphereRadius=this.halfExtents.length()}forEachWorldCorner(t,e,n){const r=this.halfExtents,i=[[r.x,r.y,r.z],[-r.x,r.y,r.z],[-r.x,-r.y,r.z],[-r.x,-r.y,-r.z],[r.x,-r.y,-r.z],[r.x,r.y,-r.z],[-r.x,r.y,-r.z],[r.x,-r.y,r.z]];for(let r=0;rr.x&&(r.x=a),s>r.y&&(r.y=s),u>r.z&&(r.z=u),a0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?L.STATIC:L.DYNAMIC,typeof t.type==typeof L.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=L.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new o,this.quaternion=new p,this.initQuaternion=new p,this.previousQuaternion=new p,this.interpolatedQuaternion=new p,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new o,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new o,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new o,this.invInertia=new o,this.invInertiaWorld=new r,this.invMassSolve=0,this.invInertiaSolve=new o,this.invInertiaWorldSolve=new r,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new o(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new o(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new l,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new o,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=L.AWAKE,this.wakeUpAfterNarrowphase=!1,t===L.SLEEPING&&this.dispatchEvent(L.wakeupEvent)}sleep(){this.sleepState=L.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(t){if(this.allowSleep){const e=this.sleepState,n=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=this.sleepSpeedLimit**2;e===L.AWAKE&&nr?this.wakeUp():e===L.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(L.sleepEvent))}}updateSolveMassProperties(){this.sleepState===L.SLEEPING||this.type===L.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(t,e){return void 0===e&&(e=new o),t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e){return void 0===e&&(e=new o),this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e}addShape(t,e,n){const r=new o,i=new p;return e&&r.copy(e),n&&i.copy(n),this.shapes.push(t),this.shapeOffsets.push(r),this.shapeOrientations.push(i),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this}removeShape(t){const e=this.shapes.indexOf(t);return-1===e?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(e,1),this.shapeOffsets.splice(e,1),this.shapeOrientations.splice(e,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=null,this)}updateBoundingRadius(){const t=this.shapes,e=this.shapeOffsets,n=t.length;let r=0;for(let i=0;i!==n;i++){const n=t[i];n.updateBoundingSphereRadius();const o=e[i].length(),a=n.boundingSphereRadius;o+a>r&&(r=o+a)}this.boundingRadius=r}updateAABB(){const t=this.shapes,e=this.shapeOffsets,n=this.shapeOrientations,r=t.length,i=R,o=D,a=this.quaternion,s=this.aabb,u=z;for(let l=0;l!==r;l++){const r=t[l];a.vmult(e[l],i),i.vadd(this.position,i),a.mult(n[l],o),r.calculateWorldAABB(i,o,u.lowerBound,u.upperBound),0===l?s.copy(u):s.extend(u)}this.aabbNeedsUpdate=!1}updateInertiaWorld(t){const e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){const t=F,n=B;t.setRotationFromQuaternion(this.quaternion),t.transpose(n),t.scale(e,t),t.mmult(n,this.invInertiaWorld)}else;}applyForce(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;this.sleepState===L.SLEEPING&&this.wakeUp();const n=U;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}applyLocalForce(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;const n=j,r=V;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,r),this.applyForce(n,r)}applyTorque(t){this.type===L.DYNAMIC&&(this.sleepState===L.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;this.sleepState===L.SLEEPING&&this.wakeUp();const n=e,r=H;r.copy(t),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const i=G;n.cross(t,i),this.invInertiaWorld.vmult(i,i),this.angularVelocity.vadd(i,this.angularVelocity)}applyLocalImpulse(t,e){if(void 0===e&&(e=new o),this.type!==L.DYNAMIC)return;const n=W,r=X;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,r),this.applyImpulse(n,r)}updateMassProperties(){const t=Y;this.invMass=this.mass>0?1/this.mass:0;const e=this.inertia,n=this.fixedRotation;this.updateAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),M.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!n?1/e.x:0,e.y>0&&!n?1/e.y:0,e.z>0&&!n?1/e.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(t,e){const n=new o;return t.vsub(this.position,n),this.angularVelocity.cross(n,e),this.velocity.vadd(e,e),e}integrate(t,e,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==L.DYNAMIC&&this.type!==L.KINEMATIC||this.sleepState===L.SLEEPING)return;const r=this.velocity,i=this.angularVelocity,o=this.position,a=this.force,s=this.torque,u=this.quaternion,l=this.invMass,c=this.invInertiaWorld,h=this.linearFactor,d=l*t;r.x+=a.x*d*h.x,r.y+=a.y*d*h.y,r.z+=a.z*d*h.z;const f=c.elements,p=this.angularFactor,m=s.x*p.x,g=s.y*p.y,v=s.z*p.z;i.x+=t*(f[0]*m+f[1]*g+f[2]*v),i.y+=t*(f[3]*m+f[4]*g+f[5]*v),i.z+=t*(f[6]*m+f[7]*g+f[8]*v),o.x+=r.x*t,o.y+=r.y*t,o.z+=r.z*t,u.integrate(this.angularVelocity,t,this.angularFactor,u),e&&(n?u.normalizeFast():u.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}L.idCounter=0,L.COLLIDE_EVENT_NAME="collide",L.DYNAMIC=T,L.STATIC=k,L.KINEMATIC=I,L.AWAKE=N,L.SLEEPY=P,L.SLEEPING=O,L.wakeupEvent={type:"wakeup"},L.sleepyEvent={type:"sleepy"},L.sleepEvent={type:"sleep"};const R=new o,D=new p,z=new l,F=new r,B=new r,U=(new r,new o),j=new o,V=new o,H=new o,G=new o,W=new o,X=new o,Y=new o;class q{constructor(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(t,e,n){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(t,e){return!!(t.collisionFilterGroup&e.collisionFilterMask&&e.collisionFilterGroup&t.collisionFilterMask)&&(!(t.type&L.STATIC||t.sleepState===L.SLEEPING)||!(e.type&L.STATIC||e.sleepState===L.SLEEPING))}intersectionTest(t,e,n,r){this.useBoundingBoxes?this.doBoundingBoxBroadphase(t,e,n,r):this.doBoundingSphereBroadphase(t,e,n,r)}doBoundingSphereBroadphase(t,e,n,r){const i=$;e.position.vsub(t.position,i);const o=(t.boundingRadius+e.boundingRadius)**2;i.lengthSquared()n.lengthSquared()}aabbQuery(t,e,n){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}}const $=new o;new o,new p,new o;const K={keys:[]},Z=[],Q=[];new o;new o;new o;class J extends q{constructor(){super()}collisionPairs(t,e,n){const r=t.bodies,i=r.length;let o,a;for(let t=0;t!==i;t++)for(let i=0;i!==t;i++)o=r[t],a=r[i],this.needBroadphaseCollision(o,a)&&this.intersectionTest(o,a,e,n)}aabbQuery(t,e,n){void 0===n&&(n=[]);for(let r=0;r{}}intersectWorld(t,e){return this.mode=e.mode||ht.ANY,this.result=e.result||new tt,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===e.checkCollisionResponse||e.checkCollisionResponse,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(dt),ft.length=0,t.broadphase.aabbQuery(t,dt,ft),this.intersectBodies(ft),this.hasHit}intersectBody(t,e){e&&(this.result=e,this.updateDirection());const n=this.checkCollisionResponse;if(n&&!t.collisionResponse)return;if(!(this.collisionFilterGroup&t.collisionFilterMask&&t.collisionFilterGroup&this.collisionFilterMask))return;const r=gt,i=vt;for(let e=0,o=t.shapes.length;et.boundingSphereRadius)return;const o=this[t.type];o&&o.call(this,t,e,n,r,t)}_intersectBox(t,e,n,r,i){return this._intersectConvex(t.convexPolyhedronRepresentation,e,n,r,i)}_intersectPlane(t,e,n,r,i){const a=this.from,s=this.to,u=this.direction,l=new o(0,0,1);e.vmult(l,l);const c=new o;a.vsub(n,c);const h=c.dot(l);s.vsub(n,c);if(h*c.dot(l)>0)return;if(a.distanceTo(s)=0&&t<=1&&(o.lerp(a,t,h),h.vsub(n,d),d.normalize(),this.reportIntersection(d,h,i,r,-1)),this.result.shouldStop)return;e>=0&&e<=1&&(o.lerp(a,e,h),h.vsub(n,d),d.normalize(),this.reportIntersection(d,h,i,r,-1))}}_intersectConvex(t,e,n,r,i,o){const a=Tt,s=kt,u=o&&o.faceList||null,l=t.faces,c=t.vertices,h=t.faceNormals,d=this.direction,f=this.from,p=this.to,m=f.distanceTo(p),g=u?u.length:l.length,v=this.result;for(let t=0;!v.shouldStop&&tm||this.reportIntersection(a,yt,i,r,o)}}}}_intersectTrimesh(t,e,n,r,i,o){const a=It,s=Dt,u=zt,l=kt,c=Nt,h=Pt,d=Ot,f=Rt,p=Lt,m=t.indices;t.vertices;const g=this.from,v=this.to,b=this.direction;u.position.copy(n),u.quaternion.copy(e),y.vectorToLocalFrame(n,e,b,c),y.pointToLocalFrame(n,e,g,h),y.pointToLocalFrame(n,e,v,d),d.x*=t.scale.x,d.y*=t.scale.y,d.z*=t.scale.z,h.x*=t.scale.x,h.y*=t.scale.y,h.z*=t.scale.z,d.vsub(h,c),c.normalize();const x=h.distanceSquared(d);t.tree.rayQuery(this,u,s);for(let o=0,u=s.length;!this.result.shouldStop&&o!==u;o++){const u=s[o];t.getNormal(u,a),t.getVertex(m[3*u],bt),bt.vsub(h,l);const d=c.dot(a),g=a.dot(l)/d;if(g<0)continue;c.scale(g,yt),yt.vadd(h,yt),t.getVertex(m[3*u+1],xt),t.getVertex(m[3*u+2],wt);const v=yt.distanceSquared(h);!ht.pointInTriangle(yt,xt,bt,wt)&&!ht.pointInTriangle(yt,bt,xt,wt)||v>x||(y.vectorToWorldFrame(e,a,p),y.pointToWorldFrame(n,e,yt,f),this.reportIntersection(p,f,i,r,u))}s.length=0}reportIntersection(t,e,n,r,i){const o=this.from,a=this.to,s=o.distanceTo(e),u=this.result;if(!(this.skipBackfaces&&t.dot(this.direction)>0))switch(u.hitFaceIndex=void 0!==i?i:-1,this.mode){case ht.ALL:this.hasHit=!0,u.set(o,a,t,e,n,r,s),u.hasHit=!0,this.callback(u);break;case ht.CLOSEST:(s=0&&(c=i*u-o*a)>=0&&l+ce.maxForce&&(d=e.maxForce-m),y[t]+=d,f+=d>0?d:-d,e.addToWlambda(d)}if(f*ft;)e.pop();for(;e.length=0&&l.restitution>=0&&(a.restitution=u.restitution*l.restitution),a.si=i||n,a.sj=o||r,a}createFrictionEquationsFromContact(t,e){const n=t.bi,r=t.bj,i=t.si,o=t.sj,a=this.world,s=this.currentContactMaterial;let u=s.friction;const l=i.material||n.material,c=o.material||r.material;if(l&&c&&l.friction>=0&&c.friction>=0&&(u=l.friction*c.friction),u>0){const i=u*(a.frictionGravity||a.gravity).length();let o=n.invMass+r.invMass;o>0&&(o=1/o);const l=this.frictionEquationPool,c=l.length?l.pop():new oe(n,r,i*o),h=l.length?l.pop():new oe(n,r,i*o);return c.bi=h.bi=n,c.bj=h.bj=r,c.minForce=h.minForce=-i*o,c.maxForce=h.maxForce=i*o,c.ri.copy(t.ri),c.rj.copy(t.rj),h.ri.copy(t.ri),h.rj.copy(t.rj),t.ni.tangents(c.t,h.t),c.setSpookParams(s.frictionEquationStiffness,s.frictionEquationRelaxation,a.dt),h.setSpookParams(s.frictionEquationStiffness,s.frictionEquationRelaxation,a.dt),c.enabled=h.enabled=t.enabled,e.push(c,h),!0}return!1}createFrictionFromAverage(t){let e=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(e,this.frictionResult)||1===t)return;const n=this.frictionResult[this.frictionResult.length-2],r=this.frictionResult[this.frictionResult.length-1];We.setZero(),Xe.setZero(),Ye.setZero();const i=e.bi;e.bj;for(let n=0;n!==t;n++)e=this.result[this.result.length-1-n],e.bi!==i?(We.vadd(e.ni,We),Xe.vadd(e.ri,Xe),Ye.vadd(e.rj,Ye)):(We.vsub(e.ni,We),Xe.vadd(e.rj,Xe),Ye.vadd(e.ri,Ye));const o=1/t;Xe.scale(o,n.ri),Ye.scale(o,n.rj),r.ri.copy(n.ri),r.rj.copy(n.rj),We.normalize(),We.tangents(n.t,r.t)}getContacts(t,e,n,r,i,o,a){this.contactPointPool=i,this.frictionEquationPool=a,this.result=r,this.frictionResult=o;const s=Ke,u=Ze,l=qe,c=$e;for(let r=0,i=t.length;r!==i;r++){const i=t[r],o=e[r];let a=null;i.material&&o.material&&(a=n.getContactMaterial(i.material,o.material)||null);const h=i.type&L.KINEMATIC&&o.type&L.STATIC||i.type&L.STATIC&&o.type&L.KINEMATIC||i.type&L.KINEMATIC&&o.type&L.KINEMATIC;for(let t=0;te.boundingSphereRadius+r.boundingSphereRadius)continue;let d=null;e.material&&r.material&&(d=n.getContactMaterial(e.material,r.material)||null),this.currentContactMaterial=d||a||n.defaultContactMaterial;const f=this[e.type|r.type];if(f){let t=!1;t=e.type0){const i=Mn,o=An;i.copy(d[(t+1)%3]),o.copy(d[(t+2)%3]);const a=i.length(),s=o.length();i.normalize(),o.normalize();const u=Sn.dot(i),l=Sn.dot(o);if(u-a&&l-s){const t=Math.abs(r-n-f);if((null===_||t<_)&&(_=t,x=u,w=l,y=n,m.copy(e),g.copy(i),v.copy(o),b++,c))return!0}}}if(b){p=!0;const i=this.createContactEquation(a,s,t,e,u,l);m.scale(-f,i.ri),i.ni.copy(m),i.ni.negate(i.ni),m.scale(y,m),g.scale(x,g),m.vadd(g,m),v.scale(w,v),m.vadd(v,i.rj),i.ri.vadd(n,i.ri),i.ri.vsub(a.position,i.ri),i.rj.vadd(r,i.rj),i.rj.vsub(s.position,i.rj),this.result.push(i),this.createFrictionEquationsFromContact(i,this.frictionResult)}let S=h.get();const E=Tn;for(let i=0;2!==i&&!p;i++)for(let o=0;2!==o&&!p;o++)for(let h=0;2!==h&&!p;h++)if(S.set(0,0,0),i?S.vadd(d[0],S):S.vsub(d[0],S),o?S.vadd(d[1],S):S.vsub(d[1],S),h?S.vadd(d[2],S):S.vsub(d[2],S),r.vadd(S,E),E.vsub(n,E),E.lengthSquared()t.boundingSphereRadius+e.boundingSphereRadius)&&t.findSeparatingAxis(e,n,i,r,o,f,h,d)){const h=[],d=Yn;t.clipAgainstHull(n,i,e,r,o,f,-100,100,h);let p=0;for(let i=0;i!==h.length;i++){if(c)return!0;const o=this.createContactEquation(a,s,t,e,u,l),m=o.ri,g=o.rj;f.negate(o.ni),h[i].normal.negate(d),d.scale(h[i].depth,d),h[i].point.vadd(d,m),g.copy(h[i].point),m.vsub(n,m),g.vsub(r,g),m.vadd(n,m),m.vsub(a.position,m),g.vadd(r,g),g.vsub(s.position,g),this.result.push(o),p++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(o,this.frictionResult)}this.enableFrictionReduction&&p&&this.createFrictionFromAverage(p)}}sphereConvex(t,e,n,r,i,o,a,s,u,l,c){const h=this.v3pool;n.vsub(r,Pn);const d=e.faceNormals,f=e.faces,p=e.vertices,m=t.radius;let g=!1;for(let i=0;i!==p.length;i++){const h=p[i],d=Dn;o.vmult(h,d),r.vadd(d,d);const f=Rn;if(d.vsub(n,f),f.lengthSquared()0){const i=[];for(let t=0,e=y.length;t!==e;t++){const e=h.get();o.vmult(p[y[t]],e),r.vadd(e,e),i.push(e)}if(_n(i,b,n)){if(c)return!0;g=!0;const o=this.createContactEquation(a,s,t,e,u,l);b.scale(-m,o.ri),b.negate(o.ni);const d=h.get();b.scale(-S,d);const f=h.get();b.scale(-m,f),n.vsub(r,o.rj),o.rj.vadd(f,o.rj),o.rj.vadd(d,o.rj),o.rj.vadd(r,o.rj),o.rj.vsub(s.position,o.rj),o.ri.vadd(n,o.ri),o.ri.vsub(a.position,o.ri),h.release(d),h.release(f),this.result.push(o),this.createFrictionEquationsFromContact(o,this.frictionResult);for(let t=0,e=i.length;t!==e;t++)h.release(i[t]);return}for(let d=0;d!==y.length;d++){const f=h.get(),g=h.get();o.vmult(p[y[(d+1)%y.length]],f),o.vmult(p[y[(d+2)%y.length]],g),r.vadd(f,f),r.vadd(g,g);const v=On;g.vsub(f,v);const b=Ln;v.unit(b);const x=h.get(),w=h.get();n.vsub(f,w);const _=w.dot(b);b.scale(_,x),x.vadd(f,x);const S=h.get();if(x.vsub(n,S),_>0&&_*_h.length||b>h[0].length)return;g<0&&(g=0),v<0&&(v=0),b<0&&(b=0),x<0&&(x=0),g>=h.length&&(g=h.length-1),v>=h.length&&(v=h.length-1),x>=h[0].length&&(x=h[0].length-1),b>=h[0].length&&(b=h[0].length-1);const w=[];e.getRectMinMax(g,b,v,x,w);const _=w[0],S=w[1];if(m.z-d>S||m.z+d<_)return;const E=this.result;for(let u=g;u2)return}}boxHeightfield(t,e,n,r,i,o,a,s,u,l,c){return t.convexPolyhedronRepresentation.material=t.material,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,this.convexHeightfield(t.convexPolyhedronRepresentation,e,n,r,i,o,a,s,t,e,c)}convexHeightfield(t,e,n,r,i,o,a,s,u,l,c){const h=e.data,d=e.elementSize,f=t.boundingSphereRadius,p=ir,m=or,g=rr;y.pointToLocalFrame(r,o,n,g);let v=Math.floor((g.x-f)/d)-1,b=Math.ceil((g.x+f)/d)+1,x=Math.floor((g.y-f)/d)-1,w=Math.ceil((g.y+f)/d)+1;if(b<0||w<0||v>h.length||x>h[0].length)return;v<0&&(v=0),b<0&&(b=0),x<0&&(x=0),w<0&&(w=0),v>=h.length&&(v=h.length-1),b>=h.length&&(b=h.length-1),w>=h[0].length&&(w=h[0].length-1),x>=h[0].length&&(x=h[0].length-1);const _=[];e.getRectMinMax(v,x,b,w,_);const S=_[0],E=_[1];if(!(g.z-f>E||g.z+f0&&b<0){m.vsub(h,g),p.copy(f),p.normalize(),x=g.dot(p),p.scale(x,g),g.vadd(h,g);if(g.distanceTo(m)0&&!0===r||c<=0&&!1===r))return!1;null===r&&(r=c>0)}return!0}const Sn=new o,En=new o,Mn=new o,An=new o,Cn=[new o,new o,new o,new o,new o,new o],Tn=new o,kn=new o,In=new o,Nn=new o,Pn=new o,On=new o,Ln=new o,Rn=new o,Dn=new o,zn=new o,Fn=new o,Bn=new o,Un=new o,jn=new o;new o,new o;const Vn=new o,Hn=new o,Gn=new o,Wn=new o,Xn=new o,Yn=new o,qn=new o,$n=new o,Kn=new o,Zn=new o,Qn=new p,Jn=new o;new o;const tr=new o,er=new o,nr=new o,rr=new o,ir=new o,or=[0],ar=new o,sr=new o;class ur{constructor(){this.current=[],this.previous=[]}getKey(t,e){if(er[i];)i++;if(n!==r[i]){for(let t=r.length-1;t>=i;t--)r[t+1]=r[t];r[i]=n}}tick(){const t=this.current;this.current=this.previous,this.previous=t,this.current.length=0}getDiff(t,e){const n=this.current,r=this.previous,i=n.length,o=r.length;let a=0;for(let e=0;er[a];)a++;i=o===r[a],i||lr(t,o)}a=0;for(let t=0;tn[a];)a++;i=n[a]===o,i||lr(e,o)}}}function lr(t,e){t.push((4294901760&e)>>16,65535&e)}const cr=(t,e)=>t0;){delete t[e.pop()]}}}class dr extends f{constructor(t){void 0===t&&(t={}),super(),this.dt=-1,this.allowSleep=!!t.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=void 0!==t.quatNormalizeSkip?t.quatNormalizeSkip:0,this.quatNormalizeFast=void 0!==t.quatNormalizeFast&&t.quatNormalizeFast,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new o,t.gravity&&this.gravity.copy(t.gravity),t.frictionGravity&&(this.frictionGravity=new o,this.frictionGravity.copy(t.frictionGravity)),this.broadphase=void 0!==t.broadphase?t.broadphase:new J,this.bodies=[],this.hasActiveBodies=!1,this.solver=void 0!==t.solver?t.solver:new fe,this.constraints=[],this.narrowphase=new Ge(this),this.collisionMatrix=new d,this.collisionMatrixPrevious=new d,this.bodyOverlapKeeper=new ur,this.shapeOverlapKeeper=new ur,this.contactmaterials=[],this.contactMaterialTable=new hr,this.defaultMaterial=new le("default"),this.defaultContactMaterial=new ue(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(t,e){return this.contactMaterialTable.get(t.id,e.id)}collisionMatrixTick(){const t=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=t,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(t){this.constraints.push(t)}removeConstraint(t){const e=this.constraints.indexOf(t);-1!==e&&this.constraints.splice(e,1)}rayTest(t,e,n){n instanceof tt?this.raycastClosest(t,e,{skipBackfaces:!0},n):this.raycastAll(t,e,{skipBackfaces:!0},n)}raycastAll(t,e,n,r){return void 0===n&&(n={}),n.mode=ht.ALL,n.from=t,n.to=e,n.callback=r,fr.intersectWorld(this,n)}raycastAny(t,e,n,r){return void 0===n&&(n={}),n.mode=ht.ANY,n.from=t,n.to=e,n.result=r,fr.intersectWorld(this,n)}raycastClosest(t,e,n,r){return void 0===n&&(n={}),n.mode=ht.CLOSEST,n.from=t,n.to=e,n.result=r,fr.intersectWorld(this,n)}addBody(t){this.bodies.includes(t)||(t.index=this.bodies.length,this.bodies.push(t),t.world=this,t.initPosition.copy(t.position),t.initVelocity.copy(t.velocity),t.timeLastSleepy=this.time,t instanceof L&&(t.initAngularVelocity.copy(t.angularVelocity),t.initQuaternion.copy(t.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=t,this.idToBodyMap[t.id]=t,this.dispatchEvent(this.addBodyEvent))}removeBody(t){t.world=null;const e=this.bodies.length-1,n=this.bodies,r=n.indexOf(t);if(-1!==r){n.splice(r,1);for(let t=0;t!==n.length;t++)n[t].index=t;this.collisionMatrix.setNumObjects(e),this.removeBodyEvent.body=t,delete this.idToBodyMap[t.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(t){return this.idToBodyMap[t]}getShapeById(t){const e=this.bodies;for(let n=0;n=t&&i1e3*t)););this.accumulator=this.accumulator%t;const o=this.accumulator/t;for(let t=0;t!==this.bodies.length;t++){const e=this.bodies[t];e.previousPosition.lerp(e.position,o,e.interpolatedPosition),e.previousQuaternion.slerp(e.quaternion,o,e.interpolatedQuaternion),e.previousQuaternion.normalize()}this.time+=e}}internalStep(t){this.dt=t;const e=this.contacts,n=xr,r=wr,i=this.bodies.length,o=this.bodies,a=this.solver,s=this.gravity,u=this.doProfiling,l=this.profile,c=L.DYNAMIC;let h=-1/0;const d=this.constraints,f=br;s.length();const p=s.x,m=s.y,g=s.z;let v=0;for(u&&(h=pr.now()),v=0;v!==i;v++){const t=o[v];if(t.type===c){const e=t.force,n=t.mass;e.x+=n*p,e.y+=n*m,e.z+=n*g}}for(let t=0,e=this.subsystems.length;t!==e;t++)this.subsystems[t].update();u&&(h=pr.now()),n.length=0,r.length=0,this.broadphase.collisionPairs(this,n,r),u&&(l.broadphase=pr.now()-h);let y=d.length;for(v=0;v!==y;v++){const t=d[v];if(!t.collideConnected)for(let e=n.length-1;e>=0;e-=1)(t.bodyA===n[e]&&t.bodyB===r[e]||t.bodyB===n[e]&&t.bodyA===r[e])&&(n.splice(e,1),r.splice(e,1))}this.collisionMatrixTick(),u&&(h=pr.now());const b=yr,x=e.length;for(v=0;v!==x;v++)b.push(e[v]);e.length=0;const w=this.frictionEquations.length;for(v=0;v!==w;v++)f.push(this.frictionEquations[v]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(n,r,this,e,b,this.frictionEquations,f),u&&(l.narrowphase=pr.now()-h),u&&(h=pr.now()),v=0;v=0&&i.material.friction>=0&&(r.material.friction,i.material.friction),r.material.restitution>=0&&i.material.restitution>=0&&(n.restitution=r.material.restitution*i.material.restitution)),a.addEquation(n),r.allowSleep&&r.type===L.DYNAMIC&&r.sleepState===L.SLEEPING&&i.sleepState===L.AWAKE&&i.type!==L.STATIC){i.velocity.lengthSquared()+i.angularVelocity.lengthSquared()>=2*i.sleepSpeedLimit**2&&(r.wakeUpAfterNarrowphase=!0)}if(i.allowSleep&&i.type===L.DYNAMIC&&i.sleepState===L.SLEEPING&&r.sleepState===L.AWAKE&&r.type!==L.STATIC){r.velocity.lengthSquared()+r.angularVelocity.lengthSquared()>=2*r.sleepSpeedLimit**2&&(i.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(r,i,!0),this.collisionMatrixPrevious.get(r,i)||(vr.body=i,vr.contact=n,r.dispatchEvent(vr),vr.body=r,i.dispatchEvent(vr)),this.bodyOverlapKeeper.set(r.id,i.id),this.shapeOverlapKeeper.set(o.id,s.id)}for(this.emitContactEvents(),u&&(l.makeContactConstraints=pr.now()-h,h=pr.now()),v=0;v!==i;v++){const t=o[v];t.wakeUpAfterNarrowphase&&(t.wakeUp(),t.wakeUpAfterNarrowphase=!1)}for(y=d.length,v=0;v!==y;v++){const t=d[v];t.update();for(let e=0,n=t.equations.length;e!==n;e++){const n=t.equations[e];a.addEquation(n)}}a.solve(t,this),u&&(l.solve=pr.now()-h),a.removeAllEquations();const S=Math.pow;for(v=0;v!==i;v++){const e=o[v];if(e.type&c){const n=S(1-e.linearDamping,t),r=e.velocity;r.scale(n,r);const i=e.angularVelocity;if(i){const n=S(1-e.angularDamping,t);i.scale(n,i)}}}this.dispatchEvent(gr),u&&(h=pr.now());const E=this.stepnumber%(this.quatNormalizeSkip+1)==0,M=this.quatNormalizeFast;for(v=0;v!==i;v++)o[v].integrate(t,E,M);this.clearForces(),this.broadphase.dirty=!0,u&&(l.integrate=pr.now()-h),this.stepnumber+=1,this.dispatchEvent(mr);let A=!0;if(this.allowSleep)for(A=!1,v=0;v!==i;v++){const t=o[v];t.sleepTick(this.time),t.sleepState!==L.SLEEPING&&(A=!0)}this.hasActiveBodies=A}emitContactEvents(){const t=this.hasAnyEventListener("beginContact"),e=this.hasAnyEventListener("endContact");if((t||e)&&this.bodyOverlapKeeper.getDiff(_r,Sr),t){for(let t=0,e=_r.length;tDate.now()-t}new o;const mr={type:"postStep"},gr={type:"preStep"},vr={type:L.COLLIDE_EVENT_NAME,body:null,contact:null},yr=[],br=[],xr=[],wr=[],_r=[],Sr=[],Er={type:"beginContact",bodyA:null,bodyB:null},Mr={type:"endContact",bodyA:null,bodyB:null},Ar={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},Cr={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null}},15659:(t,e,n)=>{var r=n(51031),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,l=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:l})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),u=s-a;return s===a?e=0:r===s?e=(i-o)/u:i===s?e=2+(o-r)/u:o===s&&(e=4+(r-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?u/(s+a):u/(2-s-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,l=Math.max(a,s,u),c=l-Math.min(a,s,u),h=function(t){return(l-t)/6/c+.5};return 0===c?i=o=0:(o=c/l,e=h(a),n=h(s),r=h(u),a===l?i=r-n:s===l?i=1/3+e-r:u===l&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*l]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var l=r[u],c=(o=t,a=l,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));c.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var l=0;l<3;l++)(r=a+1/3*-(l-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[l]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,s,u=t[0]/360,l=t[1]/100,c=t[2]/100,h=l+c;switch(h>1&&(l/=h,c/=h),r=6*u-(e=Math.floor(6*u)),1&e&&(r=1-r),i=l+r*((n=1-c)-l),e){default:case 6:case 0:o=n,a=i,s=l;break;case 1:o=i,a=n,s=l;break;case 2:o=l,a=n,s=i;break;case 3:o=l,a=i,s=n;break;case 4:o=i,a=l,s=n;break;case 5:o=n,a=l,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},10734:(t,e,n)=>{var r=n(15659),i=n(8507),o={};Object.keys(r).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:r[t].channels}),Object.defineProperty(o[t],"labels",{value:r[t].labels});var e=i(t);Object.keys(e).forEach((function(n){var r=e[n];o[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var r=n.length,i=0;i1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=o},51031:t=>{"use strict";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]}},8507:(t,e,n)=>{var r=n(15659);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i{"use strict";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]}},28854:(t,e,n)=>{var r=n(8156),i=n(19872),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)]}},2520:(t,e,n)=>{"use strict";var r=n(28854),i=n(10734),o=[].slice,a=["keyword","gray","hex"],s={};Object.keys(i).forEach((function(t){s[o.call(i[t].labels).sort().join("")]=t}));var u={};function l(t,e){if(!(this instanceof l))return new l(t,e);if(e&&e in a&&(e=null),e&&!(e in i))throw new Error("Unknown model: "+e);var n,c;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof l)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var h=r.get(t);if(null===h)throw new Error("Unable to parse color from string: "+t);this.model=h.model,c=i[this.model].channels,this.color=h.value.slice(0,c),this.valpha="number"==typeof h.value[c]?h.value[c]:1}else if(t.length){this.model=e||"rgb",c=i[this.model].channels;var f=o.call(t,0,c);this.color=d(f,c),this.valpha="number"==typeof t[c]?t[c]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var p=Object.keys(t);"alpha"in t&&(p.splice(p.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var m=p.sort().join("");if(!(m in s))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=s[m];var g=i[this.model].labels,v=[];for(n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return l.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var n=t.rgb(),r=this.rgb(),i=void 0===e?.5:e,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,u=1-s;return l.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue(),n.alpha()*i+r.alpha()*(1-i))}},Object.keys(i).forEach((function(t){if(-1===a.indexOf(t)){var e=i[t].channels;l.prototype[t]=function(){if(this.model===t)return new l(this);if(arguments.length)return new l(arguments,t);var n,r="number"==typeof arguments[e]?e:this.valpha;return new l((n=i[this.model][t].raw(this.color),Array.isArray(n)?n:[n]).concat(r),t)},l[t]=function(n){return"number"==typeof n&&(n=d(o.call(arguments),e)),new l(n,t)}}})),t.exports=l},99877:(t,e,n)=>{"use strict";function r(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;ir,forceCollide:()=>l,forceLink:()=>d,forceManyBody:()=>W,forceRadial:()=>X,forceSimulation:()=>G,forceX:()=>Y,forceY:()=>q});var i=n(2847);function o(t){return function(){return t}}function a(t){return 1e-6*(t()-.5)}function s(t){return t.x+t.vx}function u(t){return t.y+t.vy}function l(t){var e,n,r,l=1,c=1;function h(){for(var t,o,h,f,p,m,g,v=e.length,y=0;yf+c||ip+c||oh.index){var d=f-s.x-s.vx,v=p-s.y-s.vy,y=d*d+v*v;yt.r&&(t.r=t[e].r)}function f(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[l(t,e,r),t])));for(o=0,i=new Array(u);o{}};function p(){for(var t,e=0,n=arguments.length,r={};e=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(;++a0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(null,t),e=e._next;--w}()}finally{w=0,function(){var t,e,n=b,r=1/0;for(;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:b=e);x=t,D(r)}(),A=0}}function R(){var t=T.now(),e=t-M;e>E&&(C-=e,M=t)}function D(t){w||(_&&(_=clearTimeout(_)),t-A>24?(t<1/0&&(_=setTimeout(L,t-T.now()-C)),S&&(S=clearInterval(S))):(S||(M=T.now(),S=setInterval(R,E)),w=1,k(L)))}P.prototype=O.prototype={constructor:P,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?I():+n)+(null==e?0:+e),this._next||x===this||(x?x._next=this:b=this,x=this),this._call=t,this._time=n,D()},stop:function(){this._call&&(this._call=null,this._time=1/0,D())}};const z=1664525,F=1013904223,B=4294967296;function U(t){return t.x}function j(t){return t.y}var V=10,H=Math.PI*(3-Math.sqrt(5));function G(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=O(h),l=y("tick","end"),c=function(){let t=1;return()=>(t=(z*t+F)%B)/B}();function h(){d(),l.call("tick",e),n1?(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;l1?(l.on(t,n),e):l.on(t)}}}function W(){var t,e,n,r,s,u=o(-30),l=1,c=1/0,h=.81;function d(n){var o,a=t.length,s=(0,i.A)(t,U,j).visitAfter(p);for(r=n,o=0;o=c)){(t.data!==e||t.next)&&(0===d&&(m+=(d=a(n))*d),0===f&&(m+=(f=a(n))*f),m{"use strict";n.r(e),n.d(e,{quadtree:()=>r.A});var r=n(2847)},2847:(t,e,n)=>{"use strict";function r(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,h,d,f=t._root,p={data:r},m=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((l=e>=(o=(m+v)/2))?m=o:v=o,(c=n>=(a=(g+y)/2))?g=a:y=a,i=f,!(f=f[h=c<<1|l]))return i[h]=p,t;if(s=+t._x.call(null,f.data),u=+t._y.call(null,f.data),e===s&&n===u)return p.next=f,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(l=e>=(o=(m+v)/2))?m=o:v=o,(c=n>=(a=(g+y)/2))?g=a:y=a}while((h=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=f,i[h]=p,t}function i(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function o(t){return t[0]}function a(t){return t[1]}function s(t,e,n){var r=new u(null==e?o:e,null==n?a:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function u(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 l(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}n.d(e,{A:()=>s});var c=s.prototype=u.prototype;c.copy=function(){var t,e,n=new u(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=l(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]=l(e));return n},c.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return r(this.cover(e,n),e,n,t)},c.addAll=function(t){var e,n,i,o,a=t.length,s=new Array(a),u=new Array(a),l=1/0,c=1/0,h=-1/0,d=-1/0;for(n=0;nh&&(h=i),od&&(d=o));if(l>h||c>d)return this;for(this.cover(l,c).cover(h,d),n=0;nt||t>=i||r>e||e>=o;)switch(s=(ef||(a=l.y0)>p||(s=l.x1)=y)<<1|t>=v)&&(l=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=l)}else{var b=t-+this._x.call(null,g.data),x=e-+this._y.call(null,g.data),w=b*b+x*x;if(w=(s=(p+g)/2))?p=s:g=s,(c=a>=(u=(m+v)/2))?m=u:v=u,e=f,!(f=f[h=c<<1|l]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,d=h)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=i,this)},c.removeAll=function(t){for(var e=0,n=t.length;e{"use strict";n.r(e),n.d(e,{BRIDGE_GRAPH_NAME:()=>s,GraphType:()=>c,HierarchyNodeType:()=>h,InclusionType:()=>l,LAYOUT_CONFIG:()=>r,NodeType:()=>u,ROOT_NAME:()=>a,buildGraph:()=>da,flatGraph:()=>fa,getEdges:()=>pa,mergeConfig:()=>i});const r={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function i(t={},e=r){var n,i,o,a;const s=JSON.parse(JSON.stringify(e)),u=(null===(n=null==t?void 0:t.graph)||void 0===n?void 0:n.meta)||{},l=(null===(i=null==t?void 0:t.subScene)||void 0===i?void 0:i.meta)||{},c=(null===(o=null==t?void 0:t.nodeSize)||void 0===o?void 0:o.meta)||{},h=(null===(a=null==t?void 0:t.nodeSize)||void 0===a?void 0:a.node)||{},d=s.nodeSize.bridge;return{graph:{meta:Object.assign(s.graph.meta,u)},subScene:{meta:Object.assign(s.subScene.meta,l)},nodeSize:{meta:Object.assign(s.nodeSize.meta,c),node:Object.assign(s.nodeSize.node,h),bridge:d}}}function o(t){return`◬${t}◬`}const a=o("ROOT"),s=o("BRIDGE_GRAPH");var u,l,c,h;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(u||(u={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(l||(l={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(c||(c={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(h||(h={}));var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function f(t,e){return t(e={exports:{}},e.exports),e.exports}var p=function(t,e){return t===e||t!=t&&e!=e},m=function(t,e){for(var n=t.length;n--;)if(p(t[n][0],e))return n;return-1},g=Array.prototype.splice;function v(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},v.prototype.set=function(t,e){var n=this.__data__,r=m(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var y,b=v,x="object"==typeof d&&d&&d.Object===Object&&d,w="object"==typeof self&&self&&self.Object===Object&&self,_=x||w||Function("return this")(),S=_.Symbol,E=Object.prototype,M=E.hasOwnProperty,A=E.toString,C=S?S.toStringTag:void 0,T=Object.prototype.toString,k=S?S.toStringTag:void 0,I=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":k&&k in Object(t)?function(t){var e=M.call(t,C),n=t[C];try{t[C]=void 0;var r=!0}catch(t){}var i=A.call(t);return r&&(e?t[C]=n:delete t[C]),i}(t):function(t){return T.call(t)}(t)},N=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},P=function(t){if(!N(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},O=_["__core-js_shared__"],L=(y=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",R=Function.prototype.toString,D=function(t){if(null!=t){try{return R.call(t)}catch(t){}try{return t+""}catch(t){}}return""},z=/^\[object .+?Constructor\]$/,F=Function.prototype,B=Object.prototype,U=F.toString,j=B.hasOwnProperty,V=RegExp("^"+U.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=function(t){return!(!N(t)||function(t){return!!L&&L in t}(t))&&(P(t)?V:z).test(D(t))},G=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return H(n)?n:void 0},W=G(_,"Map"),X=G(Object,"create"),Y=Object.prototype.hasOwnProperty,q=Object.prototype.hasOwnProperty;function $(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},xt={};xt["[object Float32Array]"]=xt["[object Float64Array]"]=xt["[object Int8Array]"]=xt["[object Int16Array]"]=xt["[object Int32Array]"]=xt["[object Uint8Array]"]=xt["[object Uint8ClampedArray]"]=xt["[object Uint16Array]"]=xt["[object Uint32Array]"]=!0,xt["[object Arguments]"]=xt["[object Array]"]=xt["[object ArrayBuffer]"]=xt["[object Boolean]"]=xt["[object DataView]"]=xt["[object Date]"]=xt["[object Error]"]=xt["[object Function]"]=xt["[object Map]"]=xt["[object Number]"]=xt["[object Object]"]=xt["[object RegExp]"]=xt["[object Set]"]=xt["[object String]"]=xt["[object WeakMap]"]=!1;var wt=function(t){return function(e){return t(e)}},_t=f((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,i=r&&r.exports===n&&x.process,o=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o})),St=_t&&_t.isTypedArray,Et=St?wt(St):function(t){return ut(t)&&bt(t.length)&&!!xt[I(t)]},Mt=Object.prototype.hasOwnProperty,At=function(t,e){var n=pt(t),r=!n&&ft(t),i=!n&&!r&>(t),o=!n&&!r&&!i&&Et(t),a=n||r||i||o,s=a?function(t,e){for(var n=-1,r=Array(t);++ns))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var h=-1,d=!0,f=2&n?new Re:void 0;for(o.set(t,e),o.set(e,t);++h0&&r(u)?n>1?t(u,n-1,r,i,o):Wt(o,u):i||(o[o.length]=u)}return o},$n=Math.max,Kn=function(t,e,n){return e=$n(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=$n(r.length-e,0),a=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Zn),tr=function(t,e){return Jn(Kn(t,e,ke),t+"")},er=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o-1},ir=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r=200){var l=e?null:or(t);if(l)return Ue(l);a=!1,i=ze,u=new Re}else u=e?[]:s;t:for(;++ro){var a=i;i=o,o=a}return i+""+o+""+(lr.isUndefined(r)?"\0":r)}function mr(t,e){return pr(t,e.v,e.w,e.name)}hr.prototype._nodeCount=0,hr.prototype._edgeCount=0,hr.prototype.isDirected=function(){return this._isDirected},hr.prototype.isMultigraph=function(){return this._isMultigraph},hr.prototype.isCompound=function(){return this._isCompound},hr.prototype.setGraph=function(t){return this._label=t,this},hr.prototype.graph=function(){return this._label},hr.prototype.setDefaultNodeLabel=function(t){return lr.isFunction(t)||(t=lr.constant(t)),this._defaultNodeLabelFn=t,this},hr.prototype.nodeCount=function(){return this._nodeCount},hr.prototype.nodes=function(){return lr.keys(this._nodes)},hr.prototype.sources=function(){var t=this;return lr.filter(this.nodes(),(function(e){return lr.isEmpty(t._in[e])}))},hr.prototype.sinks=function(){var t=this;return lr.filter(this.nodes(),(function(e){return lr.isEmpty(t._out[e])}))},hr.prototype.setNodes=function(t,e){var n=arguments,r=this;return lr.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},hr.prototype.setNode=function(t,e){return lr.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},hr.prototype.node=function(t){return this._nodes[t]},hr.prototype.hasNode=function(t){return lr.has(this._nodes,t)},hr.prototype.removeNode=function(t){var e=this;if(lr.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],lr.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),lr.each(lr.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],lr.each(lr.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},hr.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(lr.isUndefined(e))e="\0";else{for(var n=e+="";!lr.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},hr.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},hr.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},hr.prototype.children=function(t){if(lr.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return lr.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},hr.prototype.predecessors=function(t){var e=this._preds[t];if(e)return lr.keys(e)},hr.prototype.successors=function(t){var e=this._sucs[t];if(e)return lr.keys(e)},hr.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return lr.union(e,this.successors(t))},hr.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},hr.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;lr.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),lr.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var o=n.parent(t);return void 0===o||e.hasNode(o)?(r[t]=o,o):o in r?r[o]:i(o)}return this._isCompound&&lr.each(e.nodes(),(function(t){e.setParent(t,i(t))})),e},hr.prototype.setDefaultEdgeLabel=function(t){return lr.isFunction(t)||(t=lr.constant(t)),this._defaultEdgeLabelFn=t,this},hr.prototype.edgeCount=function(){return this._edgeCount},hr.prototype.edges=function(){return lr.values(this._edgeObjs)},hr.prototype.setPath=function(t,e){var n=this,r=arguments;return lr.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},hr.prototype.setEdge=function(){var t,e,n,r,i=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(t=o.v,e=o.w,n=o.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=o,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,lr.isUndefined(n)||(n=""+n);var a=pr(this._isDirected,t,e,n);if(lr.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=r),this;if(!lr.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?r:this._defaultEdgeLabelFn(t,e,n);var s=function(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,t,e,n);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,dr(this._preds[e],t),dr(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},hr.prototype.edge=function(t,e,n){var r=1===arguments.length?mr(this._isDirected,arguments[0]):pr(this._isDirected,t,e,n);return this._edgeLabels[r]},hr.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?mr(this._isDirected,arguments[0]):pr(this._isDirected,t,e,n);return lr.has(this._edgeLabels,r)},hr.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?mr(this._isDirected,arguments[0]):pr(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],fr(this._preds[e],t),fr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},hr.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=lr.values(n);return e?lr.filter(r,(function(t){return t.v===e})):r}},hr.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=lr.values(n);return e?lr.filter(r,(function(t){return t.w===e})):r}},hr.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var gr={Graph:cr,version:"2.1.8"},vr={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:yr(t),edges:br(t)};return lr.isUndefined(t.graph())||(e.value=lr.clone(t.graph())),e},read:function(t){var e=new cr(t.options).setGraph(t.value);return lr.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),lr.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function yr(t){return lr.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),i={v:e};return lr.isUndefined(n)||(i.value=n),lr.isUndefined(r)||(i.parent=r),i}))}function br(t){return lr.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return lr.isUndefined(e.name)||(r.name=e.name),lr.isUndefined(n)||(r.value=n),r}))}var xr=wr;function wr(){this._arr=[],this._keyIndices={}}wr.prototype.size=function(){return this._arr.length},wr.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},wr.prototype.has=function(t){return lr.has(this._keyIndices,t)},wr.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},wr.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},wr.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!lr.has(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1},wr.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},wr.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},wr.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1].priority0&&(i=s.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(u);return a}(t,String(e),n||Sr,r||function(e){return t.outEdges(e)})},Sr=lr.constant(1),Er=function(t){var e=0,n=[],r={},i=[];function o(a){var s=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){lr.has(r,t)?r[t].onStack&&(s.lowlink=Math.min(s.lowlink,r[t].index)):(o(t),s.lowlink=Math.min(s.lowlink,r[t].lowlink))})),s.lowlink===s.index){var u,l=[];do{u=n.pop(),r[u].onStack=!1,l.push(u)}while(a!==u);i.push(l)}}return t.nodes().forEach((function(t){lr.has(r,t)||o(t)})),i},Mr=lr.constant(1),Ar=Cr;function Cr(t){var e={},n={},r=[];if(lr.each(t.sinks(),(function i(o){if(lr.has(n,o))throw new Tr;lr.has(e,o)||(n[o]=!0,e[o]=!0,lr.each(t.predecessors(o),i),delete n[o],r.push(o))})),lr.size(e)!==t.nodeCount())throw new Tr;return r}function Tr(){}Cr.CycleException=Tr,Tr.prototype=new Error;var kr=function(t,e,n){lr.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],o={};return lr.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);Ir(t,e,"post"===n,o,r,i)})),i};function Ir(t,e,n,r,i,o){lr.has(r,e)||(r[e]=!0,n||o.push(e),lr.each(i(e),(function(e){Ir(t,e,n,r,i,o)})),n&&o.push(e))}var Nr,Pr={Graph:gr.Graph,json:vr,alg:{components:function(t){var e,n={},r=[];function i(r){lr.has(n,r)||(n[r]=!0,e.push(r),lr.each(t.successors(r),i),lr.each(t.predecessors(r),i))}return lr.each(t.nodes(),(function(t){e=[],i(t),e.length&&r.push(e)})),r},dijkstra:_r,dijkstraAll:function(t,e,n){return lr.transform(t.nodes(),(function(r,i){r[i]=_r(t,i,e,n)}),{})},findCycles:function(t){return lr.filter(Er(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))},floydWarshall:function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s0;){if(n=o.removeMin(),lr.has(i,n))r.setEdge(n,i[n]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(n).forEach(a)}return r},tarjan:Er,topsort:Ar},version:gr.version};try{Nr=Pr}catch(r){}Nr||(Nr=window.graphlib);var Or,Lr=Nr,Rr=function(t,e,n){if(!N(n))return!1;var r=typeof e;return!!("number"==r?Ot(n)&&yt(e,n.length):"string"==r&&e in n)&&p(n[e],t)},Dr=Object.prototype,zr=Dr.hasOwnProperty,Fr=tr((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Rr(e[0],e[1],i)&&(r=1);++n-1?i[o?e[a]:a]:void 0}}((function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:function(t){var e=Gr(t),n=e%1;return e==e?n?e-n:e:0}(n);return i<0&&(i=Wr(r+i,0)),er(t,_n(e),i)})),Yr=function(t){return null!=t&&t.length?qn(t,1):[]},qr=function(t,e,n){for(var r=-1,i=t.length;++re},Kr=function(t,e,n){(void 0!==n&&!p(t[e],n)||void 0===n&&!(e in t))&&it(t,e,n)},Zr=Function.prototype,Qr=Object.prototype,Jr=Zr.toString,ti=Qr.hasOwnProperty,ei=Jr.call(Object),ni=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},ri=function(t,e,n,r,i,o,a){var s=ni(t,n),u=ni(e,n),l=a.get(u);if(l)Kr(t,n,l);else{var c=o?o(s,u,n+"",t,e,a):void 0,h=void 0===c;if(h){var d=pt(u),f=!d&>(u),p=!d&&!f&&Et(u);c=u,d||f||p?pt(s)?c=s:ar(s)?c=Bt(s):f?(h=!1,c=Ft(u,!0)):p?(h=!1,c=pe(u,!0)):c=[]:function(t){if(!ut(t)||"[object Object]"!=I(t))return!1;var e=Xt(t);if(null===e)return!0;var n=ti.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Jr.call(n)==ei}(u)||ft(u)?(c=s,ft(s)?c=function(t){return st(t,zt(t))}(s):N(s)&&!P(s)||(c=ye(u))):h=!1}h&&(a.set(u,c),i(c,u,r,o,a),a.delete(u)),Kr(t,n,c)}},ii=function t(e,n,r,i,o){e!==n&&Ae(n,(function(a,s){if(o||(o=new et),N(a))ri(e,n,s,r,t,i,o);else{var u=i?i(ni(e,s),a,s+"",e,n,o):void 0;void 0===u&&(u=a),Kr(e,s,u)}}),zt)},oi=function(t){return tr((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Rr(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++re||o&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!l&&t=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))},mi=tr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Rr(t,e[0],e[1])?e=[]:n>2&&Rr(e[0],e[1],e[2])&&(e=[e[0]]),pi(t,qn(e,1),[])})),gi=0;try{Or={cloneDeep:function(t){return Ee(t,5)},constant:Me,defaults:Fr,each:Pe,filter:Sn,find:Xr,flatten:Yr,forEach:Ne,forIn:function(t,e){return null==t?t:Ae(t,Ie(e),zt)},has:An,isUndefined:Tn,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:In,mapValues:function(t,e){var n={};return e=_n(e),Ce(t,(function(t,r,i){it(n,r,e(t,r,i))})),n},max:function(t){return t&&t.length?qr(t,ke,$r):void 0},merge:oi,min:function(t){return t&&t.length?qr(t,ke,ai):void 0},minBy:function(t,e){return t&&t.length?qr(t,_n(e),ai):void 0},now:function(){return _.Date.now()},pick:li,range:di,reduce:On,sortBy:mi,uniqueId:function(t){var e=++gi;return dn(t)+e},values:ur,zipObject:function(t,e){return function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r0;--s)if(r=e[s].dequeue()){i=i.concat(Ei(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return vi.flatten(vi.map(r,(function(e){return t.outEdges(e.v,e.w)})),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return vi.forEach(t.nodes(),(function i(o){vi.has(r,o)||(r[o]=!0,n[o]=!0,vi.forEach(t.outEdges(o),(function(t){vi.has(n,t.w)?e.push(t):i(t.w)})),delete n[o])})),e}(t);vi.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,vi.uniqueId("rev"))}))},Ci=function(t){vi.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))},Ti=Lr.Graph,ki={addDummyNode:Ii,simplify:function(t){var e=(new Ti).setGraph(t.graph());return vi.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),vi.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new Ti({multigraph:t.isMultigraph()}).setGraph(t.graph());return vi.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),vi.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=vi.map(t.nodes(),(function(e){var n={};return vi.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return vi.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=vi.map(t.nodes(),(function(e){var n={};return vi.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return vi.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,l=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),n=l*a/s,r=l):(a<0&&(u=-u),n=u,r=u*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=vi.map(vi.range(Ni(t)+1),(function(){return[]}));return vi.forEach(t.nodes(),(function(n){var r=t.node(n),i=r.rank;vi.isUndefined(i)||(e[i][r.order]=n)})),e},normalizeRanks:function(t){var e=vi.min(vi.map(t.nodes(),(function(e){return t.node(e).rank})));vi.forEach(t.nodes(),(function(n){var r=t.node(n);vi.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=vi.min(vi.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];vi.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var r=0,i=t.graph().nodeRankFactor;vi.forEach(n,(function(e,n){vi.isUndefined(e)&&n%i!=0?--r:r&&vi.forEach(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Ii(t,"border",i,e)},maxRank:Ni,partition:function(t,e){var n={lhs:[],rhs:[]};return vi.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=vi.now();try{return e()}finally{console.log(t+" time: "+(vi.now()-n)+"ms")}},notime:function(t,e){return e()}};function Ii(t,e,n,r){var i;do{i=vi.uniqueId(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function Ni(t){return vi.max(vi.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!vi.isUndefined(n))return n})))}var Pi=function(t){t.graph().dummyChains=[],vi.forEach(t.edges(),(function(e){!function(t,e){var n,r,i,o=e.v,a=t.node(o).rank,s=e.w,u=t.node(s).rank,l=e.name,c=t.edge(e),h=c.labelRank;if(u!==a+1){for(t.removeEdge(e),i=0,++a;aa.lim&&(s=a,u=!0);var l=vi.filter(e.edges(),(function(e){return u===no(t,t.node(e.v),s)&&u!==no(t,t.node(e.w),s)}));return vi.minBy(l,(function(t){return Vi(e,t)}))}function eo(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),Zi(t),$i(t,e),function(t,e){var n=vi.find(t.nodes(),(function(t){return!e.node(t).parent})),r=Gi(t,n);r=r.slice(1),vi.forEach(r,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function no(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}qi.initLowLimValues=Zi,qi.initCutValues=$i,qi.calcCutValue=Ki,qi.leaveEdge=Ji,qi.enterEdge=to,qi.exchangeEdges=eo;var ro=Li,io=ro;function oo(t){Yi(t)}var ao=function(t){var e=ki.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var o=t.children(r);o&&o.length&&vi.forEach(o,(function(t){n(t,i+1)})),e[r]=i}return vi.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=vi.max(vi.values(n))-1,i=2*r+1;t.graph().nestingRoot=e,vi.forEach(t.edges(),(function(e){t.edge(e).minlen*=i}));var o=function(t){return vi.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;vi.forEach(t.children(),(function(a){uo(t,e,i,o,r,n,a)})),t.graph().nodeRankFactor=i},so=function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,vi.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))};function uo(t,e,n,r,i,o,a){var s=t.children(a);if(s.length){var u=ki.addBorderNode(t,"_bt"),l=ki.addBorderNode(t,"_bb"),c=t.node(a);t.setParent(u,a),c.borderTop=u,t.setParent(l,a),c.borderBottom=l,vi.forEach(s,(function(s){uo(t,e,n,r,i,o,s);var c=t.node(s),h=c.borderTop?c.borderTop:s,d=c.borderBottom?c.borderBottom:s,f=c.borderTop?r:2*r,p=h!==d?1:i-o[a]+1;t.setEdge(u,h,{weight:f,minlen:p,nestingEdge:!0}),t.setEdge(d,l,{weight:f,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,u,{weight:0,minlen:i+o[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}function lo(t,e,n,r,i,o){var a={width:0,height:0,rank:o,borderType:e},s=i[e][o-1],u=ki.addDummyNode(t,"border",a,n);i[e][o]=u,t.setParent(u,r),s&&t.setEdge(s,u,{weight:1})}var co=function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||fo(t)},ho=function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){vi.forEach(t.nodes(),(function(e){mo(t.node(e))})),vi.forEach(t.edges(),(function(e){var n=t.edge(e);vi.forEach(n.points,mo),vi.has(n,"y")&&mo(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){vi.forEach(t.nodes(),(function(e){go(t.node(e))})),vi.forEach(t.edges(),(function(e){var n=t.edge(e);vi.forEach(n.points,go),vi.has(n,"x")&&go(n)}))}(t),fo(t))};function fo(t){vi.forEach(t.nodes(),(function(e){po(t.node(e))})),vi.forEach(t.edges(),(function(e){po(t.edge(e))}))}function po(t){var e=t.width;t.width=t.height,t.height=e}function mo(t){t.y=-t.y}function go(t){var e=t.x;t.x=t.y,t.y=e}var vo=function(t,e){for(var n=0,r=1;r0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*n}))),u}function bo(t,e,n){for(var r;e.length&&(r=vi.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var xo=function t(e,n,r,i){var o=e.children(n),a=e.node(n),s=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,l={};s&&(o=vi.filter(o,(function(t){return t!==s&&t!==u})));var c=function(t,e){return vi.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=vi.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,o);vi.forEach(c,(function(n){if(e.children(n.v).length){var o=t(e,n.v,r,i);l[n.v]=o,vi.has(o,"barycenter")&&(a=n,s=o,vi.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s}));var h=function(t,e){var n={};return vi.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};vi.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),vi.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];vi.isUndefined(e)||vi.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(vi.isUndefined(e.barycenter)||vi.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var i=t.pop();e.push(i),vi.forEach(i.in.reverse(),n(i)),vi.forEach(i.out,r(i))}return vi.map(vi.filter(e,(function(t){return!t.merged})),(function(t){return vi.pick(t,["vs","i","barycenter","weight"])}))}(vi.filter(n,(function(t){return!t.indegree})))}(c,r);!function(t,e){vi.forEach(t,(function(t){t.vs=vi.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(h,l);var d=function(t,e){var n,r=ki.partition(t,(function(t){return vi.has(t,"barycenter")})),i=r.lhs,o=vi.sortBy(r.rhs,(function(t){return-t.i})),a=[],s=0,u=0,l=0;i.sort((n=!!e,function(t,e){return t.barycentere.barycenter?1:n?e.i-t.i:t.i-e.i})),l=bo(a,o,l),vi.forEach(i,(function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,l=bo(a,o,l)}));var c={vs:vi.flatten(a,!0)};return u&&(c.barycenter=s/u,c.weight=u),c}(h,i);if(s&&(d.vs=vi.flatten([s,d.vs,u],!0),e.predecessors(s).length)){var f=e.node(e.predecessors(s)[0]),p=e.node(e.predecessors(u)[0]);vi.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d},wo=Lr.Graph,_o=Lr.Graph,So=function(t){var e=ki.maxRank(t),n=Eo(t,vi.range(1,e+1),"inEdges"),r=Eo(t,vi.range(e-1,-1,-1),"outEdges"),i=function(t){var e={},n=vi.filter(t.nodes(),(function(e){return!t.children(e).length})),r=vi.max(vi.map(n,(function(e){return t.node(e).rank}))),i=vi.map(vi.range(r+1),(function(){return[]})),o=vi.sortBy(n,(function(e){return t.node(e).rank}));return vi.forEach(o,(function n(r){if(!vi.has(e,r)){e[r]=!0;var o=t.node(r);i[o.rank].push(r),vi.forEach(t.successors(r),n)}})),i}(t);Ao(t,i);for(var o,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){Mo(s%2?n:r,s%4>=2),i=ki.buildLayerMatrix(t);var l=vo(t,i);ln){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function ko(t,e,n){if(e>n){var r=e;e=n,n=r}return vi.has(t[e],n)}var Io=function(t){var e,n=ki.buildLayerMatrix(t),r=vi.merge(function(t,e){var n={};return vi.reduce(e,(function(e,r){var i=0,o=0,a=e.length,s=vi.last(r);return vi.forEach(r,(function(e,u){var l=function(t,e){if(t.node(e).dummy)return vi.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),c=l?t.node(l).order:a;(l||e===s)&&(vi.forEach(r.slice(o,u+1),(function(e){vi.forEach(t.predecessors(e),(function(r){var o=t.node(r),a=o.order;!(aa)&&To(n,e,s)}))}))}return vi.reduce(e,(function(e,n){var i,o=-1,a=0;return vi.forEach(n,(function(s,u){if("border"===t.node(s).dummy){var l=t.predecessors(s);l.length&&(i=t.node(l[0]).order,r(n,a,u,o,i),a=u,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,n)),i={};vi.forEach(["u","d"],(function(o){e="u"===o?n:vi.values(n).reverse(),vi.forEach(["l","r"],(function(n){"r"===n&&(e=vi.map(e,(function(t){return vi.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),s=function(t,e,n,r){var i={},o={},a={};return vi.forEach(e,(function(t){vi.forEach(t,(function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),vi.forEach(e,(function(t){var e=-1;vi.forEach(t,(function(t){var s=r(t);if(s.length)for(var u=((s=vi.sortBy(s,(function(t){return a[t]}))).length-1)/2,l=Math.floor(u),c=Math.ceil(u);l<=c;++l){var h=s[l];o[t]===t&&eu||l>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,l=a[u],c=!0;n!==i.w;){if(r=t.node(n),c){for(;(l=a[u])!==s&&t.node(l).maxRankthis.metaGraph.node(t)))}leaves(){let t,e=[],n=[this];for(;n.length;){let r=n.shift();r.isGroupNode?(t=r.metaGraph,t.nodes().forEach((e=>n.push(t.node(e))))):e.push(r.name)}return e}}class Qo{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function Jo(t,e={}){return new Zo(t,e)}function ta(t,e){return new Qo(t,e)}function ea(t,e,n){const r=n||{},i=new Yo.Graph(r);return i.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),i}class na{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=Jo(a,this.graphOptions),this.index[a]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const r=ea(s,c.BRIDGE,this.graphOptions);if(n.bridgeGraph=r,!e.parentNode||!("metaGraph"in e.parentNode))return r;const i=e.parentNode;return[i.metaGraph,this.getBridgeGraph(i.name)].forEach((e=>{e.edges().filter((e=>e.v===t||e.w===t)).forEach((n=>{const i=n.w===t;e.edge(n).baseEdgeList.forEach((e=>{const[o,a]=i?[e.w,n.v]:[e.v,n.w],s=this.getChildName(t,o),u={v:i?a:s,w:i?s:a};let l=r.edge(u);l||(l=ta(u.v,u.w),l.inbound=i,r.setEdge(u.v,u.w,l)),l.addBaseEdge(e,this)}))}))})),r}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const r=t.parentNode,i=r.metaGraph,o=this.getBridgeGraph(r.name);return ra(i,t,e,n),ra(o,t,e,n),n}}function ra(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class ia{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new sa(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==u.META)return;const n=e,r=n.node.metaGraph,i=n.coreGraph;r.nodes().forEach((t=>{const e=this.getOrCreateRenderNodeByName(t);i.setNode(t,e)})),r.edges().forEach((t=>{const e=r.edge(t),n=new aa(e);i.setEdge(t.v,t.w,n)}));const o=n.node.parentNode;if(!o)return;const a=this.getRenderNodeByName(o.name),s=(t,...e)=>e.concat([t?"IN":"OUT"]).join("~~"),c=this.hierarchy.getBridgeGraph(t);c.edges().forEach((e=>{const n=c.edge(e),h=!!r.node(e.w),[d,f]=h?[e.w,e.v]:[e.v,e.w],p=e=>{const n=h?{v:e,w:t}:{v:t,w:e};return a.coreGraph.edge(n)};let m=p(f);m||(m=p(s(h,f,o.name)));const g=s(h,t),v=s(h,f,t);let y=i.node(v);if(!y){let t=i.node(g);if(!t){const e={name:g,type:u.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:l.UNSPECIFIED,inbound:h,attr:{}};t=new oa(e),this.index[g]=t,i.setNode(g,t)}const e={name:v,type:u.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:l.UNSPECIFIED,inbound:h,attr:{}};y=new oa(e),this.index[v]=y,i.setNode(v,y),i.setParent(v,g),t.node.cardinality++}const b=new aa(n);b.adjoiningMetaEdge=m,h?i.setEdge(v,d,b):i.setEdge(d,v,b)}))}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new sa(e,this.hierarchy.graphOptions):new oa(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class oa{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class aa{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class sa extends oa{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=ea(n.name,c.CORE,e)}}function ua(t,e){t.node.isGroupNode&&function(t,e){const n=i(e);t.coreGraph.nodes().map((e=>t.coreGraph.node(e))).forEach((t=>{var r,i,o,a,s,l;const{height:c,width:h}=t;switch(t.node.type){case u.NODE:Object.assign(t,n.nodeSize.node),t.height=c||n.nodeSize.node.height,t.width=h||n.nodeSize.node.width;break;case u.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case u.META:t.expanded?ua(t,e):(Object.assign(t,n.nodeSize.meta),t.height=n.nodeSize.meta.height,t.width=n.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+t.node.type)}if(!t.expanded){const n=t.attr;!function(t,e=!1){if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){const e=`${t.displayName}`.length,n=3;t.width=Math.max(t.coreBox.width,e*n)}}(t,e&&(0===t.node.type&&!!(null===(i=null===(r=null==e?void 0:e.nodeSize)||void 0===r?void 0:r.meta)||void 0===i?void 0:i.width)||1===t.node.type&&(!!(null===(a=null===(o=null==e?void 0:e.nodeSize)||void 0===o?void 0:o.node)||void 0===a?void 0:a.width)||!!n.width)||2===t.node.type&&!!(null===(l=null===(s=null==e?void 0:e.nodeSize)||void 0===s?void 0:s.bridge)||void 0===l?void 0:l.width)))}}))}(t,e),t.node.type===u.META&&function(t,e){const n=i(e),r=n.subScene.meta;Object.assign(t,r);const{nodeSep:o,rankSep:a,edgeSep:s,align:l}=n.graph.meta,c={nodesep:o,ranksep:a,edgesep:s,align:l};Object.assign(t.coreBox,function(t,e){const{ranksep:n,nodesep:r,edgesep:i,align:o}=e;Object.assign(t.graph(),{ranksep:n,nodesep:r,edgesep:i,align:o});const a=[];if(t.nodes().forEach((e=>{t.node(e).node.type!==u.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};qo(t);let s=1/0,l=1/0,c=-1/0,h=-1/0;return a.forEach((e=>{const n=t.node(e),r=.5*n.width,i=n.x-r,o=n.x+r;s=ic?o:c;const a=.5*n.height,u=n.y-a,d=n.y+a;l=uh?d:h})),t.edges().forEach((e=>{const n=t.edge(e),r=t.node(n.metaEdge.v),i=t.node(n.metaEdge.w);if(3===n.points.length&&function(t){let e=la(t[0],t[1]);for(let n=1;n1)return!1;e=r}return!0}(n.points)){if(null!=r){const t=r.expanded?r.x:ca(r);n.points[0].x=t}if(null!=i){const t=i.expanded?i.x:ca(i);n.points[2].x=t}n.points=[n.points[0],n.points[1]]}const o=n.points[n.points.length-2];null!=i&&(n.points[n.points.length-1]=ha(o,i));const a=n.points[1];null!=r&&(n.points[0]=ha(a,r)),n.points.forEach((t=>{s=t.xc?t.x:c,l=t.yh?t.y:h}))})),t.nodes().forEach((e=>{const n=t.node(e);n.x-=s,n.y-=l})),t.edges().forEach((e=>{t.edge(e).points.forEach((t=>{t.x-=s,t.y-=l}))})),{width:c-s,height:h-l}}(t.coreGraph,c));let h=0;t.coreGraph.nodeCount()>0&&h++;const d=h<=1?0:h;t.coreBox.width+=d+d,t.coreBox.height=r.labelHeight+t.coreBox.height,t.width=t.coreBox.width+r.paddingLeft+r.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function la(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function ca(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function ha(t,e){const n=e.expanded?e.x:ca(e),r=e.y,i=t.x-n,o=t.y-r;let a,s,u=e.expanded?e.width:e.coreBox.width,l=e.expanded?e.height:e.coreBox.height;return Math.abs(o)*u/2>Math.abs(i)*l/2?(o<0&&(l=-l),a=0===o?0:l/2*i/o,s=l/2):(i<0&&(u=-u),a=u/2,s=0===i?0:u/2*o/i),{x:n+a,y:r+s}}function da(t,e,n){var i,o,a,s;const u=t.nodes.filter(((t,e,n)=>n.findIndex((e=>e.id===t.id))!==e)).map((t=>t.id));if(u.length)throw new Error(`Duplicated ids found: ${u.join(", ")}`);const l=function(t){const e={nodes:[]},n=t.compound,r=Object.keys(n||{}),i=new Map,o=(t,e=[])=>{if(i.has(t))return i.get(t);for(let i=0;it.edges.filter((t=>t.w===e)).map((t=>({name:t.v})));return t.nodes.forEach((t=>{const n=t.id,r=[...o(n),n];let i=a(n);e.nodes.push({name:n,path:r,inputs:i,width:t.width,height:t.height,attr:Object.assign({},t)})})),e}(t),c=function(t,e){const n=(t,e)=>{for(let n of e.values())if(n.includes(t))return!0;return!1},r=(t,e=[])=>{if(0===Object.keys(t).length)return[...new Set(e)];const i=new Map(Object.keys(t).map((e=>[e,t[e]]))),o={};for(let[t,r]of i)n(t,i)?o[t]=r:e=e.concat(t,r);return r(o,e)};return r(t).filter((t=>e.includes(t)))}(t.compound||{},(null==e?void 0:e.expanded)||[]),h=function(t,e){return function(t){return new ia(t)}(function(t,e){const{rankDirection:n,align:r}=e,i=new na({rankdir:n,align:r});return function(t,e){Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n],i=r.path;let o=t.root;o.depth=Math.max(i.length,o.depth);for(let e=0;e{let n=0;for(;t;)e[n++]=t.name,t=t.parentNode;return n-1};e.edges.forEach((a=>{r=[],i=[];let s=o(e.nodes[a.v],r),u=o(e.nodes[a.w],i);for(;r[s]===i[u];)if(s--,u--,s<0||u<0)throw Error("No difference found between ancestor paths.");const l=n[r[s+1]],c=r[s],h=i[u];let d=l.metaGraph.edge(c,h);d||(d=ta(c,h),l.metaGraph.setEdge(c,h,d)),d.addBaseEdge(a,t)}))}(i,t),i}(function(t){const e=new Ko;return t.nodes.map((t=>new $o(t))).forEach((t=>{e.nodes[t.name]=t,t.inputs.forEach((n=>{!function(t,e,n){n.name!==e.name&&t.edges.push(Object.assign(Object.assign({},n.attr),{v:n.name,w:e.name}))}(e,t,n)}))})),e}(t),e))}(l,{rankDirection:(null===(o=null===(i=null==n?void 0:n.graph)||void 0===i?void 0:i.meta)||void 0===o?void 0:o.rankDir)||(null==e?void 0:e.rankDirection)||r.graph.meta.rankDir,align:(null===(s=null===(a=null==n?void 0:n.graph)||void 0===a?void 0:a.meta)||void 0===s?void 0:s.align)||r.graph.meta.align});return function(t,e){e.forEach((e=>{const n=t.getRenderInfoNodes().find((t=>t.displayName===e));let r=n&&n.node&&n.node.name||"";const i=t.getRenderNodeByName(r);if(!i)throw new Error(`No nodes found: ${r}`);i.expanded=!0,t.buildSubHierarchy(r)}))}(h,c),ua(h.root,n),ma(h.root)}function fa(t,e=!1){const n=JSON.parse(JSON.stringify(t)),r={nodes:[n],edges:[...n.edges]};return n.nodes.forEach((function t(e){(0===e.type||1===e.type)&&r.nodes.push(e),0===e.type&&(r.edges=r.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)})),e&&r.nodes.forEach((t=>{const e=r.nodes.find((e=>e.id===t.parentNodeName));if(e){const n=e.x-e.width/2+e.paddingLeft,r=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==a&&(t.x+=n,t.y+=r),0===t.type&&t.edges.forEach((e=>{e.points.forEach((e=>{e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop}))}))}})),r}function pa(t,e,n,r){var i,o;let s=[];const u=(null===(i=n.find((e=>e.id===t)))||void 0===i?void 0:i.path)||[],l=(null===(o=n.find((t=>t.id===e)))||void 0===o?void 0:o.path)||[],c=[a,...u].slice(0,u.length).reverse(),h=[a,...l].slice(0,l.length);return c.forEach((i=>{const o=n.find((t=>t.id===i));s=s.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),h.filter((t=>!c.includes(t))).forEach((i=>{const o=n.find((t=>t.id===i));s=s.concat(o.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),s}function ma(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},ga(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===u.META?ma(t):ga(t)))):[],edges:t.expanded?va(t):[]});var n}function ga(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}function va(t){return t.coreGraph.edges().map((e=>({renderInfoEdge:t.coreGraph.edge(e),edge:e}))).filter((({renderInfoEdge:t})=>t.metaEdge)).map((({edge:e,renderInfoEdge:n})=>{const r=function(t,e){const n=e.points.map((t=>Object.assign({},t)));if(e.adjoiningMetaEdge){const r=e.adjoiningMetaEdge.points,i=e.metaEdge.inbound,o=i?r[r.length-1]:r[0],a=n[i?0:n.length-1],s=t.x-t.width/2,u=t.y-t.height/2,l=o.x-s,c=o.y-u,h=-t.paddingLeft,d=-(t.paddingTop+t.labelHeight);a.x=l+h,a.y=c+d}return n}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}}))}},70551:(t,e,n)=>{"use strict";function r(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}n.d(e,{A:()=>r})},94188:(t,e,n)=>{"use strict";function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}n.d(e,{A:()=>r})},21524:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(94188),i=n(7767),o=n(70551),a=36e5;function s(t,e){(0,o.A)(2,arguments);var n=(0,r.A)(e);return(0,i.A)(t,n*a)}},7767:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(94188),i=n(10123),o=n(70551);function a(t,e){(0,o.A)(2,arguments);var n=(0,i.A)(t).getTime(),a=(0,r.A)(e);return new Date(n+a)}},70653:(t,e,n)=>{"use strict";n.d(e,{A:()=>Z});var r=n(82284),i=n(70551);var o=n(10123);function a(t){if((0,i.A)(1,arguments),!function(t){return(0,i.A)(1,arguments),t instanceof Date||"object"===(0,r.A)(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=(0,o.A)(t);return!isNaN(Number(e))}var s=n(7767),u=n(94188);function l(t){(0,i.A)(1,arguments);var e=(0,o.A)(t),n=e.getUTCDay(),r=(n<1?7:0)+n-1;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function c(t){(0,i.A)(1,arguments);var e=(0,o.A)(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=l(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var u=l(s);return e.getTime()>=a.getTime()?n+1:e.getTime()>=u.getTime()?n:n-1}function h(t){(0,i.A)(1,arguments);var e=(0,o.A)(t),n=l(e).getTime()-function(t){(0,i.A)(1,arguments);var e=c(t),n=new Date(0);return n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0),l(n)}(e).getTime();return Math.round(n/6048e5)+1}var d={};function f(){return d}function p(t,e){var n,r,a,s,l,c,h,d;(0,i.A)(1,arguments);var p=f(),m=(0,u.A)(null!==(n=null!==(r=null!==(a=null!==(s=null==e?void 0:e.weekStartsOn)&&void 0!==s?s:null==e||null===(l=e.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==a?a:p.weekStartsOn)&&void 0!==r?r:null===(h=p.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==n?n:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,o.A)(t),v=g.getUTCDay(),y=(v=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(g+1,0,y),b.setUTCHours(0,0,0,0);var x=p(b,e),w=new Date(0);w.setUTCFullYear(g,0,y),w.setUTCHours(0,0,0,0);var _=p(w,e);return m.getTime()>=x.getTime()?g+1:m.getTime()>=_.getTime()?g:g-1}function g(t,e){(0,i.A)(1,arguments);var n=(0,o.A)(t),r=p(n,e).getTime()-function(t,e){var n,r,o,a,s,l,c,h;(0,i.A)(1,arguments);var d=f(),g=(0,u.A)(null!==(n=null!==(r=null!==(o=null!==(a=null==e?void 0:e.firstWeekContainsDate)&&void 0!==a?a:null==e||null===(s=e.locale)||void 0===s||null===(l=s.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:d.firstWeekContainsDate)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==n?n:1),v=m(t,e),y=new Date(0);return y.setUTCFullYear(v,0,g),y.setUTCHours(0,0,0,0),p(y,e)}(n,e).getTime();return Math.round(r/6048e5)+1}function v(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return v("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):v(n+1,2)},d:function(t,e){return v(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return v(t.getUTCHours()%12||12,e.length)},H:function(t,e){return v(t.getUTCHours(),e.length)},m:function(t,e){return v(t.getUTCMinutes(),e.length)},s:function(t,e){return v(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return v(Math.floor(r*Math.pow(10,n-3)),e.length)}};var b="midnight",x="noon",w="morning",_="afternoon",S="evening",E="night",M={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){var i=m(t,r),o=i>0?i:1-i;return"YY"===e?v(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):v(o,e.length)},R:function(t,e){return v(c(t),e.length)},u:function(t,e){return v(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return v(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return v(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return v(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=g(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):v(i,e.length)},I:function(t,e,n){var r=h(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):v(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){var r=function(t){(0,i.A)(1,arguments);var e=(0,o.A)(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=n-e.getTime();return Math.floor(r/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):v(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return v(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return v(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return v(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?x:0===i?b:i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?S:i>=12?_:i>=4?w:E,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):v(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):v(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return C(i);case"XXXX":case"XX":return T(i);default:return T(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return C(i);case"xxxx":case"xx":return T(i);default:return T(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+A(i,":");default:return"GMT"+T(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+A(i,":");default:return"GMT"+T(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return v(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return v((r._originalDate||t).getTime(),e.length)}};function A(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=e||"";return n+String(i)+a+v(o,2)}function C(t,e){return t%60==0?(t>0?"-":"+")+v(Math.abs(t)/60,2):T(t,e)}function T(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+v(Math.floor(i/60),2)+n+v(i%60,2)}const k=M;var I=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},N=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},P={p:N,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return I(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",I(i,e)).replace("{{time}}",N(o,e))}};const O=P;var L=["D","DD"],R=["YY","YYYY"];function D(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var z={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const F=function(t,e,n){var r,i=z[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function B(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}var U={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var j={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function V(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,s=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function H(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var a,s=o[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(u)?function(t,e){for(var n=0;n20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:V({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:V({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:V({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:V({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(G.matchPattern);if(!n)return null;var r=n[0],i=t.match(G.parsePattern);if(!i)return null;var o=G.valueCallback?G.valueCallback(i[0]):i[0];return{value:o=e.valueCallback?e.valueCallback(o):o,rest:t.slice(r.length)}}),era:H({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:H({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:H({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:H({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:H({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var X=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Y=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,q=/^'([^]*?)'?$/,$=/''/g,K=/[a-zA-Z]/;function Z(t,e,n){var r,l,c,h,d,p,m,g,v,y,b,x,w,_,S,E,M,A;(0,i.A)(2,arguments);var C=String(e),T=f(),I=null!==(r=null!==(l=null==n?void 0:n.locale)&&void 0!==l?l:T.locale)&&void 0!==r?r:W,N=(0,u.A)(null!==(c=null!==(h=null!==(d=null!==(p=null==n?void 0:n.firstWeekContainsDate)&&void 0!==p?p:null==n||null===(m=n.locale)||void 0===m||null===(g=m.options)||void 0===g?void 0:g.firstWeekContainsDate)&&void 0!==d?d:T.firstWeekContainsDate)&&void 0!==h?h:null===(v=T.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=(0,u.A)(null!==(b=null!==(x=null!==(w=null!==(_=null==n?void 0:n.weekStartsOn)&&void 0!==_?_:null==n||null===(S=n.locale)||void 0===S||null===(E=S.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==w?w:T.weekStartsOn)&&void 0!==x?x:null===(M=T.locale)||void 0===M||null===(A=M.options)||void 0===A?void 0:A.weekStartsOn)&&void 0!==b?b:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!I.localize)throw new RangeError("locale must contain localize property");if(!I.formatLong)throw new RangeError("locale must contain formatLong property");var z=(0,o.A)(t);if(!a(z))throw new RangeError("Invalid time value");var F=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(z),B=function(t,e){(0,i.A)(2,arguments);var n=(0,u.A)(e);return(0,s.A)(t,-n)}(z,F),U={firstWeekContainsDate:N,weekStartsOn:P,locale:I,_originalDate:z};return C.match(Y).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,O[e])(t,I.formatLong):t})).join("").match(X).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return function(t){var e=t.match(q);if(!e)return t;return e[1].replace($,"'")}(r);var o,a=k[i];if(a)return null!=n&&n.useAdditionalWeekYearTokens||(o=r,-1===R.indexOf(o))||D(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!function(t){return-1!==L.indexOf(t)}(r)||D(r,e,String(t)),a(B,r,I.localize,U);if(i.match(K))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")}},35938:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(94188),i=n(10123),o=n(70551);function a(t,e){return(0,o.A)(2,arguments),function(t,e){(0,o.A)(2,arguments);var n=(0,i.A)(t),a=(0,r.A)(e);return isNaN(a)?new Date(NaN):a?(n.setDate(n.getDate()+a),n):n}(t,-(0,r.A)(e))}},10123:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(82284),i=n(70551);function o(t){(0,i.A)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===(0,r.A)(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},17823:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ARRAY_TYPE:()=>i,EPSILON:()=>r,RANDOM:()=>o,equals:()=>l,setMatrixArrayType:()=>a,toRadian:()=>u});var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;function a(t){i=t}var s=Math.PI/180;function u(t){return t*s}function l(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},38274:(t,e,n)=>{"use strict";n.r(e),n.d(e,{glMatrix:()=>l,mat2:()=>r,mat2d:()=>i,mat3:()=>st,mat4:()=>o,quat:()=>s,quat2:()=>u,vec2:()=>Mr,vec3:()=>oe,vec4:()=>a});var r={};n.r(r),n.d(r,{LDU:()=>C,add:()=>T,adjoint:()=>y,clone:()=>h,copy:()=>d,create:()=>c,determinant:()=>b,equals:()=>N,exactEquals:()=>I,frob:()=>A,fromRotation:()=>S,fromScaling:()=>E,fromValues:()=>p,identity:()=>f,invert:()=>v,mul:()=>L,multiply:()=>x,multiplyScalar:()=>P,multiplyScalarAndAdd:()=>O,rotate:()=>w,scale:()=>_,set:()=>m,str:()=>M,sub:()=>R,subtract:()=>k,transpose:()=>g});var i={};n.r(i),n.d(i,{add:()=>J,clone:()=>z,copy:()=>F,create:()=>D,determinant:()=>H,equals:()=>it,exactEquals:()=>rt,frob:()=>Q,fromRotation:()=>q,fromScaling:()=>$,fromTranslation:()=>K,fromValues:()=>U,identity:()=>B,invert:()=>V,mul:()=>ot,multiply:()=>G,multiplyScalar:()=>et,multiplyScalarAndAdd:()=>nt,rotate:()=>W,scale:()=>X,set:()=>j,str:()=>Z,sub:()=>at,subtract:()=>tt,translate:()=>Y});var o={};n.r(o),n.d(o,{add:()=>Zt,adjoint:()=>gt,clone:()=>lt,copy:()=>ct,create:()=>ut,determinant:()=>vt,equals:()=>ne,exactEquals:()=>ee,frob:()=>Kt,fromQuat:()=>Ft,fromQuat2:()=>Pt,fromRotation:()=>Ct,fromRotationTranslation:()=>Nt,fromRotationTranslationScale:()=>Dt,fromRotationTranslationScaleOrigin:()=>zt,fromScaling:()=>At,fromTranslation:()=>Mt,fromValues:()=>ht,fromXRotation:()=>Tt,fromYRotation:()=>kt,fromZRotation:()=>It,frustum:()=>Bt,getRotation:()=>Rt,getScaling:()=>Lt,getTranslation:()=>Ot,identity:()=>ft,invert:()=>mt,lookAt:()=>Yt,mul:()=>re,multiply:()=>yt,multiplyScalar:()=>Jt,multiplyScalarAndAdd:()=>te,ortho:()=>Wt,orthoNO:()=>Gt,orthoZO:()=>Xt,perspective:()=>jt,perspectiveFromFieldOfView:()=>Ht,perspectiveNO:()=>Ut,perspectiveZO:()=>Vt,rotate:()=>wt,rotateX:()=>_t,rotateY:()=>St,rotateZ:()=>Et,scale:()=>xt,set:()=>dt,str:()=>$t,sub:()=>ie,subtract:()=>Qt,targetTo:()=>qt,translate:()=>bt,transpose:()=>pt});var a={};n.r(a),n.d(a,{add:()=>he,ceil:()=>me,clone:()=>se,copy:()=>le,create:()=>ae,cross:()=>Ie,dist:()=>He,distance:()=>_e,div:()=>Ve,divide:()=>pe,dot:()=>ke,equals:()=>Fe,exactEquals:()=>ze,floor:()=>ge,forEach:()=>Ye,fromValues:()=>ue,inverse:()=>Ce,len:()=>We,length:()=>Ee,lerp:()=>Ne,max:()=>ye,min:()=>ve,mul:()=>je,multiply:()=>fe,negate:()=>Ae,normalize:()=>Te,random:()=>Pe,round:()=>be,scale:()=>xe,scaleAndAdd:()=>we,set:()=>ce,sqrDist:()=>Ge,sqrLen:()=>Xe,squaredDistance:()=>Se,squaredLength:()=>Me,str:()=>De,sub:()=>Ue,subtract:()=>de,transformMat4:()=>Oe,transformQuat:()=>Le,zero:()=>Re});var s={};n.r(s),n.d(s,{add:()=>Mn,calculateW:()=>rn,clone:()=>wn,conjugate:()=>hn,copy:()=>Sn,create:()=>qe,dot:()=>Tn,equals:()=>Dn,exactEquals:()=>Rn,exp:()=>on,fromEuler:()=>fn,fromMat3:()=>dn,fromValues:()=>_n,getAngle:()=>Qe,getAxisAngle:()=>Ze,identity:()=>$e,invert:()=>cn,len:()=>Nn,length:()=>In,lerp:()=>kn,ln:()=>an,mul:()=>An,multiply:()=>Je,normalize:()=>Ln,pow:()=>sn,random:()=>ln,rotateX:()=>tn,rotateY:()=>en,rotateZ:()=>nn,rotationTo:()=>zn,scale:()=>Cn,set:()=>En,setAxes:()=>Bn,setAxisAngle:()=>Ke,slerp:()=>un,sqlerp:()=>Fn,sqrLen:()=>On,squaredLength:()=>Pn,str:()=>pn});var u={};n.r(u),n.d(u,{add:()=>lr,clone:()=>jn,conjugate:()=>gr,copy:()=>qn,create:()=>Un,dot:()=>fr,equals:()=>Er,exactEquals:()=>Sr,fromMat4:()=>Yn,fromRotation:()=>Xn,fromRotationTranslation:()=>Gn,fromRotationTranslationValues:()=>Hn,fromTranslation:()=>Wn,fromValues:()=>Vn,getDual:()=>Qn,getReal:()=>Zn,getTranslation:()=>er,identity:()=>$n,invert:()=>mr,len:()=>yr,length:()=>vr,lerp:()=>pr,mul:()=>hr,multiply:()=>cr,normalize:()=>wr,rotateAroundAxis:()=>ur,rotateByQuatAppend:()=>ar,rotateByQuatPrepend:()=>sr,rotateX:()=>rr,rotateY:()=>ir,rotateZ:()=>or,scale:()=>dr,set:()=>Kn,setDual:()=>tr,setReal:()=>Jn,sqrLen:()=>xr,squaredLength:()=>br,str:()=>_r,translate:()=>nr});var l=n(17823);function c(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function h(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function f(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function p(t,e,n,r){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function m(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function g(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function v(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*o-i*r;return a?(a=1/a,t[0]=o*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null}function y(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t}function b(t){return t[0]*t[3]-t[2]*t[1]}function x(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*s+o*u,t[1]=i*s+a*u,t[2]=r*l+o*c,t[3]=i*l+a*c,t}function w(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*s,t[1]=i*u+a*s,t[2]=r*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1];return t[0]=r*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function S(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t}function E(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function M(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function A(t){return Math.hypot(t[0],t[1],t[2],t[3])}function C(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]}function T(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function k(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function I(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(n-a)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function P(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function O(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}var L=x,R=k;function D(){var t=new l.ARRAY_TYPE(6);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function z(t){var e=new l.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function F(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function B(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function U(t,e,n,r,i,o){var a=new l.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a[4]=i,a[5]=o,a}function j(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t}function V(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=n*o-r*i;return u?(u=1/u,t[0]=o*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*s-o*a)*u,t[5]=(r*a-n*s)*u,t):null}function H(t){return t[0]*t[3]-t[1]*t[2]}function G(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=n[0],c=n[1],h=n[2],d=n[3],f=n[4],p=n[5];return t[0]=r*l+o*c,t[1]=i*l+a*c,t[2]=r*h+o*d,t[3]=i*h+a*d,t[4]=r*f+o*p+s,t[5]=i*f+a*p+u,t}function W(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=Math.sin(n),c=Math.cos(n);return t[0]=r*c+o*l,t[1]=i*c+a*l,t[2]=r*-l+o*c,t[3]=i*-l+a*c,t[4]=s,t[5]=u,t}function X(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=n[0],c=n[1];return t[0]=r*l,t[1]=i*l,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function Y(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=n[0],c=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=r*l+o*c+s,t[5]=i*l+a*c+u,t}function q(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t}function $(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function K(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function Z(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Q(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function J(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t}function tt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}function et(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t}function nt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t}function rt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function it(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],c=e[1],h=e[2],d=e[3],f=e[4],p=e[5];return Math.abs(n-u)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(r-c)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-h)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(o-d)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-f)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(s-p)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))}var ot=G,at=tt,st=n(91409);function ut(){var t=new l.ARRAY_TYPE(16);return l.ARRAY_TYPE!=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}function lt(t){var e=new l.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ct(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ht(t,e,n,r,i,o,a,s,u,c,h,d,f,p,m,g){var v=new l.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=c,v[10]=h,v[11]=d,v[12]=f,v[13]=p,v[14]=m,v[15]=g,v}function dt(t,e,n,r,i,o,a,s,u,l,c,h,d,f,p,m,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=d,t[12]=f,t[13]=p,t[14]=m,t[15]=g,t}function ft(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function mt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=n*s-r*a,b=n*u-i*a,x=n*l-o*a,w=r*u-i*s,_=r*l-o*s,S=i*l-o*u,E=c*m-h*p,M=c*g-d*p,A=c*v-f*p,C=h*g-d*m,T=h*v-f*m,k=d*v-f*g,I=y*k-b*T+x*C+w*A-_*M+S*E;return I?(I=1/I,t[0]=(s*k-u*T+l*C)*I,t[1]=(i*T-r*k-o*C)*I,t[2]=(m*S-g*_+v*w)*I,t[3]=(d*_-h*S-f*w)*I,t[4]=(u*A-a*k-l*M)*I,t[5]=(n*k-i*A+o*M)*I,t[6]=(g*x-p*S-v*b)*I,t[7]=(c*S-d*x+f*b)*I,t[8]=(a*T-s*A+l*E)*I,t[9]=(r*A-n*T-o*E)*I,t[10]=(p*_-m*x+v*y)*I,t[11]=(h*x-c*_-f*y)*I,t[12]=(s*M-a*C-u*E)*I,t[13]=(n*C-r*M+i*E)*I,t[14]=(m*b-p*w-g*y)*I,t[15]=(c*w-h*b+d*y)*I,t):null}function gt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=s*(d*v-f*g)-h*(u*v-l*g)+m*(u*f-l*d),t[1]=-(r*(d*v-f*g)-h*(i*v-o*g)+m*(i*f-o*d)),t[2]=r*(u*v-l*g)-s*(i*v-o*g)+m*(i*l-o*u),t[3]=-(r*(u*f-l*d)-s*(i*f-o*d)+h*(i*l-o*u)),t[4]=-(a*(d*v-f*g)-c*(u*v-l*g)+p*(u*f-l*d)),t[5]=n*(d*v-f*g)-c*(i*v-o*g)+p*(i*f-o*d),t[6]=-(n*(u*v-l*g)-a*(i*v-o*g)+p*(i*l-o*u)),t[7]=n*(u*f-l*d)-a*(i*f-o*d)+c*(i*l-o*u),t[8]=a*(h*v-f*m)-c*(s*v-l*m)+p*(s*f-l*h),t[9]=-(n*(h*v-f*m)-c*(r*v-o*m)+p*(r*f-o*h)),t[10]=n*(s*v-l*m)-a*(r*v-o*m)+p*(r*l-o*s),t[11]=-(n*(s*f-l*h)-a*(r*f-o*h)+c*(r*l-o*s)),t[12]=-(a*(h*g-d*m)-c*(s*g-u*m)+p*(s*d-u*h)),t[13]=n*(h*g-d*m)-c*(r*g-i*m)+p*(r*d-i*h),t[14]=-(n*(s*g-u*m)-a*(r*g-i*m)+p*(r*u-i*s)),t[15]=n*(s*d-u*h)-a*(r*d-i*h)+c*(r*u-i*s),t}function vt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-n*o)*(h*g-d*m)-(e*s-r*o)*(c*g-d*p)+(e*u-i*o)*(c*m-h*p)+(n*s-r*a)*(l*g-d*f)-(n*u-i*a)*(l*m-h*f)+(r*u-i*s)*(l*p-c*f)}function yt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=n[0],x=n[1],w=n[2],_=n[3];return t[0]=b*r+x*s+w*h+_*m,t[1]=b*i+x*u+w*d+_*g,t[2]=b*o+x*l+w*f+_*v,t[3]=b*a+x*c+w*p+_*y,b=n[4],x=n[5],w=n[6],_=n[7],t[4]=b*r+x*s+w*h+_*m,t[5]=b*i+x*u+w*d+_*g,t[6]=b*o+x*l+w*f+_*v,t[7]=b*a+x*c+w*p+_*y,b=n[8],x=n[9],w=n[10],_=n[11],t[8]=b*r+x*s+w*h+_*m,t[9]=b*i+x*u+w*d+_*g,t[10]=b*o+x*l+w*f+_*v,t[11]=b*a+x*c+w*p+_*y,b=n[12],x=n[13],w=n[14],_=n[15],t[12]=b*r+x*s+w*h+_*m,t[13]=b*i+x*u+w*d+_*g,t[14]=b*o+x*l+w*f+_*v,t[15]=b*a+x*c+w*p+_*y,t}function bt(t,e,n){var r,i,o,a,s,u,l,c,h,d,f,p,m=n[0],g=n[1],v=n[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=r*m+s*g+h*v+e[12],t[13]=i*m+u*g+d*v+e[13],t[14]=o*m+l*g+f*v+e[14],t[15]=a*m+c*g+p*v+e[15]),t}function xt(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function wt(t,e,n,r){var i,o,a,s,u,c,h,d,f,p,m,g,v,y,b,x,w,_,S,E,M,A,C,T,k=r[0],I=r[1],N=r[2],P=Math.hypot(k,I,N);return P0?(n[0]=2*(s*a+h*r+u*o-c*i)/d,n[1]=2*(u*a+h*i+c*r-s*o)/d,n[2]=2*(c*a+h*o+s*i-u*r)/d):(n[0]=2*(s*a+h*r+u*o-c*i),n[1]=2*(u*a+h*i+c*r-s*o),n[2]=2*(c*a+h*o+s*i-u*r)),Nt(t,e,n),t}function Ot(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Lt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,l,c),t}function Rt(t,e){var n=new l.ARRAY_TYPE(3);Lt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,h=e[5]*i,d=e[6]*o,f=e[8]*r,p=e[9]*i,m=e[10]*o,g=a+h+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(d-p)/v,t[1]=(f-u)/v,t[2]=(s-c)/v):a>h&&a>m?(v=2*Math.sqrt(1+a-h-m),t[3]=(d-p)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(f+u)/v):h>m?(v=2*Math.sqrt(1+h-a-m),t[3]=(f-u)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(d+p)/v):(v=2*Math.sqrt(1+m-a-h),t[3]=(s-c)/v,t[0]=(f+u)/v,t[1]=(d+p)/v,t[2]=.25*v),t}function Dt(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,l=o+o,c=a+a,h=i*u,d=i*l,f=i*c,p=o*l,m=o*c,g=a*c,v=s*u,y=s*l,b=s*c,x=r[0],w=r[1],_=r[2];return t[0]=(1-(p+g))*x,t[1]=(d+b)*x,t[2]=(f-y)*x,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(h+g))*w,t[6]=(m+v)*w,t[7]=0,t[8]=(f+y)*_,t[9]=(m-v)*_,t[10]=(1-(h+p))*_,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function zt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],l=o+o,c=a+a,h=s+s,d=o*l,f=o*c,p=o*h,m=a*c,g=a*h,v=s*h,y=u*l,b=u*c,x=u*h,w=r[0],_=r[1],S=r[2],E=i[0],M=i[1],A=i[2],C=(1-(m+v))*w,T=(f+x)*w,k=(p-b)*w,I=(f-x)*_,N=(1-(d+v))*_,P=(g+y)*_,O=(p+b)*S,L=(g-y)*S,R=(1-(d+m))*S;return t[0]=C,t[1]=T,t[2]=k,t[3]=0,t[4]=I,t[5]=N,t[6]=P,t[7]=0,t[8]=O,t[9]=L,t[10]=R,t[11]=0,t[12]=n[0]+E-(C*E+I*M+O*A),t[13]=n[1]+M-(T*E+N*M+L*A),t[14]=n[2]+A-(k*E+P*M+R*A),t[15]=1,t}function Ft(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,h=r*s,d=i*a,f=i*s,p=i*u,m=o*a,g=o*s,v=o*u;return t[0]=1-h-p,t[1]=c+v,t[2]=d-g,t[3]=0,t[4]=c-v,t[5]=1-l-p,t[6]=f+m,t[7]=0,t[8]=d+g,t[9]=f-m,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bt(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}function Ut(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var jt=Ut;function Vt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function Ht(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),l=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function Gt(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}var Wt=Gt;function Xt(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]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*l,t[15]=1,t}function Yt(t,e,n,r){var i,o,a,s,u,c,h,d,f,p,m=e[0],g=e[1],v=e[2],y=r[0],b=r[1],x=r[2],w=n[0],_=n[1],S=n[2];return Math.abs(m-w)0&&(c*=f=1/Math.sqrt(f),h*=f,d*=f);var p=u*d-l*h,m=l*c-s*d,g=s*h-u*c;return(f=p*p+m*m+g*g)>0&&(p*=f=1/Math.sqrt(f),m*=f,g*=f),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=h*g-d*m,t[5]=d*p-c*g,t[6]=c*m-h*p,t[7]=0,t[8]=c,t[9]=h,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function $t(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Zt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Qt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Jt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function te(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function ee(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ne(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],x=e[1],w=e[2],_=e[3],S=e[4],E=e[5],M=e[6],A=e[7],C=e[8],T=e[9],k=e[10],I=e[11],N=e[12],P=e[13],O=e[14],L=e[15];return Math.abs(n-b)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-x)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-w)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(o-_)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(s-E)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(u-M)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(c-A)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-C)<=l.EPSILON*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(d-T)<=l.EPSILON*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(f-k)<=l.EPSILON*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=l.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-N)<=l.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(g-P)<=l.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(v-O)<=l.EPSILON*Math.max(1,Math.abs(v),Math.abs(O))&&Math.abs(y-L)<=l.EPSILON*Math.max(1,Math.abs(y),Math.abs(L))}var re=yt,ie=Qt,oe=n(30329);function ae(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function se(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ue(t,e,n,r){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function le(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ce(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function he(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function de(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function fe(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function pe(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function me(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function ge(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function ve(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function ye(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function be(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function xe(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function we(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function _e(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function Se(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function Ee(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function Me(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function Ae(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function Ce(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function Te(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function ke(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ie(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],u=n[1]*r[3]-n[3]*r[1],l=n[2]*r[3]-n[3]*r[2],c=e[0],h=e[1],d=e[2],f=e[3];return t[0]=h*l-d*u+f*s,t[1]=-c*l+d*a-f*o,t[2]=c*u-h*a+f*i,t[3]=-c*s+h*o-d*i,t}function Ne(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function Pe(t,e){var n,r,i,o,a,s;e=e||1;do{a=(n=2*l.RANDOM()-1)*n+(r=2*l.RANDOM()-1)*r}while(a>=1);do{s=(i=2*l.RANDOM()-1)*i+(o=2*l.RANDOM()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*n,t[1]=e*r,t[2]=e*i*u,t[3]=e*o*u,t}function Oe(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function Le(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],l=n[3],c=l*r+s*o-u*i,h=l*i+u*r-a*o,d=l*o+a*i-s*r,f=-a*r-s*i-u*o;return t[0]=c*l+f*-a+h*-u-d*-s,t[1]=h*l+f*-s+d*-a-c*-u,t[2]=d*l+f*-u+c*-s-h*-a,t[3]=e[3],t}function Re(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function De(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function ze(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Fe(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(n-a)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var Be,Ue=de,je=fe,Ve=pe,He=_e,Ge=Se,We=Ee,Xe=Me,Ye=(Be=ae(),function(t,e,n,r,i,o){var a,s;for(e||(e=4),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;al.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function Qe(t,e){var n=Tn(t,e);return Math.acos(2*n*n-1)}function Je(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-r*l,t[2]=o*c+a*l+r*u-i*s,t[3]=a*c-r*s-i*u-o*l,t}function tn(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-r*s,t}function en(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u-o*s,t[1]=i*u+a*s,t[2]=o*u+r*s,t[3]=a*u-i*s,t}function nn(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*s,t[1]=i*u-r*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function rn(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function on(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function an(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function sn(t,e,n){return an(t,e),Cn(t,t,n),on(t,t),t}function un(t,e,n,r){var i,o,a,s,u,c=e[0],h=e[1],d=e[2],f=e[3],p=n[0],m=n[1],g=n[2],v=n[3];return(o=c*p+h*m+d*g+f*v)<0&&(o=-o,p=-p,m=-m,g=-g,v=-v),1-o>l.EPSILON?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*p,t[1]=s*h+u*m,t[2]=s*d+u*g,t[3]=s*f+u*v,t}function ln(t){var e=l.RANDOM(),n=l.RANDOM(),r=l.RANDOM(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function cn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function hn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function dn(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function fn(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=o*u*c-a*s*l,t[1]=a*s*c+o*u*l,t[2]=a*u*l-o*s*c,t[3]=a*u*c+o*s*l,t}function pn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var mn,gn,vn,yn,bn,xn,wn=se,_n=ue,Sn=le,En=ce,Mn=he,An=Je,Cn=xe,Tn=ke,kn=Ne,In=Ee,Nn=In,Pn=Me,On=Pn,Ln=Te,Rn=ze,Dn=Fe,zn=(mn=oe.create(),gn=oe.fromValues(1,0,0),vn=oe.fromValues(0,1,0),function(t,e,n){var r=oe.dot(e,n);return r<-.999999?(oe.cross(mn,gn,e),oe.len(mn)<1e-6&&oe.cross(mn,vn,e),oe.normalize(mn,mn),Ke(t,mn,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(oe.cross(mn,e,n),t[0]=mn[0],t[1]=mn[1],t[2]=mn[2],t[3]=1+r,Ln(t,t))}),Fn=(yn=qe(),bn=qe(),function(t,e,n,r,i,o){return un(yn,e,i,o),un(bn,n,r,o),un(t,yn,bn,2*o*(1-o)),t}),Bn=(xn=st.create(),function(t,e,n,r){return xn[0]=n[0],xn[3]=n[1],xn[6]=n[2],xn[1]=r[0],xn[4]=r[1],xn[7]=r[2],xn[2]=-e[0],xn[5]=-e[1],xn[8]=-e[2],Ln(t,dn(t,xn))});function Un(){var t=new l.ARRAY_TYPE(8);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function jn(t){var e=new l.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Vn(t,e,n,r,i,o,a,s){var u=new l.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=n,u[3]=r,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function Hn(t,e,n,r,i,o,a){var s=new l.ARRAY_TYPE(8);s[0]=t,s[1]=e,s[2]=n,s[3]=r;var u=.5*i,c=.5*o,h=.5*a;return s[4]=u*r+c*n-h*e,s[5]=c*r+h*t-u*n,s[6]=h*r+u*e-c*t,s[7]=-u*t-c*e-h*n,s}function Gn(t,e,n){var r=.5*n[0],i=.5*n[1],o=.5*n[2],a=e[0],s=e[1],u=e[2],l=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=l,t[4]=r*l+i*u-o*s,t[5]=i*l+o*a-r*u,t[6]=o*l+r*s-i*a,t[7]=-r*a-i*s-o*u,t}function Wn(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Xn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Yn(t,e){var n=qe();Rt(n,e);var r=new l.ARRAY_TYPE(3);return Ot(r,e),Gn(t,n,r),t}function qn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function $n(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Kn(t,e,n,r,i,o,a,s,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Zn=Sn;function Qn(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Jn=Sn;function tr(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function er(t,e){var n=e[4],r=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],l=e[3];return t[0]=2*(n*l+o*a+r*u-i*s),t[1]=2*(r*l+o*s+i*a-n*u),t[2]=2*(i*l+o*u+n*s-r*a),t}function nr(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=.5*n[0],u=.5*n[1],l=.5*n[2],c=e[4],h=e[5],d=e[6],f=e[7];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*l-o*u+c,t[5]=a*u+o*s-r*l+h,t[6]=a*l+r*u-i*s+d,t[7]=-r*s-i*u-o*l+f,t}function rr(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=s*a+c*r+u*o-l*i,d=u*a+c*i+l*r-s*o,f=l*a+c*o+s*i-u*r,p=c*a-s*r-u*i-l*o;return tn(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+d*o-f*i,t[5]=d*a+p*i+f*r-h*o,t[6]=f*a+p*o+h*i-d*r,t[7]=p*a-h*r-d*i-f*o,t}function ir(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=s*a+c*r+u*o-l*i,d=u*a+c*i+l*r-s*o,f=l*a+c*o+s*i-u*r,p=c*a-s*r-u*i-l*o;return en(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+d*o-f*i,t[5]=d*a+p*i+f*r-h*o,t[6]=f*a+p*o+h*i-d*r,t[7]=p*a-h*r-d*i-f*o,t}function or(t,e,n){var r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=s*a+c*r+u*o-l*i,d=u*a+c*i+l*r-s*o,f=l*a+c*o+s*i-u*r,p=c*a-s*r-u*i-l*o;return nn(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=h*a+p*r+d*o-f*i,t[5]=d*a+p*i+f*r-h*o,t[6]=f*a+p*o+h*i-d*r,t[7]=p*a-h*r-d*i-f*o,t}function ar(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],l=e[2],c=e[3];return t[0]=s*a+c*r+u*o-l*i,t[1]=u*a+c*i+l*r-s*o,t[2]=l*a+c*o+s*i-u*r,t[3]=c*a-s*r-u*i-l*o,s=e[4],u=e[5],l=e[6],c=e[7],t[4]=s*a+c*r+u*o-l*i,t[5]=u*a+c*i+l*r-s*o,t[6]=l*a+c*o+s*i-u*r,t[7]=c*a-s*r-u*i-l*o,t}function sr(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-r*l,t[2]=o*c+a*l+r*u-i*s,t[3]=a*c-r*s-i*u-o*l,s=n[4],u=n[5],l=n[6],c=n[7],t[4]=r*c+a*s+i*l-o*u,t[5]=i*c+a*u+o*s-r*l,t[6]=o*c+a*l+r*u-i*s,t[7]=a*c-r*s-i*u-o*l,t}function ur(t,e,n,r){if(Math.abs(r)0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,o=e[2]/n,a=e[3]/n,s=e[4],u=e[5],l=e[6],c=e[7],h=r*s+i*u+o*l+a*c;t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-r*h)/n,t[5]=(u-i*h)/n,t[6]=(l-o*h)/n,t[7]=(c-a*h)/n}return t}function _r(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Sr(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function Er(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=e[0],d=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(n-h)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-d)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-f)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-p)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-g)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-y)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))}var Mr=n(40842)},91409:(t,e,n)=>{"use strict";n.r(e),n.d(e,{add:()=>T,adjoint:()=>f,clone:()=>a,copy:()=>s,create:()=>i,determinant:()=>p,equals:()=>O,exactEquals:()=>P,frob:()=>C,fromMat2d:()=>_,fromMat4:()=>o,fromQuat:()=>S,fromRotation:()=>x,fromScaling:()=>w,fromTranslation:()=>b,fromValues:()=>u,identity:()=>c,invert:()=>d,mul:()=>L,multiply:()=>m,multiplyScalar:()=>I,multiplyScalarAndAdd:()=>N,normalFromMat4:()=>E,projection:()=>M,rotate:()=>v,scale:()=>y,set:()=>l,str:()=>A,sub:()=>R,subtract:()=>k,translate:()=>g,transpose:()=>h});var r=n(17823);function i(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function a(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function u(t,e,n,i,o,a,s,u,l){var c=new r.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=i,c[4]=o,c[5]=a,c[6]=s,c[7]=u,c[8]=l,c}function l(t,e,n,r,i,o,a,s,u,l){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function h(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function d(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=c*a-s*l,d=-c*o+s*u,f=l*o-a*u,p=n*h+r*d+i*f;return p?(p=1/p,t[0]=h*p,t[1]=(-c*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=d*p,t[4]=(c*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=f*p,t[7]=(-l*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function f(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8];return t[0]=a*c-s*l,t[1]=i*l-r*c,t[2]=r*s-i*a,t[3]=s*u-o*c,t[4]=n*c-i*u,t[5]=i*o-n*s,t[6]=o*l-a*u,t[7]=r*u-n*l,t[8]=n*a-r*o,t}function p(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8];return e*(l*o-a*u)+n*(-l*i+a*s)+r*(u*i-o*s)}function m(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=n[0],f=n[1],p=n[2],m=n[3],g=n[4],v=n[5],y=n[6],b=n[7],x=n[8];return t[0]=d*r+f*a+p*l,t[1]=d*i+f*s+p*c,t[2]=d*o+f*u+p*h,t[3]=m*r+g*a+v*l,t[4]=m*i+g*s+v*c,t[5]=m*o+g*u+v*h,t[6]=y*r+b*a+x*l,t[7]=y*i+b*s+x*c,t[8]=y*o+b*u+x*h,t}function g(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=d*r+f*a+l,t[7]=d*i+f*s+c,t[8]=d*o+f*u+h,t}function v(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=Math.sin(n),f=Math.cos(n);return t[0]=f*r+d*a,t[1]=f*i+d*s,t[2]=f*o+d*u,t[3]=f*a-d*r,t[4]=f*s-d*i,t[5]=f*u-d*o,t[6]=l,t[7]=c,t[8]=h,t}function y(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function _(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function S(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,h=r*s,d=i*a,f=i*s,p=i*u,m=o*a,g=o*s,v=o*u;return t[0]=1-h-p,t[3]=c-v,t[6]=d+g,t[1]=c+v,t[4]=1-l-p,t[7]=f-m,t[2]=d-g,t[5]=f+m,t[8]=1-l-h,t}function E(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=n*s-r*a,b=n*u-i*a,x=n*l-o*a,w=r*u-i*s,_=r*l-o*s,S=i*l-o*u,E=c*m-h*p,M=c*g-d*p,A=c*v-f*p,C=h*g-d*m,T=h*v-f*m,k=d*v-f*g,I=y*k-b*T+x*C+w*A-_*M+S*E;return I?(I=1/I,t[0]=(s*k-u*T+l*C)*I,t[1]=(u*A-a*k-l*M)*I,t[2]=(a*T-s*A+l*E)*I,t[3]=(i*T-r*k-o*C)*I,t[4]=(n*k-i*A+o*M)*I,t[5]=(r*A-n*T-o*E)*I,t[6]=(m*S-g*_+v*w)*I,t[7]=(g*x-p*S-v*b)*I,t[8]=(p*_-m*x+v*y)*I,t):null}function M(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function A(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function C(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function T(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function k(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function I(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function N(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function O(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],h=t[8],d=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-d)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-g)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(l-y)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(c-b)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(h-x)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))}var L=m,R=k},40842:(t,e,n)=>{"use strict";n.r(e),n.d(e,{add:()=>l,angle:()=>D,ceil:()=>f,clone:()=>o,copy:()=>s,create:()=>i,cross:()=>T,dist:()=>X,distance:()=>x,div:()=>W,divide:()=>d,dot:()=>C,equals:()=>U,exactEquals:()=>B,floor:()=>p,forEach:()=>$,fromValues:()=>a,inverse:()=>M,len:()=>V,length:()=>_,lerp:()=>k,max:()=>g,min:()=>m,mul:()=>G,multiply:()=>h,negate:()=>E,normalize:()=>A,random:()=>I,rotate:()=>R,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,set:()=>u,sqrDist:()=>Y,sqrLen:()=>q,squaredDistance:()=>w,squaredLength:()=>S,str:()=>F,sub:()=>H,subtract:()=>c,transformMat2:()=>N,transformMat2d:()=>P,transformMat3:()=>O,transformMat4:()=>L,zero:()=>z});var r=n(17823);function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function l(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function c(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function h(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function d(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function f(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function g(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function _(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function A(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function C(t,e){return t[0]*e[0]+t[1]*e[1]}function T(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function k(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function I(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function N(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function P(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function O(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function L(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function R(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function D(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function z(t){return t[0]=0,t[1]=0,t}function F(t){return"vec2("+t[0]+", "+t[1]+")"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]}function U(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))}var j,V=_,H=c,G=h,W=d,X=x,Y=w,q=S,$=(j=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a{"use strict";n.r(e),n.d(e,{add:()=>c,angle:()=>B,bezier:()=>N,ceil:()=>p,clone:()=>o,copy:()=>u,create:()=>i,cross:()=>T,dist:()=>q,distance:()=>w,div:()=>Y,divide:()=>f,dot:()=>C,equals:()=>H,exactEquals:()=>V,floor:()=>m,forEach:()=>Q,fromValues:()=>s,hermite:()=>I,inverse:()=>M,len:()=>K,length:()=>a,lerp:()=>k,max:()=>v,min:()=>g,mul:()=>X,multiply:()=>d,negate:()=>E,normalize:()=>A,random:()=>P,rotateX:()=>D,rotateY:()=>z,rotateZ:()=>F,round:()=>y,scale:()=>b,scaleAndAdd:()=>x,set:()=>l,sqrDist:()=>$,sqrLen:()=>Z,squaredDistance:()=>_,squaredLength:()=>S,str:()=>j,sub:()=>W,subtract:()=>h,transformMat3:()=>L,transformMat4:()=>O,transformQuat:()=>R,zero:()=>U});var r=n(17823);function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=new r.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function s(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function l(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function d(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function f(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function v(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function x(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function _(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function S(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function A(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function C(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function T(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function k(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function I(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,l=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*l+i[0]*c,t[1]=e[1]*s+n[1]*u+r[1]*l+i[1]*c,t[2]=e[2]*s+n[2]*u+r[2]*l+i[2]*c,t}function N(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,l=s*a,c=3*o*s,h=3*u*a,d=u*o;return t[0]=e[0]*l+n[0]*c+r[0]*h+i[0]*d,t[1]=e[1]*l+n[1]*c+r[1]*h+i[1]*d,t[2]=e[2]*l+n[2]*c+r[2]*h+i[2]*d,t}function P(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI,i=2*r.RANDOM()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t}function O(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function L(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function R(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],l=e[2],c=i*l-o*u,h=o*s-r*l,d=r*u-i*s,f=i*d-o*h,p=o*c-r*d,m=r*h-i*c,g=2*a;return c*=g,h*=g,d*=g,f*=2,p*=2,m*=2,t[0]=s+c+f,t[1]=u+h+p,t[2]=l+d+m,t}function D(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function z(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function F(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),l=u&&C(t,e)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function U(t){return t[0]=0,t[1]=0,t[2]=0,t}function j(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function H(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}var G,W=h,X=d,Y=f,q=w,$=_,K=a,Z=S,Q=(G=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a{"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e} +/*! + * GSAP 3.12.5 + * https://gsap.com + * + * @license Copyright 2008-2024, GreenSock. All rights reserved. + * Subject to the terms at https://gsap.com/standard-license or for + * Club GSAP members, the agreement issued with that membership. + * @author: Jack Doyle, jack@greensock.com +*/n.d(e,{Ay:()=>Kr,os:()=>Kr});var o,a,s,u,l,c,h,d,f,p,m,g,v,y,b,x,w,_={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},S={duration:.5,overwrite:!1,delay:0},E=1e8,M=1e-8,A=2*Math.PI,C=A/4,T=0,k=Math.sqrt,I=Math.cos,N=Math.sin,P=function(t){return"string"==typeof t},O=function(t){return"function"==typeof t},L=function(t){return"number"==typeof t},R=function(t){return void 0===t},D=function(t){return"object"==typeof t},z=function(t){return!1!==t},F=function(){return"undefined"!=typeof window},B=function(t){return O(t)||P(t)},U="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},j=Array.isArray,V=/(?:-?\.?\d|\.)+/gi,H=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,G=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,W=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,X=/[+-]=-?[.\d]+/,Y=/[^,'"\[\]\s]+/gi,q=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,$={},K={},Z=function(t){return(K=At(t,$))&&Tn},Q=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},J=function(t,e){return!e&&console.warn(t)},tt=function(t,e){return t&&($[t]=e)&&K&&(K[t]=e)||$},et=function(){return 0},nt={suppressEvents:!0,isStart:!0,kill:!1},rt={suppressEvents:!0,kill:!1},it={suppressEvents:!0},ot={},at=[],st={},ut={},lt={},ct=30,ht=[],dt="",ft=function(t){var e,n,r=t[0];if(D(r)||O(r)||(t=[t]),!(e=(r._gsap||{}).harness)){for(n=ht.length;n--&&!ht[n].targetTest(r););e=ht[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new je(t[n],e)))||t.splice(n,1);return t},pt=function(t){return t._gsap||ft(ie(t))[0]._gsap},mt=function(t,e,n){return(n=t[e])&&O(n)?t[e]():R(n)&&t.getAttribute&&t.getAttribute(e)||n},gt=function(t,e){return(t=t.split(",")).forEach(e)||t},vt=function(t){return Math.round(1e5*t)/1e5||0},yt=function(t){return Math.round(1e7*t)/1e7||0},bt=function(t,e){var n=e.charAt(0),r=parseFloat(e.substr(2));return t=parseFloat(t),"+"===n?t+r:"-"===n?t-r:"*"===n?t*r:t/r},xt=function(t,e){for(var n=e.length,r=0;t.indexOf(e[r])<0&&++ro;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[r]=e,e._prev=a,e.parent=e._dp=t,e},Nt=function(t,e,n,r){void 0===n&&(n="_first"),void 0===r&&(r="_last");var i=e._prev,o=e._next;i?i._next=o:t[n]===e&&(t[n]=o),o?o._prev=i:t[r]===e&&(t[r]=i),e._next=e._prev=e.parent=null},Pt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Ot=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},Lt=function(t,e,n,r){return t._startAt&&(a?t._startAt.revert(rt):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},Rt=function t(e){return!e||e._ts&&t(e.parent)},Dt=function(t){return t._repeat?zt(t._tTime,t=t.duration()+t._rDelay)*t:0},zt=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},Ft=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Bt=function(t){return t._end=yt(t._start+(t._tDur/Math.abs(t._ts||t._rts||M)||0))},Ut=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=yt(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Bt(t),n._dirty||Ot(n,t)),t},jt=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._startM)&&e.render(n,!0)),Ot(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-1e-8}},Vt=function(t,e,n,r){return e.parent&&Pt(e),e._start=yt((L(n)?n:n||t!==u?Kt(t,n,e):t._time)+e._delay),e._end=yt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),It(t,e,"_first","_last",t._sort?"_start":0),Xt(e)||(t._recent=e),r||jt(t,e),t._ts<0&&Ut(t,t._tTime),t},Ht=function(t,e){return($.ScrollTrigger||Q("scrollTrigger",e))&&$.ScrollTrigger.create(e,t)},Gt=function(t,e,n,r,i){return $e(t,e,i),t._initted?!n&&t._pt&&!a&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==Te.frame?(at.push(t),t._lazy=[i,r],1):void 0:1},Wt=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},Xt=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},Yt=function(t,e,n,r){var i=t._repeat,o=yt(e)||0,a=t._tTime/t._tDur;return a&&!r&&(t._time*=o/t._dur),t._dur=o,t._tDur=i?i<0?1e10:yt(o*(i+1)+t._rDelay*i):o,a>0&&!r&&Ut(t,t._tTime=t._tDur*a),t.parent&&Bt(t),n||Ot(t.parent,t),t},qt=function(t){return t instanceof He?Ot(t):Yt(t,t._dur)},$t={_start:0,endTime:et,totalDuration:et},Kt=function t(e,n,r){var i,o,a,s=e.labels,u=e._recent||$t,l=e.duration()>=E?u.endTime(!1):e._dur;return P(n)&&(isNaN(n)||n in s)?(o=n.charAt(0),a="%"===n.substr(-1),i=n.indexOf("="),"<"===o||">"===o?(i>=0&&(n=n.replace(/=/,"")),("<"===o?u._start:u.endTime(u._repeat>=0))+(parseFloat(n.substr(1))||0)*(a?(i<0?u:r).totalDuration()/100:1)):i<0?(n in s||(s[n]=l),s[n]):(o=parseFloat(n.charAt(i-1)+n.substr(i+1)),a&&r&&(o=o/100*(j(r)?r[0]:r).totalDuration()),i>1?t(e,n.substr(0,i-1),r)+o:l+o)):null==n?l:+n},Zt=function(t,e,n){var r,i,o=L(e[1]),a=(o?2:1)+(t<2?0:1),s=e[a];if(o&&(s.duration=e[1]),s.parent=n,t){for(r=s,i=n;i&&!("immediateRender"in r);)r=i.vars.defaults||{},i=z(i.vars.inherit)&&i.parent;s.immediateRender=z(r.immediateRender),t<2?s.runBackwards=1:s.startAt=e[a-1]}return new tn(e[0],s,e[a+1])},Qt=function(t,e){return t||0===t?e(t):e},Jt=function(t,e,n){return ne?e:n},te=function(t,e){return P(t)&&(e=q.exec(t))?e[1]:""},ee=[].slice,ne=function(t,e){return t&&D(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&D(t[0]))&&!t.nodeType&&t!==l},re=function(t,e,n){return void 0===n&&(n=[]),t.forEach((function(t){var r;return P(t)&&!e||ne(t,1)?(r=n).push.apply(r,ie(t)):n.push(t)}))||n},ie=function(t,e,n){return s&&!e&&s.selector?s.selector(t):!P(t)||n||!c&&ke()?j(t)?re(t,n):ne(t)?ee.call(t,0):t?[t]:[]:ee.call((e||h).querySelectorAll(t),0)},oe=function(t){return t=ie(t)[0]||J("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return ie(e,n.querySelectorAll?n:n===t?J("Invalid scope")||h.createElement("div"):t)}},ae=function(t){return t.sort((function(){return.5-Math.random()}))},se=function(t){if(O(t))return t;var e=D(t)?t:{each:t},n=De(e.ease),r=e.from||0,i=parseFloat(e.base)||0,o={},a=r>0&&r<1,s=isNaN(r)||a,u=e.axis,l=r,c=r;return P(r)?l=c={center:.5,edges:.5,end:1}[r]||0:!a&&s&&(l=r[0],c=r[1]),function(t,a,h){var d,f,p,m,g,v,y,b,x,w=(h||e).length,_=o[w];if(!_){if(!(x="auto"===e.grid?0:(e.grid||[1,E])[1])){for(y=-E;y<(y=h[x++].getBoundingClientRect().left)&&xy&&(y=g),gw?w-1:u?"y"===u?w/x:x:Math.max(x,w/x))||0)*("edges"===r?-1:1),_.b=w<0?i-w:i,_.u=te(e.amount||e.each)||0,n=n&&w<0?Le(n):n}return w=(_[t]-_.min)/_.max||0,yt(_.b+(n?n(w):w)*_.v)+_.u}},ue=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var r=yt(Math.round(parseFloat(n)/t)*t*e);return(r-r%1)/e+(L(n)?0:te(n))}},le=function(t,e){var n,r,i=j(t);return!i&&D(t)&&(n=i=t.radius||E,t.values?(t=ie(t.values),(r=!L(t[0]))&&(n*=n)):t=ue(t.increment)),Qt(e,i?O(t)?function(e){return r=t(e),Math.abs(r-e)<=n?r:e}:function(e){for(var i,o,a=parseFloat(r?e.x:e),s=parseFloat(r?e.y:0),u=E,l=0,c=t.length;c--;)(i=r?(i=t[c].x-a)*i+(o=t[c].y-s)*o:Math.abs(t[c]-a))(i=Math.abs(i))&&(o=r,s=i);return o},me=function(t,e,n){var r,i,o,a=t.vars,u=a[e],l=s,c=t._ctx;if(u)return r=a[e+"Params"],i=a.callbackScope||t,n&&at.length&&wt(),c&&(s=c),o=r?u.apply(i,r):u.call(i),s=l,o},ge=function(t){return Pt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!a),t.progress()<1&&me(t,"onInterrupt"),t},ve=[],ye=function(t){if(t)if(t=!t.name&&t.default||t,F()||t.headless){var e=t.name,n=O(t),r=e&&!n&&t.init?function(){this._props=[]}:t,i={init:et,render:cn,add:Ye,kill:dn,modifier:hn,rawVars:0},o={targetTest:0,get:0,getSetter:an,aliases:{},register:0};if(ke(),t!==r){if(ut[e])return;Mt(r,Mt(Tt(t,i),o)),At(r.prototype,At(i,Tt(t,o))),ut[r.prop=e]=r,t.targetTest&&(ht.push(r),ot[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}tt(e,r),t.register&&t.register(Tn,r,mn)}else ve.push(t)},be=255,xe={aqua:[0,be,be],lime:[0,be,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,be],navy:[0,0,128],white:[be,be,be],olive:[128,128,0],yellow:[be,be,0],orange:[be,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[be,0,0],pink:[be,192,203],cyan:[0,be,be],transparent:[be,be,be,0]},we=function(t,e,n){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(n-e)*t*6:t<.5?n:3*t<2?e+(n-e)*(2/3-t)*6:e)*be+.5|0},_e=function(t,e,n){var r,i,o,a,s,u,l,c,h,d,f=t?L(t)?[t>>16,t>>8&be,t&be]:0:xe.black;if(!f){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),xe[t])f=xe[t];else if("#"===t.charAt(0)){if(t.length<6&&(r=t.charAt(1),i=t.charAt(2),o=t.charAt(3),t="#"+r+r+i+i+o+o+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(f=parseInt(t.substr(1,6),16))>>16,f>>8&be,f&be,parseInt(t.substr(7),16)/255];f=[(t=parseInt(t.substr(1),16))>>16,t>>8&be,t&be]}else if("hsl"===t.substr(0,3))if(f=d=t.match(V),e){if(~t.indexOf("="))return f=t.match(H),n&&f.length<4&&(f[3]=1),f}else a=+f[0]%360/360,s=+f[1]/100,r=2*(u=+f[2]/100)-(i=u<=.5?u*(s+1):u+s-u*s),f.length>3&&(f[3]*=1),f[0]=we(a+1/3,r,i),f[1]=we(a,r,i),f[2]=we(a-1/3,r,i);else f=t.match(V)||xe.transparent;f=f.map(Number)}return e&&!d&&(r=f[0]/be,i=f[1]/be,o=f[2]/be,u=((l=Math.max(r,i,o))+(c=Math.min(r,i,o)))/2,l===c?a=s=0:(h=l-c,s=u>.5?h/(2-l-c):h/(l+c),a=l===r?(i-o)/h+(is||b<0)&&(f+=b-u),((c=(d=(p+=b)-f)-v)>0||x)&&(m=++r.frame,i=d-1e3*r.time,r.time=d/=1e3,v+=c+(c>=g?4:g-c),h=1),x||(t=e(n)),h)for(o=0;o=e&&o--},_listeners:y}}(),ke=function(){return!m&&Te.wake()},Ie={},Ne=/^[\d.\-M][\d.\-,\s]/,Pe=/["']/g,Oe=function(t){for(var e,n,r,i={},o=t.substr(1,t.length-3).split(":"),a=o[0],s=1,u=o.length;s1&&a.config?a.config.apply(null,~t.indexOf("{")?[Oe(o[1])]:(e=t,n=e.indexOf("(")+1,r=e.indexOf(")"),i=e.indexOf("(",n),e.substring(n,~i&&i=1?n:1,o=(r||(e?.3:.45))/(n<1?n:1),a=o/A*(Math.asin(1/i)||0),s=function(t){return 1===t?1:i*Math.pow(2,-10*t)*N((t-a)*o)+1},u="out"===e?s:"in"===e?function(t){return 1-s(1-t)}:Fe(s);return o=A/o,u.config=function(n,r){return t(e,n,r)},u},Ue=function t(e,n){void 0===n&&(n=1.70158);var r=function(t){return t?--t*t*((n+1)*t+n)+1:0},i="out"===e?r:"in"===e?function(t){return 1-r(1-t)}:Fe(r);return i.config=function(n){return t(e,n)},i};gt("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var n=e<5?e+1:e;ze(t+",Power"+(n-1),e?function(t){return Math.pow(t,n)}:function(t){return t},(function(t){return 1-Math.pow(1-t,n)}),(function(t){return t<.5?Math.pow(2*t,n)/2:1-Math.pow(2*(1-t),n)/2}))})),Ie.Linear.easeNone=Ie.none=Ie.Linear.easeIn,ze("Elastic",Be("in"),Be("out"),Be()),g=7.5625,b=2*(y=1/(v=2.75)),x=2.5*y,ze("Bounce",(function(t){return 1-w(1-t)}),w=function(t){return t0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Yt(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(ke(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Ut(this,t),!n._dp||n.parent||jt(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t0||!this._tDur&&!t)&&Vt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===M||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),_t(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Dt(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Dt(this),e):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,e){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*n,e):this._repeat?zt(this._tTime,n)+1:1},e.timeScale=function(t,e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var n=this.parent&&this._ts?Ft(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(Jt(-Math.abs(this._delay),this._tDur,n),!1!==e),Bt(this),function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ke(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==M&&(this._tTime-=M)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Vt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(z(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ft(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=it);var e=a;return a=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),a=e,this},e.globalTime=function(t){for(var e=this,n=arguments.length?t:e.rawTime();e;)n=e._start+n/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):n},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,qt(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,qt(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(Kt(this,t),z(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,z(e))},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,n=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=n&&t1?(e?(r[t]=e,n&&(r[t+"Params"]=n),"onUpdate"===t&&(this._onUpdate=e)):delete r[t],this):r[t]},e.then=function(t){var e=this;return new Promise((function(n){var r=O(t)?t:Et,i=function(){var t=e.then;e.then=null,O(r)&&(r=r(e))&&(r.then||r===e)&&(e.then=t),n(r),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?i():e._prom=i}))},e.kill=function(){ge(this)},t}();Mt(Ve.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var He=function(t){function e(e,n){var i;return void 0===e&&(e={}),(i=t.call(this,e)||this).labels={},i.smoothChildTiming=!!e.smoothChildTiming,i.autoRemoveChildren=!!e.autoRemoveChildren,i._sort=z(e.sortChildren),u&&Vt(e.parent||u,r(i),n),e.reversed&&i.reverse(),e.paused&&i.paused(!0),e.scrollTrigger&&Ht(r(i),e.scrollTrigger),i}i(e,t);var n=e.prototype;return n.to=function(t,e,n){return Zt(0,arguments,this),this},n.from=function(t,e,n){return Zt(1,arguments,this),this},n.fromTo=function(t,e,n,r){return Zt(2,arguments,this),this},n.set=function(t,e,n){return e.duration=0,e.parent=this,kt(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new tn(t,e,Kt(this,n),1),this},n.call=function(t,e,n){return Vt(this,tn.delayedCall(0,t,e),n)},n.staggerTo=function(t,e,n,r,i,o,a){return n.duration=e,n.stagger=n.stagger||r,n.onComplete=o,n.onCompleteParams=a,n.parent=this,new tn(t,n,Kt(this,i)),this},n.staggerFrom=function(t,e,n,r,i,o,a){return n.runBackwards=1,kt(n).immediateRender=z(n.immediateRender),this.staggerTo(t,e,n,r,i,o,a)},n.staggerFromTo=function(t,e,n,r,i,o,a,s){return r.startAt=n,kt(r).immediateRender=z(r.immediateRender),this.staggerTo(t,e,r,i,o,a,s)},n.render=function(t,e,n){var r,i,o,s,l,c,h,d,f,p,m,g,v=this._time,y=this._dirty?this.totalDuration():this._tDur,b=this._dur,x=t<=0?0:yt(t),w=this._zTime<0!=t<0&&(this._initted||!b);if(this!==u&&x>y&&t>=0&&(x=y),x!==this._tTime||n||w){if(v!==this._time&&b&&(x+=this._time-v,t+=this._time-v),r=x,f=this._start,c=!(d=this._ts),w&&(b||(v=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(m=this._yoyo,l=b+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*l+t,e,n);if(r=yt(x%l),x===y?(s=this._repeat,r=b):((s=~~(x/l))&&s===x/l&&(r=b,s--),r>b&&(r=b)),p=zt(this._tTime,l),!v&&this._tTime&&p!==s&&this._tTime-p*l-this._dur<=0&&(p=s),m&&1&s&&(r=b-r,g=1),s!==p&&!this._lock){var _=m&&1&p,S=_===(m&&1&s);if(se)for(r=t._first;r&&r._start<=n;){if("isPause"===r.data&&r._start>e)return r;r=r._next}else for(r=t._last;r&&r._start>=n;){if("isPause"===r.data&&r._start=v&&t>=0)for(i=this._first;i;){if(o=i._next,(i._act||r>=i._start)&&i._ts&&h!==i){if(i.parent!==this)return this.render(t,e,n);if(i.render(i._ts>0?(r-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(r-i._start)*i._ts,e,n),r!==this._time||!this._ts&&!c){h=0,o&&(x+=this._zTime=-1e-8);break}}i=o}else{i=this._last;for(var E=t<0?t:r;i;){if(o=i._prev,(i._act||E<=i._end)&&i._ts&&h!==i){if(i.parent!==this)return this.render(t,e,n);if(i.render(i._ts>0?(E-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(E-i._start)*i._ts,e,n||a&&(i._initted||i._startAt)),r!==this._time||!this._ts&&!c){h=0,o&&(x+=this._zTime=E?-1e-8:M);break}}i=o}}if(h&&!e&&(this.pause(),h.render(r>=v?0:-1e-8)._zTime=r>=v?1:-1,this._ts))return this._start=f,Bt(this),this.render(t,e,n);this._onUpdate&&!e&&me(this,"onUpdate",!0),(x===y&&this._tTime>=this.totalDuration()||!x&&v)&&(f!==this._start&&Math.abs(d)===Math.abs(this._ts)||this._lock||((t||!b)&&(x===y&&this._ts>0||!x&&this._ts<0)&&Pt(this,1),e||t<0&&!v||!x&&!v&&y||(me(this,x===y&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(x0)&&this._prom())))}return this},n.add=function(t,e){var n=this;if(L(e)||(e=Kt(this,e,t)),!(t instanceof Ve)){if(j(t))return t.forEach((function(t){return n.add(t,e)})),this;if(P(t))return this.addLabel(t,e);if(!O(t))return this;t=tn.delayedCall(0,t)}return this!==t?Vt(this,t,e):this},n.getChildren=function(t,e,n,r){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===n&&(n=!0),void 0===r&&(r=-E);for(var i=[],o=this._first;o;)o._start>=r&&(o instanceof tn?e&&i.push(o):(n&&i.push(o),t&&i.push.apply(i,o.getChildren(!0,e,n)))),o=o._next;return i},n.getById=function(t){for(var e=this.getChildren(1,1,1),n=e.length;n--;)if(e[n].vars.id===t)return e[n]},n.remove=function(t){return P(t)?this.removeLabel(t):O(t)?this.killTweensOf(t):(Nt(this,t),t===this._recent&&(this._recent=this._last),Ot(this))},n.totalTime=function(e,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=yt(Te.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,n),this._forcing=0,this):this._tTime},n.addLabel=function(t,e){return this.labels[t]=Kt(this,e),this},n.removeLabel=function(t){return delete this.labels[t],this},n.addPause=function(t,e,n){var r=tn.delayedCall(0,e||et,n);return r.data="isPause",this._hasPause=1,Vt(this,r,Kt(this,t))},n.removePause=function(t){var e=this._first;for(t=Kt(this,t);e;)e._start===t&&"isPause"===e.data&&Pt(e),e=e._next},n.killTweensOf=function(t,e,n){for(var r=this.getTweensOf(t,n),i=r.length;i--;)Ge!==r[i]&&r[i].kill(t,e);return this},n.getTweensOf=function(t,e){for(var n,r=[],i=ie(t),o=this._first,a=L(e);o;)o instanceof tn?xt(o._targets,i)&&(a?(!Ge||o._initted&&o._ts)&&o.globalTime(0)<=e&&o.globalTime(o.totalDuration())>e:!e||o.isActive())&&r.push(o):(n=o.getTweensOf(i,e)).length&&r.push.apply(r,n),o=o._next;return r},n.tweenTo=function(t,e){e=e||{};var n,r=this,i=Kt(r,t),o=e,a=o.startAt,s=o.onStart,u=o.onStartParams,l=o.immediateRender,c=tn.to(r,Mt({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:e.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale())||M,onStart:function(){if(r.pause(),!n){var t=e.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale());c._dur!==t&&Yt(c,t,0,1).render(c._time,!0,!0),n=1}s&&s.apply(c,u||[])}},e));return l?c.render(0):c},n.tweenFromTo=function(t,e,n){return this.tweenTo(e,Mt({startAt:{time:Kt(this,t)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(t){return void 0===t&&(t=this._time),pe(this,Kt(this,t))},n.previousLabel=function(t){return void 0===t&&(t=this._time),pe(this,Kt(this,t),1)},n.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+M)},n.shiftChildren=function(t,e,n){void 0===n&&(n=0);for(var r,i=this._first,o=this.labels;i;)i._start>=n&&(i._start+=t,i._end+=t),i=i._next;if(e)for(r in o)o[r]>=n&&(o[r]+=t);return Ot(this)},n.invalidate=function(e){var n=this._first;for(this._lock=0;n;)n.invalidate(e),n=n._next;return t.prototype.invalidate.call(this,e)},n.clear=function(t){void 0===t&&(t=!0);for(var e,n=this._first;n;)e=n._next,this.remove(n),n=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Ot(this)},n.totalDuration=function(t){var e,n,r,i=0,o=this,a=o._last,s=E;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-t:t));if(o._dirty){for(r=o.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),(n=a._start)>s&&o._sort&&a._ts&&!o._lock?(o._lock=1,Vt(o,a,n-a._delay,1)._lock=0):s=n,n<0&&a._ts&&(i-=n,(!r&&!o._dp||r&&r.smoothChildTiming)&&(o._start+=n/o._ts,o._time-=n,o._tTime-=n),o.shiftChildren(-n,!1,-Infinity),s=0),a._end>i&&a._ts&&(i=a._end),a=e;Yt(o,o===u&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(t){if(u._ts&&(_t(u,Ft(t,u)),f=Te.frame),Te.frame>=ct){ct+=_.autoSleep||120;var e=u._first;if((!e||!e._ts)&&_.autoSleep&&Te._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Te.sleep()}}},e}(Ve);Mt(He.prototype,{_lock:0,_hasPause:0,_forcing:0});var Ge,We,Xe=function(t,e,n,r,i,o,a){var s,u,l,c,h,d,f,p,m=new mn(this._pt,t,e,0,1,ln,null,i),g=0,v=0;for(m.b=n,m.e=r,n+="",(f=~(r+="").indexOf("random("))&&(r=de(r)),o&&(o(p=[n,r],t,e),n=p[0],r=p[1]),u=n.match(W)||[];s=W.exec(r);)c=s[0],h=r.substring(g,s.index),l?l=(l+1)%5:"rgba("===h.substr(-5)&&(l=1),c!==u[v++]&&(d=parseFloat(u[v-1])||0,m._pt={_next:m._pt,p:h||1===v?h:",",s:d,c:"="===c.charAt(1)?bt(d,c)-d:parseFloat(c)-d,m:l&&l<4?Math.round:0},g=W.lastIndex);return m.c=g")})),l.duration();else{for(f in h={},E)"ease"===f||"easeEach"===f||Ke(f,E[f],h,E.easeEach);for(f in h)for(I=h[f].sort((function(t,e){return t.t-e.t})),O=0,c=0;cp-M&&!g?p:tm&&(r=m)),(l=this._yoyo&&1&o)&&(d=this._yEase,r=m-r),u=zt(this._tTime,s),r===f&&!n&&this._initted&&o===u)return this._tTime=v,this;o!==u&&(h&&this._yEase&&Re(h,l),this.vars.repeatRefresh&&!l&&!this._lock&&this._time!==s&&this._initted&&(this._lock=n=1,this.render(yt(s*o),!0).invalidate()._lock=0))}if(!this._initted){if(Gt(this,g?t:r,n,e,v))return this._tTime=0,this;if(!(f===this._time||n&&this.vars.repeatRefresh&&o!==u))return this;if(m!==this._dur)return this.render(t,e,n)}if(this._tTime=v,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(d||this._ease)(r/m),this._from&&(this.ratio=c=1-c),r&&!f&&!e&&!o&&(me(this,"onStart"),this._tTime!==v))return this;for(i=this._pt;i;)i.r(c,i.d),i=i._next;h&&h.render(t<0?t:h._dur*h._ease(r/this._dur),e,n)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(g&&Lt(this,t,0,n),me(this,"onUpdate")),this._repeat&&o!==u&&this.vars.onRepeat&&!e&&this.parent&&me(this,"onRepeat"),v!==this._tDur&&v||this._tTime!==v||(g&&!this._onUpdate&&Lt(this,t,0,!0),(t||!m)&&(v===this._tDur&&this._ts>0||!v&&this._ts<0)&&Pt(this,1),e||g&&!f||!(v||f||l)||(me(this,v===p?"onComplete":"onReverseComplete",!0),this._prom&&!(v0)&&this._prom()))}}else!function(t,e,n,r){var i,o,s,u=t.ratio,l=e<0||!e&&(!t._start&&Wt(t)&&(t._initted||!Xt(t))||(t._ts<0||t._dp._ts<0)&&!Xt(t))?0:1,c=t._rDelay,h=0;if(c&&t._repeat&&(h=Jt(0,t._tDur,e),o=zt(h,c),t._yoyo&&1&o&&(l=1-l),o!==zt(t._tTime,c)&&(u=1-l,t.vars.repeatRefresh&&t._initted&&t.invalidate())),l!==u||a||r||t._zTime===M||!e&&t._zTime){if(!t._initted&&Gt(t,e,r,n,h))return;for(s=t._zTime,t._zTime=e||(n?M:0),n||(n=e&&!s),t.ratio=l,t._from&&(l=1-l),t._time=0,t._tTime=h,i=t._pt;i;)i.r(l,i.d),i=i._next;e<0&&Lt(t,e,0,!0),t._onUpdate&&!n&&me(t,"onUpdate"),h&&t._repeat&&!n&&t.parent&&me(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===l&&(l&&Pt(t,1),n||a||(me(t,l?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,n);return this},n.targets=function(){return this._targets},n.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},n.resetTo=function(t,e,n,r,i){m||Te.wake(),this._ts||this.play();var o=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||$e(this,o),function(t,e,n,r,i,o,a,s){var u,l,c,h,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],c=t._ptLookup,h=t._targets.length;h--;){if((u=c[h][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return We=1,t.vars[e]="+=0",$e(t,a),We=0,s?J(e+" not eligible for reset"):1;d.push(u)}for(h=d.length;h--;)(u=(l=d[h])._pt||l).s=!r&&0!==r||i?u.s+(r||0)+o*u.c:r,u.c=n-u.s,l.e&&(l.e=vt(n)+te(l.e)),l.b&&(l.b=u.s+te(l.b))}(this,t,e,n,r,this._ease(o/this._dur),o,i)?this.resetTo(t,e,n,r,1):(Ut(this,0),this.parent||It(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?ge(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Ge&&!0!==Ge.vars.overwrite)._first||ge(this),this.parent&&n!==this.timeline.totalDuration()&&Yt(this,this._dur*this.timeline._tDur/n,0,1),this}var r,i,o,a,s,u,l,c=this._targets,h=t?ie(t):c,d=this._ptLookup,f=this._pt;if((!e||"all"===e)&&function(t,e){for(var n=t.length,r=n===e.length;r&&n--&&t[n]===e[n];);return n<0}(c,h))return"all"===e&&(this._pt=0),ge(this);for(r=this._op=this._op||[],"all"!==e&&(P(e)&&(s={},gt(e,(function(t){return s[t]=1})),e=s),e=function(t,e){var n,r,i,o,a=t[0]?pt(t[0]).harness:0,s=a&&a.aliases;if(!s)return e;for(r in n=At({},e),s)if(r in n)for(i=(o=s[r].split(",")).length;i--;)n[o[i]]=n[r];return n}(c,e)),l=c.length;l--;)if(~h.indexOf(c[l]))for(s in i=d[l],"all"===e?(r[l]=e,a=i,o={}):(o=r[l]=r[l]||{},a=e),a)(u=i&&i[s])&&("kill"in u.d&&!0!==u.d.kill(s)||Nt(this,u,"_pt"),delete i[s]),"all"!==o&&(o[s]=1);return this._initted&&!this._pt&&f&&ge(this),this},e.to=function(t,n){return new e(t,n,arguments[2])},e.from=function(t,e){return Zt(1,arguments)},e.delayedCall=function(t,n,r,i){return new e(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},e.fromTo=function(t,e,n){return Zt(2,arguments)},e.set=function(t,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new e(t,n)},e.killTweensOf=function(t,e,n){return u.killTweensOf(t,e,n)},e}(Ve);Mt(tn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),gt("staggerTo,staggerFrom,staggerFromTo",(function(t){tn[t]=function(){var e=new He,n=ee.call(arguments,0);return n.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,n)}}));var en=function(t,e,n){return t[e]=n},nn=function(t,e,n){return t[e](n)},rn=function(t,e,n,r){return t[e](r.fp,n)},on=function(t,e,n){return t.setAttribute(e,n)},an=function(t,e){return O(t[e])?nn:R(t[e])&&t.setAttribute?on:en},sn=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},un=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ln=function(t,e){var n=e._pt,r="";if(!t&&e.b)r=e.b;else if(1===t&&e.e)r=e.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*t):Math.round(1e4*(n.s+n.c*t))/1e4)+r,n=n._next;r+=e.c}e.set(e.t,e.p,r,e)},cn=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},hn=function(t,e,n,r){for(var i,o=this._pt;o;)i=o._next,o.p===r&&o.modifier(t,e,n),o=i},dn=function(t){for(var e,n,r=this._pt;r;)n=r._next,r.p===t&&!r.op||r.op===t?Nt(this,r,"_pt"):r.dep||(e=1),r=n;return!e},fn=function(t,e,n,r){r.mSet(t,e,r.m.call(r.tween,n,r.mt),r)},pn=function(t){for(var e,n,r,i,o=t._pt;o;){for(e=o._next,n=r;n&&n.pr>o.pr;)n=n._next;(o._prev=n?n._prev:i)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:i=o,o=e}t._pt=r},mn=function(){function t(t,e,n,r,i,o,a,s,u){this.t=e,this.s=r,this.c=i,this.p=n,this.r=o||sn,this.d=a||this,this.set=s||en,this.pr=u||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,n){this.mSet=this.mSet||this.set,this.set=fn,this.m=t,this.mt=n,this.tween=e},t}();gt(dt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return ot[t]=1})),$.TweenMax=$.TweenLite=tn,$.TimelineLite=$.TimelineMax=He,u=new He({sortChildren:!1,defaults:S,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),_.stringFilter=Ce;var gn=[],vn={},yn=[],bn=0,xn=0,wn=function(t){return(vn[t]||yn).map((function(t){return t()}))},_n=function(){var t=Date.now(),e=[];t-bn>2&&(wn("matchMediaInit"),gn.forEach((function(t){var n,r,i,o,a=t.queries,s=t.conditions;for(r in a)(n=l.matchMedia(a[r]).matches)&&(i=1),n!==s[r]&&(s[r]=n,o=1);o&&(t.revert(),i&&e.push(t))})),wn("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t,(function(e){return t.add(null,e)}))})),bn=t,wn("matchMedia"))},Sn=function(){function t(t,e){this.selector=e&&oe(e),this.data=[],this._r=[],this.isReverted=!1,this.id=xn++,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,n){O(t)&&(n=e,e=t,t=O);var r=this,i=function(){var t,i=s,o=r.selector;return i&&i!==r&&i.data.push(r),n&&(r.selector=oe(n)),s=r,t=e.apply(r,arguments),O(t)&&r._r.push(t),s=i,r.selector=o,r.isReverted=!1,t};return r.last=i,t===O?i(r,(function(t){return r.add(null,t)})):t?r[t]=i:i},e.ignore=function(t){var e=s;s=null,t(this),s=e},e.getTweens=function(){var e=[];return this.data.forEach((function(n){return n instanceof t?e.push.apply(e,n.getTweens()):n instanceof tn&&!(n.parent&&"nested"===n.parent.data)&&e.push(n)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var n=this;if(t?function(){for(var e,r=n.getTweens(),i=n.data.length;i--;)"isFlip"===(e=n.data[i]).data&&(e.revert(),e.getChildren(!0,!0,!1).forEach((function(t){return r.splice(r.indexOf(t),1)})));for(r.map((function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t}})).sort((function(t,e){return e.g-t.g||-1/0})).forEach((function(e){return e.t.revert(t)})),i=n.data.length;i--;)(e=n.data[i])instanceof He?"nested"!==e.data&&(e.scrollTrigger&&e.scrollTrigger.revert(),e.kill()):!(e instanceof tn)&&e.revert&&e.revert(t);n._r.forEach((function(e){return e(t,n)})),n.isReverted=!0}():this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e)for(var r=gn.length;r--;)gn[r].id===this.id&&gn.splice(r,1)},e.revert=function(t){this.kill(t||{})},t}(),En=function(){function t(t){this.contexts=[],this.scope=t,s&&s.data.push(this)}var e=t.prototype;return e.add=function(t,e,n){D(t)||(t={matches:t});var r,i,o,a=new Sn(0,n||this.scope),u=a.conditions={};for(i in s&&!a.selector&&(a.selector=s.selector),this.contexts.push(a),e=a.add("onMatch",e),a.queries=t,t)"all"===i?o=1:(r=l.matchMedia(t[i]))&&(gn.indexOf(a)<0&&gn.push(a),(u[i]=r.matches)&&(o=1),r.addListener?r.addListener(_n):r.addEventListener("change",_n));return o&&e(a,(function(t){return a.add(null,t)})),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Mn={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n1){var r=t.map((function(t){return Tn.quickSetter(t,e,n)})),i=r.length;return function(t){for(var e=i;e--;)r[e](t)}}t=t[0]||{};var o=ut[e],a=pt(t),s=a.harness&&(a.harness.aliases||{})[e]||e,u=o?function(e){var r=new o;p._pt=0,r.init(t,n?e+n:e,p,0,[t]),r.render(1,r),p._pt&&cn(1,p)}:a.set(t,s);return o?u:function(e){return u(t,s,n?e+n:e,a,1)}},quickTo:function(t,e,n){var r,i=Tn.to(t,At(((r={})[e]="+=0.1",r.paused=!0,r),n||{})),o=function(t,n,r){return i.resetTo(e,t,n,r)};return o.tween=i,o},isTweening:function(t){return u.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=De(t.ease,S.ease)),Ct(S,t||{})},config:function(t){return Ct(_,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,r=t.plugins,i=t.defaults,o=t.extendTimeline;(r||"").split(",").forEach((function(t){return t&&!ut[t]&&!$[t]&&J(e+" effect requires "+t+" plugin.")})),lt[e]=function(t,e,r){return n(ie(t),Mt(e||{},i),r)},o&&(He.prototype[e]=function(t,n,r){return this.add(lt[e](t,D(n)?n:(r=n)&&{},this),r)})},registerEase:function(t,e){Ie[t]=De(e)},parseEase:function(t,e){return arguments.length?De(t,e):Ie},getById:function(t){return u.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var n,r,i=new He(t);for(i.smoothChildTiming=z(t.smoothChildTiming),u.remove(i),i._dp=0,i._time=i._tTime=u._time,n=u._first;n;)r=n._next,!e&&!n._dur&&n instanceof tn&&n.vars.onComplete===n._targets[0]||Vt(i,n,n._start-n._delay),n=r;return Vt(u,i,0),i},context:function(t,e){return t?new Sn(t,e):s},matchMedia:function(t){return new En(t)},matchMediaRefresh:function(){return gn.forEach((function(t){var e,n,r=t.conditions;for(n in r)r[n]&&(r[n]=!1,e=1);e&&t.revert()}))||_n()},addEventListener:function(t,e){var n=vn[t]||(vn[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=vn[t],r=n&&n.indexOf(e);r>=0&&n.splice(r,1)},utils:{wrap:function t(e,n,r){var i=n-e;return j(e)?he(e,t(0,e.length),n):Qt(r,(function(t){return(i+(t-e)%i)%i+e}))},wrapYoyo:function t(e,n,r){var i=n-e,o=2*i;return j(e)?he(e,t(0,e.length-1),n):Qt(r,(function(t){return e+((t=(o+(t-e)%o)%o||0)>i?o-t:t)}))},distribute:se,random:ce,snap:le,normalize:function(t,e,n){return fe(t,e,0,1,n)},getUnit:te,clamp:function(t,e,n){return Qt(n,(function(n){return Jt(t,e,n)}))},splitColor:_e,toArray:ie,selector:oe,mapRange:fe,pipe:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(ir,n,"")),e=rr}(o||n)&&this.props.push(e,n,o[e])},ar=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},sr=function(){var t,e,n=this.props,r=this.target,i=r.style,o=r._gsap;for(t=0;t=0?hr[i]:"")+t},fr=function(){"undefined"!=typeof window&&window.document&&(kn=window,In=kn.document,Nn=In.documentElement,On=lr("div")||{style:{}},lr("div"),rr=dr(rr),ir=rr+"Origin",On.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Dn=!!dr("perspective"),Rn=Tn.core.reverting,Pn=1)},pr=function t(e){var n,r=lr("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,a=this.style.cssText;if(Nn.appendChild(r),r.appendChild(this),this.style.display="block",e)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(n=this._gsapBBox());return i&&(o?i.insertBefore(this,o):i.appendChild(this)),Nn.removeChild(r),this.style.cssText=a,n},mr=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},gr=function(t){var e;try{e=t.getBBox()}catch(n){e=pr.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===pr||(e=pr.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+mr(t,["x","cx","x1"])||0,y:+mr(t,["y","cy","y1"])||0,width:0,height:0}},vr=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!gr(t))},yr=function(t,e){if(e){var n,r=t.style;e in zn&&e!==ir&&(e=rr),r.removeProperty?("ms"!==(n=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),r.removeProperty("--"===n?e:e.replace(jn,"-$1").toLowerCase())):r.removeAttribute(e)}},br=function(t,e,n,r,i,o){var a=new mn(t._pt,e,n,0,1,o?Kn:$n);return t._pt=a,a.b=r,a.e=i,t._props.push(n),a},xr={deg:1,rad:1,turn:1},wr={grid:1,flex:1},_r=function t(e,n,r,i){var o,a,s,u,l=parseFloat(r)||0,c=(r+"").trim().substr((l+"").length)||"px",h=On.style,d=Vn.test(n),f="svg"===e.tagName.toLowerCase(),p=(f?"client":"offset")+(d?"Width":"Height"),m=100,g="px"===i,v="%"===i;if(i===c||!l||xr[i]||xr[c])return l;if("px"!==c&&!g&&(l=t(e,n,r,"px")),u=e.getCTM&&vr(e),(v||"%"===c)&&(zn[n]||~n.indexOf("adius")))return o=u?e.getBBox()[d?"width":"height"]:e[p],vt(v?l/o*m:l/100*o);if(h[d?"width":"height"]=m+(g?c:i),a=~n.indexOf("adius")||"em"===i&&e.appendChild&&!f?e:e.parentNode,u&&(a=(e.ownerSVGElement||{}).parentNode),a&&a!==In&&a.appendChild||(a=In.body),(s=a._gsap)&&v&&s.width&&d&&s.time===Te.time&&!s.uncache)return vt(l/s.width*m);if(!v||"height"!==n&&"width"!==n)(v||"%"===c)&&!wr[cr(a,"display")]&&(h.position=cr(e,"position")),a===e&&(h.position="static"),a.appendChild(On),o=On[p],a.removeChild(On),h.position="absolute";else{var y=e.style[n];e.style[n]=m+i,o=e[p],y?e.style[n]=y:yr(e,n)}return d&&v&&((s=pt(a)).time=Te.time,s.width=a[p]),vt(g?o*l/m:o&&l?m/o*l:0)},Sr=function(t,e,n,r){var i;return Pn||fr(),e in Gn&&"transform"!==e&&~(e=Gn[e]).indexOf(",")&&(e=e.split(",")[0]),zn[e]&&"transform"!==e?(i=Lr(t,r),i="transformOrigin"!==e?i[e]:i.svg?i.origin:Rr(cr(t,ir))+" "+i.zOrigin+"px"):(!(i=t.style[e])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=Cr[e]&&Cr[e](t,e,n)||cr(t,e)||mt(t,e)||("opacity"===e?1:0)),n&&!~(i+"").trim().indexOf(" ")?_r(t,e,i,n)+n:i},Er=function(t,e,n,r){if(!n||"none"===n){var i=dr(e,t,1),o=i&&cr(t,i,1);o&&o!==n?(e=i,n=o):"borderColor"===e&&(n=cr(t,"borderTopColor"))}var a,s,u,l,c,h,d,f,p,m,g,v=new mn(this._pt,t.style,e,0,1,ln),y=0,b=0;if(v.b=n,v.e=r,n+="","auto"===(r+="")&&(h=t.style[e],t.style[e]=r,r=cr(t,e)||r,h?t.style[e]=h:yr(t,e)),Ce(a=[n,r]),r=a[1],u=(n=a[0]).match(G)||[],(r.match(G)||[]).length){for(;s=G.exec(r);)d=s[0],p=r.substring(y,s.index),c?c=(c+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(c=1),d!==(h=u[b++]||"")&&(l=parseFloat(h)||0,g=h.substr((l+"").length),"="===d.charAt(1)&&(d=bt(l,d)+g),f=parseFloat(d),m=d.substr((f+"").length),y=G.lastIndex-m.length,m||(m=m||_.units[e]||g,y===r.length&&(r+=m,v.e+=m)),g!==m&&(l=_r(t,e,h,m)||0),v._pt={_next:v._pt,p:p||1===b?p:",",s:l,c:f-l,m:c&&c<4||"zIndex"===e?Math.round:0});v.c=y-1;)n=s[i],zn[n]&&(r=1,n="transformOrigin"===n?ir:rr),yr(o,n);r&&(yr(o,rr),u&&(u.svg&&o.removeAttribute("transform"),Lr(o,1),u.uncache=1,ar(a)))}},Cr={clearProps:function(t,e,n,r,i){if("isFromStart"!==i.data){var o=t._pt=new mn(t._pt,e,n,0,0,Ar);return o.u=r,o.pr=-10,o.tween=i,t._props.push(n),1}}},Tr=[1,0,0,1,0,0],kr={},Ir=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Nr=function(t){var e=cr(t,rr);return Ir(e)?Tr:e.substr(7).match(H).map(vt)},Pr=function(t,e){var n,r,i,o,a=t._gsap||pt(t),s=t.style,u=Nr(t);return a.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?Tr:u:(u!==Tr||t.offsetParent||t===Nn||a.svg||(i=s.display,s.display="block",(n=t.parentNode)&&t.offsetParent||(o=1,r=t.nextElementSibling,Nn.appendChild(t)),u=Nr(t),i?s.display=i:yr(t,"display"),o&&(r?n.insertBefore(t,r):n?n.appendChild(t):Nn.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},Or=function(t,e,n,r,i,o){var a,s,u,l=t._gsap,c=i||Pr(t,!0),h=l.xOrigin||0,d=l.yOrigin||0,f=l.xOffset||0,p=l.yOffset||0,m=c[0],g=c[1],v=c[2],y=c[3],b=c[4],x=c[5],w=e.split(" "),_=parseFloat(w[0])||0,S=parseFloat(w[1])||0;n?c!==Tr&&(s=m*y-g*v)&&(u=_*(-g/s)+S*(m/s)-(m*x-g*b)/s,_=_*(y/s)+S*(-v/s)+(v*x-y*b)/s,S=u):(_=(a=gr(t)).x+(~w[0].indexOf("%")?_/100*a.width:_),S=a.y+(~(w[1]||w[0]).indexOf("%")?S/100*a.height:S)),r||!1!==r&&l.smooth?(b=_-h,x=S-d,l.xOffset=f+(b*m+x*v)-b,l.yOffset=p+(b*g+x*y)-x):l.xOffset=l.yOffset=0,l.xOrigin=_,l.yOrigin=S,l.smooth=!!r,l.origin=e,l.originIsAbsolute=!!n,t.style[ir]="0px 0px",o&&(br(o,l,"xOrigin",h,_),br(o,l,"yOrigin",d,S),br(o,l,"xOffset",f,l.xOffset),br(o,l,"yOffset",p,l.yOffset)),t.setAttribute("data-svg-origin",_+" "+S)},Lr=function(t,e){var n=t._gsap||new je(t);if("x"in n&&!e&&!n.uncache)return n;var r,i,o,a,s,u,l,c,h,d,f,p,m,g,v,y,b,x,w,S,E,M,A,C,T,k,I,N,P,O,L,R,D=t.style,z=n.scaleX<0,F="px",B="deg",U=getComputedStyle(t),j=cr(t,ir)||"0";return r=i=o=u=l=c=h=d=f=0,a=s=1,n.svg=!(!t.getCTM||!vr(t)),U.translate&&("none"===U.translate&&"none"===U.scale&&"none"===U.rotate||(D[rr]=("none"!==U.translate?"translate3d("+(U.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==U.rotate?"rotate("+U.rotate+") ":"")+("none"!==U.scale?"scale("+U.scale.split(" ").join(",")+") ":"")+("none"!==U[rr]?U[rr]:"")),D.scale=D.rotate=D.translate="none"),g=Pr(t,n.svg),n.svg&&(n.uncache?(T=t.getBBox(),j=n.xOrigin-T.x+"px "+(n.yOrigin-T.y)+"px",C=""):C=!e&&t.getAttribute("data-svg-origin"),Or(t,C||j,!!C||n.originIsAbsolute,!1!==n.smooth,g)),p=n.xOrigin||0,m=n.yOrigin||0,g!==Tr&&(x=g[0],w=g[1],S=g[2],E=g[3],r=M=g[4],i=A=g[5],6===g.length?(a=Math.sqrt(x*x+w*w),s=Math.sqrt(E*E+S*S),u=x||w?Un(w,x)*Fn:0,(h=S||E?Un(S,E)*Fn+u:0)&&(s*=Math.abs(Math.cos(h*Bn))),n.svg&&(r-=p-(p*x+m*S),i-=m-(p*w+m*E))):(R=g[6],O=g[7],I=g[8],N=g[9],P=g[10],L=g[11],r=g[12],i=g[13],o=g[14],l=(v=Un(R,P))*Fn,v&&(C=M*(y=Math.cos(-v))+I*(b=Math.sin(-v)),T=A*y+N*b,k=R*y+P*b,I=M*-b+I*y,N=A*-b+N*y,P=R*-b+P*y,L=O*-b+L*y,M=C,A=T,R=k),c=(v=Un(-S,P))*Fn,v&&(y=Math.cos(-v),L=E*(b=Math.sin(-v))+L*y,x=C=x*y-I*b,w=T=w*y-N*b,S=k=S*y-P*b),u=(v=Un(w,x))*Fn,v&&(C=x*(y=Math.cos(v))+w*(b=Math.sin(v)),T=M*y+A*b,w=w*y-x*b,A=A*y-M*b,x=C,M=T),l&&Math.abs(l)+Math.abs(u)>359.9&&(l=u=0,c=180-c),a=vt(Math.sqrt(x*x+w*w+S*S)),s=vt(Math.sqrt(A*A+R*R)),v=Un(M,A),h=Math.abs(v)>2e-4?v*Fn:0,f=L?1/(L<0?-L:L):0),n.svg&&(C=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Ir(cr(t,rr)),C&&t.setAttribute("transform",C))),Math.abs(h)>90&&Math.abs(h)<270&&(z?(a*=-1,h+=u<=0?180:-180,u+=u<=0?180:-180):(s*=-1,h+=h<=0?180:-180)),e=e||n.uncache,n.x=r-((n.xPercent=r&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-r)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+F,n.y=i-((n.yPercent=i&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+F,n.z=o+F,n.scaleX=vt(a),n.scaleY=vt(s),n.rotation=vt(u)+B,n.rotationX=vt(l)+B,n.rotationY=vt(c)+B,n.skewX=h+B,n.skewY=d+B,n.transformPerspective=f+F,(n.zOrigin=parseFloat(j.split(" ")[2])||!e&&n.zOrigin||0)&&(D[ir]=Rr(j)),n.xOffset=n.yOffset=0,n.force3D=_.force3D,n.renderTransform=n.svg?Vr:Dn?jr:zr,n.uncache=0,n},Rr=function(t){return(t=t.split(" "))[0]+" "+t[1]},Dr=function(t,e,n){var r=te(e);return vt(parseFloat(e)+parseFloat(_r(t,"x",n+"px",r)))+r},zr=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,jr(t,e)},Fr="0deg",Br="0px",Ur=") ",jr=function(t,e){var n=e||this,r=n.xPercent,i=n.yPercent,o=n.x,a=n.y,s=n.z,u=n.rotation,l=n.rotationY,c=n.rotationX,h=n.skewX,d=n.skewY,f=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,v=n.target,y=n.zOrigin,b="",x="auto"===g&&t&&1!==t||!0===g;if(y&&(c!==Fr||l!==Fr)){var w,_=parseFloat(l)*Bn,S=Math.sin(_),E=Math.cos(_);_=parseFloat(c)*Bn,w=Math.cos(_),o=Dr(v,o,S*w*-y),a=Dr(v,a,-Math.sin(_)*-y),s=Dr(v,s,E*w*-y+y)}m!==Br&&(b+="perspective("+m+Ur),(r||i)&&(b+="translate("+r+"%, "+i+"%) "),(x||o!==Br||a!==Br||s!==Br)&&(b+=s!==Br||x?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+Ur),u!==Fr&&(b+="rotate("+u+Ur),l!==Fr&&(b+="rotateY("+l+Ur),c!==Fr&&(b+="rotateX("+c+Ur),h===Fr&&d===Fr||(b+="skew("+h+", "+d+Ur),1===f&&1===p||(b+="scale("+f+", "+p+Ur),v.style[rr]=b||"translate(0, 0)"},Vr=function(t,e){var n,r,i,o,a,s=e||this,u=s.xPercent,l=s.yPercent,c=s.x,h=s.y,d=s.rotation,f=s.skewX,p=s.skewY,m=s.scaleX,g=s.scaleY,v=s.target,y=s.xOrigin,b=s.yOrigin,x=s.xOffset,w=s.yOffset,_=s.forceCSS,S=parseFloat(c),E=parseFloat(h);d=parseFloat(d),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),d+=p),d||f?(d*=Bn,f*=Bn,n=Math.cos(d)*m,r=Math.sin(d)*m,i=Math.sin(d-f)*-g,o=Math.cos(d-f)*g,f&&(p*=Bn,a=Math.tan(f-p),i*=a=Math.sqrt(1+a*a),o*=a,p&&(a=Math.tan(p),n*=a=Math.sqrt(1+a*a),r*=a)),n=vt(n),r=vt(r),i=vt(i),o=vt(o)):(n=m,o=g,r=i=0),(S&&!~(c+"").indexOf("px")||E&&!~(h+"").indexOf("px"))&&(S=_r(v,"x",c,"px"),E=_r(v,"y",h,"px")),(y||b||x||w)&&(S=vt(S+y-(y*n+b*i)+x),E=vt(E+b-(y*r+b*o)+w)),(u||l)&&(a=v.getBBox(),S=vt(S+u/100*a.width),E=vt(E+l/100*a.height)),a="matrix("+n+","+r+","+i+","+o+","+S+","+E+")",v.setAttribute("transform",a),_&&(v.style[rr]=a)},Hr=function(t,e,n,r,i){var o,a,s=360,u=P(i),l=parseFloat(i)*(u&&~i.indexOf("rad")?Fn:1)-r,c=r+l+"deg";return u&&("short"===(o=i.split("_")[1])&&(l%=s)!==l%180&&(l+=l<0?s:-360),"cw"===o&&l<0?l=(l+36e9)%s-~~(l/s)*s:"ccw"===o&&l>0&&(l=(l-36e9)%s-~~(l/s)*s)),t._pt=a=new mn(t._pt,e,n,r,l,Xn),a.e=c,a.u="deg",t._props.push(n),a},Gr=function(t,e){for(var n in e)t[n]=e[n];return t},Wr=function(t,e,n){var r,i,o,a,s,u,l,c=Gr({},n._gsap),h=n.style;for(i in c.svg?(o=n.getAttribute("transform"),n.setAttribute("transform",""),h[rr]=e,r=Lr(n,1),yr(n,rr),n.setAttribute("transform",o)):(o=getComputedStyle(n)[rr],h[rr]=e,r=Lr(n,1),h[rr]=o),zn)(o=c[i])!==(a=r[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(s=te(o)!==(l=te(a))?_r(n,i,o,l):parseFloat(o),u=parseFloat(a),t._pt=new mn(t._pt,r,i,s,u-s,Wn),t._pt.u=l||0,t._props.push(i));Gr(r,c)};gt("padding,margin,Width,Radius",(function(t,e){var n="Top",r="Right",i="Bottom",o="Left",a=(e<3?[n,r,i,o]:[n+o,n+r,i+r,i+o]).map((function(n){return e<2?t+n:"border"+n+t}));Cr[e>1?"border"+t:t]=function(t,e,n,r,i){var o,s;if(arguments.length<4)return o=a.map((function(e){return Sr(t,e,n)})),5===(s=o.join(" ")).split(o[0]).length?o[0]:s;o=(r+"").split(" "),s={},a.forEach((function(t,e){return s[t]=o[e]=o[e]||o[(e-1)/2|0]})),t.init(e,s,i)}}));var Xr,Yr,qr,$r={name:"css",register:fr,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,r,i){var o,a,s,u,l,c,h,d,f,p,m,g,v,y,b,x,w,S,E,M,A=this._props,C=t.style,T=n.vars.startAt;for(h in Pn||fr(),this.styles=this.styles||ur(t),x=this.styles.props,this.tween=n,e)if("autoRound"!==h&&(a=e[h],!ut[h]||!qe(h,e,n,r,t,i)))if(l=typeof a,c=Cr[h],"function"===l&&(l=typeof(a=a.call(n,r,t,i))),"string"===l&&~a.indexOf("random(")&&(a=de(a)),c)c(this,t,h,a,n)&&(b=1);else if("--"===h.substr(0,2))o=(getComputedStyle(t).getPropertyValue(h)+"").trim(),a+="",Me.lastIndex=0,Me.test(o)||(d=te(o),f=te(a)),f?d!==f&&(o=_r(t,h,o,f)+f):d&&(a+=d),this.add(C,"setProperty",o,a,r,i,0,0,h),A.push(h),x.push(h,0,C[h]);else if("undefined"!==l){if(T&&h in T?(o="function"==typeof T[h]?T[h].call(n,r,t,i):T[h],P(o)&&~o.indexOf("random(")&&(o=de(o)),te(o+"")||"auto"===o||(o+=_.units[h]||te(Sr(t,h))||""),"="===(o+"").charAt(1)&&(o=Sr(t,h))):o=Sr(t,h),u=parseFloat(o),(p="string"===l&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),s=parseFloat(a),h in Gn&&("autoAlpha"===h&&(1===u&&"hidden"===Sr(t,"visibility")&&s&&(u=0),x.push("visibility",0,C.visibility),br(this,C,"visibility",u?"inherit":"hidden",s?"inherit":"hidden",!s)),"scale"!==h&&"transform"!==h&&~(h=Gn[h]).indexOf(",")&&(h=h.split(",")[0])),m=h in zn)if(this.styles.save(h),g||((v=t._gsap).renderTransform&&!e.parseTransform||Lr(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new mn(this._pt,C,rr,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===h)this._pt=new mn(this._pt,v,"scaleY",v.scaleY,(p?bt(v.scaleY,p+s):s)-v.scaleY||0,Wn),this._pt.u=0,A.push("scaleY",h),h+="X";else{if("transformOrigin"===h){x.push(ir,0,C[ir]),S=void 0,E=void 0,M=void 0,S=(w=a).split(" "),E=S[0],M=S[1]||"50%","top"!==E&&"bottom"!==E&&"left"!==M&&"right"!==M||(w=E,E=M,M=w),S[0]=Mr[E]||E,S[1]=Mr[M]||M,a=S.join(" "),v.svg?Or(t,a,0,y,0,this):((f=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&br(this,v,"zOrigin",v.zOrigin,f),br(this,C,h,Rr(o),Rr(a)));continue}if("svgOrigin"===h){Or(t,a,1,y,0,this);continue}if(h in kr){Hr(this,v,h,u,p?bt(u,p+a):a);continue}if("smoothOrigin"===h){br(this,v,"smooth",v.smooth,a);continue}if("force3D"===h){v[h]=a;continue}if("transform"===h){Wr(this,a,t);continue}}else h in C||(h=dr(h)||h);if(m||(s||0===s)&&(u||0===u)&&!Hn.test(a)&&h in C)s||(s=0),(d=(o+"").substr((u+"").length))!==(f=te(a)||(h in _.units?_.units[h]:d))&&(u=_r(t,h,o,f)),this._pt=new mn(this._pt,m?v:C,h,u,(p?bt(u,p+s):s)-u,m||"px"!==f&&"zIndex"!==h||!1===e.autoRound?Wn:qn),this._pt.u=f||0,d!==f&&"%"!==f&&(this._pt.b=o,this._pt.r=Yn);else if(h in C)Er.call(this,t,h,o,p?p+a:a);else if(h in t)this.add(t,h,o||t[h],p?p+a:a,r,i);else if("parseTransform"!==h){Q(h,a);continue}m||(h in C?x.push(h,0,C[h]):x.push(h,1,o||t[h])),A.push(h)}b&&pn(this)},render:function(t,e){if(e.tween._time||!Rn())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Sr,aliases:Gn,getSetter:function(t,e,n){var r=Gn[e];return r&&r.indexOf(",")<0&&(e=r),e in zn&&e!==ir&&(t._gsap.x||Sr(t,"x"))?n&&Ln===n?"scale"===e?tr:Jn:(Ln=n||{})&&("scale"===e?er:nr):t.style&&!R(t.style[e])?Zn:~e.indexOf("-")?Qn:an(t,e)},core:{_removeProperty:yr,_getMatrix:Pr}};Tn.utils.checkPrefix=dr,Tn.core.getStyleSaver=ur,qr=gt((Xr="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Yr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){zn[t]=1})),gt(Yr,(function(t){_.units[t]="deg",kr[t]=1})),Gn[qr[13]]=Xr+","+Yr,gt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");Gn[e[1]]=qr[e[0]]})),gt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){_.units[t]="px"})),Tn.registerPlugin($r);var Kr=Tn.registerPlugin($r)||Tn;Kr.core.Tween},4146:(t,e,n)=>{"use strict";var r=n(44363),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return r.isMemo(t)?a:s[t.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&t(e,i,r)}var a=c(n);h&&(a=a.concat(h(n)));for(var s=u(e),m=u(n),g=0;g{var e=[],n=[];function r(t,r){if(r=r||{},void 0===t)throw new Error("insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).");var i,o=!0===r.prepend?"prepend":"append",a=void 0!==r.container?r.container:document.querySelector("head"),s=e.indexOf(a);return-1===s&&(s=e.push(a)-1,n[s]={}),void 0!==n[s]&&void 0!==n[s][o]?i=n[s][o]:(i=n[s][o]=function(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}(),"prepend"===o?a.insertBefore(i,a.childNodes[0]):a.appendChild(i)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),i.styleSheet?i.styleSheet.cssText+=t:i.textContent+=t,i}t.exports=r,t.exports.insertCss=r},62587:(t,e,n)=>{"use strict";n.d(e,{S:()=>l});var r=n(31635),i=n(78786),o=n(54819),a=n(31071);function s(t,e){return e?Object.keys(t).reduce((function(n,i){var o,a;return n[i]=(o=t[i],(a=e[i])?(0,r.__assign)((0,r.__assign)((0,r.__assign)({},o||{}),a||{}),Object.keys(o).reduce((function(t,e){return t[e]=(0,r.__assign)((0,r.__assign)({},o[e]),a[e]||{}),t}),{})):o),n}),(0,r.__assign)({},t)):t}function u(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}}}var l=function(){function t(e,n,i,l){var c,h=this;if(void 0===n&&(n=t.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(t){var e=h.formatToParts(t);if(1===e.length)return e[0].value;var n=e.reduce((function(t,e){return t.length&&e.type===a.TT.literal&&"string"==typeof t[t.length-1]?t[t.length-1]+=e.value:t.push(e.value),t}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(t){return(0,a.hN)(h.ast,h.locales,h.formatters,h.formats,t,void 0,h.message)},this.resolvedOptions=function(){var t;return{locale:(null===(t=h.resolvedLocale)||void 0===t?void 0:t.toString())||Intl.NumberFormat.supportedLocalesOf(h.locales)[0]}},this.getAst=function(){return h.ast},this.locales=n,this.resolvedLocale=t.resolveLocale(n),"string"==typeof e){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var d=l||{},f=(d.formatters,(0,r.__rest)(d,["formatters"]));this.ast=t.__parse(e,(0,r.__assign)((0,r.__assign)({},f),{locale:this.resolvedLocale}))}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=s(t.formats,i),this.formatters=l&&l.formatters||(void 0===(c=this.formatterCache)&&(c={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:(0,o.B)((function(){for(var t,e=[],n=0;n0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=i.qg,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}()},11732:(t,e,n)=>{"use strict";n.d(e,{$x:()=>a,Ei:()=>u,IF:()=>o,O4:()=>r,Zo:()=>s});var r,i=n(31635);!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(r||(r={}));var o=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.code=n,i.originalMessage=r,i}return(0,i.__extends)(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),a=function(t){function e(e,n,i,o){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),r.INVALID_VALUE,o)||this}return(0,i.__extends)(e,t),e}(o),s=function(t){function e(e,n,i){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(n),r.INVALID_VALUE,i)||this}return(0,i.__extends)(e,t),e}(o),u=function(t){function e(e,n){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(n,'"'),r.MISSING_VALUE,n)||this}return(0,i.__extends)(e,t),e}(o)},31071:(t,e,n)=>{"use strict";n.d(e,{RK:()=>a,TT:()=>r,hN:()=>s});var r,i=n(78786),o=n(11732);function a(t){return"function"==typeof t}function s(t,e,n,u,l,c,h){if(1===t.length&&(0,i.eW)(t[0]))return[{type:r.literal,value:t[0].value}];for(var d=[],f=0,p=t;f{var r=n(9325).Symbol;t.exports=r},72552:(t,e,n)=>{var r=n(51873),i=n(659),o=n(59350),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},4901:(t,e,n)=>{var r=n(72552),i=n(30294),o=n(40346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},54128:(t,e,n)=>{var r=n(31800),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},27301:t=>{t.exports=function(t){return function(e){return t(e)}}},34840:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},28879:(t,e,n)=>{var r=n(74335)(Object.getPrototypeOf,Object);t.exports=r},659:(t,e,n)=>{var r=n(51873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},86009:(t,e,n)=>{t=n.nmd(t);var r=n(34840),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},59350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},74335:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},9325:(t,e,n)=>{var r=n(34840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},31800:t=>{var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},38221:(t,e,n)=>{var r=n(23805),i=n(10124),o=n(99374),a=Math.max,s=Math.min;t.exports=function(t,e,n){var u,l,c,h,d,f,p=0,m=!1,g=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=u,r=l;return u=l=void 0,p=e,h=t.apply(r,n)}function b(t){var n=t-f;return void 0===f||n>=e||n<0||g&&t-p>=c}function x(){var t=i();if(b(t))return w(t);d=setTimeout(x,function(t){var n=e-(t-f);return g?s(n,c-(t-p)):n}(t))}function w(t){return d=void 0,v&&u?y(t):(u=l=void 0,h)}function _(){var t=i(),n=b(t);if(u=arguments,l=this,f=t,n){if(void 0===d)return function(t){return p=t,d=setTimeout(x,e),m?y(t):h}(f);if(g)return clearTimeout(d),d=setTimeout(x,e),y(f)}return void 0===d&&(d=setTimeout(x,e)),h}return e=o(e)||0,r(n)&&(m=!!n.leading,c=(g="maxWait"in n)?a(o(n.maxWait)||0,e):c,v="trailing"in n?!!n.trailing:v),_.cancel=function(){void 0!==d&&clearTimeout(d),p=0,u=f=l=d=void 0},_.flush=function(){return void 0===d?h:w(i())},_}},56449:t=>{var e=Array.isArray;t.exports=e},30294:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},98023:(t,e,n)=>{var r=n(72552),i=n(40346);t.exports=function(t){return"number"==typeof t||i(t)&&"[object Number]"==r(t)}},23805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},40346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},11331:(t,e,n)=>{var r=n(72552),i=n(28879),o=n(40346),a=Function.prototype,s=Object.prototype,u=a.toString,l=s.hasOwnProperty,c=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==c}},44394:(t,e,n)=>{var r=n(72552),i=n(40346);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},37167:(t,e,n)=>{var r=n(4901),i=n(27301),o=n(86009),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},10124:(t,e,n)=>{var r=n(9325);t.exports=function(){return r.Date.now()}},99374:(t,e,n)=>{var r=n(54128),i=n(23805),o=n(44394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?l(t.slice(2),n?2:8):a.test(t)?NaN:+t}},28570:t=>{t.exports=n;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var i={},o={};function a(t,e){var n,r,a;return e?(a=0<=(t>>>=0)&&t<256)&&(r=o[t])?r:(n=u(t,(0|t)<0?-1:0,!0),a&&(o[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(r=i[t])?r:(n=u(t,t<0?-1:0,!1),a&&(i[t]=n),n)}function s(t,e){if(isNaN(t))return e?v:g;if(e){if(t<0)return v;if(t>=f)return _}else{if(t<=-p)return S;if(t+1>=p)return w}return t<0?s(-t,e).neg():u(t%d|0,t/d|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var l=Math.pow;function c(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return g;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return c(t.substring(1),e,n).neg();for(var i=s(l(n,8)),o=g,a=0;a>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},E.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((o=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<=0},E.isOdd=function(){return!(1&~this.low)},E.isEven=function(){return!(1&this.low)},E.equals=function(t){return r(t)||(t=h(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},E.eq=E.equals,E.notEquals=function(t){return!this.eq(t)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(t){return this.comp(t)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(t){return this.comp(t)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(t){return this.comp(t)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(t){return this.comp(t)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(t){if(r(t)||(t=h(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(y)},E.neg=E.negate,E.add=function(t){r(t)||(t=h(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,l=t.low>>>16,c=0,d=0,f=0,p=0;return f+=(p+=o+(65535&t.low))>>>16,d+=(f+=i+l)>>>16,c+=(d+=n+s)>>>16,c+=e+a,u((f&=65535)<<16|(p&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},E.subtract=function(t){return r(t)||(t=h(t)),this.add(t.neg())},E.sub=E.subtract,E.multiply=function(t){if(this.isZero())return g;if(r(t)||(t=h(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return g;if(this.eq(S))return t.isOdd()?S:g;if(t.eq(S))return this.isOdd()?S:g;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(m)&&t.lt(m))return s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,a=65535&this.low,l=t.high>>>16,c=65535&t.high,d=t.low>>>16,f=65535&t.low,p=0,v=0,y=0,b=0;return y+=(b+=a*f)>>>16,v+=(y+=o*f)>>>16,y&=65535,v+=(y+=a*d)>>>16,p+=(v+=i*f)>>>16,v&=65535,p+=(v+=o*d)>>>16,v&=65535,p+=(v+=a*c)>>>16,p+=n*f+i*d+o*c+a*l,u((y&=65535)<<16|(b&=65535),(p&=65535)<<16|(v&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(t){if(r(t)||(t=h(t)),t.isZero())throw Error("division by zero");var n,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:g;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return b;o=v}else{if(this.eq(S))return t.eq(y)||t.eq(x)?S:t.eq(S)?y:(n=this.shr(1).div(t).shl(1)).eq(g)?t.isNegative()?y:x:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(S))return this.unsigned?v:g;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=g}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:l(2,a-48),d=s(n),f=d.mul(t);f.isNegative()||f.gt(i);)f=(d=s(n-=c,this.unsigned)).mul(t);d.isZero()&&(d=y),o=o.add(d),i=i.sub(f)}return o},E.div=E.divide,E.modulo=function(t){return r(t)||(t=h(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return u(~this.low,~this.high,this.unsigned)},E.and=function(t){return r(t)||(t=h(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},E.or=function(t){return r(t)||(t=h(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},E.xor=function(t){return r(t)||(t=h(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},E.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<>>32-t,this.unsigned):u(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},E.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},E.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},55346:()=>{var t=function(t,r){var i=document.querySelector("#"+t+" > .particles-js-canvas-el");this.pJS={canvas:{el:i,w:i.offsetWidth,h:i.offsetHeight},particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}},array:[]},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}},mouse:{}},retina_detect:!1,fn:{interact:{},modes:{},vendors:{}},tmp:{}};var o=this.pJS;r&&Object.deepExtend(o,r),o.tmp.obj={size_value:o.particles.size.value,size_anim_speed:o.particles.size.anim.speed,move_speed:o.particles.move.speed,line_linked_distance:o.particles.line_linked.distance,line_linked_width:o.particles.line_linked.width,mode_grab_distance:o.interactivity.modes.grab.distance,mode_bubble_distance:o.interactivity.modes.bubble.distance,mode_bubble_size:o.interactivity.modes.bubble.size,mode_repulse_distance:o.interactivity.modes.repulse.distance},o.fn.retinaInit=function(){o.retina_detect&&window.devicePixelRatio>1?(o.canvas.pxratio=window.devicePixelRatio,o.tmp.retina=!0):(o.canvas.pxratio=1,o.tmp.retina=!1),o.canvas.w=o.canvas.el.offsetWidth*o.canvas.pxratio,o.canvas.h=o.canvas.el.offsetHeight*o.canvas.pxratio,o.particles.size.value=o.tmp.obj.size_value*o.canvas.pxratio,o.particles.size.anim.speed=o.tmp.obj.size_anim_speed*o.canvas.pxratio,o.particles.move.speed=o.tmp.obj.move_speed*o.canvas.pxratio,o.particles.line_linked.distance=o.tmp.obj.line_linked_distance*o.canvas.pxratio,o.interactivity.modes.grab.distance=o.tmp.obj.mode_grab_distance*o.canvas.pxratio,o.interactivity.modes.bubble.distance=o.tmp.obj.mode_bubble_distance*o.canvas.pxratio,o.particles.line_linked.width=o.tmp.obj.line_linked_width*o.canvas.pxratio,o.interactivity.modes.bubble.size=o.tmp.obj.mode_bubble_size*o.canvas.pxratio,o.interactivity.modes.repulse.distance=o.tmp.obj.mode_repulse_distance*o.canvas.pxratio},o.fn.canvasInit=function(){o.canvas.ctx=o.canvas.el.getContext("2d")},o.fn.canvasSize=function(){o.canvas.el.width=o.canvas.w,o.canvas.el.height=o.canvas.h,o&&o.interactivity.events.resize&&window.addEventListener("resize",(function(){o.canvas.w=o.canvas.el.offsetWidth,o.canvas.h=o.canvas.el.offsetHeight,o.tmp.retina&&(o.canvas.w*=o.canvas.pxratio,o.canvas.h*=o.canvas.pxratio),o.canvas.el.width=o.canvas.w,o.canvas.el.height=o.canvas.h,o.particles.move.enable||(o.fn.particlesEmpty(),o.fn.particlesCreate(),o.fn.particlesDraw(),o.fn.vendors.densityAutoParticles()),o.fn.vendors.densityAutoParticles()}))},o.fn.canvasPaint=function(){o.canvas.ctx.fillRect(0,0,o.canvas.w,o.canvas.h)},o.fn.canvasClear=function(){o.canvas.ctx.clearRect(0,0,o.canvas.w,o.canvas.h)},o.fn.particle=function(t,n,r){if(this.radius=(o.particles.size.random?Math.random():1)*o.particles.size.value,o.particles.size.anim.enable&&(this.size_status=!1,this.vs=o.particles.size.anim.speed/100,o.particles.size.anim.sync||(this.vs=this.vs*Math.random())),this.x=r?r.x:Math.random()*o.canvas.w,this.y=r?r.y:Math.random()*o.canvas.h,this.x>o.canvas.w-2*this.radius?this.x=this.x-this.radius:this.x<2*this.radius&&(this.x=this.x+this.radius),this.y>o.canvas.h-2*this.radius?this.y=this.y-this.radius:this.y<2*this.radius&&(this.y=this.y+this.radius),o.particles.move.bounce&&o.fn.vendors.checkOverlap(this,r),this.color={},"object"==typeof t.value)if(t.value instanceof Array){var i=t.value[Math.floor(Math.random()*o.particles.color.value.length)];this.color.rgb=e(i)}else null!=t.value.r&&null!=t.value.g&&null!=t.value.b&&(this.color.rgb={r:t.value.r,g:t.value.g,b:t.value.b}),null!=t.value.h&&null!=t.value.s&&null!=t.value.l&&(this.color.hsl={h:t.value.h,s:t.value.s,l:t.value.l});else"random"==t.value?this.color.rgb={r:Math.floor(256*Math.random())+0,g:Math.floor(256*Math.random())+0,b:Math.floor(256*Math.random())+0}:"string"==typeof t.value&&(this.color=t,this.color.rgb=e(this.color.value));this.opacity=(o.particles.opacity.random?Math.random():1)*o.particles.opacity.value,o.particles.opacity.anim.enable&&(this.opacity_status=!1,this.vo=o.particles.opacity.anim.speed/100,o.particles.opacity.anim.sync||(this.vo=this.vo*Math.random()));var a={};switch(o.particles.move.direction){case"top":a={x:0,y:-1};break;case"top-right":a={x:.5,y:-.5};break;case"right":a={x:1,y:-0};break;case"bottom-right":a={x:.5,y:.5};break;case"bottom":a={x:0,y:1};break;case"bottom-left":a={x:-.5,y:1};break;case"left":a={x:-1,y:0};break;case"top-left":a={x:-.5,y:-.5};break;default:a={x:0,y:0}}o.particles.move.straight?(this.vx=a.x,this.vy=a.y,o.particles.move.random&&(this.vx=this.vx*Math.random(),this.vy=this.vy*Math.random())):(this.vx=a.x+Math.random()-.5,this.vy=a.y+Math.random()-.5),this.vx_i=this.vx,this.vy_i=this.vy;var s=o.particles.shape.type;if("object"==typeof s){if(s instanceof Array){var u=s[Math.floor(Math.random()*s.length)];this.shape=u}}else this.shape=s;if("image"==this.shape){var l=o.particles.shape;this.img={src:l.image.src,ratio:l.image.width/l.image.height},this.img.ratio||(this.img.ratio=1),"svg"==o.tmp.img_type&&null!=o.tmp.source_svg&&(o.fn.vendors.createSvgImg(this),o.tmp.pushing&&(this.img.loaded=!1))}},o.fn.particle.prototype.draw=function(){var t=this;if(null!=t.radius_bubble)var e=t.radius_bubble;else e=t.radius;if(null!=t.opacity_bubble)var n=t.opacity_bubble;else n=t.opacity;if(t.color.rgb)var r="rgba("+t.color.rgb.r+","+t.color.rgb.g+","+t.color.rgb.b+","+n+")";else r="hsla("+t.color.hsl.h+","+t.color.hsl.s+"%,"+t.color.hsl.l+"%,"+n+")";switch(o.canvas.ctx.fillStyle=r,o.canvas.ctx.beginPath(),t.shape){case"circle":o.canvas.ctx.arc(t.x,t.y,e,0,2*Math.PI,!1);break;case"edge":o.canvas.ctx.rect(t.x-e,t.y-e,2*e,2*e);break;case"triangle":o.fn.vendors.drawShape(o.canvas.ctx,t.x-e,t.y+e/1.66,2*e,3,2);break;case"polygon":o.fn.vendors.drawShape(o.canvas.ctx,t.x-e/(o.particles.shape.polygon.nb_sides/3.5),t.y-e/.76,2.66*e/(o.particles.shape.polygon.nb_sides/3),o.particles.shape.polygon.nb_sides,1);break;case"star":o.fn.vendors.drawShape(o.canvas.ctx,t.x-2*e/(o.particles.shape.polygon.nb_sides/4),t.y-e/1.52,2*e*2.66/(o.particles.shape.polygon.nb_sides/3),o.particles.shape.polygon.nb_sides,2);break;case"image":if("svg"==o.tmp.img_type)var i=t.img.obj;else i=o.tmp.img_obj;i&&o.canvas.ctx.drawImage(i,t.x-e,t.y-e,2*e,2*e/t.img.ratio)}o.canvas.ctx.closePath(),o.particles.shape.stroke.width>0&&(o.canvas.ctx.strokeStyle=o.particles.shape.stroke.color,o.canvas.ctx.lineWidth=o.particles.shape.stroke.width,o.canvas.ctx.stroke()),o.canvas.ctx.fill()},o.fn.particlesCreate=function(){for(var t=0;t=o.particles.opacity.value&&(e.opacity_status=!1),e.opacity+=e.vo):(e.opacity<=o.particles.opacity.anim.opacity_min&&(e.opacity_status=!0),e.opacity-=e.vo),e.opacity<0&&(e.opacity=0)),o.particles.size.anim.enable&&(1==e.size_status?(e.radius>=o.particles.size.value&&(e.size_status=!1),e.radius+=e.vs):(e.radius<=o.particles.size.anim.size_min&&(e.size_status=!0),e.radius-=e.vs),e.radius<0&&(e.radius=0)),"bounce"==o.particles.move.out_mode)var i={x_left:e.radius,x_right:o.canvas.w,y_top:e.radius,y_bottom:o.canvas.h};else i={x_left:-e.radius,x_right:o.canvas.w+e.radius,y_top:-e.radius,y_bottom:o.canvas.h+e.radius};if(e.x-e.radius>o.canvas.w?(e.x=i.x_left,e.y=Math.random()*o.canvas.h):e.x+e.radius<0&&(e.x=i.x_right,e.y=Math.random()*o.canvas.h),e.y-e.radius>o.canvas.h?(e.y=i.y_top,e.x=Math.random()*o.canvas.w):e.y+e.radius<0&&(e.y=i.y_bottom,e.x=Math.random()*o.canvas.w),"bounce"===o.particles.move.out_mode)(e.x+e.radius>o.canvas.w||e.x-e.radius<0)&&(e.vx=-e.vx),(e.y+e.radius>o.canvas.h||e.y-e.radius<0)&&(e.vy=-e.vy);if(n("grab",o.interactivity.events.onhover.mode)&&o.fn.modes.grabParticle(e),(n("bubble",o.interactivity.events.onhover.mode)||n("bubble",o.interactivity.events.onclick.mode))&&o.fn.modes.bubbleParticle(e),(n("repulse",o.interactivity.events.onhover.mode)||n("repulse",o.interactivity.events.onclick.mode))&&o.fn.modes.repulseParticle(e),o.particles.line_linked.enable||o.particles.move.attract.enable)for(var a=t+1;a0){var s=o.particles.line_linked.color_rgb_line;o.canvas.ctx.strokeStyle="rgba("+s.r+","+s.g+","+s.b+","+a+")",o.canvas.ctx.lineWidth=o.particles.line_linked.width,o.canvas.ctx.beginPath(),o.canvas.ctx.moveTo(t.x,t.y),o.canvas.ctx.lineTo(e.x,e.y),o.canvas.ctx.stroke(),o.canvas.ctx.closePath()}}},o.fn.interact.attractParticles=function(t,e){var n=t.x-e.x,r=t.y-e.y;if(Math.sqrt(n*n+r*r)<=o.particles.line_linked.distance){var i=n/(1e3*o.particles.move.attract.rotateX),a=r/(1e3*o.particles.move.attract.rotateY);t.vx-=i,t.vy-=a,e.vx+=i,e.vy+=a}},o.fn.interact.bounceParticles=function(t,e){var n=t.x-e.x,r=t.y-e.y;Math.sqrt(n*n+r*r)<=t.radius+e.radius&&(t.vx=-t.vx,t.vy=-t.vy,e.vx=-e.vx,e.vy=-e.vy)},o.fn.modes.pushParticles=function(t,e){o.tmp.pushing=!0;for(var n=0;n=0&&"mousemove"==o.interactivity.status){if(o.interactivity.modes.bubble.size!=o.particles.size.value)if(o.interactivity.modes.bubble.size>o.particles.size.value){(u=t.radius+o.interactivity.modes.bubble.size*i)>=0&&(t.radius_bubble=u)}else{var s=t.radius-o.interactivity.modes.bubble.size,u=t.radius-s*i;t.radius_bubble=u>0?u:0}var l;if(o.interactivity.modes.bubble.opacity!=o.particles.opacity.value)if(o.interactivity.modes.bubble.opacity>o.particles.opacity.value)(l=o.interactivity.modes.bubble.opacity*i)>t.opacity&&l<=o.interactivity.modes.bubble.opacity&&(t.opacity_bubble=l);else(l=t.opacity-(o.particles.opacity.value-o.interactivity.modes.bubble.opacity)*i)=o.interactivity.modes.bubble.opacity&&(t.opacity_bubble=l)}}else a();"mouseleave"==o.interactivity.status&&a()}else if(o.interactivity.events.onclick.enable&&n("bubble",o.interactivity.events.onclick.mode)){if(o.tmp.bubble_clicking){e=t.x-o.interactivity.mouse.click_pos_x,r=t.y-o.interactivity.mouse.click_pos_y;var c=Math.sqrt(e*e+r*r),h=((new Date).getTime()-o.interactivity.mouse.click_time)/1e3;h>o.interactivity.modes.bubble.duration&&(o.tmp.bubble_duration_end=!0),h>2*o.interactivity.modes.bubble.duration&&(o.tmp.bubble_clicking=!1,o.tmp.bubble_duration_end=!1)}function d(e,n,r,i,a){if(e!=n)if(o.tmp.bubble_duration_end)null!=r&&(u=e+(e-(i-h*(i-e)/o.interactivity.modes.bubble.duration)),"size"==a&&(t.radius_bubble=u),"opacity"==a&&(t.opacity_bubble=u));else if(c<=o.interactivity.modes.bubble.distance){if(null!=r)var s=r;else s=i;if(s!=e){var u=i-h*(i-e)/o.interactivity.modes.bubble.duration;"size"==a&&(t.radius_bubble=u),"opacity"==a&&(t.opacity_bubble=u)}}else"size"==a&&(t.radius_bubble=void 0),"opacity"==a&&(t.opacity_bubble=void 0)}o.tmp.bubble_clicking&&(d(o.interactivity.modes.bubble.size,o.particles.size.value,t.radius_bubble,t.radius,"size"),d(o.interactivity.modes.bubble.opacity,o.particles.opacity.value,t.opacity_bubble,t.opacity,"opacity"))}},o.fn.modes.repulseParticle=function(t){if(o.interactivity.events.onhover.enable&&n("repulse",o.interactivity.events.onhover.mode)&&"mousemove"==o.interactivity.status){var e=t.x-o.interactivity.mouse.pos_x,r=t.y-o.interactivity.mouse.pos_y,i=Math.sqrt(e*e+r*r),a={x:e/i,y:r/i},s=o.interactivity.modes.repulse.distance,u=(p=1/s*(-1*Math.pow(i/s,2)+1)*s*100,m=0,g=50,Math.min(Math.max(p,m),g)),l={x:t.x+a.x*u,y:t.y+a.y*u};"bounce"==o.particles.move.out_mode?(l.x-t.radius>0&&l.x+t.radius0&&l.y+t.radiuso.canvas.w||n.x-t.radius<0)&&(t.vx=-t.vx),(n.y+t.radius>o.canvas.h||n.y-t.radius<0)&&(t.vy=-t.vy)}}()}else 0==o.tmp.repulse_clicking&&(t.vx=t.vx_i,t.vy=t.vy_i);var p,m,g},o.fn.modes.grabParticle=function(t){if(o.interactivity.events.onhover.enable&&"mousemove"==o.interactivity.status){var e=t.x-o.interactivity.mouse.pos_x,n=t.y-o.interactivity.mouse.pos_y,r=Math.sqrt(e*e+n*n);if(r<=o.interactivity.modes.grab.distance){var i=o.interactivity.modes.grab.line_linked.opacity-r/(1/o.interactivity.modes.grab.line_linked.opacity)/o.interactivity.modes.grab.distance;if(i>0){var a=o.particles.line_linked.color_rgb_line;o.canvas.ctx.strokeStyle="rgba("+a.r+","+a.g+","+a.b+","+i+")",o.canvas.ctx.lineWidth=o.particles.line_linked.width,o.canvas.ctx.beginPath(),o.canvas.ctx.moveTo(t.x,t.y),o.canvas.ctx.lineTo(o.interactivity.mouse.pos_x,o.interactivity.mouse.pos_y),o.canvas.ctx.stroke(),o.canvas.ctx.closePath()}}}},o.fn.vendors.eventsListeners=function(){"window"==o.interactivity.detect_on?o.interactivity.el=window:o.interactivity.el=o.canvas.el,(o.interactivity.events.onhover.enable||o.interactivity.events.onclick.enable)&&(o.interactivity.el.addEventListener("mousemove",(function(t){if(o.interactivity.el==window)var e=t.clientX,n=t.clientY;else e=t.offsetX||t.clientX,n=t.offsetY||t.clientY;o.interactivity.mouse.pos_x=e,o.interactivity.mouse.pos_y=n,o.tmp.retina&&(o.interactivity.mouse.pos_x*=o.canvas.pxratio,o.interactivity.mouse.pos_y*=o.canvas.pxratio),o.interactivity.status="mousemove"})),o.interactivity.el.addEventListener("mouseleave",(function(t){o.interactivity.mouse.pos_x=null,o.interactivity.mouse.pos_y=null,o.interactivity.status="mouseleave"}))),o.interactivity.events.onclick.enable&&o.interactivity.el.addEventListener("click",(function(){if(o.interactivity.mouse.click_pos_x=o.interactivity.mouse.pos_x,o.interactivity.mouse.click_pos_y=o.interactivity.mouse.pos_y,o.interactivity.mouse.click_time=(new Date).getTime(),o.interactivity.events.onclick.enable)switch(o.interactivity.events.onclick.mode){case"push":o.particles.move.enable||1==o.interactivity.modes.push.particles_nb?o.fn.modes.pushParticles(o.interactivity.modes.push.particles_nb,o.interactivity.mouse):o.interactivity.modes.push.particles_nb>1&&o.fn.modes.pushParticles(o.interactivity.modes.push.particles_nb);break;case"remove":o.fn.modes.removeParticles(o.interactivity.modes.remove.particles_nb);break;case"bubble":o.tmp.bubble_clicking=!0;break;case"repulse":o.tmp.repulse_clicking=!0,o.tmp.repulse_count=0,o.tmp.repulse_finish=!1,setTimeout((function(){o.tmp.repulse_clicking=!1}),1e3*o.interactivity.modes.repulse.duration)}}))},o.fn.vendors.densityAutoParticles=function(){if(o.particles.number.density.enable){var t=o.canvas.el.width*o.canvas.el.height/1e3;o.tmp.retina&&(t/=2*o.canvas.pxratio);var e=t*o.particles.number.value/o.particles.number.density.value_area,n=o.particles.array.length-e;n<0?o.fn.modes.pushParticles(Math.abs(n)):o.fn.modes.removeParticles(n)}},o.fn.vendors.checkOverlap=function(t,e){for(var n=0;n=o.particles.number.value?(o.fn.particlesDraw(),o.particles.move.enable?o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw):cancelRequestAnimFrame(o.fn.drawAnimFrame)):o.tmp.img_error||(o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw)):null!=o.tmp.img_obj?(o.fn.particlesDraw(),o.particles.move.enable?o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw):cancelRequestAnimFrame(o.fn.drawAnimFrame)):o.tmp.img_error||(o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw)):(o.fn.particlesDraw(),o.particles.move.enable?o.fn.drawAnimFrame=requestAnimFrame(o.fn.vendors.draw):cancelRequestAnimFrame(o.fn.drawAnimFrame))},o.fn.vendors.checkBeforeDraw=function(){"image"==o.particles.shape.type?"svg"==o.tmp.img_type&&null==o.tmp.source_svg?o.tmp.checkAnimFrame=requestAnimFrame(check):(cancelRequestAnimFrame(o.tmp.checkAnimFrame),o.tmp.img_error||(o.fn.vendors.init(),o.fn.vendors.draw())):(o.fn.vendors.init(),o.fn.vendors.draw())},o.fn.vendors.init=function(){o.fn.retinaInit(),o.fn.canvasInit(),o.fn.canvasSize(),o.fn.canvasPaint(),o.fn.particlesCreate(),o.fn.vendors.densityAutoParticles(),o.particles.line_linked.color_rgb_line=e(o.particles.line_linked.color)},o.fn.vendors.start=function(){n("image",o.particles.shape.type)?(o.tmp.img_type=o.particles.shape.image.src.substr(o.particles.shape.image.src.length-3),o.fn.vendors.loadImg(o.tmp.img_type)):o.fn.vendors.checkBeforeDraw()},o.fn.vendors.eventsListeners(),o.fn.vendors.start()};function e(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}function n(t,e){return e.indexOf(t)>-1}Object.deepExtend=function(t,e){for(var n in e)e[n]&&e[n].constructor&&e[n].constructor===Object?(t[n]=t[n]||{},arguments.callee(t[n],e[n])):t[n]=e[n];return t},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},window.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout,window.pJSDom=[],window.particlesJS=function(e,n){"string"!=typeof e&&(n=e,e="particles-js"),e||(e="particles-js");var r=document.getElementById(e),i="particles-js-canvas-el",o=r.getElementsByClassName(i);if(o.length)for(;o.length>0;)r.removeChild(o[0]);var a=document.createElement("canvas");a.className=i,a.style.width="100%",a.style.height="100%",null!=document.getElementById(e).appendChild(a)&&pJSDom.push(new t(e,n))},window.particlesJS.load=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",e),r.onreadystatechange=function(e){if(4==r.readyState)if(200==r.status){var i=JSON.parse(e.currentTarget.response);window.particlesJS(t,i),n&&n()}else console.log("Error pJS - XMLHttpRequest status: "+r.status),console.log("Error pJS - File config not found")},r.send()}},83117:(t,e,n)=>{"use strict";function r(t){const e=function(t){if(null===t)return"Null";if(void 0===t)return"Undefined";if(Number.isNaN(t))return"NaN";const e=Object.prototype.toString.call(t).slice(8,-1);return"AsyncFunction"===e?"Promise":e}(t);return!["Undefined","NaN","Number","Null"].includes(e)&&(!t||("Object"===e?0===Object.keys(t).length:"Array"===e&&0===t.length))}n.d(e,{I:()=>r})},62306:(t,e,n)=>{"use strict";function r(t){return null==t}n.d(e,{g:()=>r})},38873:(t,e,n)=>{"use strict";n.d(e,{A:()=>f});var r=n(58168),i=n(89379),o=n(64467),a=n(5544),s=n(53986),u=n(46942),l=n.n(u),c=n(12533),h=n(96540),d=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"];const f=(0,h.forwardRef)((function(t,e){var n=t.prefixCls,u=void 0===n?"rc-checkbox":n,f=t.className,p=t.style,m=t.checked,g=t.disabled,v=t.defaultChecked,y=void 0!==v&&v,b=t.type,x=void 0===b?"checkbox":b,w=t.title,_=t.onChange,S=(0,s.A)(t,d),E=(0,h.useRef)(null),M=(0,c.A)(y,{value:m}),A=(0,a.A)(M,2),C=A[0],T=A[1];(0,h.useImperativeHandle)(e,(function(){return{focus:function(t){var e;null===(e=E.current)||void 0===e||e.focus(t)},blur:function(){var t;null===(t=E.current)||void 0===t||t.blur()},input:E.current}}));var k=l()(u,f,(0,o.A)((0,o.A)({},"".concat(u,"-checked"),C),"".concat(u,"-disabled"),g));return h.createElement("span",{className:k,title:w,style:p},h.createElement("input",(0,r.A)({},S,{className:"".concat(u,"-input"),ref:E,onChange:function(e){g||("checked"in t||T(e.target.checked),null==_||_({target:(0,i.A)((0,i.A)({},t),{},{type:x,checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e.nativeEvent}))},disabled:g,checked:!!C,type:x})),h.createElement("span",{className:"".concat(u,"-inner")}))}))},33766:(t,e,n)=>{"use strict";n.d(e,{Z:()=>S,A:()=>k});var r=n(58168),i=n(5544),o=n(72595),a=n(96540),s=a.createContext({}),u=n(89379),l=n(46942),c=n.n(l),h=n(54808),d=n(56855),f=n(16928),p=n(72065);function m(t,e,n){var r=e;return!r&&n&&(r="".concat(t,"-").concat(n)),r}function g(t,e){var n=t["page".concat(e?"Y":"X","Offset")],r="scroll".concat(e?"Top":"Left");if("number"!=typeof n){var i=t.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}var v=n(57557),y=n(82284),b=n(8719);const x=a.memo((function(t){return t.children}),(function(t,e){return!e.shouldUpdate}));var w={width:0,height:0,overflow:"hidden",outline:"none"},_={outline:"none"};const S=a.forwardRef((function(t,e){var n=t.prefixCls,i=t.className,o=t.style,l=t.title,h=t.ariaId,d=t.footer,f=t.closable,m=t.closeIcon,g=t.onClose,v=t.children,S=t.bodyStyle,E=t.bodyProps,M=t.modalRender,A=t.onMouseDown,C=t.onMouseUp,T=t.holderRef,k=t.visible,I=t.forceRender,N=t.width,P=t.height,O=t.classNames,L=t.styles,R=a.useContext(s).panel,D=(0,b.xK)(T,R),z=(0,a.useRef)(),F=(0,a.useRef)(),B=(0,a.useRef)();a.useImperativeHandle(e,(function(){return{focus:function(){var t;null===(t=B.current)||void 0===t||t.focus()},changeActive:function(t){var e=document.activeElement;t&&e===F.current?z.current.focus():t||e!==z.current||F.current.focus()}}}));var U,j,V={};void 0!==N&&(V.width=N),void 0!==P&&(V.height=P),d&&(U=a.createElement("div",{className:c()("".concat(n,"-footer"),null==O?void 0:O.footer),style:(0,u.A)({},null==L?void 0:L.footer)},d)),l&&(j=a.createElement("div",{className:c()("".concat(n,"-header"),null==O?void 0:O.header),style:(0,u.A)({},null==L?void 0:L.header)},a.createElement("div",{className:"".concat(n,"-title"),id:h},l)));var H,G=(0,a.useMemo)((function(){return"object"===(0,y.A)(f)&&null!==f?f:f?{closeIcon:null!=m?m:a.createElement("span",{className:"".concat(n,"-close-x")})}:{}}),[f,m]),W=(0,p.A)(G,!0);f&&(H=a.createElement("button",(0,r.A)({type:"button",onClick:g,"aria-label":"Close"},W,{className:"".concat(n,"-close")}),G.closeIcon));var X=a.createElement("div",{className:c()("".concat(n,"-content"),null==O?void 0:O.content),style:null==L?void 0:L.content},H,j,a.createElement("div",(0,r.A)({className:c()("".concat(n,"-body"),null==O?void 0:O.body),style:(0,u.A)((0,u.A)({},S),null==L?void 0:L.body)},E),v),U);return a.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":l?h:null,"aria-modal":"true",ref:D,style:(0,u.A)((0,u.A)({},o),V),className:c()(n,i),onMouseDown:A,onMouseUp:C},a.createElement("div",{tabIndex:0,ref:z,style:w,"aria-hidden":"true"}),a.createElement("div",{ref:B,tabIndex:-1,style:_},a.createElement(x,{shouldUpdate:k||I},M?M(X):X)),a.createElement("div",{tabIndex:0,ref:F,style:w,"aria-hidden":"true"}))}));var E=a.forwardRef((function(t,e){var n=t.prefixCls,o=t.title,s=t.style,l=t.className,h=t.visible,d=t.forceRender,f=t.destroyOnClose,p=t.motionName,m=t.ariaId,y=t.onVisibleChanged,b=t.mousePosition,x=(0,a.useRef)(),w=a.useState(),_=(0,i.A)(w,2),E=_[0],M=_[1],A={};function C(){var t,e,n,r,i,o=(t=x.current,e=t.getBoundingClientRect(),n={left:e.left,top:e.top},r=t.ownerDocument,i=r.defaultView||r.parentWindow,n.left+=g(i),n.top+=g(i,!0),n);M(b?"".concat(b.x-o.left,"px ").concat(b.y-o.top,"px"):"")}return E&&(A.transformOrigin=E),a.createElement(v.Ay,{visible:h,onVisibleChanged:y,onAppearPrepare:C,onEnterPrepare:C,forceRender:d,motionName:p,removeOnLeave:f,ref:x},(function(i,h){var d=i.className,f=i.style;return a.createElement(S,(0,r.A)({},t,{ref:e,title:o,ariaId:m,prefixCls:n,holderRef:h,style:(0,u.A)((0,u.A)((0,u.A)({},f),s),A),className:c()(l,d)}))}))}));E.displayName="Content";const M=E;function A(t){var e=t.prefixCls,n=t.style,i=t.visible,o=t.maskProps,s=t.motionName,l=t.className;return a.createElement(v.Ay,{key:"mask",visible:i,motionName:s,leavedClassName:"".concat(e,"-mask-hidden")},(function(t,i){var s=t.className,h=t.style;return a.createElement("div",(0,r.A)({ref:i,style:(0,u.A)((0,u.A)({},h),n),className:c()("".concat(e,"-mask"),s,l)},o))}))}n(68210);function C(t){var e=t.prefixCls,n=void 0===e?"rc-dialog":e,o=t.zIndex,s=t.visible,l=void 0!==s&&s,g=t.keyboard,v=void 0===g||g,y=t.focusTriggerAfterClose,b=void 0===y||y,x=t.wrapStyle,w=t.wrapClassName,_=t.wrapProps,S=t.onClose,E=t.afterOpenChange,C=t.afterClose,T=t.transitionName,k=t.animation,I=t.closable,N=void 0===I||I,P=t.mask,O=void 0===P||P,L=t.maskTransitionName,R=t.maskAnimation,D=t.maskClosable,z=void 0===D||D,F=t.maskStyle,B=t.maskProps,U=t.rootClassName,j=t.classNames,V=t.styles;var H=(0,a.useRef)(),G=(0,a.useRef)(),W=(0,a.useRef)(),X=a.useState(l),Y=(0,i.A)(X,2),q=Y[0],$=Y[1],K=(0,d.A)();function Z(t){null==S||S(t)}var Q=(0,a.useRef)(!1),J=(0,a.useRef)(),tt=null;return z&&(tt=function(t){Q.current?Q.current=!1:G.current===t.target&&Z(t)}),(0,a.useEffect)((function(){l&&($(!0),(0,h.A)(G.current,document.activeElement)||(H.current=document.activeElement))}),[l]),(0,a.useEffect)((function(){return function(){clearTimeout(J.current)}}),[]),a.createElement("div",(0,r.A)({className:c()("".concat(n,"-root"),U)},(0,p.A)(t,{data:!0})),a.createElement(A,{prefixCls:n,visible:O&&l,motionName:m(n,L,R),style:(0,u.A)((0,u.A)({zIndex:o},F),null==V?void 0:V.mask),maskProps:B,className:null==j?void 0:j.mask}),a.createElement("div",(0,r.A)({tabIndex:-1,onKeyDown:function(t){if(v&&t.keyCode===f.A.ESC)return t.stopPropagation(),void Z(t);l&&t.keyCode===f.A.TAB&&W.current.changeActive(!t.shiftKey)},className:c()("".concat(n,"-wrap"),w,null==j?void 0:j.wrapper),ref:G,onClick:tt,style:(0,u.A)((0,u.A)((0,u.A)({zIndex:o},x),null==V?void 0:V.wrapper),{},{display:q?null:"none"})},_),a.createElement(M,(0,r.A)({},t,{onMouseDown:function(){clearTimeout(J.current),Q.current=!0},onMouseUp:function(){J.current=setTimeout((function(){Q.current=!1}))},ref:W,closable:N,ariaId:K,prefixCls:n,visible:l&&q,onClose:Z,onVisibleChanged:function(t){if(t)(0,h.A)(G.current,document.activeElement)||null===(e=W.current)||void 0===e||e.focus();else{if($(!1),O&&H.current&&b){try{H.current.focus({preventScroll:!0})}catch(t){}H.current=null}q&&(null==C||C())}var e;null==E||E(t)},motionName:m(n,T,k)}))))}var T=function(t){var e=t.visible,n=t.getContainer,u=t.forceRender,l=t.destroyOnClose,c=void 0!==l&&l,h=t.afterClose,d=t.panelRef,f=a.useState(e),p=(0,i.A)(f,2),m=p[0],g=p[1],v=a.useMemo((function(){return{panel:d}}),[d]);return a.useEffect((function(){e&&g(!0)}),[e]),u||!c||m?a.createElement(s.Provider,{value:v},a.createElement(o.A,{open:e||u||m,autoDestroy:!1,getContainer:n,autoLock:e||m},a.createElement(C,(0,r.A)({},t,{destroyOnClose:c,afterClose:function(){null==h||h(),g(!1)}})))):null};T.displayName="Dialog";const k=T},42013:(t,e,n)=>{"use strict";var r=n(96540),i=n(58168),o=n(53986),a=n(90675),s=n(10467),u=n(89379),l=n(60436),c=n(23029),h=n(92901),d=n(9417),f=n(15361),p=n(29426),m=n(64467),g=n(82546),v=n(43210),y=n(68210),b="RC_FORM_INTERNAL_HOOKS",x=function(){(0,y.Ay)(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")};const w=r.createContext({getFieldValue:x,getFieldsValue:x,getFieldError:x,getFieldWarning:x,getFieldsError:x,isFieldsTouched:x,isFieldTouched:x,isFieldValidating:x,isFieldsValidating:x,resetFields:x,setFields:x,setFieldValue:x,setFieldsValue:x,validateFields:x,submit:x,getInternalHooks:function(){return x(),{dispatch:x,initEntityValue:x,registerField:x,useSubscribe:x,setInitialValues:x,destroyForm:x,setCallbacks:x,registerWatch:x,getFields:x,setValidateMessages:x,setPreserve:x,getInitialValue:x}}});const _=r.createContext(null);function S(t){return null==t?[]:Array.isArray(t)?t:[t]}function E(){return E=Object.assign?Object.assign.bind():function(t){for(var e=1;e1?e-1:0),r=1;r=o)return t;switch(t){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(t){return"[Circular]"}break;default:return t}})):t}function P(t,e){return null==t||(!("array"!==e||!Array.isArray(t)||t.length)||!(!function(t){return"string"===t||"url"===t||"hex"===t||"email"===t||"date"===t||"pattern"===t}(e)||"string"!=typeof t||t))}function O(t,e,n){var r=0,i=t.length;!function o(a){if(a&&a.length)n(a);else{var s=r;r+=1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,j=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,V={integer:function(t){return V.number(t)&&parseInt(t,10)===t},float:function(t){return V.number(t)&&!V.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(t){return!1}},date:function(t){return"function"==typeof t.getTime&&"function"==typeof t.getMonth&&"function"==typeof t.getYear&&!isNaN(t.getTime())},number:function(t){return!isNaN(t)&&"number"==typeof t},object:function(t){return"object"==typeof t&&!V.array(t)},method:function(t){return"function"==typeof t},email:function(t){return"string"==typeof t&&t.length<=320&&!!t.match(U)},url:function(t){return"string"==typeof t&&t.length<=2048&&!!t.match(function(){if(F)return F;var t="[a-fA-F\\d:]",e=function(e){return e&&e.includeBoundaries?"(?:(?<=\\s|^)(?="+t+")|(?<="+t+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=("\n(?:\n(?:"+r+":){7}(?:"+r+"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:"+r+":){6}(?:"+n+"|:"+r+"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:"+r+":){5}(?::"+n+"|(?::"+r+"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:"+r+":){4}(?:(?::"+r+"){0,1}:"+n+"|(?::"+r+"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:"+r+":){3}(?:(?::"+r+"){0,2}:"+n+"|(?::"+r+"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:"+r+":){2}(?:(?::"+r+"){0,3}:"+n+"|(?::"+r+"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:"+r+":){1}(?:(?::"+r+"){0,4}:"+n+"|(?::"+r+"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::"+r+"){0,5}:"+n+"|(?::"+r+"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+n+"$)|(?:^"+i+"$)"),a=new RegExp("^"+n+"$"),s=new RegExp("^"+i+"$"),u=function(t){return t&&t.exact?o:new RegExp("(?:"+e(t)+n+e(t)+")|(?:"+e(t)+i+e(t)+")","g")};u.v4=function(t){return t&&t.exact?a:new RegExp(""+e(t)+n+e(t),"g")},u.v6=function(t){return t&&t.exact?s:new RegExp(""+e(t)+i+e(t),"g")};var l=u.v4().source,c=u.v6().source;return F=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+l+"|"+c+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(t){return"string"==typeof t&&!!t.match(j)}},H="enum",G={required:B,whitespace:function(t,e,n,r,i){(/^\s+$/.test(e)||""===e)&&r.push(N(i.messages.whitespace,t.fullField))},type:function(t,e,n,r,i){if(t.required&&void 0===e)B(t,e,n,r,i);else{var o=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(o)>-1?V[o](e)||r.push(N(i.messages.types[o],t.fullField,t.type)):o&&typeof e!==t.type&&r.push(N(i.messages.types[o],t.fullField,t.type))}},range:function(t,e,n,r,i){var o="number"==typeof t.len,a="number"==typeof t.min,s="number"==typeof t.max,u=e,l=null,c="number"==typeof e,h="string"==typeof e,d=Array.isArray(e);if(c?l="number":h?l="string":d&&(l="array"),!l)return!1;d&&(u=e.length),h&&(u=e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),o?u!==t.len&&r.push(N(i.messages[l].len,t.fullField,t.len)):a&&!s&&ut.max?r.push(N(i.messages[l].max,t.fullField,t.max)):a&&s&&(ut.max)&&r.push(N(i.messages[l].range,t.fullField,t.min,t.max))},enum:function(t,e,n,r,i){t[H]=Array.isArray(t[H])?t[H]:[],-1===t[H].indexOf(e)&&r.push(N(i.messages[H],t.fullField,t[H].join(", ")))},pattern:function(t,e,n,r,i){if(t.pattern)if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(e)||r.push(N(i.messages.pattern.mismatch,t.fullField,e,t.pattern));else if("string"==typeof t.pattern){new RegExp(t.pattern).test(e)||r.push(N(i.messages.pattern.mismatch,t.fullField,e,t.pattern))}}},W=function(t,e,n,r,i){var o=t.type,a=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e,o)&&!t.required)return n();G.required(t,e,r,a,i,o),P(e,o)||G.type(t,e,r,a,i)}n(a)},X={string:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e,"string")&&!t.required)return n();G.required(t,e,r,o,i,"string"),P(e,"string")||(G.type(t,e,r,o,i),G.range(t,e,r,o,i),G.pattern(t,e,r,o,i),!0===t.whitespace&&G.whitespace(t,e,r,o,i))}n(o)},method:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i),void 0!==e&&G.type(t,e,r,o,i)}n(o)},number:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(""===e&&(e=void 0),P(e)&&!t.required)return n();G.required(t,e,r,o,i),void 0!==e&&(G.type(t,e,r,o,i),G.range(t,e,r,o,i))}n(o)},boolean:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i),void 0!==e&&G.type(t,e,r,o,i)}n(o)},regexp:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i),P(e)||G.type(t,e,r,o,i)}n(o)},integer:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i),void 0!==e&&(G.type(t,e,r,o,i),G.range(t,e,r,o,i))}n(o)},float:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i),void 0!==e&&(G.type(t,e,r,o,i),G.range(t,e,r,o,i))}n(o)},array:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(null==e&&!t.required)return n();G.required(t,e,r,o,i,"array"),null!=e&&(G.type(t,e,r,o,i),G.range(t,e,r,o,i))}n(o)},object:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i),void 0!==e&&G.type(t,e,r,o,i)}n(o)},enum:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i),void 0!==e&&G.enum(t,e,r,o,i)}n(o)},pattern:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e,"string")&&!t.required)return n();G.required(t,e,r,o,i),P(e,"string")||G.pattern(t,e,r,o,i)}n(o)},date:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e,"date")&&!t.required)return n();var a;if(G.required(t,e,r,o,i),!P(e,"date"))a=e instanceof Date?e:new Date(e),G.type(t,a,r,o,i),a&&G.range(t,a.getTime(),r,o,i)}n(o)},url:W,hex:W,email:W,required:function(t,e,n,r,i){var o=[],a=Array.isArray(e)?"array":typeof e;G.required(t,e,r,o,i,a),n(o)},any:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(P(e)&&!t.required)return n();G.required(t,e,r,o,i)}n(o)}};function Y(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var q=Y(),$=function(){function t(t){this.rules=null,this._messages=q,this.define(t)}var e=t.prototype;return e.define=function(t){var e=this;if(!t)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof t||Array.isArray(t))throw new Error("Rules must be an object");this.rules={},Object.keys(t).forEach((function(n){var r=t[n];e.rules[n]=Array.isArray(r)?r:[r]}))},e.messages=function(t){return t&&(this._messages=z(Y(),t)),this._messages},e.validate=function(e,n,r){var i=this;void 0===n&&(n={}),void 0===r&&(r=function(){});var o=e,a=n,s=r;if("function"==typeof a&&(s=a,a={}),!this.rules||0===Object.keys(this.rules).length)return s&&s(null,o),Promise.resolve(o);if(a.messages){var u=this.messages();u===q&&(u=Y()),z(u,a.messages),a.messages=u}else a.messages=this.messages();var l={};(a.keys||Object.keys(this.rules)).forEach((function(t){var n=i.rules[t],r=o[t];n.forEach((function(n){var a=n;"function"==typeof a.transform&&(o===e&&(o=E({},o)),r=o[t]=a.transform(r)),(a="function"==typeof a?{validator:a}:E({},a)).validator=i.getValidationMethod(a),a.validator&&(a.field=t,a.fullField=a.fullField||t,a.type=i.getType(a),l[t]=l[t]||[],l[t].push({rule:a,value:r,source:o,field:t}))}))}));var c={};return R(l,a,(function(e,n){var r,i=e.rule,s=!("object"!==i.type&&"array"!==i.type||"object"!=typeof i.fields&&"object"!=typeof i.defaultField);function u(t,e){return E({},e,{fullField:i.fullField+"."+t,fullFields:i.fullFields?[].concat(i.fullFields,[t]):[t]})}function l(r){void 0===r&&(r=[]);var l=Array.isArray(r)?r:[r];!a.suppressWarning&&l.length&&t.warning("async-validator:",l),l.length&&void 0!==i.message&&(l=[].concat(i.message));var h=l.map(D(i,o));if(a.first&&h.length)return c[i.field]=1,n(h);if(s){if(i.required&&!e.value)return void 0!==i.message?h=[].concat(i.message).map(D(i,o)):a.error&&(h=[a.error(i,N(a.messages.required,i.field))]),n(h);var d={};i.defaultField&&Object.keys(e.value).map((function(t){d[t]=i.defaultField})),d=E({},d,e.rule.fields);var f={};Object.keys(d).forEach((function(t){var e=d[t],n=Array.isArray(e)?e:[e];f[t]=n.map(u.bind(null,t))}));var p=new t(f);p.messages(a.messages),e.rule.options&&(e.rule.options.messages=a.messages,e.rule.options.error=a.error),p.validate(e.value,e.rule.options||a,(function(t){var e=[];h&&h.length&&e.push.apply(e,h),t&&t.length&&e.push.apply(e,t),n(e.length?e:null)}))}else n(h)}if(s=s&&(i.required||!i.required&&e.value),i.field=e.field,i.asyncValidator)r=i.asyncValidator(i,e.value,l,e.source,a);else if(i.validator){try{r=i.validator(i,e.value,l,e.source,a)}catch(t){null==console.error||console.error(t),a.suppressValidatorError||setTimeout((function(){throw t}),0),l(t.message)}!0===r?l():!1===r?l("function"==typeof i.message?i.message(i.fullField||i.field):i.message||(i.fullField||i.field)+" fails"):r instanceof Array?l(r):r instanceof Error&&l(r.message)}r&&r.then&&r.then((function(){return l()}),(function(t){return l(t)}))}),(function(t){!function(t){for(var e,n,r=[],i={},a=0;a2&&void 0!==arguments[2]&&arguments[2];return t&&t.some((function(t){return dt(e,t,n)}))}function dt(t,e){return!(!t||!e)&&(!(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&t.length!==e.length)&&e.every((function(e,n){return t[n]===e})))}function ft(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&"object"===(0,st.A)(e.target)&&t in e.target?e.target[t]:e}function pt(t,e,n){var r=t.length;if(e<0||e>=r||n<0||n>=r)return t;var i=t[e],o=e-n;return o>0?[].concat((0,l.A)(t.slice(0,n)),[i],(0,l.A)(t.slice(n,e)),(0,l.A)(t.slice(e+1,r))):o<0?[].concat((0,l.A)(t.slice(0,e)),(0,l.A)(t.slice(e+1,n+1)),[i],(0,l.A)(t.slice(n+1,r))):t}var mt=["name"],gt=[];function vt(t,e,n,r,i,o){return"function"==typeof t?t(e,n,"source"in o?{source:o.source}:{}):r!==i}var yt=function(t){(0,f.A)(n,t);var e=(0,p.A)(n);function n(t){var i;((0,c.A)(this,n),i=e.call(this,t),(0,m.A)((0,d.A)(i),"state",{resetCount:0}),(0,m.A)((0,d.A)(i),"cancelRegisterFunc",null),(0,m.A)((0,d.A)(i),"mounted",!1),(0,m.A)((0,d.A)(i),"touched",!1),(0,m.A)((0,d.A)(i),"dirty",!1),(0,m.A)((0,d.A)(i),"validatePromise",void 0),(0,m.A)((0,d.A)(i),"prevValidating",void 0),(0,m.A)((0,d.A)(i),"errors",gt),(0,m.A)((0,d.A)(i),"warnings",gt),(0,m.A)((0,d.A)(i),"cancelRegister",(function(){var t=i.props,e=t.preserve,n=t.isListField,r=t.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(n,e,lt(r)),i.cancelRegisterFunc=null})),(0,m.A)((0,d.A)(i),"getNamePath",(function(){var t=i.props,e=t.name,n=t.fieldContext.prefixName,r=void 0===n?[]:n;return void 0!==e?[].concat((0,l.A)(r),(0,l.A)(e)):[]})),(0,m.A)((0,d.A)(i),"getRules",(function(){var t=i.props,e=t.rules,n=void 0===e?[]:e,r=t.fieldContext;return n.map((function(t){return"function"==typeof t?t(r):t}))})),(0,m.A)((0,d.A)(i),"refresh",(function(){i.mounted&&i.setState((function(t){return{resetCount:t.resetCount+1}}))})),(0,m.A)((0,d.A)(i),"metaCache",null),(0,m.A)((0,d.A)(i),"triggerMetaEvent",(function(t){var e=i.props.onMetaChange;if(e){var n=(0,u.A)((0,u.A)({},i.getMeta()),{},{destroy:t});(0,v.A)(i.metaCache,n)||e(n),i.metaCache=n}else i.metaCache=null})),(0,m.A)((0,d.A)(i),"onStoreChange",(function(t,e,n){var r=i.props,o=r.shouldUpdate,a=r.dependencies,s=void 0===a?[]:a,u=r.onReset,l=n.store,c=i.getNamePath(),h=i.getValue(t),d=i.getValue(l),f=e&&ht(e,c);switch("valueUpdate"!==n.type||"external"!==n.source||(0,v.A)(h,d)||(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=gt,i.warnings=gt,i.triggerMetaEvent()),n.type){case"reset":if(!e||f)return i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=gt,i.warnings=gt,i.triggerMetaEvent(),null==u||u(),void i.refresh();break;case"remove":if(o)return void i.reRender();break;case"setField":var p=n.data;if(f)return"touched"in p&&(i.touched=p.touched),"validating"in p&&!("originRCField"in p)&&(i.validatePromise=p.validating?Promise.resolve([]):null),"errors"in p&&(i.errors=p.errors||gt),"warnings"in p&&(i.warnings=p.warnings||gt),i.dirty=!0,i.triggerMetaEvent(),void i.reRender();if("value"in p&&ht(e,c,!0))return void i.reRender();if(o&&!c.length&&vt(o,t,l,h,d,n))return void i.reRender();break;case"dependenciesUpdate":if(s.map(lt).some((function(t){return ht(n.relatedFields,t)})))return void i.reRender();break;default:if(f||(!s.length||c.length||o)&&vt(o,t,l,h,d,n))return void i.reRender()}!0===o&&i.reRender()})),(0,m.A)((0,d.A)(i),"validateRules",(function(t){var e=i.getNamePath(),n=i.getValue(),r=t||{},o=r.triggerName,u=r.validateOnly,c=void 0!==u&&u,h=Promise.resolve().then((0,s.A)((0,a.A)().mark((function r(){var s,u,c,d,f,p,m;return(0,a.A)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i.mounted){r.next=2;break}return r.abrupt("return",[]);case 2:if(s=i.props,u=s.validateFirst,c=void 0!==u&&u,d=s.messageVariables,f=s.validateDebounce,p=i.getRules(),o&&(p=p.filter((function(t){return t})).filter((function(t){var e=t.validateTrigger;return!e||S(e).includes(o)}))),!f||!o){r.next=10;break}return r.next=8,new Promise((function(t){setTimeout(t,f)}));case 8:if(i.validatePromise===h){r.next=10;break}return r.abrupt("return",[]);case 10:return(m=it(e,n,p,t,c,d)).catch((function(t){return t})).then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gt;if(i.validatePromise===h){var e;i.validatePromise=null;var n=[],r=[];null===(e=t.forEach)||void 0===e||e.call(t,(function(t){var e=t.rule.warningOnly,i=t.errors,o=void 0===i?gt:i;e?r.push.apply(r,(0,l.A)(o)):n.push.apply(n,(0,l.A)(o))})),i.errors=n,i.warnings=r,i.triggerMetaEvent(),i.reRender()}})),r.abrupt("return",m);case 13:case"end":return r.stop()}}),r)}))));return c||(i.validatePromise=h,i.dirty=!0,i.errors=gt,i.warnings=gt,i.triggerMetaEvent(),i.reRender()),h})),(0,m.A)((0,d.A)(i),"isFieldValidating",(function(){return!!i.validatePromise})),(0,m.A)((0,d.A)(i),"isFieldTouched",(function(){return i.touched})),(0,m.A)((0,d.A)(i),"isFieldDirty",(function(){return!(!i.dirty&&void 0===i.props.initialValue)||void 0!==(0,i.props.fieldContext.getInternalHooks(b).getInitialValue)(i.getNamePath())})),(0,m.A)((0,d.A)(i),"getErrors",(function(){return i.errors})),(0,m.A)((0,d.A)(i),"getWarnings",(function(){return i.warnings})),(0,m.A)((0,d.A)(i),"isListField",(function(){return i.props.isListField})),(0,m.A)((0,d.A)(i),"isList",(function(){return i.props.isList})),(0,m.A)((0,d.A)(i),"isPreserve",(function(){return i.props.preserve})),(0,m.A)((0,d.A)(i),"getMeta",(function(){return i.prevValidating=i.isFieldValidating(),{touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:null===i.validatePromise}})),(0,m.A)((0,d.A)(i),"getOnlyChild",(function(t){if("function"==typeof t){var e=i.getMeta();return(0,u.A)((0,u.A)({},i.getOnlyChild(t(i.getControlled(),e,i.props.fieldContext))),{},{isFunction:!0})}var n=(0,g.A)(t);return 1===n.length&&r.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}})),(0,m.A)((0,d.A)(i),"getValue",(function(t){var e=i.props.fieldContext.getFieldsValue,n=i.getNamePath();return(0,ut.A)(t||e(!0),n)})),(0,m.A)((0,d.A)(i),"getControlled",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=i.props,n=e.name,r=e.trigger,o=e.validateTrigger,a=e.getValueFromEvent,s=e.normalize,l=e.valuePropName,c=e.getValueProps,h=e.fieldContext,d=void 0!==o?o:h.validateTrigger,f=i.getNamePath(),p=h.getInternalHooks,g=h.getFieldsValue,v=p(b).dispatch,y=i.getValue(),x=c||function(t){return(0,m.A)({},l,t)},w=t[r],_=void 0!==n?x(y):{};var E=(0,u.A)((0,u.A)({},t),_);return E[r]=function(){var t;i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var e=arguments.length,n=new Array(e),r=0;r=0&&e<=n.length?(d.keys=[].concat((0,l.A)(d.keys.slice(0,e)),[d.id],(0,l.A)(d.keys.slice(e))),o([].concat((0,l.A)(n.slice(0,e)),[t],(0,l.A)(n.slice(e))))):(d.keys=[].concat((0,l.A)(d.keys),[d.id]),o([].concat((0,l.A)(n),[t]))),d.id+=1},remove:function(t){var e=s(),n=new Set(Array.isArray(t)?t:[t]);n.size<=0||(d.keys=d.keys.filter((function(t,e){return!n.has(e)})),o(e.filter((function(t,e){return!n.has(e)}))))},move:function(t,e){if(t!==e){var n=s();t<0||t>=n.length||e<0||e>=n.length||(d.keys=pt(d.keys,t,e),o(pt(n,t,e)))}}},h=r||[];return Array.isArray(h)||(h=[]),i(h.map((function(t,e){var n=d.keys[e];return void 0===n&&(d.keys[e]=d.id,n=d.keys[e],d.id+=1),{name:e,key:n,isListField:!0}})),u,e)}))))};var wt=n(5544);var _t="__@field_split__";function St(t){return t.map((function(t){return"".concat((0,st.A)(t),":").concat(t)})).join(_t)}var Et=function(){function t(){(0,c.A)(this,t),(0,m.A)(this,"kvs",new Map)}return(0,h.A)(t,[{key:"set",value:function(t,e){this.kvs.set(St(t),e)}},{key:"get",value:function(t){return this.kvs.get(St(t))}},{key:"update",value:function(t,e){var n=e(this.get(t));n?this.set(t,n):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(St(t))}},{key:"map",value:function(t){return(0,l.A)(this.kvs.entries()).map((function(e){var n=(0,wt.A)(e,2),r=n[0],i=n[1],o=r.split(_t);return t({key:o.map((function(t){var e=t.match(/^([^:]*):(.*)$/),n=(0,wt.A)(e,3),r=n[1],i=n[2];return"number"===r?Number(i):i})),value:i})}))}},{key:"toJSON",value:function(){var t={};return this.map((function(e){var n=e.key,r=e.value;return t[n.join(".")]=r,null})),t}}]),t}();const Mt=Et;var At=["name"],Ct=(0,h.A)((function t(e){var n=this;(0,c.A)(this,t),(0,m.A)(this,"formHooked",!1),(0,m.A)(this,"forceRootUpdate",void 0),(0,m.A)(this,"subscribable",!0),(0,m.A)(this,"store",{}),(0,m.A)(this,"fieldEntities",[]),(0,m.A)(this,"initialValues",{}),(0,m.A)(this,"callbacks",{}),(0,m.A)(this,"validateMessages",null),(0,m.A)(this,"preserve",null),(0,m.A)(this,"lastValidatePromise",null),(0,m.A)(this,"getForm",(function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}})),(0,m.A)(this,"getInternalHooks",(function(t){return t===b?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):((0,y.Ay)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)})),(0,m.A)(this,"useSubscribe",(function(t){n.subscribable=t})),(0,m.A)(this,"prevWithoutPreserves",null),(0,m.A)(this,"setInitialValues",(function(t,e){if(n.initialValues=t||{},e){var r,i=(0,Q.h)(t,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map((function(e){var n=e.key;i=(0,Q.A)(i,n,(0,ut.A)(t,n))})),n.prevWithoutPreserves=null,n.updateStore(i)}})),(0,m.A)(this,"destroyForm",(function(){var t=new Mt;n.getFieldEntities(!0).forEach((function(e){n.isMergedPreserve(e.isPreserve())||t.set(e.getNamePath(),!0)})),n.prevWithoutPreserves=t})),(0,m.A)(this,"getInitialValue",(function(t){var e=(0,ut.A)(n.initialValues,t);return t.length?(0,Q.h)(e):e})),(0,m.A)(this,"setCallbacks",(function(t){n.callbacks=t})),(0,m.A)(this,"setValidateMessages",(function(t){n.validateMessages=t})),(0,m.A)(this,"setPreserve",(function(t){n.preserve=t})),(0,m.A)(this,"watchList",[]),(0,m.A)(this,"registerWatch",(function(t){return n.watchList.push(t),function(){n.watchList=n.watchList.filter((function(e){return e!==t}))}})),(0,m.A)(this,"notifyWatch",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var e=n.getFieldsValue(),r=n.getFieldsValue(!0);n.watchList.forEach((function(n){n(e,r,t)}))}})),(0,m.A)(this,"timeoutId",null),(0,m.A)(this,"warningUnhooked",(function(){0})),(0,m.A)(this,"updateStore",(function(t){n.store=t})),(0,m.A)(this,"getFieldEntities",(function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?n.fieldEntities.filter((function(t){return t.getNamePath().length})):n.fieldEntities})),(0,m.A)(this,"getFieldsMap",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=new Mt;return n.getFieldEntities(t).forEach((function(t){var n=t.getNamePath();e.set(n,t)})),e})),(0,m.A)(this,"getFieldEntitiesForNamePathList",(function(t){if(!t)return n.getFieldEntities(!0);var e=n.getFieldsMap(!0);return t.map((function(t){var n=lt(t);return e.get(n)||{INVALIDATE_NAME_PATH:lt(t)}}))})),(0,m.A)(this,"getFieldsValue",(function(t,e){var r,i,o;if(n.warningUnhooked(),!0===t||Array.isArray(t)?(r=t,i=e):t&&"object"===(0,st.A)(t)&&(o=t.strict,i=t.filter),!0===r&&!i)return n.store;var a=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),s=[];return a.forEach((function(t){var e,n,a,u,l="INVALIDATE_NAME_PATH"in t?t.INVALIDATE_NAME_PATH:t.getNamePath();if(o){if(null!==(a=(u=t).isList)&&void 0!==a&&a.call(u))return}else if(!r&&null!==(e=(n=t).isListField)&&void 0!==e&&e.call(n))return;if(i){var c="getMeta"in t?t.getMeta():null;i(c)&&s.push(l)}else s.push(l)})),ct(n.store,s.map(lt))})),(0,m.A)(this,"getFieldValue",(function(t){n.warningUnhooked();var e=lt(t);return(0,ut.A)(n.store,e)})),(0,m.A)(this,"getFieldsError",(function(t){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(t).map((function(e,n){return e&&!("INVALIDATE_NAME_PATH"in e)?{name:e.getNamePath(),errors:e.getErrors(),warnings:e.getWarnings()}:{name:lt(t[n]),errors:[],warnings:[]}}))})),(0,m.A)(this,"getFieldError",(function(t){n.warningUnhooked();var e=lt(t);return n.getFieldsError([e])[0].errors})),(0,m.A)(this,"getFieldWarning",(function(t){n.warningUnhooked();var e=lt(t);return n.getFieldsError([e])[0].warnings})),(0,m.A)(this,"isFieldsTouched",(function(){n.warningUnhooked();for(var t=arguments.length,e=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=new Mt,r=n.getFieldEntities(!0);r.forEach((function(t){var n=t.props.initialValue,r=t.getNamePath();if(void 0!==n){var i=e.get(r)||new Set;i.add({entity:t,value:n}),e.set(r,i)}}));var i;t.entities?i=t.entities:t.namePathList?(i=[],t.namePathList.forEach((function(t){var n,r=e.get(t);r&&(n=i).push.apply(n,(0,l.A)((0,l.A)(r).map((function(t){return t.entity}))))}))):i=r,i.forEach((function(r){if(void 0!==r.props.initialValue){var i=r.getNamePath();if(void 0!==n.getInitialValue(i))(0,y.Ay)(!1,"Form already set 'initialValues' with path '".concat(i.join("."),"'. Field can not overwrite it."));else{var o=e.get(i);if(o&&o.size>1)(0,y.Ay)(!1,"Multiple Field with path '".concat(i.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(o){var a=n.getFieldValue(i);r.isListField()||t.skipExist&&void 0!==a||n.updateStore((0,Q.A)(n.store,i,(0,l.A)(o)[0].value))}}}}))})),(0,m.A)(this,"resetFields",(function(t){n.warningUnhooked();var e=n.store;if(!t)return n.updateStore((0,Q.h)(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(e,null,{type:"reset"}),void n.notifyWatch();var r=t.map(lt);r.forEach((function(t){var e=n.getInitialValue(t);n.updateStore((0,Q.A)(n.store,t,e))})),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(e,r,{type:"reset"}),n.notifyWatch(r)})),(0,m.A)(this,"setFields",(function(t){n.warningUnhooked();var e=n.store,r=[];t.forEach((function(t){var i=t.name,a=(0,o.A)(t,At),s=lt(i);r.push(s),"value"in a&&n.updateStore((0,Q.A)(n.store,s,a.value)),n.notifyObservers(e,[s],{type:"setField",data:t})})),n.notifyWatch(r)})),(0,m.A)(this,"getFields",(function(){return n.getFieldEntities(!0).map((function(t){var e=t.getNamePath(),r=t.getMeta(),i=(0,u.A)((0,u.A)({},r),{},{name:e,value:n.getFieldValue(e)});return Object.defineProperty(i,"originRCField",{value:!0}),i}))})),(0,m.A)(this,"initEntityValue",(function(t){var e=t.props.initialValue;if(void 0!==e){var r=t.getNamePath();void 0===(0,ut.A)(n.store,r)&&n.updateStore((0,Q.A)(n.store,r,e))}})),(0,m.A)(this,"isMergedPreserve",(function(t){var e=void 0!==t?t:n.preserve;return null==e||e})),(0,m.A)(this,"registerField",(function(t){n.fieldEntities.push(t);var e=t.getNamePath();if(n.notifyWatch([e]),void 0!==t.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[t],skipExist:!0}),n.notifyObservers(r,[t.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter((function(e){return e!==t})),!n.isMergedPreserve(i)&&(!r||o.length>1)){var a=r?void 0:n.getInitialValue(e);if(e.length&&n.getFieldValue(e)!==a&&n.fieldEntities.every((function(t){return!dt(t.getNamePath(),e)}))){var s=n.store;n.updateStore((0,Q.A)(s,e,a,!0)),n.notifyObservers(s,[e],{type:"remove"}),n.triggerDependenciesUpdate(s,e)}}n.notifyWatch([e])}})),(0,m.A)(this,"dispatch",(function(t){switch(t.type){case"updateValue":var e=t.namePath,r=t.value;n.updateValue(e,r);break;case"validateField":var i=t.namePath,o=t.triggerName;n.validateFields([i],{triggerName:o})}})),(0,m.A)(this,"notifyObservers",(function(t,e,r){if(n.subscribable){var i=(0,u.A)((0,u.A)({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach((function(n){(0,n.onStoreChange)(t,e,i)}))}else n.forceRootUpdate()})),(0,m.A)(this,"triggerDependenciesUpdate",(function(t,e){var r=n.getDependencyChildrenFields(e);return r.length&&n.validateFields(r),n.notifyObservers(t,r,{type:"dependenciesUpdate",relatedFields:[e].concat((0,l.A)(r))}),r})),(0,m.A)(this,"updateValue",(function(t,e){var r=lt(t),i=n.store;n.updateStore((0,Q.A)(n.store,r,e)),n.notifyObservers(i,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var o=n.triggerDependenciesUpdate(i,r),a=n.callbacks.onValuesChange;a&&a(ct(n.store,[r]),n.getFieldsValue());n.triggerOnFieldsChange([r].concat((0,l.A)(o)))})),(0,m.A)(this,"setFieldsValue",(function(t){n.warningUnhooked();var e=n.store;if(t){var r=(0,Q.h)(n.store,t);n.updateStore(r)}n.notifyObservers(e,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()})),(0,m.A)(this,"setFieldValue",(function(t,e){n.setFields([{name:t,value:e}])})),(0,m.A)(this,"getDependencyChildrenFields",(function(t){var e=new Set,r=[],i=new Mt;n.getFieldEntities().forEach((function(t){(t.props.dependencies||[]).forEach((function(e){var n=lt(e);i.update(n,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return e.add(t),e}))}))}));return function t(n){(i.get(n)||new Set).forEach((function(n){if(!e.has(n)){e.add(n);var i=n.getNamePath();n.isFieldDirty()&&i.length&&(r.push(i),t(i))}}))}(t),r})),(0,m.A)(this,"triggerOnFieldsChange",(function(t,e){var r=n.callbacks.onFieldsChange;if(r){var i=n.getFields();if(e){var o=new Mt;e.forEach((function(t){var e=t.name,n=t.errors;o.set(e,n)})),i.forEach((function(t){t.errors=o.get(t.name)||t.errors}))}var a=i.filter((function(e){var n=e.name;return ht(t,n)}));a.length&&r(a,i)}})),(0,m.A)(this,"validateFields",(function(t,e){var r,i;n.warningUnhooked(),Array.isArray(t)||"string"==typeof t||"string"==typeof e?(r=t,i=e):i=t;var o=!!r,a=o?r.map(lt):[],s=[],c=String(Date.now()),h=new Set,d=i||{},f=d.recursive,p=d.dirty;n.getFieldEntities(!0).forEach((function(t){if(o||a.push(t.getNamePath()),t.props.rules&&t.props.rules.length&&(!p||t.isFieldDirty())){var e=t.getNamePath();if(h.add(e.join(c)),!o||ht(a,e,f)){var r=t.validateRules((0,u.A)({validateMessages:(0,u.A)((0,u.A)({},Z),n.validateMessages)},i));s.push(r.then((function(){return{name:e,errors:[],warnings:[]}})).catch((function(t){var n,r=[],i=[];return null===(n=t.forEach)||void 0===n||n.call(t,(function(t){var e=t.rule.warningOnly,n=t.errors;e?i.push.apply(i,(0,l.A)(n)):r.push.apply(r,(0,l.A)(n))})),r.length?Promise.reject({name:e,errors:r,warnings:i}):{name:e,errors:r,warnings:i}})))}}}));var m=function(t){var e=!1,n=t.length,r=[];return t.length?new Promise((function(i,o){t.forEach((function(t,a){t.catch((function(t){return e=!0,t})).then((function(t){n-=1,r[a]=t,n>0||(e&&o(r),i(r))}))}))})):Promise.resolve([])}(s);n.lastValidatePromise=m,m.catch((function(t){return t})).then((function(t){var e=t.map((function(t){return t.name}));n.notifyObservers(n.store,e,{type:"validateFinish"}),n.triggerOnFieldsChange(e,t)}));var g=m.then((function(){return n.lastValidatePromise===m?Promise.resolve(n.getFieldsValue(a)):Promise.reject([])})).catch((function(t){var e=t.filter((function(t){return t&&t.errors.length}));return Promise.reject({values:n.getFieldsValue(a),errorFields:e,outOfDate:n.lastValidatePromise!==m})}));g.catch((function(t){return t}));var v=a.filter((function(t){return h.has(t.join(c))}));return n.triggerOnFieldsChange(v),g})),(0,m.A)(this,"submit",(function(){n.warningUnhooked(),n.validateFields().then((function(t){var e=n.callbacks.onFinish;if(e)try{e(t)}catch(t){console.error(t)}})).catch((function(t){var e=n.callbacks.onFinishFailed;e&&e(t)}))})),this.forceRootUpdate=e}));const Tt=function(t){var e=r.useRef(),n=r.useState({}),i=(0,wt.A)(n,2)[1];if(!e.current)if(t)e.current=t;else{var o=new Ct((function(){i({})}));e.current=o.getForm()}return[e.current]};var kt=r.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}});const It=kt;var Nt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"];const Pt=function(t,e){var n=t.name,a=t.initialValues,s=t.fields,c=t.form,h=t.preserve,d=t.children,f=t.component,p=void 0===f?"form":f,m=t.validateMessages,g=t.validateTrigger,v=void 0===g?"onChange":g,y=t.onValuesChange,x=t.onFieldsChange,S=t.onFinish,E=t.onFinishFailed,M=(0,o.A)(t,Nt),A=r.useContext(It),C=Tt(c),T=(0,wt.A)(C,1)[0],k=T.getInternalHooks(b),I=k.useSubscribe,N=k.setInitialValues,P=k.setCallbacks,O=k.setValidateMessages,L=k.setPreserve,R=k.destroyForm;r.useImperativeHandle(e,(function(){return T})),r.useEffect((function(){return A.registerForm(n,T),function(){A.unregisterForm(n)}}),[A,T,n]),O((0,u.A)((0,u.A)({},A.validateMessages),m)),P({onValuesChange:y,onFieldsChange:function(t){if(A.triggerFormChange(n,t),x){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i{"use strict";n.d(e,{A:()=>j});var r=n(58168),i=n(64467),o=n(82284),a=n(5544),s=n(53986),u=n(23029),l=n(92901);function c(){return"function"==typeof BigInt}function h(t){return!t&&0!==t&&!Number.isNaN(t)||!String(t).trim()}function d(t){var e=t.trim(),n=e.startsWith("-");n&&(e=e.slice(1)),(e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(e="0".concat(e));var r=e||"0",i=r.split("."),o=i[0]||"0",a=i[1]||"0";"0"===o&&"0"===a&&(n=!1);var s=n?"-":"";return{negative:n,negativeStr:s,trimStr:r,integerStr:o,decimalStr:a,fullStr:"".concat(s).concat(r)}}function f(t){var e=String(t);return!Number.isNaN(Number(e))&&e.includes("e")}function p(t){var e=String(t);if(f(t)){var n=Number(e.slice(e.indexOf("e-")+2)),r=e.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return e.includes(".")&&g(e)?e.length-e.indexOf(".")-1:0}function m(t){var e=String(t);if(f(t)){if(t>Number.MAX_SAFE_INTEGER)return String(c()?BigInt(t).toString():Number.MAX_SAFE_INTEGER);if(t0&&void 0!==arguments[0])||arguments[0]?this.isInvalidate()?"":d("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),t}(),y=function(){function t(e){(0,u.A)(this,t),(0,i.A)(this,"origin",""),(0,i.A)(this,"number",void 0),(0,i.A)(this,"empty",void 0),h(e)?this.empty=!0:(this.origin=String(e),this.number=Number(e))}return(0,l.A)(t,[{key:"negate",value:function(){return new t(-this.toNumber())}},{key:"add",value:function(e){if(this.isInvalidate())return new t(e);var n=Number(e);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(rNumber.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(r0&&void 0!==arguments[0])||arguments[0]?this.isInvalidate()?"":m(this.number):this.origin}}]),t}();function b(t){return c()?new v(t):new y(t)}function x(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===t)return"";var i=d(t),o=i.negativeStr,a=i.integerStr,s=i.decimalStr,u="".concat(e).concat(s),l="".concat(o).concat(a);if(n>=0){var c=Number(s[n]);return c>=5&&!r?x(b(t).add("".concat(o,"0.").concat("0".repeat(n)).concat(10-c)).toString(),e,n,r):0===n?l:"".concat(l).concat(e).concat(s.padEnd(n,"0").slice(0,n))}return".0"===u?l:"".concat(l).concat(u)}const w=b;var _=n(46942),S=n.n(_),E=n(48491),M=n(30981),A=n(8719),C=n(96540),T=n(68210);var k=n(68430);const I=function(){var t=(0,C.useState)(!1),e=(0,a.A)(t,2),n=e[0],r=e[1];return(0,M.A)((function(){r((0,k.A)())}),[]),n};var N=n(25371);function P(t){var e=t.prefixCls,n=t.upNode,o=t.downNode,a=t.upDisabled,s=t.downDisabled,u=t.onStep,l=C.useRef(),c=C.useRef([]),h=C.useRef();h.current=u;var d=function(){clearTimeout(l.current)},f=function(t,e){t.preventDefault(),d(),h.current(e),l.current=setTimeout((function t(){h.current(e),l.current=setTimeout(t,200)}),600)};if(C.useEffect((function(){return function(){d(),c.current.forEach((function(t){return N.A.cancel(t)}))}}),[]),I())return null;var p="".concat(e,"-handler"),m=S()(p,"".concat(p,"-up"),(0,i.A)({},"".concat(p,"-up-disabled"),a)),g=S()(p,"".concat(p,"-down"),(0,i.A)({},"".concat(p,"-down-disabled"),s)),v=function(){return c.current.push((0,N.A)(d))},y={unselectable:"on",role:"button",onMouseUp:v,onMouseLeave:v};return C.createElement("div",{className:"".concat(p,"-wrap")},C.createElement("span",(0,r.A)({},y,{onMouseDown:function(t){f(t,!0)},"aria-label":"Increase Value","aria-disabled":a,className:m}),n||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),C.createElement("span",(0,r.A)({},y,{onMouseDown:function(t){f(t,!1)},"aria-label":"Decrease Value","aria-disabled":s,className:g}),o||C.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function O(t){var e="number"==typeof t?m(t):d(t).fullStr;return e.includes(".")?d(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:t+"0"}var L=n(11980);var R=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],D=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],z=function(t,e){return t||e.isEmpty()?e.toString():e.toNumber()},F=function(t){var e=w(t);return e.isInvalidate()?null:e},B=C.forwardRef((function(t,e){var n,u=t.prefixCls,l=void 0===u?"rc-input-number":u,c=t.className,h=t.style,d=t.min,f=t.max,v=t.step,y=void 0===v?1:v,b=t.defaultValue,_=t.value,E=t.disabled,k=t.readOnly,I=t.upHandler,L=t.downHandler,D=t.keyboard,B=t.changeOnWheel,U=void 0!==B&&B,j=t.controls,V=void 0===j||j,H=(t.classNames,t.stringMode),G=t.parser,W=t.formatter,X=t.precision,Y=t.decimalSeparator,q=t.onChange,$=t.onInput,K=t.onPressEnter,Z=t.onStep,Q=t.changeOnBlur,J=void 0===Q||Q,tt=(0,s.A)(t,R),et="".concat(l,"-input"),nt=C.useRef(null),rt=C.useState(!1),it=(0,a.A)(rt,2),ot=it[0],at=it[1],st=C.useRef(!1),ut=C.useRef(!1),lt=C.useRef(!1),ct=C.useState((function(){return w(null!=_?_:b)})),ht=(0,a.A)(ct,2),dt=ht[0],ft=ht[1];var pt=C.useCallback((function(t,e){if(!e)return X>=0?X:Math.max(p(t),p(y))}),[X,y]),mt=C.useCallback((function(t){var e=String(t);if(G)return G(e);var n=e;return Y&&(n=n.replace(Y,".")),n.replace(/[^\w.-]+/g,"")}),[G,Y]),gt=C.useRef(""),vt=C.useCallback((function(t,e){if(W)return W(t,{userTyping:e,input:String(gt.current)});var n="number"==typeof t?m(t):t;if(!e){var r=pt(n,e);if(g(n)&&(Y||r>=0))n=x(n,Y||".",r)}return n}),[W,pt,Y]),yt=C.useState((function(){var t=null!=b?b:_;return dt.isInvalidate()&&["string","number"].includes((0,o.A)(t))?Number.isNaN(t)?"":t:vt(dt.toString(),!1)})),bt=(0,a.A)(yt,2),xt=bt[0],wt=bt[1];function _t(t,e){wt(vt(t.isInvalidate()?t.toString(!1):t.toString(!e),e))}gt.current=xt;var St,Et,Mt,At,Ct,Tt=C.useMemo((function(){return F(f)}),[f,X]),kt=C.useMemo((function(){return F(d)}),[d,X]),It=C.useMemo((function(){return!(!Tt||!dt||dt.isInvalidate())&&Tt.lessEquals(dt)}),[Tt,dt]),Nt=C.useMemo((function(){return!(!kt||!dt||dt.isInvalidate())&&dt.lessEquals(kt)}),[kt,dt]),Pt=(St=nt.current,Et=ot,Mt=(0,C.useRef)(null),[function(){try{var t=St.selectionStart,e=St.selectionEnd,n=St.value,r=n.substring(0,t),i=n.substring(e);Mt.current={start:t,end:e,value:n,beforeTxt:r,afterTxt:i}}catch(t){}},function(){if(St&&Mt.current&&Et)try{var t=St.value,e=Mt.current,n=e.beforeTxt,r=e.afterTxt,i=e.start,o=t.length;if(t.endsWith(r))o=t.length-Mt.current.afterTxt.length;else if(t.startsWith(n))o=n.length;else{var a=n[i-1],s=t.indexOf(a,i-1);-1!==s&&(o=s+1)}St.setSelectionRange(o,o)}catch(t){(0,T.Ay)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(t.message))}}]),Ot=(0,a.A)(Pt,2),Lt=Ot[0],Rt=Ot[1],Dt=function(t){return Tt&&!t.lessEquals(Tt)?Tt:kt&&!kt.lessEquals(t)?kt:null},zt=function(t){return!Dt(t)},Ft=function(t,e){var n,r=t,i=zt(r)||r.isEmpty();if(r.isEmpty()||e||(r=Dt(r)||r,i=!0),!k&&!E&&i){var o=r.toString(),a=pt(o,e);return a>=0&&(r=w(x(o,".",a)),zt(r)||(r=w(x(o,".",a,!0)))),r.equals(dt)||(n=r,void 0===_&&ft(n),null==q||q(r.isEmpty()?null:z(H,r)),void 0===_&&_t(r,e)),r}return dt},Bt=(At=(0,C.useRef)(0),Ct=function(){N.A.cancel(At.current)},(0,C.useEffect)((function(){return Ct}),[]),function(t){Ct(),At.current=(0,N.A)((function(){t()}))}),Ut=function t(e){if(Lt(),gt.current=e,wt(e),!ut.current){var n=mt(e),r=w(n);r.isNaN()||Ft(r,!0)}null==$||$(e),Bt((function(){var n=e;G||(n=e.replace(/。/g,".")),n!==e&&t(n)}))},jt=function(t){var e;if(!(t&&It||!t&&Nt)){st.current=!1;var n=w(lt.current?O(y):y);t||(n=n.negate());var r=(dt||w(0)).add(n.toString()),i=Ft(r,!1);null==Z||Z(z(H,i),{offset:lt.current?O(y):y,type:t?"up":"down"}),null===(e=nt.current)||void 0===e||e.focus()}},Vt=function(t){var e=w(mt(xt)),n=e;n=e.isNaN()?Ft(dt,t):Ft(e,t),void 0!==_?_t(dt,!1):n.isNaN()||_t(n,!1)};C.useEffect((function(){if(U&&ot){var t=function(t){jt(t.deltaY<0),t.preventDefault()},e=nt.current;if(e)return e.addEventListener("wheel",t,{passive:!1}),function(){return e.removeEventListener("wheel",t)}}}));return(0,M.o)((function(){dt.isInvalidate()||_t(dt,!1)}),[X,W]),(0,M.o)((function(){var t=w(_);ft(t);var e=w(mt(xt));t.equals(e)&&st.current&&!W||_t(t,st.current)}),[_]),(0,M.o)((function(){W&&Rt()}),[xt]),C.createElement("div",{className:S()(l,c,(n={},(0,i.A)(n,"".concat(l,"-focused"),ot),(0,i.A)(n,"".concat(l,"-disabled"),E),(0,i.A)(n,"".concat(l,"-readonly"),k),(0,i.A)(n,"".concat(l,"-not-a-number"),dt.isNaN()),(0,i.A)(n,"".concat(l,"-out-of-range"),!dt.isInvalidate()&&!zt(dt)),n)),style:h,onFocus:function(){at(!0)},onBlur:function(){J&&Vt(!1),at(!1),st.current=!1},onKeyDown:function(t){var e=t.key,n=t.shiftKey;st.current=!0,lt.current=n,"Enter"===e&&(ut.current||(st.current=!1),Vt(!1),null==K||K(t)),!1!==D&&!ut.current&&["Up","ArrowUp","Down","ArrowDown"].includes(e)&&(jt("Up"===e||"ArrowUp"===e),t.preventDefault())},onKeyUp:function(){st.current=!1,lt.current=!1},onCompositionStart:function(){ut.current=!0},onCompositionEnd:function(){ut.current=!1,Ut(nt.current.value)},onBeforeInput:function(){st.current=!0}},V&&C.createElement(P,{prefixCls:l,upNode:I,downNode:L,upDisabled:It,downDisabled:Nt,onStep:jt}),C.createElement("div",{className:"".concat(et,"-wrap")},C.createElement("input",(0,r.A)({autoComplete:"off",role:"spinbutton","aria-valuemin":d,"aria-valuemax":f,"aria-valuenow":dt.isInvalidate()?null:dt.toString(),step:y},tt,{ref:(0,A.K4)(nt,e),className:et,value:xt,onChange:function(t){Ut(t.target.value)},disabled:E,readOnly:k}))))})),U=C.forwardRef((function(t,e){var n=t.disabled,i=t.style,o=t.prefixCls,a=t.value,u=t.prefix,l=t.suffix,c=t.addonBefore,h=t.addonAfter,d=t.className,f=t.classNames,p=(0,s.A)(t,D),m=C.useRef(null);return C.createElement(E.a,{className:d,triggerFocus:function(t){m.current&&(0,L.F4)(m.current,t)},prefixCls:o,value:a,disabled:n,style:i,prefix:u,suffix:l,addonAfter:h,addonBefore:c,classNames:f,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},C.createElement(B,(0,r.A)({prefixCls:o,disabled:n,ref:(0,A.K4)(m,e),className:null==f?void 0:f.input},p)))}));U.displayName="InputNumber";const j=U},22489:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(53986),i=n(89379),o=n(82284),a=n(96540),s=["show"];function u(t,e){return a.useMemo((function(){var n={};e&&(n.show="object"===(0,o.A)(e)&&e.formatter?e.formatter:!!e);var a=n=(0,i.A)((0,i.A)({},n),t),u=a.show,l=(0,r.A)(a,s);return(0,i.A)((0,i.A)({},l),{},{show:!!u,showFormatter:"function"==typeof u?u:void 0,strategy:l.strategy||function(t){return t.length}})}),[t,e])}},48491:(t,e,n)=>{"use strict";n.d(e,{a:()=>h,A:()=>b});var r=n(89379),i=n(58168),o=n(64467),a=n(82284),s=n(46942),u=n.n(s),l=n(96540),c=n(11980);const h=function(t){var e,n,s=t.inputElement,h=t.children,d=t.prefixCls,f=t.prefix,p=t.suffix,m=t.addonBefore,g=t.addonAfter,v=t.className,y=t.style,b=t.disabled,x=t.readOnly,w=t.focused,_=t.triggerFocus,S=t.allowClear,E=t.value,M=t.handleReset,A=t.hidden,C=t.classes,T=t.classNames,k=t.dataAttrs,I=t.styles,N=t.components,P=null!=h?h:s,O=(null==N?void 0:N.affixWrapper)||"span",L=(null==N?void 0:N.groupWrapper)||"span",R=(null==N?void 0:N.wrapper)||"span",D=(null==N?void 0:N.groupAddon)||"span",z=(0,l.useRef)(null),F=(0,c.OL)(t),B=(0,l.cloneElement)(P,{value:E,className:u()(P.props.className,!F&&(null==T?void 0:T.variant))||null});if(F){var U,j=null;if(S){var V,H=!b&&!x&&E,G="".concat(d,"-clear-icon"),W="object"===(0,a.A)(S)&&null!=S&&S.clearIcon?S.clearIcon:"✖";j=l.createElement("span",{onClick:M,onMouseDown:function(t){return t.preventDefault()},className:u()(G,(V={},(0,o.A)(V,"".concat(G,"-hidden"),!H),(0,o.A)(V,"".concat(G,"-has-suffix"),!!p),V)),role:"button",tabIndex:-1},W)}var X="".concat(d,"-affix-wrapper"),Y=u()(X,(U={},(0,o.A)(U,"".concat(d,"-disabled"),b),(0,o.A)(U,"".concat(X,"-disabled"),b),(0,o.A)(U,"".concat(X,"-focused"),w),(0,o.A)(U,"".concat(X,"-readonly"),x),(0,o.A)(U,"".concat(X,"-input-with-clear-btn"),p&&S&&E),U),null==C?void 0:C.affixWrapper,null==T?void 0:T.affixWrapper,null==T?void 0:T.variant),q=(p||S)&&l.createElement("span",{className:u()("".concat(d,"-suffix"),null==T?void 0:T.suffix),style:null==I?void 0:I.suffix},j,p);B=l.createElement(O,(0,i.A)({className:Y,style:null==I?void 0:I.affixWrapper,onClick:function(t){var e;null!==(e=z.current)&&void 0!==e&&e.contains(t.target)&&(null==_||_())}},null==k?void 0:k.affixWrapper,{ref:z}),f&&l.createElement("span",{className:u()("".concat(d,"-prefix"),null==T?void 0:T.prefix),style:null==I?void 0:I.prefix},f),B,q)}if((0,c.bk)(t)){var $="".concat(d,"-group"),K="".concat($,"-addon"),Z="".concat($,"-wrapper"),Q=u()("".concat(d,"-wrapper"),$,null==C?void 0:C.wrapper,null==T?void 0:T.wrapper),J=u()(Z,(0,o.A)({},"".concat(Z,"-disabled"),b),null==C?void 0:C.group,null==T?void 0:T.groupWrapper);B=l.createElement(L,{className:J},l.createElement(R,{className:Q},m&&l.createElement(D,{className:K},m),B,g&&l.createElement(D,{className:K},g)))}return l.cloneElement(B,{className:u()(null===(e=B.props)||void 0===e?void 0:e.className,v)||null,style:(0,r.A)((0,r.A)({},null===(n=B.props)||void 0===n?void 0:n.style),y),hidden:A})};var d=n(60436),f=n(5544),p=n(53986),m=n(12533),g=n(19853),v=n(22489),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"];const b=(0,l.forwardRef)((function(t,e){var n=t.autoComplete,a=t.onChange,s=t.onFocus,b=t.onBlur,x=t.onPressEnter,w=t.onKeyDown,_=t.prefixCls,S=void 0===_?"rc-input":_,E=t.disabled,M=t.htmlSize,A=t.className,C=t.maxLength,T=t.suffix,k=t.showCount,I=t.count,N=t.type,P=void 0===N?"text":N,O=t.classes,L=t.classNames,R=t.styles,D=t.onCompositionStart,z=t.onCompositionEnd,F=(0,p.A)(t,y),B=(0,l.useState)(!1),U=(0,f.A)(B,2),j=U[0],V=U[1],H=(0,l.useRef)(!1),G=(0,l.useRef)(null),W=function(t){G.current&&(0,c.F4)(G.current,t)},X=(0,m.A)(t.defaultValue,{value:t.value}),Y=(0,f.A)(X,2),q=Y[0],$=Y[1],K=null==q?"":String(q),Z=(0,l.useState)(null),Q=(0,f.A)(Z,2),J=Q[0],tt=Q[1],et=(0,v.A)(I,k),nt=et.max||C,rt=et.strategy(K),it=!!nt&&rt>nt;(0,l.useImperativeHandle)(e,(function(){return{focus:W,blur:function(){var t;null===(t=G.current)||void 0===t||t.blur()},setSelectionRange:function(t,e,n){var r;null===(r=G.current)||void 0===r||r.setSelectionRange(t,e,n)},select:function(){var t;null===(t=G.current)||void 0===t||t.select()},input:G.current}})),(0,l.useEffect)((function(){V((function(t){return(!t||!E)&&t}))}),[E]);var ot=function(t,e,n){var r,i,o=e;if(!H.current&&et.exceedFormatter&&et.max&&et.strategy(e)>et.max)e!==(o=et.exceedFormatter(e,{max:et.max}))&&tt([(null===(r=G.current)||void 0===r?void 0:r.selectionStart)||0,(null===(i=G.current)||void 0===i?void 0:i.selectionEnd)||0]);else if("compositionEnd"===n.source)return;$(o),G.current&&(0,c.gS)(G.current,t,a,o)};(0,l.useEffect)((function(){var t;J&&(null===(t=G.current)||void 0===t||t.setSelectionRange.apply(t,(0,d.A)(J)))}),[J]);var at,st=function(t){ot(t,t.target.value,{source:"change"})},ut=function(t){H.current=!1,ot(t,t.currentTarget.value,{source:"compositionEnd"}),null==z||z(t)},lt=function(t){x&&"Enter"===t.key&&x(t),null==w||w(t)},ct=function(t){V(!0),null==s||s(t)},ht=function(t){V(!1),null==b||b(t)},dt=it&&"".concat(S,"-out-of-range");return l.createElement(h,(0,i.A)({},F,{prefixCls:S,className:u()(A,dt),handleReset:function(t){$(""),W(),G.current&&(0,c.gS)(G.current,t,a)},value:K,focused:j,triggerFocus:W,suffix:function(){var t=Number(nt)>0;if(T||et.show){var e=et.showFormatter?et.showFormatter({value:K,count:rt,maxLength:nt}):"".concat(rt).concat(t?" / ".concat(nt):"");return l.createElement(l.Fragment,null,et.show&&l.createElement("span",{className:u()("".concat(S,"-show-count-suffix"),(0,o.A)({},"".concat(S,"-show-count-has-suffix"),!!T),null==L?void 0:L.count),style:(0,r.A)({},null==R?void 0:R.count)},e),T)}return null}(),disabled:E,classes:O,classNames:L,styles:R}),(at=(0,g.A)(t,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]),l.createElement("input",(0,i.A)({autoComplete:n},at,{onChange:st,onFocus:ct,onBlur:ht,onKeyDown:lt,className:u()(S,(0,o.A)({},"".concat(S,"-disabled"),E),null==L?void 0:L.input),style:null==R?void 0:R.input,ref:G,size:M,type:P,onCompositionStart:function(t){H.current=!0,null==D||D(t)},onCompositionEnd:ut}))))}))},11980:(t,e,n)=>{"use strict";function r(t){return!(!t.addonBefore&&!t.addonAfter)}function i(t){return!!(t.prefix||t.suffix||t.allowClear)}function o(t,e,n){var r=e.cloneNode(!0),i=Object.create(t,{target:{value:r},currentTarget:{value:r}});return r.value=n,"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd&&(r.selectionStart=e.selectionStart,r.selectionEnd=e.selectionEnd),i}function a(t,e,n,r){if(n){var i=e;"click"!==e.type?"file"===t.type||void 0===r?n(i):n(i=o(e,t,r)):n(i=o(e,t,""))}}function s(t,e){if(t){t.focus(e);var n=(e||{}).cursor;if(n){var r=t.value.length;switch(n){case"start":t.setSelectionRange(0,0);break;case"end":t.setSelectionRange(r,r);break;default:t.setSelectionRange(0,r)}}}}n.d(e,{F4:()=>s,OL:()=>i,bk:()=>r,gS:()=>a})},48810:(t,e,n)=>{"use strict";n.d(e,{cG:()=>Gt,q7:()=>bt,te:()=>Ht,g8:()=>Ft,Ay:()=>Zt,Wj:()=>T});var r=n(58168),i=n(64467),o=n(89379),a=n(60436),s=n(5544),u=n(53986),l=n(46942),c=n.n(l),h=n(99591),d=n(12533),f=n(43210),p=n(68210),m=n(96540),g=n(40961),v=m.createContext(null);function y(t,e){return void 0===t?null:"".concat(t,"-").concat(e)}function b(t){return y(m.useContext(v),t)}var x=n(28104),w=["children","locked"],_=m.createContext(null);function S(t){var e=t.children,n=t.locked,r=(0,u.A)(t,w),i=m.useContext(_),a=(0,x.A)((function(){return t=i,e=r,n=(0,o.A)({},t),Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)})),n;var t,e,n}),[i,r],(function(t,e){return!(n||t[0]===e[0]&&(0,f.A)(t[1],e[1],!0))}));return m.createElement(_.Provider,{value:a},e)}var E=[],M=m.createContext(null);function A(){return m.useContext(M)}var C=m.createContext(E);function T(t){var e=m.useContext(C);return m.useMemo((function(){return void 0!==t?[].concat((0,a.A)(e),[t]):e}),[e,t])}var k=m.createContext(null);const I=m.createContext({});var N=n(42467);function P(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,N.A)(t)){var n=t.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||t.isContentEditable||"a"===n&&!!t.getAttribute("href"),i=t.getAttribute("tabindex"),o=Number(i),a=null;return i&&!Number.isNaN(o)?a=o:r&&null===a&&(a=0),r&&t.disabled&&(a=null),null!==a&&(a>=0||e&&a<0)}return!1}function O(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,a.A)(t.querySelectorAll("*")).filter((function(t){return P(t,e)}));return P(t,e)&&n.unshift(t),n}var L=n(16928),R=n(25371),D=L.A.LEFT,z=L.A.RIGHT,F=L.A.UP,B=L.A.DOWN,U=L.A.ENTER,j=L.A.ESC,V=L.A.HOME,H=L.A.END,G=[F,B,D,z];function W(t,e){return O(t,!0).filter((function(t){return e.has(t)}))}function X(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!t)return null;var i=W(t,e),o=i.length,a=i.findIndex((function(t){return n===t}));return r<0?-1===a?a=o-1:a-=1:r>0&&(a+=1),i[a=(a+o)%o]}var Y=function(t,e){var n=new Set,r=new Map,i=new Map;return t.forEach((function(t){var o=document.querySelector("[data-menu-id='".concat(y(e,t),"']"));o&&(n.add(o),i.set(o,t),r.set(t,o))})),{elements:n,key2element:r,element2key:i}};function q(t,e,n,r,o,a,s,u,l,c){var h=m.useRef(),d=m.useRef();d.current=e;var f=function(){R.A.cancel(h.current)};return m.useEffect((function(){return function(){f()}}),[]),function(p){var m=p.which;if([].concat(G,[U,j,V,H]).includes(m)){var g=a(),v=Y(g,r),y=v,b=y.elements,x=y.key2element,w=y.element2key,_=function(t,e){for(var n=t||document.activeElement;n;){if(e.has(n))return n;n=n.parentElement}return null}(x.get(e),b),S=w.get(_),E=function(t,e,n,r){var o,a="prev",s="next",u="children",l="parent";if("inline"===t&&r===U)return{inlineTrigger:!0};var c=(0,i.A)((0,i.A)({},F,a),B,s),h=(0,i.A)((0,i.A)((0,i.A)((0,i.A)({},D,n?s:a),z,n?a:s),B,u),U,u),d=(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},F,a),B,s),U,u),j,l),D,n?u:l),z,n?l:u);switch(null===(o={inline:c,horizontal:h,vertical:d,inlineSub:c,horizontalSub:d,verticalSub:d}["".concat(t).concat(e?"":"Sub")])||void 0===o?void 0:o[r]){case a:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case l:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}(t,1===s(S,!0).length,n,m);if(!E&&m!==V&&m!==H)return;(G.includes(m)||[V,H].includes(m))&&p.preventDefault();var M=function(t){if(t){var e=t,n=t.querySelector("a");null!=n&&n.getAttribute("href")&&(e=n);var r=w.get(t);u(r),f(),h.current=(0,R.A)((function(){d.current===r&&e.focus()}))}};if([V,H].includes(m)||E.sibling||!_){var A,C,T=W(A=_&&"inline"!==t?function(t){for(var e=t;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}(_):o.current,b);C=m===V?T[0]:m===H?T[T.length-1]:X(A,b,_,E.offset),M(C)}else if(E.inlineTrigger)l(S);else if(E.offset>0)l(S,!0),f(),h.current=(0,R.A)((function(){v=Y(g,r);var t=_.getAttribute("aria-controls"),e=X(document.getElementById(t),v.elements);M(e)}),5);else if(E.offset<0){var k=s(S,!0),I=k[k.length-2],N=x.get(I);l(I,!1),M(N)}}null==c||c(p)}}var $="__RC_UTIL_PATH_SPLIT__",K=function(t){return t.join($)},Z="rc-menu-more";function Q(){var t=m.useState({}),e=(0,s.A)(t,2)[1],n=(0,m.useRef)(new Map),r=(0,m.useRef)(new Map),i=m.useState([]),o=(0,s.A)(i,2),u=o[0],l=o[1],c=(0,m.useRef)(0),h=(0,m.useRef)(!1),d=(0,m.useCallback)((function(t,i){var o=K(i);r.current.set(o,t),n.current.set(t,o),c.current+=1;var a,s=c.current;a=function(){s===c.current&&(h.current||e({}))},Promise.resolve().then(a)}),[]),f=(0,m.useCallback)((function(t,e){var i=K(e);r.current.delete(i),n.current.delete(t)}),[]),p=(0,m.useCallback)((function(t){l(t)}),[]),g=(0,m.useCallback)((function(t,e){var r=n.current.get(t)||"",i=r.split($);return e&&u.includes(i[0])&&i.unshift(Z),i}),[u]),v=(0,m.useCallback)((function(t,e){return t.some((function(t){return g(t,!0).includes(e)}))}),[g]),y=(0,m.useCallback)((function(t){var e="".concat(n.current.get(t)).concat($),i=new Set;return(0,a.A)(r.current.keys()).forEach((function(t){t.startsWith(e)&&i.add(r.current.get(t))})),i}),[]);return m.useEffect((function(){return function(){h.current=!0}}),[]),{registerPath:d,unregisterPath:f,refreshOverflowKeys:p,isSubPathKey:v,getKeyPath:g,getKeys:function(){var t=(0,a.A)(n.current.keys());return u.length&&t.push(Z),t},getSubPathKeys:y}}function J(t){var e=m.useRef(t);e.current=t;var n=m.useCallback((function(){for(var t,n=arguments.length,r=new Array(n),i=0;i1&&(E.motionAppear=!1);var M=E.onVisibleChanged;return E.onVisibleChanged=function(t){return g.current||t||x(!0),null==M?void 0:M(t)},b?null:m.createElement(S,{mode:u,locked:!g.current},m.createElement(Ot.Ay,(0,r.A)({visible:w},E,{forceRender:h,removeOnLeave:!1,leavedClassName:"".concat(c,"-hidden")}),(function(t){var n=t.className,r=t.style;return m.createElement(St,{id:e,className:n,style:r},a)})))}var Rt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Dt=["active"],zt=function(t){var e=t.style,n=t.className,a=t.title,l=t.eventKey,d=(t.warnKey,t.disabled),f=t.internalPopupClose,p=t.children,g=t.itemIcon,v=t.expandIcon,y=t.popupClassName,x=t.popupOffset,w=t.popupStyle,E=t.onClick,M=t.onMouseEnter,A=t.onMouseLeave,C=t.onTitleClick,N=t.onTitleMouseEnter,P=t.onTitleMouseLeave,O=(0,u.A)(t,Rt),L=b(l),R=m.useContext(_),D=R.prefixCls,z=R.mode,F=R.openKeys,B=R.disabled,U=R.overflowDisabled,j=R.activeKey,V=R.selectedKeys,H=R.itemIcon,G=R.expandIcon,W=R.onItemClick,X=R.onOpenChange,Y=R.onActive,q=m.useContext(I)._internalRenderSubMenuItem,$=m.useContext(k).isSubPathKey,K=T(),Z="".concat(D,"-submenu"),Q=B||d,tt=m.useRef(),et=m.useRef();var nt=null!=g?g:H,rt=null!=v?v:G,it=F.includes(l),ot=!U&&it,at=$(V,l),st=ut(l,Q,N,P),ht=st.active,ft=(0,u.A)(st,Dt),pt=m.useState(!1),mt=(0,s.A)(pt,2),gt=mt[0],vt=mt[1],yt=function(t){Q||vt(t)},bt=m.useMemo((function(){return ht||"inline"!==z&&(gt||$([j],l))}),[z,ht,j,gt,l,$]),xt=lt(K.length),wt=J((function(t){null==E||E(dt(t)),W(t)})),_t=L&&"".concat(L,"-popup"),Et=m.createElement("div",(0,r.A)({role:"menuitem",style:xt,className:"".concat(Z,"-title"),tabIndex:Q?null:-1,ref:tt,title:"string"==typeof a?a:null,"data-menu-id":U&&L?null:L,"aria-expanded":ot,"aria-haspopup":!0,"aria-controls":_t,"aria-disabled":Q,onClick:function(t){Q||(null==C||C({key:l,domEvent:t}),"inline"===z&&X(l,!it))},onFocus:function(){Y(l)}},ft),a,m.createElement(ct,{icon:"horizontal"!==z?rt:void 0,props:(0,o.A)((0,o.A)({},t),{},{isOpen:ot,isSubMenu:!0})},m.createElement("i",{className:"".concat(Z,"-arrow")}))),Mt=m.useRef(z);if("inline"!==z&&K.length>1?Mt.current="vertical":Mt.current=z,!U){var At=Mt.current;Et=m.createElement(Pt,{mode:At,prefixCls:Z,visible:!f&&ot&&"inline"!==z,popupClassName:y,popupOffset:x,popupStyle:w,popup:m.createElement(S,{mode:"horizontal"===At?"vertical":At},m.createElement(St,{id:_t,ref:et},p)),disabled:Q,onVisibleChange:function(t){"inline"!==z&&X(l,t)}},Et)}var Ct=m.createElement(h.A.Item,(0,r.A)({role:"none"},O,{component:"li",style:e,className:c()(Z,"".concat(Z,"-").concat(z),n,(0,i.A)((0,i.A)((0,i.A)((0,i.A)({},"".concat(Z,"-open"),ot),"".concat(Z,"-active"),bt),"".concat(Z,"-selected"),at),"".concat(Z,"-disabled"),Q)),onMouseEnter:function(t){yt(!0),null==M||M({key:l,domEvent:t})},onMouseLeave:function(t){yt(!1),null==A||A({key:l,domEvent:t})}}),Et,!U&&m.createElement(Lt,{id:_t,open:ot,keyPath:K},p));return q&&(Ct=q(Ct,t,{selected:at,active:bt,open:ot,disabled:Q})),m.createElement(S,{onItemClick:wt,mode:"horizontal"===z?"vertical":z,itemIcon:nt,expandIcon:rt},Ct)};function Ft(t){var e,n=t.eventKey,r=t.children,i=T(n),o=Mt(r,i),a=A();return m.useEffect((function(){if(a)return a.registerPath(n,i),function(){a.unregisterPath(n,i)}}),[i]),e=a?o:m.createElement(zt,t,o),m.createElement(C.Provider,{value:i},e)}var Bt=n(82284),Ut=["className","title","eventKey","children"],jt=["children"],Vt=function(t){var e=t.className,n=t.title,i=(t.eventKey,t.children),o=(0,u.A)(t,Ut),a=m.useContext(_).prefixCls,s="".concat(a,"-item-group");return m.createElement("li",(0,r.A)({role:"presentation"},o,{onClick:function(t){return t.stopPropagation()},className:c()(s,e)}),m.createElement("div",{role:"presentation",className:"".concat(s,"-title"),title:"string"==typeof n?n:void 0},n),m.createElement("ul",{role:"group",className:"".concat(s,"-list")},i))};function Ht(t){var e=t.children,n=(0,u.A)(t,jt),r=Mt(e,T(n.eventKey));return A()?r:m.createElement(Vt,(0,at.A)(n,["warnKey"]),r)}function Gt(t){var e=t.className,n=t.style,r=m.useContext(_).prefixCls;return A()?null:m.createElement("li",{role:"separator",className:c()("".concat(r,"-item-divider"),e),style:n})}var Wt=["label","children","key","type"];function Xt(t){return(t||[]).map((function(t,e){if(t&&"object"===(0,Bt.A)(t)){var n=t,i=n.label,o=n.children,a=n.key,s=n.type,l=(0,u.A)(n,Wt),c=null!=a?a:"tmp-".concat(e);return o||"group"===s?"group"===s?m.createElement(Ht,(0,r.A)({key:c},l,{title:i}),Xt(o)):m.createElement(Ft,(0,r.A)({key:c},l,{title:i}),Xt(o)):"divider"===s?m.createElement(Gt,(0,r.A)({key:c},l)):m.createElement(bt,(0,r.A)({key:c},l),i)}return null})).filter((function(t){return t}))}function Yt(t,e,n){var r=t;return e&&(r=Xt(e)),Mt(r,n)}var qt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],$t=[];var Kt=m.forwardRef((function(t,e){var n,l=t,p=l.prefixCls,y=void 0===p?"rc-menu":p,b=l.rootClassName,x=l.style,w=l.className,_=l.tabIndex,E=void 0===_?0:_,A=l.items,C=l.children,T=l.direction,N=l.id,P=l.mode,O=void 0===P?"vertical":P,L=l.inlineCollapsed,R=l.disabled,D=l.disabledOverflow,z=l.subMenuOpenDelay,F=void 0===z?.1:z,B=l.subMenuCloseDelay,U=void 0===B?.1:B,j=l.forceSubMenuRender,V=l.defaultOpenKeys,H=l.openKeys,G=l.activeKey,X=l.defaultActiveFirst,$=l.selectable,K=void 0===$||$,nt=l.multiple,rt=void 0!==nt&&nt,it=l.defaultSelectedKeys,ot=l.selectedKeys,at=l.onSelect,st=l.onDeselect,ut=l.inlineIndent,lt=void 0===ut?24:ut,ct=l.motion,ht=l.defaultMotions,ft=l.triggerSubMenuAction,pt=void 0===ft?"hover":ft,mt=l.builtinPlacements,gt=l.itemIcon,vt=l.expandIcon,yt=l.overflowedIndicator,xt=void 0===yt?"...":yt,wt=l.overflowedIndicatorPopupClassName,_t=l.getPopupContainer,St=l.onClick,Et=l.onOpenChange,Mt=l.onKeyDown,At=(l.openAnimation,l.openTransitionName,l._internalRenderMenuItem),Ct=l._internalRenderSubMenuItem,Tt=(0,u.A)(l,qt),kt=m.useMemo((function(){return Yt(C,A,$t)}),[C,A]),It=m.useState(!1),Nt=(0,s.A)(It,2),Pt=Nt[0],Ot=Nt[1],Lt=m.useRef(),Rt=function(t){var e=(0,d.A)(t,{value:t}),n=(0,s.A)(e,2),r=n[0],i=n[1];return m.useEffect((function(){et+=1;var t="".concat(tt,"-").concat(et);i("rc-menu-uuid-".concat(t))}),[]),r}(N),Dt="rtl"===T;var zt=(0,d.A)(V,{value:H,postState:function(t){return t||$t}}),Bt=(0,s.A)(zt,2),Ut=Bt[0],jt=Bt[1],Vt=function(t){function e(){jt(t),null==Et||Et(t)}arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(0,g.flushSync)(e):e()},Ht=m.useState(Ut),Gt=(0,s.A)(Ht,2),Wt=Gt[0],Xt=Gt[1],Kt=m.useRef(!1),Zt=m.useMemo((function(){return"inline"!==O&&"vertical"!==O||!L?[O,!1]:["vertical",L]}),[O,L]),Qt=(0,s.A)(Zt,2),Jt=Qt[0],te=Qt[1],ee="inline"===Jt,ne=m.useState(Jt),re=(0,s.A)(ne,2),ie=re[0],oe=re[1],ae=m.useState(te),se=(0,s.A)(ae,2),ue=se[0],le=se[1];m.useEffect((function(){oe(Jt),le(te),Kt.current&&(ee?jt(Wt):Vt($t))}),[Jt,te]);var ce=m.useState(0),he=(0,s.A)(ce,2),de=he[0],fe=he[1],pe=de>=kt.length-1||"horizontal"!==ie||D;m.useEffect((function(){ee&&Xt(Ut)}),[Ut]),m.useEffect((function(){return Kt.current=!0,function(){Kt.current=!1}}),[]);var me=Q(),ge=me.registerPath,ve=me.unregisterPath,ye=me.refreshOverflowKeys,be=me.isSubPathKey,xe=me.getKeyPath,we=me.getKeys,_e=me.getSubPathKeys,Se=m.useMemo((function(){return{registerPath:ge,unregisterPath:ve}}),[ge,ve]),Ee=m.useMemo((function(){return{isSubPathKey:be}}),[be]);m.useEffect((function(){ye(pe?$t:kt.slice(de+1).map((function(t){return t.key})))}),[de,pe]);var Me=(0,d.A)(G||X&&(null===(n=kt[0])||void 0===n?void 0:n.key),{value:G}),Ae=(0,s.A)(Me,2),Ce=Ae[0],Te=Ae[1],ke=J((function(t){Te(t)})),Ie=J((function(){Te(void 0)}));(0,m.useImperativeHandle)(e,(function(){return{list:Lt.current,focus:function(t){var e,n,r=we(),i=Y(r,Rt),o=i.elements,a=i.key2element,s=i.element2key,u=W(Lt.current,o),l=null!=Ce?Ce:u[0]?s.get(u[0]):null===(e=kt.find((function(t){return!t.props.disabled})))||void 0===e?void 0:e.key,c=a.get(l);l&&c&&(null==c||null===(n=c.focus)||void 0===n||n.call(c,t))}}}));var Ne=(0,d.A)(it||[],{value:ot,postState:function(t){return Array.isArray(t)?t:null==t?$t:[t]}}),Pe=(0,s.A)(Ne,2),Oe=Pe[0],Le=Pe[1],Re=J((function(t){null==St||St(dt(t)),function(t){if(K){var e,n=t.key,r=Oe.includes(n);e=rt?r?Oe.filter((function(t){return t!==n})):[].concat((0,a.A)(Oe),[n]):[n],Le(e);var i=(0,o.A)((0,o.A)({},t),{},{selectedKeys:e});r?null==st||st(i):null==at||at(i)}!rt&&Ut.length&&"inline"!==ie&&Vt($t)}(t)})),De=J((function(t,e){var n=Ut.filter((function(e){return e!==t}));if(e)n.push(t);else if("inline"!==ie){var r=_e(t);n=n.filter((function(t){return!r.has(t)}))}(0,f.A)(Ut,n,!0)||Vt(n,!0)})),ze=q(ie,Ce,Dt,Rt,Lt,we,xe,Te,(function(t,e){var n=null!=e?e:!Ut.includes(t);De(t,n)}),Mt);m.useEffect((function(){Ot(!0)}),[]);var Fe=m.useMemo((function(){return{_internalRenderMenuItem:At,_internalRenderSubMenuItem:Ct}}),[At,Ct]),Be="horizontal"!==ie||D?kt:kt.map((function(t,e){return m.createElement(S,{key:t.key,overflowDisabled:e>de},t)})),Ue=m.createElement(h.A,(0,r.A)({id:N,ref:Lt,prefixCls:"".concat(y,"-overflow"),component:"ul",itemComponent:bt,className:c()(y,"".concat(y,"-root"),"".concat(y,"-").concat(ie),w,(0,i.A)((0,i.A)({},"".concat(y,"-inline-collapsed"),ue),"".concat(y,"-rtl"),Dt),b),dir:T,style:x,role:"menu",tabIndex:E,data:Be,renderRawItem:function(t){return t},renderRawRest:function(t){var e=t.length,n=e?kt.slice(-e):null;return m.createElement(Ft,{eventKey:Z,title:xt,disabled:pe,internalPopupClose:0===e,popupClassName:wt},n)},maxCount:"horizontal"!==ie||D?h.A.INVALIDATE:h.A.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(t){fe(t)},onKeyDown:ze},Tt));return m.createElement(I.Provider,{value:Fe},m.createElement(v.Provider,{value:Rt},m.createElement(S,{prefixCls:y,rootClassName:b,mode:ie,openKeys:Ut,rtl:Dt,disabled:R,motion:Pt?ct:null,defaultMotions:Pt?ht:null,activeKey:Ce,onActive:ke,onInactive:Ie,selectedKeys:Oe,inlineIndent:lt,subMenuOpenDelay:F,subMenuCloseDelay:U,forceSubMenuRender:j,builtinPlacements:mt,triggerSubMenuAction:pt,getPopupContainer:_t,itemIcon:gt,expandIcon:vt,onItemClick:Re,onOpenChange:De},m.createElement(k.Provider,{value:Ee},Ue),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(M.Provider,{value:Se},kt)))))}));Kt.Item=bt,Kt.SubMenu=Ft,Kt.ItemGroup=Ht,Kt.Divider=Gt;const Zt=Kt},57557:(t,e,n)=>{"use strict";n.d(e,{aF:()=>mt,Kq:()=>m,Ay:()=>gt});var r=n(64467),i=n(89379),o=n(5544),a=n(82284),s=n(46942),u=n.n(s),l=n(66588),c=n(8719),h=n(96540),d=n(53986),f=["children"],p=h.createContext({});function m(t){var e=t.children,n=(0,d.A)(t,f);return h.createElement(p.Provider,{value:n},e)}var g=n(23029),v=n(92901),y=n(15361),b=n(29426);const x=function(t){(0,y.A)(n,t);var e=(0,b.A)(n);function n(){return(0,g.A)(this,n),e.apply(this,arguments)}return(0,v.A)(n,[{key:"render",value:function(){return this.props.children}}]),n}(h.Component);var w=n(1233),_="none",S="appear",E="enter",M="leave",A="none",C="prepare",T="start",k="active",I="end",N="prepared",P=n(20998);function O(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}var L,R,D,z=(L=(0,P.A)(),R="undefined"!=typeof window?window:{},D={animationend:O("Animation","AnimationEnd"),transitionend:O("Transition","TransitionEnd")},L&&("AnimationEvent"in R||delete D.animationend.animation,"TransitionEvent"in R||delete D.transitionend.transition),D),F={};if((0,P.A)()){var B=document.createElement("div");F=B.style}var U={};function j(t){if(U[t])return U[t];var e=z[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:2;e();var o=(0,K.A)((function(){i<=1?r({isCanceled:function(){return o!==t.current}}):n(r,i-1)}));t.current=o},e]}(),l=(0,o.A)(u,2),c=l[0],d=l[1];var f=e?Q:Z;return $((function(){if(a!==A&&a!==I){var t=f.indexOf(a),e=f[t+1],r=n(a);r===J?s(e,!0):e&&c((function(t){function n(){t.isCanceled()||s(e,!0)}!0===r?n():Promise.resolve(r).then(n)}))}}),[t,a]),h.useEffect((function(){return function(){d()}}),[]),[function(){s(C,!0)},a]};const rt=function(t){var e=t;"object"===(0,a.A)(t)&&(e=t.transitionSupport);var n=h.forwardRef((function(t,n){var a=t.visible,s=void 0===a||a,d=t.removeOnLeave,f=void 0===d||d,m=t.forceRender,g=t.children,v=t.motionName,y=t.leavedClassName,b=t.eventProps,A=function(t,n){return!(!t.motionName||!e||!1===n)}(t,h.useContext(p).motion),I=(0,h.useRef)(),P=(0,h.useRef)();var O=function(t,e,n,a){var s=a.motionEnter,u=void 0===s||s,l=a.motionAppear,c=void 0===l||l,d=a.motionLeave,f=void 0===d||d,p=a.motionDeadline,m=a.motionLeaveImmediately,g=a.onAppearPrepare,v=a.onEnterPrepare,y=a.onLeavePrepare,b=a.onAppearStart,x=a.onEnterStart,A=a.onLeaveStart,I=a.onAppearActive,P=a.onEnterActive,O=a.onLeaveActive,L=a.onAppearEnd,R=a.onEnterEnd,D=a.onLeaveEnd,z=a.onVisibleChanged,F=(0,w.A)(),B=(0,o.A)(F,2),U=B[0],j=B[1],V=(0,w.A)(_),H=(0,o.A)(V,2),G=H[0],W=H[1],X=(0,w.A)(null),Y=(0,o.A)(X,2),K=Y[0],Z=Y[1],Q=(0,h.useRef)(!1),rt=(0,h.useRef)(null);function it(){return n()}var ot=(0,h.useRef)(!1);function at(){W(_,!0),Z(null,!0)}function st(t){var e=it();if(!t||t.deadline||t.target===e){var n,r=ot.current;G===S&&r?n=null==L?void 0:L(e,t):G===E&&r?n=null==R?void 0:R(e,t):G===M&&r&&(n=null==D?void 0:D(e,t)),G!==_&&r&&!1!==n&&at()}}var ut=q(st),lt=(0,o.A)(ut,1)[0],ct=function(t){var e,n,i;switch(t){case S:return e={},(0,r.A)(e,C,g),(0,r.A)(e,T,b),(0,r.A)(e,k,I),e;case E:return n={},(0,r.A)(n,C,v),(0,r.A)(n,T,x),(0,r.A)(n,k,P),n;case M:return i={},(0,r.A)(i,C,y),(0,r.A)(i,T,A),(0,r.A)(i,k,O),i;default:return{}}},ht=h.useMemo((function(){return ct(G)}),[G]),dt=nt(G,!t,(function(t){if(t===C){var e=ht[C];return e?e(it()):J}var n;return mt in ht&&Z((null===(n=ht[mt])||void 0===n?void 0:n.call(ht,it(),null))||null),mt===k&&(lt(it()),p>0&&(clearTimeout(rt.current),rt.current=setTimeout((function(){st({deadline:!0})}),p))),mt===N&&at(),tt})),ft=(0,o.A)(dt,2),pt=ft[0],mt=ft[1],gt=et(mt);ot.current=gt,$((function(){j(e);var n,r=Q.current;Q.current=!0,!r&&e&&c&&(n=S),r&&e&&u&&(n=E),(r&&!e&&f||!r&&m&&!e&&f)&&(n=M);var i=ct(n);n&&(t||i[C])?(W(n),pt()):W(_)}),[e]),(0,h.useEffect)((function(){(G===S&&!c||G===E&&!u||G===M&&!f)&&W(_)}),[c,u,f]),(0,h.useEffect)((function(){return function(){Q.current=!1,clearTimeout(rt.current)}}),[]);var vt=h.useRef(!1);(0,h.useEffect)((function(){U&&(vt.current=!0),void 0!==U&&G===_&&((vt.current||U)&&(null==z||z(U)),vt.current=!0)}),[U,G]);var yt=K;return ht[C]&&mt===T&&(yt=(0,i.A)({transition:"none"},yt)),[G,mt,yt,null!=U?U:e]}(A,s,(function(){try{return I.current instanceof HTMLElement?I.current:(0,l.A)(P.current)}catch(t){return null}}),t),L=(0,o.A)(O,4),R=L[0],D=L[1],z=L[2],F=L[3],B=h.useRef(F);F&&(B.current=!0);var U,j=h.useCallback((function(t){I.current=t,(0,c.Xf)(n,t)}),[n]),V=(0,i.A)((0,i.A)({},b),{},{visible:s});if(g)if(R===_)U=F?g((0,i.A)({},V),j):!f&&B.current&&y?g((0,i.A)((0,i.A)({},V),{},{className:y}),j):m||!f&&!y?g((0,i.A)((0,i.A)({},V),{},{style:{display:"none"}}),j):null;else{var H,G;D===C?G="prepare":et(D)?G="active":D===T&&(G="start");var W=Y(v,"".concat(R,"-").concat(G));U=g((0,i.A)((0,i.A)({},V),{},{className:u()(Y(v,R),(H={},(0,r.A)(H,W,W&&G),(0,r.A)(H,v,"string"==typeof v),H)),style:z}),j)}else U=null;h.isValidElement(U)&&(0,c.f3)(U)&&(U.ref||(U=h.cloneElement(U,{ref:j})));return h.createElement(x,{ref:P},U)}));return n.displayName="CSSMotion",n}(G);var it=n(58168),ot=n(9417),at="add",st="keep",ut="remove",lt="removed";function ct(t){var e;return e=t&&"object"===(0,a.A)(t)&&"key"in t?t:{key:t},(0,i.A)((0,i.A)({},e),{},{key:String(e.key)})}function ht(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(ct)}var dt=["component","children","onVisibleChanged","onAllRemoved"],ft=["status"],pt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];const mt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rt,n=function(t){(0,y.A)(o,t);var n=(0,b.A)(o);function o(){var t;(0,g.A)(this,o);for(var e=arguments.length,a=new Array(e),s=0;s0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=e.length,a=ht(t),s=ht(e);a.forEach((function(t){for(var e=!1,a=r;a1})).forEach((function(t){(n=n.filter((function(e){var n=e.key,r=e.status;return n!==t||r!==ut}))).forEach((function(e){e.key===t&&(e.status=st)}))})),n}(r,o);return{keyEntities:a.filter((function(t){var e=r.find((function(e){var n=e.key;return t.key===n}));return!e||e.status!==lt||t.status!==ut}))}}}]),o}(h.Component);return(0,r.A)(n,"defaultProps",{component:"div"}),n}(G),gt=rt},22370:(t,e,n)=>{"use strict";n.d(e,{$T:()=>v,ph:()=>b,hN:()=>C});var r=n(60436),i=n(5544),o=n(53986),a=n(96540),s=n(89379),u=n(40961),l=n(58168),c=n(64467),h=n(46942),d=n.n(h),f=n(57557),p=n(82284),m=n(16928),g=n(72065);const v=a.forwardRef((function(t,e){var n=t.prefixCls,r=t.style,o=t.className,s=t.duration,u=void 0===s?4.5:s,h=t.eventKey,f=t.content,v=t.closable,y=t.closeIcon,b=void 0===y?"x":y,x=t.props,w=t.onClick,_=t.onNoticeClose,S=t.times,E=t.hovering,M=a.useState(!1),A=(0,i.A)(M,2),C=A[0],T=A[1],k=E||C,I=function(){_(h)};a.useEffect((function(){if(!k&&u>0){var t=setTimeout((function(){I()}),1e3*u);return function(){clearTimeout(t)}}}),[u,k,S]);var N=a.useMemo((function(){return"object"===(0,p.A)(v)&&null!==v?v:v?{closeIcon:b}:{}}),[v,b]),P=(0,g.A)(N,!0),O="".concat(n,"-notice");return a.createElement("div",(0,l.A)({},x,{ref:e,className:d()(O,o,(0,c.A)({},"".concat(O,"-closable"),v)),style:r,onMouseEnter:function(t){var e;T(!0),null==x||null===(e=x.onMouseEnter)||void 0===e||e.call(x,t)},onMouseLeave:function(t){var e;T(!1),null==x||null===(e=x.onMouseLeave)||void 0===e||e.call(x,t)},onClick:w}),a.createElement("div",{className:"".concat(O,"-content")},f),v&&a.createElement("a",(0,l.A)({tabIndex:0,className:"".concat(O,"-close"),onKeyDown:function(t){"Enter"!==t.key&&"Enter"!==t.code&&t.keyCode!==m.A.ENTER||I()},"aria-label":"Close"},P,{onClick:function(t){t.preventDefault(),t.stopPropagation(),I()}}),N.closeIcon))}));var y=a.createContext({});const b=function(t){var e=t.children,n=t.classNames;return a.createElement(y.Provider,{value:{classNames:n}},e)};const x=function(t){var e,n,r,i={offset:8,threshold:3,gap:16};t&&"object"===(0,p.A)(t)&&(i.offset=null!==(e=t.offset)&&void 0!==e?e:8,i.threshold=null!==(n=t.threshold)&&void 0!==n?n:3,i.gap=null!==(r=t.gap)&&void 0!==r?r:16);return[!!t,i]};var w=["className","style","classNames","styles"];const _=function(t){var e=t.configList,n=t.placement,u=t.prefixCls,h=t.className,p=t.style,m=t.motion,g=t.onAllNoticeRemoved,b=t.onNoticeClose,_=t.stack,S=(0,a.useContext)(y).classNames,E=(0,a.useRef)({}),M=(0,a.useState)(null),A=(0,i.A)(M,2),C=A[0],T=A[1],k=(0,a.useState)([]),I=(0,i.A)(k,2),N=I[0],P=I[1],O=e.map((function(t){return{config:t,key:String(t.key)}})),L=x(_),R=(0,i.A)(L,2),D=R[0],z=R[1],F=z.offset,B=z.threshold,U=z.gap,j=D&&(N.length>0||O.length<=B),V="function"==typeof m?m(n):m;return(0,a.useEffect)((function(){D&&N.length>1&&P((function(t){return t.filter((function(t){return O.some((function(e){var n=e.key;return t===n}))}))}))}),[N,O,D]),(0,a.useEffect)((function(){var t,e;D&&E.current[null===(t=O[O.length-1])||void 0===t?void 0:t.key]&&T(E.current[null===(e=O[O.length-1])||void 0===e?void 0:e.key])}),[O,D]),a.createElement(f.aF,(0,l.A)({key:n,className:d()(u,"".concat(u,"-").concat(n),null==S?void 0:S.list,h,(0,c.A)((0,c.A)({},"".concat(u,"-stack"),!!D),"".concat(u,"-stack-expanded"),j)),style:p,keys:O,motionAppear:!0},V,{onAllRemoved:function(){g(n)}}),(function(t,e){var i=t.config,c=t.className,h=t.style,f=t.index,p=i,m=p.key,g=p.times,y=String(m),x=i,_=x.className,M=x.style,A=x.classNames,T=x.styles,k=(0,o.A)(x,w),I=O.findIndex((function(t){return t.key===y})),L={};if(D){var R=O.length-1-(I>-1?I:f-1),z="top"===n||"bottom"===n?"-50%":"0";if(R>0){var B,V,H;L.height=j?null===(B=E.current[y])||void 0===B?void 0:B.offsetHeight:null==C?void 0:C.offsetHeight;for(var G=0,W=0;W-1?E.current[y]=t:delete E.current[y]},prefixCls:u,classNames:A,styles:T,className:d()(_,null==S?void 0:S.notice),style:M,times:g,key:m,eventKey:m,onNoticeClose:b,hovering:D&&N.length>0})))}))};const S=a.forwardRef((function(t,e){var n=t.prefixCls,o=void 0===n?"rc-notification":n,l=t.container,c=t.motion,h=t.maxCount,d=t.className,f=t.style,p=t.onAllRemoved,m=t.stack,g=t.renderNotifications,v=a.useState([]),y=(0,i.A)(v,2),b=y[0],x=y[1],w=function(t){var e,n=b.find((function(e){return e.key===t}));null==n||null===(e=n.onClose)||void 0===e||e.call(n),x((function(e){return e.filter((function(e){return e.key!==t}))}))};a.useImperativeHandle(e,(function(){return{open:function(t){x((function(e){var n,i=(0,r.A)(e),o=i.findIndex((function(e){return e.key===t.key})),a=(0,s.A)({},t);o>=0?(a.times=((null===(n=e[o])||void 0===n?void 0:n.times)||0)+1,i[o]=a):(a.times=0,i.push(a));return h>0&&i.length>h&&(i=i.slice(-h)),i}))},close:function(t){w(t)},destroy:function(){x([])}}}));var S=a.useState({}),E=(0,i.A)(S,2),M=E[0],A=E[1];a.useEffect((function(){var t={};b.forEach((function(e){var n=e.placement,r=void 0===n?"topRight":n;r&&(t[r]=t[r]||[],t[r].push(e))})),Object.keys(M).forEach((function(e){t[e]=t[e]||[]})),A(t)}),[b]);var C=function(t){A((function(e){var n=(0,s.A)({},e);return(n[t]||[]).length||delete n[t],n}))},T=a.useRef(!1);if(a.useEffect((function(){Object.keys(M).length>0?T.current=!0:T.current&&(null==p||p(),T.current=!1)}),[M]),!l)return null;var k=Object.keys(M);return(0,u.createPortal)(a.createElement(a.Fragment,null,k.map((function(t){var e=M[t],n=a.createElement(_,{key:t,configList:e,placement:t,prefixCls:o,className:null==d?void 0:d(t),style:null==f?void 0:f(t),motion:c,onNoticeClose:w,onAllNoticeRemoved:C,stack:m});return g?g(n,{prefixCls:o,key:t}):n}))),l)}));var E=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],M=function(){return document.body},A=0;function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.getContainer,n=void 0===e?M:e,s=t.motion,u=t.prefixCls,l=t.maxCount,c=t.className,h=t.style,d=t.onAllRemoved,f=t.stack,p=t.renderNotifications,m=(0,o.A)(t,E),g=a.useState(),v=(0,i.A)(g,2),y=v[0],b=v[1],x=a.useRef(),w=a.createElement(S,{container:y,ref:x,prefixCls:u,motion:s,maxCount:l,className:c,style:h,onAllRemoved:d,stack:f,renderNotifications:p}),_=a.useState([]),C=(0,i.A)(_,2),T=C[0],k=C[1],I=a.useMemo((function(){return{open:function(t){var e=function(){for(var t={},e=arguments.length,n=new Array(e),r=0;r{"use strict";n.d(e,{A:()=>R});var r=n(58168),i=n(89379),o=n(5544),a=n(53986),s=n(96540),u=n(46942),l=n.n(u),c=n(18462),h=n(30981),d=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],f=void 0;function p(t,e){var n=t.prefixCls,o=t.invalidate,u=t.item,h=t.renderItem,p=t.responsive,m=t.responsiveDisabled,g=t.registerSize,v=t.itemKey,y=t.className,b=t.style,x=t.children,w=t.display,_=t.order,S=t.component,E=void 0===S?"div":S,M=(0,a.A)(t,d),A=p&&!w;function C(t){g(v,t)}s.useEffect((function(){return function(){C(null)}}),[]);var T,k=h&&u!==f?h(u):x;o||(T={opacity:A?0:1,height:A?0:f,overflowY:A?"hidden":f,order:p?_:f,pointerEvents:A?"none":f,position:A?"absolute":f});var I={};A&&(I["aria-hidden"]=!0);var N=s.createElement(E,(0,r.A)({className:l()(!o&&n,y),style:(0,i.A)((0,i.A)({},T),b)},I,M,{ref:e}),k);return p&&(N=s.createElement(c.A,{onResize:function(t){C(t.offsetWidth)},disabled:m},N)),N}var m=s.forwardRef(p);m.displayName="Item";const g=m;var v=n(26956),y=n(40961),b=n(25371);function x(){var t=s.useRef(null);return function(e){t.current||(t.current=[],function(t){if("undefined"==typeof MessageChannel)(0,b.A)(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}((function(){(0,y.unstable_batchedUpdates)((function(){t.current.forEach((function(t){t()})),t.current=null}))}))),t.current.push(e)}}function w(t,e){var n=s.useState(e),r=(0,o.A)(n,2),i=r[0],a=r[1];return[i,(0,v.A)((function(e){t((function(){a(e)}))}))]}var _=s.createContext(null),S=["component"],E=["className"],M=["className"],A=function(t,e){var n=s.useContext(_);if(!n){var i=t.component,o=void 0===i?"div":i,u=(0,a.A)(t,S);return s.createElement(o,(0,r.A)({},u,{ref:e}))}var c=n.className,h=(0,a.A)(n,E),d=t.className,f=(0,a.A)(t,M);return s.createElement(_.Provider,{value:null},s.createElement(g,(0,r.A)({ref:e,className:l()(c,d)},h,f)))},C=s.forwardRef(A);C.displayName="RawItem";const T=C;var k=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],I="responsive",N="invalidate";function P(t){return"+ ".concat(t.length," ...")}function O(t,e){var n=t.prefixCls,u=void 0===n?"rc-overflow":n,d=t.data,f=void 0===d?[]:d,p=t.renderItem,m=t.renderRawItem,v=t.itemKey,y=t.itemWidth,b=void 0===y?10:y,S=t.ssr,E=t.style,M=t.className,A=t.maxCount,C=t.renderRest,T=t.renderRawRest,O=t.suffix,L=t.component,R=void 0===L?"div":L,D=t.itemComponent,z=t.onVisibleChange,F=(0,a.A)(t,k),B="full"===S,U=x(),j=w(U,null),V=(0,o.A)(j,2),H=V[0],G=V[1],W=H||0,X=w(U,new Map),Y=(0,o.A)(X,2),q=Y[0],$=Y[1],K=w(U,0),Z=(0,o.A)(K,2),Q=Z[0],J=Z[1],tt=w(U,0),et=(0,o.A)(tt,2),nt=et[0],rt=et[1],it=w(U,0),ot=(0,o.A)(it,2),at=ot[0],st=ot[1],ut=(0,s.useState)(null),lt=(0,o.A)(ut,2),ct=lt[0],ht=lt[1],dt=(0,s.useState)(null),ft=(0,o.A)(dt,2),pt=ft[0],mt=ft[1],gt=s.useMemo((function(){return null===pt&&B?Number.MAX_SAFE_INTEGER:pt||0}),[pt,H]),vt=(0,s.useState)(!1),yt=(0,o.A)(vt,2),bt=yt[0],xt=yt[1],wt="".concat(u,"-item"),_t=Math.max(Q,nt),St=A===I,Et=f.length&&St,Mt=A===N,At=Et||"number"==typeof A&&f.length>A,Ct=(0,s.useMemo)((function(){var t=f;return Et?t=null===H&&B?f:f.slice(0,Math.min(f.length,W/b)):"number"==typeof A&&(t=f.slice(0,A)),t}),[f,b,H,A,Et]),Tt=(0,s.useMemo)((function(){return Et?f.slice(gt+1):f.slice(Ct.length)}),[f,Ct,Et,gt]),kt=(0,s.useCallback)((function(t,e){var n;return"function"==typeof v?v(t):null!==(n=v&&(null==t?void 0:t[v]))&&void 0!==n?n:e}),[v]),It=(0,s.useCallback)(p||function(t){return t},[p]);function Nt(t,e,n){(pt!==t||void 0!==e&&e!==ct)&&(mt(t),n||(xt(tW){Nt(r-1,t-i-at+nt);break}}O&&Ot(0)+at>W&&ht(null)}}),[W,q,nt,at,kt,Ct]);var Lt=bt&&!!Tt.length,Rt={};null!==ct&&Et&&(Rt={position:"absolute",left:ct,top:0});var Dt,zt={prefixCls:wt,responsive:Et,component:D,invalidate:Mt},Ft=m?function(t,e){var n=kt(t,e);return s.createElement(_.Provider,{key:n,value:(0,i.A)((0,i.A)({},zt),{},{order:e,item:t,itemKey:n,registerSize:Pt,display:e<=gt})},m(t,e))}:function(t,e){var n=kt(t,e);return s.createElement(g,(0,r.A)({},zt,{order:e,key:n,item:t,renderItem:It,itemKey:n,registerSize:Pt,display:e<=gt}))},Bt={order:Lt?gt:Number.MAX_SAFE_INTEGER,className:"".concat(wt,"-rest"),registerSize:function(t,e){rt(e),J(nt)},display:Lt};if(T)T&&(Dt=s.createElement(_.Provider,{value:(0,i.A)((0,i.A)({},zt),Bt)},T(Tt)));else{var Ut=C||P;Dt=s.createElement(g,(0,r.A)({},zt,Bt),"function"==typeof Ut?Ut(Tt):Ut)}var jt=s.createElement(R,(0,r.A)({className:l()(!Mt&&u,M),style:E,ref:e},F),Ct.map(Ft),At?Dt:null,O&&s.createElement(g,(0,r.A)({},zt,{responsive:St,responsiveDisabled:!Et,order:gt,className:"".concat(wt,"-suffix"),registerSize:function(t,e){st(e)},display:!0,style:Rt}),O));return St&&(jt=s.createElement(c.A,{onResize:function(t,e){G(e.clientWidth)},disabled:!Et},jt)),jt}var L=s.forwardRef(O);L.displayName="Overflow",L.Item=T,L.RESPONSIVE=I,L.INVALIDATE=N;const R=L},96069:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"}},64395:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"}},71559:(t,e,n)=>{"use strict";n.d(e,{jl:()=>E});var r=n(58168),i=n(89379),o=n(53986),a=n(96540),s=n(46942),u=n.n(s),l={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},c=function(){var t=(0,a.useRef)([]),e=(0,a.useRef)(null);return(0,a.useEffect)((function(){var n=Date.now(),r=!1;t.current.forEach((function(t){if(t){r=!0;var i=t.style;i.transitionDuration=".3s, .3s, .3s, .06s",e.current&&n-e.current<100&&(i.transitionDuration="0s, 0s")}})),r&&(e.current=Date.now())})),t.current};var h=n(82284),d=n(5544),f=n(20998),p=0,m=(0,f.A)();const g=function(t){var e=a.useState(),n=(0,d.A)(e,2),r=n[0],i=n[1];return a.useEffect((function(){var t;i("rc_progress_".concat((m?(t=p,p+=1):t="TEST_OR_SSR",t)))}),[]),t||r};var v=function(t){var e=t.bg,n=t.children;return a.createElement("div",{style:{width:"100%",height:"100%",background:e}},n)};function y(t,e){return Object.keys(t).map((function(n){var r=parseFloat(n),i="".concat(Math.floor(r*e),"%");return"".concat(t[n]," ").concat(i)}))}const b=a.forwardRef((function(t,e){var n=t.prefixCls,r=t.color,i=t.gradientId,o=t.radius,s=t.style,u=t.ptg,l=t.strokeLinecap,c=t.strokeWidth,d=t.size,f=t.gapDegree,p=r&&"object"===(0,h.A)(r),m=p?"#FFF":void 0,g=d/2,b=a.createElement("circle",{className:"".concat(n,"-circle-path"),r:o,cx:g,cy:g,stroke:m,strokeLinecap:l,strokeWidth:c,opacity:0===u?0:1,style:s,ref:e});if(!p)return b;var x="".concat(i,"-conic"),w=f?"".concat(180+f/2,"deg"):"0deg",_=y(r,(360-f)/360),S=y(r,1),E="conic-gradient(from ".concat(w,", ").concat(_.join(", "),")"),M="linear-gradient(to ".concat(f?"bottom":"top",", ").concat(S.join(", "),")");return a.createElement(a.Fragment,null,a.createElement("mask",{id:x},b),a.createElement("foreignObject",{x:0,y:0,width:d,height:d,mask:"url(#".concat(x,")")},a.createElement(v,{bg:M},a.createElement(v,{bg:E}))))}));var x=100,w=function(t,e,n,r,i,o,a,s,u,l){var c=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,h=n/100*360*((360-o)/360),d=0===o?0:{bottom:0,top:180,left:90,right:-90}[a],f=(100-r)/100*e;"round"===u&&100!==r&&(f+=l/2)>=e&&(f=e-.01);return{stroke:"string"==typeof s?s:void 0,strokeDasharray:"".concat(e,"px ").concat(t),strokeDashoffset:f+c,transform:"rotate(".concat(i+h+d,"deg)"),transformOrigin:"".concat(50,"px ").concat(50,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},_=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function S(t){var e=null!=t?t:[];return Array.isArray(e)?e:[e]}const E=function(t){var e,n,s,d=(0,i.A)((0,i.A)({},l),t),f=d.id,p=d.prefixCls,m=d.steps,v=d.strokeWidth,y=d.trailWidth,E=d.gapDegree,M=void 0===E?0:E,A=d.gapPosition,C=d.trailColor,T=d.strokeLinecap,k=d.style,I=d.className,N=d.strokeColor,P=d.percent,O=(0,o.A)(d,_),L=g(f),R="".concat(L,"-gradient"),D=50-v/2,z=2*Math.PI*D,F=M>0?90+M/2:-90,B=z*((360-M)/360),U="object"===(0,h.A)(m)?m:{count:m,gap:2},j=U.count,V=U.gap,H=S(P),G=S(N),W=G.find((function(t){return t&&"object"===(0,h.A)(t)})),X=W&&"object"===(0,h.A)(W)?"butt":T,Y=w(z,B,0,100,F,M,A,C,X,v),q=c();return a.createElement("svg",(0,r.A)({className:u()("".concat(p,"-circle"),I),viewBox:"0 0 ".concat(x," ").concat(x),style:k,id:f,role:"presentation"},O),!j&&a.createElement("circle",{className:"".concat(p,"-circle-trail"),r:D,cx:50,cy:50,stroke:C,strokeLinecap:X,strokeWidth:y||v,style:Y}),j?(e=Math.round(j*(H[0]/100)),n=100/j,s=0,new Array(j).fill(null).map((function(t,r){var i=r<=e-1?G[0]:C,o=i&&"object"===(0,h.A)(i)?"url(#".concat(R,")"):void 0,u=w(z,B,s,n,F,M,A,i,"butt",v,V);return s+=100*(B-u.strokeDashoffset+V)/B,a.createElement("circle",{key:r,className:"".concat(p,"-circle-path"),r:D,cx:50,cy:50,stroke:o,strokeWidth:v,opacity:1,style:u,ref:function(t){q[r]=t}})}))):function(){var t=0;return H.map((function(e,n){var r=G[n]||G[G.length-1],i=w(z,B,t,e,F,M,A,r,X,v);return t+=e,a.createElement(b,{key:n,color:r,ptg:e,radius:D,prefixCls:p,gradientId:R,style:i,strokeLinecap:X,strokeWidth:v,gapDegree:M,ref:function(t){q[n]=t},size:x})})).reverse()}())}},18462:(t,e,n)=>{"use strict";n.d(e,{A:()=>G});var r=n(58168),i=n(96540),o=n(82546),a=(n(68210),n(89379)),s=n(82284),u=n(66588),l=n(8719),c=i.createContext(null);var h=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n0},t.prototype.connect_=function(){d&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),g?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){d&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;m.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),y=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),I="undefined"!=typeof WeakMap?new WeakMap:new h,N=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=v.getInstance(),r=new k(e,n,this);I.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){N.prototype[t]=function(){var e;return(e=I.get(this))[t].apply(e,arguments)}}));const P=void 0!==f.ResizeObserver?f.ResizeObserver:N;var O=new Map;var L=new P((function(t){t.forEach((function(t){var e,n=t.target;null===(e=O.get(n))||void 0===e||e.forEach((function(t){return t(n)}))}))}));var R=n(23029),D=n(92901),z=n(15361),F=n(29426),B=function(t){(0,z.A)(n,t);var e=(0,F.A)(n);function n(){return(0,R.A)(this,n),e.apply(this,arguments)}return(0,D.A)(n,[{key:"render",value:function(){return this.props.children}}]),n}(i.Component);function U(t,e){var n=t.children,r=t.disabled,o=i.useRef(null),h=i.useRef(null),d=i.useContext(c),f="function"==typeof n,p=f?n(o):n,m=i.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),g=!f&&i.isValidElement(p)&&(0,l.f3)(p),v=g?p.ref:null,y=(0,l.xK)(v,o),b=function(){var t;return(0,u.A)(o.current)||(o.current&&"object"===(0,s.A)(o.current)?(0,u.A)(null===(t=o.current)||void 0===t?void 0:t.nativeElement):null)||(0,u.A)(h.current)};i.useImperativeHandle(e,(function(){return b()}));var x=i.useRef(t);x.current=t;var w=i.useCallback((function(t){var e=x.current,n=e.onResize,r=e.data,i=t.getBoundingClientRect(),o=i.width,s=i.height,u=t.offsetWidth,l=t.offsetHeight,c=Math.floor(o),h=Math.floor(s);if(m.current.width!==c||m.current.height!==h||m.current.offsetWidth!==u||m.current.offsetHeight!==l){var f={width:c,height:h,offsetWidth:u,offsetHeight:l};m.current=f;var p=u===Math.round(o)?o:u,g=l===Math.round(s)?s:l,v=(0,a.A)((0,a.A)({},f),{},{offsetWidth:p,offsetHeight:g});null==d||d(v,t,r),n&&Promise.resolve().then((function(){n(v,t)}))}}),[]);return i.useEffect((function(){var t,e,n=b();return n&&!r&&(t=n,e=w,O.has(t)||(O.set(t,new Set),L.observe(t)),O.get(t).add(e)),function(){return function(t,e){O.has(t)&&(O.get(t).delete(e),O.get(t).size||(L.unobserve(t),O.delete(t)))}(n,w)}}),[o.current,r]),i.createElement(B,{ref:h},g?i.cloneElement(p,{ref:y}):p)}const j=i.forwardRef(U);function V(t,e){var n=t.children;return("function"==typeof n?[n]:(0,o.A)(n)).map((function(n,o){var a=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(o);return i.createElement(j,(0,r.A)({},t,{key:a,ref:0===o?e:void 0}),n)}))}var H=i.forwardRef(V);H.Collection=function(t){var e=t.children,n=t.onBatchResize,r=i.useRef(0),o=i.useRef([]),a=i.useContext(c),s=i.useCallback((function(t,e,i){r.current+=1;var s=r.current;o.current.push({size:t,element:e,data:i}),Promise.resolve().then((function(){s===r.current&&(null==n||n(o.current),o.current=[])})),null==a||a(t,e,i)}),[n,a]);return i.createElement(c.Provider,{value:s},e)};const G=H},63188:(t,e,n)=>{"use strict";n.d(e,{JM:()=>Q,c$:()=>tt,Ay:()=>qt});var r=n(58168),i=n(60436),o=n(64467),a=n(89379),s=n(5544),u=n(53986),l=n(82284),c=n(12533),h=n(68210),d=n(96540),f=n(46942),p=n.n(f),m=n(30981),g=n(68430),v=n(16928),y=n(8719);const b=function(t){var e=t.className,n=t.customizeIcon,r=t.customizeIconProps,i=t.children,o=t.onMouseDown,a=t.onClick,s="function"==typeof n?n(r):n;return d.createElement("span",{className:e,onMouseDown:function(t){t.preventDefault(),null==o||o(t)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==s?s:d.createElement("span",{className:p()(e.split(/\s+/).map((function(t){return"".concat(t,"-icon")})))},i))};var x=d.createContext(null);function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,e=d.useRef(null),n=d.useRef(null);return d.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return e.current},function(r){(r||null===e.current)&&(e.current=r),window.clearTimeout(n.current),n.current=window.setTimeout((function(){e.current=null}),t)}]}var _=n(72065),S=n(99591),E=function(t,e){var n,r=t.prefixCls,i=t.id,o=t.inputElement,s=t.disabled,u=t.tabIndex,l=t.autoFocus,c=t.autoComplete,f=t.editable,m=t.activeDescendantId,g=t.value,v=t.maxLength,b=t.onKeyDown,x=t.onMouseDown,w=t.onChange,_=t.onPaste,S=t.onCompositionStart,E=t.onCompositionEnd,M=t.open,A=t.attrs,C=o||d.createElement("input",null),T=C,k=T.ref,I=T.props,N=I.onKeyDown,P=I.onChange,O=I.onMouseDown,L=I.onCompositionStart,R=I.onCompositionEnd,D=I.style;return(0,h.$e)(!("maxLength"in C.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),C=d.cloneElement(C,(0,a.A)((0,a.A)((0,a.A)({type:"search"},I),{},{id:i,ref:(0,y.K4)(e,k),disabled:s,tabIndex:u,autoComplete:c||"off",autoFocus:l,className:p()("".concat(r,"-selection-search-input"),null===(n=C)||void 0===n||null===(n=n.props)||void 0===n?void 0:n.className),role:"combobox","aria-expanded":M||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":M?m:void 0},A),{},{value:f?g:"",maxLength:v,readOnly:!f,unselectable:f?null:"on",style:(0,a.A)((0,a.A)({},D),{},{opacity:f?null:0}),onKeyDown:function(t){b(t),N&&N(t)},onMouseDown:function(t){x(t),O&&O(t)},onChange:function(t){w(t),P&&P(t)},onCompositionStart:function(t){S(t),L&&L(t)},onCompositionEnd:function(t){E(t),R&&R(t)},onPaste:_}))};const M=d.forwardRef(E);function A(t){return Array.isArray(t)?t:void 0!==t?[t]:[]}var C="undefined"!=typeof window&&window.document&&window.document.documentElement;function T(t){return["string","number"].includes((0,l.A)(t))}function k(t){var e=void 0;return t&&(T(t.title)?e=t.title.toString():T(t.label)&&(e=t.label.toString())),e}function I(t){var e;return null!==(e=t.key)&&void 0!==e?e:t.value}var N=function(t){t.preventDefault(),t.stopPropagation()};const P=function(t){var e,n,r=t.id,i=t.prefixCls,a=t.values,u=t.open,l=t.searchValue,c=t.autoClearSearchValue,h=t.inputRef,f=t.placeholder,m=t.disabled,g=t.mode,v=t.showSearch,y=t.autoFocus,x=t.autoComplete,w=t.activeDescendantId,E=t.tabIndex,A=t.removeIcon,T=t.maxTagCount,P=t.maxTagTextLength,O=t.maxTagPlaceholder,L=void 0===O?function(t){return"+ ".concat(t.length," ...")}:O,R=t.tagRender,D=t.onToggleOpen,z=t.onRemove,F=t.onInputChange,B=t.onInputPaste,U=t.onInputKeyDown,j=t.onInputMouseDown,V=t.onInputCompositionStart,H=t.onInputCompositionEnd,G=d.useRef(null),W=(0,d.useState)(0),X=(0,s.A)(W,2),Y=X[0],q=X[1],$=(0,d.useState)(!1),K=(0,s.A)($,2),Z=K[0],Q=K[1],J="".concat(i,"-selection"),tt=u||"multiple"===g&&!1===c||"tags"===g?l:"",et="tags"===g||"multiple"===g&&!1===c||v&&(u||Z);e=function(){q(G.current.scrollWidth)},n=[tt],C?d.useLayoutEffect(e,n):d.useEffect(e,n);var nt=function(t,e,n,r,i){return d.createElement("span",{title:k(t),className:p()("".concat(J,"-item"),(0,o.A)({},"".concat(J,"-item-disabled"),n))},d.createElement("span",{className:"".concat(J,"-item-content")},e),r&&d.createElement(b,{className:"".concat(J,"-item-remove"),onMouseDown:N,onClick:i,customizeIcon:A},"×"))},rt=d.createElement("div",{className:"".concat(J,"-search"),style:{width:Y},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},d.createElement(M,{ref:h,open:u,prefixCls:i,id:r,inputElement:null,disabled:m,autoFocus:y,autoComplete:x,editable:et,activeDescendantId:w,value:tt,onKeyDown:U,onMouseDown:j,onChange:F,onPaste:B,onCompositionStart:V,onCompositionEnd:H,tabIndex:E,attrs:(0,_.A)(t,!0)}),d.createElement("span",{ref:G,className:"".concat(J,"-search-mirror"),"aria-hidden":!0},tt," ")),it=d.createElement(S.A,{prefixCls:"".concat(J,"-overflow"),data:a,renderItem:function(t){var e=t.disabled,n=t.label,r=t.value,i=!m&&!e,o=n;if("number"==typeof P&&("string"==typeof n||"number"==typeof n)){var a=String(o);a.length>P&&(o="".concat(a.slice(0,P),"..."))}var s=function(e){e&&e.stopPropagation(),z(t)};return"function"==typeof R?function(t,e,n,r,i){return d.createElement("span",{onMouseDown:function(t){N(t),D(!u)}},R({label:e,value:t,disabled:n,closable:r,onClose:i}))}(r,o,e,i,s):nt(t,o,e,i,s)},renderRest:function(t){var e="function"==typeof L?L(t):L;return nt({title:e},e,!1)},suffix:rt,itemKey:I,maxCount:T});return d.createElement(d.Fragment,null,it,!a.length&&!tt&&d.createElement("span",{className:"".concat(J,"-placeholder")},f))};const O=function(t){var e=t.inputElement,n=t.prefixCls,r=t.id,i=t.inputRef,o=t.disabled,a=t.autoFocus,u=t.autoComplete,l=t.activeDescendantId,c=t.mode,h=t.open,f=t.values,p=t.placeholder,m=t.tabIndex,g=t.showSearch,v=t.searchValue,y=t.activeValue,b=t.maxLength,x=t.onInputKeyDown,w=t.onInputMouseDown,S=t.onInputChange,E=t.onInputPaste,A=t.onInputCompositionStart,C=t.onInputCompositionEnd,T=t.title,I=d.useState(!1),N=(0,s.A)(I,2),P=N[0],O=N[1],L="combobox"===c,R=L||g,D=f[0],z=v||"";L&&y&&!P&&(z=y),d.useEffect((function(){L&&O(!1)}),[L,y]);var F=!("combobox"!==c&&!h&&!g)&&!!z,B=void 0===T?k(D):T,U=d.useMemo((function(){return D?null:d.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:F?{visibility:"hidden"}:void 0},p)}),[D,F,p,n]);return d.createElement(d.Fragment,null,d.createElement("span",{className:"".concat(n,"-selection-search")},d.createElement(M,{ref:i,prefixCls:n,id:r,open:h,inputElement:e,disabled:o,autoFocus:a,autoComplete:u,editable:R,activeDescendantId:l,value:z,onKeyDown:x,onMouseDown:w,onChange:function(t){O(!0),S(t)},onPaste:E,onCompositionStart:A,onCompositionEnd:C,tabIndex:m,attrs:(0,_.A)(t,!0),maxLength:L?b:void 0})),!L&&D?d.createElement("span",{className:"".concat(n,"-selection-item"),title:B,style:F?{visibility:"hidden"}:void 0},D.label):null,U)};var L=function(t,e){var n=(0,d.useRef)(null),i=(0,d.useRef)(!1),o=t.prefixCls,a=t.open,u=t.mode,l=t.showSearch,c=t.tokenWithEnter,h=t.autoClearSearchValue,f=t.onSearch,p=t.onSearchSubmit,m=t.onToggleOpen,g=t.onInputKeyDown,y=t.domRef;d.useImperativeHandle(e,(function(){return{focus:function(t){n.current.focus(t)},blur:function(){n.current.blur()}}}));var b=w(0),x=(0,s.A)(b,2),_=x[0],S=x[1],E=(0,d.useRef)(null),M=function(t){!1!==f(t,!0,i.current)&&m(!0)},A={inputRef:n,onInputKeyDown:function(t){var e,n=t.which;n!==v.A.UP&&n!==v.A.DOWN||t.preventDefault(),g&&g(t),n!==v.A.ENTER||"tags"!==u||i.current||a||null==p||p(t.target.value),e=n,[v.A.ESC,v.A.SHIFT,v.A.BACKSPACE,v.A.TAB,v.A.WIN_KEY,v.A.ALT,v.A.META,v.A.WIN_KEY_RIGHT,v.A.CTRL,v.A.SEMICOLON,v.A.EQUALS,v.A.CAPS_LOCK,v.A.CONTEXT_MENU,v.A.F1,v.A.F2,v.A.F3,v.A.F4,v.A.F5,v.A.F6,v.A.F7,v.A.F8,v.A.F9,v.A.F10,v.A.F11,v.A.F12].includes(e)||m(!0)},onInputMouseDown:function(){S(!0)},onInputChange:function(t){var e=t.target.value;if(c&&E.current&&/[\r\n]/.test(E.current)){var n=E.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");e=e.replace(n,E.current)}E.current=null,M(e)},onInputPaste:function(t){var e=t.clipboardData,n=null==e?void 0:e.getData("text");E.current=n||""},onInputCompositionStart:function(){i.current=!0},onInputCompositionEnd:function(t){i.current=!1,"combobox"!==u&&M(t.target.value)}},C="multiple"===u||"tags"===u?d.createElement(P,(0,r.A)({},t,A)):d.createElement(O,(0,r.A)({},t,A));return d.createElement("div",{ref:y,className:"".concat(o,"-selector"),onClick:function(t){t.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(t){var e=_();t.target===n.current||e||"combobox"===u||t.preventDefault(),("combobox"===u||l&&e)&&a||(a&&!1!==h&&f("",!0,!1),m())}},C)};const R=d.forwardRef(L);var D=n(62427),z=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],F=function(t,e){var n=t.prefixCls,i=(t.disabled,t.visible),s=t.children,l=t.popupElement,c=t.animation,h=t.transitionName,f=t.dropdownStyle,m=t.dropdownClassName,g=t.direction,v=void 0===g?"ltr":g,y=t.placement,b=t.builtinPlacements,x=t.dropdownMatchSelectWidth,w=t.dropdownRender,_=t.dropdownAlign,S=t.getPopupContainer,E=t.empty,M=t.getTriggerDOMNode,A=t.onPopupVisibleChange,C=t.onPopupMouseEnter,T=(0,u.A)(t,z),k="".concat(n,"-dropdown"),I=l;w&&(I=w(l));var N=d.useMemo((function(){return b||function(t){var e=!0===t?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"}}}(x)}),[b,x]),P=c?"".concat(k,"-").concat(c):h,O="number"==typeof x,L=d.useMemo((function(){return O?null:!1===x?"minWidth":"width"}),[x,O]),R=f;O&&(R=(0,a.A)((0,a.A)({},R),{},{width:x}));var F=d.useRef(null);return d.useImperativeHandle(e,(function(){return{getPopupElement:function(){var t;return null===(t=F.current)||void 0===t?void 0:t.popupElement}}})),d.createElement(D.A,(0,r.A)({},T,{showAction:A?["click"]:[],hideAction:A?["click"]:[],popupPlacement:y||("rtl"===v?"bottomRight":"bottomLeft"),builtinPlacements:N,prefixCls:k,popupTransitionName:P,popup:d.createElement("div",{onMouseEnter:C},I),ref:F,stretch:L,popupAlign:_,popupVisible:i,getPopupContainer:S,popupClassName:p()(m,(0,o.A)({},"".concat(k,"-empty"),E)),popupStyle:R,getTriggerDOMNode:M,onPopupVisibleChange:A}),s)};const B=d.forwardRef(F);var U=n(87695);function j(t,e){var n,r=t.key;return"value"in t&&(n=t.value),null!=r?r:void 0!==n?n:"rc-index-key-".concat(e)}function V(t){return void 0!==t&&!Number.isNaN(t)}function H(t,e){var n=t||{},r=n.label||(e?"children":"label");return{label:r,value:n.value||"value",options:n.options||"options",groupLabel:n.groupLabel||r}}function G(t){var e=(0,a.A)({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return(0,h.Ay)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}const W=d.createContext(null);var X=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Y=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],q=function(t){return"tags"===t||"multiple"===t},$=d.forwardRef((function(t,e){var n,h=t.id,f=t.prefixCls,_=t.className,S=t.showSearch,E=t.tagRender,M=t.direction,A=t.omitDomProps,C=t.displayValues,T=t.onDisplayValuesChange,k=t.emptyOptions,I=t.notFoundContent,N=void 0===I?"Not Found":I,P=t.onClear,O=t.mode,L=t.disabled,D=t.loading,z=t.getInputElement,F=t.getRawInputElement,j=t.open,H=t.defaultOpen,G=t.onDropdownVisibleChange,$=t.activeValue,K=t.onActiveValueChange,Z=t.activeDescendantId,Q=t.searchValue,J=t.autoClearSearchValue,tt=t.onSearch,et=t.onSearchSplit,nt=t.tokenSeparators,rt=t.allowClear,it=t.suffixIcon,ot=t.clearIcon,at=t.OptionList,st=t.animation,ut=t.transitionName,lt=t.dropdownStyle,ct=t.dropdownClassName,ht=t.dropdownMatchSelectWidth,dt=t.dropdownRender,ft=t.dropdownAlign,pt=t.placement,mt=t.builtinPlacements,gt=t.getPopupContainer,vt=t.showAction,yt=void 0===vt?[]:vt,bt=t.onFocus,xt=t.onBlur,wt=t.onKeyUp,_t=t.onKeyDown,St=t.onMouseDown,Et=(0,u.A)(t,X),Mt=q(O),At=(void 0!==S?S:Mt)||"combobox"===O,Ct=(0,a.A)({},Et);Y.forEach((function(t){delete Ct[t]})),null==A||A.forEach((function(t){delete Ct[t]}));var Tt=d.useState(!1),kt=(0,s.A)(Tt,2),It=kt[0],Nt=kt[1];d.useEffect((function(){Nt((0,g.A)())}),[]);var Pt=d.useRef(null),Ot=d.useRef(null),Lt=d.useRef(null),Rt=d.useRef(null),Dt=d.useRef(null),zt=d.useRef(!1),Ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=d.useState(!1),n=(0,s.A)(e,2),r=n[0],i=n[1],o=d.useRef(null),a=function(){window.clearTimeout(o.current)};return d.useEffect((function(){return a}),[]),[r,function(e,n){a(),o.current=window.setTimeout((function(){i(e),n&&n()}),t)},a]}(),Bt=(0,s.A)(Ft,3),Ut=Bt[0],jt=Bt[1],Vt=Bt[2];d.useImperativeHandle(e,(function(){var t,e;return{focus:null===(t=Rt.current)||void 0===t?void 0:t.focus,blur:null===(e=Rt.current)||void 0===e?void 0:e.blur,scrollTo:function(t){var e;return null===(e=Dt.current)||void 0===e?void 0:e.scrollTo(t)}}}));var Ht=d.useMemo((function(){var t;if("combobox"!==O)return Q;var e=null===(t=C[0])||void 0===t?void 0:t.value;return"string"==typeof e||"number"==typeof e?String(e):""}),[Q,O,C]),Gt="combobox"===O&&"function"==typeof z&&z()||null,Wt="function"==typeof F&&F(),Xt=(0,y.xK)(Ot,null==Wt||null===(n=Wt.props)||void 0===n?void 0:n.ref),Yt=d.useState(!1),qt=(0,s.A)(Yt,2),$t=qt[0],Kt=qt[1];(0,m.A)((function(){Kt(!0)}),[]);var Zt=(0,c.A)(!1,{defaultValue:H,value:j}),Qt=(0,s.A)(Zt,2),Jt=Qt[0],te=Qt[1],ee=!!$t&&Jt,ne=!N&&k;(L||ne&&ee&&"combobox"===O)&&(ee=!1);var re=!ne&&ee,ie=d.useCallback((function(t){var e=void 0!==t?t:!ee;L||(te(e),ee!==e&&(null==G||G(e)))}),[L,ee,te,G]),oe=d.useMemo((function(){return(nt||[]).some((function(t){return["\n","\r\n"].includes(t)}))}),[nt]),ae=d.useContext(W)||{},se=ae.maxCount,ue=ae.rawValues,le=function(t,e,n){if(!(Mt&&V(se)&&(null==ue?void 0:ue.size)>=se)){var r=!0,o=t;null==K||K(null);var a=function(t,e,n){if(!e||!e.length)return null;var r=!1,o=function t(e,n){var o=(0,U.A)(n),a=o[0],s=o.slice(1);if(!a)return[e];var u=e.split(a);return r=r||u.length>1,u.reduce((function(e,n){return[].concat((0,i.A)(e),(0,i.A)(t(n,s)))}),[]).filter(Boolean)}(t,e);return r?void 0!==n?o.slice(0,n):o:null}(t,nt,V(se)?se-ue.size:void 0),s=n?null:a;return"combobox"!==O&&s&&(o="",null==et||et(s),ie(!1),r=!1),tt&&Ht!==o&&tt(o,{source:e?"typing":"effect"}),r}};d.useEffect((function(){ee||Mt||"combobox"===O||le("",!1,!1)}),[ee]),d.useEffect((function(){Jt&&L&&te(!1),L&&!zt.current&&jt(!1)}),[L]);var ce=w(),he=(0,s.A)(ce,2),de=he[0],fe=he[1],pe=d.useRef(!1),me=[];d.useEffect((function(){return function(){me.forEach((function(t){return clearTimeout(t)})),me.splice(0,me.length)}}),[]);var ge,ve=d.useState({}),ye=(0,s.A)(ve,2)[1];Wt&&(ge=function(t){ie(t)}),function(t,e,n,r){var i=d.useRef(null);i.current={open:e,triggerOpen:n,customizedTrigger:r},d.useEffect((function(){function e(e){var n;if(null===(n=i.current)||void 0===n||!n.customizedTrigger){var r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),i.current.open&&t().filter((function(t){return t})).every((function(t){return!t.contains(r)&&t!==r}))&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[])}((function(){var t;return[Pt.current,null===(t=Lt.current)||void 0===t?void 0:t.getPopupElement()]}),re,ie,!!Wt);var be,xe=d.useMemo((function(){return(0,a.A)((0,a.A)({},t),{},{notFoundContent:N,open:ee,triggerOpen:re,id:h,showSearch:At,multiple:Mt,toggleOpen:ie})}),[t,N,re,ee,h,At,Mt,ie]),we=!!it||D;we&&(be=d.createElement(b,{className:p()("".concat(f,"-arrow"),(0,o.A)({},"".concat(f,"-arrow-loading"),D)),customizeIcon:it,customizeIconProps:{loading:D,searchValue:Ht,open:ee,focused:Ut,showSearch:At}}));var _e,Se=function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0,u=d.useMemo((function(){return"object"===(0,l.A)(r)?r.clearIcon:i||void 0}),[r,i]);return{allowClear:d.useMemo((function(){return!(o||!r||!n.length&&!a||"combobox"===s&&""===a)}),[r,o,n.length,a,s]),clearIcon:d.createElement(b,{className:"".concat(t,"-clear"),onMouseDown:e,customizeIcon:u},"×")}}(f,(function(){var t;null==P||P(),null===(t=Rt.current)||void 0===t||t.focus(),T([],{type:"clear",values:C}),le("",!1,!1)}),C,rt,ot,L,Ht,O),Ee=Se.allowClear,Me=Se.clearIcon,Ae=d.createElement(at,{ref:Dt}),Ce=p()(f,_,(0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)({},"".concat(f,"-focused"),Ut),"".concat(f,"-multiple"),Mt),"".concat(f,"-single"),!Mt),"".concat(f,"-allow-clear"),rt),"".concat(f,"-show-arrow"),we),"".concat(f,"-disabled"),L),"".concat(f,"-loading"),D),"".concat(f,"-open"),ee),"".concat(f,"-customize-input"),Gt),"".concat(f,"-show-search"),At)),Te=d.createElement(B,{ref:Lt,disabled:L,prefixCls:f,visible:re,popupElement:Ae,animation:st,transitionName:ut,dropdownStyle:lt,dropdownClassName:ct,direction:M,dropdownMatchSelectWidth:ht,dropdownRender:dt,dropdownAlign:ft,placement:pt,builtinPlacements:mt,getPopupContainer:gt,empty:k,getTriggerDOMNode:function(){return Ot.current},onPopupVisibleChange:ge,onPopupMouseEnter:function(){ye({})}},Wt?d.cloneElement(Wt,{ref:Xt}):d.createElement(R,(0,r.A)({},t,{domRef:Ot,prefixCls:f,inputElement:Gt,ref:Rt,id:h,showSearch:At,autoClearSearchValue:J,mode:O,activeDescendantId:Z,tagRender:E,values:C,open:ee,onToggleOpen:ie,activeValue:$,searchValue:Ht,onSearch:le,onSearchSubmit:function(t){t&&t.trim()&&tt(t,{source:"submit"})},onRemove:function(t){var e=C.filter((function(e){return e!==t}));T(e,{type:"remove",values:[t]})},tokenWithEnter:oe})));return _e=Wt?Te:d.createElement("div",(0,r.A)({className:Ce},Ct,{ref:Pt,onMouseDown:function(t){var e,n=t.target,r=null===(e=Lt.current)||void 0===e?void 0:e.getPopupElement();if(r&&r.contains(n)){var i=setTimeout((function(){var t,e=me.indexOf(i);-1!==e&&me.splice(e,1),Vt(),It||r.contains(document.activeElement)||null===(t=Rt.current)||void 0===t||t.focus()}));me.push(i)}for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s=0;s-=1){var u=o[s];if(!u.disabled){o.splice(s,1),a=u;break}}a&&T(o,{type:"remove",values:[a]})}for(var l=arguments.length,c=new Array(l>1?l-1:0),h=1;h1?e-1:0),r=1;r1&&void 0!==arguments[1]&&arguments[1],o=t<0&&i.current.top||t>0&&i.current.bottom;return e&&o?(clearTimeout(r.current),n.current=!1):o&&!n.current||(clearTimeout(r.current),n.current=!0,r.current=setTimeout((function(){n.current=!1}),50)),!n.current&&o}};function xt(t,e,n,r,i){var o=(0,d.useRef)(0),a=(0,d.useRef)(null),s=(0,d.useRef)(null),u=(0,d.useRef)(!1),l=bt(e,n);var c=(0,d.useRef)(null),h=(0,d.useRef)(null);return[function(e){if(t){st.A.cancel(h.current),h.current=(0,st.A)((function(){c.current=null}),2);var n=e.deltaX,d=e.deltaY,f=e.shiftKey,p=n,m=d;("sx"===c.current||!c.current&&f&&d&&!n)&&(p=d,m=0,c.current="sx");var g=Math.abs(p),v=Math.abs(m);null===c.current&&(c.current=r&&g>v?"x":"y"),"y"===c.current?function(t,e){st.A.cancel(a.current),o.current+=e,s.current=e,l(e)||(yt||t.preventDefault(),a.current=(0,st.A)((function(){var t=u.current?10:1;i(o.current*t),o.current=0})))}(e,m):function(t,e){i(e,!0),yt||t.preventDefault()}(e,p)}},function(e){t&&(u.current=e.detail===s.current)}]}var wt=14/15;var _t=20;function St(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=t/(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)*t;return isNaN(e)&&(e=0),e=Math.max(e,_t),Math.floor(e)}var Et=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],Mt=[],At={overflowY:"auto",overflowAnchor:"none"};function Ct(t,e){var n=t.prefixCls,i=void 0===n?"rc-virtual-list":n,c=t.className,h=t.height,f=t.itemHeight,g=t.fullHeight,v=void 0===g||g,y=t.style,b=t.data,x=t.children,w=t.itemKey,_=t.virtual,S=t.direction,E=t.scrollWidth,M=t.component,A=void 0===M?"div":M,C=t.onScroll,T=t.onVirtualScroll,k=t.onVisibleChange,I=t.innerProps,N=t.extraRender,P=t.styles,O=(0,u.A)(t,Et),L=d.useCallback((function(t){return"function"==typeof w?w(t):null==t?void 0:t[w]}),[w]),R=function(t,e,n){var r=d.useState(0),i=(0,s.A)(r,2),o=i[0],a=i[1],u=(0,d.useRef)(new Map),l=(0,d.useRef)(new pt),c=(0,d.useRef)();function h(){st.A.cancel(c.current)}function f(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h();var e=function(){u.current.forEach((function(t,e){if(t&&t.offsetParent){var n=(0,ht.A)(t),r=n.offsetHeight;l.current.get(e)!==r&&l.current.set(e,n.offsetHeight)}})),a((function(t){return t+1}))};t?e():c.current=(0,st.A)(e)}return(0,d.useEffect)((function(){return h}),[]),[function(r,i){var o=t(r),a=u.current.get(o);i?(u.current.set(o,i),f()):u.current.delete(o),!a!=!i&&(i?null==e||e(r):null==n||n(r))},f,l.current,o]}(L,null,null),D=(0,s.A)(R,4),z=D[0],F=D[1],B=D[2],U=D[3],j=!(!1===_||!h||!f),V=d.useMemo((function(){return Object.values(B.maps).reduce((function(t,e){return t+e}),0)}),[B.id,B.maps]),H=j&&b&&(Math.max(f*b.length,V)>h||!!E),G="rtl"===S,W=p()(i,(0,o.A)({},"".concat(i,"-rtl"),G),c),X=b||Mt,Y=(0,d.useRef)(),q=(0,d.useRef)(),$=(0,d.useState)(0),K=(0,s.A)($,2),Z=K[0],Q=K[1],J=(0,d.useState)(0),tt=(0,s.A)(J,2),et=tt[0],nt=tt[1],ot=(0,d.useState)(!1),ut=(0,s.A)(ot,2),dt=ut[0],ft=ut[1],yt=function(){ft(!0)},_t=function(){ft(!1)},Ct={getKey:L};function Tt(t){Q((function(e){var n=function(t){var e=t;Number.isNaN(Yt.current)||(e=Math.min(e,Yt.current));return e=Math.max(e,0),e}("function"==typeof t?t(e):t);return Y.current.scrollTop=n,n}))}var kt=(0,d.useRef)({start:0,end:X.length}),It=(0,d.useRef)(),Nt=vt(X,L),Pt=(0,s.A)(Nt,1)[0];It.current=Pt;var Ot=d.useMemo((function(){if(!j)return{scrollHeight:void 0,start:0,end:X.length-1,offset:void 0};var t;if(!H)return{scrollHeight:(null===(t=q.current)||void 0===t?void 0:t.offsetHeight)||0,start:0,end:X.length-1,offset:void 0};for(var e,n,r,i=0,o=X.length,a=0;a=Z&&void 0===e&&(e=a,n=i),c>Z+h&&void 0===r&&(r=a),i=c}return void 0===e&&(e=0,n=0,r=Math.ceil(h/f)),void 0===r&&(r=X.length-1),{scrollHeight:i,start:e,end:r=Math.min(r+1,X.length-1),offset:n}}),[H,j,Z,X,U,h]),Lt=Ot.scrollHeight,Rt=Ot.start,Dt=Ot.end,zt=Ot.offset;kt.current.start=Rt,kt.current.end=Dt;var Ft=d.useState({width:0,height:h}),Bt=(0,s.A)(Ft,2),Ut=Bt[0],jt=Bt[1],Vt=(0,d.useRef)(),Ht=(0,d.useRef)(),Gt=d.useMemo((function(){return St(Ut.width,E)}),[Ut.width,E]),Wt=d.useMemo((function(){return St(Ut.height,Lt)}),[Ut.height,Lt]),Xt=Lt-h,Yt=(0,d.useRef)(Xt);Yt.current=Xt;var qt=Z<=0,$t=Z>=Xt,Kt=bt(qt,$t),Zt=function(){return{x:G?-et:et,y:Z}},Qt=(0,d.useRef)(Zt()),Jt=(0,mt._q)((function(){if(T){var t=Zt();Qt.current.x===t.x&&Qt.current.y===t.y||(T(t),Qt.current=t)}}));function te(t,e){var n=t;e?((0,rt.flushSync)((function(){nt(n)})),Jt()):Tt(n)}var ee=function(t){var e=t,n=E?E-Ut.width:0;return e=Math.max(e,0),e=Math.min(e,n)},ne=(0,mt._q)((function(t,e){e?((0,rt.flushSync)((function(){nt((function(e){return ee(e+(G?-t:t))}))})),Jt()):Tt((function(e){return e+t}))})),re=xt(j,qt,$t,!!E,ne),ie=(0,s.A)(re,2),oe=ie[0],ae=ie[1];!function(t,e,n){var r,i=(0,d.useRef)(!1),o=(0,d.useRef)(0),a=(0,d.useRef)(null),s=(0,d.useRef)(null),u=function(t){if(i.current){var e=Math.ceil(t.touches[0].pageY),r=o.current-e;o.current=e,n(r)&&t.preventDefault(),clearInterval(s.current),s.current=setInterval((function(){(!n(r*=wt,!0)||Math.abs(r)<=.1)&&clearInterval(s.current)}),16)}},l=function(){i.current=!1,r()},c=function(t){r(),1!==t.touches.length||i.current||(i.current=!0,o.current=Math.ceil(t.touches[0].pageY),a.current=t.target,a.current.addEventListener("touchmove",u),a.current.addEventListener("touchend",l))};r=function(){a.current&&(a.current.removeEventListener("touchmove",u),a.current.removeEventListener("touchend",l))},(0,m.A)((function(){return t&&e.current.addEventListener("touchstart",c),function(){var t;null===(t=e.current)||void 0===t||t.removeEventListener("touchstart",c),r(),clearInterval(s.current)}}),[t])}(j,Y,(function(t,e){return!Kt(t,e)&&(oe({preventDefault:function(){},deltaY:t}),!0)})),(0,m.A)((function(){function t(t){j&&t.preventDefault()}var e=Y.current;return e.addEventListener("wheel",oe),e.addEventListener("DOMMouseScroll",ae),e.addEventListener("MozMousePixelScroll",t),function(){e.removeEventListener("wheel",oe),e.removeEventListener("DOMMouseScroll",ae),e.removeEventListener("MozMousePixelScroll",t)}}),[j]),(0,m.A)((function(){E&&nt((function(t){return ee(t)}))}),[Ut.width,E]);var se=function(){var t,e;null===(t=Vt.current)||void 0===t||t.delayHidden(),null===(e=Ht.current)||void 0===e||e.delayHidden()},ue=function(t,e,n,r,i,o,u,c){var h=d.useRef(),f=d.useState(null),p=(0,s.A)(f,2),g=p[0],v=p[1];return(0,m.A)((function(){if(g&&g.times=0;C-=1){var T=i(e[C]),k=n.get(T);if(void 0===k){f=!0;break}if((A-=k)<=0)break}switch(y){case"top":m=x-h;break;case"bottom":m=w-d+h;break;default:var I=t.current.scrollTop;xI+d&&(p="bottom")}null!==m&&u(m),m!==g.lastTop&&(f=!0)}f&&v((0,a.A)((0,a.A)({},g),{},{times:g.times+1,targetAlign:p,lastTop:m}))}}),[g,t.current]),function(t){if(null!=t){if(st.A.cancel(h.current),"number"==typeof t)u(t);else if(t&&"object"===(0,l.A)(t)){var n,r=t.align;n="index"in t?t.index:e.findIndex((function(e){return i(e)===t.key}));var o=t.offset;v({times:0,index:n,offset:void 0===o?0:o,originAlign:r})}}else c()}}(Y,X,B,f,L,(function(){return F(!0)}),Tt,se);d.useImperativeHandle(e,(function(){return{getScrollInfo:Zt,scrollTo:function(t){var e;(e=t)&&"object"===(0,l.A)(e)&&("left"in e||"top"in e)?(void 0!==t.left&&nt(ee(t.left)),ue(t.top)):ue(t)}}})),(0,m.A)((function(){if(k){var t=X.slice(Rt,Dt+1);k(t,X)}}),[Rt,Dt,X]);var le=function(t,e,n,r){var i=d.useMemo((function(){return[new Map,[]]}),[t,n.id,r]),o=(0,s.A)(i,2),a=o[0],u=o[1];return function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,s=a.get(i),l=a.get(o);if(void 0===s||void 0===l)for(var c=t.length,h=u.length;hh&&d.createElement(lt,{ref:Vt,prefixCls:i,scrollOffset:Z,scrollRange:Lt,rtl:G,onScroll:te,onStartMove:yt,onStopMove:_t,spinSize:Wt,containerSize:Ut.height,style:null==P?void 0:P.verticalScrollBar,thumbStyle:null==P?void 0:P.verticalScrollBarThumb}),H&&E>Ut.width&&d.createElement(lt,{ref:Ht,prefixCls:i,scrollOffset:et,scrollRange:E,rtl:G,onScroll:te,onStartMove:yt,onStopMove:_t,spinSize:Gt,containerSize:Ut.width,horizontal:!0,style:null==P?void 0:P.horizontalScrollBar,thumbStyle:null==P?void 0:P.horizontalScrollBarThumb}))}var Tt=d.forwardRef(Ct);Tt.displayName="List";const kt=Tt;var It=["disabled","title","children","style","className"];function Nt(t){return"string"==typeof t||"number"==typeof t}var Pt=function(t,e){var n=d.useContext(x),a=n.prefixCls,l=n.id,c=n.open,h=n.multiple,f=n.mode,m=n.searchValue,g=n.toggleOpen,y=n.notFoundContent,w=n.onPopupScroll,S=d.useContext(W),E=S.maxCount,M=S.flattenOptions,A=S.onActiveValue,C=S.defaultActiveFirstOption,T=S.onSelect,k=S.menuItemSelectedIcon,I=S.rawValues,N=S.fieldNames,P=S.virtual,O=S.direction,L=S.listHeight,R=S.listItemHeight,D=S.optionRender,z="".concat(a,"-item"),F=(0,et.A)((function(){return M}),[c,M],(function(t,e){return e[0]&&t[1]!==e[1]})),B=d.useRef(null),U=d.useMemo((function(){return h&&V(E)&&(null==I?void 0:I.size)>=E}),[h,E,null==I?void 0:I.size]),j=function(t){t.preventDefault()},H=function(t){var e;null===(e=B.current)||void 0===e||e.scrollTo("number"==typeof t?{index:t}:t)},G=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=F.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];$(t);var n={source:e?"keyboard":"mouse"},r=F[t];r?A(r.value,t,n):A(null,-1,n)};(0,d.useEffect)((function(){K(!1!==C?G(0):-1)}),[F.length,m]);var Z=d.useCallback((function(t){return I.has(t)&&"combobox"!==f}),[f,(0,i.A)(I).toString(),I.size]);(0,d.useEffect)((function(){var t,e=setTimeout((function(){if(!h&&c&&1===I.size){var t=Array.from(I)[0],e=F.findIndex((function(e){return e.data.value===t}));-1!==e&&(K(e),H(e))}}));c&&(null===(t=B.current)||void 0===t||t.scrollTo(void 0));return function(){return clearTimeout(e)}}),[c,m]);var Q=function(t){void 0!==t&&T(t,{selected:!I.has(t)}),h||g(!1)};if(d.useImperativeHandle(e,(function(){return{onKeyDown:function(t){var e=t.which,n=t.ctrlKey;switch(e){case v.A.N:case v.A.P:case v.A.UP:case v.A.DOWN:var r=0;if(e===v.A.UP?r=-1:e===v.A.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(e===v.A.N?r=1:e===v.A.P&&(r=-1)),0!==r){var i=G(q+r,r);H(i),K(i,!0)}break;case v.A.ENTER:var o,a=F[q];!a||null!=a&&null!==(o=a.data)&&void 0!==o&&o.disabled||U?Q(void 0):Q(a.value),c&&t.preventDefault();break;case v.A.ESC:g(!1),c&&t.stopPropagation()}},onKeyUp:function(){},scrollTo:function(t){H(t)}}})),0===F.length)return d.createElement("div",{role:"listbox",id:"".concat(l,"_list"),className:"".concat(z,"-empty"),onMouseDown:j},y);var J=Object.keys(N).map((function(t){return N[t]})),tt=function(t){return t.label};function rt(t,e){return{role:t.group?"presentation":"option",id:"".concat(l,"_list_").concat(e)}}var it=function(t){var e=F[t];if(!e)return null;var n=e.data||{},i=n.value,o=e.group,a=(0,_.A)(n,!0),s=tt(e);return e?d.createElement("div",(0,r.A)({"aria-label":"string"!=typeof s||o?null:s},a,{key:t},rt(e,t),{"aria-selected":Z(i)}),i):null},ot={role:"listbox",id:"".concat(l,"_list")};return d.createElement(d.Fragment,null,P&&d.createElement("div",(0,r.A)({},ot,{style:{height:0,width:0,overflow:"hidden"}}),it(q-1),it(q),it(q+1)),d.createElement(kt,{itemKey:"key",ref:B,data:F,height:L,itemHeight:R,fullHeight:!1,onMouseDown:j,onScroll:w,virtual:P,direction:O,innerProps:P?null:ot},(function(t,e){var n=t.group,i=t.groupOption,a=t.data,s=t.label,l=t.value,c=a.key;if(n){var h,f=null!==(h=a.title)&&void 0!==h?h:Nt(s)?s.toString():void 0;return d.createElement("div",{className:p()(z,"".concat(z,"-group"),a.className),title:f},void 0!==s?s:c)}var m=a.disabled,g=a.title,v=(a.children,a.style),y=a.className,x=(0,u.A)(a,It),w=(0,nt.A)(x,J),S=Z(l),E=m||!S&&U,M="".concat(z,"-option"),A=p()(z,M,y,(0,o.A)((0,o.A)((0,o.A)((0,o.A)({},"".concat(M,"-grouped"),i),"".concat(M,"-active"),q===e&&!E),"".concat(M,"-disabled"),E),"".concat(M,"-selected"),S)),C=tt(t),T=!k||"function"==typeof k||S,I="number"==typeof C?C:C||l,N=Nt(I)?I.toString():void 0;return void 0!==g&&(N=g),d.createElement("div",(0,r.A)({},(0,_.A)(w),P?{}:rt(t,e),{"aria-selected":S,className:A,title:N,onMouseMove:function(){q===e||E||K(e)},onClick:function(){E||Q(l)},style:v}),d.createElement("div",{className:"".concat(M,"-content")},"function"==typeof D?D(t,{index:e}):I),d.isValidElement(k)||S,T&&d.createElement(b,{className:"".concat(z,"-option-state"),customizeIcon:k,customizeIconProps:{value:l,disabled:E,isSelected:S}},S?"✓":null))})))};const Ot=d.forwardRef(Pt);function Lt(t,e){return A(t).join("").toUpperCase().includes(e)}var Rt=n(20998),Dt=0,zt=(0,Rt.A)();function Ft(t){var e=d.useState(),n=(0,s.A)(e,2),r=n[0],i=n[1];return d.useEffect((function(){var t;i("rc_select_".concat((zt?(t=Dt,Dt+=1):t="TEST_OR_SSR",t)))}),[]),t||r}var Bt=n(82546),Ut=["children","value"],jt=["children"];function Vt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,Bt.A)(t).map((function(t,n){if(!d.isValidElement(t)||!t.type)return null;var r=t,i=r.type.isSelectOptGroup,o=r.key,s=r.props,l=s.children,c=(0,u.A)(s,jt);return e||!i?function(t){var e=t,n=e.key,r=e.props,i=r.children,o=r.value,s=(0,u.A)(r,Ut);return(0,a.A)({key:n,value:void 0!==o?o:n,children:i},s)}(t):(0,a.A)((0,a.A)({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},c),{},{options:Vt(l)})})).filter((function(t){return t}))}const Ht=function(t,e,n,r,i){return d.useMemo((function(){var o=t;!t&&(o=Vt(e));var a=new Map,s=new Map,u=function(t,e,n){n&&"string"==typeof n&&t.set(e[n],e)};return function t(e){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=0;l1&&void 0!==arguments[1]?arguments[1]:{},n=e.fieldNames,r=e.childrenAsData,i=[],o=H(n,!1),a=o.label,s=o.value,u=o.options,l=o.groupLabel;return function t(e,n){Array.isArray(e)&&e.forEach((function(e){if(n||!(u in e)){var o=e[s];i.push({key:j(e,i.length),groupOption:n,data:e,label:e[a],value:o})}else{var c=e[l];void 0===c&&r&&(c=e.label),i.push({key:j(e,i.length),group:!0,data:e,label:c}),t(e[u],!0)}}))}(t,!1),i}(kt,{fieldNames:ot,childrenAsData:rt})}),[kt,ot,rt]),Nt=function(t){var e=pt(t);if(yt(e),Q&&(e.length!==_t.length||e.some((function(t,e){var n;return(null===(n=_t[e])||void 0===n?void 0:n.value)!==(null==t?void 0:t.value)})))){var n=Z?e:e.map((function(t){return t.value})),r=e.map((function(t){return G(St(t.value))}));Q(nt?n:n[0],nt?r:r[0])}},Pt=d.useState(null),Rt=(0,s.A)(Pt,2),Dt=Rt[0],zt=Rt[1],Bt=d.useState(0),Ut=(0,s.A)(Bt,2),jt=Ut[0],Vt=Ut[1],Yt=void 0!==L?L:"combobox"!==h,qt=d.useCallback((function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).source,r=void 0===n?"keyboard":n;Vt(e),m&&"combobox"===h&&null!==t&&"keyboard"===r&&zt(String(t))}),[m,h]),$t=function(t,e,n){var r=function(){var e,n=St(t);return[Z?{label:null==n?void 0:n[ot.label],value:t,key:null!==(e=null==n?void 0:n.key)&&void 0!==e?e:t}:t,G(n)]};if(e&&_){var i=r(),o=(0,s.A)(i,2),a=o[0],u=o[1];_(a,u)}else if(!e&&S&&"clear"!==n){var l=r(),c=(0,s.A)(l,2),h=c[0],d=c[1];S(h,d)}},Kt=Gt((function(t,e){var n,r=!nt||e.selected;n=r?nt?[].concat((0,i.A)(_t),[t]):[t]:_t.filter((function(e){return e.value!==t})),Nt(n),$t(t,r),"combobox"===h?zt(""):q&&!w||(lt(""),zt(""))})),Zt=d.useMemo((function(){var t=!1!==D&&!1!==M;return(0,a.A)((0,a.A)({},ct),{},{flattenOptions:It,onActiveValue:qt,defaultActiveFirstOption:Yt,onSelect:Kt,menuItemSelectedIcon:R,rawValues:Mt,fieldNames:ot,virtual:t,direction:z,listHeight:B,listItemHeight:V,childrenAsData:rt,maxCount:J,optionRender:P})}),[J,ct,It,qt,Yt,Kt,R,Mt,ot,D,M,z,B,V,rt,P]);return d.createElement(W.Provider,{value:Zt},d.createElement(K,(0,r.A)({},tt,{id:et,prefixCls:p,ref:e,omitDomProps:Xt,mode:h,displayValues:Et,onDisplayValuesChange:function(t,e){Nt(t);var n=e.type,r=e.values;"remove"!==n&&"clear"!==n||r.forEach((function(t){$t(t.value,!1,n)}))},direction:z,searchValue:ut,onSearch:function(t,e){if(lt(t),zt(null),"submit"!==e.source)"blur"!==e.source&&("combobox"===h&&Nt(t),null==b||b(t));else{var n=(t||"").trim();if(n){var r=Array.from(new Set([].concat((0,i.A)(Mt),[n])));Nt(r),$t(n,!0),lt("")}}},autoClearSearchValue:w,onSearchSplit:function(t){var e=t;"tags"!==h&&(e=t.map((function(t){var e=dt.get(t);return null==e?void 0:e.value})).filter((function(t){return void 0!==t})));var n=Array.from(new Set([].concat((0,i.A)(Mt),(0,i.A)(e))));Nt(n),n.forEach((function(t){$t(t,!0)}))},dropdownMatchSelectWidth:M,OptionList:Ot,emptyOptions:!It.length,activeValue:Dt,activeDescendantId:"".concat(et,"_list_").concat(jt)})))}));Yt.Option=tt,Yt.OptGroup=Q;const qt=Yt},95826:(t,e,n)=>{"use strict";n.d(e,{A:()=>L});var r=n(89379),i=n(64467),o=n(60436),a=n(5544),s=n(82284),u=n(46942),l=n.n(u),c=n(12533),h=n(43210),d=n(68210),f=n(96540),p=n(58168),m=n(53986);function g(t,e,n){return(t-e)/(n-e)}function v(t,e,n,r){var i=g(e,n,r),o={};switch(t){case"rtl":o.right="".concat(100*i,"%"),o.transform="translateX(50%)";break;case"btt":o.bottom="".concat(100*i,"%"),o.transform="translateY(50%)";break;case"ttb":o.top="".concat(100*i,"%"),o.transform="translateY(-50%)";break;default:o.left="".concat(100*i,"%"),o.transform="translateX(-50%)"}return o}function y(t,e){return Array.isArray(t)?t[e]:t}var b=n(16928);const x=f.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}});var w=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"];const _=f.forwardRef((function(t,e){var n,o=t.prefixCls,a=t.value,s=t.valueIndex,u=t.onStartMove,c=t.style,h=t.render,d=t.dragging,g=t.onOffsetChange,_=t.onChangeComplete,S=t.onFocus,E=t.onMouseEnter,M=(0,m.A)(t,w),A=f.useContext(x),C=A.min,T=A.max,k=A.direction,I=A.disabled,N=A.keyboard,P=A.range,O=A.tabIndex,L=A.ariaLabelForHandle,R=A.ariaLabelledByForHandle,D=A.ariaValueTextFormatterForHandle,z=A.styles,F=A.classNames,B="".concat(o,"-handle"),U=function(t){I||u(t,s)},j=v(k,a,C,T),V={};null!==s&&(V={tabIndex:I?null:y(O,s),role:"slider","aria-valuemin":C,"aria-valuemax":T,"aria-valuenow":a,"aria-disabled":I,"aria-label":y(L,s),"aria-labelledby":y(R,s),"aria-valuetext":null===(n=y(D,s))||void 0===n?void 0:n(a),"aria-orientation":"ltr"===k||"rtl"===k?"horizontal":"vertical",onMouseDown:U,onTouchStart:U,onFocus:function(t){null==S||S(t,s)},onMouseEnter:function(t){E(t,s)},onKeyDown:function(t){if(!I&&N){var e=null;switch(t.which||t.keyCode){case b.A.LEFT:e="ltr"===k||"btt"===k?-1:1;break;case b.A.RIGHT:e="ltr"===k||"btt"===k?1:-1;break;case b.A.UP:e="ttb"!==k?1:-1;break;case b.A.DOWN:e="ttb"!==k?-1:1;break;case b.A.HOME:e="min";break;case b.A.END:e="max";break;case b.A.PAGE_UP:e=2;break;case b.A.PAGE_DOWN:e=-2}null!==e&&(t.preventDefault(),g(e,s))}},onKeyUp:function(t){switch(t.which||t.keyCode){case b.A.LEFT:case b.A.RIGHT:case b.A.UP:case b.A.DOWN:case b.A.HOME:case b.A.END:case b.A.PAGE_UP:case b.A.PAGE_DOWN:null==_||_()}}});var H=f.createElement("div",(0,p.A)({ref:e,className:l()(B,(0,i.A)((0,i.A)({},"".concat(B,"-").concat(s+1),null!==s&&P),"".concat(B,"-dragging"),d),F.handle),style:(0,r.A)((0,r.A)((0,r.A)({},j),c),z.handle)},V,M));return h&&(H=h(H,{index:s,prefixCls:o,value:a,dragging:d})),H}));var S=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","onFocus"];const E=f.forwardRef((function(t,e){var n=t.prefixCls,i=t.style,o=t.onStartMove,s=t.onOffsetChange,u=t.values,l=t.handleRender,c=t.activeHandleRender,h=t.draggingIndex,d=t.onFocus,g=(0,m.A)(t,S),v=f.useRef({});f.useImperativeHandle(e,(function(){return{focus:function(t){var e;null===(e=v.current[t])||void 0===e||e.focus()}}}));var b=f.useState(-1),x=(0,a.A)(b,2),w=x[0],E=x[1],M=(0,r.A)({prefixCls:n,onStartMove:o,onOffsetChange:s,render:l,onFocus:function(t,e){E(e),null==d||d(t)},onMouseEnter:function(t,e){E(e)}},g);return f.createElement(f.Fragment,null,u.map((function(t,e){return f.createElement(_,(0,p.A)({ref:function(t){t?v.current[e]=t:delete v.current[e]},dragging:h===e,style:y(i,e),key:e,value:t,valueIndex:e},M))})),c&&f.createElement(_,(0,p.A)({key:"a11y"},M,{value:u[w],valueIndex:null,dragging:-1!==h,render:c,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}));const M=function(t){var e=t.prefixCls,n=t.style,o=t.children,a=t.value,s=t.onClick,u=f.useContext(x),c=u.min,h=u.max,d=u.direction,p=u.includedStart,m=u.includedEnd,g=u.included,y="".concat(e,"-text"),b=v(d,a,c,h);return f.createElement("span",{className:l()(y,(0,i.A)({},"".concat(y,"-active"),g&&p<=a&&a<=m)),style:(0,r.A)((0,r.A)({},b),n),onMouseDown:function(t){t.stopPropagation()},onClick:function(){s(a)}},o)};const A=function(t){var e=t.prefixCls,n=t.marks,r=t.onClick,i="".concat(e,"-mark");return n.length?f.createElement("div",{className:i},n.map((function(t){var e=t.value,n=t.style,o=t.label;return f.createElement(M,{key:e,prefixCls:i,style:n,value:e,onClick:r},o)}))):null};const C=function(t){var e=t.prefixCls,n=t.value,o=t.style,a=t.activeStyle,s=f.useContext(x),u=s.min,c=s.max,h=s.direction,d=s.included,p=s.includedStart,m=s.includedEnd,g="".concat(e,"-dot"),y=d&&p<=n&&n<=m,b=(0,r.A)((0,r.A)({},v(h,n,u,c)),"function"==typeof o?o(n):o);return y&&(b=(0,r.A)((0,r.A)({},b),"function"==typeof a?a(n):a)),f.createElement("span",{className:l()(g,(0,i.A)({},"".concat(g,"-active"),y)),style:b})};const T=function(t){var e=t.prefixCls,n=t.marks,r=t.dots,i=t.style,o=t.activeStyle,a=f.useContext(x),s=a.min,u=a.max,l=a.step,c=f.useMemo((function(){var t=new Set;if(n.forEach((function(e){t.add(e.value)})),r&&null!==l)for(var e=s;e<=u;)t.add(e),e+=l;return Array.from(t)}),[s,u,l,r,n]);return f.createElement("div",{className:"".concat(e,"-step")},c.map((function(t){return f.createElement(C,{prefixCls:e,key:t,value:t,style:i,activeStyle:o})})))};const k=function(t){var e=t.prefixCls,n=t.style,o=t.start,a=t.end,s=t.index,u=t.onStartMove,c=t.replaceCls,h=f.useContext(x),d=h.direction,p=h.min,m=h.max,v=h.disabled,y=h.range,b=h.classNames,w="".concat(e,"-track"),_=g(o,p,m),S=g(a,p,m),E=function(t){!v&&u&&u(t,-1)},M={};switch(d){case"rtl":M.right="".concat(100*_,"%"),M.width="".concat(100*S-100*_,"%");break;case"btt":M.bottom="".concat(100*_,"%"),M.height="".concat(100*S-100*_,"%");break;case"ttb":M.top="".concat(100*_,"%"),M.height="".concat(100*S-100*_,"%");break;default:M.left="".concat(100*_,"%"),M.width="".concat(100*S-100*_,"%")}var A=c||l()(w,(0,i.A)((0,i.A)({},"".concat(w,"-").concat(s+1),null!==s&&y),"".concat(e,"-track-draggable"),u),b.track);return f.createElement("div",{className:A,style:(0,r.A)((0,r.A)({},M),n),onMouseDown:E,onTouchStart:E})};const I=function(t){var e=t.prefixCls,n=t.style,i=t.values,o=t.startPoint,a=t.onStartMove,s=f.useContext(x),u=s.included,c=s.range,h=s.min,d=s.styles,p=s.classNames,m=f.useMemo((function(){if(!c){if(0===i.length)return[];var t=null!=o?o:h,e=i[0];return[{start:Math.min(t,e),end:Math.max(t,e)}]}for(var n=[],r=0;r=0&&q}),[q,xt]),_t=f.useMemo((function(){return Object.keys(at||{}).map((function(t){var e=at[t],n={value:Number(t)};return e&&"object"===(0,s.A)(e)&&!f.isValidElement(e)&&("label"in e||"style"in e)?(n.style=e.style,n.label=e.label):n.label=e,n})).filter((function(t){var e=t.label;return e||"number"==typeof e})).sort((function(t,e){return t.value-e.value}))}),[at]),St=function(t,e,n,r,i,a){var s=f.useCallback((function(n){return Math.max(t,Math.min(e,n))}),[t,e]),u=f.useCallback((function(r){if(null!==n){var i=t+Math.round((s(r)-t)/n)*n,o=function(t){return(String(t).split(".")[1]||"").length},a=Math.max(o(n),o(e),o(t)),u=Number(i.toFixed(a));return t<=u&&u<=e?u:null}return null}),[n,t,e,s]),l=f.useCallback((function(i){var o=s(i),a=r.map((function(t){return t.value}));null!==n&&a.push(u(i)),a.push(t,e);var l=a[0],c=e-t;return a.forEach((function(t){var e=Math.abs(o-t);e<=c&&(l=t,c=e)})),l}),[t,e,r,n,s,u]),c=function i(a,s,l){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof s){var h,d=a[l],f=d+s,p=[];r.forEach((function(t){p.push(t.value)})),p.push(t,e),p.push(u(d));var m=s>0?1:-1;"unit"===c?p.push(u(d+m*n)):p.push(u(f)),p=p.filter((function(t){return null!==t})).filter((function(t){return s<0?t<=d:t>=d})),"unit"===c&&(p=p.filter((function(t){return t!==d})));var g="unit"===c?d:f;h=p[0];var v=Math.abs(h-g);if(p.forEach((function(t){var e=Math.abs(t-g);e1){var y=(0,o.A)(a);return y[l]=h,i(y,s-m,l,c)}return h}return"min"===s?t:"max"===s?e:void 0},h=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",i=t[n],o=c(t,e,n,r);return{value:o,changed:o!==i}},d=function(t){return null===a&&0===t||"number"==typeof a&&t3&&void 0!==arguments[3]?arguments[3]:"unit",o=t.map(l),s=o[n],u=c(o,e,n,r);if(o[n]=u,!1===i){var f=a||0;n>0&&o[n-1]!==s&&(o[n]=Math.max(o[n],o[n-1]+f)),n0;v-=1)for(var y=!0;d(o[v]-o[v-1])&&y;){var b=h(o,-1,v-1);o[v-1]=b.value,y=b.changed}for(var x=o.length-1;x>0;x-=1)for(var w=!0;d(o[x]-o[x-1])&&w;){var _=h(o,-1,x-1);o[x-1]=_.value,w=_.changed}for(var S=0;S=0?U+1:2;for(n=n.slice(0,r);n.length=0&&mt.current.focus(t)}Xt(null)}),[Wt]);var Yt=f.useMemo((function(){return(!$||null!==xt)&&$}),[$,xt]),qt=function(t,e){jt(t,e),null==V||V(Ot(Pt.current))},$t=-1!==Ft;f.useEffect((function(){if(!$t){var t=Nt.lastIndexOf(Bt);mt.current.focus(t)}}),[$t]);var Kt=f.useMemo((function(){return(0,o.A)(Ut).sort((function(t,e){return t-e}))}),[Ut]),Zt=f.useMemo((function(){return B?[Kt[0],Kt[Kt.length-1]]:[yt,Kt[0]]}),[Kt,B,yt]),Qt=(0,a.A)(Zt,2),Jt=Qt[0],te=Qt[1];f.useImperativeHandle(e,(function(){return{focus:function(){mt.current.focus(0)},blur:function(){var t,e=document.activeElement;null!==(t=gt.current)&&void 0!==t&&t.contains(e)&&(null==e||e.blur())}}})),f.useEffect((function(){S&&mt.current.focus(0)}),[]);var ee=f.useMemo((function(){return{min:yt,max:bt,direction:vt,disabled:b,keyboard:_,step:xt,included:J,includedStart:Jt,includedEnd:te,range:B,tabIndex:ht,ariaLabelForHandle:dt,ariaLabelledByForHandle:ft,ariaValueTextFormatterForHandle:pt,styles:v||{},classNames:g||{}}}),[yt,bt,vt,b,_,xt,J,Jt,te,B,ht,dt,ft,pt,v,g]);return f.createElement(x.Provider,{value:ee},f.createElement("div",{ref:gt,className:l()(u,p,(0,i.A)((0,i.A)((0,i.A)((0,i.A)({},"".concat(u,"-disabled"),b),"".concat(u,"-vertical"),Z),"".concat(u,"-horizontal"),!Z),"".concat(u,"-with-marks"),_t.length)),style:m,onMouseDown:function(t){t.preventDefault();var e,n=gt.current.getBoundingClientRect(),r=n.width,i=n.height,o=n.left,a=n.top,s=n.bottom,u=n.right,l=t.clientX,c=t.clientY;switch(vt){case"btt":e=(s-c)/i;break;case"ttb":e=(c-a)/i;break;case"rtl":e=(u-l)/r;break;default:e=(l-o)/r}Vt(Mt(yt+e*(bt-yt)),t)}},f.createElement("div",{className:l()("".concat(u,"-rail"),null==g?void 0:g.rail),style:(0,r.A)((0,r.A)({},rt),null==v?void 0:v.rail)}),f.createElement(I,{prefixCls:u,style:et,values:Kt,startPoint:tt,onStartMove:Yt?qt:void 0}),f.createElement(T,{prefixCls:u,marks:_t,dots:st,style:it,activeStyle:ot}),f.createElement(E,{ref:mt,prefixCls:u,style:nt,values:Ut,draggingIndex:Ft,onStartMove:qt,onOffsetChange:function(t,e){if(!b){var n=At(Nt,t,e);null==V||V(Ot(Nt)),Lt(n.values),Xt(n.value)}},onFocus:M,onBlur:C,handleRender:ut,activeHandleRender:lt,onChangeComplete:Rt}),f.createElement(A,{prefixCls:u,marks:_t,onClick:Vt})))}))},9919:(t,e,n)=>{"use strict";n.d(e,{A:()=>C});var r,i=n(58168),o=n(64467),a=n(89379),s=n(60436),u=n(5544),l=n(53986),c=n(46942),h=n.n(c),d=n(48491),f=n(22489),p=n(11980),m=n(12533),g=n(96540),v=n(82284),y=n(18462),b=n(30981),x=n(25371),w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],_={};function S(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),t.getAttribute("wrap")?r.setAttribute("wrap",t.getAttribute("wrap")):r.removeAttribute("wrap");var o=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&_[n])return _[n];var r=window.getComputedStyle(t),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s={sizingStyle:w.map((function(t){return"".concat(t,":").concat(r.getPropertyValue(t))})).join(";"),paddingSize:o,borderSize:a,boxSizing:i};return e&&n&&(_[n]=s),s}(t,e),a=o.paddingSize,s=o.borderSize,u=o.boxSizing,l=o.sizingStyle;r.setAttribute("style","".concat(l,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=t.value||t.placeholder||"";var c,h=void 0,d=void 0,f=r.scrollHeight;if("border-box"===u?f+=s:"content-box"===u&&(f-=a),null!==n||null!==i){r.value=" ";var p=r.scrollHeight-a;null!==n&&(h=p*n,"border-box"===u&&(h=h+a+s),f=Math.max(h,f)),null!==i&&(d=p*i,"border-box"===u&&(d=d+a+s),c=f>d?"":"hidden",f=Math.min(d,f))}var m={height:f,overflowY:c,resize:"none"};return h&&(m.minHeight=h),d&&(m.maxHeight=d),m}var E=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"];const M=g.forwardRef((function(t,e){var n=t,r=n.prefixCls,s=(n.onPressEnter,n.defaultValue),c=n.value,d=n.autoSize,f=n.onResize,p=n.className,w=n.style,_=n.disabled,M=n.onChange,A=(n.onInternalAutoSize,(0,l.A)(n,E)),C=(0,m.A)(s,{value:c,postState:function(t){return null!=t?t:""}}),T=(0,u.A)(C,2),k=T[0],I=T[1],N=g.useRef();g.useImperativeHandle(e,(function(){return{textArea:N.current}}));var P=g.useMemo((function(){return d&&"object"===(0,v.A)(d)?[d.minRows,d.maxRows]:[]}),[d]),O=(0,u.A)(P,2),L=O[0],R=O[1],D=!!d,z=g.useState(2),F=(0,u.A)(z,2),B=F[0],U=F[1],j=g.useState(),V=(0,u.A)(j,2),H=V[0],G=V[1],W=function(){U(0)};(0,b.A)((function(){D&&W()}),[c,L,R,D]),(0,b.A)((function(){if(0===B)U(1);else if(1===B){var t=S(N.current,!1,L,R);U(2),G(t)}else!function(){try{if(document.activeElement===N.current){var t=N.current,e=t.selectionStart,n=t.selectionEnd,r=t.scrollTop;N.current.setSelectionRange(e,n),N.current.scrollTop=r}}catch(t){}}()}),[B]);var X=g.useRef(),Y=function(){x.A.cancel(X.current)};g.useEffect((function(){return Y}),[]);var q=D?H:null,$=(0,a.A)((0,a.A)({},w),q);return 0!==B&&1!==B||($.overflowY="hidden",$.overflowX="hidden"),g.createElement(y.A,{onResize:function(t){2===B&&(null==f||f(t),d&&(Y(),X.current=(0,x.A)((function(){W()}))))},disabled:!(d||f)},g.createElement("textarea",(0,i.A)({},A,{ref:N,style:$,className:h()(r,p,(0,o.A)({},"".concat(r,"-disabled"),_)),disabled:_,value:k,onChange:function(t){I(t.target.value),null==M||M(t)}})))}));var A=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"];const C=g.forwardRef((function(t,e){var n,r,c=t.defaultValue,v=t.value,y=t.onFocus,b=t.onBlur,x=t.onChange,w=t.allowClear,_=t.maxLength,S=t.onCompositionStart,E=t.onCompositionEnd,C=t.suffix,T=t.prefixCls,k=void 0===T?"rc-textarea":T,I=t.showCount,N=t.count,P=t.className,O=t.style,L=t.disabled,R=t.hidden,D=t.classNames,z=t.styles,F=t.onResize,B=(0,l.A)(t,A),U=(0,m.A)(c,{value:v,defaultValue:c}),j=(0,u.A)(U,2),V=j[0],H=j[1],G=null==V?"":String(V),W=g.useState(!1),X=(0,u.A)(W,2),Y=X[0],q=X[1],$=g.useRef(!1),K=g.useState(null),Z=(0,u.A)(K,2),Q=Z[0],J=Z[1],tt=(0,g.useRef)(null),et=function(){var t;return null===(t=tt.current)||void 0===t?void 0:t.textArea},nt=function(){et().focus()};(0,g.useImperativeHandle)(e,(function(){return{resizableTextArea:tt.current,focus:nt,blur:function(){et().blur()}}})),(0,g.useEffect)((function(){q((function(t){return!L&&t}))}),[L]);var rt=g.useState(null),it=(0,u.A)(rt,2),ot=it[0],at=it[1];g.useEffect((function(){var t;ot&&(t=et()).setSelectionRange.apply(t,(0,s.A)(ot))}),[ot]);var st,ut=(0,f.A)(N,I),lt=null!==(n=ut.max)&&void 0!==n?n:_,ct=Number(lt)>0,ht=ut.strategy(G),dt=!!lt&&ht>lt,ft=function(t,e){var n=e;!$.current&&ut.exceedFormatter&&ut.max&&ut.strategy(e)>ut.max&&e!==(n=ut.exceedFormatter(e,{max:ut.max}))&&at([et().selectionStart||0,et().selectionEnd||0]),H(n),(0,p.gS)(t.currentTarget,t,x,n)},pt=C;ut.show&&(st=ut.showFormatter?ut.showFormatter({value:G,count:ht,maxLength:lt}):"".concat(ht).concat(ct?" / ".concat(lt):""),pt=g.createElement(g.Fragment,null,pt,g.createElement("span",{className:h()("".concat(k,"-data-count"),null==D?void 0:D.count),style:null==z?void 0:z.count},st)));var mt=!B.autoSize&&!I&&!w;return g.createElement(d.a,{value:G,allowClear:w,handleReset:function(t){H(""),nt(),(0,p.gS)(et(),t,x)},suffix:pt,prefixCls:k,classNames:(0,a.A)((0,a.A)({},D),{},{affixWrapper:h()(null==D?void 0:D.affixWrapper,(r={},(0,o.A)(r,"".concat(k,"-show-count"),I),(0,o.A)(r,"".concat(k,"-textarea-allow-clear"),w),r))}),disabled:L,focused:Y,className:h()(P,dt&&"".concat(k,"-out-of-range")),style:(0,a.A)((0,a.A)({},O),Q&&!mt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof st?st:void 0}},hidden:R},g.createElement(M,(0,i.A)({},B,{maxLength:_,onKeyDown:function(t){var e=B.onPressEnter,n=B.onKeyDown;"Enter"===t.key&&e&&e(t),null==n||n(t)},onChange:function(t){ft(t,t.target.value)},onFocus:function(t){q(!0),null==y||y(t)},onBlur:function(t){q(!1),null==b||b(t)},onCompositionStart:function(t){$.current=!0,null==S||S(t)},onCompositionEnd:function(t){$.current=!1,ft(t,t.currentTarget.value),null==E||E(t)},className:h()(null==D?void 0:D.textarea),style:(0,a.A)((0,a.A)({},null==z?void 0:z.textarea),{},{resize:null==O?void 0:O.resize}),disabled:L,prefixCls:k,onResize:function(t){var e;null==F||F(t),null!==(e=et())&&void 0!==e&&e.style.height&&J(!0)},ref:tt})))}))},80427:(t,e,n)=>{"use strict";n.d(e,{z:()=>a,A:()=>v});var r=n(46942),i=n.n(r),o=n(96540);function a(t){var e=t.children,n=t.prefixCls,r=t.id,a=t.overlayInnerStyle,s=t.className,u=t.style;return o.createElement("div",{className:i()("".concat(n,"-content"),s),style:u},o.createElement("div",{className:"".concat(n,"-inner"),id:r,role:"tooltip",style:a},"function"==typeof e?e():e))}var s=n(58168),u=n(89379),l=n(53986),c=n(62427),h={shiftX:64,adjustY:1},d={adjustX:1,shiftY:!0},f=[0,0],p={left:{points:["cr","cl"],overflow:d,offset:[-4,0],targetOffset:f},right:{points:["cl","cr"],overflow:d,offset:[4,0],targetOffset:f},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:f},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:f},topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:f},leftTop:{points:["tr","tl"],overflow:d,offset:[-4,0],targetOffset:f},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:f},rightTop:{points:["tl","tr"],overflow:d,offset:[4,0],targetOffset:f},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:f},rightBottom:{points:["bl","br"],overflow:d,offset:[4,0],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:f},leftBottom:{points:["br","bl"],overflow:d,offset:[-4,0],targetOffset:f}};var m=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],g=function(t,e){var n=t.overlayClassName,r=t.trigger,i=void 0===r?["hover"]:r,h=t.mouseEnterDelay,d=void 0===h?0:h,f=t.mouseLeaveDelay,g=void 0===f?.1:f,v=t.overlayStyle,y=t.prefixCls,b=void 0===y?"rc-tooltip":y,x=t.children,w=t.onVisibleChange,_=t.afterVisibleChange,S=t.transitionName,E=t.animation,M=t.motion,A=t.placement,C=void 0===A?"right":A,T=t.align,k=void 0===T?{}:T,I=t.destroyTooltipOnHide,N=void 0!==I&&I,P=t.defaultVisible,O=t.getTooltipContainer,L=t.overlayInnerStyle,R=(t.arrowContent,t.overlay),D=t.id,z=t.showArrow,F=void 0===z||z,B=(0,l.A)(t,m),U=(0,o.useRef)(null);(0,o.useImperativeHandle)(e,(function(){return U.current}));var j=(0,u.A)({},B);"visible"in t&&(j.popupVisible=t.visible);return o.createElement(c.A,(0,s.A)({popupClassName:n,prefixCls:b,popup:function(){return o.createElement(a,{key:"content",prefixCls:b,id:D,overlayInnerStyle:L},R)},action:i,builtinPlacements:p,popupPlacement:C,ref:U,popupAlign:k,getPopupContainer:O,onPopupVisibleChange:w,afterPopupVisibleChange:_,popupTransitionName:S,popupAnimation:E,popupMotion:M,defaultPopupVisible:P,autoDestroy:N,mouseLeaveDelay:g,popupStyle:v,mouseEnterDelay:d,arrow:F},j),x)};const v=(0,o.forwardRef)(g)},40778:(t,e,n)=>{"use strict";n.d(e,{A:()=>P});var r=n(58168),i=n(23029),o=n(92901),a=n(9417),s=n(15361),u=n(29426),l=n(64467),c=n(96540),h=n(89379),d=n(53986),f=n(90675),p=n(82284),m=n(10467),g=n(60436),v=n(46942),y=n.n(v),b=n(72065),x=n(68210);const w=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),r=t.name||"",i=t.type||"",o=i.replace(/\/.*$/,"");return n.some((function(t){var e=t.trim();if(/^\*(\/\*)?$/.test(t))return!0;if("."===e.charAt(0)){var n=r.toLowerCase(),a=e.toLowerCase(),s=[a];return".jpg"!==a&&".jpeg"!==a||(s=[".jpg",".jpeg"]),s.some((function(t){return n.endsWith(t)}))}return/\/\*$/.test(e)?o===e.replace(/\/.*$/,""):i===e||!!/^\w+$/.test(e)&&((0,x.Ay)(!1,"Upload takes an invalidate 'accept' type '".concat(e,"'.Skip for check.")),!0)}))}return!0};function _(t){var e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(t){return e}}function S(t){var e=new XMLHttpRequest;t.onProgress&&e.upload&&(e.upload.onprogress=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.onProgress(e)});var n=new FormData;t.data&&Object.keys(t.data).forEach((function(e){var r=t.data[e];Array.isArray(r)?r.forEach((function(t){n.append("".concat(e,"[]"),t)})):n.append(e,r)})),t.file instanceof Blob?n.append(t.filename,t.file,t.file.name):n.append(t.filename,t.file),e.onerror=function(e){t.onError(e)},e.onload=function(){return e.status<200||e.status>=300?t.onError(function(t,e){var n="cannot ".concat(t.method," ").concat(t.action," ").concat(e.status,"'"),r=new Error(n);return r.status=e.status,r.method=t.method,r.url=t.action,r}(t,e),_(e)):t.onSuccess(_(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);var r=t.headers||{};return null!==r["X-Requested-With"]&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach((function(t){null!==r[t]&&e.setRequestHeader(t,r[t])})),e.send(n),{abort:function(){e.abort()}}}const E=function(t,e,n){var r=function t(r,i){r&&(r.path=i||"",r.isFile?r.file((function(t){n(t)&&(r.fullPath&&!t.webkitRelativePath&&(Object.defineProperties(t,{webkitRelativePath:{writable:!0}}),t.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(t,{webkitRelativePath:{writable:!1}})),e([t]))})):r.isDirectory&&function(t,e){var n=t.createReader(),r=[];!function t(){n.readEntries((function(n){var i=Array.prototype.slice.apply(n);r=r.concat(i),i.length?t():e(r)}))}()}(r,(function(e){e.forEach((function(e){t(e,"".concat(i).concat(r.name,"/"))}))})))};t.forEach((function(t){r(t.webkitGetAsEntry())}))};var M=+new Date,A=0;function C(){return"rc-upload-".concat(M,"-").concat(++A)}var T=["component","prefixCls","className","classNames","disabled","id","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"];const k=function(t){(0,s.A)(n,t);var e=(0,u.A)(n);function n(){var t;(0,i.A)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s{"use strict";n.d(e,{A:()=>o});var r=n(96540),i=n(66351);function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];return r.Children.forEach(t,(function(t){(null!=t||e.keepEmpty)&&(Array.isArray(t)?n=n.concat(o(t)):(0,i.isFragment)(t)&&t.props?n=n.concat(o(t.props.children,e)):n.push(t))})),n}},20998:(t,e,n)=>{"use strict";function r(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}n.d(e,{A:()=>r})},54808:(t,e,n)=>{"use strict";function r(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}n.d(e,{A:()=>r})},85089:(t,e,n)=>{"use strict";n.d(e,{BD:()=>g,m6:()=>m});var r=n(89379),i=n(20998),o=n(54808),a="data-rc-order",s="data-rc-priority",u="rc-util-key",l=new Map;function c(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return t?t.startsWith("data-")?t:"data-".concat(t):u}function h(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function d(t){return Array.from((l.get(t)||t).children).filter((function(t){return"STYLE"===t.tagName}))}function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,i.A)())return null;var n=e.csp,r=e.prepend,o=e.priority,u=void 0===o?0:o,l=function(t){return"queue"===t?"prependQueue":t?"prepend":"append"}(r),c="prependQueue"===l,f=document.createElement("style");f.setAttribute(a,l),c&&u&&f.setAttribute(s,"".concat(u)),null!=n&&n.nonce&&(f.nonce=null==n?void 0:n.nonce),f.innerHTML=t;var p=h(e),m=p.firstChild;if(r){if(c){var g=(e.styles||d(p)).filter((function(t){if(!["prepend","prependQueue"].includes(t.getAttribute(a)))return!1;var e=Number(t.getAttribute(s)||0);return u>=e}));if(g.length)return p.insertBefore(f,g[g.length-1].nextSibling),f}p.insertBefore(f,m)}else p.appendChild(f);return f}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=h(e);return(e.styles||d(n)).find((function(n){return n.getAttribute(c(e))===t}))}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=p(t,e);n&&h(e).removeChild(n)}function g(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=h(n),a=d(i),s=(0,r.A)((0,r.A)({},n),{},{styles:a});!function(t,e){var n=l.get(t);if(!n||!(0,o.A)(document,n)){var r=f("",e),i=r.parentNode;l.set(t,i),t.removeChild(r)}}(i,s);var u=p(e,s);if(u){var m,g,v;if(null!==(m=s.csp)&&void 0!==m&&m.nonce&&u.nonce!==(null===(g=s.csp)||void 0===g?void 0:g.nonce))u.nonce=null===(v=s.csp)||void 0===v?void 0:v.nonce;return u.innerHTML!==t&&(u.innerHTML=t),u}var y=f(t,s);return y.setAttribute(c(s),e),y}},66588:(t,e,n)=>{"use strict";n.d(e,{A:()=>a,f:()=>o});var r=n(96540),i=n(40961);function o(t){return t instanceof HTMLElement||t instanceof SVGElement}function a(t){return o(t)?t:t instanceof r.Component?i.findDOMNode(t):null}},42467:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,r=e.height;if(n||r)return!0}if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),o=i.width,a=i.height;if(o||a)return!0}}return!1}},72633:(t,e,n)=>{"use strict";function r(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}function i(t){return function(t){return r(t)instanceof ShadowRoot}(t)?r(t):null}n.d(e,{j:()=>i})},16928:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var e=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||e>=r.F1&&e<=r.F12)return!1;switch(e){case r.ALT:case r.CAPS_LOCK:case r.CONTEXT_MENU:case r.CTRL:case r.DOWN:case r.END:case r.ESC:case r.HOME:case r.INSERT:case r.LEFT:case r.MAC_FF_META:case r.META:case r.NUMLOCK:case r.NUM_CENTER:case r.PAGE_DOWN:case r.PAGE_UP:case r.PAUSE:case r.PRINT_SCREEN:case r.RIGHT:case r.SHIFT:case r.UP:case r.WIN_KEY:case r.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=r.ZERO&&t<=r.NINE)return!0;if(t>=r.NUM_ZERO&&t<=r.NUM_MULTIPLY)return!0;if(t>=r.A&&t<=r.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===t)return!0;switch(t){case r.SPACE:case r.QUESTION_MARK:case r.NUM_PLUS:case r.NUM_MINUS:case r.NUM_PERIOD:case r.NUM_DIVISION:case r.SEMICOLON:case r.DASH:case r.EQUALS:case r.COMMA:case r.PERIOD:case r.SLASH:case r.APOSTROPHE:case r.SINGLE_QUOTE:case r.OPEN_SQUARE_BRACKET:case r.BACKSLASH:case r.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};const i=r},14832:(t,e,n)=>{"use strict";var r;n.d(e,{X:()=>g,v:()=>x});var i,o=n(90675),a=n(10467),s=n(82284),u=n(89379),l=n(40961),c=(0,u.A)({},r||(r=n.t(l,2))),h=c.version,d=c.render,f=c.unmountComponentAtNode;try{Number((h||"").split(".")[0])>=18&&(i=c.createRoot)}catch(t){}function p(t){var e=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&"object"===(0,s.A)(e)&&(e.usingClientEntryPoint=t)}var m="__rc_react_root__";function g(t,e){i?function(t,e){p(!0);var n=e[m]||i(e);p(!1),n.render(t),e[m]=n}(t,e):function(t,e){d(t,e)}(t,e)}function v(t){return y.apply(this,arguments)}function y(){return(y=(0,a.A)((0,o.A)().mark((function t(e){return(0,o.A)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve().then((function(){var t;null===(t=e[m])||void 0===t||t.unmount(),delete e[m]})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function b(t){f(t)}function x(t){return w.apply(this,arguments)}function w(){return(w=(0,a.A)((0,o.A)().mark((function t(e){return(0,o.A)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===i){t.next=2;break}return t.abrupt("return",v(e));case 2:b(e);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},26956:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(96540);function i(t){var e=r.useRef();e.current=t;var n=r.useCallback((function(){for(var t,n=arguments.length,r=new Array(n),i=0;i{"use strict";var r;n.d(e,{A:()=>l});var i=n(5544),o=n(89379),a=n(96540);var s=0;var u=(0,o.A)({},r||(r=n.t(a,2))).useId;const l=u?function(t){var e=u();return t||e}:function(t){var e=a.useState("ssr-id"),n=(0,i.A)(e,2),r=n[0],o=n[1];return a.useEffect((function(){var t=s;s+=1,o("rc_unique_".concat(t))}),[]),t||r}},30981:(t,e,n)=>{"use strict";n.d(e,{A:()=>s,o:()=>a});var r=n(96540),i=(0,n(20998).A)()?r.useLayoutEffect:r.useEffect,o=function(t,e){var n=r.useRef(!0);i((function(){return t(n.current)}),e),i((function(){return n.current=!1,function(){n.current=!0}}),[])},a=function(t,e){o((function(e){if(!e)return t()}),e)};const s=o},28104:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(96540);function i(t,e,n){var i=r.useRef({});return"value"in i.current&&!n(i.current.condition,e)||(i.current.value=t(),i.current.condition=e),i.current.value}},12533:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5544),i=n(26956),o=n(30981),a=n(1233);function s(t){return void 0!==t}function u(t,e){var n=e||{},u=n.defaultValue,l=n.value,c=n.onChange,h=n.postState,d=(0,a.A)((function(){return s(l)?l:s(u)?"function"==typeof u?u():u:"function"==typeof t?t():t})),f=(0,r.A)(d,2),p=f[0],m=f[1],g=void 0!==l?l:p,v=h?h(g):g,y=(0,i.A)(c),b=(0,a.A)([g]),x=(0,r.A)(b,2),w=x[0],_=x[1];return(0,o.o)((function(){var t=w[0];p!==t&&y(p,t)}),[w]),(0,o.o)((function(){s(l)||m(l)}),[l]),[v,(0,i.A)((function(t,e){m(t,e),_([g],e)}))]}},1233:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(5544),i=n(96540);function o(t){var e=i.useRef(!1),n=i.useState(t),o=(0,r.A)(n,2),a=o[0],s=o[1];return i.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),[a,function(t,n){n&&e.current||s(t)}]}},81470:(t,e,n)=>{"use strict";n.d(e,{_q:()=>r.A});var r=n(26956);n(12533),n(8719),n(20488),n(68210)},43210:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(82284),i=n(68210);const o=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=new Set;return function t(e,a){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,u=o.has(e);if((0,i.Ay)(!u,"Warning: There may be circular references"),u)return!1;if(e===a)return!0;if(n&&s>1)return!1;o.add(e);var l=s+1;if(Array.isArray(e)){if(!Array.isArray(a)||e.length!==a.length)return!1;for(var c=0;c{"use strict";n.d(e,{A:()=>r});const r=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==t?void 0:t.substr(0,4))}},19853:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(89379);function i(t,e){var n=(0,r.A)({},t);return Array.isArray(e)&&e.forEach((function(t){delete n[t]})),n}},72065:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(89379),i="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/),o="aria-",a="data-";function s(t,e){return 0===t.indexOf(e)}function u(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:(0,r.A)({},n);var u={};return Object.keys(t).forEach((function(n){(e.aria&&("role"===n||s(n,o))||e.data&&s(n,a)||e.attr&&i.includes(n))&&(u[n]=t[n])})),u}},25371:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=function(t){return+setTimeout(t,16)},i=function(t){return clearTimeout(t)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(r=function(t){return window.requestAnimationFrame(t)},i=function(t){return window.cancelAnimationFrame(t)});var o=0,a=new Map;function s(t){a.delete(t)}var u=function(t){var e=o+=1;return function n(i){if(0===i)s(e),t();else{var o=r((function(){n(i-1)}));a.set(e,o)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),e};u.cancel=function(t){var e=a.get(t);return s(t),i(e)};const l=u},8719:(t,e,n)=>{"use strict";n.d(e,{K4:()=>s,Xf:()=>a,f3:()=>l,xK:()=>u});var r=n(82284),i=(n(96540),n(66351)),o=n(28104);function a(t,e){"function"==typeof t?t(e):"object"===(0,r.A)(t)&&t&&"current"in t&&(t.current=e)}function s(){for(var t=arguments.length,e=new Array(t),n=0;n{"use strict";function r(t,e){for(var n=t,r=0;rr})},20488:(t,e,n)=>{"use strict";n.d(e,{A:()=>l,h:()=>d});var r=n(82284),i=n(89379),o=n(60436),a=n(87695),s=n(16300);function u(t,e,n,r){if(!e.length)return n;var s,l=(0,a.A)(e),c=l[0],h=l.slice(1);return s=t||"number"!=typeof c?Array.isArray(t)?(0,o.A)(t):(0,i.A)({},t):[],r&&void 0===n&&1===h.length?delete s[c][h[0]]:s[c]=u(s[c],h,n,r),s}function l(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.length&&r&&void 0===n&&!(0,s.A)(t,e.slice(0,-1))?t:u(t,e,n,r)}function c(t){return Array.isArray(t)?[]:{}}var h="undefined"==typeof Reflect?Object.keys:Reflect.ownKeys;function d(){for(var t=arguments.length,e=new Array(t),n=0;n{"use strict";n.d(e,{$e:()=>o,Ay:()=>l});var r={},i=[];function o(t,e){}function a(t,e){}function s(t,e,n){e||r[n]||(t(!1,n),r[n]=!0)}function u(t,e){s(o,t,e)}u.preMessage=function(t){i.push(t)},u.resetWarned=function(){r={}},u.noteOnce=function(t,e){s(a,t,e)};const l=u},57787:(t,e)=>{"use strict";var n,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"); +/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */function v(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case o:case s:case a:case d:case f:return t;default:switch(t=t&&t.$$typeof){case c:case l:case h:case m:case p:case u:return t;default:return e}}case i:return e}}}n=Symbol.for("react.module.reference"),e.ForwardRef=h,e.isFragment=function(t){return v(t)===o},e.isMemo=function(t){return v(t)===p}},66351:(t,e,n)=>{"use strict";t.exports=n(57787)},22551:(t,e,n)=>{"use strict"; +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r=n(96540),i=n(69982);function o(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n