/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var U2t=Object.create;var fw=Object.defineProperty,j2t=Object.defineProperties,W2t=Object.getOwnPropertyDescriptor,V2t=Object.getOwnPropertyDescriptors,H2t=Object.getOwnPropertyNames,k9=Object.getOwnPropertySymbols,Y2t=Object.getPrototypeOf,R9=Object.prototype.hasOwnProperty,X2t=Object.prototype.propertyIsEnumerable;var N9=(r,e,t)=>e in r?fw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wl=(r,e)=>{for(var t in e||(e={}))R9.call(e,t)&&N9(r,t,e[t]);if(k9)for(var t of k9(e))X2t.call(e,t)&&N9(r,t,e[t]);return r},F9=(r,e)=>j2t(r,V2t(e)),B9=r=>fw(r,"__esModule",{value:!0});var ft=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Dn=(r,e)=>{B9(r);for(var t in e)fw(r,t,{get:e[t],enumerable:!0})},q2t=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of H2t(e))!R9.call(r,n)&&n!=="default"&&fw(r,n,{get:()=>e[n],enumerable:!(t=W2t(e,n))||t.enumerable});return r},z=r=>q2t(B9(fw(r!=null?U2t(Y2t(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var xa=(r,e,t)=>new Promise((n,i)=>{var a=l=>{try{s(t.next(l))}catch(u){i(u)}},o=l=>{try{s(t.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);s((t=t.apply(r,e)).next())});var Sw=ft((dge,e2)=>{var Nq,Fq,Bq,Gq,zq,Uq,jq,Wq,Vq,JI,k3,Hq,Yq,Xq,pb,qq,Kq,Zq,$q,Qq,Jq,tK,eK,t2;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof e2=="object"&&typeof e2.exports=="object"?r(t(e,t(e2.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=i?i(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])};Nq=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function a(){this.constructor=n}n.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)},Fq=Object.assign||function(n){for(var i,a=1,o=arguments.length;a=0;f--)(u=n[f])&&(l=(s<3?u(l):s>3?u(i,a,l):u(i,a))||l);return s>3&&l&&Object.defineProperty(i,a,l),l},zq=function(n,i){return function(a,o){i(a,o,n)}},Uq=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},jq=function(n,i,a,o){function s(l){return l instanceof a?l:new a(function(u){u(l)})}return new(a||(a=Promise))(function(l,u){function f(d){try{h(o.next(d))}catch(p){u(p)}}function c(d){try{h(o.throw(d))}catch(p){u(p)}}function h(d){d.done?l(d.value):s(d.value).then(f,c)}h((o=o.apply(n,i||[])).next())})},Wq=function(n,i){var a={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},o,s,l,u;return u={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(h){return function(d){return c([h,d])}}function c(h){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(l=h[0]&2?s.return:h[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,h[1])).done)return l;switch(s=0,l&&(h=[h[0]&2,l.value]),h[0]){case 0:case 1:l=h;break;case 4:return a.label++,{value:h[1],done:!1};case 5:a.label++,s=h[1],h=[0];continue;case 7:h=a.ops.pop(),a.trys.pop();continue;default:if(l=a.trys,!(l=l.length>0&&l[l.length-1])&&(h[0]===6||h[0]===2)){a=0;continue}if(h[0]===3&&(!l||h[1]>l[0]&&h[1]=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},k3=function(n,i){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var o=a.call(n),s,l=[],u;try{for(;(i===void 0||i-- >0)&&!(s=o.next()).done;)l.push(s.value)}catch(f){u={error:f}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(u)throw u.error}}return l},Hq=function(){for(var n=[],i=0;i1||f(v,m)})})}function f(v,m){try{c(o[v](m))}catch(g){p(l[0][3],g)}}function c(v){v.value instanceof pb?Promise.resolve(v.value.v).then(h,d):p(l[0][2],v)}function h(v){f("next",v)}function d(v){f("throw",v)}function p(v,m){v(m),l.shift(),l.length&&f(l[0][0],l[0][1])}},Kq=function(n){var i,a;return i={},o("next"),o("throw",function(s){throw s}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(s,l){i[s]=n[s]?function(u){return(a=!a)?{value:pb(n[s](u)),done:s==="return"}:l?l(u):u}:l}},Zq=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],a;return i?i.call(n):(n=typeof JI=="function"?JI(n):n[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(l){a[l]=n[l]&&function(u){return new Promise(function(f,c){u=n[l](u),s(f,c,u.done,u.value)})}}function s(l,u,f,c){Promise.resolve(c).then(function(h){l({value:h,done:f})},u)}},$q=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};Qq=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&t2(i,n,a);return t(i,n),i},Jq=function(n){return n&&n.__esModule?n:{default:n}},tK=function(n,i,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!o:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(n):o?o.value:i.get(n)},eK=function(n,i,a,o,s){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!s:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?s.call(n,a):s?s.value=a:i.set(n,a),a},r("__extends",Nq),r("__assign",Fq),r("__rest",Bq),r("__decorate",Gq),r("__param",zq),r("__metadata",Uq),r("__awaiter",jq),r("__generator",Wq),r("__exportStar",Vq),r("__createBinding",t2),r("__values",JI),r("__read",k3),r("__spread",Hq),r("__spreadArrays",Yq),r("__spreadArray",Xq),r("__await",pb),r("__asyncGenerator",qq),r("__asyncDelegator",Kq),r("__asyncValues",Zq),r("__makeTemplateObject",$q),r("__importStar",Qq),r("__importDefault",Jq),r("__classPrivateFieldGet",tK),r("__classPrivateFieldSet",eK)})});var Al=ft(R3=>{"use strict";Object.defineProperty(R3,"__esModule",{value:!0});var rPt=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)};R3.default=rPt});var r2=ft(N3=>{"use strict";Object.defineProperty(N3,"__esModule",{value:!0});var nPt=Al(),iPt=function(r,e){return nPt.default(r)?r.indexOf(e)>-1:!1};N3.default=iPt});var B3=ft(F3=>{"use strict";Object.defineProperty(F3,"__esModule",{value:!0});var aPt=Al(),oPt=function(r,e){if(!aPt.default(r))return r;for(var t=[],n=0;n{"use strict";Object.defineProperty(G3,"__esModule",{value:!0});var sPt=B3(),lPt=r2(),uPt=function(r,e){return e===void 0&&(e=[]),sPt.default(r,function(t){return!lPt.default(e,t)})};G3.default=uPt});var Hu=ft(z3=>{"use strict";Object.defineProperty(z3,"__esModule",{value:!0});var fPt={}.toString,cPt=function(r,e){return fPt.call(r)==="[object "+e+"]"};z3.default=cPt});var Ml=ft(U3=>{"use strict";Object.defineProperty(U3,"__esModule",{value:!0});var hPt=Hu();U3.default=function(r){return hPt.default(r,"Function")}});var tp=ft(j3=>{"use strict";Object.defineProperty(j3,"__esModule",{value:!0});var dPt=function(r){return r==null};j3.default=dPt});var Ba=ft(W3=>{"use strict";Object.defineProperty(W3,"__esModule",{value:!0});var pPt=Hu();W3.default=function(r){return Array.isArray?Array.isArray(r):pPt.default(r,"Array")}});var Cw=ft(V3=>{"use strict";Object.defineProperty(V3,"__esModule",{value:!0});V3.default=function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"}});var Oy=ft(H3=>{"use strict";Object.defineProperty(H3,"__esModule",{value:!0});var vPt=Ba(),mPt=Cw();function gPt(r,e){if(!!r){var t;if(vPt.default(r))for(var n=0,i=r.length;n{"use strict";Object.defineProperty(Y3,"__esModule",{value:!0});var yPt=Oy(),xPt=Ml(),bPt=Object.keys?function(r){return Object.keys(r)}:function(r){var e=[];return yPt.default(r,function(t,n){xPt.default(r)&&n==="prototype"||e.push(n)}),e};Y3.default=bPt});var K3=ft(q3=>{"use strict";Object.defineProperty(q3,"__esModule",{value:!0});var _Pt=tp(),SPt=X3();function CPt(r,e){var t=SPt.default(e),n=t.length;if(_Pt.default(r))return!n;for(var i=0;i{"use strict";Object.defineProperty(Z3,"__esModule",{value:!0});var wPt=function(r){return typeof r=="object"&&r!==null};Z3.default=wPt});var vb=ft($3=>{"use strict";Object.defineProperty($3,"__esModule",{value:!0});var EPt=n2(),APt=Hu(),MPt=function(r){if(!EPt.default(r)||!APt.default(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e};$3.default=MPt});var iK=ft(Q3=>{"use strict";Object.defineProperty(Q3,"__esModule",{value:!0});var TPt=Ml(),IPt=K3(),LPt=Ba(),OPt=vb();function DPt(r,e){if(!LPt.default(r))return null;var t;if(TPt.default(e)&&(t=e),OPt.default(e)&&(t=function(i){return IPt.default(i,e)}),t){for(var n=0;n{"use strict";Object.defineProperty(J3,"__esModule",{value:!0});function PPt(r,e,t){t===void 0&&(t=0);for(var n=t;n{"use strict";Object.defineProperty(tG,"__esModule",{value:!0});var kPt=tp(),RPt=Ba(),NPt=function(r,e){for(var t=null,n=0;n{"use strict";Object.defineProperty(eG,"__esModule",{value:!0});var FPt=Ba(),BPt=function(r){if(!FPt.default(r))return[];for(var e=[],t=0;t{"use strict";Object.defineProperty(rG,"__esModule",{value:!0});var GPt=Ba(),lK=function(r,e){if(e===void 0&&(e=[]),!GPt.default(r))e.push(r);else for(var t=0;t{"use strict";Object.defineProperty(nG,"__esModule",{value:!0});var zPt=Ba();nG.default=function(r){if(!!zPt.default(r))return r.reduce(function(e,t){return Math.max(e,t)},r[0])}});var oG=ft(aG=>{"use strict";Object.defineProperty(aG,"__esModule",{value:!0});var UPt=Ba();aG.default=function(r){if(!!UPt.default(r))return r.reduce(function(e,t){return Math.min(e,t)},r[0])}});var fK=ft(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});var jPt=Ba(),WPt=iG(),VPt=oG(),HPt=function(r){var e=r.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(jPt.default(r[0])){for(var t=[],n=0;n{"use strict";Object.defineProperty(lG,"__esModule",{value:!0});var cK=Array.prototype,YPt=cK.splice,XPt=cK.indexOf,qPt=function(r){for(var e=[],t=1;t-1;)YPt.call(r,a,1);return r};lG.default=qPt});var fG=ft(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});var KPt=Al(),ZPt=Array.prototype.splice,$Pt=function(e,t){if(!KPt.default(e))return[];for(var n=e?t.length:0,i=n-1;n--;){var a=void 0,o=t[n];(n===i||o!==a)&&(a=o,ZPt.call(e,o,1))}return e};uG.default=$Pt});var hG=ft(cG=>{"use strict";Object.defineProperty(cG,"__esModule",{value:!0});var QPt=Oy(),JPt=Ba(),tkt=vb(),ekt=function(r,e,t){if(!JPt.default(r)&&!tkt.default(r))return r;var n=t;return QPt.default(r,function(i,a){n=e(n,i,a)}),n};cG.default=ekt});var dK=ft(dG=>{"use strict";Object.defineProperty(dG,"__esModule",{value:!0});var rkt=Al(),nkt=fG(),ikt=function(r,e){var t=[];if(!rkt.default(r))return t;for(var n=-1,i=[],a=r.length;++n{"use strict";Object.defineProperty(pG,"__esModule",{value:!0});var akt=Hu();pG.default=function(r){return akt.default(r,"String")}});var pK=ft(vG=>{"use strict";Object.defineProperty(vG,"__esModule",{value:!0});var okt=Ba(),skt=Jc(),lkt=Ml();function ukt(r,e){var t;if(lkt.default(e))t=function(i,a){return e(i)-e(a)};else{var n=[];skt.default(e)?n.push(e):okt.default(e)&&(n=e),t=function(i,a){for(var o=0;oa[s])return 1;if(i[s]{"use strict";Object.defineProperty(mG,"__esModule",{value:!0});function fkt(r,e){e===void 0&&(e=new Map);var t=[];if(Array.isArray(r))for(var n=0,i=r.length;n{"use strict";Object.defineProperty(yG,"__esModule",{value:!0});var ckt=gG(),hkt=function(){for(var r=[],e=0;e{"use strict";Object.defineProperty(xG,"__esModule",{value:!0});var dkt=Ba(),pkt=tp();xG.default=function(r,e){for(var t=[],n={},i=0;i{"use strict";Object.defineProperty(bG,"__esModule",{value:!0});var vkt=Al();function mkt(r){if(vkt.default(r))return r[0]}bG.default=mkt});var yK=ft(_G=>{"use strict";Object.defineProperty(_G,"__esModule",{value:!0});var gkt=Al();function ykt(r){if(gkt.default(r)){var e=r;return e[e.length-1]}}_G.default=ykt});var xK=ft(SG=>{"use strict";Object.defineProperty(SG,"__esModule",{value:!0});var xkt=Ba(),bkt=Jc();function _kt(r,e){return xkt.default(r)||bkt.default(r)?r[0]===e:!1}SG.default=_kt});var bK=ft(CG=>{"use strict";Object.defineProperty(CG,"__esModule",{value:!0});var Skt=Ba(),Ckt=Jc();function wkt(r,e){return Skt.default(r)||Ckt.default(r)?r[r.length-1]===e:!1}CG.default=wkt});var _K=ft(wG=>{"use strict";Object.defineProperty(wG,"__esModule",{value:!0});var Ekt=function(r,e){for(var t=0;t{"use strict";Object.defineProperty(EG,"__esModule",{value:!0});var Akt=function(r,e){for(var t=0;t{"use strict";Object.defineProperty(AG,"__esModule",{value:!0});var Mkt=Ba(),Tkt=Ml(),Ikt=Object.prototype.hasOwnProperty;function Lkt(r,e){if(!e||!Mkt.default(r))return{};for(var t={},n=Tkt.default(e)?e:function(s){return s[e]},i,a=0;a{"use strict";Object.defineProperty(TG,"__esModule",{value:!0});var Okt=Ba(),Dkt=Ml(),Pkt=MG();function kkt(r,e){if(!e)return{0:r};if(!Dkt.default(e)){var t=Okt.default(e)?e:e.replace(/\s+/g,"").split("*");e=function(n){for(var i="_",a=0,o=t.length;a{"use strict";Object.defineProperty(LG,"__esModule",{value:!0});var Rkt=IG();LG.default=function(r,e){if(!e)return[r];var t=Rkt.default(r,e),n=[];for(var i in t)n.push(t[i]);return n}});var wK=ft(OG=>{"use strict";Object.defineProperty(OG,"__esModule",{value:!0});function Nkt(r,e){return r["_wrap_"+e]}OG.default=Nkt});var EK=ft(DG=>{"use strict";Object.defineProperty(DG,"__esModule",{value:!0});function Fkt(r,e){if(r["_wrap_"+e])return r["_wrap_"+e];var t=function(n){r[e](n)};return r["_wrap_"+e]=t,t}DG.default=Fkt});var MK=ft(PG=>{"use strict";Object.defineProperty(PG,"__esModule",{value:!0});var AK={};function Bkt(r){var e=AK[r];if(!e){for(var t=r.toString(16),n=t.length;n<6;n++)t="0"+t;e="#"+t,AK[r]=e}return e}PG.default=Bkt});var TK=ft(kG=>{"use strict";Object.defineProperty(kG,"__esModule",{value:!0});var Gkt=Ba();function zkt(r){var e=0,t=0,n=0,i=0;return Gkt.default(r)?r.length===1?e=t=n=i=r[0]:r.length===2?(e=n=r[0],t=i=r[1]):r.length===3?(e=r[0],t=i=r[1],n=r[2]):(e=r[0],t=r[1],n=r[2],i=r[3]):e=t=n=i=r,{r1:e,r2:t,r3:n,r4:i}}kG.default=zkt});var IK=ft(RG=>{"use strict";Object.defineProperty(RG,"__esModule",{value:!0});var Ukt=function(r,e,t){return rt?t:r};RG.default=Ukt});var LK=ft(NG=>{"use strict";Object.defineProperty(NG,"__esModule",{value:!0});var jkt=function(r,e){var t=e.toString(),n=t.indexOf(".");if(n===-1)return Math.round(r);var i=t.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))};NG.default=jkt});var th=ft(FG=>{"use strict";Object.defineProperty(FG,"__esModule",{value:!0});var Wkt=Hu(),Vkt=function(r){return Wkt.default(r,"Number")};FG.default=Vkt});var OK=ft(BG=>{"use strict";Object.defineProperty(BG,"__esModule",{value:!0});var Hkt=th(),Ykt=function(r){return Hkt.default(r)&&r%1!=0};BG.default=Ykt});var DK=ft(GG=>{"use strict";Object.defineProperty(GG,"__esModule",{value:!0});var Xkt=th(),qkt=function(r){return Xkt.default(r)&&r%2==0};GG.default=qkt});var PK=ft(zG=>{"use strict";Object.defineProperty(zG,"__esModule",{value:!0});var Kkt=th(),Zkt=Number.isInteger?Number.isInteger:function(r){return Kkt.default(r)&&r%1==0};zG.default=Zkt});var kK=ft(UG=>{"use strict";Object.defineProperty(UG,"__esModule",{value:!0});var $kt=th(),Qkt=function(r){return $kt.default(r)&&r<0};UG.default=Qkt});var RK=ft(jG=>{"use strict";Object.defineProperty(jG,"__esModule",{value:!0});var Jkt=1e-5;function tRt(r,e,t){return t===void 0&&(t=Jkt),Math.abs(r-e){"use strict";Object.defineProperty(WG,"__esModule",{value:!0});var eRt=th(),rRt=function(r){return eRt.default(r)&&r%2!=0};WG.default=rRt});var FK=ft(VG=>{"use strict";Object.defineProperty(VG,"__esModule",{value:!0});var nRt=th(),iRt=function(r){return nRt.default(r)&&r>0};VG.default=iRt});var BK=ft(HG=>{"use strict";Object.defineProperty(HG,"__esModule",{value:!0});var aRt=Ba(),oRt=Ml();HG.default=function(r,e){if(!!aRt.default(r)){for(var t,n=-1/0,i=0;in&&(t=a,n=o)}return t}}});var GK=ft(YG=>{"use strict";Object.defineProperty(YG,"__esModule",{value:!0});var sRt=Ba(),lRt=Ml();YG.default=function(r,e){if(!!sRt.default(r)){for(var t,n=1/0,i=0;i{"use strict";Object.defineProperty(XG,"__esModule",{value:!0});var uRt=function(r,e){return(r%e+e)%e};XG.default=uRt});var UK=ft(qG=>{"use strict";Object.defineProperty(qG,"__esModule",{value:!0});var fRt=180/Math.PI,cRt=function(r){return fRt*r};qG.default=cRt});var jK=ft(KG=>{"use strict";Object.defineProperty(KG,"__esModule",{value:!0});KG.default=parseInt});var WK=ft(ZG=>{"use strict";Object.defineProperty(ZG,"__esModule",{value:!0});var hRt=Math.PI/180,dRt=function(r){return hRt*r};ZG.default=dRt});var VK=ft($G=>{"use strict";Object.defineProperty($G,"__esModule",{value:!0});var pRt=Oy();$G.default=pRt.default});var JG=ft(QG=>{"use strict";Object.defineProperty(QG,"__esModule",{value:!0});QG.default=function(r,e){return r.hasOwnProperty(e)}});var HK=ft(t5=>{"use strict";Object.defineProperty(t5,"__esModule",{value:!0});var vRt=JG();t5.default=vRt.default});var i2=ft(e5=>{"use strict";Object.defineProperty(e5,"__esModule",{value:!0});var mRt=Oy(),gRt=Ml(),yRt=Object.values?function(r){return Object.values(r)}:function(r){var e=[];return mRt.default(r,function(t,n){gRt.default(r)&&n==="prototype"||e.push(t)}),e};e5.default=yRt});var YK=ft(r5=>{"use strict";Object.defineProperty(r5,"__esModule",{value:!0});var xRt=r2(),bRt=i2();r5.default=function(r,e){return xRt.default(bRt.default(r),e)}});var Dy=ft(n5=>{"use strict";Object.defineProperty(n5,"__esModule",{value:!0});var _Rt=tp();n5.default=function(r){return _Rt.default(r)?"":r.toString()}});var XK=ft(i5=>{"use strict";Object.defineProperty(i5,"__esModule",{value:!0});var SRt=Dy(),CRt=function(r){return SRt.default(r).toLowerCase()};i5.default=CRt});var qK=ft(a5=>{"use strict";Object.defineProperty(a5,"__esModule",{value:!0});var wRt=Dy(),ERt=function(r){var e=wRt.default(r);return e.charAt(0).toLowerCase()+e.substring(1)};a5.default=ERt});var KK=ft(o5=>{"use strict";Object.defineProperty(o5,"__esModule",{value:!0});function ARt(r,e){return!r||!e?r:r.replace(/\\?\{([^{}]+)\}/g,function(t,n){return t.charAt(0)==="\\"?t.slice(1):e[n]===void 0?"":e[n]})}o5.default=ARt});var ZK=ft(s5=>{"use strict";Object.defineProperty(s5,"__esModule",{value:!0});var MRt=Dy(),TRt=function(r){return MRt.default(r).toUpperCase()};s5.default=TRt});var $K=ft(l5=>{"use strict";Object.defineProperty(l5,"__esModule",{value:!0});var IRt=Dy(),LRt=function(r){var e=IRt.default(r);return e.charAt(0).toUpperCase()+e.substring(1)};l5.default=LRt});var f5=ft(u5=>{"use strict";Object.defineProperty(u5,"__esModule",{value:!0});var ORt={}.toString,DRt=function(r){return ORt.call(r).replace(/^\[object /,"").replace(/]$/,"")};u5.default=DRt});var QK=ft(c5=>{"use strict";Object.defineProperty(c5,"__esModule",{value:!0});var PRt=Hu(),kRt=function(r){return PRt.default(r,"Arguments")};c5.default=kRt});var JK=ft(h5=>{"use strict";Object.defineProperty(h5,"__esModule",{value:!0});var RRt=Hu(),NRt=function(r){return RRt.default(r,"Boolean")};h5.default=NRt});var tZ=ft(d5=>{"use strict";Object.defineProperty(d5,"__esModule",{value:!0});var FRt=Hu(),BRt=function(r){return FRt.default(r,"Date")};d5.default=BRt});var eZ=ft(p5=>{"use strict";Object.defineProperty(p5,"__esModule",{value:!0});var GRt=Hu(),zRt=function(r){return GRt.default(r,"Error")};p5.default=zRt});var rZ=ft(v5=>{"use strict";Object.defineProperty(v5,"__esModule",{value:!0});var URt=th();function jRt(r){return URt.default(r)&&isFinite(r)}v5.default=jRt});var nZ=ft(m5=>{"use strict";Object.defineProperty(m5,"__esModule",{value:!0});var WRt=function(r){return r===null};m5.default=WRt});var y5=ft(g5=>{"use strict";Object.defineProperty(g5,"__esModule",{value:!0});var VRt=Object.prototype,HRt=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||VRt;return r===t};g5.default=HRt});var iZ=ft(x5=>{"use strict";Object.defineProperty(x5,"__esModule",{value:!0});var YRt=Hu(),XRt=function(r){return YRt.default(r,"RegExp")};x5.default=XRt});var aZ=ft(b5=>{"use strict";Object.defineProperty(b5,"__esModule",{value:!0});var qRt=function(r){return r===void 0};b5.default=qRt});var oZ=ft(_5=>{"use strict";Object.defineProperty(_5,"__esModule",{value:!0});var KRt=function(r){return r instanceof Element||r instanceof HTMLDocument};_5.default=KRt});var sZ=ft(S5=>{"use strict";Object.defineProperty(S5,"__esModule",{value:!0});function ZRt(r){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(r)}S5.default=ZRt});var lZ=ft(C5=>{"use strict";Object.defineProperty(C5,"__esModule",{value:!0});function $Rt(r){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(r)}C5.default=$Rt});var a2=ft(E5=>{"use strict";Object.defineProperty(E5,"__esModule",{value:!0});function w5(r,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(r[t]=e[t])}function QRt(r,e,t,n){return e&&w5(r,e),t&&w5(r,t),n&&w5(r,n),r}E5.default=QRt});var uZ=ft(A5=>{"use strict";Object.defineProperty(A5,"__esModule",{value:!0});var JRt=a2(),tNt=Ml(),eNt=function(){for(var r=[],e=0;e{"use strict";Object.defineProperty(T5,"__esModule",{value:!0});var rNt=Ba(),M5=function(r){if(typeof r!="object"||r===null)return r;var e;if(rNt.default(r)){e=[];for(var t=0,n=r.length;t{"use strict";Object.defineProperty(I5,"__esModule",{value:!0});function nNt(r,e,t){var n;return function(){var i=this,a=arguments,o=function(){n=null,t||r.apply(i,a)},s=t&&!n;clearTimeout(n),n=setTimeout(o,e),s&&r.apply(i,a)}}I5.default=nNt});var O5=ft(L5=>{"use strict";Object.defineProperty(L5,"__esModule",{value:!0});var iNt=Ml();L5.default=function(r,e){if(!iNt.default(r))throw new TypeError("Expected a function");var t=function(){for(var n=[],i=0;i{"use strict";Object.defineProperty(D5,"__esModule",{value:!0});var aNt=Ba(),hZ=vb(),oNt=5;function dZ(r,e,t,n){t=t||0,n=n||oNt;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];a!==null&&hZ.default(a)?(hZ.default(r[i])||(r[i]={}),t{"use strict";Object.defineProperty(k5,"__esModule",{value:!0});var P5=a2(),lNt=Ml(),uNt=function(r,e,t,n){lNt.default(e)||(t=e,e=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function l(){}l.prototype=o;var u=new l;return u.constructor=s,u},a=i(e.prototype,r);return r.prototype=P5.default(a,r.prototype),r.superclass=i(e.prototype,e),P5.default(a,t),P5.default(r,n),r};k5.default=uNt});var mZ=ft(R5=>{"use strict";Object.defineProperty(R5,"__esModule",{value:!0});var fNt=Al(),cNt=function(r,e){if(!fNt.default(r))return-1;var t=Array.prototype.indexOf;if(t)return t.call(r,e);for(var n=-1,i=0;i{"use strict";Object.defineProperty(N5,"__esModule",{value:!0});var hNt=tp(),dNt=Al(),pNt=f5(),vNt=y5(),mNt=Object.prototype.hasOwnProperty;function gNt(r){if(hNt.default(r))return!0;if(dNt.default(r))return!r.length;var e=pNt.default(r);if(e==="Map"||e==="Set")return!r.size;if(vNt.default(r))return!Object.keys(r).length;for(var t in r)if(mNt.call(r,t))return!1;return!0}N5.default=gNt});var G5=ft(B5=>{"use strict";Object.defineProperty(B5,"__esModule",{value:!0});var yZ=n2(),xZ=Al(),bZ=Jc(),F5=function(r,e){if(r===e)return!0;if(!r||!e||bZ.default(r)||bZ.default(e))return!1;if(xZ.default(r)||xZ.default(e)){if(r.length!==e.length)return!1;for(var t=!0,n=0;n{"use strict";Object.defineProperty(z5,"__esModule",{value:!0});var yNt=Ml(),xNt=G5();z5.default=function(r,e,t){return yNt.default(t)?!!t(r,e):xNt.default(r,e)}});var SZ=ft(U5=>{"use strict";Object.defineProperty(U5,"__esModule",{value:!0});var bNt=Al(),_Nt=function(r,e){if(!bNt.default(r))return r;for(var t=[],n=0;n{"use strict";Object.defineProperty(j5,"__esModule",{value:!0});var SNt=tp(),CNt=Cw(),wNt=function(r){return r};j5.default=function(r,e){e===void 0&&(e=wNt);var t={};return CNt.default(r)&&!SNt.default(r)&&Object.keys(r).forEach(function(n){t[n]=e(r[n],n)}),t}});var wZ=ft(W5=>{"use strict";Object.defineProperty(W5,"__esModule",{value:!0});var ENt=Jc();W5.default=function(r,e,t){for(var n=0,i=ENt.default(e)?e.split("."):e;r&&n{"use strict";Object.defineProperty(V5,"__esModule",{value:!0});var ANt=Cw(),MNt=Jc(),TNt=th();V5.default=function(r,e,t){var n=r,i=MNt.default(e)?e.split("."):e;return i.forEach(function(a,o){o{"use strict";Object.defineProperty(H5,"__esModule",{value:!0});var INt=Oy(),LNt=vb(),ONt=Object.prototype.hasOwnProperty;H5.default=function(r,e){if(r===null||!LNt.default(r))return{};var t={};return INt.default(e,function(n){ONt.call(r,n)&&(t[n]=r[n])}),t}});var MZ=ft(Y5=>{"use strict";Object.defineProperty(Y5,"__esModule",{value:!0});var DNt=hG();Y5.default=function(r,e){return DNt.default(r,function(t,n,i){return e.includes(i)||(t[i]=n),t},{})}});var TZ=ft(X5=>{"use strict";Object.defineProperty(X5,"__esModule",{value:!0});X5.default=function(r,e,t){var n,i,a,o,s=0;t||(t={});var l=function(){s=t.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},u=function(){var f=Date.now();!s&&t.leading===!1&&(s=f);var c=e-(f-s);return i=this,a=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=null),s=f,o=r.apply(i,a),n||(i=a=null)):!n&&t.trailing!==!1&&(n=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(n),s=0,n=i=a=null},u}});var IZ=ft(q5=>{"use strict";Object.defineProperty(q5,"__esModule",{value:!0});var PNt=Al();q5.default=function(r){return PNt.default(r)?Array.prototype.slice.call(r):[]}});var LZ=ft(K5=>{"use strict";Object.defineProperty(K5,"__esModule",{value:!0});var o2={};K5.default=function(r){return r=r||"g",o2[r]?o2[r]+=1:o2[r]=1,r+o2[r]}});var OZ=ft(Z5=>{"use strict";Object.defineProperty(Z5,"__esModule",{value:!0});Z5.default=function(){}});var DZ=ft($5=>{"use strict";Object.defineProperty($5,"__esModule",{value:!0});$5.default=function(r){return r}});var PZ=ft(Q5=>{"use strict";Object.defineProperty(Q5,"__esModule",{value:!0});var kNt=tp(),RNt=Al();function NNt(r){return kNt.default(r)?0:RNt.default(r)?r.length:Object.keys(r).length}Q5.default=NNt});var t4=ft(J5=>{"use strict";Object.defineProperty(J5,"__esModule",{value:!0});var FNt=Sw(),BNt=i2(),GNt=O5(),zNt=Jc(),s2;J5.default=GNt.default(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return s2||(s2=document.createElement("canvas").getContext("2d")),s2.font=[a,o,i,t+"px",n].join(" "),s2.measureText(zNt.default(r)?r:"").width},function(r,e){return e===void 0&&(e={}),FNt.__spreadArrays([r],BNt.default(e)).join("")})});var kZ=ft(e4=>{"use strict";Object.defineProperty(e4,"__esModule",{value:!0});var UNt=Jc(),jNt=Dy(),l2=t4();e4.default=function(r,e,t,n){n===void 0&&(n="...");var i=16,a=l2.default(n,t),o=UNt.default(r)?r:jNt.default(r),s=e,l=[],u,f;if(l2.default(r,t)<=e)return r;for(;u=o.substr(0,i),f=l2.default(u,t),!(f+a>s&&f>s);)if(l.push(u),s-=f,o=o.substr(i),!o)return l.join("");for(;u=o.substr(0,1),f=l2.default(u,t),!(f+a>s);)if(l.push(u),s-=f,o=o.substr(1),!o)return l.join("");return""+l.join("")+n}});var RZ=ft(r4=>{"use strict";Object.defineProperty(r4,"__esModule",{value:!0});var WNt=function(){function r(){this.map={}}return r.prototype.has=function(e){return this.map[e]!==void 0},r.prototype.get=function(e,t){var n=this.map[e];return n===void 0?t:n},r.prototype.set=function(e,t){this.map[e]=t},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(e){delete this.map[e]},r.prototype.size=function(){return Object.keys(this.map).length},r}();r4.default=WNt});var q=ft(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});var NZ=r2();Object.defineProperty(Ee,"contains",{enumerable:!0,get:function(){return NZ.default}});Object.defineProperty(Ee,"includes",{enumerable:!0,get:function(){return NZ.default}});var VNt=nK();Object.defineProperty(Ee,"difference",{enumerable:!0,get:function(){return VNt.default}});var HNt=iK();Object.defineProperty(Ee,"find",{enumerable:!0,get:function(){return HNt.default}});var YNt=aK();Object.defineProperty(Ee,"findIndex",{enumerable:!0,get:function(){return YNt.default}});var XNt=oK();Object.defineProperty(Ee,"firstValue",{enumerable:!0,get:function(){return XNt.default}});var qNt=sK();Object.defineProperty(Ee,"flatten",{enumerable:!0,get:function(){return qNt.default}});var KNt=uK();Object.defineProperty(Ee,"flattenDeep",{enumerable:!0,get:function(){return KNt.default}});var ZNt=fK();Object.defineProperty(Ee,"getRange",{enumerable:!0,get:function(){return ZNt.default}});var $Nt=hK();Object.defineProperty(Ee,"pull",{enumerable:!0,get:function(){return $Nt.default}});var QNt=fG();Object.defineProperty(Ee,"pullAt",{enumerable:!0,get:function(){return QNt.default}});var JNt=hG();Object.defineProperty(Ee,"reduce",{enumerable:!0,get:function(){return JNt.default}});var tFt=dK();Object.defineProperty(Ee,"remove",{enumerable:!0,get:function(){return tFt.default}});var eFt=pK();Object.defineProperty(Ee,"sortBy",{enumerable:!0,get:function(){return eFt.default}});var rFt=vK();Object.defineProperty(Ee,"union",{enumerable:!0,get:function(){return rFt.default}});var nFt=gG();Object.defineProperty(Ee,"uniq",{enumerable:!0,get:function(){return nFt.default}});var iFt=mK();Object.defineProperty(Ee,"valuesOfKey",{enumerable:!0,get:function(){return iFt.default}});var aFt=gK();Object.defineProperty(Ee,"head",{enumerable:!0,get:function(){return aFt.default}});var oFt=yK();Object.defineProperty(Ee,"last",{enumerable:!0,get:function(){return oFt.default}});var sFt=xK();Object.defineProperty(Ee,"startsWith",{enumerable:!0,get:function(){return sFt.default}});var lFt=bK();Object.defineProperty(Ee,"endsWith",{enumerable:!0,get:function(){return lFt.default}});var uFt=B3();Object.defineProperty(Ee,"filter",{enumerable:!0,get:function(){return uFt.default}});var fFt=_K();Object.defineProperty(Ee,"every",{enumerable:!0,get:function(){return fFt.default}});var cFt=SK();Object.defineProperty(Ee,"some",{enumerable:!0,get:function(){return cFt.default}});var hFt=CK();Object.defineProperty(Ee,"group",{enumerable:!0,get:function(){return hFt.default}});var dFt=MG();Object.defineProperty(Ee,"groupBy",{enumerable:!0,get:function(){return dFt.default}});var pFt=IG();Object.defineProperty(Ee,"groupToMap",{enumerable:!0,get:function(){return pFt.default}});var vFt=wK();Object.defineProperty(Ee,"getWrapBehavior",{enumerable:!0,get:function(){return vFt.default}});var mFt=EK();Object.defineProperty(Ee,"wrapBehavior",{enumerable:!0,get:function(){return mFt.default}});var gFt=MK();Object.defineProperty(Ee,"number2color",{enumerable:!0,get:function(){return gFt.default}});var yFt=TK();Object.defineProperty(Ee,"parseRadius",{enumerable:!0,get:function(){return yFt.default}});var xFt=IK();Object.defineProperty(Ee,"clamp",{enumerable:!0,get:function(){return xFt.default}});var bFt=LK();Object.defineProperty(Ee,"fixedBase",{enumerable:!0,get:function(){return bFt.default}});var _Ft=OK();Object.defineProperty(Ee,"isDecimal",{enumerable:!0,get:function(){return _Ft.default}});var SFt=DK();Object.defineProperty(Ee,"isEven",{enumerable:!0,get:function(){return SFt.default}});var CFt=PK();Object.defineProperty(Ee,"isInteger",{enumerable:!0,get:function(){return CFt.default}});var wFt=kK();Object.defineProperty(Ee,"isNegative",{enumerable:!0,get:function(){return wFt.default}});var EFt=RK();Object.defineProperty(Ee,"isNumberEqual",{enumerable:!0,get:function(){return EFt.default}});var AFt=NK();Object.defineProperty(Ee,"isOdd",{enumerable:!0,get:function(){return AFt.default}});var MFt=FK();Object.defineProperty(Ee,"isPositive",{enumerable:!0,get:function(){return MFt.default}});var TFt=iG();Object.defineProperty(Ee,"max",{enumerable:!0,get:function(){return TFt.default}});var IFt=BK();Object.defineProperty(Ee,"maxBy",{enumerable:!0,get:function(){return IFt.default}});var LFt=oG();Object.defineProperty(Ee,"min",{enumerable:!0,get:function(){return LFt.default}});var OFt=GK();Object.defineProperty(Ee,"minBy",{enumerable:!0,get:function(){return OFt.default}});var DFt=zK();Object.defineProperty(Ee,"mod",{enumerable:!0,get:function(){return DFt.default}});var PFt=UK();Object.defineProperty(Ee,"toDegree",{enumerable:!0,get:function(){return PFt.default}});var kFt=jK();Object.defineProperty(Ee,"toInteger",{enumerable:!0,get:function(){return kFt.default}});var RFt=WK();Object.defineProperty(Ee,"toRadian",{enumerable:!0,get:function(){return RFt.default}});var NFt=VK();Object.defineProperty(Ee,"forIn",{enumerable:!0,get:function(){return NFt.default}});var FFt=JG();Object.defineProperty(Ee,"has",{enumerable:!0,get:function(){return FFt.default}});var BFt=HK();Object.defineProperty(Ee,"hasKey",{enumerable:!0,get:function(){return BFt.default}});var GFt=YK();Object.defineProperty(Ee,"hasValue",{enumerable:!0,get:function(){return GFt.default}});var zFt=X3();Object.defineProperty(Ee,"keys",{enumerable:!0,get:function(){return zFt.default}});var UFt=K3();Object.defineProperty(Ee,"isMatch",{enumerable:!0,get:function(){return UFt.default}});var jFt=i2();Object.defineProperty(Ee,"values",{enumerable:!0,get:function(){return jFt.default}});var WFt=XK();Object.defineProperty(Ee,"lowerCase",{enumerable:!0,get:function(){return WFt.default}});var VFt=qK();Object.defineProperty(Ee,"lowerFirst",{enumerable:!0,get:function(){return VFt.default}});var HFt=KK();Object.defineProperty(Ee,"substitute",{enumerable:!0,get:function(){return HFt.default}});var YFt=ZK();Object.defineProperty(Ee,"upperCase",{enumerable:!0,get:function(){return YFt.default}});var XFt=$K();Object.defineProperty(Ee,"upperFirst",{enumerable:!0,get:function(){return XFt.default}});var qFt=f5();Object.defineProperty(Ee,"getType",{enumerable:!0,get:function(){return qFt.default}});var KFt=QK();Object.defineProperty(Ee,"isArguments",{enumerable:!0,get:function(){return KFt.default}});var ZFt=Ba();Object.defineProperty(Ee,"isArray",{enumerable:!0,get:function(){return ZFt.default}});var $Ft=Al();Object.defineProperty(Ee,"isArrayLike",{enumerable:!0,get:function(){return $Ft.default}});var QFt=JK();Object.defineProperty(Ee,"isBoolean",{enumerable:!0,get:function(){return QFt.default}});var JFt=tZ();Object.defineProperty(Ee,"isDate",{enumerable:!0,get:function(){return JFt.default}});var tBt=eZ();Object.defineProperty(Ee,"isError",{enumerable:!0,get:function(){return tBt.default}});var eBt=Ml();Object.defineProperty(Ee,"isFunction",{enumerable:!0,get:function(){return eBt.default}});var rBt=rZ();Object.defineProperty(Ee,"isFinite",{enumerable:!0,get:function(){return rBt.default}});var nBt=tp();Object.defineProperty(Ee,"isNil",{enumerable:!0,get:function(){return nBt.default}});var iBt=nZ();Object.defineProperty(Ee,"isNull",{enumerable:!0,get:function(){return iBt.default}});var aBt=th();Object.defineProperty(Ee,"isNumber",{enumerable:!0,get:function(){return aBt.default}});var oBt=Cw();Object.defineProperty(Ee,"isObject",{enumerable:!0,get:function(){return oBt.default}});var sBt=n2();Object.defineProperty(Ee,"isObjectLike",{enumerable:!0,get:function(){return sBt.default}});var lBt=vb();Object.defineProperty(Ee,"isPlainObject",{enumerable:!0,get:function(){return lBt.default}});var uBt=y5();Object.defineProperty(Ee,"isPrototype",{enumerable:!0,get:function(){return uBt.default}});var fBt=iZ();Object.defineProperty(Ee,"isRegExp",{enumerable:!0,get:function(){return fBt.default}});var cBt=Jc();Object.defineProperty(Ee,"isString",{enumerable:!0,get:function(){return cBt.default}});var hBt=Hu();Object.defineProperty(Ee,"isType",{enumerable:!0,get:function(){return hBt.default}});var dBt=aZ();Object.defineProperty(Ee,"isUndefined",{enumerable:!0,get:function(){return dBt.default}});var pBt=oZ();Object.defineProperty(Ee,"isElement",{enumerable:!0,get:function(){return pBt.default}});var vBt=sZ();Object.defineProperty(Ee,"requestAnimationFrame",{enumerable:!0,get:function(){return vBt.default}});var mBt=lZ();Object.defineProperty(Ee,"clearAnimationFrame",{enumerable:!0,get:function(){return mBt.default}});var gBt=uZ();Object.defineProperty(Ee,"augment",{enumerable:!0,get:function(){return gBt.default}});var yBt=fZ();Object.defineProperty(Ee,"clone",{enumerable:!0,get:function(){return yBt.default}});var xBt=cZ();Object.defineProperty(Ee,"debounce",{enumerable:!0,get:function(){return xBt.default}});var bBt=O5();Object.defineProperty(Ee,"memoize",{enumerable:!0,get:function(){return bBt.default}});var _Bt=pZ();Object.defineProperty(Ee,"deepMix",{enumerable:!0,get:function(){return _Bt.default}});var SBt=Oy();Object.defineProperty(Ee,"each",{enumerable:!0,get:function(){return SBt.default}});var CBt=vZ();Object.defineProperty(Ee,"extend",{enumerable:!0,get:function(){return CBt.default}});var wBt=mZ();Object.defineProperty(Ee,"indexOf",{enumerable:!0,get:function(){return wBt.default}});var EBt=gZ();Object.defineProperty(Ee,"isEmpty",{enumerable:!0,get:function(){return EBt.default}});var ABt=G5();Object.defineProperty(Ee,"isEqual",{enumerable:!0,get:function(){return ABt.default}});var MBt=_Z();Object.defineProperty(Ee,"isEqualWith",{enumerable:!0,get:function(){return MBt.default}});var TBt=SZ();Object.defineProperty(Ee,"map",{enumerable:!0,get:function(){return TBt.default}});var IBt=CZ();Object.defineProperty(Ee,"mapValues",{enumerable:!0,get:function(){return IBt.default}});var FZ=a2();Object.defineProperty(Ee,"mix",{enumerable:!0,get:function(){return FZ.default}});Object.defineProperty(Ee,"assign",{enumerable:!0,get:function(){return FZ.default}});var LBt=wZ();Object.defineProperty(Ee,"get",{enumerable:!0,get:function(){return LBt.default}});var OBt=EZ();Object.defineProperty(Ee,"set",{enumerable:!0,get:function(){return OBt.default}});var DBt=AZ();Object.defineProperty(Ee,"pick",{enumerable:!0,get:function(){return DBt.default}});var PBt=MZ();Object.defineProperty(Ee,"omit",{enumerable:!0,get:function(){return PBt.default}});var kBt=TZ();Object.defineProperty(Ee,"throttle",{enumerable:!0,get:function(){return kBt.default}});var RBt=IZ();Object.defineProperty(Ee,"toArray",{enumerable:!0,get:function(){return RBt.default}});var NBt=Dy();Object.defineProperty(Ee,"toString",{enumerable:!0,get:function(){return NBt.default}});var FBt=LZ();Object.defineProperty(Ee,"uniqueId",{enumerable:!0,get:function(){return FBt.default}});var BBt=OZ();Object.defineProperty(Ee,"noop",{enumerable:!0,get:function(){return BBt.default}});var GBt=DZ();Object.defineProperty(Ee,"identity",{enumerable:!0,get:function(){return GBt.default}});var zBt=PZ();Object.defineProperty(Ee,"size",{enumerable:!0,get:function(){return zBt.default}});var UBt=t4();Object.defineProperty(Ee,"measureTextWidth",{enumerable:!0,get:function(){return UBt.default}});var jBt=kZ();Object.defineProperty(Ee,"getEllipsisText",{enumerable:!0,get:function(){return jBt.default}});var WBt=RZ();Object.defineProperty(Ee,"Cache",{enumerable:!0,get:function(){return WBt.default}})});var WJ=ft((_Ce,Z2)=>{var CJ,wJ,EJ,AJ,MJ,TJ,IJ,LJ,OJ,K2,Ez,DJ,PJ,Ib,kJ,RJ,NJ,FJ,BJ,GJ,zJ,UJ,jJ;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Z2=="object"&&typeof Z2.exports=="object"?r(t(e,t(Z2.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=i?i(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])};CJ=function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},wJ=Object.assign||function(t){for(var n,i=1,a=arguments.length;i=0;u--)(l=t[u])&&(s=(o<3?l(s):o>3?l(n,i,s):l(n,i))||s);return o>3&&s&&Object.defineProperty(n,i,s),s},MJ=function(t,n){return function(i,a){n(i,a,t)}},TJ=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)},IJ=function(t,n,i,a){function o(s){return s instanceof i?s:new i(function(l){l(s)})}return new(i||(i=Promise))(function(s,l){function u(h){try{c(a.next(h))}catch(d){l(d)}}function f(h){try{c(a.throw(h))}catch(d){l(d)}}function c(h){h.done?s(h.value):o(h.value).then(u,f)}c((a=a.apply(t,n||[])).next())})},LJ=function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(c){return function(h){return f([c,h])}}function f(c){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,o=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Ez=function(t,n){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var a=i.call(t),o,s=[],l;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(u){l={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(l)throw l.error}}return s},DJ=function(){for(var t=[],n=0;n1||u(p,v)})})}function u(p,v){try{f(a[p](v))}catch(m){d(s[0][3],m)}}function f(p){p.value instanceof Ib?Promise.resolve(p.value.v).then(c,h):d(s[0][2],p)}function c(p){u("next",p)}function h(p){u("throw",p)}function d(p,v){p(v),s.shift(),s.length&&u(s[0][0],s[0][1])}},RJ=function(t){var n,i;return n={},a("next"),a("throw",function(o){throw o}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(o,s){n[o]=t[o]?function(l){return(i=!i)?{value:Ib(t[o](l)),done:o==="return"}:s?s(l):l}:s}},NJ=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t[Symbol.asyncIterator],i;return n?n.call(t):(t=typeof K2=="function"?K2(t):t[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(s){i[s]=t[s]&&function(l){return new Promise(function(u,f){l=t[s](l),o(u,f,l.done,l.value)})}}function o(s,l,u,f){Promise.resolve(f).then(function(c){s({value:c,done:u})},l)}},FJ=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t},BJ=function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n.default=t,n},GJ=function(t){return t&&t.__esModule?t:{default:t}},zJ=function(t,n){if(!n.has(t))throw new TypeError("attempted to get private field on non-instance");return n.get(t)},UJ=function(t,n,i){if(!n.has(t))throw new TypeError("attempted to set private field on non-instance");return n.set(t,i),i},r("__extends",CJ),r("__assign",wJ),r("__rest",EJ),r("__decorate",AJ),r("__param",MJ),r("__metadata",TJ),r("__awaiter",IJ),r("__generator",LJ),r("__exportStar",OJ),r("__createBinding",jJ),r("__values",K2),r("__read",Ez),r("__spread",DJ),r("__spreadArrays",PJ),r("__await",Ib),r("__asyncGenerator",kJ),r("__asyncDelegator",RJ),r("__asyncValues",NJ),r("__makeTemplateObject",FJ),r("__importStar",BJ),r("__importDefault",GJ),r("__classPrivateFieldGet",zJ),r("__classPrivateFieldSet",UJ)})});var mtt=ft((dwe,Q2)=>{var ZJ,$J,QJ,JJ,ttt,ett,rtt,ntt,itt,$2,Mz,att,ott,Ob,stt,ltt,utt,ftt,ctt,htt,dtt,ptt,vtt;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Q2=="object"&&typeof Q2.exports=="object"?r(t(e,t(Q2.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=i?i(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])};ZJ=function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},$J=Object.assign||function(t){for(var n,i=1,a=arguments.length;i=0;u--)(l=t[u])&&(s=(o<3?l(s):o>3?l(n,i,s):l(n,i))||s);return o>3&&s&&Object.defineProperty(n,i,s),s},ttt=function(t,n){return function(i,a){n(i,a,t)}},ett=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)},rtt=function(t,n,i,a){function o(s){return s instanceof i?s:new i(function(l){l(s)})}return new(i||(i=Promise))(function(s,l){function u(h){try{c(a.next(h))}catch(d){l(d)}}function f(h){try{c(a.throw(h))}catch(d){l(d)}}function c(h){h.done?s(h.value):o(h.value).then(u,f)}c((a=a.apply(t,n||[])).next())})},ntt=function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(c){return function(h){return f([c,h])}}function f(c){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,o=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Mz=function(t,n){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var a=i.call(t),o,s=[],l;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(u){l={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(l)throw l.error}}return s},att=function(){for(var t=[],n=0;n1||u(p,v)})})}function u(p,v){try{f(a[p](v))}catch(m){d(s[0][3],m)}}function f(p){p.value instanceof Ob?Promise.resolve(p.value.v).then(c,h):d(s[0][2],p)}function c(p){u("next",p)}function h(p){u("throw",p)}function d(p,v){p(v),s.shift(),s.length&&u(s[0][0],s[0][1])}},ltt=function(t){var n,i;return n={},a("next"),a("throw",function(o){throw o}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(o,s){n[o]=t[o]?function(l){return(i=!i)?{value:Ob(t[o](l)),done:o==="return"}:s?s(l):l}:s}},utt=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t[Symbol.asyncIterator],i;return n?n.call(t):(t=typeof $2=="function"?$2(t):t[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(s){i[s]=t[s]&&function(l){return new Promise(function(u,f){l=t[s](l),o(u,f,l.done,l.value)})}}function o(s,l,u,f){Promise.resolve(f).then(function(c){s({value:c,done:u})},l)}},ftt=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t},ctt=function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n.default=t,n},htt=function(t){return t&&t.__esModule?t:{default:t}},dtt=function(t,n){if(!n.has(t))throw new TypeError("attempted to get private field on non-instance");return n.get(t)},ptt=function(t,n,i){if(!n.has(t))throw new TypeError("attempted to set private field on non-instance");return n.set(t,i),i},r("__extends",ZJ),r("__assign",$J),r("__rest",QJ),r("__decorate",JJ),r("__param",ttt),r("__metadata",ett),r("__awaiter",rtt),r("__generator",ntt),r("__exportStar",itt),r("__createBinding",vtt),r("__values",$2),r("__read",Mz),r("__spread",att),r("__spreadArrays",ott),r("__await",Ob),r("__asyncGenerator",stt),r("__asyncDelegator",ltt),r("__asyncValues",utt),r("__makeTemplateObject",ftt),r("__importStar",ctt),r("__importDefault",htt),r("__classPrivateFieldGet",dtt),r("__classPrivateFieldSet",ptt)})});var xst=ft(pD=>{"use strict";Object.defineProperty(pD,"__esModule",{value:!0});pD.default=void 0;var hYt=1,dYt=function(){return"".concat(hYt++)};pD.default=dYt});var wj=ft(vD=>{"use strict";Object.defineProperty(vD,"__esModule",{value:!0});vD.default=void 0;var pYt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,n=null;return function(){for(var i=this,a=arguments.length,o=new Array(a),s=0;s{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.SensorTabIndex=Gm.SensorClassName=Gm.SizeSensorId=void 0;var vYt="size-sensor-id";Gm.SizeSensorId=vYt;var mYt="size-sensor-object";Gm.SensorClassName=mYt;var gYt="-1";Gm.SensorTabIndex=gYt});var _st=ft(mD=>{"use strict";Object.defineProperty(mD,"__esModule",{value:!0});mD.createSensor=void 0;var yYt=xYt(wj()),bst=Ej();function xYt(r){return r&&r.__esModule?r:{default:r}}var bYt=function(e){var t=void 0,n=[],i=function(){getComputedStyle(e).position==="static"&&(e.style.position="relative");var f=document.createElement("object");return f.onload=function(){f.contentDocument.defaultView.addEventListener("resize",a),a()},f.style.display="block",f.style.position="absolute",f.style.top="0",f.style.left="0",f.style.height="100%",f.style.width="100%",f.style.overflow="hidden",f.style.pointerEvents="none",f.style.zIndex="-1",f.style.opacity="0",f.setAttribute("class",bst.SensorClassName),f.setAttribute("tabindex",bst.SensorTabIndex),f.type="text/html",e.appendChild(f),f.data="about:blank",f},a=(0,yYt.default)(function(){n.forEach(function(u){u(e)})}),o=function(f){t||(t=i()),n.indexOf(f)===-1&&n.push(f)},s=function(){t&&t.parentNode&&(t.contentDocument&&t.contentDocument.defaultView.removeEventListener("resize",a),t.parentNode.removeChild(t),t=void 0,n=[])},l=function(f){var c=n.indexOf(f);c!==-1&&n.splice(c,1),n.length===0&&t&&s()};return{element:e,bind:o,destroy:s,unbind:l}};mD.createSensor=bYt});var Sst=ft(gD=>{"use strict";Object.defineProperty(gD,"__esModule",{value:!0});gD.createSensor=void 0;var _Yt=SYt(wj());function SYt(r){return r&&r.__esModule?r:{default:r}}var CYt=function(e){var t=void 0,n=[],i=(0,_Yt.default)(function(){n.forEach(function(u){u(e)})}),a=function(){var f=new ResizeObserver(i);return f.observe(e),i(),f},o=function(f){t||(t=a()),n.indexOf(f)===-1&&n.push(f)},s=function(){t.disconnect(),n=[],t=void 0},l=function(f){var c=n.indexOf(f);c!==-1&&n.splice(c,1),n.length===0&&t&&s()};return{element:e,bind:o,destroy:s,unbind:l}};gD.createSensor=CYt});var Cst=ft(yD=>{"use strict";Object.defineProperty(yD,"__esModule",{value:!0});yD.createSensor=void 0;var wYt=_st(),EYt=Sst(),AYt=typeof ResizeObserver!="undefined"?EYt.createSensor:wYt.createSensor;yD.createSensor=AYt});var wst=ft(G1=>{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});G1.removeSensor=G1.getSensor=void 0;var MYt=IYt(xst()),TYt=Cst(),xD=Ej();function IYt(r){return r&&r.__esModule?r:{default:r}}var oA={},LYt=function(e){var t=e.getAttribute(xD.SizeSensorId);if(t&&oA[t])return oA[t];var n=(0,MYt.default)();e.setAttribute(xD.SizeSensorId,n);var i=(0,TYt.createSensor)(e);return oA[n]=i,i};G1.getSensor=LYt;var OYt=function(e){var t=e.element.getAttribute(xD.SizeSensorId);e.element.removeAttribute(xD.SizeSensorId),e.destroy(),t&&oA[t]&&delete oA[t]};G1.removeSensor=OYt});var Est=ft(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.ver=zm.clear=zm.bind=void 0;var Aj=wst(),DYt=function(e,t){var n=(0,Aj.getSensor)(e);return n.bind(t),function(){n.unbind(t)}};zm.bind=DYt;var PYt=function(e){var t=(0,Aj.getSensor)(e);(0,Aj.removeSensor)(t)};zm.clear=PYt;var kYt="1.0.1";zm.ver=kYt});var llt=ft((GD,slt)=>{(function(r,e){typeof GD=="object"&&typeof slt!="undefined"?e(GD):typeof define=="function"&&define.amd?define(["exports"],e):(r=r||self,e(r.d3={}))})(GD,function(r){"use strict";function e(M,I){return t(M)||n(M,I)||i()}function t(M){if(Array.isArray(M))return M}function n(M,I){var R=[],P=!0,F=!1,D=void 0;try{for(var G=M[Symbol.iterator](),U;!(P=(U=G.next()).done)&&(R.push(U.value),!(I&&R.length===I));P=!0);}catch(j){F=!0,D=j}finally{try{!P&&G.return!=null&&G.return()}finally{if(F)throw D}}return R}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function a(M,I,R,P){M=M.filter(function(st,_t){var dt=I(st,_t),gt=R(st,_t);return dt!=null&&isFinite(dt)&>!=null&&isFinite(gt)}),P&&M.sort(function(st,_t){return I(st)-I(_t)});for(var F=M.length,D=new Float64Array(F),G=new Float64Array(F),U=0,j=0,H,tt,et,ut=0;utF&&(tt.splice($+1,0,gt),ut=!0)}return ut}}function c(M,I,R,P){var F=P-M*M,D=Math.abs(F)<1e-24?0:(R-M*I)/F,G=I-D*M;return[G,D]}function h(){var M=function(D){return D[0]},I=function(D){return D[1]},R;function P(F){var D=0,G=0,U=0,j=0,H=0,tt=0,et=R?+R[0]:1/0,ut=R?+R[1]:-1/0;o(F,M,I,function(Ut,$t){var Y=Math.log($t),it=Ut*$t;++D,G+=($t-G)/D,j+=(it-j)/D,tt+=(Ut*it-tt)/D,U+=($t*Y-U)/D,H+=(it*Y-H)/D,R||(Utut&&(ut=Ut))});var $=c(j/G,U/G,H/G,tt/G),st=e($,2),_t=st[0],dt=st[1];_t=Math.exp(_t);var gt=function($t){return _t*Math.exp(dt*$t)},Tt=f(et,ut,gt);return Tt.a=_t,Tt.b=dt,Tt.predict=gt,Tt.rSquared=s(F,M,I,G,gt),Tt}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function d(){var M=function(D){return D[0]},I=function(D){return D[1]},R;function P(F){var D=0,G=0,U=0,j=0,H=0,tt=R?+R[0]:1/0,et=R?+R[1]:-1/0;o(F,M,I,function(Tt,Ut){++D,G+=(Tt-G)/D,U+=(Ut-U)/D,j+=(Tt*Ut-j)/D,H+=(Tt*Tt-H)/D,R||(Ttet&&(et=Tt))});var ut=c(G,U,j,H),$=e(ut,2),st=$[0],_t=$[1],dt=function(Ut){return _t*Ut+st},gt=[[tt,dt(tt)],[et,dt(et)]];return gt.a=_t,gt.b=st,gt.predict=dt,gt.rSquared=s(F,M,I,U,dt),gt}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function p(M){M.sort(function(R,P){return R-P});var I=M.length/2;return I%1==0?(M[I-1]+M[I])/2:M[Math.floor(I)]}var v=2,m=1e-12;function g(){var M=function(D){return D[0]},I=function(D){return D[1]},R=.3;function P(F){for(var D=a(F,M,I,!0),G=e(D,4),U=G[0],j=G[1],H=G[2],tt=G[3],et=U.length,ut=Math.max(2,~~(R*et)),$=new Float64Array(et),st=new Float64Array(et),_t=new Float64Array(et).fill(1),dt=-1;++dt<=v;){for(var gt=[0,ut-1],Tt=0;TtU[Y]-Ut?$t:Y,K=0,Rt=0,Xt=0,Zt=0,Ae=0,We=1/Math.abs(U[it]-Ut||1),$e=$t;$e<=Y;++$e){var W=U[$e],Te=j[$e],ne=x(Math.abs(Ut-W)*We)*_t[$e],pt=W*ne;K+=ne,Rt+=pt,Xt+=Te*ne,Zt+=Te*pt,Ae+=W*pt}var Et=c(Rt/K,Xt/K,Zt/K,Ae/K),St=e(Et,2),Wt=St[0],ee=St[1];$[Tt]=Wt+ee*Ut,st[Tt]=Math.abs(j[Tt]-$[Tt]),b(U,Tt+1,gt)}if(dt===v)break;var Ue=p(st);if(Math.abs(Ue)=1?m:(ge=1-ae*ae)*ge}return S(U,$,H,tt)}return P.bandwidth=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function x(M){return(M=1-M*M*M)*M*M}function b(M,I,R){var P=M[I],F=R[0],D=R[1]+1;if(!(D>=M.length))for(;I>F&&M[D]-P<=P-M[F];)R[0]=++F,R[1]=D,++D}function S(M,I,R,P){for(var F=M.length,D=[],G=0,U=0,j=[],H;Gut&&(ut=$t))});var st=c(U,j,H,tt),_t=e(st,2),dt=_t[0],gt=_t[1],Tt=function(Y){return gt*Math.log(Y)/$+dt},Ut=f(et,ut,Tt);return Ut.a=gt,Ut.b=dt,Ut.predict=Tt,Ut.rSquared=s(D,M,I,j,Tt),Ut}return F.domain=function(D){return arguments.length?(P=D,F):P},F.x=function(D){return arguments.length?(M=D,F):M},F.y=function(D){return arguments.length?(I=D,F):I},F.base=function(D){return arguments.length?(R=D,F):R},F}function w(){var M=function(D){return D[0]},I=function(D){return D[1]},R;function P(F){var D=a(F,M,I),G=e(D,4),U=G[0],j=G[1],H=G[2],tt=G[3],et=U.length,ut=0,$=0,st=0,_t=0,dt=0,gt,Tt,Ut,$t;for(gt=0;gtRt&&(Rt=ne))});var Xt=st-ut*ut,Zt=ut*Xt-$*$,Ae=(dt*ut-_t*$)/Zt,We=(_t*Xt-dt*$)/Zt,$e=-Ae*ut,W=function(pt){return pt=pt-H,Ae*pt*pt+We*pt+$e+tt},Te=f(K,Rt,W);return Te.a=Ae,Te.b=We-2*Ae*H,Te.c=$e-We*H+Ae*H*H+tt,Te.predict=W,Te.rSquared=s(F,M,I,Y,W),Te}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function A(){var M=function(G){return G[0]},I=function(G){return G[1]},R=3,P;function F(D){if(R===1){var G=d().x(M).y(I).domain(P)(D);return G.coefficients=[G.b,G.a],delete G.a,delete G.b,G}if(R===2){var U=w().x(M).y(I).domain(P)(D);return U.coefficients=[U.c,U.b,U.a],delete U.a,delete U.b,delete U.c,U}var j=a(D,M,I),H=e(j,4),tt=H[0],et=H[1],ut=H[2],$=H[3],st=tt.length,_t=[],dt=[],gt=R+1,Tt=0,Ut=0,$t=P?+P[0]:1/0,Y=P?+P[1]:-1/0;o(D,M,I,function(W,Te){++Ut,Tt+=(Te-Tt)/Ut,P||(W<$t&&($t=W),W>Y&&(Y=W))});var it,K,Rt,Xt,Zt;for(it=0;it=0;--D)for(U=I[D],j=1,F[D]+=U,G=1;G<=D;++G)j*=(D+1-G)/G,F[D-G]+=U*Math.pow(R,G)*j;return F[0]+=P,F}function k(M){var I=M.length-1,R=[],P,F,D,G,U;for(P=0;PMath.abs(M[P][G])&&(G=F);for(D=P;D=P;D--)M[D][F]-=M[D][P]*M[P][F]/M[P][P]}for(F=I-1;F>=0;--F){for(U=0,D=F+1;Dut&&(ut=Ut))});var $=c(G,U,j,H),st=e($,2),_t=st[0],dt=st[1];_t=Math.exp(_t);var gt=function($t){return _t*Math.pow($t,dt)},Tt=f(et,ut,gt);return Tt.a=_t,Tt.b=dt,Tt.predict=gt,Tt.rSquared=s(F,M,I,tt,gt),Tt}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}r.regressionExp=h,r.regressionLinear=d,r.regressionLoess=g,r.regressionLog=C,r.regressionPoly=A,r.regressionPow=O,r.regressionQuad=w,Object.defineProperty(r,"__esModule",{value:!0})})});var Ult=ft((Der,Zm)=>{"use strict";var QD=Zm.exports;Zm.exports.isNumber=function(r){return typeof r=="number"};Zm.exports.findMin=function(r){if(r.length===0)return 1/0;for(var e=r[0],t=1;t{"use strict";var jlt=50,Wlt=2,$9t=Math.log(2),Vlt=$m.exports,vc=Ult();function Q9t(r){return 1-Math.abs(r)}$m.exports.getUnifiedMinMax=function(r,e){return Vlt.getUnifiedMinMaxMulti([r],e)};$m.exports.getUnifiedMinMaxMulti=function(r,e){e=e||{};var t=!1,n=!1,i=vc.isNumber(e.width)?e.width:Wlt,a=vc.isNumber(e.size)?e.size:jlt,o=vc.isNumber(e.min)?e.min:(t=!0,vc.findMinMulti(r)),s=vc.isNumber(e.max)?e.max:(n=!0,vc.findMaxMulti(r)),l=s-o,u=l/(a-1);return t&&(o=o-2*i*u),n&&(s=s+2*i*u),{min:o,max:s}};$m.exports.create=function(r,e){if(e=e||{},!r||r.length===0)return[];var t=vc.isNumber(e.size)?e.size:jlt,n=vc.isNumber(e.width)?e.width:Wlt,i=Vlt.getUnifiedMinMax(r,{size:t,width:n,min:e.min,max:e.max}),a=i.min,o=i.max,s=o-a,l=s/(t-1);if(s===0)return[{x:a,y:1}];for(var u=[],f=0;f=u.length)){var C=Math.max(S-n,0),w=S,A=Math.min(S+n,u.length-1),L=C-(S-n),k=S+n-A,O=h[-n-1+L]||0,M=h[-n-1+k]||0,I=d/(d-O-M);L>0&&(v+=I*(L-1)*p);var R=Math.max(0,S-n+1);vc.inside(0,u.length-1,R)&&(u[R].y+=I*1*p),vc.inside(0,u.length-1,w+1)&&(u[w+1].y-=I*2*p),vc.inside(0,u.length-1,A+1)&&(u[A+1].y+=I*1*p)}});var m=v,g=0,x=0;return u.forEach(function(b){g+=b.y,m+=g,b.y=m,x+=m}),x>0&&u.forEach(function(b){b.y/=x}),u};function J9t(r,e){for(var t={},n=0,i=-e;i<=e;i++)n+=r(i/e),t[i]=n;return t}$m.exports.getExpectedValueFromPdf=function(r){if(!(!r||r.length===0)){var e=0;return r.forEach(function(t){e+=t.x*t.y}),e}};$m.exports.getXWithLeftTailArea=function(r,e){if(!(!r||r.length===0)){for(var t=0,n=0,i=0;i=e));i++);return r[n].x}};$m.exports.getPerplexity=function(r){if(!(!r||r.length===0)){var e=0;return r.forEach(function(t){var n=Math.log(t.y);isFinite(n)&&(e+=t.y*n)}),e=-e/$9t,Math.pow(2,e)}}});var oW=ft((aP,out)=>{(function(r,e){typeof aP=="object"&&typeof out!="undefined"?e(aP):typeof define=="function"&&define.amd?define(["exports"],e):e(r.fmin=r.fmin||{})})(aP,function(r){"use strict";function e(d,p,v,m){m=m||{};var g=m.maxIterations||100,x=m.tolerance||1e-10,b=d(p),S=d(v),C=v-p;if(b*S>0)throw"Initial bisect points must have opposite signs";if(b===0)return p;if(S===0)return v;for(var w=0;w=0&&(p=A),Math.abs(C)=M[O-1].fx){var $=!1;if(G.fx>ut.fx?(s(U,1+A,D,-A,ut),U.fx=d(U),U.fx=1)break;for(I=1;IS+x*g*C||w>=P)R=g;else{if(Math.abs(L)<=-b*C)return g;L*(R-I)>=0&&(R=I),I=g,P=w}return 0}for(var M=0;M<10;++M){if(s(m.x,1,v.x,g,p),w=m.fx=d(m.x,m.fxprime),L=i(m.fxprime,p),w>S+x*g*C||M&&w>=A)return O(k,g,A);if(Math.abs(L)<=-b*C)return g;if(L>=0)return O(g,k,w);A=w,k=g,g*=2}return g}function f(d,p,v){var m={x:p.slice(),fx:0,fxprime:p.slice()},g={x:p.slice(),fx:0,fxprime:p.slice()},x=p.slice(),b,S,C=1,w;v=v||{},w=v.maxIterations||p.length*20,m.fx=d(m.x,m.fxprime),b=m.fxprime.slice(),o(b,m.fxprime,-1);for(var A=0;A{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.MESSAGE=N_.ALGORITHM=void 0;var tte={pageRank:"pageRank",breadthFirstSearch:"breadthFirstSearch",connectedComponent:"connectedComponent",depthFirstSearch:"depthFirstSearch",detectCycle:"detectCycle",detectDirectedCycle:"detectDirectedCycle",detectAllCycles:"detectAllCycles",detectAllDirectedCycle:"detectAllDirectedCycle",detectAllUndirectedCycle:"detectAllUndirectedCycle",dijkstra:"dijkstra",findAllPath:"findAllPath",findShortestPath:"findShortestPath",floydWarshall:"floydWarshall",getAdjMatrix:"getAdjMatrix",getDegree:"getDegree",getInDegree:"getInDegree",getNeighbors:"getNeighbors",getOutDegree:"getOutDegree",labelPropagation:"labelPropagation",louvain:"louvain",GADDI:"GADDI",minimumSpanningTree:"minimumSpanningTree",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};N_.ALGORITHM=tte;var ete={SUCCESS:"SUCCESS",FAILURE:"FAILURE"};N_.MESSAGE=ete});var sM=ft(Bk=>{"use strict";Object.defineProperty(Bk,"__esModule",{value:!0});Bk.default=void 0;var rte=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,f=o[l],c=o[u];!f&&f!==0||!c&&c!==0||(a[f][c]=1,t||(a[c][f]=1))}),a},nte=rte;Bk.default=nte});var Dht=ft(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.default=F_.LinkedListNode=void 0;var ite=function(e,t){return e===t},o8=function(){function r(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return r.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},r}();F_.LinkedListNode=o8;var ate=function(){function r(e){e===void 0&&(e=ite),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new o8(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new o8(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},r.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,e)?(t=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,e)&&(this.tail=n),t},r.prototype.find=function(e){var t=e.value,n=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},r.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},r.prototype.fromArray=function(e){var t=this;return e.forEach(function(n){return t.append(n)}),this},r.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},r.prototype.reverse=function(){for(var e=this.head,t=null,n=null;e;)n=e.next,e.next=t,t=e,e=n;this.tail=this.head,this.head=t},r.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},r}(),ote=ate;F_.default=ote});var Pht=ft(Gk=>{"use strict";Object.defineProperty(Gk,"__esModule",{value:!0});Gk.default=void 0;var ste=lte(Dht());function lte(r){return r&&r.__esModule?r:{default:r}}var ute=function(){function r(){this.linkedList=new ste.default}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(e){this.linkedList.append(e)},r.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toString=function(e){return this.linkedList.toString(e)},r}(),fte=ute;Gk.default=fte});var vf=ft(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.uniqueId=qh.getOutEdgesNodeId=qh.getNeighbors=qh.getEdgesByNodeId=void 0;var cte=function(e,t,n){t===void 0&&(t=[]);var i=t.filter(function(l){return l.source===e||l.target===e});if(n==="target"){var a=function(u){return u.source===e};return i.filter(a).map(function(l){return l.target})}if(n==="source"){var o=function(u){return u.target===e};return i.filter(o).map(function(l){return l.source})}var s=function(u){return u.source===e?u.target:u.source};return i.map(s)};qh.getNeighbors=cte;var hte=function(e,t){return t.filter(function(n){return n.source===e})};qh.getOutEdgesNodeId=hte;var dte=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})};qh.getEdgesByNodeId=dte;var pte=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(n)};qh.uniqueId=pte});var kht=ft(zk=>{"use strict";Object.defineProperty(zk,"__esModule",{value:!0});zk.default=void 0;var vte=gte(Pht()),mte=vf();function gte(r){return r&&r.__esModule?r:{default:r}}function yte(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}var xte=function(e,t,n,i){i===void 0&&(i=!0);var a=yte(n),o=new vte.default,s=e.edges,l=s===void 0?[]:s;o.enqueue(t);for(var u="",f=function(){var h=o.dequeue();a.enter({current:h,previous:u}),(0,mte.getNeighbors)(h,l,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:u,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:u}),u=h};!o.isEmpty();)f()},bte=xte;zk.default=bte});var s8=ft(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.default=_te;B0.detectStrongConnectComponents=B0.detectConnectedComponents=void 0;var Rht=vf(),Nht=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l=[],u=function d(p){l.push(p),s[p.id]=!0;for(var v=(0,Rht.getNeighbors)(p.id,a),m=function(b){var S=v[b];if(!s[S]){var C=n.filter(function(w){return w.id===S});C.length>0&&d(C[0])}},g=0;g0;)h.push(l.pop());o.push(h)}}return o};B0.detectConnectedComponents=Nht;var Fht=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},f=[],c=0,h=function m(g){l[g.id]=c,u[g.id]=c,c+=1,o.push(g),s[g.id]=!0;for(var x=(0,Rht.getNeighbors)(g.id,a,"target").filter(function(A){return n.map(function(L){return L.id}).indexOf(A)>-1}),b=function(L){var k=x[L];if(!l[k]&&l[k]!==0){var O=n.filter(function(M){return M.id===k});O.length>0&&m(O[0]),u[g.id]=Math.min(u[g.id],u[k])}else s[k]&&(u[g.id]=Math.min(u[g.id],l[k]))},S=0;S0;){var w=o.pop();if(s[w.id]=!1,C.push(w),w===g)break}C.length>0&&f.push(C)}},d=0,p=n;d{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});mg.getOutDegree=mg.getInDegree=mg.default=void 0;var lM=function(e){var t={},n=e.nodes,i=n===void 0?[]:n,a=e.edges,o=a===void 0?[]:a;return i.forEach(function(s){t[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){t[s.source].degree++,t[s.source].outDegree++,t[s.target].degree++,t[s.target].inDegree++}),t},Ste=lM;mg.default=Ste;var Cte=function(e,t){var n=lM(e);return n[t]?lM(e)[t].inDegree:0};mg.getInDegree=Cte;var wte=function(e,t){var n=lM(e);return n[t]?lM(e)[t].outDegree:0};mg.getOutDegree=wte});var f8=ft(u8=>{"use strict";Object.defineProperty(u8,"__esModule",{value:!0});u8.default=Mte;var Ete=vf();function Ate(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}function Bht(r,e,t,n){n.enter({current:e,previous:t});var i=r.edges,a=i===void 0?[]:i;(0,Ete.getNeighbors)(e,a,"target").forEach(function(o){n.allowTraversal({previous:t,current:e,next:o})&&Bht(r,o,e,n)}),n.leave({current:e,previous:t})}function Mte(r,e,t){Bht(r,e,"",Ate(t))}});var Vht=ft(Kh=>{"use strict";function Uk(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uk=function(t){return typeof t}:Uk=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uk(r)}Object.defineProperty(Kh,"__esModule",{value:!0});Kh.detectAllUndirectedCycle=Kh.detectAllDirectedCycle=Kh.detectAllCycles=Kh.default=void 0;var Tte=Lte(f8()),Ght=Ite(s8()),zht=vf();function Uht(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Uht=function(i){return i?t:e})(r)}function Ite(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||Uk(r)!=="object"&&typeof r!="function")return{default:r};var t=Uht(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)){var o=i?Object.getOwnPropertyDescriptor(r,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=r[a]}return n.default=r,t&&t.set(r,n),n}function Lte(r){return r&&r.__esModule?r:{default:r}}var Ote=function(e){var t=null,n=e.nodes,i=n===void 0?[]:n,a={},o={},s={},l={};i.forEach(function(c){o[c.id]=c});for(var u={enter:function(h){var d=h.current,p=h.previous;if(s[d]){t={};for(var v=d,m=p;m!==d;)t[v]=m,v=m,m=a[m];t[v]=m}else s[d]=d,delete o[d],a[d]=p},leave:function(h){var d=h.current;l[d]=d,delete s[d]},allowTraversal:function(h){var d=h.next;return t?!1:!l[d]}};Object.keys(o).length;){var f=Object.keys(o)[0];(0,Tte.default)(e,f,u)}return t},jht=function(e,t,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=(0,Ght.default)(e,!1),l=0,u=s;l0;)for(var m=d.pop(),g=m.id,x=(0,zht.getNeighbors)(g,e.edges),b=function(w){var A,L=x[w],k=e.nodes.find(function(F){return F.id===L});if(L===g)o.push((A={},A[L]=m,A));else if(!(L in v))p[L]=m,d.push(k),v[L]=new Set([m]);else if(!v[g].has(k)){for(var O=!0,M=[k,m],I=p[g];v[L].size&&!v[L].has(I)&&(M.push(I),I!==p[I.id]);)I=p[I.id];if(M.push(I),t&&n?(O=!1,M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!0)):t&&!n&&M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!1),O){for(var R={},P=1;P0;){var P=R.pop();a.has(P)&&(a.delete(P),o[P.id].forEach(function(F){R.push(F)}),o[P.id].clear())}},c=function M(I,R,P){var F=!1;if(t&&n===!1&&t.indexOf(I.id)>-1)return F;i.push(I),a.add(I);for(var D=P[I.id],G=0;G-1});ut<$.length;ut++){var st=$[ut];st===et.id&&!(n===!1&&t.indexOf(et.id)>-1)?s.push((R={},R[et.id]=et,R)):tt[et.id].push(u[st])}}return{component:H,adjList:tt,minIdx:F}},b=0;b=b}),C=(0,Ght.detectStrongConnectComponents)({nodes:S,edges:e.edges}).filter(function(M){return M.length>1});if(C.length===0)break;var w=x(C),A=w.minIdx,L=w.adjList,k=w.component;if(k.length>1){k.forEach(function(M){o[M.id]=new Set});var O=l[A];if(t&&n&&t.indexOf(O.id)===-1)return s;c(O,O,L),b=A+1}else break}return s};Kh.detectAllDirectedCycle=Wht;var Dte=function(e,t,n,i){return i===void 0&&(i=!0),t?Wht(e,n,i):jht(e,n,i)};Kh.detectAllCycles=Dte;var Pte=Ote;Kh.default=Pte});var Wk=ft(jk=>{"use strict";Object.defineProperty(jk,"__esModule",{value:!0});jk.default=void 0;var Hht=Sw(),kte=q(),Yht=vf(),Rte=function(e,t,n){for(var i=1/0,a,o=0;oc[C.id]+I?(c[M]=c[C.id]+I,h[M]=[C.id]):c[M]===c[C.id]+I&&h[M].push(C.id)})},v=0;v{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});B_.findShortestPath=B_.findAllPath=void 0;var Bte=Gte(Wk()),Vk=vf();function Gte(r){return r&&r.__esModule?r:{default:r}}var zte=function(e,t,n,i,a){var o=(0,Bte.default)(e,t,i,a),s=o.length,l=o.path,u=o.allPath;return{length:s[n],path:l[n],allPath:u[n]}};B_.findShortestPath=zte;var Ute=function(e,t,n,i){var a;if(t===n)return[[t]];var o=e.edges,s=o===void 0?[]:o,l=[t],u=(a={},a[t]=!0,a),f=[],c=[],h=i?(0,Vk.getNeighbors)(t,s,"target"):(0,Vk.getNeighbors)(t,s);for(f.push(h);l.length>0&&f.length>0;){var d=f[f.length-1];if(d.length){var p=d.shift();p&&(l.push(p),u[p]=!0,h=i?(0,Vk.getNeighbors)(p,s,"target"):(0,Vk.getNeighbors)(p,s),f.push(h.filter(function(g){return!u[g]})))}else{var v=l.pop();u[v]=!1,f.pop();continue}if(l[l.length-1]===n){var m=l.map(function(x){return x});c.push(m);var v=l.pop();u[v]=!1,f.pop()}}return c};B_.findAllPath=Ute});var c8=ft(Hk=>{"use strict";Object.defineProperty(Hk,"__esModule",{value:!0});Hk.default=void 0;var jte=Wte(sM());function Wte(r){return r&&r.__esModule?r:{default:r}}var Vte=function(e,t){for(var n=(0,jte.default)(e,t),i=[],a=n.length,o=0;oi[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},Hte=Vte;Hk.default=Hte});var Kht=ft(Yk=>{"use strict";Object.defineProperty(Yk,"__esModule",{value:!0});Yk.default=void 0;var Yte=qte(sM()),Xte=vf();function qte(r){return r&&r.__esModule?r:{default:r}}var Kte=function(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},f={};o.forEach(function(S,C){var w=(0,Xte.uniqueId)();S.clusterId=w,u[w]={id:w,nodes:[S]},f[S.id]={node:S,idx:C}});var c=(0,Yte.default)(e,t),h=[],d={};c.forEach(function(S,C){var w=0,A=o[C].id;d[A]={},S.forEach(function(L,k){if(!!L){w+=L;var O=o[k].id;d[A][O]=L}}),h.push(w)});for(var p=0,v=function(){var C=!1;if(o.forEach(function(w){var A={};Object.keys(d[w.id]).forEach(function(F){var D=d[w.id][F],G=f[F].node,U=G.clusterId;A[U]||(A[U]=0),A[U]+=D});var L=-1/0,k=[];if(Object.keys(A).forEach(function(F){L=0&&k.splice(O,1),k&&k.length){C=!0;var M=u[w.clusterId],I=M.nodes.indexOf(w);M.nodes.splice(I,1);var R=Math.floor(Math.random()*k.length),P=u[k[R]];P.nodes.push(w),w.clusterId=P.id}}}),!C)return"break";p++};p{"use strict";Object.defineProperty(Xk,"__esModule",{value:!0});Xk.default=void 0;var $te=q(),Qte=function(){function r(e){this.arr=e}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length))return new r(n);if(!(n==null?void 0:n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length))return new r(n);if(!(n==null?void 0:n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(e){var t=[];if(e!==0)for(var n in this.arr)t[n]=this.arr[n]/e;return new r(t)},r.prototype.negate=function(){var e=[];for(var t in this.arr)e[t]=-this.arr[t];return new r(e)},r.prototype.squareEuclideanDistance=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return i}},r.prototype.euclideanDistance=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var e=[],t=(0,$te.clone)(this.arr);t.sort(function(o,s){return o-s});var n=t[t.length-1],i=t[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(n-i);return new r(e)},r.prototype.norm2=function(){var e;if(!((e=this.arr)===null||e===void 0?void 0:e.length))return 0;var t=0;for(var n in this.arr)t+=Math.pow(this.arr[n],2);return Math.sqrt(t)},r.prototype.dot=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*e.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(e){var t,n=e.arr;if(((t=this.arr)===null||t===void 0?void 0:t.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Jte=Qte;Xk.default=Jte});var Zht=ft(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});G_.secondReg=G_.dateReg=void 0;var tee=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;G_.secondReg=tee;var eee=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;G_.dateReg=eee});var Jht=ft(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});Zh.getPropertyWeight=Zh.getAllSortProperties=Zh.getAllProperties=Zh.default=void 0;var qk=Zht(),d8=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=100);var n={};e.forEach(function(a){!a.properties||Object.keys(a.properties).forEach(function(o){if(o==="id"||!"".concat(a.properties[o]).match(qk.secondReg)&&!"".concat(a.properties[o]).match(qk.dateReg)&&isNaN(Number(a.properties[o]))){n.hasOwnProperty(o)&&delete n[o];return}n.hasOwnProperty(o)?n[o]+=1:n[o]=1})});var i=Object.keys(n).sort(function(a,o){return n[o]-n[a]});return i.length{"use strict";Object.defineProperty(uM,"__esModule",{value:!0});uM.DistanceType=void 0;var p8;uM.DistanceType=p8;(function(r){r.EuclideanDistance="euclideanDistance"})(p8||(uM.DistanceType=p8={}))});var odt=ft($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.oneHot=$h.getDistance=$h.getAllKeyValueMap=$h.default=void 0;var edt=q(),rdt=tdt(),ndt=iee(h8());function iee(r){return r&&r.__esModule?r:{default:r}}var v8=function(e,t,n){var i=[];(t==null?void 0:t.length)?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=(0,edt.uniq)(i));var a={};return i.forEach(function(o){var s=[];e.forEach(function(l){l[o]!==void 0&&l[o]!==""&&s.push(l[o])}),s.length&&!(n==null?void 0:n.includes(o))&&(a[o]=(0,edt.uniq)(s))}),a};$h.getAllKeyValueMap=v8;var idt=function(e,t,n){var i=v8(e,t,n),a=[];return e.forEach(function(o,s){var l=[];Object.keys(i).forEach(function(u){for(var f=o[u],c=i[u],h=c.findIndex(function(v){return f===v}),d=[],p=0;p{"use strict";Object.defineProperty(Kk,"__esModule",{value:!0});Kk.default=void 0;var oee=q(),see=sdt(sM()),fM=sdt(h8()),lee=Jht(),uee=odt();function sdt(r){return r&&r.__esModule?r:{default:r}}var ldt=function(e,t,n,i){for(var a=t.length,o=2*i,s=0,l=0;l0&&C>w&&C-ww&&(L=l.map(function(D){return{node:D,clusterId:D.clusterId}}),k=(0,oee.clone)(v),w=C),O||A>100)break;A++,Object.keys(v).forEach(function(D){var G=0;f.forEach(function(U){var j=U.source,H=U.target,tt=m[j].node.clusterId,et=m[H].node.clusterId;(tt===D&&et!==D||et===D&&tt!==D)&&(G=G+(U[n]||1))}),v[D].sumTot=G}),l.forEach(function(D,G){var U=v[D.clusterId],j=0,H,tt=x[G]/(2*S),et=0,ut=U.nodes;ut.forEach(function(it){var K=m[it.id].idx;et+=g[G][K]||0});var $=et-U.sumTot*tt,st=ut.filter(function(it){return it.id!==D.id}),_t=[];st.forEach(function(it,K){_t[K]=c[it.originIndex]});var dt=m8(st,c)*o,gt=b[D.id];if(Object.keys(gt).forEach(function(it){var K=m[it].node,Rt=K.clusterId;if(Rt!==D.clusterId){var Xt=v[Rt],Zt=Xt.nodes;if(!(!Zt||!Zt.length)){var Ae=0;Zt.forEach(function(pt){var Et=m[pt.id].idx;Ae+=g[G][Et]||0});var We=Ae-Xt.sumTot*tt,$e=Zt.concat([D]),W=[];$e.forEach(function(pt,Et){W[Et]=c[pt.originIndex]});var Te=m8($e,c)*o,ne=We-$;a&&(ne=We+Te-($+dt)),ne>j&&(j=ne,H=Xt)}}}),j>0){H.nodes.push(D);var Tt=D.clusterId;D.clusterId=H.id;var Ut=U.nodes.indexOf(D);U.nodes.splice(Ut,1);var $t=0,Y=0;f.forEach(function(it){var K=it.source,Rt=it.target,Xt=m[K].node.clusterId,Zt=m[Rt].node.clusterId;(Xt===H.id&&Zt!==H.id||Zt===H.id&&Xt!==H.id)&&($t=$t+(it[n]||1)),(Xt===Tt&&Zt!==Tt||Zt===Tt&&Xt!==Tt)&&(Y=Y+(it[n]||1))}),H.sumTot=$t,U.sumTot=Y}})}var M={},I=0;Object.keys(k).forEach(function(D){var G=k[D];if(!G.nodes||!G.nodes.length){delete k[D];return}var U=String(I+1);U!==D&&(G.id=U,G.nodes=G.nodes.map(function(j){return{id:j.id,clusterId:U}}),k[U]=G,M[D]=U,delete k[D],I++)}),L.forEach(function(D){var G=D.node,U=D.clusterId;G.clusterId=U,G.clusterId&&M[G.clusterId]&&(G.clusterId=M[G.clusterId])});var R=[],P={};f.forEach(function(D){var G=D.source,U=D.target,j=D[n]||1,H=m[G].node.clusterId,tt=m[U].node.clusterId,et="".concat(H,"---").concat(tt);if(P[et])P[et].weight+=j,P[et].count++;else{var ut={source:H,target:tt,weight:j,count:1};P[et]=ut,R.push(ut)}});var F=[];return Object.keys(k).forEach(function(D){F.push(k[D])}),{clusters:F,clusterEdges:R}},cee=fee;Kk.default=cee});var fdt=ft(Zk=>{"use strict";Object.defineProperty(Zk,"__esModule",{value:!0});Zk.default=void 0;var hee=function(){function r(e){this.count=e.length,this.parent={};for(var t=0,n=e;t{"use strict";Object.defineProperty($k,"__esModule",{value:!0});$k.default=void 0;var pee=function(e,t){return e-t},vee=function(){function r(e){e===void 0&&(e=pee),this.compareFn=e,this.list=[]}return r.prototype.getLeft=function(e){return 2*e+1},r.prototype.getRight=function(e){return 2*e+2},r.prototype.getParent=function(e){return e===0?null:Math.floor((e-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var e=this.top(),t=this.list.pop();return this.list.length>0&&(this.list[0]=t,this.moveDown(0)),e},r.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},r.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var n=this.list[t];this.list[t]=this.list[e],this.list[e]=n,e=t,t=this.getParent(e)}},r.prototype.moveDown=function(e){var t,n=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i0?n=i:a!==null&&a0&&(n=a),e!==n&&(t=[this.list[n],this.list[e]],this.list[e]=t[0],this.list[n]=t[1],this.moveDown(n))},r}(),mee=vee;$k.default=mee});var pdt=ft(Qk=>{"use strict";Object.defineProperty(Qk,"__esModule",{value:!0});Qk.default=void 0;var gee=hdt(fdt()),yee=hdt(cdt()),g8=vf();function hdt(r){return r&&r.__esModule?r:{default:r}}var xee=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=a[0],u=new Set;u.add(l);var f=function(m,g){return t?m.weight-g.weight:0},c=new yee.default(f);for((0,g8.getEdgesByNodeId)(l.id,s).forEach(function(v){c.insert(v)});!c.isEmpty();){var h=c.delMin(),d=h.source,p=h.target;u.has(d)&&u.has(p)||(n.push(h),u.has(d)||(u.add(d),(0,g8.getEdgesByNodeId)(d,s).forEach(function(v){c.insert(v)})),u.has(p)||(u.add(p),(0,g8.getEdgesByNodeId)(p,s).forEach(function(v){c.insert(v)})))}return n},ddt=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=s.map(function(d){return d});t&&l.sort(function(d,p){return d.weight-p.weight});for(var u=new gee.default(a.map(function(d){return d.id}));l.length>0;){var f=l.shift(),c=f.source,h=f.target;u.connected(c,h)||(n.push(f),u.union(c,h))}return n},bee=function(e,t,n){var i={prim:xee,kruskal:ddt};return n?i[n](e,t):ddt(e,t)},_ee=bee;Qk.default=_ee});var vdt=ft(Jk=>{"use strict";Object.defineProperty(Jk,"__esModule",{value:!0});Jk.default=void 0;var See=wee(l8()),Cee=vf();function wee(r){return r&&r.__esModule?r:{default:r}}var Eee=function(e,t,n){typeof t!="number"&&(t=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,f=u===void 0?[]:u,c=l.length,h,d={},p={},v=0;v0&&i>t;){a=0;for(var v=0;v0&&(h+=p[C]/w)}d[g]=n*h,a+=d[g]}}a=(1-a)/c,i=0;for(var v=0;v{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.VACANT_NODE_LABEL=co.VACANT_NODE_ID=co.VACANT_GRAPH_ID=co.VACANT_EDGE_LABEL=co.VACANT_EDGE_ID=co.Node=co.Graph=co.Edge=co.AUTO_EDGE_ID=void 0;var mdt=-1;co.VACANT_EDGE_ID=mdt;var cM=-1;co.VACANT_NODE_ID=cM;var gdt="-1";co.VACANT_EDGE_LABEL=gdt;var ydt="-1";co.VACANT_NODE_LABEL=ydt;var Mee=-1;co.VACANT_GRAPH_ID=Mee;var Tee="-1";co.AUTO_EDGE_ID=Tee;var y8=function(){function r(e,t,n,i){e===void 0&&(e=mdt),t===void 0&&(t=cM),n===void 0&&(n=cM),i===void 0&&(i=gdt),this.id=e,this.from=t,this.to=n,this.label=i}return r}();co.Edge=y8;var xdt=function(){function r(e,t){e===void 0&&(e=cM),t===void 0&&(t=ydt),this.id=e,this.label=t,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(e){this.edges.push(e),this.edgeMap[e.id]=e},r}();co.Node=xdt;var Iee=function(){function r(e,t,n){e===void 0&&(e=cM),t===void 0&&(t=!0),n===void 0&&(n=!1),this.id=e,this.edgeIdAutoIncrease=t,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(e,t){if(!this.nodeMap[e]){var n=new xdt(e,t);this.nodes.push(n),this.nodeMap[e]=n,this.nodeLabelMap[t]||(this.nodeLabelMap[t]=[]),this.nodeLabelMap[t].push(e)}},r.prototype.addEdge=function(e,t,n,i){if((this.edgeIdAutoIncrease||e===void 0)&&(e=this.counter++),!(this.nodeMap[t]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[e])){var a=new y8(e,t,n,i);if(this.edges.push(a),this.edgeMap[e]=a,this.nodeMap[t].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new y8(e,n,t,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}();co.Graph=Iee});var Cdt=ft(eR=>{"use strict";Object.defineProperty(eR,"__esModule",{value:!0});eR.default=void 0;var Lee=q(),ql=bdt(),G0=function(){function r(e,t,n,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:n||ql.VACANT_NODE_LABEL,edgeLabel:i||ql.VACANT_EDGE_LABEL,nodeLabel2:a||ql.VACANT_NODE_LABEL}}return r.prototype.equalTo=function(e){return this.fromNode===e.formNode&&this.toNode===e.toNode&&this.nodeEdgeNodeLabel===e.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r}(),_dt=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(e){var t=this.dfsEdgeList.length,n=e.length;if(t!==n)return!1;for(var i=0;i=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;ad||i.hasNode(o[h.to])||(t.labelb;C--){var w=S(C);if(w==="break")break}if(g){var A=e.findMinLabel(m);o.dfsEdgeList.push(new G0(v,x,ql.VACANT_NODE_LABEL,A.edgeLabel,ql.VACANT_NODE_LABEL));var L=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[L]!==o.dfsEdgeList[L]?!1:c(m[A.edgeLabel].projected)}var k={};g=!1;var O=0;h.forEach(function(D){var G=new tR(D),U=e.findForwardPureEdges(i,G.edges[d[0]],p,G);U.length>0&&(g=!0,O=v,U.forEach(function(j){var H="".concat(j.label,"-").concat(a[j.to].label);k[H]||(k[H]={projected:[],edgeLabel:j.label,nodeLabel2:a[j.to].label}),k[H].projected.push({graphId:i.id,edge:j,preNode:D})}))});for(var M=d.length,I=function(G){if(g)return"break";var U=d[G];h.forEach(function(j){var H=new tR(j),tt=e.findForwardRmpathEdges(i,H.edges[U],p,H);tt.length>0&&(g=!0,O=o.dfsEdgeList[U].fromNode,tt.forEach(function(et){var ut="".concat(et.label,"-").concat(a[et.to].label);k[ut]||(k[ut]={projected:[],edgeLabel:et.label,nodeLabel2:a[et.to].label}),k[ut].projected.push({graphId:i.id,edge:et,preNode:j})}))})},C=0;C=0;p--){var v=t.findBackwardEdge(c,d.edges[a[p]],d.edges[a[0]],d);if(v){var m="".concat(t.dfsCode.dfsEdgeList[a[p]].fromNode,"-").concat(v.label);u[m]||(u[m]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[p]].fromNode,edgeLabel:v.label}),u[m].projected.push({graphId:f.graphId,edge:v,preNode:f})}}if(!(i>=t.maxNodeNum)){var g=t.findForwardPureEdges(c,d.edges[a[0]],s,d);g.forEach(function(b){var S="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);l[S]||(l[S]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),l[S].projected.push({graphId:f.graphId,edge:b,preNode:f})});for(var x=function(S){var C=t.findForwardRmpathEdges(c,d.edges[a[S]],s,d);C.forEach(function(w){var A="".concat(t.dfsCode.dfsEdgeList[a[S]].fromNode,"-").concat(w.label,"-").concat(h[w.to].label);l[A]||(l[A]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[S]].fromNode,edgeLabel:w.label,nodeLabel2:h[w.to].label}),l[A].projected.push({graphId:f.graphId,edge:w,preNode:f})})},p=0;pb){var S=b;b=x,x=S}var C=g.label,w="".concat(u,"-").concat(x,"-").concat(C,"-").concat(b),A="".concat(x,"-").concat(C,"-").concat(b);if(!o[A]){var L=o[A]||0;L++,o[A]=L}l[w]={graphId:u,nodeLabel1:x,edgeLabel:C,nodeLabel2:b}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f{"use strict";Object.defineProperty(iR,"__esModule",{value:!0});iR.default=void 0;var wdt=Sw(),Edt=x8(c8()),Nee=x8(Cdt()),Adt=x8(Wk()),Fee=vf();function x8(r){return r&&r.__esModule?r:{default:r}}var Mdt=function(e,t,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=e.nodes;return t.forEach(function(s,l){a.push(Tdt(o,s,l,n,i))}),a},Tdt=function(e,t,n,i,a){var o=[n],s=[],l={};return t.forEach(function(u,f){if(u<=a&&n!==f){o.push(f),s.push(e[f]);var c=e[f][i];l[c]?(l[c].count++,l[c].dists.push(u)):l[c]={count:1,dists:[u]}}}),Object.keys(l).forEach(function(u){l[u].dists=l[u].dists.sort(function(f,c){return f-c})}),{nodeIdx:n,nodeId:e[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:l}},Bee=function(e,t,n,i,a){var o=Math.ceil(n/t),s={},l=0;return i.forEach(function(u,f){for(var c=0,h=0,d=u.nodeIdxs,p=u.neighborNum-1;c2*t)););if(m<2*t&&(s["".concat(f,"-").concat(v)]={start:f,end:v,distance:a[f][v]},c++,l++,l>=n))return s;if(h++,h>2*t)break}if(ch&&(l=h);var d=n[c.id].inDegree;u>d&&(u=d);var p=n[c.id].outDegree;f>p&&(f=p)}),e[t]={degree:l,inDegree:u,outDegree:f}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:f}},Uee=function(e,t,n,i,a,o,s){var l;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var f=(0,Edt.default)(e,n),c=(0,Edt.default)(t,n),h=Odt(e.nodes,f,n),d=Odt(t.nodes,c,n),p=Idt(e.nodes,o),v=p.nodeMap,m=p.nodeLabelMap,g=Idt(t.nodes,o),x=g.nodeMap,b=g.nodeLabelMap;Ldt(e.edges,s,v);var S=Ldt(t.edges,s,x).edgeLabelMap,C=[];c==null||c.forEach(function(W){C=C.concat(W)}),a||(a=Math.max.apply(Math,(0,wdt.__spreadArray)((0,wdt.__spreadArray)([],C,!1),[2],!1))),i||(i=a);var w=Mdt(e,f,o,i),A=Mdt(t,c,o,i),L=Math.min(100,u*(u-1)/2),k=Bee(i,u,L,w,f),O=rR(k,w,e),M=10,I=1,R=1,P=4,F={graphs:O,nodeLabelProp:o,edgeLabelProp:s,minSupport:I,minNodeNum:R,maxNodeNum:P,directed:n},D=(0,Nee.default)(F).slice(0,M),G=D.length,U=[];D.forEach(function(W,Te){U[Te]={},Object.keys(O).forEach(function(ne){var pt=O[ne],Et=nR(pt,W,o,s);U[Te][ne]=Et})});var j=Gee(U,G,D),H=j.structure,tt=j.structureCountMap,et=t.nodes[0],ut=[],$=(l=t.nodes[0])===null||l===void 0?void 0:l[o],st=-1/0;t.nodes.forEach(function(W){var Te=W[o],ne=m[Te];(ne==null?void 0:ne.length)>st&&(st=ne.length,ut=ne,$=Te,et=W)});var _t={},dt={},gt={},Tt={},Ut={},$t={};Object.keys(b).forEach(function(W,Te){Ut[W]=[],n&&($t[W]=[]);var ne=-1/0,pt=b[W],Et={};pt.forEach(function(Ht){var ae=d["".concat(et.id,"-").concat(Ht.id)];if(ae&&Ut[W].push(ae),neUt[W][_n]){ga=!0;break}if(ga)return ut.splice(ae,1),"continue";var ii={};Ye.neighbors.forEach(function(En){var ci=h["".concat(ge.id,"-").concat(En.id)];ii["".concat(ge.id,"-").concat(En.id)]={start:v[ge.id].idx,end:v[En.id].idx,distance:ci}}),O=rR(ii,w,e,O);var xi=[];Object.keys(ii).forEach(function(En){if(tt[En]){xi.push(tt[En]);return}var ci=O[En];tt[En]=nR(ci,H,o,s),xi.push(tt[En])}),xi=xi.sort(function(En,ci){return ci-En});for(var Ki=!1,_n=0;_n<$n;_n++)if(xi[_n]=0;Ue--)ee(Ue)});var Y=[];ut==null||ut.forEach(function(W){for(var Te=v[W.id].idx,ne=Tdt(e.nodes,f[Te],Te,o,a),pt=ne.neighbors,Et=pt.length,St=!1,Wt=Et-1;Wt>=0;Wt--){if(pt.length+1Ye){pt.splice(Wt,1);continue}if(n){var Ve="".concat(ee.id,"-").concat(W.id),$n=h[Ve];ge=$t[Ue].length-1;var ga=$t[Ue][ge];if($n>ga){pt.splice(Wt,1);continue}}var _n=tt[Ht]?tt[Ht]:zee(e,W,ee,v,ae,w,H,o,s,tt,O),ii="".concat(et.id,"-").concat(Ue),xi=Tt[ii][Tt[ii].length-1];if(_n=0;ae--){var ga=$n(ae);if(ga==="break")break}if(Ve)return Y.splice(Te,1),"continue";ne.edges=Wt;var _n=(0,Adt.default)(ne,ne.nodes[0].id,!1).length;if(Object.keys(_n).reverse().forEach(function(er){if(!(er===ne.nodes[0].id||Ve)){if(_n[er]===1/0){var ai=St[er].node[o];if(Et[ai]--,Et[ai]K[ji][K[ji].length-1]){var ai=St[er].node[o];if(Et[ai]--,Et[ai]=0;ci--){var Nn=ne.nodes[ci],Ia=St[Nn.id].degree,Li=St[Nn.id].inDegree,ko=St[Nn.id].outDegree,ku=Nn[o],Ro=Ddt(_t,ku,x,b),ys=Ro.minPatternNodeLabelDegree,Jo=Ro.minPatternNodeLabelInDegree,vl=Ro.minPatternNodeLabelOutDegree,Fs=n?Ia=0;yo--){var Oi=Wt[yo];if(!St[Oi.source]||!St[Oi.target]){Wt.splice(yo,1);var xs=Oi[s];if(ee[xs]--,St[Oi.source]&&(St[Oi.source].degree--,St[Oi.source].outDegree--),St[Oi.target]&&(St[Oi.target].degree--,St[Oi.target].inDegree--),S[xs]&&ee[xs]=0;Zt--){var Ae=Xt(Zt);if(Ae==="break")break}for(var We=Y.length,$e=function(Te){var ne=Y[Te],pt={};ne.edges.forEach(function(Wt){var ee="".concat(Wt.source,"-").concat(Wt.target,"-").concat(Wt.label);pt[ee]?pt[ee]++:pt[ee]=1});for(var Et=function(ee){var Ue=Y[ee],Ht={};Ue.edges.forEach(function(ge){var Ye="".concat(ge.source,"-").concat(ge.target,"-").concat(ge.label);Ht[Ye]?Ht[Ye]++:Ht[Ye]=1});var ae=!0;Object.keys(Ht).length!==Object.keys(pt).length?ae=!1:Object.keys(pt).forEach(function(ge){Ht[ge]!==pt[ge]&&(ae=!1)}),ae&&Y.splice(ee,1)},St=We-1;St>Te;St--)Et(St);We=Y.length},Zt=0;Zt<=We-1;Zt++)$e(Zt);return Y}}},jee=Uee;iR.default=jee});var Ndt=ft(ho=>{"use strict";function aR(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?aR=function(t){return typeof t}:aR=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aR(r)}Object.defineProperty(ho,"__esModule",{value:!0});Object.defineProperty(ho,"GADDI",{enumerable:!0,get:function(){return tre.default}});Object.defineProperty(ho,"breadthFirstSearch",{enumerable:!0,get:function(){return Vee.default}});Object.defineProperty(ho,"connectedComponent",{enumerable:!0,get:function(){return Hee.default}});Object.defineProperty(ho,"depthFirstSearch",{enumerable:!0,get:function(){return Xee.default}});Object.defineProperty(ho,"detectCycle",{enumerable:!0,get:function(){return Yee.default}});Object.defineProperty(ho,"dijkstra",{enumerable:!0,get:function(){return qee.default}});Object.defineProperty(ho,"findAllPath",{enumerable:!0,get:function(){return kdt.findAllPath}});Object.defineProperty(ho,"findShortestPath",{enumerable:!0,get:function(){return kdt.findShortestPath}});Object.defineProperty(ho,"floydWarshall",{enumerable:!0,get:function(){return Kee.default}});Object.defineProperty(ho,"getAdjMatrix",{enumerable:!0,get:function(){return Wee.default}});Object.defineProperty(ho,"getDegree",{enumerable:!0,get:function(){return b8.default}});Object.defineProperty(ho,"getInDegree",{enumerable:!0,get:function(){return b8.getInDegree}});Object.defineProperty(ho,"getNeighbors",{enumerable:!0,get:function(){return ere.getNeighbors}});Object.defineProperty(ho,"getOutDegree",{enumerable:!0,get:function(){return b8.getOutDegree}});Object.defineProperty(ho,"labelPropagation",{enumerable:!0,get:function(){return Zee.default}});Object.defineProperty(ho,"louvain",{enumerable:!0,get:function(){return $ee.default}});Object.defineProperty(ho,"minimumSpanningTree",{enumerable:!0,get:function(){return Qee.default}});Object.defineProperty(ho,"pageRank",{enumerable:!0,get:function(){return Jee.default}});var Wee=mf(sM()),Vee=mf(kht()),Hee=mf(s8()),b8=rre(l8()),Yee=mf(Vht()),Xee=mf(f8()),qee=mf(Wk()),kdt=qht(),Kee=mf(c8()),Zee=mf(Kht()),$ee=mf(udt()),Qee=mf(pdt()),Jee=mf(vdt()),tre=mf(Pdt()),ere=vf();function Rdt(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Rdt=function(i){return i?t:e})(r)}function rre(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||aR(r)!=="object"&&typeof r!="function")return{default:r};var t=Rdt(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)){var o=i?Object.getOwnPropertyDescriptor(r,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=r[a]}return n.default=r,t&&t.set(r,n),n}function mf(r){return r&&r.__esModule?r:{default:r}}});var Gdt=ft(sR=>{"use strict";function oR(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?oR=function(t){return typeof t}:oR=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oR(r)}Object.defineProperty(sR,"__esModule",{value:!0});sR.default=void 0;var _8=nre(Ndt()),Fdt=Fk();function Bdt(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Bdt=function(i){return i?t:e})(r)}function nre(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||oR(r)!=="object"&&typeof r!="function")return{default:r};var t=Bdt(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)){var o=i?Object.getOwnPropertyDescriptor(r,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=r[a]}return n.default=r,t&&t.set(r,n),n}var S8=typeof self!="undefined"?self:{};S8.onmessage=function(r){var e=r.data,t=e._algorithmType,n=e.data;if(!!t){if(typeof _8[t]=="function"){var i=_8[t].apply(_8,n);S8.postMessage({_algorithmType:Fdt.MESSAGE.SUCCESS,data:i});return}S8.postMessage({_algorithmType:Fdt.MESSAGE.FAILURE})}};var ire=null;sR.default=ire});var zdt=ft(lR=>{"use strict";Object.defineProperty(lR,"__esModule",{value:!0});lR.default=void 0;var are=Fk(),ore=sre(Gdt());function sre(r){return r&&r.__esModule?r:{default:r}}var lre=function(e){return function(){for(var t=[],n=0;n{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.pageRankAsync=Pn.minimumSpanningTreeAsync=Pn.louvainAsync=Pn.labelPropagationAsync=Pn.getOutDegreeAsync=Pn.getNeighborsAsync=Pn.getInDegreeAsync=Pn.getDegreeAsync=Pn.getAdjMatrixAsync=Pn.floydWarshallAsync=Pn.findShortestPathAsync=Pn.findAllPathAsync=Pn.dijkstraAsync=Pn.detectCycleAsync=Pn.detectAllUndirectedCycleAsync=Pn.detectAllDirectedCycleAsync=Pn.detectAllCyclesAsync=Pn.connectedComponentAsync=Pn.GADDIAsync=void 0;var Ao=fre(zdt()),Mo=Fk();function fre(r){return r&&r.__esModule?r:{default:r}}var cre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.getAdjMatrix).apply(void 0,[e,t])};Pn.getAdjMatrixAsync=cre;var hre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.connectedComponent).apply(void 0,[e,t])};Pn.connectedComponentAsync=hre;var dre=function(e){return(0,Ao.default)(Mo.ALGORITHM.getDegree)(e)};Pn.getDegreeAsync=dre;var pre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.getInDegree)(e,t)};Pn.getInDegreeAsync=pre;var vre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.getOutDegree)(e,t)};Pn.getOutDegreeAsync=vre;var mre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectCycle)(e)};Pn.detectCycleAsync=mre;var gre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectAllCycles)(e)};Pn.detectAllCyclesAsync=gre;var yre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectAllDirectedCycle)(e)};Pn.detectAllDirectedCycleAsync=yre;var xre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectAllUndirectedCycle)(e)};Pn.detectAllUndirectedCycleAsync=xre;var bre=function(e,t,n,i){return(0,Ao.default)(Mo.ALGORITHM.dijkstra).apply(void 0,[e,t,n,i])};Pn.dijkstraAsync=bre;var _re=function(e,t,n,i){return(0,Ao.default)(Mo.ALGORITHM.findAllPath).apply(void 0,[e,t,n,i])};Pn.findAllPathAsync=_re;var Sre=function(e,t,n,i,a){return(0,Ao.default)(Mo.ALGORITHM.findShortestPath).apply(void 0,[e,t,n,i,a])};Pn.findShortestPathAsync=Sre;var Cre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.floydWarshall).apply(void 0,[e,t])};Pn.floydWarshallAsync=Cre;var wre=function(e,t,n,i){return i===void 0&&(i=1e3),(0,Ao.default)(Mo.ALGORITHM.labelPropagation)(e,t,n,i)};Pn.labelPropagationAsync=wre;var Ere=function(e,t,n,i){return(0,Ao.default)(Mo.ALGORITHM.louvain)(e,t,n,i)};Pn.louvainAsync=Ere;var Are=function(e,t,n){return(0,Ao.default)(Mo.ALGORITHM.minimumSpanningTree).apply(void 0,[e,t,n])};Pn.minimumSpanningTreeAsync=Are;var Mre=function(e,t,n){return(0,Ao.default)(Mo.ALGORITHM.pageRank).apply(void 0,[e,t,n])};Pn.pageRankAsync=Mre;var Tre=function(e,t,n){return(0,Ao.default)(Mo.ALGORITHM.getNeighbors).apply(void 0,[e,t,n])};Pn.getNeighborsAsync=Tre;var Ire=function(e,t,n,i,a,o,s){return n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),(0,Ao.default)(Mo.ALGORITHM.GADDI).apply(void 0,[e,t,n,i,a,o,s])};Pn.GADDIAsync=Ire});var Wdt=ft(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});Object.defineProperty(ha,"GADDIAsync",{enumerable:!0,get:function(){return kn.GADDIAsync}});Object.defineProperty(ha,"connectedComponentAsync",{enumerable:!0,get:function(){return kn.connectedComponentAsync}});ha.default=void 0;Object.defineProperty(ha,"detectAllCyclesAsync",{enumerable:!0,get:function(){return kn.detectAllCyclesAsync}});Object.defineProperty(ha,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return kn.detectAllDirectedCycleAsync}});Object.defineProperty(ha,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return kn.detectAllUndirectedCycleAsync}});Object.defineProperty(ha,"detectCycleAsync",{enumerable:!0,get:function(){return kn.detectCycleAsync}});ha.detectDirectedCycleAsync=void 0;Object.defineProperty(ha,"dijkstraAsync",{enumerable:!0,get:function(){return kn.dijkstraAsync}});Object.defineProperty(ha,"findAllPathAsync",{enumerable:!0,get:function(){return kn.findAllPathAsync}});Object.defineProperty(ha,"findShortestPathAsync",{enumerable:!0,get:function(){return kn.findShortestPathAsync}});Object.defineProperty(ha,"floydWarshallAsync",{enumerable:!0,get:function(){return kn.floydWarshallAsync}});Object.defineProperty(ha,"getAdjMatrixAsync",{enumerable:!0,get:function(){return kn.getAdjMatrixAsync}});Object.defineProperty(ha,"getDegreeAsync",{enumerable:!0,get:function(){return kn.getDegreeAsync}});Object.defineProperty(ha,"getInDegreeAsync",{enumerable:!0,get:function(){return kn.getInDegreeAsync}});Object.defineProperty(ha,"getNeighborsAsync",{enumerable:!0,get:function(){return kn.getNeighborsAsync}});Object.defineProperty(ha,"getOutDegreeAsync",{enumerable:!0,get:function(){return kn.getOutDegreeAsync}});Object.defineProperty(ha,"labelPropagationAsync",{enumerable:!0,get:function(){return kn.labelPropagationAsync}});Object.defineProperty(ha,"louvainAsync",{enumerable:!0,get:function(){return kn.louvainAsync}});Object.defineProperty(ha,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return kn.minimumSpanningTreeAsync}});Object.defineProperty(ha,"pageRankAsync",{enumerable:!0,get:function(){return kn.pageRankAsync}});var kn=Udt(),jdt=kn.detectCycleAsync;ha.detectDirectedCycleAsync=jdt;var Lre={getAdjMatrixAsync:kn.getAdjMatrixAsync,connectedComponentAsync:kn.connectedComponentAsync,getDegreeAsync:kn.getDegreeAsync,getInDegreeAsync:kn.getInDegreeAsync,getOutDegreeAsync:kn.getOutDegreeAsync,detectCycleAsync:kn.detectCycleAsync,detectDirectedCycleAsync:jdt,detectAllCyclesAsync:kn.detectAllCyclesAsync,detectAllDirectedCycleAsync:kn.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:kn.detectAllUndirectedCycleAsync,dijkstraAsync:kn.dijkstraAsync,findAllPathAsync:kn.findAllPathAsync,findShortestPathAsync:kn.findShortestPathAsync,floydWarshallAsync:kn.floydWarshallAsync,labelPropagationAsync:kn.labelPropagationAsync,louvainAsync:kn.louvainAsync,minimumSpanningTreeAsync:kn.minimumSpanningTreeAsync,pageRankAsync:kn.pageRankAsync,getNeighborsAsync:kn.getNeighborsAsync,GADDIAsync:kn.GADDIAsync};ha.default=Lre});var C8=ft((CSr,Vdt)=>{"use strict";Vdt.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]}});var Ydt=ft((wSr,Hdt)=>{Hdt.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var Kdt=ft((ESr,qdt)=>{"use strict";var Ore=Ydt(),Dre=Array.prototype.concat,Pre=Array.prototype.slice,Xdt=qdt.exports=function(e){for(var t=[],n=0,i=e.length;n{var hM=C8(),dM=Kdt(),Zdt=Object.hasOwnProperty,$dt={};for(uR in hM)Zdt.call(hM,uR)&&($dt[hM[uR]]=uR);var uR,Au=Qdt.exports={to:{},get:{}};Au.get=function(r){var e=r.substring(0,3).toLowerCase(),t,n;switch(e){case"hsl":t=Au.get.hsl(r),n="hsl";break;case"hwb":t=Au.get.hwb(r),n="hwb";break;default:t=Au.get.rgb(r),n="rgb";break}return t?{model:n,value:t}:null};Au.get.rgb=function(r){if(!r)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],s,l,u;if(s=r.match(t)){for(u=s[2],s=s[1],l=0;l<3;l++){var f=l*2;o[l]=parseInt(s.slice(f,f+2),16)}u&&(o[3]=parseInt(u,16)/255)}else if(s=r.match(e)){for(s=s[1],u=s[3],l=0;l<3;l++)o[l]=parseInt(s[l]+s[l],16);u&&(o[3]=parseInt(u+u,16)/255)}else if(s=r.match(n)){for(l=0;l<3;l++)o[l]=parseInt(s[l+1],0);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else if(s=r.match(i)){for(l=0;l<3;l++)o[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else return(s=r.match(a))?s[1]==="transparent"?[0,0,0,0]:Zdt.call(hM,s[1])?(o=hM[s[1]],o[3]=1,o):null:null;for(l=0;l<3;l++)o[l]=gg(o[l],0,255);return o[3]=gg(o[3],0,1),o};Au.get.hsl=function(r){if(!r)return null;var e=/^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*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gg(parseFloat(t[2]),0,100),o=gg(parseFloat(t[3]),0,100),s=gg(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Au.get.hwb=function(r){if(!r)return null;var e=/^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*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gg(parseFloat(t[2]),0,100),o=gg(parseFloat(t[3]),0,100),s=gg(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Au.to.hex=function(){var r=dM(arguments);return"#"+fR(r[0])+fR(r[1])+fR(r[2])+(r[3]<1?fR(Math.round(r[3]*255)):"")};Au.to.rgb=function(){var r=dM(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};Au.to.rgb.percent=function(){var r=dM(arguments),e=Math.round(r[0]/255*100),t=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+e+"%, "+t+"%, "+n+"%)":"rgba("+e+"%, "+t+"%, "+n+"%, "+r[3]+")"};Au.to.hsl=function(){var r=dM(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};Au.to.hwb=function(){var r=dM(arguments),e="";return r.length>=4&&r[3]!==1&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"};Au.to.keyword=function(r){return $dt[r.slice(0,3)]};function gg(r,e,t){return Math.min(Math.max(e,r),t)}function fR(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var w8=ft((MSr,npt)=>{var z0=C8(),tpt={};for(cR in z0)z0.hasOwnProperty(cR)&&(tpt[z0[cR]]=cR);var cR,Ar=npt.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(tl in Ar)if(Ar.hasOwnProperty(tl)){if(!("channels"in Ar[tl]))throw new Error("missing channels property: "+tl);if(!("labels"in Ar[tl]))throw new Error("missing channel labels property: "+tl);if(Ar[tl].labels.length!==Ar[tl].channels)throw new Error("channel and label counts mismatch: "+tl);ept=Ar[tl].channels,rpt=Ar[tl].labels,delete Ar[tl].channels,delete Ar[tl].labels,Object.defineProperty(Ar[tl],"channels",{value:ept}),Object.defineProperty(Ar[tl],"labels",{value:rpt})}var ept,rpt,tl;Ar.rgb.hsl=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=a-i,s,l,u;return a===i?s=0:e===a?s=(t-n)/o:t===a?s=2+(n-e)/o:n===a&&(s=4+(e-t)/o),s=Math.min(s*60,360),s<0&&(s+=360),u=(i+a)/2,a===i?l=0:u<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,u*100]};Ar.rgb.hsv=function(r){var e,t,n,i,a,o=r[0]/255,s=r[1]/255,l=r[2]/255,u=Math.max(o,s,l),f=u-Math.min(o,s,l),c=function(h){return(u-h)/6/f+1/2};return f===0?i=a=0:(a=f/u,e=c(o),t=c(s),n=c(l),o===u?i=n-t:s===u?i=1/3+e-n:l===u&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,u*100]};Ar.rgb.hwb=function(r){var e=r[0],t=r[1],n=r[2],i=Ar.rgb.hsl(r)[0],a=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[i,a*100,n*100]};Ar.rgb.cmyk=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i,a,o,s;return s=Math.min(1-e,1-t,1-n),i=(1-e-s)/(1-s)||0,a=(1-t-s)/(1-s)||0,o=(1-n-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function kre(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}Ar.rgb.keyword=function(r){var e=tpt[r];if(e)return e;var t=1/0,n;for(var i in z0)if(z0.hasOwnProperty(i)){var a=z0[i],o=kre(r,a);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+t*.3576+n*.1805,a=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[i*100,a*100,o*100]};Ar.rgb.lab=function(r){var e=Ar.rgb.xyz(r),t=e[0],n=e[1],i=e[2],a,o,s;return t/=95.047,n/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*n-16,o=500*(t-n),s=200*(n-i),[a,o,s]};Ar.hsl.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i,a,o,s,l;if(t===0)return l=n*255,[l,l,l];n<.5?a=n*(1+t):a=n+t-n*t,i=2*n-a,s=[0,0,0];for(var u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[u]=l*255;return s};Ar.hsl.hsv=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=t,a=Math.max(n,.01),o,s;return n*=2,t*=n<=1?n:2-n,i*=a<=1?a:2-a,s=(n+t)/2,o=n===0?2*i/(a+i):2*t/(n+t),[e,o*100,s*100]};Ar.hsv.rgb=function(r){var e=r[0]/60,t=r[1]/100,n=r[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*n*(1-t),s=255*n*(1-t*a),l=255*n*(1-t*(1-a));switch(n*=255,i){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}};Ar.hsv.hsl=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=Math.max(n,.01),a,o,s;return s=(2-t)*n,a=(2-t)*i,o=t*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};Ar.hwb.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i=t+n,a,o,s,l;i>1&&(t/=i,n/=i),a=Math.floor(6*e),o=1-n,s=6*e-a,(a&1)!=0&&(s=1-s),l=t+s*(o-t);var u,f,c;switch(a){default:case 6:case 0:u=o,f=l,c=t;break;case 1:u=l,f=o,c=t;break;case 2:u=t,f=o,c=l;break;case 3:u=t,f=l,c=o;break;case 4:u=l,f=t,c=o;break;case 5:u=o,f=t,c=l;break}return[u*255,f*255,c*255]};Ar.cmyk.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i=r[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,n*(1-i)+i),[a*255,o*255,s*255]};Ar.xyz.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i,a,o;return i=e*3.2406+t*-1.5372+n*-.4986,a=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};Ar.xyz.lab=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;return e/=95.047,t/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*t-16,a=500*(e-t),o=200*(t-n),[i,a,o]};Ar.lab.xyz=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;a=(e+16)/116,i=t/500+a,o=a-n/200;var s=Math.pow(a,3),l=Math.pow(i,3),u=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};Ar.lab.lch=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;return i=Math.atan2(n,t),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(t*t+n*n),[e,o,a]};Ar.lch.lab=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;return o=n/360*2*Math.PI,i=t*Math.cos(o),a=t*Math.sin(o),[e,i,a]};Ar.rgb.ansi16=function(r){var e=r[0],t=r[1],n=r[2],i=1 in arguments?arguments[1]:Ar.rgb.hsv(r)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};Ar.hsv.ansi16=function(r){return Ar.rgb.ansi16(Ar.hsv.rgb(r),r[2])};Ar.rgb.ansi256=function(r){var e=r[0],t=r[1],n=r[2];if(e===t&&t===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return i};Ar.ansi16.rgb=function(r){var e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(r>50)+1)*.5,n=(e&1)*t*255,i=(e>>1&1)*t*255,a=(e>>2&1)*t*255;return[n,i,a]};Ar.ansi256.rgb=function(r){if(r>=232){var e=(r-232)*10+8;return[e,e,e]}r-=16;var t,n=Math.floor(r/36)/5*255,i=Math.floor((t=r%36)/6)/5*255,a=t%6/5*255;return[n,i,a]};Ar.rgb.hex=function(r){var e=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};Ar.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(s){return s+s}).join(""));var n=parseInt(t,16),i=n>>16&255,a=n>>8&255,o=n&255;return[i,a,o]};Ar.rgb.hcg=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.max(Math.max(e,t),n),a=Math.min(Math.min(e,t),n),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(t-n)/o%6:i===t?l=2+(n-e)/o:l=4+(e-t)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};Ar.hsl.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1,i=0;return t<.5?n=2*e*t:n=2*e*(1-t),n<1&&(i=(t-.5*n)/(1-n)),[r[0],n*100,i*100]};Ar.hsv.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=e*t,i=0;return n<1&&(i=(t-n)/(1-n)),[r[0],n*100,i*100]};Ar.hcg.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100;if(t===0)return[n*255,n*255,n*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-t)*n,[(t*i[0]+l)*255,(t*i[1]+l)*255,(t*i[2]+l)*255]};Ar.hcg.hsv=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e),i=0;return n>0&&(i=e/n),[r[0],i*100,n*100]};Ar.hcg.hsl=function(r){var e=r[1]/100,t=r[2]/100,n=t*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[r[0],i*100,n*100]};Ar.hcg.hwb=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e);return[r[0],(n-e)*100,(1-n)*100]};Ar.hwb.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1-t,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[r[0],i*100,a*100]};Ar.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};Ar.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};Ar.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};Ar.gray.hsl=Ar.gray.hsv=function(r){return[0,0,r[0]]};Ar.gray.hwb=function(r){return[0,100,r[0]]};Ar.gray.cmyk=function(r){return[0,0,0,r[0]]};Ar.gray.lab=function(r){return[r[0],0,0]};Ar.gray.hex=function(r){var e=Math.round(r[0]/100*255)&255,t=(e<<16)+(e<<8)+e,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};Ar.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}});var apt=ft((TSr,ipt)=>{var hR=w8();function Rre(){for(var r={},e=Object.keys(hR),t=e.length,n=0;n{var E8=w8(),Gre=apt(),z_={},zre=Object.keys(E8);function Ure(r){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function jre(r){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=r(t);if(typeof n=="object")for(var i=n.length,a=0;a{"use strict";var pM=Jdt(),Mu=spt(),A8=[].slice,lpt=["keyword","gray","hex"],M8={};Object.keys(Mu).forEach(function(r){M8[A8.call(Mu[r].labels).sort().join("")]=r});var dR={};function cs(r,e){if(!(this instanceof cs))return new cs(r,e);if(e&&e in lpt&&(e=null),e&&!(e in Mu))throw new Error("Unknown model: "+e);var t,n;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof cs)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if(typeof r=="string"){var i=pM.get(r);if(i===null)throw new Error("Unable to parse color from string: "+r);this.model=i.model,n=Mu[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(r.length){this.model=e||"rgb",n=Mu[this.model].channels;var a=A8.call(r,0,n);this.color=T8(a,n),this.valpha=typeof r[n]=="number"?r[n]:1}else if(typeof r=="number")r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;var o=Object.keys(r);"alpha"in r&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);var s=o.sort().join("");if(!(s in M8))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=M8[s];var l=Mu[this.model].labels,u=[];for(t=0;tt?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(r){var e=this.contrast(r);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,e=(r[0]*299+r[1]*587+r[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten:function(r){var e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken:function(r){var e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate:function(r){var e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate:function(r){var e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten:function(r){var e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken:function(r){var e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale:function(){var r=this.rgb().color,e=r[0]*.3+r[1]*.59+r[2]*.11;return cs.rgb(e,e,e)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var e=this.hsl(),t=e.color[0];return t=(t+r)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var t=r.rgb(),n=this.rgb(),i=e===void 0?.5:e,a=2*i-1,o=t.alpha()-n.alpha(),s=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return cs.rgb(s*t.red()+l*n.red(),s*t.green()+l*n.green(),s*t.blue()+l*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};Object.keys(Mu).forEach(function(r){if(lpt.indexOf(r)===-1){var e=Mu[r].channels;cs.prototype[r]=function(){if(this.model===r)return new cs(this);if(arguments.length)return new cs(arguments,r);var t=typeof arguments[e]=="number"?e:this.valpha;return new cs(Hre(Mu[this.model][r].raw(this.color)).concat(t),r)},cs[r]=function(t){return typeof t=="number"&&(t=T8(A8.call(arguments),e)),new cs(t,r)}}});function Wre(r,e){return Number(r.toFixed(e))}function Vre(r){return function(e){return Wre(e,r)}}function Wa(r,e,t){return r=Array.isArray(r)?r:[r],r.forEach(function(n){(dR[n]||(dR[n]=[]))[e]=t}),r=r[0],function(n){var i;return arguments.length?(t&&(n=t(n)),i=this[r](),i.color[e]=n,i):(i=this[r]().color[e],t&&(i=t(i)),i)}}function To(r){return function(e){return Math.max(0,Math.min(r,e))}}function Hre(r){return Array.isArray(r)?r:[r]}function T8(r,e){for(var t=0;t{(function(r){var e=/^\s+/,t=/\s+$/,n=0,i=r.round,a=r.min,o=r.max,s=r.random;function l(Y,it){if(Y=Y||"",it=it||{},Y instanceof l)return Y;if(!(this instanceof l))return new l(Y,it);var K=u(Y);this._originalInput=Y,this._r=K.r,this._g=K.g,this._b=K.b,this._a=K.a,this._roundA=i(100*this._a)/100,this._format=it.format||K.format,this._gradientType=it.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=K.ok,this._tc_id=n++}l.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 Y=this.toRgb();return(Y.r*299+Y.g*587+Y.b*114)/1e3},getLuminance:function(){var Y=this.toRgb(),it,K,Rt,Xt,Zt,Ae;return it=Y.r/255,K=Y.g/255,Rt=Y.b/255,it<=.03928?Xt=it/12.92:Xt=r.pow((it+.055)/1.055,2.4),K<=.03928?Zt=K/12.92:Zt=r.pow((K+.055)/1.055,2.4),Rt<=.03928?Ae=Rt/12.92:Ae=r.pow((Rt+.055)/1.055,2.4),.2126*Xt+.7152*Zt+.0722*Ae},setAlpha:function(Y){return this._a=U(Y),this._roundA=i(100*this._a)/100,this},toHsv:function(){var Y=d(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,v:Y.v,a:this._a}},toHsvString:function(){var Y=d(this._r,this._g,this._b),it=i(Y.h*360),K=i(Y.s*100),Rt=i(Y.v*100);return this._a==1?"hsv("+it+", "+K+"%, "+Rt+"%)":"hsva("+it+", "+K+"%, "+Rt+"%, "+this._roundA+")"},toHsl:function(){var Y=c(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,l:Y.l,a:this._a}},toHslString:function(){var Y=c(this._r,this._g,this._b),it=i(Y.h*360),K=i(Y.s*100),Rt=i(Y.l*100);return this._a==1?"hsl("+it+", "+K+"%, "+Rt+"%)":"hsla("+it+", "+K+"%, "+Rt+"%, "+this._roundA+")"},toHex:function(Y){return v(this._r,this._g,this._b,Y)},toHexString:function(Y){return"#"+this.toHex(Y)},toHex8:function(Y){return m(this._r,this._g,this._b,this._a,Y)},toHex8String:function(Y){return"#"+this.toHex8(Y)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(j(this._r,255)*100)+"%",g:i(j(this._g,255)*100)+"%",b:i(j(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+i(j(this._r,255)*100)+"%, "+i(j(this._g,255)*100)+"%, "+i(j(this._b,255)*100)+"%)":"rgba("+i(j(this._r,255)*100)+"%, "+i(j(this._g,255)*100)+"%, "+i(j(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:D[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(Y){var it="#"+g(this._r,this._g,this._b,this._a),K=it,Rt=this._gradientType?"GradientType = 1, ":"";if(Y){var Xt=l(Y);K="#"+g(Xt._r,Xt._g,Xt._b,Xt._a)}return"progid:DXImageTransform.Microsoft.gradient("+Rt+"startColorstr="+it+",endColorstr="+K+")"},toString:function(Y){var it=!!Y;Y=Y||this._format;var K=!1,Rt=this._a<1&&this._a>=0,Xt=!it&&Rt&&(Y==="hex"||Y==="hex6"||Y==="hex3"||Y==="hex4"||Y==="hex8"||Y==="name");return Xt?Y==="name"&&this._a===0?this.toName():this.toRgbString():(Y==="rgb"&&(K=this.toRgbString()),Y==="prgb"&&(K=this.toPercentageRgbString()),(Y==="hex"||Y==="hex6")&&(K=this.toHexString()),Y==="hex3"&&(K=this.toHexString(!0)),Y==="hex4"&&(K=this.toHex8String(!0)),Y==="hex8"&&(K=this.toHex8String()),Y==="name"&&(K=this.toName()),Y==="hsl"&&(K=this.toHslString()),Y==="hsv"&&(K=this.toHsvString()),K||this.toHexString())},clone:function(){return l(this.toString())},_applyModification:function(Y,it){var K=Y.apply(null,[this].concat([].slice.call(it)));return this._r=K._r,this._g=K._g,this._b=K._b,this.setAlpha(K._a),this},lighten:function(){return this._applyModification(C,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(L,arguments)},_applyCombination:function(Y,it){return Y.apply(null,[this].concat([].slice.call(it)))},analogous:function(){return this._applyCombination(R,arguments)},complement:function(){return this._applyCombination(k,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(I,arguments)},triad:function(){return this._applyCombination(O,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},l.fromRatio=function(Y,it){if(typeof Y=="object"){var K={};for(var Rt in Y)Y.hasOwnProperty(Rt)&&(Rt==="a"?K[Rt]=Y[Rt]:K[Rt]=st(Y[Rt]));Y=K}return l(Y,it)};function u(Y){var it={r:0,g:0,b:0},K=1,Rt=null,Xt=null,Zt=null,Ae=!1,We=!1;return typeof Y=="string"&&(Y=Ut(Y)),typeof Y=="object"&&(Tt(Y.r)&&Tt(Y.g)&&Tt(Y.b)?(it=f(Y.r,Y.g,Y.b),Ae=!0,We=String(Y.r).substr(-1)==="%"?"prgb":"rgb"):Tt(Y.h)&&Tt(Y.s)&&Tt(Y.v)?(Rt=st(Y.s),Xt=st(Y.v),it=p(Y.h,Rt,Xt),Ae=!0,We="hsv"):Tt(Y.h)&&Tt(Y.s)&&Tt(Y.l)&&(Rt=st(Y.s),Zt=st(Y.l),it=h(Y.h,Rt,Zt),Ae=!0,We="hsl"),Y.hasOwnProperty("a")&&(K=Y.a)),K=U(K),{ok:Ae,format:Y.format||We,r:a(255,o(it.r,0)),g:a(255,o(it.g,0)),b:a(255,o(it.b,0)),a:K}}function f(Y,it,K){return{r:j(Y,255)*255,g:j(it,255)*255,b:j(K,255)*255}}function c(Y,it,K){Y=j(Y,255),it=j(it,255),K=j(K,255);var Rt=o(Y,it,K),Xt=a(Y,it,K),Zt,Ae,We=(Rt+Xt)/2;if(Rt==Xt)Zt=Ae=0;else{var $e=Rt-Xt;switch(Ae=We>.5?$e/(2-Rt-Xt):$e/(Rt+Xt),Rt){case Y:Zt=(it-K)/$e+(it1&&(ne-=1),ne<1/6?W+(Te-W)*6*ne:ne<1/2?Te:ne<2/3?W+(Te-W)*(2/3-ne)*6:W}if(it===0)Rt=Xt=Zt=K;else{var We=K<.5?K*(1+it):K+it-K*it,$e=2*K-We;Rt=Ae($e,We,Y+1/3),Xt=Ae($e,We,Y),Zt=Ae($e,We,Y-1/3)}return{r:Rt*255,g:Xt*255,b:Zt*255}}function d(Y,it,K){Y=j(Y,255),it=j(it,255),K=j(K,255);var Rt=o(Y,it,K),Xt=a(Y,it,K),Zt,Ae,We=Rt,$e=Rt-Xt;if(Ae=Rt===0?0:$e/Rt,Rt==Xt)Zt=0;else{switch(Rt){case Y:Zt=(it-K)/$e+(it>1)+720)%360;--it;)Rt.h=(Rt.h+Xt)%360,Zt.push(l(Rt));return Zt}function P(Y,it){it=it||6;for(var K=l(Y).toHsv(),Rt=K.h,Xt=K.s,Zt=K.v,Ae=[],We=1/it;it--;)Ae.push(l({h:Rt,s:Xt,v:Zt})),Zt=(Zt+We)%1;return Ae}l.mix=function(Y,it,K){K=K===0?0:K||50;var Rt=l(Y).toRgb(),Xt=l(it).toRgb(),Zt=K/100,Ae={r:(Xt.r-Rt.r)*Zt+Rt.r,g:(Xt.g-Rt.g)*Zt+Rt.g,b:(Xt.b-Rt.b)*Zt+Rt.b,a:(Xt.a-Rt.a)*Zt+Rt.a};return l(Ae)},l.readability=function(Y,it){var K=l(Y),Rt=l(it);return(r.max(K.getLuminance(),Rt.getLuminance())+.05)/(r.min(K.getLuminance(),Rt.getLuminance())+.05)},l.isReadable=function(Y,it,K){var Rt=l.readability(Y,it),Xt,Zt;switch(Zt=!1,Xt=$t(K),Xt.level+Xt.size){case"AAsmall":case"AAAlarge":Zt=Rt>=4.5;break;case"AAlarge":Zt=Rt>=3;break;case"AAAsmall":Zt=Rt>=7;break}return Zt},l.mostReadable=function(Y,it,K){var Rt=null,Xt=0,Zt,Ae,We,$e;K=K||{},Ae=K.includeFallbackColors,We=K.level,$e=K.size;for(var W=0;WXt&&(Xt=Zt,Rt=l(it[W]));return l.isReadable(Y,Rt,{level:We,size:$e})||!Ae?Rt:(K.includeFallbackColors=!1,l.mostReadable(Y,["#fff","#000"],K))};var F=l.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"},D=l.hexNames=G(F);function G(Y){var it={};for(var K in Y)Y.hasOwnProperty(K)&&(it[Y[K]]=K);return it}function U(Y){return Y=parseFloat(Y),(isNaN(Y)||Y<0||Y>1)&&(Y=1),Y}function j(Y,it){et(Y)&&(Y="100%");var K=ut(Y);return Y=a(it,o(0,parseFloat(Y))),K&&(Y=parseInt(Y*it,10)/100),r.abs(Y-it)<1e-6?1:Y%it/parseFloat(it)}function H(Y){return a(1,o(0,Y))}function tt(Y){return parseInt(Y,16)}function et(Y){return typeof Y=="string"&&Y.indexOf(".")!=-1&&parseFloat(Y)===1}function ut(Y){return typeof Y=="string"&&Y.indexOf("%")!=-1}function $(Y){return Y.length==1?"0"+Y:""+Y}function st(Y){return Y<=1&&(Y=Y*100+"%"),Y}function _t(Y){return r.round(parseFloat(Y)*255).toString(16)}function dt(Y){return tt(Y)/255}var gt=function(){var Y="[-\\+]?\\d+%?",it="[-\\+]?\\d*\\.\\d+%?",K="(?:"+it+")|(?:"+Y+")",Rt="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?",Xt="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?";return{CSS_UNIT:new RegExp(K),rgb:new RegExp("rgb"+Rt),rgba:new RegExp("rgba"+Xt),hsl:new RegExp("hsl"+Rt),hsla:new RegExp("hsla"+Xt),hsv:new RegExp("hsv"+Rt),hsva:new RegExp("hsva"+Xt),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 Tt(Y){return!!gt.CSS_UNIT.exec(Y)}function Ut(Y){Y=Y.replace(e,"").replace(t,"").toLowerCase();var it=!1;if(F[Y])Y=F[Y],it=!0;else if(Y=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var K;return(K=gt.rgb.exec(Y))?{r:K[1],g:K[2],b:K[3]}:(K=gt.rgba.exec(Y))?{r:K[1],g:K[2],b:K[3],a:K[4]}:(K=gt.hsl.exec(Y))?{h:K[1],s:K[2],l:K[3]}:(K=gt.hsla.exec(Y))?{h:K[1],s:K[2],l:K[3],a:K[4]}:(K=gt.hsv.exec(Y))?{h:K[1],s:K[2],v:K[3]}:(K=gt.hsva.exec(Y))?{h:K[1],s:K[2],v:K[3],a:K[4]}:(K=gt.hex8.exec(Y))?{r:tt(K[1]),g:tt(K[2]),b:tt(K[3]),a:dt(K[4]),format:it?"name":"hex8"}:(K=gt.hex6.exec(Y))?{r:tt(K[1]),g:tt(K[2]),b:tt(K[3]),format:it?"name":"hex"}:(K=gt.hex4.exec(Y))?{r:tt(K[1]+""+K[1]),g:tt(K[2]+""+K[2]),b:tt(K[3]+""+K[3]),a:dt(K[4]+""+K[4]),format:it?"name":"hex8"}:(K=gt.hex3.exec(Y))?{r:tt(K[1]+""+K[1]),g:tt(K[2]+""+K[2]),b:tt(K[3]+""+K[3]),format:it?"name":"hex"}:!1}function $t(Y){var it,K;return Y=Y||{level:"AA",size:"small"},it=(Y.level||"AA").toUpperCase(),K=(Y.size||"small").toLowerCase(),it!=="AA"&&it!=="AAA"&&(it="AA"),K!=="small"&&K!=="large"&&(K="small"),{level:it,size:K}}typeof pR!="undefined"&&pR.exports?pR.exports=l:typeof define=="function"&&define.amd?define(function(){return l}):window.tinycolor=l})(Math)});var Ypt=ft((q_,CM)=>{(function(){var r,e="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",o="__lodash_hash_undefined__",s=500,l="__lodash_placeholder__",u=1,f=2,c=4,h=1,d=2,p=1,v=2,m=4,g=8,x=16,b=32,S=64,C=128,w=256,A=512,L=30,k="...",O=800,M=16,I=1,R=2,P=3,F=1/0,D=9007199254740991,G=17976931348623157e292,U=0/0,j=4294967295,H=j-1,tt=j>>>1,et=[["ary",C],["bind",p],["bindKey",v],["curry",g],["curryRight",x],["flip",A],["partial",b],["partialRight",S],["rearg",w]],ut="[object Arguments]",$="[object Array]",st="[object AsyncFunction]",_t="[object Boolean]",dt="[object Date]",gt="[object DOMException]",Tt="[object Error]",Ut="[object Function]",$t="[object GeneratorFunction]",Y="[object Map]",it="[object Number]",K="[object Null]",Rt="[object Object]",Xt="[object Promise]",Zt="[object Proxy]",Ae="[object RegExp]",We="[object Set]",$e="[object String]",W="[object Symbol]",Te="[object Undefined]",ne="[object WeakMap]",pt="[object WeakSet]",Et="[object ArrayBuffer]",St="[object DataView]",Wt="[object Float32Array]",ee="[object Float64Array]",Ue="[object Int8Array]",Ht="[object Int16Array]",ae="[object Int32Array]",ge="[object Uint8Array]",Ye="[object Uint8ClampedArray]",Ve="[object Uint16Array]",$n="[object Uint32Array]",ga=/\b__p \+= '';/g,_n=/\b(__p \+=) '' \+/g,ii=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xi=/&(?:amp|lt|gt|quot|#39);/g,Ki=/[&<>"']/g,En=RegExp(xi.source),ci=RegExp(Ki.source),Nn=/<%-([\s\S]+?)%>/g,Ia=/<%([\s\S]+?)%>/g,Li=/<%=([\s\S]+?)%>/g,ko=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ku=/^\w*$/,Ro=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ys=/[\\^$.*+?()[\]{}|]/g,Jo=RegExp(ys.source),vl=/^\s+/,Fs=/\s/,yo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Oi=/\{\n\/\* \[wrapped with (.+)\] \*/,xs=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ai=/[()=,{}\[\]\/\s]/,vn=/\\(\\)?/g,ji=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,La=/\w*$/,Lf=/^[-+]0x[0-9a-f]+$/i,Of=/^0b[01]+$/i,eu=/^\[object .+?Constructor\]$/,Df=/^0o[0-7]+$/i,Pf=/^(?:0|[1-9]\d*)$/,kf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pv=/($^)/,uC=/['\n\r\u2028\u2029\\]/g,vv="\\ud800-\\udfff",fC="\\u0300-\\u036f",cC="\\ufe20-\\ufe2f",RF="\\u20d0-\\u20ff",CT=fC+cC+RF,wT="\\u2700-\\u27bf",ET="a-z\\xdf-\\xf6\\xf8-\\xff",NF="\\xac\\xb1\\xd7\\xf7",FF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BF="\\u2000-\\u206f",GF=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",AT="A-Z\\xc0-\\xd6\\xd8-\\xde",MT="\\ufe0e\\ufe0f",TT=NF+FF+BF+GF,hC="['\u2019]",xx="["+vv+"]",dC="["+TT+"]",bx="["+CT+"]",IT="\\d+",Kg="["+wT+"]",_x="["+ET+"]",pC="[^"+vv+TT+IT+wT+ET+AT+"]",Zg="\\ud83c[\\udffb-\\udfff]",zF="(?:"+bx+"|"+Zg+")",LT="[^"+vv+"]",vC="(?:\\ud83c[\\udde6-\\uddff]){2}",mC="[\\ud800-\\udbff][\\udc00-\\udfff]",No="["+AT+"]",bs="\\u200d",$g="(?:"+_x+"|"+pC+")",UF="(?:"+No+"|"+pC+")",OT="(?:"+hC+"(?:d|ll|m|re|s|t|ve))?",gC="(?:"+hC+"(?:D|LL|M|RE|S|T|VE))?",yC=zF+"?",DT="["+MT+"]?",jF="(?:"+bs+"(?:"+[LT,vC,mC].join("|")+")"+DT+yC+")*",xC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",WF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",PT=DT+yC+jF,VF="(?:"+[Kg,vC,mC].join("|")+")"+PT,HF="(?:"+[LT+bx+"?",bx,vC,mC,xx].join("|")+")",YF=RegExp(hC,"g"),XF=RegExp(bx,"g"),bC=RegExp(Zg+"(?="+Zg+")|"+HF+PT,"g"),qF=RegExp([No+"?"+_x+"+"+OT+"(?="+[dC,No,"$"].join("|")+")",UF+"+"+gC+"(?="+[dC,No+$g,"$"].join("|")+")",No+"?"+$g+"+"+OT,No+"+"+gC,WF,xC,IT,VF].join("|"),"g"),_d=RegExp("["+bs+vv+CT+MT+"]"),KF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ZF=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Sx=-1,Di={};Di[Wt]=Di[ee]=Di[Ue]=Di[Ht]=Di[ae]=Di[ge]=Di[Ye]=Di[Ve]=Di[$n]=!0,Di[ut]=Di[$]=Di[Et]=Di[_t]=Di[St]=Di[dt]=Di[Tt]=Di[Ut]=Di[Y]=Di[it]=Di[Rt]=Di[Ae]=Di[We]=Di[$e]=Di[ne]=!1;var Pi={};Pi[ut]=Pi[$]=Pi[Et]=Pi[St]=Pi[_t]=Pi[dt]=Pi[Wt]=Pi[ee]=Pi[Ue]=Pi[Ht]=Pi[ae]=Pi[Y]=Pi[it]=Pi[Rt]=Pi[Ae]=Pi[We]=Pi[$e]=Pi[W]=Pi[ge]=Pi[Ye]=Pi[Ve]=Pi[$n]=!0,Pi[Tt]=Pi[Ut]=Pi[ne]=!1;var kT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},$F={"&":"&","<":"<",">":">",'"':""","'":"'"},_C={"&":"&","<":"<",">":">",""":'"',"'":"'"},SC={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rc=parseFloat,Cx=parseInt,CC=typeof global=="object"&&global&&global.Object===Object&&global,RT=typeof self=="object"&&self&&self.Object===Object&&self,Ja=CC||RT||Function("return this")(),wC=typeof q_=="object"&&q_&&!q_.nodeType&&q_,Sd=wC&&typeof CM=="object"&&CM&&!CM.nodeType&&CM,NT=Sd&&Sd.exports===wC,EC=NT&&CC.process,ml=function(){try{var kt=Sd&&Sd.require&&Sd.require("util").types;return kt||EC&&EC.binding&&EC.binding("util")}catch(de){}}(),FT=ml&&ml.isArrayBuffer,Cd=ml&&ml.isDate,BT=ml&&ml.isMap,GT=ml&&ml.isRegExp,mv=ml&&ml.isSet,zT=ml&&ml.isTypedArray;function to(kt,de,te){switch(te.length){case 0:return kt.call(de);case 1:return kt.call(de,te[0]);case 2:return kt.call(de,te[0],te[1]);case 3:return kt.call(de,te[0],te[1],te[2])}return kt.apply(de,te)}function UT(kt,de,te,pr){for(var fn=-1,Qn=kt==null?0:kt.length;++fn-1}function AC(kt,de,te){for(var pr=-1,fn=kt==null?0:kt.length;++pr-1;);return te}function Ix(kt,de){for(var te=kt.length;te--&&Nf(de,kt[te],0)>-1;);return te}function xv(kt,de){for(var te=kt.length,pr=0;te--;)kt[te]===de&&++pr;return pr}var OC=yv(kT),DC=yv($F);function PC(kt){return"\\"+SC[kt]}function kC(kt,de){return kt==null?r:kt[de]}function Ad(kt){return _d.test(kt)}function HT(kt){return KF.test(kt)}function YT(kt){for(var de,te=[];!(de=kt.next()).done;)te.push(de.value);return te}function Lx(kt){var de=-1,te=Array(kt.size);return kt.forEach(function(pr,fn){te[++de]=[fn,pr]}),te}function RC(kt,de){return function(te){return kt(de(te))}}function Ff(kt,de){for(var te=-1,pr=kt.length,fn=0,Qn=[];++te-1}function CB(y,_){var T=this.__data__,N=Rd(T,y);return N<0?(++this.size,T.push([y,_])):T[N][1]=_,this}iu.prototype.clear=Gx,iu.prototype.delete=bB,iu.prototype.get=_B,iu.prototype.has=SB,iu.prototype.set=CB;function zf(y){var _=-1,T=y==null?0:y.length;for(this.clear();++_=_?y:_)),y}function bo(y,_,T,N,X,at){var bt,At=_&u,Bt=_&f,Se=_&c;if(T&&(bt=X?T(y,N,X,at):T(y)),bt!==r)return bt;if(!Pa(y))return y;var we=bn(y);if(we){if(bt=Be(y),!At)return _s(y,bt)}else{var Ne=le(y),ar=Ne==Ut||Ne==$t;if(zv(y))return Bv(y,At);if(Ne==Rt||Ne==ut||ar&&!X){if(bt=Bt||ar?{}:me(y),!At)return Bt?bI(y,Iv(bt,y)):Kc(y,Nd(bt,y))}else{if(!Pi[Ne])return X?y:{};bt=Pe(y,Ne,At)}}at||(at=new au);var Mr=at.get(y);if(Mr)return Mr;at.set(y,bt),x9(y)?y.forEach(function(Qr){bt.add(bo(Qr,_,T,Qr,y,at))}):g9(y)&&y.forEach(function(Qr,Wn){bt.set(Wn,bo(Qr,_,T,Wn,y,at))});var $r=Se?Bt?sw:ow:Bt?Sl:zo,On=we?r:$r(y);return xo(On||y,function(Qr,Wn){On&&(Wn=Qr,Qr=y[Wn]),uy(bt,Wn,bo(Qr,_,T,Wn,y,at))}),bt}function YC(y){var _=zo(y);return function(T){return zx(T,y,_)}}function zx(y,_,T){var N=T.length;if(y==null)return!N;for(y=hi(y);N--;){var X=T[N],at=_[X],bt=y[X];if(bt===r&&!(X in y)||!at(bt))return!1}return!0}function Ux(y,_,T){if(typeof y!="function")throw new gl(i);return yn(function(){y.apply(r,T)},_)}function Fd(y,_,T,N){var X=-1,at=wx,bt=!0,At=y.length,Bt=[],Se=_.length;if(!At)return Bt;T&&(_=Zi(_,Bs(T))),N?(at=AC,bt=!1):_.length>=t&&(at=Fc,bt=!1,_=new Pd(_));t:for(;++XX?0:X+T),N=N===r||N>X?X:Mn(N),N<0&&(N+=X),N=T>N?0:_9(N);T0&&T(At)?_>1?eo(At,_-1,T,N,X):Rf(X,At):N||(X[X.length]=At)}return X}var hy=tw(),jx=tw(!0);function ou(y,_){return y&&hy(y,_,zo)}function Wx(y,_){return y&&jx(y,_,zo)}function dy(y,_){return Ru(_,function(T){return Kd(y[T])})}function Vc(y,_){_=su(_,y);for(var T=0,N=_.length;y!=null&&T_}function qC(y,_){return y!=null&&Jn.call(y,_)}function KC(y,_){return y!=null&&_ in hi(y)}function uI(y,_,T){return y>=Fo(_,T)&&y=120&&we.length>=120)?new Pd(bt&&we):r}we=y[0];var Ne=-1,ar=At[0];t:for(;++Ne-1;)At!==y&&ay.call(At,Bt,1),ay.call(y,Bt,1);return y}function QC(y,_){for(var T=y?_.length:0,N=T-1;T--;){var X=_[T];if(T==N||X!==at){var at=X;pe(X)?ay.call(y,X,1):kv(y,X)}}return y}function Zx(y,_){return y+Cv(jC()*(_-y+1))}function RB(y,_,T,N){for(var X=-1,at=ya(kx((_-y)/(T||1)),0),bt=te(at);at--;)bt[N?at:++X]=y,y+=T;return bt}function Xc(y,_){var T="";if(!y||_<1||_>D)return T;do _%2&&(T+=y),_=Cv(_/2),_&&(y+=y);while(_);return T}function An(y,_){return $i(Vr(y,_,Cl),y+"")}function NB(y){return oI(ob(y))}function FB(y,_){var T=ob(y);return Qi(T,Wc(_,0,T.length))}function Pv(y,_,T,N){if(!Pa(y))return y;_=su(_,y);for(var X=-1,at=_.length,bt=at-1,At=y;At!=null&&++XX?0:X+_),T=T>X?X:T,T<0&&(T+=X),X=_>T?0:T-_>>>0,_>>>=0;for(var at=te(X);++N>>1,bt=y[at];bt!==null&&!cu(bt)&&(T?bt<=_:bt<_)?N=at+1:X=at}return X}return JC(y,_,Cl,T)}function JC(y,_,T,N){var X=0,at=y==null?0:y.length;if(at===0)return 0;_=T(_);for(var bt=_!==_,At=_===null,Bt=cu(_),Se=_===r;X=t){var Se=_?null:jB(y);if(Se)return ty(Se);bt=!1,X=Fc,Bt=new Pd}else Bt=_?[]:At;t:for(;++N=N?y:xl(y,_,T)}var Fv=lB||function(y){return Ja.clearTimeout(y)};function Bv(y,_){if(_)return y.slice();var T=y.length,N=GC?GC(T):new y.constructor(T);return y.copy(N),N}function Vd(y){var _=new y.constructor(y.byteLength);return new iy(_).set(new iy(y)),_}function Cy(y,_){var T=_?Vd(y.buffer):y.buffer;return new y.constructor(T,y.byteOffset,y.byteLength)}function wy(y){var _=new y.constructor(y.source,La.exec(y));return _.lastIndex=y.lastIndex,_}function gI(y){return Mv?hi(Mv.call(y)):{}}function Gv(y,_){var T=_?Vd(y.buffer):y.buffer;return new y.constructor(T,y.byteOffset,y.length)}function qc(y,_){if(y!==_){var T=y!==r,N=y===null,X=y===y,at=cu(y),bt=_!==r,At=_===null,Bt=_===_,Se=cu(_);if(!At&&!Se&&!at&&y>_||at&&bt&&Bt&&!At&&!Se||N&&bt&&Bt||!T&&Bt||!X)return 1;if(!N&&!at&&!Se&&y<_||Se&&T&&X&&!N&&!at||At&&T&&X||!bt&&X||!Bt)return-1}return 0}function yI(y,_,T){for(var N=-1,X=y.criteria,at=_.criteria,bt=X.length,At=T.length;++N=At)return Bt;var Se=T[N];return Bt*(Se=="desc"?-1:1)}}return y.index-_.index}function tb(y,_,T,N){for(var X=-1,at=y.length,bt=T.length,At=-1,Bt=_.length,Se=ya(at-bt,0),we=te(Bt+Se),Ne=!N;++At1?T[X-1]:r,bt=X>2?T[2]:r;for(at=y.length>3&&typeof at=="function"?(X--,at):r,bt&&Le(T[0],T[1],bt)&&(at=X<3?r:at,X=1),_=hi(_);++N-1?X[at?_[bt]:bt]:r}}function eb(y){return Uu(function(_){var T=_.length,N=T,X=yl.prototype.thru;for(y&&_.reverse();N--;){var at=_[N];if(typeof at!="function")throw new gl(i);if(X&&!bt&&ib(at)=="wrapper")var bt=new yl([],!0)}for(N=bt?N:T;++N1&&ti.reverse(),we&&BtAt))return!1;var Se=at.get(y),we=at.get(_);if(Se&&we)return Se==_&&we==y;var Ne=-1,ar=!0,Mr=T&d?new Pd:r;for(at.set(y,_),at.set(_,y);++Ne1?"& ":"")+_[N],_=_.join(T>2?", ":" "),y.replace(yo,`{ /* [wrapped with `+_+`] */ `)}function Yt(y){return bn(y)||Ay(y)||!!(zC&&y&&y[zC])}function pe(y,_){var T=typeof y;return _=_==null?D:_,!!_&&(T=="number"||T!="symbol"&&Pf.test(y))&&y>-1&&y%1==0&&y<_}function Le(y,_,T){if(!Pa(T))return!1;var N=typeof _;return(N=="number"?_l(T)&&pe(_,T.length):N=="string"&&_ in T)?Hf(T[_],y):!1}function ue(y,_){if(bn(y))return!1;var T=typeof y;return T=="number"||T=="symbol"||T=="boolean"||y==null||cu(y)?!0:ku.test(y)||!ko.test(y)||_!=null&&y in hi(_)}function He(y){var _=typeof y;return _=="string"||_=="number"||_=="symbol"||_=="boolean"?y!=="__proto__":y===null}function ce(y){var _=ib(y),T=J[_];if(typeof T!="function"||!(_ in Fn.prototype))return!1;if(y===T)return!0;var N=nb(T);return!!N&&y===N[0]}function Re(y){return!!ry&&ry in y}var he=Dx?Kd:n3;function Oe(y){var _=y&&y.constructor,T=typeof _=="function"&&_.prototype||_v;return y===T}function vr(y){return y===y&&!Pa(y)}function Dr(y,_){return function(T){return T==null?!1:T[y]===_&&(_!==r||y in hi(T))}}function Ge(y){var _=PI(y,function(N){return T.size===s&&T.clear(),N}),T=_.cache;return _}function Me(y,_){var T=y[1],N=_[1],X=T|N,at=X<(p|v|C),bt=N==C&&T==g||N==C&&T==w&&y[7].length<=_[8]||N==(C|w)&&_[7].length<=_[8]&&T==g;if(!(at||bt))return y;N&p&&(y[2]=_[2],X|=T&p?0:m);var At=_[3];if(At){var Bt=y[3];y[3]=Bt?tb(Bt,At,_[4]):At,y[4]=Bt?Ff(y[3],l):_[4]}return At=_[5],At&&(Bt=y[5],y[5]=Bt?xI(Bt,At,_[6]):At,y[6]=Bt?Ff(y[5],l):_[6]),At=_[7],At&&(y[7]=At),N&C&&(y[8]=y[8]==null?_[8]:Fo(y[8],_[8])),y[9]==null&&(y[9]=_[9]),y[0]=_[0],y[1]=X,y}function fe(y){var _=[];if(y!=null)for(var T in hi(y))_.push(T);return _}function Er(y){return es.call(y)}function Vr(y,_,T){return _=ya(_===r?y.length-1:_,0),function(){for(var N=arguments,X=-1,at=ya(N.length-_,0),bt=te(at);++X0){if(++_>=O)return arguments[0]}else _=0;return y.apply(r,arguments)}}function Qi(y,_){var T=-1,N=y.length,X=N-1;for(_=_===r?N:_;++T<_;){var at=Zx(T,X),bt=y[at];y[at]=y[T],y[T]=bt}return y.length=_,y}var bi=Ge(function(y){var _=[];return y.charCodeAt(0)===46&&_.push(""),y.replace(Ro,function(T,N,X,at){_.push(X?at.replace(vn,"$1"):N||T)}),_});function oi(y){if(typeof y=="string"||cu(y))return y;var _=y+"";return _=="0"&&1/y==-F?"-0":_}function ki(y){if(y!=null){try{return ey.call(y)}catch(_){}try{return y+""}catch(_){}}return""}function Da(y,_){return xo(et,function(T){var N="_."+T[0];_&T[1]&&!wx(y,N)&&y.push(N)}),y.sort()}function Ra(y){if(y instanceof Fn)return y.clone();var _=new yl(y.__wrapped__,y.__chain__);return _.__actions__=_s(y.__actions__),_.__index__=y.__index__,_.__values__=y.__values__,_}function no(y,_,T){(T?Le(y,_,T):_===r)?_=1:_=ya(Mn(_),0);var N=y==null?0:y.length;if(!N||_<1)return[];for(var X=0,at=0,bt=te(kx(N/_));X1?y[_-1]:r;return T=typeof T=="function"?(y.pop(),T):r,a9(y,T)});function o9(y){var _=J(y);return _.__chain__=!0,_}function LMt(y,_){return _(y),y}function LI(y,_){return _(y)}var OMt=Uu(function(y){var _=y.length,T=_?y[0]:0,N=this.__wrapped__,X=function(at){return jc(at,y)};return _>1||this.__actions__.length||!(N instanceof Fn)||!pe(T)?this.thru(X):(N=N.slice(T,+T+(_?1:0)),N.__actions__.push({func:LI,args:[X],thisArg:r}),new yl(N,this.__chain__).thru(function(at){return _&&!at.length&&at.push(r),at}))});function DMt(){return o9(this)}function PMt(){return new yl(this.value(),this.__chain__)}function kMt(){this.__values__===r&&(this.__values__=b9(this.value()));var y=this.__index__>=this.__values__.length,_=y?r:this.__values__[this.__index__++];return{done:y,value:_}}function RMt(){return this}function NMt(y){for(var _,T=this;T instanceof ly;){var N=Ra(T);N.__index__=0,N.__values__=r,_?X.__wrapped__=N:_=N;var X=N;T=T.__wrapped__}return X.__wrapped__=y,_}function FMt(){var y=this.__wrapped__;if(y instanceof Fn){var _=y;return this.__actions__.length&&(_=new Fn(this)),_=_.reverse(),_.__actions__.push({func:LI,args:[ir],thisArg:r}),new yl(_,this.__chain__)}return this.thru(ir)}function BMt(){return Qx(this.__wrapped__,this.__actions__)}var GMt=Ey(function(y,_,T){Jn.call(y,T)?++y[T]:Uf(y,T,1)});function zMt(y,_,T){var N=bn(y)?Nc:sI;return T&&Le(y,_,T)&&(_=r),N(y,Z(_,3))}function UMt(y,_){var T=bn(y)?Ru:XC;return T(y,Z(_,3))}var jMt=ew(lt),WMt=ew(jt);function VMt(y,_){return eo(OI(y,_),1)}function HMt(y,_){return eo(OI(y,_),F)}function YMt(y,_,T){return T=T===r?1:Mn(T),eo(OI(y,_),T)}function s9(y,_){var T=bn(y)?xo:Nu;return T(y,Z(_,3))}function l9(y,_){var T=bn(y)?jT:fy;return T(y,Z(_,3))}var XMt=Ey(function(y,_,T){Jn.call(y,T)?y[T].push(_):Uf(y,T,[_])});function qMt(y,_,T,N){y=_l(y)?y:ob(y),T=T&&!N?Mn(T):0;var X=y.length;return T<0&&(T=ya(X+T,0)),NI(y)?T<=X&&y.indexOf(_,T)>-1:!!X&&Nf(y,_,T)>-1}var KMt=An(function(y,_,T){var N=-1,X=typeof _=="function",at=_l(y)?te(y.length):[];return Nu(y,function(bt){at[++N]=X?to(_,bt,T):Lv(bt,_,T)}),at}),ZMt=Ey(function(y,_,T){Uf(y,T,_)});function OI(y,_){var T=bn(y)?Zi:Hc;return T(y,Z(_,3))}function $Mt(y,_,T,N){return y==null?[]:(bn(_)||(_=_==null?[]:[_]),T=N?r:T,bn(T)||(T=T==null?[]:[T]),jd(y,_,T))}var QMt=Ey(function(y,_,T){y[T?0:1].push(_)},function(){return[[],[]]});function JMt(y,_,T){var N=bn(y)?MC:TC,X=arguments.length<3;return N(y,Z(_,4),T,X,Nu)}function tTt(y,_,T){var N=bn(y)?QF:TC,X=arguments.length<3;return N(y,Z(_,4),T,X,fy)}function eTt(y,_){var T=bn(y)?Ru:XC;return T(y,kI(Z(_,3)))}function rTt(y){var _=bn(y)?oI:NB;return _(y)}function nTt(y,_,T){(T?Le(y,_,T):_===r)?_=1:_=Mn(_);var N=bn(y)?OB:FB;return N(y,_)}function iTt(y){var _=bn(y)?DB:GB;return _(y)}function aTt(y){if(y==null)return 0;if(_l(y))return NI(y)?Bc(y):y.length;var _=le(y);return _==Y||_==We?y.size:zd(y).length}function oTt(y,_,T){var N=bn(y)?Ex:zB;return T&&Le(y,_,T)&&(_=r),N(y,Z(_,3))}var sTt=An(function(y,_){if(y==null)return[];var T=_.length;return T>1&&Le(y,_[0],_[1])?_=[]:T>2&&Le(_[0],_[1],_[2])&&(_=[_[0]]),jd(y,eo(_,1),[])}),DI=uB||function(){return Ja.Date.now()};function lTt(y,_){if(typeof _!="function")throw new gl(i);return y=Mn(y),function(){if(--y<1)return _.apply(this,arguments)}}function u9(y,_,T){return _=T?r:_,_=y&&_==null?y.length:_,Vf(y,C,r,r,r,r,_)}function f9(y,_){var T;if(typeof _!="function")throw new gl(i);return y=Mn(y),function(){return--y>0&&(T=_.apply(this,arguments)),y<=1&&(_=r),T}}var HB=An(function(y,_,T){var N=p;if(T.length){var X=Ff(T,B(HB));N|=b}return Vf(y,N,_,T,X)}),c9=An(function(y,_,T){var N=p|v;if(T.length){var X=Ff(T,B(c9));N|=b}return Vf(_,N,y,T,X)});function h9(y,_,T){_=T?r:_;var N=Vf(y,g,r,r,r,r,r,_);return N.placeholder=h9.placeholder,N}function d9(y,_,T){_=T?r:_;var N=Vf(y,x,r,r,r,r,r,_);return N.placeholder=d9.placeholder,N}function p9(y,_,T){var N,X,at,bt,At,Bt,Se=0,we=!1,Ne=!1,ar=!0;if(typeof y!="function")throw new gl(i);_=Wu(_)||0,Pa(T)&&(we=!!T.leading,Ne="maxWait"in T,at=Ne?ya(Wu(T.maxWait)||0,_):at,ar="trailing"in T?!!T.trailing:ar);function Mr(qa){var Yf=N,$d=X;return N=X=r,Se=qa,bt=y.apply($d,Yf),bt}function $r(qa){return Se=qa,At=yn(Wn,_),we?Mr(qa):bt}function On(qa){var Yf=qa-Bt,$d=qa-Se,P9=_-Yf;return Ne?Fo(P9,at-$d):P9}function Qr(qa){var Yf=qa-Bt,$d=qa-Se;return Bt===r||Yf>=_||Yf<0||Ne&&$d>=at}function Wn(){var qa=DI();if(Qr(qa))return ti(qa);At=yn(Wn,On(qa))}function ti(qa){return At=r,ar&&N?Mr(qa):(N=X=r,bt)}function hu(){At!==r&&Fv(At),Se=0,N=Bt=X=At=r}function zs(){return At===r?bt:ti(DI())}function du(){var qa=DI(),Yf=Qr(qa);if(N=arguments,X=this,Bt=qa,Yf){if(At===r)return $r(Bt);if(Ne)return Fv(At),At=yn(Wn,_),Mr(Bt)}return At===r&&(At=yn(Wn,_)),bt}return du.cancel=hu,du.flush=zs,du}var uTt=An(function(y,_){return Ux(y,1,_)}),fTt=An(function(y,_,T){return Ux(y,Wu(_)||0,T)});function cTt(y){return Vf(y,A)}function PI(y,_){if(typeof y!="function"||_!=null&&typeof _!="function")throw new gl(i);var T=function(){var N=arguments,X=_?_.apply(this,N):N[0],at=T.cache;if(at.has(X))return at.get(X);var bt=y.apply(this,N);return T.cache=at.set(X,bt)||at,bt};return T.cache=new(PI.Cache||zf),T}PI.Cache=zf;function kI(y){if(typeof y!="function")throw new gl(i);return function(){var _=arguments;switch(_.length){case 0:return!y.call(this);case 1:return!y.call(this,_[0]);case 2:return!y.call(this,_[0],_[1]);case 3:return!y.call(this,_[0],_[1],_[2])}return!y.apply(this,_)}}function hTt(y){return f9(2,y)}var dTt=Jx(function(y,_){_=_.length==1&&bn(_[0])?Zi(_[0],Bs(Z())):Zi(eo(_,1),Bs(Z()));var T=_.length;return An(function(N){for(var X=-1,at=Fo(N.length,T);++X=_}),Ay=Yx(function(){return arguments}())?Yx:function(y){return Na(y)&&Jn.call(y,"callee")&&!Ya.call(y,"callee")},bn=te.isArray,TTt=FT?Bs(FT):cI;function _l(y){return y!=null&&RI(y.length)&&!Kd(y)}function Xa(y){return Na(y)&&_l(y)}function ITt(y){return y===!0||y===!1||Na(y)&&Go(y)==_t}var zv=cB||n3,LTt=Cd?Bs(Cd):hI;function OTt(y){return Na(y)&&y.nodeType===1&&!uw(y)}function DTt(y){if(y==null)return!0;if(_l(y)&&(bn(y)||typeof y=="string"||typeof y.splice=="function"||zv(y)||ab(y)||Ay(y)))return!y.length;var _=le(y);if(_==Y||_==We)return!y.size;if(Oe(y))return!zd(y).length;for(var T in y)if(Jn.call(y,T))return!1;return!0}function PTt(y,_){return Bd(y,_)}function kTt(y,_,T){T=typeof T=="function"?T:r;var N=T?T(y,_):r;return N===r?Bd(y,_,r,T):!!N}function XB(y){if(!Na(y))return!1;var _=Go(y);return _==Tt||_==gt||typeof y.message=="string"&&typeof y.name=="string"&&!uw(y)}function RTt(y){return typeof y=="number"&&UC(y)}function Kd(y){if(!Pa(y))return!1;var _=Go(y);return _==Ut||_==$t||_==st||_==Zt}function m9(y){return typeof y=="number"&&y==Mn(y)}function RI(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=D}function Pa(y){var _=typeof y;return y!=null&&(_=="object"||_=="function")}function Na(y){return y!=null&&typeof y=="object"}var g9=BT?Bs(BT):vy;function NTt(y,_){return y===_||Xx(y,_,Gt(_))}function FTt(y,_,T){return T=typeof T=="function"?T:r,Xx(y,_,Gt(_),T)}function BTt(y){return y9(y)&&y!=+y}function GTt(y){if(he(y))throw new fn(n);return my(y)}function zTt(y){return y===null}function UTt(y){return y==null}function y9(y){return typeof y=="number"||Na(y)&&Go(y)==it}function uw(y){if(!Na(y)||Go(y)!=Rt)return!1;var _=Px(y);if(_===null)return!0;var T=Jn.call(_,"constructor")&&_.constructor;return typeof T=="function"&&T instanceof T&&ey.call(T)==Sv}var qB=GT?Bs(GT):jf;function jTt(y){return m9(y)&&y>=-D&&y<=D}var x9=mv?Bs(mv):gy;function NI(y){return typeof y=="string"||!bn(y)&&Na(y)&&Go(y)==$e}function cu(y){return typeof y=="symbol"||Na(y)&&Go(y)==W}var ab=zT?Bs(zT):Gd;function WTt(y){return y===r}function VTt(y){return Na(y)&&le(y)==ne}function HTt(y){return Na(y)&&Go(y)==pt}var YTt=rb(Wf),XTt=rb(function(y,_){return y<=_});function b9(y){if(!y)return[];if(_l(y))return NI(y)?ts(y):_s(y);if(nu&&y[nu])return YT(y[nu]());var _=le(y),T=_==Y?Lx:_==We?ty:ob;return T(y)}function Zd(y){if(!y)return y===0?y:0;if(y=Wu(y),y===F||y===-F){var _=y<0?-1:1;return _*G}return y===y?y:0}function Mn(y){var _=Zd(y),T=_%1;return _===_?T?_-T:_:0}function _9(y){return y?Wc(Mn(y),0,j):0}function Wu(y){if(typeof y=="number")return y;if(cu(y))return U;if(Pa(y)){var _=typeof y.valueOf=="function"?y.valueOf():y;y=Pa(_)?_+"":_}if(typeof y!="string")return y===0?y:+y;y=VT(y);var T=Of.test(y);return T||Df.test(y)?Cx(y.slice(2),T?2:8):Lf.test(y)?U:+y}function S9(y){return Bu(y,Sl(y))}function qTt(y){return y?Wc(Mn(y),-D,D):y===0?y:0}function wi(y){return y==null?"":Gs(y)}var KTt=Hd(function(y,_){if(Oe(_)||_l(_)){Bu(_,zo(_),y);return}for(var T in _)Jn.call(_,T)&&uy(y,T,_[T])}),C9=Hd(function(y,_){Bu(_,Sl(_),y)}),FI=Hd(function(y,_,T,N){Bu(_,Sl(_),y,N)}),ZTt=Hd(function(y,_,T,N){Bu(_,zo(_),y,N)}),$Tt=Uu(jc);function QTt(y,_){var T=Od(y);return _==null?T:Nd(T,_)}var JTt=An(function(y,_){y=hi(y);var T=-1,N=_.length,X=N>2?_[2]:r;for(X&&Le(_[0],_[1],X)&&(N=1);++T1),at}),Bu(y,sw(y),T),N&&(T=bo(T,u|f|c,WB));for(var X=_.length;X--;)kv(T,_[X]);return T});function gIt(y,_){return E9(y,kI(Z(_)))}var yIt=Uu(function(y,_){return y==null?{}:Dv(y,_)});function E9(y,_){if(y==null)return{};var T=Zi(sw(y),function(N){return[N]});return _=Z(_),dI(y,T,function(N,X){return _(N,X[0])})}function xIt(y,_,T){_=su(_,y);var N=-1,X=_.length;for(X||(X=1,y=r);++N_){var N=y;y=_,_=N}if(T||y%1||_%1){var X=jC();return Fo(y+X*(_-y+Rc("1e-"+((X+"").length-1))),_)}return Zx(y,_)}var LIt=Yd(function(y,_,T){return _=_.toLowerCase(),y+(T?T9(_):_)});function T9(y){return $B(wi(y).toLowerCase())}function I9(y){return y=wi(y),y&&y.replace(kf,OC).replace(XF,"")}function OIt(y,_,T){y=wi(y),_=Gs(_);var N=y.length;T=T===r?N:Wc(Mn(T),0,N);var X=T;return T-=_.length,T>=0&&y.slice(T,X)==_}function DIt(y){return y=wi(y),y&&ci.test(y)?y.replace(Ki,DC):y}function PIt(y){return y=wi(y),y&&Jo.test(y)?y.replace(ys,"\\$&"):y}var kIt=Yd(function(y,_,T){return y+(T?"-":"")+_.toLowerCase()}),RIt=Yd(function(y,_,T){return y+(T?" ":"")+_.toLowerCase()}),NIt=uu("toLowerCase");function FIt(y,_,T){y=wi(y),_=Mn(_);var N=_?Bc(y):0;if(!_||N>=_)return y;var X=(_-N)/2;return Wi(Cv(X),T)+y+Wi(kx(X),T)}function BIt(y,_,T){y=wi(y),_=Mn(_);var N=_?Bc(y):0;return _&&N<_?y+Wi(_-N,T):y}function GIt(y,_,T){y=wi(y),_=Mn(_);var N=_?Bc(y):0;return _&&N<_?Wi(_-N,T)+y:y}function zIt(y,_,T){return T||_==null?_=0:_&&(_=+_),Nx(wi(y).replace(vl,""),_||0)}function UIt(y,_,T){return(T?Le(y,_,T):_===r)?_=1:_=Mn(_),Xc(wi(y),_)}function jIt(){var y=arguments,_=wi(y[0]);return y.length<3?_:_.replace(y[1],y[2])}var WIt=Yd(function(y,_,T){return y+(T?"_":"")+_.toLowerCase()});function VIt(y,_,T){return T&&typeof T!="number"&&Le(y,_,T)&&(_=T=r),T=T===r?j:T>>>0,T?(y=wi(y),y&&(typeof _=="string"||_!=null&&!qB(_))&&(_=Gs(_),!_&&Ad(y))?lu(ts(y),0,T):y.split(_,T)):[]}var HIt=Yd(function(y,_,T){return y+(T?" ":"")+$B(_)});function YIt(y,_,T){return y=wi(y),T=T==null?0:Wc(Mn(T),0,y.length),_=Gs(_),y.slice(T,T+_.length)==_}function XIt(y,_,T){var N=J.templateSettings;T&&Le(y,_,T)&&(_=r),y=wi(y),_=FI({},_,N,CI);var X=FI({},_.imports,N.imports,CI),at=zo(X),bt=Jg(X,at),At,Bt,Se=0,we=_.interpolate||pv,Ne="__p += '",ar=BC((_.escape||pv).source+"|"+we.source+"|"+(we===Li?ji:pv).source+"|"+(_.evaluate||pv).source+"|$","g"),Mr="//# sourceURL="+(Jn.call(_,"sourceURL")?(_.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Sx+"]")+` `;y.replace(ar,function(Qr,Wn,ti,hu,zs,du){return ti||(ti=hu),Ne+=y.slice(Se,du).replace(uC,PC),Wn&&(At=!0,Ne+=`' + __e(`+Wn+`) + '`),zs&&(Bt=!0,Ne+=`'; `+zs+`; __p += '`),ti&&(Ne+=`' + ((__t = (`+ti+`)) == null ? '' : __t) + '`),Se=du+Qr.length,Qr}),Ne+=`'; `;var $r=Jn.call(_,"variable")&&_.variable;if(!$r)Ne=`with (obj) { `+Ne+` } `;else if(ai.test($r))throw new fn(a);Ne=(Bt?Ne.replace(ga,""):Ne).replace(_n,"$1").replace(ii,"$1;"),Ne="function("+($r||"obj")+`) { `+($r?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(At?", __e = _.escape":"")+(Bt?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Ne+`return __p }`;var On=O9(function(){return Qn(at,Mr+"return "+Ne).apply(r,bt)});if(On.source=Ne,XB(On))throw On;return On}function qIt(y){return wi(y).toLowerCase()}function KIt(y){return wi(y).toUpperCase()}function ZIt(y,_,T){if(y=wi(y),y&&(T||_===r))return VT(y);if(!y||!(_=Gs(_)))return y;var N=ts(y),X=ts(_),at=Tx(N,X),bt=Ix(N,X)+1;return lu(N,at,bt).join("")}function $It(y,_,T){if(y=wi(y),y&&(T||_===r))return y.slice(0,qT(y)+1);if(!y||!(_=Gs(_)))return y;var N=ts(y),X=Ix(N,ts(_))+1;return lu(N,0,X).join("")}function QIt(y,_,T){if(y=wi(y),y&&(T||_===r))return y.replace(vl,"");if(!y||!(_=Gs(_)))return y;var N=ts(y),X=Tx(N,ts(_));return lu(N,X).join("")}function JIt(y,_){var T=L,N=k;if(Pa(_)){var X="separator"in _?_.separator:X;T="length"in _?Mn(_.length):T,N="omission"in _?Gs(_.omission):N}y=wi(y);var at=y.length;if(Ad(y)){var bt=ts(y);at=bt.length}if(T>=at)return y;var At=T-Bc(N);if(At<1)return N;var Bt=bt?lu(bt,0,At).join(""):y.slice(0,At);if(X===r)return Bt+N;if(bt&&(At+=Bt.length-At),qB(X)){if(y.slice(At).search(X)){var Se,we=Bt;for(X.global||(X=BC(X.source,wi(La.exec(X))+"g")),X.lastIndex=0;Se=X.exec(we);)var Ne=Se.index;Bt=Bt.slice(0,Ne===r?At:Ne)}}else if(y.indexOf(Gs(X),At)!=At){var ar=Bt.lastIndexOf(X);ar>-1&&(Bt=Bt.slice(0,ar))}return Bt+N}function t2t(y){return y=wi(y),y&&En.test(y)?y.replace(xi,eB):y}var e2t=Yd(function(y,_,T){return y+(T?" ":"")+_.toUpperCase()}),$B=uu("toUpperCase");function L9(y,_,T){return y=wi(y),_=T?r:_,_===r?HT(y)?nB(y):JF(y):y.match(_)||[]}var O9=An(function(y,_){try{return to(y,r,_)}catch(T){return XB(T)?T:new fn(T)}}),r2t=Uu(function(y,_){return xo(_,function(T){T=oi(T),Uf(y,T,HB(y[T],y))}),y});function n2t(y){var _=y==null?0:y.length,T=Z();return y=_?Zi(y,function(N){if(typeof N[1]!="function")throw new gl(i);return[T(N[0]),N[1]]}):[],An(function(N){for(var X=-1;++X<_;){var at=y[X];if(to(at[0],this,N))return to(at[1],this,N)}})}function i2t(y){return YC(bo(y,u))}function QB(y){return function(){return y}}function a2t(y,_){return y==null||y!==y?_:y}var o2t=eb(),s2t=eb(!0);function Cl(y){return y}function JB(y){return Ov(typeof y=="function"?y:bo(y,u))}function l2t(y){return yy(bo(y,u))}function u2t(y,_){return xy(y,bo(_,u))}var f2t=An(function(y,_){return function(T){return Lv(T,y,_)}}),c2t=An(function(y,_){return function(T){return Lv(y,T,_)}});function t3(y,_,T){var N=zo(_),X=dy(_,N);T==null&&!(Pa(_)&&(X.length||!N.length))&&(T=_,_=y,y=this,X=dy(_,zo(_)));var at=!(Pa(T)&&"chain"in T)||!!T.chain,bt=Kd(y);return xo(X,function(At){var Bt=_[At];y[At]=Bt,bt&&(y.prototype[At]=function(){var Se=this.__chain__;if(at||Se){var we=y(this.__wrapped__),Ne=we.__actions__=_s(this.__actions__);return Ne.push({func:Bt,args:arguments,thisArg:y}),we.__chain__=Se,we}return Bt.apply(y,Rf([this.value()],arguments))})}),y}function h2t(){return Ja._===this&&(Ja._=KT),this}function e3(){}function d2t(y){return y=Mn(y),An(function(_){return qx(_,y)})}var p2t=zu(Zi),v2t=zu(Nc),m2t=zu(Ex);function D9(y){return ue(y)?Ed(oi(y)):kB(y)}function g2t(y){return function(_){return y==null?r:Vc(y,_)}}var y2t=nw(),x2t=nw(!0);function r3(){return[]}function n3(){return!1}function b2t(){return{}}function _2t(){return""}function S2t(){return!0}function C2t(y,_){if(y=Mn(y),y<1||y>D)return[];var T=j,N=Fo(y,j);_=Z(_),y-=j;for(var X=LC(N,_);++T0||_<0)?new Fn(T):(y<0?T=T.takeRight(-y):y&&(T=T.drop(y)),_!==r&&(_=Mn(_),T=_<0?T.dropRight(-_):T.take(_-y)),T)},Fn.prototype.takeRightWhile=function(y){return this.reverse().takeWhile(y).reverse()},Fn.prototype.toArray=function(){return this.take(j)},ou(Fn.prototype,function(y,_){var T=/^(?:filter|find|map|reject)|While$/.test(_),N=/^(?:head|last)$/.test(_),X=J[N?"take"+(_=="last"?"Right":""):_],at=N||/^find/.test(_);!X||(J.prototype[_]=function(){var bt=this.__wrapped__,At=N?[1]:arguments,Bt=bt instanceof Fn,Se=At[0],we=Bt||bn(bt),Ne=function(Wn){var ti=X.apply(J,Rf([Wn],At));return N&&ar?ti[0]:ti};we&&T&&typeof Se=="function"&&Se.length!=1&&(Bt=we=!1);var ar=this.__chain__,Mr=!!this.__actions__.length,$r=at&&!ar,On=Bt&&!Mr;if(!at&&we){bt=On?bt:new Fn(this);var Qr=y.apply(bt,At);return Qr.__actions__.push({func:LI,args:[Ne],thisArg:r}),new yl(Qr,ar)}return $r&&On?y.apply(this,At):(Qr=this.thru(Ne),$r?N?Qr.value()[0]:Qr.value():Qr)})}),xo(["pop","push","shift","sort","splice","unshift"],function(y){var _=Ox[y],T=/^(?:push|sort|unshift)$/.test(y)?"tap":"thru",N=/^(?:pop|shift)$/.test(y);J.prototype[y]=function(){var X=arguments;if(N&&!this.__chain__){var at=this.value();return _.apply(bn(at)?at:[],X)}return this[T](function(bt){return _.apply(bn(bt)?bt:[],X)})}}),ou(Fn.prototype,function(y,_){var T=J[_];if(T){var N=T.name+"";Jn.call(Bo,N)||(Bo[N]=[]),Bo[N].push({name:_,func:T})}}),Bo[Xd(r,v).name]=[{name:"wrapper",func:r}],Fn.prototype.clone=pB,Fn.prototype.reverse=vB,Fn.prototype.value=mB,J.prototype.at=OMt,J.prototype.chain=DMt,J.prototype.commit=PMt,J.prototype.next=kMt,J.prototype.plant=NMt,J.prototype.reverse=FMt,J.prototype.toJSON=J.prototype.valueOf=J.prototype.value=BMt,J.prototype.first=J.prototype.head,nu&&(J.prototype[nu]=RMt),J},Gc=iB();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ja._=Gc,define(function(){return Gc})):Sd?((Sd.exports=Gc)._=Gc,wC._=Gc):Ja._=Gc}).call(q_)});var Tu=ft((Jwr,Xpt)=>{var _R;if(typeof require=="function")try{_R=Ypt()}catch(r){}_R||(_R=window._);Xpt.exports=_R});var SR=ft((tEr,$pt)=>{"use strict";var Jr=Tu();$pt.exports=jn;var _ne="\0",H0="\0",qpt="";function jn(r){this._isDirected=Jr.has(r,"directed")?r.directed:!0,this._isMultigraph=Jr.has(r,"multigraph")?r.multigraph:!1,this._isCompound=Jr.has(r,"compound")?r.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Jr.constant(void 0),this._defaultEdgeLabelFn=Jr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[H0]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}jn.prototype._nodeCount=0;jn.prototype._edgeCount=0;jn.prototype.isDirected=function(){return this._isDirected};jn.prototype.isMultigraph=function(){return this._isMultigraph};jn.prototype.isCompound=function(){return this._isCompound};jn.prototype.setGraph=function(r){return this._label=r,this};jn.prototype.graph=function(){return this._label};jn.prototype.setDefaultNodeLabel=function(r){return Jr.isFunction(r)||(r=Jr.constant(r)),this._defaultNodeLabelFn=r,this};jn.prototype.nodeCount=function(){return this._nodeCount};jn.prototype.nodes=function(){return Jr.keys(this._nodes)};jn.prototype.sources=function(){return Jr.filter(this.nodes(),Jr.bind(function(r){return Jr.isEmpty(this._in[r])},this))};jn.prototype.sinks=function(){return Jr.filter(this.nodes(),Jr.bind(function(r){return Jr.isEmpty(this._out[r])},this))};jn.prototype.setNodes=function(r,e){var t=arguments;return Jr.each(r,Jr.bind(function(n){t.length>1?this.setNode(n,e):this.setNode(n)},this)),this};jn.prototype.setNode=function(r,e){return Jr.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=e),this):(this._nodes[r]=arguments.length>1?e:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=H0,this._children[r]={},this._children[H0][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)};jn.prototype.node=function(r){return this._nodes[r]};jn.prototype.hasNode=function(r){return Jr.has(this._nodes,r)};jn.prototype.removeNode=function(r){var e=this;if(Jr.has(this._nodes,r)){var t=function(n){e.removeEdge(e._edgeObjs[n])};delete this._nodes[r],this._isCompound&&(this._removeFromParentsChildList(r),delete this._parent[r],Jr.each(this.children(r),Jr.bind(function(n){this.setParent(n)},this)),delete this._children[r]),Jr.each(Jr.keys(this._in[r]),t),delete this._in[r],delete this._preds[r],Jr.each(Jr.keys(this._out[r]),t),delete this._out[r],delete this._sucs[r],--this._nodeCount}return this};jn.prototype.setParent=function(r,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Jr.isUndefined(e))e=H0;else{e+="";for(var t=e;!Jr.isUndefined(t);t=this.parent(t))if(t===r)throw new Error("Setting "+e+" as parent of "+r+" would create create a cycle");this.setNode(e)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=e,this._children[e][r]=!0,this};jn.prototype._removeFromParentsChildList=function(r){delete this._children[this._parent[r]][r]};jn.prototype.parent=function(r){if(this._isCompound){var e=this._parent[r];if(e!==H0)return e}};jn.prototype.children=function(r){if(Jr.isUndefined(r)&&(r=H0),this._isCompound){var e=this._children[r];if(e)return Jr.keys(e)}else{if(r===H0)return this.nodes();if(this.hasNode(r))return[]}};jn.prototype.predecessors=function(r){var e=this._preds[r];if(e)return Jr.keys(e)};jn.prototype.successors=function(r){var e=this._sucs[r];if(e)return Jr.keys(e)};jn.prototype.neighbors=function(r){var e=this.predecessors(r);if(e)return Jr.union(e,this.successors(r))};jn.prototype.isLeaf=function(r){var e;return this.isDirected()?e=this.successors(r):e=this.neighbors(r),e.length===0};jn.prototype.filterNodes=function(r){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Jr.each(this._nodes,Jr.bind(function(a,o){r(o)&&e.setNode(o,a)},this)),Jr.each(this._edgeObjs,Jr.bind(function(a){e.hasNode(a.v)&&e.hasNode(a.w)&&e.setEdge(a,this.edge(a))},this));var t=this,n={};function i(a){var o=t.parent(a);return o===void 0||e.hasNode(o)?(n[a]=o,o):o in n?n[o]:i(o)}return this._isCompound&&Jr.each(e.nodes(),function(a){e.setParent(a,i(a))}),e};jn.prototype.setDefaultEdgeLabel=function(r){return Jr.isFunction(r)||(r=Jr.constant(r)),this._defaultEdgeLabelFn=r,this};jn.prototype.edgeCount=function(){return this._edgeCount};jn.prototype.edges=function(){return Jr.values(this._edgeObjs)};jn.prototype.setPath=function(r,e){var t=this,n=arguments;return Jr.reduce(r,function(i,a){return n.length>1?t.setEdge(i,a,e):t.setEdge(i,a),a}),this};jn.prototype.setEdge=function(){var r,e,t,n,i=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(r=a.v,e=a.w,t=a.name,arguments.length===2&&(n=arguments[1],i=!0)):(r=a,e=arguments[1],t=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),r=""+r,e=""+e,Jr.isUndefined(t)||(t=""+t);var o=wM(this._isDirected,r,e,t);if(Jr.has(this._edgeLabels,o))return i&&(this._edgeLabels[o]=n),this;if(!Jr.isUndefined(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(e),this._edgeLabels[o]=i?n:this._defaultEdgeLabelFn(r,e,t);var s=Sne(this._isDirected,r,e,t);return r=s.v,e=s.w,Object.freeze(s),this._edgeObjs[o]=s,Kpt(this._preds[e],r),Kpt(this._sucs[r],e),this._in[e][o]=s,this._out[r][o]=s,this._edgeCount++,this};jn.prototype.edge=function(r,e,t){var n=arguments.length===1?F8(this._isDirected,arguments[0]):wM(this._isDirected,r,e,t);return this._edgeLabels[n]};jn.prototype.hasEdge=function(r,e,t){var n=arguments.length===1?F8(this._isDirected,arguments[0]):wM(this._isDirected,r,e,t);return Jr.has(this._edgeLabels,n)};jn.prototype.removeEdge=function(r,e,t){var n=arguments.length===1?F8(this._isDirected,arguments[0]):wM(this._isDirected,r,e,t),i=this._edgeObjs[n];return i&&(r=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],Zpt(this._preds[e],r),Zpt(this._sucs[r],e),delete this._in[e][n],delete this._out[r][n],this._edgeCount--),this};jn.prototype.inEdges=function(r,e){var t=this._in[r];if(t){var n=Jr.values(t);return e?Jr.filter(n,function(i){return i.v===e}):n}};jn.prototype.outEdges=function(r,e){var t=this._out[r];if(t){var n=Jr.values(t);return e?Jr.filter(n,function(i){return i.w===e}):n}};jn.prototype.nodeEdges=function(r,e){var t=this.inEdges(r,e);if(t)return t.concat(this.outEdges(r,e))};function Kpt(r,e){r[e]?r[e]++:r[e]=1}function Zpt(r,e){--r[e]||delete r[e]}function wM(r,e,t,n){var i=""+e,a=""+t;if(!r&&i>a){var o=i;i=a,a=o}return i+qpt+a+qpt+(Jr.isUndefined(n)?_ne:n)}function Sne(r,e,t,n){var i=""+e,a=""+t;if(!r&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function F8(r,e){return wM(r,e.v,e.w,e.name)}});var Jpt=ft((eEr,Qpt)=>{Qpt.exports="2.1.4"});var evt=ft((rEr,tvt)=>{tvt.exports={Graph:SR(),version:Jpt()}});var nvt=ft((nEr,rvt)=>{var Jh=Tu(),Cne=SR();rvt.exports={write:wne,read:Mne};function wne(r){var e={options:{directed:r.isDirected(),multigraph:r.isMultigraph(),compound:r.isCompound()},nodes:Ene(r),edges:Ane(r)};return Jh.isUndefined(r.graph())||(e.value=Jh.clone(r.graph())),e}function Ene(r){return Jh.map(r.nodes(),function(e){var t=r.node(e),n=r.parent(e),i={v:e};return Jh.isUndefined(t)||(i.value=t),Jh.isUndefined(n)||(i.parent=n),i})}function Ane(r){return Jh.map(r.edges(),function(e){var t=r.edge(e),n={v:e.v,w:e.w};return Jh.isUndefined(e.name)||(n.name=e.name),Jh.isUndefined(t)||(n.value=t),n})}function Mne(r){var e=new Cne(r.options).setGraph(r.value);return Jh.each(r.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),Jh.each(r.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}});var avt=ft((iEr,ivt)=>{var CR=Tu();ivt.exports=Tne;function Tne(r){var e={},t=[],n;function i(a){CR.has(e,a)||(e[a]=!0,n.push(a),CR.each(r.successors(a),i),CR.each(r.predecessors(a),i))}return CR.each(r.nodes(),function(a){n=[],i(a),n.length&&t.push(n)}),t}});var B8=ft((aEr,svt)=>{var ovt=Tu();svt.exports=yf;function yf(){this._arr=[],this._keyIndices={}}yf.prototype.size=function(){return this._arr.length};yf.prototype.keys=function(){return this._arr.map(function(r){return r.key})};yf.prototype.has=function(r){return ovt.has(this._keyIndices,r)};yf.prototype.priority=function(r){var e=this._keyIndices[r];if(e!==void 0)return this._arr[e].priority};yf.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};yf.prototype.add=function(r,e){var t=this._keyIndices;if(r=String(r),!ovt.has(t,r)){var n=this._arr,i=n.length;return t[r]=i,n.push({key:r,priority:e}),this._decrease(i),!0}return!1};yf.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key};yf.prototype.decrease=function(r,e){var t=this._keyIndices[r];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)};yf.prototype._heapify=function(r){var e=this._arr,t=2*r,n=t+1,i=r;t>1,!(e[n].priority{var Ine=Tu(),Lne=B8();lvt.exports=Dne;var One=Ine.constant(1);function Dne(r,e,t,n){return Pne(r,String(e),t||One,n||function(i){return r.outEdges(i)})}function Pne(r,e,t,n){var i={},a=new Lne,o,s,l=function(u){var f=u.v!==o?u.v:u.w,c=i[f],h=t(u),d=s.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);d0&&(o=a.removeMin(),s=i[o],s.distance!==Number.POSITIVE_INFINITY);)n(o).forEach(l);return i}});var fvt=ft((sEr,uvt)=>{var kne=G8(),Rne=Tu();uvt.exports=Nne;function Nne(r,e,t){return Rne.transform(r.nodes(),function(n,i){n[i]=kne(r,i,e,t)},{})}});var z8=ft((lEr,hvt)=>{var cvt=Tu();hvt.exports=Fne;function Fne(r){var e=0,t=[],n={},i=[];function a(o){var s=n[o]={onStack:!0,lowlink:e,index:e++};if(t.push(o),r.successors(o).forEach(function(f){cvt.has(n,f)?n[f].onStack&&(s.lowlink=Math.min(s.lowlink,n[f].index)):(a(f),s.lowlink=Math.min(s.lowlink,n[f].lowlink))}),s.lowlink===s.index){var l=[],u;do u=t.pop(),n[u].onStack=!1,l.push(u);while(o!==u);i.push(l)}}return r.nodes().forEach(function(o){cvt.has(n,o)||a(o)}),i}});var pvt=ft((uEr,dvt)=>{var Bne=Tu(),Gne=z8();dvt.exports=zne;function zne(r){return Bne.filter(Gne(r),function(e){return e.length>1||e.length===1&&r.hasEdge(e[0],e[0])})}});var mvt=ft((fEr,vvt)=>{var Une=Tu();vvt.exports=Wne;var jne=Une.constant(1);function Wne(r,e,t){return Vne(r,e||jne,t||function(n){return r.outEdges(n)})}function Vne(r,e,t){var n={},i=r.nodes();return i.forEach(function(a){n[a]={},n[a][a]={distance:0},i.forEach(function(o){a!==o&&(n[a][o]={distance:Number.POSITIVE_INFINITY})}),t(a).forEach(function(o){var s=o.v===a?o.w:o.v,l=e(o);n[a][s]={distance:l,predecessor:a}})}),i.forEach(function(a){var o=n[a];i.forEach(function(s){var l=n[s];i.forEach(function(u){var f=l[a],c=o[u],h=l[u],d=f.distance+c.distance;d{var EM=Tu();yvt.exports=gvt;gvt.CycleException=U8;function gvt(r){var e={},t={},n=[];function i(a){if(EM.has(t,a))throw new U8;EM.has(e,a)||(t[a]=!0,e[a]=!0,EM.each(r.predecessors(a),i),delete t[a],n.push(a))}if(EM.each(r.sinks(),i),EM.size(e)!==r.nodeCount())throw new U8;return n}function U8(){}});var _vt=ft((hEr,bvt)=>{var xvt=j8();bvt.exports=Hne;function Hne(r){try{xvt(r)}catch(e){if(e instanceof xvt.CycleException)return!1;throw e}return!0}});var W8=ft((dEr,Cvt)=>{var wR=Tu();Cvt.exports=Yne;function Yne(r,e,t){wR.isArray(e)||(e=[e]);var n=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return wR.each(e,function(o){if(!r.hasNode(o))throw new Error("Graph does not have node: "+o);Svt(r,o,t==="post",a,n,i)}),i}function Svt(r,e,t,n,i,a){wR.has(n,e)||(n[e]=!0,t||a.push(e),wR.each(i(e),function(o){Svt(r,o,t,n,i,a)}),t&&a.push(e))}});var Evt=ft((pEr,wvt)=>{var Xne=W8();wvt.exports=qne;function qne(r,e){return Xne(r,e,"post")}});var Mvt=ft((vEr,Avt)=>{var Kne=W8();Avt.exports=Zne;function Zne(r,e){return Kne(r,e,"pre")}});var Lvt=ft((mEr,Ivt)=>{var Tvt=Tu(),$ne=SR(),Qne=B8();Ivt.exports=Jne;function Jne(r,e){var t=new $ne,n={},i=new Qne,a;function o(l){var u=l.v===a?l.w:l.v,f=i.priority(u);if(f!==void 0){var c=e(l);c0;){if(a=i.removeMin(),Tvt.has(n,a))t.setEdge(a,n[a]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(a).forEach(o)}return t}});var Dvt=ft((gEr,Ovt)=>{Ovt.exports={components:avt(),dijkstra:G8(),dijkstraAll:fvt(),findCycles:pvt(),floydWarshall:mvt(),isAcyclic:_vt(),postorder:Evt(),preorder:Mvt(),prim:Lvt(),tarjan:z8(),topsort:j8()}});var Rvt=ft((yEr,kvt)=>{var Pvt=evt();kvt.exports={Graph:Pvt.Graph,json:nvt(),alg:Dvt(),version:Pvt.version}});var lgt=ft((iTr,zp)=>{function gH(r){return zp.exports=gH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zp.exports.__esModule=!0,zp.exports.default=zp.exports,gH(r)}zp.exports=gH,zp.exports.__esModule=!0,zp.exports.default=zp.exports});var fgt=ft((aTr,Up)=>{var Kae=lgt().default;function ugt(){"use strict";Up.exports=ugt=function(){return r},Up.exports.__esModule=!0,Up.exports.default=Up.exports;var r={},e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(I,R,P){I[R]=P.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(I,R,P){return Object.defineProperty(I,R,{value:P,enumerable:!0,configurable:!0,writable:!0}),I[R]}try{l({},"")}catch(I){l=function(P,F,D){return P[F]=D}}function u(I,R,P,F){var D=R&&R.prototype instanceof h?R:h,G=Object.create(D.prototype),U=new k(F||[]);return n(G,"_invoke",{value:C(I,P,U)}),G}function f(I,R,P){try{return{type:"normal",arg:I.call(R,P)}}catch(F){return{type:"throw",arg:F}}}r.wrap=u;var c={};function h(){}function d(){}function p(){}var v={};l(v,a,function(){return this});var m=Object.getPrototypeOf,g=m&&m(m(O([])));g&&g!==e&&t.call(g,a)&&(v=g);var x=p.prototype=h.prototype=Object.create(v);function b(I){["next","throw","return"].forEach(function(R){l(I,R,function(P){return this._invoke(R,P)})})}function S(I,R){function P(D,G,U,j){var H=f(I[D],I,G);if(H.type!=="throw"){var tt=H.arg,et=tt.value;return et&&Kae(et)=="object"&&t.call(et,"__await")?R.resolve(et.__await).then(function(ut){P("next",ut,U,j)},function(ut){P("throw",ut,U,j)}):R.resolve(et).then(function(ut){tt.value=ut,U(tt)},function(ut){return P("throw",ut,U,j)})}j(H.arg)}var F;n(this,"_invoke",{value:function(G,U){function j(){return new R(function(H,tt){P(G,U,H,tt)})}return F=F?F.then(j,j):j()}})}function C(I,R,P){var F="suspendedStart";return function(D,G){if(F==="executing")throw new Error("Generator is already running");if(F==="completed"){if(D==="throw")throw G;return M()}for(P.method=D,P.arg=G;;){var U=P.delegate;if(U){var j=w(U,P);if(j){if(j===c)continue;return j}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(F==="suspendedStart")throw F="completed",P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);F="executing";var H=f(I,R,P);if(H.type==="normal"){if(F=P.done?"completed":"suspendedYield",H.arg===c)continue;return{value:H.arg,done:P.done}}H.type==="throw"&&(F="completed",P.method="throw",P.arg=H.arg)}}}function w(I,R){var P=R.method,F=I.iterator[P];if(F===void 0)return R.delegate=null,P==="throw"&&I.iterator.return&&(R.method="return",R.arg=void 0,w(I,R),R.method==="throw")||P!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+P+"' method")),c;var D=f(F,I.iterator,R.arg);if(D.type==="throw")return R.method="throw",R.arg=D.arg,R.delegate=null,c;var G=D.arg;return G?G.done?(R[I.resultName]=G.value,R.next=I.nextLoc,R.method!=="return"&&(R.method="next",R.arg=void 0),R.delegate=null,c):G:(R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,c)}function A(I){var R={tryLoc:I[0]};1 in I&&(R.catchLoc=I[1]),2 in I&&(R.finallyLoc=I[2],R.afterLoc=I[3]),this.tryEntries.push(R)}function L(I){var R=I.completion||{};R.type="normal",delete R.arg,I.completion=R}function k(I){this.tryEntries=[{tryLoc:"root"}],I.forEach(A,this),this.reset(!0)}function O(I){if(I){var R=I[a];if(R)return R.call(I);if(typeof I.next=="function")return I;if(!isNaN(I.length)){var P=-1,F=function D(){for(;++P=0;--D){var G=this.tryEntries[D],U=G.completion;if(G.tryLoc==="root")return F("end");if(G.tryLoc<=this.prev){var j=t.call(G,"catchLoc"),H=t.call(G,"finallyLoc");if(j&&H){if(this.prev=0;--F){var D=this.tryEntries[F];if(D.tryLoc<=this.prev&&t.call(D,"finallyLoc")&&this.prev=0;--P){var F=this.tryEntries[P];if(F.finallyLoc===R)return this.complete(F.completion,F.afterLoc),L(F),c}},catch:function(R){for(var P=this.tryEntries.length-1;P>=0;--P){var F=this.tryEntries[P];if(F.tryLoc===R){var D=F.completion;if(D.type==="throw"){var G=D.arg;L(F)}return G}}throw new Error("illegal catch attempt")},delegateYield:function(R,P,F){return this.delegate={iterator:O(R),resultName:P,nextLoc:F},this.method==="next"&&(this.arg=void 0),c}},r}Up.exports=ugt,Up.exports.__esModule=!0,Up.exports.default=Up.exports});var $a=ft((oTr,cgt)=>{var PR=fgt()();cgt.exports=PR;try{regeneratorRuntime=PR}catch(r){typeof globalThis=="object"?globalThis.regeneratorRuntime=PR:Function("r","regeneratorRuntime = r")(PR)}});var Lo=ft(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.NON_CUSTOM_TAG_KEYS=yi.POST_CONSTRUCT=yi.DESIGN_PARAM_TYPES=yi.PARAM_TYPES=yi.TAGGED_PROP=yi.TAGGED=yi.MULTI_INJECT_TAG=yi.INJECT_TAG=yi.OPTIONAL_TAG=yi.UNMANAGED_TAG=yi.NAME_TAG=yi.NAMED_TAG=void 0;yi.NAMED_TAG="named";yi.NAME_TAG="name";yi.UNMANAGED_TAG="unmanaged";yi.OPTIONAL_TAG="optional";yi.INJECT_TAG="inject";yi.MULTI_INJECT_TAG="multi_inject";yi.TAGGED="inversify:tagged";yi.TAGGED_PROP="inversify:tagged_props";yi.PARAM_TYPES="inversify:paramtypes";yi.DESIGN_PARAM_TYPES="design:paramtypes";yi.POST_CONSTRUCT="post_construct";function $ae(){return[yi.INJECT_TAG,yi.MULTI_INJECT_TAG,yi.NAME_TAG,yi.UNMANAGED_TAG,yi.NAMED_TAG,yi.OPTIONAL_TAG]}yi.NON_CUSTOM_TAG_KEYS=$ae()});var ed=ft(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.TargetTypeEnum=wg.BindingTypeEnum=wg.BindingScopeEnum=void 0;var Qae={Request:"Request",Singleton:"Singleton",Transient:"Transient"};wg.BindingScopeEnum=Qae;var Jae={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};wg.BindingTypeEnum=Jae;var toe={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};wg.TargetTypeEnum=toe});var Eg=ft(kR=>{"use strict";Object.defineProperty(kR,"__esModule",{value:!0});kR.id=void 0;var eoe=0;function roe(){return eoe++}kR.id=roe});var vgt=ft(RR=>{"use strict";Object.defineProperty(RR,"__esModule",{value:!0});RR.Binding=void 0;var pgt=ed(),noe=Eg(),ioe=function(){function r(e,t){this.id=noe.id(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=pgt.BindingTypeEnum.Invalid,this.constraint=function(n){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return r.prototype.clone=function(){var e=new r(this.serviceIdentifier,this.scope);return e.activated=e.scope===pgt.BindingScopeEnum.Singleton?this.activated:!1,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},r}();RR.Binding=ioe});var Kl=ft(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.STACK_OVERFLOW=zr.CIRCULAR_DEPENDENCY_IN_FACTORY=zr.POST_CONSTRUCT_ERROR=zr.MULTIPLE_POST_CONSTRUCT_METHODS=zr.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=zr.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=zr.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=zr.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=zr.ARGUMENTS_LENGTH_MISMATCH=zr.INVALID_DECORATOR_OPERATION=zr.INVALID_TO_SELF_VALUE=zr.INVALID_FUNCTION_BINDING=zr.INVALID_MIDDLEWARE_RETURN=zr.NO_MORE_SNAPSHOTS_AVAILABLE=zr.INVALID_BINDING_TYPE=zr.NOT_IMPLEMENTED=zr.CIRCULAR_DEPENDENCY=zr.UNDEFINED_INJECT_ANNOTATION=zr.MISSING_INJECT_ANNOTATION=zr.MISSING_INJECTABLE_ANNOTATION=zr.NOT_REGISTERED=zr.CANNOT_UNBIND=zr.AMBIGUOUS_MATCH=zr.KEY_NOT_FOUND=zr.NULL_ARGUMENT=zr.DUPLICATED_METADATA=zr.DUPLICATED_INJECTABLE_DECORATOR=void 0;zr.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.";zr.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:";zr.NULL_ARGUMENT="NULL argument";zr.KEY_NOT_FOUND="Key Not Found";zr.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:";zr.CANNOT_UNBIND="Could not unbind serviceIdentifier:";zr.NOT_REGISTERED="No matching bindings found for serviceIdentifier:";zr.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:";zr.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var aoe=function(r){return"@inject called with undefined this could mean that the class "+r+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."};zr.UNDEFINED_INJECT_ANNOTATION=aoe;zr.CIRCULAR_DEPENDENCY="Circular dependency found:";zr.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.";zr.INVALID_BINDING_TYPE="Invalid binding type:";zr.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.";zr.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!";zr.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!";zr.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier";zr.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var ooe=function(){for(var r=[],e=0;e= than the number of constructor arguments of its base class.")};zr.ARGUMENTS_LENGTH_MISMATCH=ooe;zr.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.";zr.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').";zr.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean";zr.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean";zr.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";var soe=function(){for(var r=[],e=0;e{"use strict";Object.defineProperty(NR,"__esModule",{value:!0});NR.MetadataReader=void 0;var SH=Lo(),uoe=function(){function r(){}return r.prototype.getConstructorMetadata=function(e){var t=Reflect.getMetadata(SH.PARAM_TYPES,e),n=Reflect.getMetadata(SH.TAGGED,e);return{compilerGeneratedMetadata:t,userGeneratedMetadata:n||{}}},r.prototype.getPropertiesMetadata=function(e){var t=Reflect.getMetadata(SH.TAGGED_PROP,e)||[];return t},r}();NR.MetadataReader=uoe});var mgt=ft(FR=>{"use strict";Object.defineProperty(FR,"__esModule",{value:!0});FR.BindingCount=void 0;var foe={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};FR.BindingCount=foe});var wH=ft(BR=>{"use strict";Object.defineProperty(BR,"__esModule",{value:!0});BR.isStackOverflowExeption=void 0;var coe=Kl();function hoe(r){return r instanceof RangeError||r.message===coe.STACK_OVERFLOW}BR.isStackOverflowExeption=hoe});var tS=ft(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.circularDependencyToException=_f.listMetadataForTarget=_f.listRegisteredBindingsForServiceIdentifier=_f.getServiceIdentifierAsString=_f.getFunctionName=void 0;var doe=Kl();function ggt(r){if(typeof r=="function"){var e=r;return e.name}else{if(typeof r=="symbol")return r.toString();var e=r;return e}}_f.getServiceIdentifierAsString=ggt;function poe(r,e,t){var n="",i=t(r,e);return i.length!==0&&(n=` Registered bindings:`,i.forEach(function(a){var o="Object";a.implementationType!==null&&(o=bgt(a.implementationType)),n=n+` `+o,a.constraint.metaData&&(n=n+" - "+a.constraint.metaData)})),n}_f.listRegisteredBindingsForServiceIdentifier=poe;function ygt(r,e){return r.parentRequest===null?!1:r.parentRequest.serviceIdentifier===e?!0:ygt(r.parentRequest,e)}function voe(r){function e(n,i){i===void 0&&(i=[]);var a=ggt(n.serviceIdentifier);return i.push(a),n.parentRequest!==null?e(n.parentRequest,i):i}var t=e(r);return t.reverse().join(" --> ")}function xgt(r){r.childRequests.forEach(function(e){if(ygt(e,e.serviceIdentifier)){var t=voe(e);throw new Error(doe.CIRCULAR_DEPENDENCY+" "+t)}else xgt(e)})}_f.circularDependencyToException=xgt;function moe(r,e){if(e.isTagged()||e.isNamed()){var t="",n=e.getNamedTag(),i=e.getCustomTags();return n!==null&&(t+=n.toString()+` `),i!==null&&i.forEach(function(a){t+=a.toString()+` `})," "+r+` `+r+" - "+t}else return" "+r}_f.listMetadataForTarget=moe;function bgt(r){if(r.name)return r.name;var e=r.toString(),t=e.match(/^function\s*([^\s(]+)/);return t?t[1]:"Anonymous function: "+e}_f.getFunctionName=bgt});var _gt=ft(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0});GR.Context=void 0;var goe=Eg(),yoe=function(){function r(e){this.id=goe.id(),this.container=e}return r.prototype.addPlan=function(e){this.plan=e},r.prototype.setCurrentRequest=function(e){this.currentRequest=e},r}();GR.Context=yoe});var Sf=ft(zR=>{"use strict";Object.defineProperty(zR,"__esModule",{value:!0});zR.Metadata=void 0;var xoe=Lo(),boe=function(){function r(e,t){this.key=e,this.value=t}return r.prototype.toString=function(){return this.key===xoe.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},r}();zR.Metadata=boe});var Sgt=ft(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0});UR.Plan=void 0;var _oe=function(){function r(e,t){this.parentContext=e,this.rootRequest=t}return r}();UR.Plan=_oe});var Vp=ft(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});Ag.tagProperty=Ag.tagParameter=Ag.decorate=void 0;var Cgt=Kl(),wgt=Lo();function Soe(r,e,t,n){var i=wgt.TAGGED;Egt(i,r,e,n,t)}Ag.tagParameter=Soe;function Coe(r,e,t){var n=wgt.TAGGED_PROP;Egt(n,r.constructor,e,t)}Ag.tagProperty=Coe;function Egt(r,e,t,n,i){var a={},o=typeof i=="number",s=i!==void 0&&o?i.toString():t;if(o&&t!==void 0)throw new Error(Cgt.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(r,e)&&(a=Reflect.getMetadata(r,e));var l=a[s];if(!Array.isArray(l))l=[];else for(var u=0,f=l;u{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});eS.inject=eS.LazyServiceIdentifer=void 0;var Aoe=Kl(),Moe=Lo(),Toe=Sf(),Mgt=Vp(),Ioe=function(){function r(e){this._cb=e}return r.prototype.unwrap=function(){return this._cb()},r}();eS.LazyServiceIdentifer=Ioe;function Loe(r){return function(e,t,n){if(r===void 0)throw new Error(Aoe.UNDEFINED_INJECT_ANNOTATION(e.name));var i=new Toe.Metadata(Moe.INJECT_TAG,r);typeof n=="number"?Mgt.tagParameter(e,t,n,i):Mgt.tagProperty(e,t,i)}}eS.inject=Loe});var Tgt=ft(jR=>{"use strict";Object.defineProperty(jR,"__esModule",{value:!0});jR.QueryableString=void 0;var Ooe=function(){function r(e){this.str=e}return r.prototype.startsWith=function(e){return this.str.indexOf(e)===0},r.prototype.endsWith=function(e){var t="",n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},r.prototype.contains=function(e){return this.str.indexOf(e)!==-1},r.prototype.equals=function(e){return this.str===e},r.prototype.value=function(){return this.str},r}();jR.QueryableString=Ooe});var AH=ft(WR=>{"use strict";Object.defineProperty(WR,"__esModule",{value:!0});WR.Target=void 0;var Hp=Lo(),Doe=Eg(),Igt=Sf(),Poe=Tgt(),koe=function(){function r(e,t,n,i){this.id=Doe.id(),this.type=e,this.serviceIdentifier=n,this.name=new Poe.QueryableString(t||""),this.metadata=new Array;var a=null;typeof i=="string"?a=new Igt.Metadata(Hp.NAMED_TAG,i):i instanceof Igt.Metadata&&(a=i),a!==null&&this.metadata.push(a)}return r.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t{"use strict";var VR=rd&&rd.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t0,f=l.length>t.length,c=u||f?l.length:t.length,h=Boe(n,e,a,s,c),d=kgt(r,t),p=VR(VR([],h),d);return p}function Foe(r,e,t,n,i){var a=i[r.toString()]||[],o=Ngt(a),s=o.unmanaged!==!0,l=n[r],u=o.inject||o.multiInject;if(l=u||l,l instanceof Roe.LazyServiceIdentifer&&(l=l.unwrap()),s){var f=l===Object,c=l===Function,h=l===void 0,d=f||c||h;if(!e&&d){var p=Lgt.MISSING_INJECT_ANNOTATION+" argument "+r+" in class "+t+".";throw new Error(p)}var v=new Dgt.Target(Ogt.TargetTypeEnum.ConstructorArgument,o.targetName,l);return v.metadata=a,v}return null}function Boe(r,e,t,n,i){for(var a=[],o=0;o0?s:Rgt(r,t)}else return 0}rd.getBaseClassDependencyCount=Rgt;function Ngt(r){var e={};return r.forEach(function(t){e[t.key.toString()]=t.value}),{inject:e[OM.INJECT_TAG],multiInject:e[OM.MULTI_INJECT_TAG],targetName:e[OM.NAME_TAG],unmanaged:e[OM.UNMANAGED_TAG]}}});var Bgt=ft(HR=>{"use strict";Object.defineProperty(HR,"__esModule",{value:!0});HR.Request=void 0;var Goe=Eg(),zoe=function(){function r(e,t,n,i,a){this.id=Goe.id(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=a,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=n===null?new Map:null}return r.prototype.addChildRequest=function(e,t,n){var i=new r(e,this.parentContext,this,t,n);return this.childRequests.push(i),i},r}();HR.Request=zoe});var Ygt=ft(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.getBindingDictionary=Mg.createMockRequest=Mg.plan=void 0;var YR=mgt(),TH=Kl(),Ggt=ed(),zgt=Lo(),Uoe=wH(),rS=tS(),Ugt=_gt(),IH=Sf(),joe=Sgt(),LH=Fgt(),OH=Bgt(),jgt=AH();function Wgt(r){return r._bindingDictionary}Mg.getBindingDictionary=Wgt;function Woe(r,e,t,n,i,a){var o=r?zgt.MULTI_INJECT_TAG:zgt.INJECT_TAG,s=new IH.Metadata(o,t),l=new jgt.Target(e,n,t,s);if(i!==void 0){var u=new IH.Metadata(i,a);l.metadata.push(u)}return l}function Vgt(r,e,t,n,i){var a=DM(t.container,i.serviceIdentifier),o=[];return a.length===YR.BindingCount.NoBindingsAvailable&&t.container.options.autoBindInjectable&&typeof i.serviceIdentifier=="function"&&r.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(t.container.bind(i.serviceIdentifier).toSelf(),a=DM(t.container,i.serviceIdentifier)),e?o=a:o=a.filter(function(s){var l=new OH.Request(s.serviceIdentifier,t,n,s,i);return s.constraint(l)}),Voe(i.serviceIdentifier,o,i,t.container),o}function Voe(r,e,t,n){switch(e.length){case YR.BindingCount.NoBindingsAvailable:if(t.isOptional())return e;var i=rS.getServiceIdentifierAsString(r),a=TH.NOT_REGISTERED;throw a+=rS.listMetadataForTarget(i,t),a+=rS.listRegisteredBindingsForServiceIdentifier(n,i,DM),new Error(a);case YR.BindingCount.OnlyOneBindingAvailable:if(!t.isArray())return e;case YR.BindingCount.MultipleBindingsAvailable:default:if(t.isArray())return e;var i=rS.getServiceIdentifierAsString(r),a=TH.AMBIGUOUS_MATCH+" "+i;throw a+=rS.listRegisteredBindingsForServiceIdentifier(n,i,DM),new Error(a)}}function Hgt(r,e,t,n,i,a){var o,s;if(i===null){o=Vgt(r,e,n,null,a),s=new OH.Request(t,n,null,o,a);var l=new joe.Plan(n,s);n.addPlan(l)}else o=Vgt(r,e,n,i,a),s=i.addChildRequest(a.serviceIdentifier,o,a);o.forEach(function(u){var f=null;if(a.isArray())f=s.addChildRequest(u.serviceIdentifier,u,a);else{if(u.cache)return;f=s}if(u.type===Ggt.BindingTypeEnum.Instance&&u.implementationType!==null){var c=LH.getDependencies(r,u.implementationType);if(!n.container.options.skipBaseClassChecks){var h=LH.getBaseClassDependencyCount(r,u.implementationType);if(c.length{"use strict";var Xoe=nS&&nS.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t0){var i=e.filter(function(o){return o.target!==null&&o.target.type===Xgt.TargetTypeEnum.ConstructorArgument}),a=i.map(t);n=Zoe(r,a),n=Koe(n,e,t)}else n=new r;return $oe(r,n),n}nS.resolveInstance=Qoe});var $gt=ft(XR=>{"use strict";Object.defineProperty(XR,"__esModule",{value:!0});XR.resolve=void 0;var Zgt=Kl(),Yp=ed(),Joe=wH(),tse=tS(),ese=Kgt(),DH=function(r,e,t){try{return t()}catch(n){throw Joe.isStackOverflowExeption(n)?new Error(Zgt.CIRCULAR_DEPENDENCY_IN_FACTORY(r,e.toString())):n}},PH=function(r){return function(e){e.parentContext.setCurrentRequest(e);var t=e.bindings,n=e.childRequests,i=e.target&&e.target.isArray(),a=!e.parentRequest||!e.parentRequest.target||!e.target||!e.parentRequest.target.matchesArray(e.target.serviceIdentifier);if(i&&a)return n.map(function(c){var h=PH(r);return h(c)});var o=null;if(e.target.isOptional()&&t.length===0)return;var s=t[0],l=s.scope===Yp.BindingScopeEnum.Singleton,u=s.scope===Yp.BindingScopeEnum.Request;if(l&&s.activated)return s.cache;if(u&&r!==null&&r.has(s.id))return r.get(s.id);if(s.type===Yp.BindingTypeEnum.ConstantValue)o=s.cache,s.activated=!0;else if(s.type===Yp.BindingTypeEnum.Function)o=s.cache,s.activated=!0;else if(s.type===Yp.BindingTypeEnum.Constructor)o=s.implementationType;else if(s.type===Yp.BindingTypeEnum.DynamicValue&&s.dynamicValue!==null)o=DH("toDynamicValue",s.serviceIdentifier,function(){return s.dynamicValue(e.parentContext)});else if(s.type===Yp.BindingTypeEnum.Factory&&s.factory!==null)o=DH("toFactory",s.serviceIdentifier,function(){return s.factory(e.parentContext)});else if(s.type===Yp.BindingTypeEnum.Provider&&s.provider!==null)o=DH("toProvider",s.serviceIdentifier,function(){return s.provider(e.parentContext)});else if(s.type===Yp.BindingTypeEnum.Instance&&s.implementationType!==null)o=ese.resolveInstance(s.implementationType,n,PH(r));else{var f=tse.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(Zgt.INVALID_BINDING_TYPE+" "+f)}return typeof s.onActivation=="function"&&(o=s.onActivation(e.parentContext,o)),l&&(s.cache=o,s.activated=!0),u&&r!==null&&!r.has(s.id)&&r.set(s.id,o),o}};function rse(r){var e=PH(r.plan.rootRequest.requestScope);return e(r.plan.rootRequest)}XR.resolve=rse});var kH=ft(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.typeConstraint=nd.namedConstraint=nd.taggedConstraint=nd.traverseAncerstors=void 0;var nse=Lo(),ise=Sf(),Qgt=function(r,e){var t=r.parentRequest;return t!==null?e(t)?!0:Qgt(t,e):!1};nd.traverseAncerstors=Qgt;var Jgt=function(r){return function(e){var t=function(n){return n!==null&&n.target!==null&&n.target.matchesTag(r)(e)};return t.metaData=new ise.Metadata(r,e),t}};nd.taggedConstraint=Jgt;var ase=Jgt(nse.NAMED_TAG);nd.namedConstraint=ase;var ose=function(r){return function(e){var t=null;if(e!==null)if(t=e.bindings[0],typeof r=="string"){var n=t.serviceIdentifier;return n===r}else{var i=e.bindings[0].implementationType;return r===i}return!1}};nd.typeConstraint=ose});var KR=ft(qR=>{"use strict";Object.defineProperty(qR,"__esModule",{value:!0});qR.BindingWhenSyntax=void 0;var nl=ZR(),Oo=kH(),sse=function(){function r(e){this._binding=e}return r.prototype.when=function(e){return this._binding.constraint=e,new nl.BindingOnSyntax(this._binding)},r.prototype.whenTargetNamed=function(e){return this._binding.constraint=Oo.namedConstraint(e),new nl.BindingOnSyntax(this._binding)},r.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){var t=e.target!==null&&!e.target.isNamed()&&!e.target.isTagged();return t},new nl.BindingOnSyntax(this._binding)},r.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=Oo.taggedConstraint(e)(t),new nl.BindingOnSyntax(this._binding)},r.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return Oo.typeConstraint(e)(t.parentRequest)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return Oo.namedConstraint(e)(t.parentRequest)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return Oo.taggedConstraint(e)(t)(n.parentRequest)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return Oo.traverseAncerstors(t,Oo.typeConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return!Oo.traverseAncerstors(t,Oo.typeConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return Oo.traverseAncerstors(t,Oo.namedConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return!Oo.traverseAncerstors(t,Oo.namedConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return Oo.traverseAncerstors(n,Oo.taggedConstraint(e)(t))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return!Oo.traverseAncerstors(n,Oo.taggedConstraint(e)(t))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return Oo.traverseAncerstors(t,e)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return!Oo.traverseAncerstors(t,e)},new nl.BindingOnSyntax(this._binding)},r}();qR.BindingWhenSyntax=sse});var ZR=ft($R=>{"use strict";Object.defineProperty($R,"__esModule",{value:!0});$R.BindingOnSyntax=void 0;var lse=KR(),use=function(){function r(e){this._binding=e}return r.prototype.onActivation=function(e){return this._binding.onActivation=e,new lse.BindingWhenSyntax(this._binding)},r}();$R.BindingOnSyntax=use});var RH=ft(QR=>{"use strict";Object.defineProperty(QR,"__esModule",{value:!0});QR.BindingWhenOnSyntax=void 0;var fse=ZR(),cse=KR(),hse=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new cse.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new fse.BindingOnSyntax(this._binding)}return r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r}();QR.BindingWhenOnSyntax=hse});var tyt=ft(JR=>{"use strict";Object.defineProperty(JR,"__esModule",{value:!0});JR.BindingInSyntax=void 0;var NH=ed(),FH=RH(),dse=function(){function r(e){this._binding=e}return r.prototype.inRequestScope=function(){return this._binding.scope=NH.BindingScopeEnum.Request,new FH.BindingWhenOnSyntax(this._binding)},r.prototype.inSingletonScope=function(){return this._binding.scope=NH.BindingScopeEnum.Singleton,new FH.BindingWhenOnSyntax(this._binding)},r.prototype.inTransientScope=function(){return this._binding.scope=NH.BindingScopeEnum.Transient,new FH.BindingWhenOnSyntax(this._binding)},r}();JR.BindingInSyntax=dse});var eyt=ft(tN=>{"use strict";Object.defineProperty(tN,"__esModule",{value:!0});tN.BindingInWhenOnSyntax=void 0;var pse=tyt(),vse=ZR(),mse=KR(),gse=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new mse.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new vse.BindingOnSyntax(this._binding),this._bindingInSyntax=new pse.BindingInSyntax(e)}return r.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},r.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},r.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r}();tN.BindingInWhenOnSyntax=gse});var iyt=ft(eN=>{"use strict";Object.defineProperty(eN,"__esModule",{value:!0});eN.BindingToSyntax=void 0;var ryt=Kl(),Zl=ed(),nyt=eyt(),PM=RH(),yse=function(){function r(e){this._binding=e}return r.prototype.to=function(e){return this._binding.type=Zl.BindingTypeEnum.Instance,this._binding.implementationType=e,new nyt.BindingInWhenOnSyntax(this._binding)},r.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+ryt.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},r.prototype.toConstantValue=function(e){return this._binding.type=Zl.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toDynamicValue=function(e){return this._binding.type=Zl.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new nyt.BindingInWhenOnSyntax(this._binding)},r.prototype.toConstructor=function(e){return this._binding.type=Zl.BindingTypeEnum.Constructor,this._binding.implementationType=e,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toFactory=function(e){return this._binding.type=Zl.BindingTypeEnum.Factory,this._binding.factory=e,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toFunction=function(e){if(typeof e!="function")throw new Error(ryt.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=Zl.BindingTypeEnum.Function,this._binding.scope=Zl.BindingScopeEnum.Singleton,t},r.prototype.toAutoFactory=function(e){return this._binding.type=Zl.BindingTypeEnum.Factory,this._binding.factory=function(t){var n=function(){return t.container.get(e)};return n},this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toProvider=function(e){return this._binding.type=Zl.BindingTypeEnum.Provider,this._binding.provider=e,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toService=function(e){this.toDynamicValue(function(t){return t.container.get(e)})},r}();eN.BindingToSyntax=yse});var ayt=ft(rN=>{"use strict";Object.defineProperty(rN,"__esModule",{value:!0});rN.ContainerSnapshot=void 0;var xse=function(){function r(){}return r.of=function(e,t){var n=new r;return n.bindings=e,n.middleware=t,n},r}();rN.ContainerSnapshot=xse});var oyt=ft(nN=>{"use strict";Object.defineProperty(nN,"__esModule",{value:!0});nN.Lookup=void 0;var $0=Kl(),bse=function(){function r(){this._map=new Map}return r.prototype.getMap=function(){return this._map},r.prototype.add=function(e,t){if(e==null)throw new Error($0.NULL_ARGUMENT);if(t==null)throw new Error($0.NULL_ARGUMENT);var n=this._map.get(e);n!==void 0?(n.push(t),this._map.set(e,n)):this._map.set(e,[t])},r.prototype.get=function(e){if(e==null)throw new Error($0.NULL_ARGUMENT);var t=this._map.get(e);if(t!==void 0)return t;throw new Error($0.KEY_NOT_FOUND)},r.prototype.remove=function(e){if(e==null)throw new Error($0.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error($0.KEY_NOT_FOUND)},r.prototype.removeByCondition=function(e){var t=this;this._map.forEach(function(n,i){var a=n.filter(function(o){return!e(o)});a.length>0?t._map.set(i,a):t._map.delete(i)})},r.prototype.hasKey=function(e){if(e==null)throw new Error($0.NULL_ARGUMENT);return this._map.has(e)},r.prototype.clone=function(){var e=new r;return this._map.forEach(function(t,n){t.forEach(function(i){return e.add(n,i.clone())})}),e},r.prototype.traverse=function(e){this._map.forEach(function(t,n){e(n,t)})},r}();nN.Lookup=bse});var lyt=ft(id=>{"use strict";var _se=id&&id.__awaiter||function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},Sse=id&&id.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});iS.AsyncContainerModule=iS.ContainerModule=void 0;var uyt=Eg(),Dse=function(){function r(e){this.id=uyt.id(),this.registry=e}return r}();iS.ContainerModule=Dse;var Pse=function(){function r(e){this.id=uyt.id(),this.registry=e}return r}();iS.AsyncContainerModule=Pse});var cyt=ft(aN=>{"use strict";Object.defineProperty(aN,"__esModule",{value:!0});aN.injectable=void 0;var kse=Kl(),GH=Lo();function Rse(){return function(r){if(Reflect.hasOwnMetadata(GH.PARAM_TYPES,r))throw new Error(kse.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(GH.DESIGN_PARAM_TYPES,r)||[];return Reflect.defineMetadata(GH.PARAM_TYPES,e,r),r}}aN.injectable=Rse});var dyt=ft(oN=>{"use strict";Object.defineProperty(oN,"__esModule",{value:!0});oN.tagged=void 0;var Nse=Sf(),hyt=Vp();function Fse(r,e){return function(t,n,i){var a=new Nse.Metadata(r,e);typeof i=="number"?hyt.tagParameter(t,n,i,a):hyt.tagProperty(t,n,a)}}oN.tagged=Fse});var vyt=ft(sN=>{"use strict";Object.defineProperty(sN,"__esModule",{value:!0});sN.named=void 0;var Bse=Lo(),Gse=Sf(),pyt=Vp();function zse(r){return function(e,t,n){var i=new Gse.Metadata(Bse.NAMED_TAG,r);typeof n=="number"?pyt.tagParameter(e,t,n,i):pyt.tagProperty(e,t,i)}}sN.named=zse});var gyt=ft(lN=>{"use strict";Object.defineProperty(lN,"__esModule",{value:!0});lN.optional=void 0;var Use=Lo(),jse=Sf(),myt=Vp();function Wse(){return function(r,e,t){var n=new jse.Metadata(Use.OPTIONAL_TAG,!0);typeof t=="number"?myt.tagParameter(r,e,t,n):myt.tagProperty(r,e,n)}}lN.optional=Wse});var yyt=ft(uN=>{"use strict";Object.defineProperty(uN,"__esModule",{value:!0});uN.unmanaged=void 0;var Vse=Lo(),Hse=Sf(),Yse=Vp();function Xse(){return function(r,e,t){var n=new Hse.Metadata(Vse.UNMANAGED_TAG,!0);Yse.tagParameter(r,e,t,n)}}uN.unmanaged=Xse});var byt=ft(fN=>{"use strict";Object.defineProperty(fN,"__esModule",{value:!0});fN.multiInject=void 0;var qse=Lo(),Kse=Sf(),xyt=Vp();function Zse(r){return function(e,t,n){var i=new Kse.Metadata(qse.MULTI_INJECT_TAG,r);typeof n=="number"?xyt.tagParameter(e,t,n,i):xyt.tagProperty(e,t,i)}}fN.multiInject=Zse});var _yt=ft(cN=>{"use strict";Object.defineProperty(cN,"__esModule",{value:!0});cN.targetName=void 0;var $se=Lo(),Qse=Sf(),Jse=Vp();function tle(r){return function(e,t,n){var i=new Qse.Metadata($se.NAME_TAG,r);Jse.tagParameter(e,t,n,i)}}cN.targetName=tle});var Syt=ft(hN=>{"use strict";Object.defineProperty(hN,"__esModule",{value:!0});hN.postConstruct=void 0;var ele=Kl(),zH=Lo(),rle=Sf();function nle(){return function(r,e,t){var n=new rle.Metadata(zH.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(zH.POST_CONSTRUCT,r.constructor))throw new Error(ele.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(zH.POST_CONSTRUCT,n,r.constructor)}}hN.postConstruct=nle});var Cyt=ft(dN=>{"use strict";Object.defineProperty(dN,"__esModule",{value:!0});dN.multiBindToService=void 0;var ile=function(r){return function(e){return function(){for(var t=[],n=0;n{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.multiBindToService=Wr.getServiceIdentifierAsString=Wr.typeConstraint=Wr.namedConstraint=Wr.taggedConstraint=Wr.traverseAncerstors=Wr.decorate=Wr.id=Wr.MetadataReader=Wr.postConstruct=Wr.targetName=Wr.multiInject=Wr.unmanaged=Wr.optional=Wr.LazyServiceIdentifer=Wr.inject=Wr.named=Wr.tagged=Wr.injectable=Wr.ContainerModule=Wr.AsyncContainerModule=Wr.TargetTypeEnum=Wr.BindingTypeEnum=Wr.BindingScopeEnum=Wr.Container=Wr.METADATA_KEY=void 0;var ale=Lo();Wr.METADATA_KEY=ale;var ole=lyt();Object.defineProperty(Wr,"Container",{enumerable:!0,get:function(){return ole.Container}});var UH=ed();Object.defineProperty(Wr,"BindingScopeEnum",{enumerable:!0,get:function(){return UH.BindingScopeEnum}});Object.defineProperty(Wr,"BindingTypeEnum",{enumerable:!0,get:function(){return UH.BindingTypeEnum}});Object.defineProperty(Wr,"TargetTypeEnum",{enumerable:!0,get:function(){return UH.TargetTypeEnum}});var wyt=fyt();Object.defineProperty(Wr,"AsyncContainerModule",{enumerable:!0,get:function(){return wyt.AsyncContainerModule}});Object.defineProperty(Wr,"ContainerModule",{enumerable:!0,get:function(){return wyt.ContainerModule}});var sle=cyt();Object.defineProperty(Wr,"injectable",{enumerable:!0,get:function(){return sle.injectable}});var lle=dyt();Object.defineProperty(Wr,"tagged",{enumerable:!0,get:function(){return lle.tagged}});var ule=vyt();Object.defineProperty(Wr,"named",{enumerable:!0,get:function(){return ule.named}});var Eyt=EH();Object.defineProperty(Wr,"inject",{enumerable:!0,get:function(){return Eyt.inject}});Object.defineProperty(Wr,"LazyServiceIdentifer",{enumerable:!0,get:function(){return Eyt.LazyServiceIdentifer}});var fle=gyt();Object.defineProperty(Wr,"optional",{enumerable:!0,get:function(){return fle.optional}});var cle=yyt();Object.defineProperty(Wr,"unmanaged",{enumerable:!0,get:function(){return cle.unmanaged}});var hle=byt();Object.defineProperty(Wr,"multiInject",{enumerable:!0,get:function(){return hle.multiInject}});var dle=_yt();Object.defineProperty(Wr,"targetName",{enumerable:!0,get:function(){return dle.targetName}});var ple=Syt();Object.defineProperty(Wr,"postConstruct",{enumerable:!0,get:function(){return ple.postConstruct}});var vle=CH();Object.defineProperty(Wr,"MetadataReader",{enumerable:!0,get:function(){return vle.MetadataReader}});var mle=Eg();Object.defineProperty(Wr,"id",{enumerable:!0,get:function(){return mle.id}});var gle=Vp();Object.defineProperty(Wr,"decorate",{enumerable:!0,get:function(){return gle.decorate}});var pN=kH();Object.defineProperty(Wr,"traverseAncerstors",{enumerable:!0,get:function(){return pN.traverseAncerstors}});Object.defineProperty(Wr,"taggedConstraint",{enumerable:!0,get:function(){return pN.taggedConstraint}});Object.defineProperty(Wr,"namedConstraint",{enumerable:!0,get:function(){return pN.namedConstraint}});Object.defineProperty(Wr,"typeConstraint",{enumerable:!0,get:function(){return pN.typeConstraint}});var yle=tS();Object.defineProperty(Wr,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return yle.getServiceIdentifierAsString}});var xle=Cyt();Object.defineProperty(Wr,"multiBindToService",{enumerable:!0,get:function(){return xle.multiBindToService}})});var Nxt=ft(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var GM=Symbol.for("INJECTION");function bN(r,e,t,n){function i(){return n&&!Reflect.hasMetadata(GM,this,e)&&Reflect.defineMetadata(GM,t(),this,e),Reflect.hasMetadata(GM,this,e)?Reflect.getMetadata(GM,this,e):t()}function a(o){Reflect.defineMetadata(GM,o,this,e)}Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:i,set:a})}function yue(r,e){return function(t){return function(n,i){var a=function(){return r.get(t)};bN(n,i,a,e)}}}hS.makePropertyInjectDecorator=yue;function xue(r,e){return function(t,n){return function(i,a){var o=function(){return r.getNamed(t,n)};bN(i,a,o,e)}}}hS.makePropertyInjectNamedDecorator=xue;function bue(r,e){return function(t,n,i){return function(a,o){var s=function(){return r.getTagged(t,n,i)};bN(a,o,s,e)}}}hS.makePropertyInjectTaggedDecorator=bue;function _ue(r,e){return function(t){return function(n,i){var a=function(){return r.getAll(t)};bN(n,i,a,e)}}}hS.makePropertyMultiInjectDecorator=_ue});var Fxt=ft(hY=>{"use strict";Object.defineProperty(hY,"__esModule",{value:!0});var _N=Nxt();function Sue(r,e){e===void 0&&(e=!0);var t=_N.makePropertyInjectDecorator(r,e),n=_N.makePropertyInjectNamedDecorator(r,e),i=_N.makePropertyInjectTaggedDecorator(r,e),a=_N.makePropertyMultiInjectDecorator(r,e);return{lazyInject:t,lazyInjectNamed:n,lazyInjectTagged:i,lazyMultiInject:a}}hY.default=Sue});var Ac=ft(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});var Pue;(function(r){r.TextureCompressionBC="texture-compression-bc"})(Pue=Rr.ExtensionName||(Rr.ExtensionName={}));var kue;(function(r){r.ClampToEdge="clamp-to-edge",r.Repeat="repeat",r.MirrorRepeat="mirror-repeat"})(kue=Rr.AddressMode||(Rr.AddressMode={}));var Rue;(function(r){r.UniformBuffer="uniform-buffer",r.StorageBuffer="storage-buffer",r.ReadonlyStorageBuffer="readonly-storage-buffer",r.Sampler="sampler",r.ComparisonSampler="comparison-sampler",r.SampledTexture="sampled-texture",r.ReadonlyStorageTexture="readonly-storage-texture",r.WriteonlyStorageTexture="writeonly-storage-texture"})(Rue=Rr.BindingType||(Rr.BindingType={}));var Nue;(function(r){r.Zero="zero",r.One="one",r.SrcColor="src-color",r.OneMinusSrcColor="one-minus-src-color",r.SrcAlpha="src-alpha",r.OneMinusSrcAlpha="one-minus-src-alpha",r.DstColor="dst-color",r.OneMinusDstColor="one-minus-dst-color",r.DstAlpha="dst-alpha",r.OneMinusDstAlpha="one-minus-dst-alpha",r.SrcAlphaSaturated="src-alpha-saturated",r.BlendColor="blend-color",r.OneMinusBlendColor="one-minus-blend-color"})(Nue=Rr.BlendFactor||(Rr.BlendFactor={}));var Fue;(function(r){r.Add="add",r.Subtract="subtract",r.ReverseSubtract="reverse-subtract",r.Min="min",r.Max="max"})(Fue=Rr.BlendOperation||(Rr.BlendOperation={}));var Bue;(function(r){r.Never="never",r.Less="less",r.Equal="equal",r.LessEqual="less-equal",r.Greater="greater",r.NotEqual="not-equal",r.GreaterEqual="greater-equal",r.Always="always"})(Bue=Rr.CompareFunction||(Rr.CompareFunction={}));var Gue;(function(r){r.None="none",r.Front="front",r.Back="back"})(Gue=Rr.CullMode||(Rr.CullMode={}));var zue;(function(r){r.Nearest="nearest",r.Linear="linear"})(zue=Rr.FilterMode||(Rr.FilterMode={}));var Uue;(function(r){r.CCW="ccw",r.CW="cw"})(Uue=Rr.FrontFace||(Rr.FrontFace={}));var jue;(function(r){r.Uint16="uint16",r.Uint32="uint32"})(jue=Rr.IndexFormat||(Rr.IndexFormat={}));var Wue;(function(r){r.Vertex="vertex",r.Instance="instance"})(Wue=Rr.InputStepMode||(Rr.InputStepMode={}));var Vue;(function(r){r.Load="load"})(Vue=Rr.LoadOp||(Rr.LoadOp={}));var Hue;(function(r){r.PointList="point-list",r.LineList="line-list",r.LineStrip="line-strip",r.TriangleList="triangle-list",r.TriangleStrip="triangle-strip"})(Hue=Rr.PrimitiveTopology||(Rr.PrimitiveTopology={}));var Yue;(function(r){r.Keep="keep",r.Zero="zero",r.Replace="replace",r.Invert="invert",r.IncrementClamp="increment-clamp",r.DecrementClamp="decrement-clamp",r.IncrementWrap="increment-wrap",r.DecrementWrap="decrement-wrap"})(Yue=Rr.StencilOperation||(Rr.StencilOperation={}));var Xue;(function(r){r.Store="store",r.Clear="clear"})(Xue=Rr.StoreOp||(Rr.StoreOp={}));var que;(function(r){r.E1d="1d",r.E2d="2d",r.E3d="3d"})(que=Rr.TextureDimension||(Rr.TextureDimension={}));var Kue;(function(r){r.R8Unorm="r8unorm",r.R8Snorm="r8snorm",r.R8Uint="r8uint",r.R8Sint="r8sint",r.R16Uint="r16uint",r.R16Sint="r16sint",r.R16Float="r16float",r.RG8Unorm="rg8unorm",r.RG8Snorm="rg8snorm",r.RG8Uint="rg8uint",r.RG8Sint="rg8sint",r.R32Uint="r32uint",r.R32Sint="r32sint",r.R32Float="r32float",r.RG16Uint="rg16uint",r.RG16Sint="rg16sint",r.RG16Float="rg16float",r.RGBA8Unorm="rgba8unorm",r.RGBA8UnormSRGB="rgba8unorm-srgb",r.RGBA8Snorm="rgba8snorm",r.RGBA8Uint="rgba8uint",r.RGBA8Sint="rgba8sint",r.BGRA8Unorm="bgra8unorm",r.BGRA8UnormSRGB="bgra8unorm-srgb",r.RGB10A2Unorm="rgb10a2unorm",r.RG11B10Float="rg11b10float",r.RG32Uint="rg32uint",r.RG32Sint="rg32sint",r.RG32Float="rg32float",r.RGBA16Uint="rgba16uint",r.RGBA16Sint="rgba16sint",r.RGBA16Float="rgba16float",r.RGBA32Uint="rgba32uint",r.RGBA32Sint="rgba32sint",r.RGBA32Float="rgba32float",r.Depth32Float="depth32float",r.Depth24Plus="depth24plus",r.Depth24PlusStencil8="depth24plus-stencil8"})(Kue=Rr.TextureFormat||(Rr.TextureFormat={}));var Zue;(function(r){r.Float="float",r.Sint="sint",r.Uint="uint"})(Zue=Rr.TextureComponentType||(Rr.TextureComponentType={}));var $ue;(function(r){r.E1d="1d",r.E2d="2d",r.E2dArray="2d-array",r.Cube="cube",r.CubeArray="cube-array",r.E3d="3d"})($ue=Rr.TextureViewDimension||(Rr.TextureViewDimension={}));var Que;(function(r){r.Uchar2="uchar2",r.Uchar4="uchar4",r.Char2="char2",r.Char4="char4",r.Uchar2Norm="uchar2norm",r.Uchar4Norm="uchar4norm",r.Char2Norm="char2norm",r.Char4Norm="char4norm",r.Ushort2="ushort2",r.Ushort4="ushort4",r.Short2="short2",r.Short4="short4",r.Ushort2Norm="ushort2norm",r.Ushort4Norm="ushort4norm",r.Short2Norm="short2norm",r.Short4Norm="short4norm",r.Half2="half2",r.Half4="half4",r.Float="float",r.Float2="float2",r.Float3="float3",r.Float4="float4",r.Uint="uint",r.Uint2="uint2",r.Uint3="uint3",r.Uint4="uint4",r.Int="int",r.Int2="int2",r.Int3="int3",r.Int4="int4"})(Que=Rr.VertexFormat||(Rr.VertexFormat={}));var Jue;(function(r){r.All="all",r.StencilOnly="stencil-only",r.DepthOnly="depth-only"})(Jue=Rr.TextureAspect||(Rr.TextureAspect={}));var tfe;(function(r){r.Error="error",r.Warning="warning",r.Info="info"})(tfe=Rr.CompilationMessageType||(Rr.CompilationMessageType={}));var efe;(function(r){r.Occlusion="occlusion"})(efe=Rr.QueryType||(Rr.QueryType={}));var rfe;(function(r){r[r.MapRead=1]="MapRead",r[r.MapWrite=2]="MapWrite",r[r.CopySrc=4]="CopySrc",r[r.CopyDst=8]="CopyDst",r[r.Index=16]="Index",r[r.Vertex=32]="Vertex",r[r.Uniform=64]="Uniform",r[r.Storage=128]="Storage",r[r.Indirect=256]="Indirect",r[r.QueryResolve=512]="QueryResolve"})(rfe=Rr.BufferUsage||(Rr.BufferUsage={}));var nfe;(function(r){r[r.Red=1]="Red",r[r.Green=2]="Green",r[r.Blue=4]="Blue",r[r.Alpha=8]="Alpha",r[r.All=15]="All"})(nfe=Rr.ColorWrite||(Rr.ColorWrite={}));var ife;(function(r){r[r.Vertex=1]="Vertex",r[r.Fragment=2]="Fragment",r[r.Compute=4]="Compute"})(ife=Rr.ShaderStage||(Rr.ShaderStage={}));var afe;(function(r){r[r.CopySrc=1]="CopySrc",r[r.CopyDst=2]="CopyDst",r[r.Sampled=4]="Sampled",r[r.Storage=8]="Storage",r[r.OutputAttachment=16]="OutputAttachment"})(afe=Rr.TextureUsage||(Rr.TextureUsage={}));var ofe;(function(r){r[r.Read=1]="Read",r[r.Write=2]="Write"})(ofe=Rr.MapMode||(Rr.MapMode={}))});var Jbt=ft((_Y,SY)=>{(function(r,e){typeof _Y=="object"&&typeof SY!="undefined"?SY.exports=e():typeof define=="function"&&define.amd?define(e):r.createREGL=e()})(_Y,function(){"use strict";var r=function(B){return B instanceof Uint8Array||B instanceof Uint16Array||B instanceof Uint32Array||B instanceof Int8Array||B instanceof Int16Array||B instanceof Int32Array||B instanceof Float32Array||B instanceof Float64Array||B instanceof Uint8ClampedArray},e=function(B,Z){for(var ct=Object.keys(Z),Gt=0;Gt=0&&(B|0)===B||i("invalid parameter type, ("+B+")"+o(Z)+". must be a nonnegative integer")}function h(B,Z,ct){Z.indexOf(B)<0&&i("invalid value"+o(ct)+". must be one of: "+Z)}var d=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function p(B){Object.keys(B).forEach(function(Z){d.indexOf(Z)<0&&i('invalid regl constructor argument "'+Z+'". must be one of '+d)})}function v(B,Z){for(B=B+"";B.length0&&Z.push(new x("unknown",0,ct))}}),Z}function A(B,Z){Z.forEach(function(ct){var Gt=B[ct.file];if(Gt){var Jt=Gt.index[ct.line];if(Jt){Jt.errors.push(ct),Gt.hasErrors=!0;return}}B.unknown.hasErrors=!0,B.unknown.lines[0].errors.push(ct)})}function L(B,Z,ct,Gt,Jt){if(!B.getShaderParameter(Z,B.COMPILE_STATUS)){var zt=B.getShaderInfoLog(Z),Vt=Gt===B.FRAGMENT_SHADER?"fragment":"vertex";F(ct,"string",Vt+" shader source must be a string",Jt);var ve=C(ct,Jt),le=w(zt);A(ve,le),Object.keys(ve).forEach(function(Ce){var ye=ve[Ce];if(!ye.hasErrors)return;var Ie=[""],Be=[""];function me(Pe,Ot){Ie.push(Pe),Be.push(Ot||"")}me("file number "+Ce+": "+ye.name+` `,"color:red;text-decoration:underline;font-weight:bold"),ye.lines.forEach(function(Pe){if(Pe.errors.length>0){me(v(Pe.number,4)+"| ","background-color:yellow; font-weight:bold"),me(Pe.line+t,"color:red; background-color:yellow; font-weight:bold");var Ot=0;Pe.errors.forEach(function(Yt){var pe=Yt.message,Le=/^\s*'(.*)'\s*:\s*(.*)$/.exec(pe);if(Le){var ue=Le[1];switch(pe=Le[2],ue){case"assign":ue="=";break}Ot=Math.max(Pe.line.indexOf(ue,Ot),0)}else Ot=0;me(v("| ",6)),me(v("^^^",Ot+3)+t,"font-weight:bold"),me(v("| ",6)),me(pe+t,"font-weight:bold")}),me(v("| ",6)+t)}else me(v(Pe.number,4)+"| "),me(Pe.line+t,"color:red")}),typeof document!="undefined"&&!window.chrome?(Be[0]=Ie.join("%c"),console.log.apply(console,Be)):console.log(Ie.join(""))}),a.raise("Error compiling "+Vt+" shader, "+ve[0].name)}}function k(B,Z,ct,Gt,Jt){if(!B.getProgramParameter(Z,B.LINK_STATUS)){var zt=B.getProgramInfoLog(Z),Vt=C(ct,Jt),ve=C(Gt,Jt),le='Error linking program with vertex shader, "'+ve[0].name+'", and fragment shader "'+Vt[0].name+'"';typeof document!="undefined"?console.log("%c"+le+t+"%c"+zt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(le+t+zt),a.raise(le)}}function O(B){B._commandRef=b()}function M(B,Z,ct,Gt){O(B);function Jt(le){return le?Gt.id(le):0}B._fragId=Jt(B.static.frag),B._vertId=Jt(B.static.vert);function zt(le,Ce){Object.keys(Ce).forEach(function(ye){le[Gt.id(ye)]=!0})}var Vt=B._uniformSet={};zt(Vt,Z.static),zt(Vt,Z.dynamic);var ve=B._attributeSet={};zt(ve,ct.static),zt(ve,ct.dynamic),B._hasCount="count"in B.static||"count"in B.dynamic||"elements"in B.static||"elements"in B.dynamic}function I(B,Z){var ct=S();i(B+" in command "+(Z||b())+(ct==="unknown"?"":" called from "+ct))}function R(B,Z,ct){B||I(Z,ct||b())}function P(B,Z,ct,Gt){B in Z||I("unknown parameter ("+B+")"+o(ct)+". possible values: "+Object.keys(Z).join(),Gt||b())}function F(B,Z,ct,Gt){u(B,Z)||I("invalid parameter type"+o(ct)+". expected "+Z+", got "+typeof B,Gt||b())}function D(B){B()}function G(B,Z,ct){B.texture?h(B.texture._texture.internalformat,Z,"unsupported texture format for attachment"):h(B.renderbuffer._renderbuffer.format,ct,"unsupported renderbuffer format for attachment")}var U=33071,j=9728,H=9984,tt=9985,et=9986,ut=9987,$=5120,st=5121,_t=5122,dt=5123,gt=5124,Tt=5125,Ut=5126,$t=32819,Y=32820,it=33635,K=34042,Rt=36193,Xt={};Xt[$]=Xt[st]=1,Xt[_t]=Xt[dt]=Xt[Rt]=Xt[it]=Xt[$t]=Xt[Y]=2,Xt[gt]=Xt[Tt]=Xt[Ut]=Xt[K]=4;function Zt(B,Z){return B===Y||B===$t||B===it?2:B===K?4:Xt[B]*Z}function Ae(B){return!(B&B-1)&&!!B}function We(B,Z,ct){var Gt,Jt=Z.width,zt=Z.height,Vt=Z.channels;a(Jt>0&&Jt<=ct.maxTextureSize&&zt>0&&zt<=ct.maxTextureSize,"invalid texture shape"),(B.wrapS!==U||B.wrapT!==U)&&a(Ae(Jt)&&Ae(zt),"incompatible wrap mode for texture, both width and height must be power of 2"),Z.mipmask===1?Jt!==1&&zt!==1&&a(B.minFilter!==H&&B.minFilter!==et&&B.minFilter!==tt&&B.minFilter!==ut,"min filter requires mipmap"):(a(Ae(Jt)&&Ae(zt),"texture must be a square power of 2 to support mipmapping"),a(Z.mipmask===(Jt<<1)-1,"missing or incomplete mipmap data")),Z.type===Ut&&(ct.extensions.indexOf("oes_texture_float_linear")<0&&a(B.minFilter===j&&B.magFilter===j,"filter not supported, must enable oes_texture_float_linear"),a(!B.genMipmaps,"mipmap generation not supported with float textures"));var ve=Z.images;for(Gt=0;Gt<16;++Gt)if(ve[Gt]){var le=Jt>>Gt,Ce=zt>>Gt;a(Z.mipmask&1<0&&Jt<=Gt.maxTextureSize&&zt>0&&zt<=Gt.maxTextureSize,"invalid texture shape"),a(Jt===zt,"cube map must be square"),a(Z.wrapS===U&&Z.wrapT===U,"wrap mode not supported by cube map");for(var ve=0;ve>ye,me=zt>>ye;a(le.mipmask&1<1&&Z===ct&&(Z==='"'||Z==="'"))return['"'+Wt(B.substr(1,B.length-2))+'"'];var Gt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(B);if(Gt)return ee(B.substr(0,Gt.index)).concat(ee(Gt[1])).concat(ee(B.substr(Gt.index+Gt[0].length)));var Jt=B.split(".");if(Jt.length===1)return['"'+Wt(B)+'"'];for(var zt=[],Vt=0;Vtge(ct,Z+"["+Gt+"]")));if(B instanceof St)return B;W(!1,"invalid option type in uniform "+Z)}var Ye={DynamicVariable:St,define:Ht,isDynamic:ae,unbox:ge,accessor:Ue},Ve={next:typeof requestAnimationFrame=="function"?function(B){return requestAnimationFrame(B)}:function(B){return setTimeout(B,16)},cancel:typeof cancelAnimationFrame=="function"?function(B){return cancelAnimationFrame(B)}:clearTimeout},$n=typeof performance!="undefined"&&performance.now?function(){return performance.now()}:function(){return+new Date};function ga(){var B={"":0},Z=[""];return{id:function(ct){var Gt=B[ct];return Gt||(Gt=B[ct]=Z.length,Z.push(ct),Gt)},str:function(ct){return Z[ct]}}}function _n(B,Z,ct){var Gt=document.createElement("canvas");e(Gt.style,{border:0,margin:0,padding:0,top:0,left:0}),B.appendChild(Gt),B===document.body&&(Gt.style.position="absolute",e(B.style,{margin:0,padding:0}));function Jt(){var ve=window.innerWidth,le=window.innerHeight;if(B!==document.body){var Ce=B.getBoundingClientRect();ve=Ce.right-Ce.left,le=Ce.bottom-Ce.top}Gt.width=ct*ve,Gt.height=ct*le,e(Gt.style,{width:ve+"px",height:le+"px"})}var zt;B!==document.body&&typeof ResizeObserver=="function"?(zt=new ResizeObserver(function(){setTimeout(Jt)}),zt.observe(B)):window.addEventListener("resize",Jt,!1);function Vt(){zt?zt.disconnect():window.removeEventListener("resize",Jt),B.removeChild(Gt)}return Jt(),{canvas:Gt,onDestroy:Vt}}function ii(B,Z){function ct(Gt){try{return B.getContext(Gt,Z)}catch(Jt){return null}}return ct("webgl")||ct("experimental-webgl")||ct("webgl-experimental")}function xi(B){return typeof B.nodeName=="string"&&typeof B.appendChild=="function"&&typeof B.getBoundingClientRect=="function"}function Ki(B){return typeof B.drawArrays=="function"||typeof B.drawElements=="function"}function En(B){return typeof B=="string"?B.split():(W(Array.isArray(B),"invalid extension array"),B)}function ci(B){return typeof B=="string"?(W(typeof document!="undefined","not supported outside of DOM"),document.querySelector(B)):B}function Nn(B){var Z=B||{},ct,Gt,Jt,zt,Vt={},ve=[],le=[],Ce=typeof window=="undefined"?1:window.devicePixelRatio,ye=!1,Ie=function(Pe){Pe&&W.raise(Pe)},Be=function(){};if(typeof Z=="string"?(W(typeof document!="undefined","selector queries only supported in DOM enviroments"),ct=document.querySelector(Z),W(ct,"invalid query string for element")):typeof Z=="object"?xi(Z)?ct=Z:Ki(Z)?(zt=Z,Jt=zt.canvas):(W.constructor(Z),"gl"in Z?zt=Z.gl:"canvas"in Z?Jt=ci(Z.canvas):"container"in Z&&(Gt=ci(Z.container)),"attributes"in Z&&(Vt=Z.attributes,W.type(Vt,"object","invalid context attributes")),"extensions"in Z&&(ve=En(Z.extensions)),"optionalExtensions"in Z&&(le=En(Z.optionalExtensions)),"onDone"in Z&&(W.type(Z.onDone,"function","invalid or missing onDone callback"),Ie=Z.onDone),"profile"in Z&&(ye=!!Z.profile),"pixelRatio"in Z&&(Ce=+Z.pixelRatio,W(Ce>0,"invalid pixel ratio"))):W.raise("invalid arguments to regl"),ct&&(ct.nodeName.toLowerCase()==="canvas"?Jt=ct:Gt=ct),!zt){if(!Jt){W(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var me=_n(Gt||document.body,Ie,Ce);if(!me)return null;Jt=me.canvas,Be=me.onDestroy}Vt.premultipliedAlpha===void 0&&(Vt.premultipliedAlpha=!0),zt=ii(Jt,Vt)}return zt?{gl:zt,canvas:Jt,container:Gt,extensions:ve,optionalExtensions:le,pixelRatio:Ce,profile:ye,onDone:Ie,onDestroy:Be}:(Be(),Ie("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Ia(B,Z){var ct={};function Gt(Vt){W.type(Vt,"string","extension name must be string");var ve=Vt.toLowerCase(),le;try{le=ct[ve]=B.getExtension(ve)}catch(Ce){}return!!le}for(var Jt=0;Jt65535)<<4,B>>>=Z,ct=(B>255)<<3,B>>>=ct,Z|=ct,ct=(B>15)<<2,B>>>=ct,Z|=ct,ct=(B>3)<<1,B>>>=ct,Z|=ct,Z|B>>1}function xs(){var B=Li(8,function(){return[]});function Z(zt){var Vt=yo(zt),ve=B[Oi(Vt)>>2];return ve.length>0?ve.pop():new ArrayBuffer(Vt)}function ct(zt){B[Oi(zt.byteLength)>>2].push(zt)}function Gt(zt,Vt){var ve=null;switch(zt){case ko:ve=new Int8Array(Z(Vt),0,Vt);break;case ku:ve=new Uint8Array(Z(Vt),0,Vt);break;case Ro:ve=new Int16Array(Z(2*Vt),0,Vt);break;case ys:ve=new Uint16Array(Z(2*Vt),0,Vt);break;case Jo:ve=new Int32Array(Z(4*Vt),0,Vt);break;case vl:ve=new Uint32Array(Z(4*Vt),0,Vt);break;case Fs:ve=new Float32Array(Z(4*Vt),0,Vt);break;default:return null}return ve.length!==Vt?ve.subarray(0,Vt):ve}function Jt(zt){ct(zt.buffer)}return{alloc:Z,free:ct,allocType:Gt,freeType:Jt}}var er=xs();er.zero=xs();var ai=3408,vn=3410,ji=3411,La=3412,Lf=3413,Of=3414,eu=3415,Df=33901,Pf=33902,kf=3379,pv=3386,uC=34921,vv=36347,fC=36348,cC=35661,RF=35660,CT=34930,wT=36349,ET=34076,NF=34024,FF=7936,BF=7937,GF=7938,AT=35724,MT=34047,TT=36063,hC=34852,xx=3553,dC=34067,bx=34069,IT=33984,Kg=6408,_x=5126,pC=5121,Zg=36160,zF=36053,LT=36064,vC=16384,mC=function(B,Z){var ct=1;Z.ext_texture_filter_anisotropic&&(ct=B.getParameter(MT));var Gt=1,Jt=1;Z.webgl_draw_buffers&&(Gt=B.getParameter(hC),Jt=B.getParameter(TT));var zt=!!Z.oes_texture_float;if(zt){var Vt=B.createTexture();B.bindTexture(xx,Vt),B.texImage2D(xx,0,Kg,1,1,0,Kg,_x,null);var ve=B.createFramebuffer();if(B.bindFramebuffer(Zg,ve),B.framebufferTexture2D(Zg,LT,xx,Vt,0),B.bindTexture(xx,null),B.checkFramebufferStatus(Zg)!==zF)zt=!1;else{B.viewport(0,0,1,1),B.clearColor(1,0,0,1),B.clear(vC);var le=er.allocType(_x,4);B.readPixels(0,0,1,1,Kg,_x,le),B.getError()?zt=!1:(B.deleteFramebuffer(ve),B.deleteTexture(Vt),zt=le[0]===1),er.freeType(le)}}var Ce=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ye=!0;if(!Ce){var Ie=B.createTexture(),Be=er.allocType(pC,36);B.activeTexture(IT),B.bindTexture(dC,Ie),B.texImage2D(bx,0,Kg,3,3,0,Kg,pC,Be),er.freeType(Be),B.bindTexture(dC,null),B.deleteTexture(Ie),ye=!B.getError()}return{colorBits:[B.getParameter(vn),B.getParameter(ji),B.getParameter(La),B.getParameter(Lf)],depthBits:B.getParameter(Of),stencilBits:B.getParameter(eu),subpixelBits:B.getParameter(ai),extensions:Object.keys(Z).filter(function(me){return!!Z[me]}),maxAnisotropic:ct,maxDrawbuffers:Gt,maxColorAttachments:Jt,pointSizeDims:B.getParameter(Df),lineWidthDims:B.getParameter(Pf),maxViewportDims:B.getParameter(pv),maxCombinedTextureUnits:B.getParameter(cC),maxCubeMapSize:B.getParameter(ET),maxRenderbufferSize:B.getParameter(NF),maxTextureUnits:B.getParameter(CT),maxTextureSize:B.getParameter(kf),maxAttributes:B.getParameter(uC),maxVertexUniforms:B.getParameter(vv),maxVertexTextureUnits:B.getParameter(RF),maxVaryingVectors:B.getParameter(fC),maxFragmentUniforms:B.getParameter(wT),glsl:B.getParameter(AT),renderer:B.getParameter(BF),vendor:B.getParameter(FF),version:B.getParameter(GF),readFloat:zt,npotTextureCube:ye}};function No(B){return!!B&&typeof B=="object"&&Array.isArray(B.shape)&&Array.isArray(B.stride)&&typeof B.offset=="number"&&B.shape.length===B.stride.length&&(Array.isArray(B.data)||r(B.data))}var bs=function(B){return Object.keys(B).map(function(Z){return B[Z]})},$g={shape:jF,flatten:DT};function UF(B,Z,ct){for(var Gt=0;Gt0){var Re;if(Array.isArray(Yt[0])){ce=Pi(Yt);for(var he=1,Oe=1;Oe0)if(typeof he[0]=="number"){var Ge=er.allocType(ue.dtype,he.length);CC(Ge,he),ce(Ge,vr),er.freeType(Ge)}else if(Array.isArray(he[0])||r(he[0])){Dr=Pi(he);var Me=Di(he,Dr,ue.dtype);ce(Me,vr),er.freeType(Me)}else W.raise("invalid buffer data")}else if(No(he)){Dr=he.shape;var fe=he.stride,Er=0,Vr=0,Je=0,on=0;Dr.length===1?(Er=Dr[0],Vr=1,Je=fe[0],on=0):Dr.length===2?(Er=Dr[0],Vr=Dr[1],Je=fe[0],on=fe[1]):W.raise("invalid shape");var Pr=Array.isArray(he.data)?ue.dtype:Cx(he.data),Kr=er.allocType(Pr,Er*Vr);RT(Kr,he.data,Er,Vr,Je,on,he.offset),ce(Kr,vr),er.freeType(Kr)}else W.raise("invalid data for buffer subdata");return He}return pe||He(Ot),He._reglType="buffer",He._buffer=ue,He.subdata=Re,ct.profile&&(He.stats=ue.stats),He.destroy=function(){Be(ue)},He}function Pe(){bs(zt).forEach(function(Ot){Ot.buffer=B.createBuffer(),B.bindBuffer(Ot.type,Ot.buffer),B.bufferData(Ot.type,Ot.persistentData||Ot.byteLength,Ot.usage)})}return ct.profile&&(Z.getTotalBufferSize=function(){var Ot=0;return Object.keys(zt).forEach(function(Yt){Ot+=zt[Yt].stats.size}),Ot}),{create:me,createStream:le,destroyStream:Ce,clear:function(){bs(zt).forEach(Be),ve.forEach(Be)},getBuffer:function(Ot){return Ot&&Ot._buffer instanceof Vt?Ot._buffer:null},restore:Pe,_initBuffer:Ie}}var wC=0,Sd=0,NT=1,EC=1,ml=4,FT=4,Cd={points:wC,point:Sd,lines:NT,line:EC,triangles:ml,triangle:FT,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},BT=0,GT=1,mv=4,zT=5120,to=5121,UT=5122,xo=5123,jT=5124,Nc=5125,Ru=34963,wx=35040,AC=35044;function Zi(B,Z,ct,Gt){var Jt={},zt=0,Vt={uint8:to,uint16:xo};Z.oes_element_index_uint&&(Vt.uint32=Nc);function ve(Pe){this.id=zt++,Jt[this.id]=this,this.buffer=Pe,this.primType=mv,this.vertCount=0,this.type=0}ve.prototype.bind=function(){this.buffer.bind()};var le=[];function Ce(Pe){var Ot=le.pop();return Ot||(Ot=new ve(ct.create(null,Ru,!0,!1)._buffer)),Ie(Ot,Pe,wx,-1,-1,0,0),Ot}function ye(Pe){le.push(Pe)}function Ie(Pe,Ot,Yt,pe,Le,ue,He){Pe.buffer.bind();var ce;if(Ot){var Re=He;!He&&(!r(Ot)||No(Ot)&&!r(Ot.data))&&(Re=Z.oes_element_index_uint?Nc:xo),ct._initBuffer(Pe.buffer,Ot,Yt,Re,3)}else B.bufferData(Ru,ue,Yt),Pe.buffer.dtype=ce||to,Pe.buffer.usage=Yt,Pe.buffer.dimension=3,Pe.buffer.byteLength=ue;if(ce=He,!He){switch(Pe.buffer.dtype){case to:case zT:ce=to;break;case xo:case UT:ce=xo;break;case Nc:case jT:ce=Nc;break;default:W.raise("unsupported type for element array")}Pe.buffer.dtype=ce}Pe.type=ce,W(ce!==Nc||!!Z.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var he=Le;he<0&&(he=Pe.buffer.byteLength,ce===xo?he>>=1:ce===Nc&&(he>>=2)),Pe.vertCount=he;var Oe=pe;if(pe<0){Oe=mv;var vr=Pe.buffer.dimension;vr===1&&(Oe=BT),vr===2&&(Oe=GT),vr===3&&(Oe=mv)}Pe.primType=Oe}function Be(Pe){Gt.elementsCount--,W(Pe.buffer!==null,"must not double destroy elements"),delete Jt[Pe.id],Pe.buffer.destroy(),Pe.buffer=null}function me(Pe,Ot){var Yt=ct.create(null,Ru,!0),pe=new ve(Yt._buffer);Gt.elementsCount++;function Le(ue){if(!ue)Yt(),pe.primType=mv,pe.vertCount=0,pe.type=to;else if(typeof ue=="number")Yt(ue),pe.primType=mv,pe.vertCount=ue|0,pe.type=to;else{var He=null,ce=AC,Re=-1,he=-1,Oe=0,vr=0;Array.isArray(ue)||r(ue)||No(ue)?He=ue:(W.type(ue,"object","invalid arguments for elements"),"data"in ue&&(He=ue.data,W(Array.isArray(He)||r(He)||No(He),"invalid data for element buffer")),"usage"in ue&&(W.parameter(ue.usage,Sx,"invalid element buffer usage"),ce=Sx[ue.usage]),"primitive"in ue&&(W.parameter(ue.primitive,Cd,"invalid element buffer primitive"),Re=Cd[ue.primitive]),"count"in ue&&(W(typeof ue.count=="number"&&ue.count>=0,"invalid vertex count for elements"),he=ue.count|0),"type"in ue&&(W.parameter(ue.type,Vt,"invalid buffer type"),vr=Vt[ue.type]),"length"in ue?Oe=ue.length|0:(Oe=he,vr===xo||vr===UT?Oe*=2:(vr===Nc||vr===jT)&&(Oe*=4))),Ie(pe,He,ce,Re,he,Oe,vr)}return Le}return Le(Pe),Le._reglType="elements",Le._elements=pe,Le.subdata=function(ue,He){return Yt.subdata(ue,He),Le},Le.destroy=function(){Be(pe)},Le}return{create:me,createStream:Ce,destroyStream:ye,getElements:function(Pe){return typeof Pe=="function"&&Pe._elements instanceof ve?Pe._elements:null},clear:function(){bs(Jt).forEach(Be)}}}var Rf=new Float32Array(1),MC=new Uint32Array(Rf.buffer),QF=5123;function Ex(B){for(var Z=er.allocType(QF,B.length),ct=0;ct>>31<<15,zt=(Gt<<1>>>24)-127,Vt=Gt>>13&(1<<10)-1;if(zt<-24)Z[ct]=Jt;else if(zt<-14){var ve=-14-zt;Z[ct]=Jt+(Vt+(1<<10)>>ve)}else zt>15?Z[ct]=Jt+31744:Z[ct]=Jt+(zt+15<<10)+Vt}return Z}function aa(B){return Array.isArray(B)||r(B)}var WT=function(B){return!(B&B-1)&&!!B},JF=34467,ru=3553,gv=34067,Nf=34069,wd=6408,Ax=6406,Qg=6407,Ed=6409,yv=6410,TC=32854,IC=32855,Mx=36194,LC=32819,tB=32820,VT=33635,Bs=34042,Jg=6402,Fc=34041,Tx=35904,Ix=35906,xv=36193,OC=33776,DC=33777,PC=33778,kC=33779,Ad=35986,HT=35987,YT=34798,Lx=35840,RC=35841,Ff=35842,ty=35843,XT=36196,bv=5121,NC=5123,Bc=5125,ts=5126,qT=10242,eB=10243,rB=10497,FC=33071,nB=33648,iB=10240,Gc=10241,kt=9728,de=9729,te=9984,pr=9985,fn=9986,Qn=9987,Ha=33170,hi=4352,BC=4353,aB=4354,gl=34046,Ox=3317,oB=37440,_v=37441,Dx=37443,ey=37444,Jn=33984,sB=[te,fn,pr,Qn],ry=[0,Ed,yv,Qg,wd],es={};es[Ed]=es[Ax]=es[Jg]=1,es[Fc]=es[yv]=2,es[Qg]=es[Tx]=3,es[wd]=es[Ix]=4;function Sv(B){return"[object "+B+"]"}var KT=Sv("HTMLCanvasElement"),ZT=Sv("OffscreenCanvas"),ny=Sv("CanvasRenderingContext2D"),Bf=Sv("ImageBitmap"),iy=Sv("HTMLImageElement"),GC=Sv("HTMLVideoElement"),Px=Object.keys(xC).concat([KT,ZT,ny,Bf,iy,GC]),Md=[];Md[bv]=1,Md[ts]=4,Md[xv]=2,Md[NC]=2,Md[Bc]=4;var Ya=[];Ya[TC]=2,Ya[IC]=2,Ya[Mx]=2,Ya[Fc]=4,Ya[OC]=.5,Ya[DC]=.5,Ya[PC]=1,Ya[kC]=1,Ya[Ad]=.5,Ya[HT]=1,Ya[YT]=1,Ya[Lx]=.5,Ya[RC]=.25,Ya[Ff]=.5,Ya[ty]=.25,Ya[XT]=.5;function ay(B){return Array.isArray(B)&&(B.length===0||typeof B[0]=="number")}function zC(B){if(!Array.isArray(B))return!1;var Z=B.length;return!(Z===0||!aa(B[0]))}function nu(B){return Object.prototype.toString.call(B)}function zc(B){return nu(B)===KT}function oy(B){return nu(B)===ZT}function lB(B){return nu(B)===ny}function uB(B){return nu(B)===Bf}function fB(B){return nu(B)===iy}function kx(B){return nu(B)===GC}function Cv(B){if(!B)return!1;var Z=nu(B);return Px.indexOf(Z)>=0?!0:ay(B)||zC(B)||No(B)}function Rx(B){return xC[Object.prototype.toString.call(B)]|0}function cB(B,Z){var ct=Z.length;switch(B.type){case bv:case NC:case Bc:case ts:var Gt=er.allocType(B.type,ct);Gt.set(Z),B.data=Gt;break;case xv:B.data=Ex(Z);break;default:W.raise("unsupported texture type, must specify a typed array")}}function UC(B,Z){return er.allocType(B.type===xv?ts:B.type,Z)}function $T(B,Z){B.type===xv?(B.data=Ex(Z),er.freeType(Z)):B.data=Z}function hB(B,Z,ct,Gt,Jt,zt){for(var Vt=B.width,ve=B.height,le=B.channels,Ce=Vt*ve*le,ye=UC(B,Ce),Ie=0,Be=0;Be=1;)ve+=Vt*le*le,le/=2;return ve}else return Vt*ct*Gt}function Fo(B,Z,ct,Gt,Jt,zt,Vt){var ve={"don't care":hi,"dont care":hi,nice:aB,fast:BC},le={repeat:rB,clamp:FC,mirror:nB},Ce={nearest:kt,linear:de},ye=e({mipmap:Qn,"nearest mipmap nearest":te,"linear mipmap nearest":pr,"nearest mipmap linear":fn,"linear mipmap linear":Qn},Ce),Ie={none:0,browser:ey},Be={uint8:bv,rgba4:LC,rgb565:VT,"rgb5 a1":tB},me={alpha:Ax,luminance:Ed,"luminance alpha":yv,rgb:Qg,rgba:wd,rgba4:TC,"rgb5 a1":IC,rgb565:Mx},Pe={};Z.ext_srgb&&(me.srgb=Tx,me.srgba=Ix),Z.oes_texture_float&&(Be.float32=Be.float=ts),Z.oes_texture_half_float&&(Be.float16=Be["half float"]=xv),Z.webgl_depth_texture&&(e(me,{depth:Jg,"depth stencil":Fc}),e(Be,{uint16:NC,uint32:Bc,"depth stencil":Bs})),Z.webgl_compressed_texture_s3tc&&e(Pe,{"rgb s3tc dxt1":OC,"rgba s3tc dxt1":DC,"rgba s3tc dxt3":PC,"rgba s3tc dxt5":kC}),Z.webgl_compressed_texture_atc&&e(Pe,{"rgb atc":Ad,"rgba atc explicit alpha":HT,"rgba atc interpolated alpha":YT}),Z.webgl_compressed_texture_pvrtc&&e(Pe,{"rgb pvrtc 4bppv1":Lx,"rgb pvrtc 2bppv1":RC,"rgba pvrtc 4bppv1":Ff,"rgba pvrtc 2bppv1":ty}),Z.webgl_compressed_texture_etc1&&(Pe["rgb etc1"]=XT);var Ot=Array.prototype.slice.call(B.getParameter(JF));Object.keys(Pe).forEach(function(lt){var jt=Pe[lt];Ot.indexOf(jt)>=0&&(me[lt]=jt)});var Yt=Object.keys(me);ct.textureFormats=Yt;var pe=[];Object.keys(me).forEach(function(lt){var jt=me[lt];pe[jt]=lt});var Le=[];Object.keys(Be).forEach(function(lt){var jt=Be[lt];Le[jt]=lt});var ue=[];Object.keys(Ce).forEach(function(lt){var jt=Ce[lt];ue[jt]=lt});var He=[];Object.keys(ye).forEach(function(lt){var jt=ye[lt];He[jt]=lt});var ce=[];Object.keys(le).forEach(function(lt){var jt=le[lt];ce[jt]=lt});var Re=Yt.reduce(function(lt,jt){var Nt=me[jt];return Nt===Ed||Nt===Ax||Nt===Ed||Nt===yv||Nt===Jg||Nt===Fc||Z.ext_srgb&&(Nt===Tx||Nt===Ix)?lt[Nt]=Nt:Nt===IC||jt.indexOf("rgba")>=0?lt[Nt]=wd:lt[Nt]=Qg,lt},{});function he(){this.internalformat=wd,this.format=wd,this.type=bv,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ey,this.width=0,this.height=0,this.channels=0}function Oe(lt,jt){lt.internalformat=jt.internalformat,lt.format=jt.format,lt.type=jt.type,lt.compressed=jt.compressed,lt.premultiplyAlpha=jt.premultiplyAlpha,lt.flipY=jt.flipY,lt.unpackAlignment=jt.unpackAlignment,lt.colorSpace=jt.colorSpace,lt.width=jt.width,lt.height=jt.height,lt.channels=jt.channels}function vr(lt,jt){if(!(typeof jt!="object"||!jt)){if("premultiplyAlpha"in jt&&(W.type(jt.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),lt.premultiplyAlpha=jt.premultiplyAlpha),"flipY"in jt&&(W.type(jt.flipY,"boolean","invalid texture flip"),lt.flipY=jt.flipY),"alignment"in jt&&(W.oneOf(jt.alignment,[1,2,4,8],"invalid texture unpack alignment"),lt.unpackAlignment=jt.alignment),"colorSpace"in jt&&(W.parameter(jt.colorSpace,Ie,"invalid colorSpace"),lt.colorSpace=Ie[jt.colorSpace]),"type"in jt){var Nt=jt.type;W(Z.oes_texture_float||!(Nt==="float"||Nt==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),W(Z.oes_texture_half_float||!(Nt==="half float"||Nt==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),W(Z.webgl_depth_texture||!(Nt==="uint16"||Nt==="uint32"||Nt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),W.parameter(Nt,Be,"invalid texture type"),lt.type=Be[Nt]}var Xe=lt.width,sn=lt.height,ot=lt.channels,Q=!1;"shape"in jt?(W(Array.isArray(jt.shape)&&jt.shape.length>=2,"shape must be an array"),Xe=jt.shape[0],sn=jt.shape[1],jt.shape.length===3&&(ot=jt.shape[2],W(ot>0&&ot<=4,"invalid number of channels"),Q=!0),W(Xe>=0&&Xe<=ct.maxTextureSize,"invalid width"),W(sn>=0&&sn<=ct.maxTextureSize,"invalid height")):("radius"in jt&&(Xe=sn=jt.radius,W(Xe>=0&&Xe<=ct.maxTextureSize,"invalid radius")),"width"in jt&&(Xe=jt.width,W(Xe>=0&&Xe<=ct.maxTextureSize,"invalid width")),"height"in jt&&(sn=jt.height,W(sn>=0&&sn<=ct.maxTextureSize,"invalid height")),"channels"in jt&&(ot=jt.channels,W(ot>0&&ot<=4,"invalid number of channels"),Q=!0)),lt.width=Xe|0,lt.height=sn|0,lt.channels=ot|0;var yt=!1;if("format"in jt){var Lt=jt.format;W(Z.webgl_depth_texture||!(Lt==="depth"||Lt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),W.parameter(Lt,me,"invalid texture format");var Dt=lt.internalformat=me[Lt];lt.format=Re[Dt],Lt in Be&&("type"in jt||(lt.type=Be[Lt])),Lt in Pe&&(lt.compressed=!0),yt=!0}!Q&&yt?lt.channels=es[lt.format]:Q&&!yt?lt.channels!==ry[lt.format]&&(lt.format=lt.internalformat=ry[lt.channels]):yt&&Q&&W(lt.channels===es[lt.format],"number of channels inconsistent with specified format")}}function Dr(lt){B.pixelStorei(oB,lt.flipY),B.pixelStorei(_v,lt.premultiplyAlpha),B.pixelStorei(Dx,lt.colorSpace),B.pixelStorei(Ox,lt.unpackAlignment)}function Ge(){he.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Me(lt,jt){var Nt=null;if(Cv(jt)?Nt=jt:jt&&(W.type(jt,"object","invalid pixel data type"),vr(lt,jt),"x"in jt&&(lt.xOffset=jt.x|0),"y"in jt&&(lt.yOffset=jt.y|0),Cv(jt.data)&&(Nt=jt.data)),W(!lt.compressed||Nt instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),jt.copy){W(!Nt,"can not specify copy and data field for the same texture");var Xe=Jt.viewportWidth,sn=Jt.viewportHeight;lt.width=lt.width||Xe-lt.xOffset,lt.height=lt.height||sn-lt.yOffset,lt.needsCopy=!0,W(lt.xOffset>=0&<.xOffset=0&<.yOffset0&<.width<=Xe&<.height>0&<.height<=sn,"copy texture read out of bounds")}else if(!Nt)lt.width=lt.width||1,lt.height=lt.height||1,lt.channels=lt.channels||4;else if(r(Nt))lt.channels=lt.channels||4,lt.data=Nt,!("type"in jt)&<.type===bv&&(lt.type=Rx(Nt));else if(ay(Nt))lt.channels=lt.channels||4,cB(lt,Nt),lt.alignment=1,lt.needsFree=!0;else if(No(Nt)){var ot=Nt.data;!Array.isArray(ot)&<.type===bv&&(lt.type=Rx(ot));var Q=Nt.shape,yt=Nt.stride,Lt,Dt,Ct,xt,wt,rt;Q.length===3?(Ct=Q[2],rt=yt[2]):(W(Q.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Ct=1,rt=1),Lt=Q[0],Dt=Q[1],xt=yt[0],wt=yt[1],lt.alignment=1,lt.width=Lt,lt.height=Dt,lt.channels=Ct,lt.format=lt.internalformat=ry[Ct],lt.needsFree=!0,hB(lt,ot,xt,wt,rt,Nt.offset)}else if(zc(Nt)||oy(Nt)||lB(Nt))zc(Nt)||oy(Nt)?lt.element=Nt:lt.element=Nt.canvas,lt.width=lt.element.width,lt.height=lt.element.height,lt.channels=4;else if(uB(Nt))lt.element=Nt,lt.width=Nt.width,lt.height=Nt.height,lt.channels=4;else if(fB(Nt))lt.element=Nt,lt.width=Nt.naturalWidth,lt.height=Nt.naturalHeight,lt.channels=4;else if(kx(Nt))lt.element=Nt,lt.width=Nt.videoWidth,lt.height=Nt.videoHeight,lt.channels=4;else if(zC(Nt)){var vt=lt.width||Nt[0].length,nt=lt.height||Nt.length,It=lt.channels;aa(Nt[0][0])?It=It||Nt[0][0].length:It=It||1;for(var Pt=$g.shape(Nt),re=1,ie=0;ie=0,"oes_texture_float extension not enabled"):lt.type===xv&&W(ct.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function fe(lt,jt,Nt){var Xe=lt.element,sn=lt.data,ot=lt.internalformat,Q=lt.format,yt=lt.type,Lt=lt.width,Dt=lt.height;Dr(lt),Xe?B.texImage2D(jt,Nt,Q,Q,yt,Xe):lt.compressed?B.compressedTexImage2D(jt,Nt,ot,Lt,Dt,0,sn):lt.needsCopy?(Gt(),B.copyTexImage2D(jt,Nt,Q,lt.xOffset,lt.yOffset,Lt,Dt,0)):B.texImage2D(jt,Nt,Q,Lt,Dt,0,Q,yt,sn||null)}function Er(lt,jt,Nt,Xe,sn){var ot=lt.element,Q=lt.data,yt=lt.internalformat,Lt=lt.format,Dt=lt.type,Ct=lt.width,xt=lt.height;Dr(lt),ot?B.texSubImage2D(jt,sn,Nt,Xe,Lt,Dt,ot):lt.compressed?B.compressedTexSubImage2D(jt,sn,Nt,Xe,yt,Ct,xt,Q):lt.needsCopy?(Gt(),B.copyTexSubImage2D(jt,sn,Nt,Xe,lt.xOffset,lt.yOffset,Ct,xt)):B.texSubImage2D(jt,sn,Nt,Xe,Ct,xt,Lt,Dt,Q)}var Vr=[];function Je(){return Vr.pop()||new Ge}function on(lt){lt.needsFree&&er.freeType(lt.data),Ge.call(lt),Vr.push(lt)}function Pr(){he.call(this),this.genMipmaps=!1,this.mipmapHint=hi,this.mipmask=0,this.images=Array(16)}function Kr(lt,jt,Nt){var Xe=lt.images[0]=Je();lt.mipmask=1,Xe.width=lt.width=jt,Xe.height=lt.height=Nt,Xe.channels=lt.channels=4}function yn(lt,jt){var Nt=null;if(Cv(jt))Nt=lt.images[0]=Je(),Oe(Nt,lt),Me(Nt,jt),lt.mipmask=1;else if(vr(lt,jt),Array.isArray(jt.mipmap))for(var Xe=jt.mipmap,sn=0;sn>=sn,Nt.height>>=sn,Me(Nt,Xe[sn]),lt.mipmask|=1<=0&&!("faces"in jt)&&(lt.genMipmaps=!0)}if("mag"in jt){var Xe=jt.mag;W.parameter(Xe,Ce),lt.magFilter=Ce[Xe]}var sn=lt.wrapS,ot=lt.wrapT;if("wrap"in jt){var Q=jt.wrap;typeof Q=="string"?(W.parameter(Q,le),sn=ot=le[Q]):Array.isArray(Q)&&(W.parameter(Q[0],le),W.parameter(Q[1],le),sn=le[Q[0]],ot=le[Q[1]])}else{if("wrapS"in jt){var yt=jt.wrapS;W.parameter(yt,le),sn=le[yt]}if("wrapT"in jt){var Lt=jt.wrapT;W.parameter(Lt,le),ot=le[Lt]}}if(lt.wrapS=sn,lt.wrapT=ot,"anisotropic"in jt){var Dt=jt.anisotropic;W(typeof Dt=="number"&&Dt>=1&&Dt<=ct.maxAnisotropic,"aniso samples must be between 1 and "),lt.anisotropic=jt.anisotropic}if("mipmap"in jt){var Ct=!1;switch(typeof jt.mipmap){case"string":W.parameter(jt.mipmap,ve,"invalid mipmap hint"),lt.mipmapHint=ve[jt.mipmap],lt.genMipmaps=!0,Ct=!0;break;case"boolean":Ct=lt.genMipmaps=jt.mipmap;break;case"object":W(Array.isArray(jt.mipmap),"invalid mipmap type"),lt.genMipmaps=!1,Ct=!0;break;default:W.raise("invalid mipmap type")}Ct&&!("min"in jt)&&(lt.minFilter=te)}}function ki(lt,jt){B.texParameteri(jt,Gc,lt.minFilter),B.texParameteri(jt,iB,lt.magFilter),B.texParameteri(jt,qT,lt.wrapS),B.texParameteri(jt,eB,lt.wrapT),Z.ext_texture_filter_anisotropic&&B.texParameteri(jt,gl,lt.anisotropic),lt.genMipmaps&&(B.hint(Ha,lt.mipmapHint),B.generateMipmap(jt))}var Da=0,Ra={},no=ct.maxTextureUnits,oa=Array(no).map(function(){return null});function Yr(lt){he.call(this),this.mipmask=0,this.internalformat=wd,this.id=Da++,this.refCount=1,this.target=lt,this.texture=B.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new bi,Vt.profile&&(this.stats={size:0})}function io(lt){B.activeTexture(Jn),B.bindTexture(lt.target,lt.texture)}function Bn(){var lt=oa[0];lt?B.bindTexture(lt.target,lt.texture):B.bindTexture(ru,null)}function br(lt){var jt=lt.texture;W(jt,"must not double destroy texture");var Nt=lt.unit,Xe=lt.target;Nt>=0&&(B.activeTexture(Jn+Nt),B.bindTexture(Xe,null),oa[Nt]=null),B.deleteTexture(jt),lt.texture=null,lt.params=null,lt.pixels=null,lt.refCount=0,delete Ra[lt.id],zt.textureCount--}e(Yr.prototype,{bind:function(){var lt=this;lt.bindCount+=1;var jt=lt.unit;if(jt<0){for(var Nt=0;Nt0)continue;Xe.unit=-1}oa[Nt]=lt,jt=Nt;break}jt>=no&&W.raise("insufficient number of texture units"),Vt.profile&&zt.maxTextureUnits>wt)-Ct,rt.height=rt.height||(Nt.height>>wt)-xt,W(Nt.type===rt.type&&Nt.format===rt.format&&Nt.internalformat===rt.internalformat,"incompatible format for texture.subimage"),W(Ct>=0&&xt>=0&&Ct+rt.width<=Nt.width&&xt+rt.height<=Nt.height,"texture.subimage write out of bounds"),W(Nt.mipmask&1<>Ct;++Ct){var xt=Lt>>Ct,wt=Dt>>Ct;if(!xt||!wt)break;B.texImage2D(ru,Ct,Nt.format,xt,wt,0,Nt.format,Nt.type,null)}return Bn(),Vt.profile&&(Nt.stats.size=ya(Nt.internalformat,Nt.type,Lt,Dt,!1,!1)),Xe}return Xe(lt,jt),Xe.subimage=sn,Xe.resize=ot,Xe._reglType="texture2d",Xe._texture=Nt,Vt.profile&&(Xe.stats=Nt.stats),Xe.destroy=function(){Nt.decRef()},Xe}function Sn(lt,jt,Nt,Xe,sn,ot){var Q=new Yr(gv);Ra[Q.id]=Q,zt.cubeCount++;var yt=new Array(6);function Lt(xt,wt,rt,vt,nt,It){var Pt,re=Q.texInfo;for(bi.call(re),Pt=0;Pt<6;++Pt)yt[Pt]=cn();if(typeof xt=="number"||!xt){var ie=xt|0||1;for(Pt=0;Pt<6;++Pt)Kr(yt[Pt],ie,ie)}else if(typeof xt=="object")if(wt)yn(yt[0],xt),yn(yt[1],wt),yn(yt[2],rt),yn(yt[3],vt),yn(yt[4],nt),yn(yt[5],It);else if(oi(re,xt),vr(Q,xt),"faces"in xt){var Kt=xt.faces;for(W(Array.isArray(Kt)&&Kt.length===6,"cube faces must be a length 6 array"),Pt=0;Pt<6;++Pt)W(typeof Kt[Pt]=="object"&&!!Kt[Pt],"invalid input for cube map face"),Oe(yt[Pt],Q),yn(yt[Pt],Kt[Pt])}else for(Pt=0;Pt<6;++Pt)yn(yt[Pt],xt);else W.raise("invalid arguments to cube map");for(Oe(Q,yt[0]),ct.npotTextureCube||W(WT(Q.width)&&WT(Q.height),"your browser does not support non power or two texture dimensions"),re.genMipmaps?Q.mipmask=(yt[0].width<<1)-1:Q.mipmask=yt[0].mipmask,W.textureCube(Q,re,yt,ct),Q.internalformat=yt[0].internalformat,Lt.width=yt[0].width,Lt.height=yt[0].height,io(Q),Pt=0;Pt<6;++Pt)$i(yt[Pt],Nf+Pt);for(ki(re,gv),Bn(),Vt.profile&&(Q.stats.size=ya(Q.internalformat,Q.type,Lt.width,Lt.height,re.genMipmaps,!0)),Lt.format=pe[Q.internalformat],Lt.type=Le[Q.type],Lt.mag=ue[re.magFilter],Lt.min=He[re.minFilter],Lt.wrapS=ce[re.wrapS],Lt.wrapT=ce[re.wrapT],Pt=0;Pt<6;++Pt)Qi(yt[Pt]);return Lt}function Dt(xt,wt,rt,vt,nt){W(!!wt,"must specify image data"),W(typeof xt=="number"&&xt===(xt|0)&&xt>=0&&xt<6,"invalid face");var It=rt|0,Pt=vt|0,re=nt|0,ie=Je();return Oe(ie,Q),ie.width=0,ie.height=0,Me(ie,wt),ie.width=ie.width||(Q.width>>re)-It,ie.height=ie.height||(Q.height>>re)-Pt,W(Q.type===ie.type&&Q.format===ie.format&&Q.internalformat===ie.internalformat,"incompatible format for texture.subimage"),W(It>=0&&Pt>=0&&It+ie.width<=Q.width&&Pt+ie.height<=Q.height,"texture.subimage write out of bounds"),W(Q.mipmask&1<>vt;++vt)B.texImage2D(Nf+rt,vt,Q.format,wt>>vt,wt>>vt,0,Q.format,Q.type,null);return Bn(),Vt.profile&&(Q.stats.size=ya(Q.internalformat,Q.type,Lt.width,Lt.height,!1,!0)),Lt}}return Lt(lt,jt,Nt,Xe,sn,ot),Lt.subimage=Dt,Lt.resize=Ct,Lt._reglType="textureCube",Lt._texture=Q,Vt.profile&&(Lt.stats=Q.stats),Lt.destroy=function(){Q.decRef()},Lt}function sa(){for(var lt=0;lt>Xe,Nt.height>>Xe,0,Nt.internalformat,Nt.type,null);else for(var sn=0;sn<6;++sn)B.texImage2D(Nf+sn,Xe,Nt.internalformat,Nt.width>>Xe,Nt.height>>Xe,0,Nt.internalformat,Nt.type,null);ki(Nt.texInfo,Nt.target)})}function qd(){for(var lt=0;lt=2,"invalid renderbuffer shape"),He=Oe[0]|0,ce=Oe[1]|0}else"radius"in he&&(He=ce=he.radius|0),"width"in he&&(He=he.width|0),"height"in he&&(ce=he.height|0);"format"in he&&(W.parameter(he.format,zt,"invalid renderbuffer format"),Re=zt[he.format])}else typeof Le=="number"?(He=Le|0,typeof ue=="number"?ce=ue|0:ce=He):Le?W.raise("invalid arguments to renderbuffer constructor"):He=ce=1;if(W(He>0&&ce>0&&He<=ct.maxRenderbufferSize&&ce<=ct.maxRenderbufferSize,"invalid renderbuffer size"),!(He===Ot.width&&ce===Ot.height&&Re===Ot.format))return Yt.width=Ot.width=He,Yt.height=Ot.height=ce,Ot.format=Re,B.bindRenderbuffer(Uc,Ot.renderbuffer),B.renderbufferStorage(Uc,Re,He,ce),W(B.getError()===0,"invalid render buffer format"),Jt.profile&&(Ot.stats.size=JT(Ot.format,Ot.width,Ot.height)),Yt.format=Vt[Ot.format],Yt}function pe(Le,ue){var He=Le|0,ce=ue|0||He;return He===Ot.width&&ce===Ot.height||(W(He>0&&ce>0&&He<=ct.maxRenderbufferSize&&ce<=ct.maxRenderbufferSize,"invalid renderbuffer size"),Yt.width=Ot.width=He,Yt.height=Ot.height=ce,B.bindRenderbuffer(Uc,Ot.renderbuffer),B.renderbufferStorage(Uc,Ot.format,He,ce),W(B.getError()===0,"invalid render buffer format"),Jt.profile&&(Ot.stats.size=JT(Ot.format,Ot.width,Ot.height))),Yt}return Yt(me,Pe),Yt.resize=pe,Yt._reglType="renderbuffer",Yt._renderbuffer=Ot,Jt.profile&&(Yt.stats=Ot.stats),Yt.destroy=function(){Ot.decRef()},Yt}Jt.profile&&(Gt.getTotalRenderbufferSize=function(){var me=0;return Object.keys(le).forEach(function(Pe){me+=le[Pe].stats.size}),me});function Be(){bs(le).forEach(function(me){me.renderbuffer=B.createRenderbuffer(),B.bindRenderbuffer(Uc,me.renderbuffer),B.renderbufferStorage(Uc,me.format,me.width,me.height)}),B.bindRenderbuffer(Uc,null)}return{create:Ie,clear:function(){bs(le).forEach(ye)},restore:Be}},Gf=36160,WC=36161,Id=3553,Ld=34069,Mv=36064,VC=36096,J=36128,Od=33306,ly=36053,yl=36054,Fn=36055,pB=36057,vB=36061,mB=36193,Dd=5121,gB=5126,tI=6407,eI=6408,yB=6402,xB=[tI,eI],iu=[];iu[eI]=4,iu[tI]=3;var Gx=[];Gx[Dd]=1,Gx[gB]=4,Gx[mB]=2;var bB=32854,_B=32855,SB=36194,CB=33189,zf=36168,rI=34041,wB=35907,EB=34836,AB=34842,MB=34843,Pd=[bB,_B,SB,wB,AB,MB,EB],Tv={};Tv[ly]="complete",Tv[yl]="incomplete attachment",Tv[pB]="incomplete dimensions",Tv[Fn]="incomplete, missing attachment",Tv[vB]="unsupported";function TB(B,Z,ct,Gt,Jt,zt){var Vt={cur:null,next:null,dirty:!1,setFBO:null},ve=["rgba"],le=["rgba4","rgb565","rgb5 a1"];Z.ext_srgb&&le.push("srgba"),Z.ext_color_buffer_half_float&&le.push("rgba16f","rgb16f"),Z.webgl_color_buffer_float&&le.push("rgba32f");var Ce=["uint8"];Z.oes_texture_half_float&&Ce.push("half float","float16"),Z.oes_texture_float&&Ce.push("float","float32");function ye(Ge,Me,fe){this.target=Ge,this.texture=Me,this.renderbuffer=fe;var Er=0,Vr=0;Me?(Er=Me.width,Vr=Me.height):fe&&(Er=fe.width,Vr=fe.height),this.width=Er,this.height=Vr}function Ie(Ge){Ge&&(Ge.texture&&Ge.texture._texture.decRef(),Ge.renderbuffer&&Ge.renderbuffer._renderbuffer.decRef())}function Be(Ge,Me,fe){if(!!Ge)if(Ge.texture){var Er=Ge.texture._texture,Vr=Math.max(1,Er.width),Je=Math.max(1,Er.height);W(Vr===Me&&Je===fe,"inconsistent width/height for supplied texture"),Er.refCount+=1}else{var on=Ge.renderbuffer._renderbuffer;W(on.width===Me&&on.height===fe,"inconsistent width/height for renderbuffer"),on.refCount+=1}}function me(Ge,Me){Me&&(Me.texture?B.framebufferTexture2D(Gf,Ge,Me.target,Me.texture._texture.texture,0):B.framebufferRenderbuffer(Gf,Ge,WC,Me.renderbuffer._renderbuffer.renderbuffer))}function Pe(Ge){var Me=Id,fe=null,Er=null,Vr=Ge;typeof Ge=="object"&&(Vr=Ge.data,"target"in Ge&&(Me=Ge.target|0)),W.type(Vr,"function","invalid attachment data");var Je=Vr._reglType;return Je==="texture2d"?(fe=Vr,W(Me===Id)):Je==="textureCube"?(fe=Vr,W(Me>=Ld&&Me=2,"invalid shape for framebuffer"),Kr=io[0],yn=io[1]}else"radius"in Yr&&(Kr=yn=Yr.radius),"width"in Yr&&(Kr=Yr.width),"height"in Yr&&(yn=Yr.height);("color"in Yr||"colors"in Yr)&&(cn=Yr.color||Yr.colors,Array.isArray(cn)&&W(cn.length===1||Z.webgl_draw_buffers,"multiple render targets not supported")),cn||("colorCount"in Yr&&(ki=Yr.colorCount|0,W(ki>0,"invalid color buffer count")),"colorTexture"in Yr&&(Qi=!!Yr.colorTexture,bi="rgba4"),"colorType"in Yr&&(oi=Yr.colorType,Qi?(W(Z.oes_texture_float||!(oi==="float"||oi==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),W(Z.oes_texture_half_float||!(oi==="half float"||oi==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):oi==="half float"||oi==="float16"?(W(Z.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),bi="rgba16f"):(oi==="float"||oi==="float32")&&(W(Z.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),bi="rgba32f"),W.oneOf(oi,Ce,"invalid color type")),"colorFormat"in Yr&&(bi=Yr.colorFormat,ve.indexOf(bi)>=0?Qi=!0:le.indexOf(bi)>=0?Qi=!1:Qi?W.oneOf(Yr.colorFormat,ve,"invalid color format for texture"):W.oneOf(Yr.colorFormat,le,"invalid color format for renderbuffer"))),("depthTexture"in Yr||"depthStencilTexture"in Yr)&&(oa=!!(Yr.depthTexture||Yr.depthStencilTexture),W(!oa||Z.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Yr&&(typeof Yr.depth=="boolean"?$i=Yr.depth:(Da=Yr.depth,Oa=!1)),"stencil"in Yr&&(typeof Yr.stencil=="boolean"?Oa=Yr.stencil:(Ra=Yr.stencil,$i=!1)),"depthStencil"in Yr&&(typeof Yr.depthStencil=="boolean"?$i=Oa=Yr.depthStencil:(no=Yr.depthStencil,$i=!1,Oa=!1))}var Bn=null,br=null,hn=null,Sn=null;if(Array.isArray(cn))Bn=cn.map(Pe);else if(cn)Bn=[Pe(cn)];else for(Bn=new Array(ki),Pr=0;Pr=0||Bn[Pr].renderbuffer&&Pd.indexOf(Bn[Pr].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Pr+" is invalid"),Bn[Pr]&&Bn[Pr].texture){var ju=iu[Bn[Pr].texture._texture.format]*Gx[Bn[Pr].texture._texture.type];sa===null?sa=ju:W(sa===ju,"all color attachments much have the same number of bits per pixel.")}return Be(br,Kr,yn),W(!br||br.texture&&br.texture._texture.format===yB||br.renderbuffer&&br.renderbuffer._renderbuffer.format===CB,"invalid depth attachment for framebuffer object"),Be(hn,Kr,yn),W(!hn||hn.renderbuffer&&hn.renderbuffer._renderbuffer.format===zf,"invalid stencil attachment for framebuffer object"),Be(Sn,Kr,yn),W(!Sn||Sn.texture&&Sn.texture._texture.format===rI||Sn.renderbuffer&&Sn.renderbuffer._renderbuffer.format===rI,"invalid depth-stencil attachment for framebuffer object"),ce(fe),fe.width=Kr,fe.height=yn,fe.colorAttachments=Bn,fe.depthAttachment=br,fe.stencilAttachment=hn,fe.depthStencilAttachment=Sn,Er.color=Bn.map(Yt),Er.depth=Yt(br),Er.stencil=Yt(hn),Er.depthStencil=Yt(Sn),Er.width=fe.width,Er.height=fe.height,he(fe),Er}function Vr(Je,on){W(Vt.next!==fe,"can not resize a framebuffer which is currently in use");var Pr=Math.max(Je|0,1),Kr=Math.max(on|0||Pr,1);if(Pr===fe.width&&Kr===fe.height)return Er;for(var yn=fe.colorAttachments,$i=0;$i=2,"invalid shape for framebuffer"),W(Qi[0]===Qi[1],"cube framebuffer must be square"),Pr=Qi[0]}else"radius"in cn&&(Pr=cn.radius|0),"width"in cn?(Pr=cn.width|0,"height"in cn&&W(cn.height===Pr,"must be square")):"height"in cn&&(Pr=cn.height|0);("color"in cn||"colors"in cn)&&(Kr=cn.color||cn.colors,Array.isArray(Kr)&&W(Kr.length===1||Z.webgl_draw_buffers,"multiple render targets not supported")),Kr||("colorCount"in cn&&(Oa=cn.colorCount|0,W(Oa>0,"invalid color buffer count")),"colorType"in cn&&(W.oneOf(cn.colorType,Ce,"invalid color type"),$i=cn.colorType),"colorFormat"in cn&&(yn=cn.colorFormat,W.oneOf(cn.colorFormat,ve,"invalid color format for texture"))),"depth"in cn&&(on.depth=cn.depth),"stencil"in cn&&(on.stencil=cn.stencil),"depthStencil"in cn&&(on.depthStencil=cn.depthStencil)}var bi;if(Kr)if(Array.isArray(Kr))for(bi=[],Je=0;Je0&&(on.depth=Me[0].depth,on.stencil=Me[0].stencil,on.depthStencil=Me[0].depthStencil),Me[Je]?Me[Je](on):Me[Je]=Oe(on)}return e(fe,{width:Pr,height:Pr,color:bi})}function Er(Vr){var Je,on=Vr|0;if(W(on>0&&on<=ct.maxCubeMapSize,"invalid radius for cube fbo"),on===fe.width)return fe;var Pr=fe.color;for(Je=0;Je0,"must specify at least one attribute");var vr={},Dr=Re.attributes;Dr.length=Oe.length;for(var Ge=0;Ge=Er.byteLength?Vr.subdata(Er):(Vr.destroy(),Re.buffers[Ge]=null)),Re.buffers[Ge]||(Vr=Re.buffers[Ge]=Jt.create(Me,nI,!1,!0)),fe.buffer=Jt.getBuffer(Vr),fe.size=fe.buffer.dimension|0,fe.normalized=!1,fe.type=fe.buffer.dtype,fe.offset=0,fe.stride=0,fe.divisor=0,fe.state=1,vr[Ge]=1}else Jt.getBuffer(Me)?(fe.buffer=Jt.getBuffer(Me),fe.size=fe.buffer.dimension|0,fe.normalized=!1,fe.type=fe.buffer.dtype,fe.offset=0,fe.stride=0,fe.divisor=0,fe.state=1):Jt.getBuffer(Me.buffer)?(fe.buffer=Jt.getBuffer(Me.buffer),fe.size=(+Me.size||fe.buffer.dimension)|0,fe.normalized=!!Me.normalized||!1,"type"in Me?(W.parameter(Me.type,_d,"invalid buffer type"),fe.type=_d[Me.type]):fe.type=fe.buffer.dtype,fe.offset=(Me.offset||0)|0,fe.stride=(Me.stride||0)|0,fe.divisor=(Me.divisor||0)|0,fe.state=1,W(fe.size>=1&&fe.size<=4,"size must be between 1 and 4"),W(fe.offset>=0,"invalid offset"),W(fe.stride>=0&&fe.stride<=255,"stride must be between 0 and 255"),W(fe.divisor>=0,"divisor must be positive"),W(!fe.divisor||!!Z.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Me?(W(Ge>0,"first attribute must not be a constant"),fe.x=+Me.x||0,fe.y=+Me.y||0,fe.z=+Me.z||0,fe.w=+Me.w||0,fe.state=2):W(!1,"invalid attribute spec for location "+Ge)}for(var Je=0;Je1)for(var Dr=0;DrOt&&(Ot=Yt.stats.uniformsCount)}),Ot},ct.getMaxAttributesCount=function(){var Ot=0;return ye.forEach(function(Yt){Yt.stats.attributesCount>Ot&&(Ot=Yt.stats.attributesCount)}),Ot});function Pe(){Jt={},zt={};for(var Ot=0;Ot=0,"missing vertex shader",pe),W.command(Yt>=0,"missing fragment shader",pe);var ue=Ce[Yt];ue||(ue=Ce[Yt]={});var He=ue[Ot];if(He&&(He.refCount++,!Le))return He;var ce=new Be(Yt,Ot);return ct.shaderCount++,me(ce,pe,Le),He||(ue[Ot]=ce),ye.push(ce),e(ce,{destroy:function(){if(ce.refCount--,ce.refCount<=0){B.deleteProgram(ce.program);var Re=ye.indexOf(ce);ye.splice(Re,1),ct.shaderCount--}ue[ce.vertId].refCount<=0&&(B.deleteShader(zt[ce.vertId]),delete zt[ce.vertId],delete Ce[ce.fragId][ce.vertId]),Object.keys(Ce[ce.fragId]).length||(B.deleteShader(Jt[ce.fragId]),delete Jt[ce.fragId],delete Ce[ce.fragId])}})},restore:Pe,shader:le,frag:-1,vert:-1}}var DB=6408,kd=5121,uy=3333,Rd=5126;function PB(B,Z,ct,Gt,Jt,zt,Vt){function ve(ye){var Ie;Z.next===null?(W(Jt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Ie=kd):(W(Z.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Ie=Z.next.colorAttachments[0].texture._texture.type,zt.oes_texture_float?(W(Ie===kd||Ie===Rd,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Ie===Rd&&W(Vt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):W(Ie===kd,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Be=0,me=0,Pe=Gt.framebufferWidth,Ot=Gt.framebufferHeight,Yt=null;r(ye)?Yt=ye:ye&&(W.type(ye,"object","invalid arguments to regl.read()"),Be=ye.x|0,me=ye.y|0,W(Be>=0&&Be=0&&me0&&Pe+Be<=Gt.framebufferWidth,"invalid width for read pixels"),W(Ot>0&&Ot+me<=Gt.framebufferHeight,"invalid height for read pixels"),ct();var pe=Pe*Ot*4;return Yt||(Ie===kd?Yt=new Uint8Array(pe):Ie===Rd&&(Yt=Yt||new Float32Array(pe))),W.isTypedArray(Yt,"data buffer for regl.read() must be a typedarray"),W(Yt.byteLength>=pe,"data buffer for regl.read() too small"),B.pixelStorei(uy,4),B.readPixels(Be,me,Pe,Ot,DB,Ie,Yt),Yt}function le(ye){var Ie;return Z.setFBO({framebuffer:ye.framebuffer},function(){Ie=ve(ye)}),Ie}function Ce(ye){return!ye||!("framebuffer"in ye)?ve(ye):le(ye)}return Ce}function Nd(B){return Array.prototype.slice.call(B)}function Iv(B){return Nd(B).join("")}function Uf(){var B=0,Z=[],ct=[];function Gt(Ie){for(var Be=0;Be0&&(Ie.push(Ot,"="),Ie.push.apply(Ie,Nd(arguments)),Ie.push(";")),Ot}return e(Be,{def:Pe,toString:function(){return Iv([me.length>0?"var "+me.join(",")+";":"",Iv(Ie)])}})}function zt(){var Ie=Jt(),Be=Jt(),me=Ie.toString,Pe=Be.toString;function Ot(Yt,pe){Be(Yt,pe,"=",Ie.def(Yt,pe),";")}return e(function(){Ie.apply(Ie,Nd(arguments))},{def:Ie.def,entry:Ie,exit:Be,save:Ot,set:function(Yt,pe,Le){Ot(Yt,pe),Ie(Yt,pe,"=",Le,";")},toString:function(){return me()+Pe()}})}function Vt(){var Ie=Iv(arguments),Be=zt(),me=zt(),Pe=Be.toString,Ot=me.toString;return e(Be,{then:function(){return Be.apply(Be,Nd(arguments)),this},else:function(){return me.apply(me,Nd(arguments)),this},toString:function(){var Yt=Ot();return Yt&&(Yt="else{"+Yt+"}"),Iv(["if(",Ie,"){",Pe(),"}",Yt])}})}var ve=Jt(),le={};function Ce(Ie,Be){var me=[];function Pe(){var ue="a"+me.length;return me.push(ue),ue}Be=Be||0;for(var Ot=0;Ot":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Zc={"0":0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ew={frag:NB,vert:FB},eb={cw:yI,ccw:tb};function Xd(B){return Array.isArray(B)||r(B)||No(B)}function rw(B){return B.sort(function(Z,ct){return Z===jf?-1:ct===jf?1:Z=1,Gt>=2,Z)}else if(ct===fy){var Jt=B.data;return new ro(Jt.thisDep,Jt.contextDep,Jt.propDep,Z)}else{if(ct===sI)return new ro(!1,!1,!1,Z);if(ct===cy){for(var zt=!1,Vt=!1,ve=!1,le=0;le=1&&(Vt=!0),ye>=2&&(ve=!0)}else Ce.type===fy&&(zt=zt||Ce.data.thisDep,Vt=Vt||Ce.data.contextDep,ve=ve||Ce.data.propDep)}return new ro(zt,Vt,ve,Z)}else return new ro(ct===Nu,ct===Fd,ct===Ux,Z)}}var nw=new ro(!1,!1,!1,function(){});function rb(B,Z,ct,Gt,Jt,zt,Vt,ve,le,Ce,ye,Ie,Be,me,Pe){var Ot=Ce.Record,Yt={add:32774,subtract:32778,"reverse subtract":32779};ct.ext_blend_minmax&&(Yt.min=xI,Yt.max=_s);var pe=ct.angle_instanced_arrays,Le=ct.webgl_draw_buffers,ue={dirty:!0,profile:Pe.profile},He={},ce=[],Re={},he={};function Oe(ot){return ot.replace(".","_")}function vr(ot,Q,yt){var Lt=Oe(ot);ce.push(ot),He[Lt]=ue[Lt]=!!yt,Re[Lt]=Q}function Dr(ot,Q,yt){var Lt=Oe(ot);ce.push(ot),Array.isArray(yt)?(ue[Lt]=yt.slice(),He[Lt]=yt.slice()):ue[Lt]=He[Lt]=yt,he[Lt]=Q}vr(lI,xl),vr(XC,GB),Dr(eo,"blendColor",[0,0,0,0]),Dr(hy,"blendEquationSeparate",[Hd,Hd]),Dr(jx,"blendFuncSeparate",[Ey,bI,Ey,bI]),vr(ou,$x,!0),Dr(Wx,"depthFunc",_I),Dr(dy,"depthRange",[0,1]),Dr(Vc,"depthMask",!0),Dr(Vx,Vx,[!0,!0,!0,!0]),vr(Go,BB),Dr(Hx,"cullFace",qc),Dr(qC,qC,tb),Dr(KC,KC,1),vr(uI,vI),Dr(py,"polygonOffset",[0,0]),vr(fI,mI),vr(Lv,Gs),Dr(Yx,"sampleCoverage",[1,!1]),vr(cI,zB),Dr(hI,"stencilMask",-1),Dr(Bd,"stencilFunc",[Bu,0,-1]),Dr(ZC,"stencilOpSeparate",[Gv,Kc,Kc,Kc]),Dr(vy,"stencilOpSeparate",[qc,Kc,Kc,Kc]),vr(Xx,JC),Dr(my,"scissor",[0,0,B.drawingBufferWidth,B.drawingBufferHeight]),Dr(jf,jf,[0,0,B.drawingBufferWidth,B.drawingBufferHeight]);var Ge={gl:B,context:Be,strings:Z,next:He,current:ue,draw:Ie,elements:zt,buffer:Jt,shader:ye,attributes:Ce.state,vao:Ce,uniforms:le,framebuffer:ve,extensions:ct,timer:me,isBufferArgs:Xd},Me={primTypes:Cd,compareFuncs:Gu,blendFuncs:uu,blendEquations:Yt,stencilOps:Zc,glTypes:_d,orientationType:eb};W.optional(function(){Ge.isArrayLike=aa}),Le&&(Me.backBuffer=[qc],Me.drawBuffer=Li(Gt.maxDrawbuffers,function(ot){return ot===0?[0]:Li(ot,function(Q){return UB+Q})}));var fe=0;function Er(){var ot=Uf(),Q=ot.link,yt=ot.global;ot.id=fe++,ot.batchId="0";var Lt=Q(Ge),Dt=ot.shared={props:"a0"};Object.keys(Ge).forEach(function(vt){Dt[vt]=yt.def(Lt,".",vt)}),W.optional(function(){ot.CHECK=Q(W),ot.commandStr=W.guessCommand(),ot.command=Q(ot.commandStr),ot.assert=function(vt,nt,It){vt("if(!(",nt,"))",this.CHECK,".commandRaise(",Q(It),",",this.command,");")},Me.invalidBlendCombinations=Yd});var Ct=ot.next={},xt=ot.current={};Object.keys(he).forEach(function(vt){Array.isArray(ue[vt])&&(Ct[vt]=yt.def(Dt.next,".",vt),xt[vt]=yt.def(Dt.current,".",vt))});var wt=ot.constants={};Object.keys(Me).forEach(function(vt){wt[vt]=yt.def(JSON.stringify(Me[vt]))}),ot.invoke=function(vt,nt){switch(nt.type){case zx:var It=["this",Dt.context,Dt.props,ot.batchId];return vt.def(Q(nt.data),".call(",It.slice(0,Math.max(nt.data.length+1,4)),")");case Ux:return vt.def(Dt.props,nt.data);case Fd:return vt.def(Dt.context,nt.data);case Nu:return vt.def("this",nt.data);case fy:return nt.data.append(ot,vt),nt.data.ref;case sI:return nt.data.toString();case cy:return nt.data.map(function(Pt){return ot.invoke(vt,Pt)})}},ot.attribCache={};var rt={};return ot.scopeAttrib=function(vt){var nt=Z.id(vt);if(nt in rt)return rt[nt];var It=Ce.scope[nt];It||(It=Ce.scope[nt]=new Ot);var Pt=rt[nt]=Q(It);return Pt},ot}function Vr(ot){var Q=ot.static,yt=ot.dynamic,Lt;if(gy in Q){var Dt=!!Q[gy];Lt=Wi(function(xt,wt){return Dt}),Lt.enable=Dt}else if(gy in yt){var Ct=yt[gy];Lt=Ss(Ct,function(xt,wt){return xt.invoke(wt,Ct)})}return Lt}function Je(ot,Q){var yt=ot.static,Lt=ot.dynamic;if(Gd in yt){var Dt=yt[Gd];return Dt?(Dt=ve.getFramebuffer(Dt),W.command(Dt,"invalid framebuffer object"),Wi(function(xt,wt){var rt=xt.link(Dt),vt=xt.shared;wt.set(vt.framebuffer,".next",rt);var nt=vt.context;return wt.set(nt,"."+jd,rt+".width"),wt.set(nt,"."+Dv,rt+".height"),rt})):Wi(function(xt,wt){var rt=xt.shared;wt.set(rt.framebuffer,".next","null");var vt=rt.context;return wt.set(vt,"."+jd,vt+"."+QC),wt.set(vt,"."+Dv,vt+"."+Zx),"null"})}else if(Gd in Lt){var Ct=Lt[Gd];return Ss(Ct,function(xt,wt){var rt=xt.invoke(wt,Ct),vt=xt.shared,nt=vt.framebuffer,It=wt.def(nt,".getFramebuffer(",rt,")");W.optional(function(){xt.assert(wt,"!"+rt+"||"+It,"invalid framebuffer object")}),wt.set(nt,".next",It);var Pt=vt.context;return wt.set(Pt,"."+jd,It+"?"+It+".width:"+Pt+"."+QC),wt.set(Pt,"."+Dv,It+"?"+It+".height:"+Pt+"."+Zx),It})}else return null}function on(ot,Q,yt){var Lt=ot.static,Dt=ot.dynamic;function Ct(rt){if(rt in Lt){var vt=Lt[rt];W.commandType(vt,"object","invalid "+rt,yt.commandStr);var nt=!0,It=vt.x|0,Pt=vt.y|0,re,ie;return"width"in vt?(re=vt.width|0,W.command(re>=0,"invalid "+rt,yt.commandStr)):nt=!1,"height"in vt?(ie=vt.height|0,W.command(ie>=0,"invalid "+rt,yt.commandStr)):nt=!1,new ro(!nt&&Q&&Q.thisDep,!nt&&Q&&Q.contextDep,!nt&&Q&&Q.propDep,function(ir,Xr){var tr=ir.shared.context,Cr=re;"width"in vt||(Cr=Xr.def(tr,".",jd,"-",It));var jr=ie;return"height"in vt||(jr=Xr.def(tr,".",Dv,"-",Pt)),[It,Pt,Cr,jr]})}else if(rt in Dt){var Kt=Dt[rt],_e=Ss(Kt,function(ir,Xr){var tr=ir.invoke(Xr,Kt);W.optional(function(){ir.assert(Xr,tr+"&&typeof "+tr+'==="object"',"invalid "+rt)});var Cr=ir.shared.context,jr=Xr.def(tr,".x|0"),Ln=Xr.def(tr,".y|0"),Ji=Xr.def('"width" in ',tr,"?",tr,".width|0:","(",Cr,".",jd,"-",jr,")"),rs=Xr.def('"height" in ',tr,"?",tr,".height|0:","(",Cr,".",Dv,"-",Ln,")");return W.optional(function(){ir.assert(Xr,Ji+">=0&&"+rs+">=0","invalid "+rt)}),[jr,Ln,Ji,rs]});return Q&&(_e.thisDep=_e.thisDep||Q.thisDep,_e.contextDep=_e.contextDep||Q.contextDep,_e.propDep=_e.propDep||Q.propDep),_e}else return Q?new ro(Q.thisDep,Q.contextDep,Q.propDep,function(ir,Xr){var tr=ir.shared.context;return[0,0,Xr.def(tr,".",jd),Xr.def(tr,".",Dv)]}):null}var xt=Ct(jf);if(xt){var wt=xt;xt=new ro(xt.thisDep,xt.contextDep,xt.propDep,function(rt,vt){var nt=wt.append(rt,vt),It=rt.shared.context;return vt.set(It,"."+dI,nt[2]),vt.set(It,"."+kB,nt[3]),nt})}return{viewport:xt,scissor_box:Ct(my)}}function Pr(ot,Q){var yt=ot.static,Lt=typeof yt[zd]=="string"&&typeof yt[Ov]=="string";if(Lt){if(Object.keys(Q.dynamic).length>0)return null;var Dt=Q.static,Ct=Object.keys(Dt);if(Ct.length>0&&typeof Dt[Ct[0]]=="number"){for(var xt=[],wt=0;wt=0,"invalid "+nt,Q.commandStr),Wi(function(ie,Kt){return It&&(ie.OFFSET=Pt),Pt})}else if(nt in Lt){var re=Lt[nt];return Ss(re,function(ie,Kt){var _e=ie.invoke(Kt,re);return It&&(ie.OFFSET=_e,W.optional(function(){ie.assert(Kt,_e+">=0","invalid "+nt)})),_e})}else if(It&&Ct)return Wi(function(ie,Kt){return ie.OFFSET="0",0});return null}var rt=wt(yy,!0);function vt(){if(Hc in yt){var nt=yt[Hc]|0;return W.command(typeof nt=="number"&&nt>=0,"invalid vertex count",Q.commandStr),Wi(function(){return nt})}else if(Hc in Lt){var It=Lt[Hc];return Ss(It,function(ie,Kt){var _e=ie.invoke(Kt,It);return W.optional(function(){ie.assert(Kt,"typeof "+_e+'==="number"&&'+_e+">=0&&"+_e+"===("+_e+"|0)","invalid vertex count")}),_e})}else if(Ct)if(zu(Ct)){if(Ct)return rt?new ro(rt.thisDep,rt.contextDep,rt.propDep,function(ie,Kt){var _e=Kt.def(ie.ELEMENTS,".vertCount-",ie.OFFSET);return W.optional(function(){ie.assert(Kt,_e+">=0","invalid vertex offset/element buffer too small")}),_e}):Wi(function(ie,Kt){return Kt.def(ie.ELEMENTS,".vertCount")});var Pt=Wi(function(){return-1});return W.optional(function(){Pt.MISSING=!0}),Pt}else{var re=new ro(Ct.thisDep||rt.thisDep,Ct.contextDep||rt.contextDep,Ct.propDep||rt.propDep,function(ie,Kt){var _e=ie.ELEMENTS;return ie.OFFSET?Kt.def(_e,"?",_e,".vertCount-",ie.OFFSET,":-1"):Kt.def(_e,"?",_e,".vertCount:-1")});return W.optional(function(){re.DYNAMIC=!0}),re}return null}return{elements:Ct,primitive:xt(),count:vt(),instances:wt(xy,!1),offset:rt}}function $i(ot,Q){var yt=ot.static,Lt=ot.dynamic,Dt={};return ce.forEach(function(Ct){var xt=Oe(Ct);function wt(rt,vt){if(Ct in yt){var nt=rt(yt[Ct]);Dt[xt]=Wi(function(){return nt})}else if(Ct in Lt){var It=Lt[Ct];Dt[xt]=Ss(It,function(Pt,re){return vt(Pt,re,Pt.invoke(re,It))})}}switch(Ct){case Go:case XC:case lI:case cI:case ou:case Xx:case uI:case fI:case Lv:case Vc:return wt(function(rt){return W.commandType(rt,"boolean",Ct,Q.commandStr),rt},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,"typeof "+nt+'==="boolean"',"invalid flag "+Ct,rt.commandStr)}),nt});case Wx:return wt(function(rt){return W.commandParameter(rt,Gu,"invalid "+Ct,Q.commandStr),Gu[rt]},function(rt,vt,nt){var It=rt.constants.compareFuncs;return W.optional(function(){rt.assert(vt,nt+" in "+It,"invalid "+Ct+", must be one of "+Object.keys(Gu))}),vt.def(It,"[",nt,"]")});case dy:return wt(function(rt){return W.command(aa(rt)&&rt.length===2&&typeof rt[0]=="number"&&typeof rt[1]=="number"&&rt[0]<=rt[1],"depth range is 2d array",Q.commandStr),rt},function(rt,vt,nt){W.optional(function(){rt.assert(vt,rt.shared.isArrayLike+"("+nt+")&&"+nt+".length===2&&typeof "+nt+'[0]==="number"&&typeof '+nt+'[1]==="number"&&'+nt+"[0]<="+nt+"[1]","depth range must be a 2d array")});var It=vt.def("+",nt,"[0]"),Pt=vt.def("+",nt,"[1]");return[It,Pt]});case jx:return wt(function(rt){W.commandType(rt,"object","blend.func",Q.commandStr);var vt="srcRGB"in rt?rt.srcRGB:rt.src,nt="srcAlpha"in rt?rt.srcAlpha:rt.src,It="dstRGB"in rt?rt.dstRGB:rt.dst,Pt="dstAlpha"in rt?rt.dstAlpha:rt.dst;return W.commandParameter(vt,uu,xt+".srcRGB",Q.commandStr),W.commandParameter(nt,uu,xt+".srcAlpha",Q.commandStr),W.commandParameter(It,uu,xt+".dstRGB",Q.commandStr),W.commandParameter(Pt,uu,xt+".dstAlpha",Q.commandStr),W.command(Yd.indexOf(vt+", "+It)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+vt+", "+It+")",Q.commandStr),[uu[vt],uu[It],uu[nt],uu[Pt]]},function(rt,vt,nt){var It=rt.constants.blendFuncs;W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid blend func, must be an object")});function Pt(tr,Cr){var jr=vt.def('"',tr,Cr,'" in ',nt,"?",nt,".",tr,Cr,":",nt,".",tr);return W.optional(function(){rt.assert(vt,jr+" in "+It,"invalid "+Ct+"."+tr+Cr+", must be one of "+Object.keys(uu))}),jr}var re=Pt("src","RGB"),ie=Pt("dst","RGB");W.optional(function(){var tr=rt.constants.invalidBlendCombinations;rt.assert(vt,tr+".indexOf("+re+'+", "+'+ie+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var Kt=vt.def(It,"[",re,"]"),_e=vt.def(It,"[",Pt("src","Alpha"),"]"),ir=vt.def(It,"[",ie,"]"),Xr=vt.def(It,"[",Pt("dst","Alpha"),"]");return[Kt,ir,_e,Xr]});case hy:return wt(function(rt){if(typeof rt=="string")return W.commandParameter(rt,Yt,"invalid "+Ct,Q.commandStr),[Yt[rt],Yt[rt]];if(typeof rt=="object")return W.commandParameter(rt.rgb,Yt,Ct+".rgb",Q.commandStr),W.commandParameter(rt.alpha,Yt,Ct+".alpha",Q.commandStr),[Yt[rt.rgb],Yt[rt.alpha]];W.commandRaise("invalid blend.equation",Q.commandStr)},function(rt,vt,nt){var It=rt.constants.blendEquations,Pt=vt.def(),re=vt.def(),ie=rt.cond("typeof ",nt,'==="string"');return W.optional(function(){function Kt(_e,ir,Xr){rt.assert(_e,Xr+" in "+It,"invalid "+ir+", must be one of "+Object.keys(Yt))}Kt(ie.then,Ct,nt),rt.assert(ie.else,nt+"&&typeof "+nt+'==="object"',"invalid "+Ct),Kt(ie.else,Ct+".rgb",nt+".rgb"),Kt(ie.else,Ct+".alpha",nt+".alpha")}),ie.then(Pt,"=",re,"=",It,"[",nt,"];"),ie.else(Pt,"=",It,"[",nt,".rgb];",re,"=",It,"[",nt,".alpha];"),vt(ie),[Pt,re]});case eo:return wt(function(rt){return W.command(aa(rt)&&rt.length===4,"blend.color must be a 4d array",Q.commandStr),Li(4,function(vt){return+rt[vt]})},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,rt.shared.isArrayLike+"("+nt+")&&"+nt+".length===4","blend.color must be a 4d array")}),Li(4,function(It){return vt.def("+",nt,"[",It,"]")})});case hI:return wt(function(rt){return W.commandType(rt,"number",xt,Q.commandStr),rt|0},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,"typeof "+nt+'==="number"',"invalid stencil.mask")}),vt.def(nt,"|0")});case Bd:return wt(function(rt){W.commandType(rt,"object",xt,Q.commandStr);var vt=rt.cmp||"keep",nt=rt.ref||0,It="mask"in rt?rt.mask:-1;return W.commandParameter(vt,Gu,Ct+".cmp",Q.commandStr),W.commandType(nt,"number",Ct+".ref",Q.commandStr),W.commandType(It,"number",Ct+".mask",Q.commandStr),[Gu[vt],nt,It]},function(rt,vt,nt){var It=rt.constants.compareFuncs;W.optional(function(){function Kt(){rt.assert(vt,Array.prototype.join.call(arguments,""),"invalid stencil.func")}Kt(nt+"&&typeof ",nt,'==="object"'),Kt('!("cmp" in ',nt,")||(",nt,".cmp in ",It,")")});var Pt=vt.def('"cmp" in ',nt,"?",It,"[",nt,".cmp]",":",Kc),re=vt.def(nt,".ref|0"),ie=vt.def('"mask" in ',nt,"?",nt,".mask|0:-1");return[Pt,re,ie]});case ZC:case vy:return wt(function(rt){W.commandType(rt,"object",xt,Q.commandStr);var vt=rt.fail||"keep",nt=rt.zfail||"keep",It=rt.zpass||"keep";return W.commandParameter(vt,Zc,Ct+".fail",Q.commandStr),W.commandParameter(nt,Zc,Ct+".zfail",Q.commandStr),W.commandParameter(It,Zc,Ct+".zpass",Q.commandStr),[Ct===vy?qc:Gv,Zc[vt],Zc[nt],Zc[It]]},function(rt,vt,nt){var It=rt.constants.stencilOps;W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid "+Ct)});function Pt(re){return W.optional(function(){rt.assert(vt,'!("'+re+'" in '+nt+")||("+nt+"."+re+" in "+It+")","invalid "+Ct+"."+re+", must be one of "+Object.keys(Zc))}),vt.def('"',re,'" in ',nt,"?",It,"[",nt,".",re,"]:",Kc)}return[Ct===vy?qc:Gv,Pt("fail"),Pt("zfail"),Pt("zpass")]});case py:return wt(function(rt){W.commandType(rt,"object",xt,Q.commandStr);var vt=rt.factor|0,nt=rt.units|0;return W.commandType(vt,"number",xt+".factor",Q.commandStr),W.commandType(nt,"number",xt+".units",Q.commandStr),[vt,nt]},function(rt,vt,nt){W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid "+Ct)});var It=vt.def(nt,".factor|0"),Pt=vt.def(nt,".units|0");return[It,Pt]});case Hx:return wt(function(rt){var vt=0;return rt==="front"?vt=Gv:rt==="back"&&(vt=qc),W.command(!!vt,xt,Q.commandStr),vt},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,nt+'==="front"||'+nt+'==="back"',"invalid cull.face")}),vt.def(nt,'==="front"?',Gv,":",qc)});case KC:return wt(function(rt){return W.command(typeof rt=="number"&&rt>=Gt.lineWidthDims[0]&&rt<=Gt.lineWidthDims[1],"invalid line width, must be a positive number between "+Gt.lineWidthDims[0]+" and "+Gt.lineWidthDims[1],Q.commandStr),rt},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,"typeof "+nt+'==="number"&&'+nt+">="+Gt.lineWidthDims[0]+"&&"+nt+"<="+Gt.lineWidthDims[1],"invalid line width")}),nt});case qC:return wt(function(rt){return W.commandParameter(rt,eb,xt,Q.commandStr),eb[rt]},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,nt+'==="cw"||'+nt+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),vt.def(nt+'==="cw"?'+yI+":"+tb)});case Vx:return wt(function(rt){return W.command(aa(rt)&&rt.length===4,"color.mask must be length 4 array",Q.commandStr),rt.map(function(vt){return!!vt})},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,rt.shared.isArrayLike+"("+nt+")&&"+nt+".length===4","invalid color.mask")}),Li(4,function(It){return"!!"+nt+"["+It+"]"})});case Yx:return wt(function(rt){W.command(typeof rt=="object"&&rt,xt,Q.commandStr);var vt="value"in rt?rt.value:1,nt=!!rt.invert;return W.command(typeof vt=="number"&&vt>=0&&vt<=1,"sample.coverage.value must be a number between 0 and 1",Q.commandStr),[vt,nt]},function(rt,vt,nt){W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid sample.coverage")});var It=vt.def('"value" in ',nt,"?+",nt,".value:1"),Pt=vt.def("!!",nt,".invert");return[It,Pt]})}}),Dt}function Oa(ot,Q){var yt=ot.static,Lt=ot.dynamic,Dt={};return Object.keys(yt).forEach(function(Ct){var xt=yt[Ct],wt;if(typeof xt=="number"||typeof xt=="boolean")wt=Wi(function(){return xt});else if(typeof xt=="function"){var rt=xt._reglType;rt==="texture2d"||rt==="textureCube"?wt=Wi(function(vt){return vt.link(xt)}):rt==="framebuffer"||rt==="framebufferCube"?(W.command(xt.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Ct+'"',Q.commandStr),wt=Wi(function(vt){return vt.link(xt.color[0])})):W.commandRaise('invalid data for uniform "'+Ct+'"',Q.commandStr)}else aa(xt)?wt=Wi(function(vt){var nt=vt.global.def("[",Li(xt.length,function(It){return W.command(typeof xt[It]=="number"||typeof xt[It]=="boolean","invalid uniform "+Ct,vt.commandStr),xt[It]}),"]");return nt}):W.commandRaise('invalid or missing data for uniform "'+Ct+'"',Q.commandStr);wt.value=xt,Dt[Ct]=wt}),Object.keys(Lt).forEach(function(Ct){var xt=Lt[Ct];Dt[Ct]=Ss(xt,function(wt,rt){return wt.invoke(rt,xt)})}),Dt}function cn(ot,Q){var yt=ot.static,Lt=ot.dynamic,Dt={};return Object.keys(yt).forEach(function(Ct){var xt=yt[Ct],wt=Z.id(Ct),rt=new Ot;if(Xd(xt))rt.state=bo,rt.buffer=Jt.getBuffer(Jt.create(xt,Xc,!1,!0)),rt.type=0;else{var vt=Jt.getBuffer(xt);if(vt)rt.state=bo,rt.buffer=vt,rt.type=0;else if(W.command(typeof xt=="object"&&xt,"invalid data for attribute "+Ct,Q.commandStr),"constant"in xt){var nt=xt.constant;rt.buffer="null",rt.state=YC,typeof nt=="number"?rt.x=nt:(W.command(aa(nt)&&nt.length>0&&nt.length<=4,"invalid constant for attribute "+Ct,Q.commandStr),jc.forEach(function(ir,Xr){Xr=0,'invalid offset for attribute "'+Ct+'"',Q.commandStr);var Pt=xt.stride|0;W.command(Pt>=0&&Pt<256,'invalid stride for attribute "'+Ct+'", must be integer betweeen [0, 255]',Q.commandStr);var re=xt.size|0;W.command(!("size"in xt)||re>0&&re<=4,'invalid size for attribute "'+Ct+'", must be 1,2,3,4',Q.commandStr);var ie=!!xt.normalized,Kt=0;"type"in xt&&(W.commandParameter(xt.type,_d,"invalid type for attribute "+Ct,Q.commandStr),Kt=_d[xt.type]);var _e=xt.divisor|0;"divisor"in xt&&(W.command(_e===0||pe,'cannot specify divisor for attribute "'+Ct+'", instancing not supported',Q.commandStr),W.command(_e>=0,'invalid divisor for attribute "'+Ct+'"',Q.commandStr)),W.optional(function(){var ir=Q.commandStr,Xr=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(xt).forEach(function(tr){W.command(Xr.indexOf(tr)>=0,'unknown parameter "'+tr+'" for attribute pointer "'+Ct+'" (valid parameters are '+Xr+")",ir)})}),rt.buffer=vt,rt.state=bo,rt.size=re,rt.normalized=ie,rt.type=Kt||vt.dtype,rt.offset=It,rt.stride=Pt,rt.divisor=_e}}Dt[Ct]=Wi(function(ir,Xr){var tr=ir.attribCache;if(wt in tr)return tr[wt];var Cr={isStream:!1};return Object.keys(rt).forEach(function(jr){Cr[jr]=rt[jr]}),rt.buffer&&(Cr.buffer=ir.link(rt.buffer),Cr.type=Cr.type||Cr.buffer+".dtype"),tr[wt]=Cr,Cr})}),Object.keys(Lt).forEach(function(Ct){var xt=Lt[Ct];function wt(rt,vt){var nt=rt.invoke(vt,xt),It=rt.shared,Pt=rt.constants,re=It.isBufferArgs,ie=It.buffer;W.optional(function(){rt.assert(vt,nt+"&&(typeof "+nt+'==="object"||typeof '+nt+'==="function")&&('+re+"("+nt+")||"+ie+".getBuffer("+nt+")||"+ie+".getBuffer("+nt+".buffer)||"+re+"("+nt+'.buffer)||("constant" in '+nt+"&&(typeof "+nt+'.constant==="number"||'+It.isArrayLike+"("+nt+".constant))))",'invalid dynamic attribute "'+Ct+'"')});var Kt={isStream:vt.def(!1)},_e=new Ot;_e.state=bo,Object.keys(_e).forEach(function(Cr){Kt[Cr]=vt.def(""+_e[Cr])});var ir=Kt.buffer,Xr=Kt.type;vt("if(",re,"(",nt,")){",Kt.isStream,"=true;",ir,"=",ie,".createStream(",Xc,",",nt,");",Xr,"=",ir,".dtype;","}else{",ir,"=",ie,".getBuffer(",nt,");","if(",ir,"){",Xr,"=",ir,".dtype;",'}else if("constant" in ',nt,"){",Kt.state,"=",YC,";","if(typeof "+nt+'.constant === "number"){',Kt[jc[0]],"=",nt,".constant;",jc.slice(1).map(function(Cr){return Kt[Cr]}).join("="),"=0;","}else{",jc.map(function(Cr,jr){return Kt[Cr]+"="+nt+".constant.length>"+jr+"?"+nt+".constant["+jr+"]:0;"}).join(""),"}}else{","if(",re,"(",nt,".buffer)){",ir,"=",ie,".createStream(",Xc,",",nt,".buffer);","}else{",ir,"=",ie,".getBuffer(",nt,".buffer);","}",Xr,'="type" in ',nt,"?",Pt.glTypes,"[",nt,".type]:",ir,".dtype;",Kt.normalized,"=!!",nt,".normalized;");function tr(Cr){vt(Kt[Cr],"=",nt,".",Cr,"|0;")}return tr("size"),tr("offset"),tr("stride"),tr("divisor"),vt("}}"),vt.exit("if(",Kt.isStream,"){",ie,".destroyStream(",ir,");","}"),Kt}Dt[Ct]=Ss(xt,wt)}),Dt}function Qi(ot,Q){var yt=ot.static,Lt=ot.dynamic;if(Yc in yt){var Dt=yt[Yc];return Dt!==null&&Ce.getVAO(Dt)===null&&(Dt=Ce.createVAO(Dt)),Wi(function(xt){return xt.link(Ce.getVAO(Dt))})}else if(Yc in Lt){var Ct=Lt[Yc];return Ss(Ct,function(xt,wt){var rt=xt.invoke(wt,Ct);return wt.def(xt.shared.vao+".getVAO("+rt+")")})}return null}function bi(ot){var Q=ot.static,yt=ot.dynamic,Lt={};return Object.keys(Q).forEach(function(Dt){var Ct=Q[Dt];Lt[Dt]=Wi(function(xt,wt){return typeof Ct=="number"||typeof Ct=="boolean"?""+Ct:xt.link(Ct)})}),Object.keys(yt).forEach(function(Dt){var Ct=yt[Dt];Lt[Dt]=Ss(Ct,function(xt,wt){return xt.invoke(wt,Ct)})}),Lt}function oi(ot,Q,yt,Lt,Dt){var Ct=ot.static,xt=ot.dynamic;W.optional(function(){var tr=[Gd,Ov,zd,Ud,Wf,yy,Hc,xy,gy,Yc].concat(ce);function Cr(jr){Object.keys(jr).forEach(function(Ln){W.command(tr.indexOf(Ln)>=0,'unknown parameter "'+Ln+'"',Dt.commandStr)})}Cr(Ct),Cr(xt)});var wt=Pr(ot,Q),rt=Je(ot,Dt),vt=on(ot,rt,Dt),nt=yn(ot,Dt),It=$i(ot,Dt),Pt=Kr(ot,Dt,wt);function re(tr){var Cr=vt[tr];Cr&&(It[tr]=Cr)}re(jf),re(Oe(my));var ie=Object.keys(It).length>0,Kt={framebuffer:rt,draw:nt,shader:Pt,state:It,dirty:ie,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Kt.profile=Vr(ot,Dt),Kt.uniforms=Oa(yt,Dt),Kt.drawVAO=Kt.scopeVAO=Qi(ot,Dt),!Kt.drawVAO&&Pt.program&&!wt&&ct.angle_instanced_arrays){var _e=!0,ir=Pt.program.attributes.map(function(tr){var Cr=Q.static[tr];return _e=_e&&!!Cr,Cr});if(_e&&ir.length>0){var Xr=Ce.getVAO(Ce.createVAO(ir));Kt.drawVAO=new ro(null,null,null,function(tr,Cr){return tr.link(Xr)}),Kt.useVAO=!0}}return wt?Kt.useVAO=!0:Kt.attributes=cn(Q,Dt),Kt.context=bi(Lt,Dt),Kt}function ki(ot,Q,yt){var Lt=ot.shared,Dt=Lt.context,Ct=ot.scope();Object.keys(yt).forEach(function(xt){Q.save(Dt,"."+xt);var wt=yt[xt],rt=wt.append(ot,Q);Array.isArray(rt)?Ct(Dt,".",xt,"=[",rt.join(),"];"):Ct(Dt,".",xt,"=",rt,";")}),Q(Ct)}function Da(ot,Q,yt,Lt){var Dt=ot.shared,Ct=Dt.gl,xt=Dt.framebuffer,wt;Le&&(wt=Q.def(Dt.extensions,".webgl_draw_buffers"));var rt=ot.constants,vt=rt.drawBuffer,nt=rt.backBuffer,It;yt?It=yt.append(ot,Q):It=Q.def(xt,".next"),Lt||Q("if(",It,"!==",xt,".cur){"),Q("if(",It,"){",Ct,".bindFramebuffer(",tw,",",It,".framebuffer);"),Le&&Q(wt,".drawBuffersWEBGL(",vt,"[",It,".colorAttachments.length]);"),Q("}else{",Ct,".bindFramebuffer(",tw,",null);"),Le&&Q(wt,".drawBuffersWEBGL(",nt,");"),Q("}",xt,".cur=",It,";"),Lt||Q("}")}function Ra(ot,Q,yt){var Lt=ot.shared,Dt=Lt.gl,Ct=ot.current,xt=ot.next,wt=Lt.current,rt=Lt.next,vt=ot.cond(wt,".dirty");ce.forEach(function(nt){var It=Oe(nt);if(!(It in yt.state)){var Pt,re;if(It in xt){Pt=xt[It],re=Ct[It];var ie=Li(ue[It].length,function(_e){return vt.def(Pt,"[",_e,"]")});vt(ot.cond(ie.map(function(_e,ir){return _e+"!=="+re+"["+ir+"]"}).join("||")).then(Dt,".",he[It],"(",ie,");",ie.map(function(_e,ir){return re+"["+ir+"]="+_e}).join(";"),";"))}else{Pt=vt.def(rt,".",It);var Kt=ot.cond(Pt,"!==",wt,".",It);vt(Kt),It in Re?Kt(ot.cond(Pt).then(Dt,".enable(",Re[It],");").else(Dt,".disable(",Re[It],");"),wt,".",It,"=",Pt,";"):Kt(Dt,".",he[It],"(",Pt,");",wt,".",It,"=",Pt,";")}}}),Object.keys(yt.state).length===0&&vt(wt,".dirty=false;"),Q(vt)}function no(ot,Q,yt,Lt){var Dt=ot.shared,Ct=ot.current,xt=Dt.current,wt=Dt.gl;rw(Object.keys(yt)).forEach(function(rt){var vt=yt[rt];if(!(Lt&&!Lt(vt))){var nt=vt.append(ot,Q);if(Re[rt]){var It=Re[rt];zu(vt)?nt?Q(wt,".enable(",It,");"):Q(wt,".disable(",It,");"):Q(ot.cond(nt).then(wt,".enable(",It,");").else(wt,".disable(",It,");")),Q(xt,".",rt,"=",nt,";")}else if(aa(nt)){var Pt=Ct[rt];Q(wt,".",he[rt],"(",nt,");",nt.map(function(re,ie){return Pt+"["+ie+"]="+re}).join(";"),";")}else Q(wt,".",he[rt],"(",nt,");",xt,".",rt,"=",nt,";")}})}function oa(ot,Q){pe&&(ot.instancing=Q.def(ot.shared.extensions,".angle_instanced_arrays"))}function Yr(ot,Q,yt,Lt,Dt){var Ct=ot.shared,xt=ot.stats,wt=Ct.current,rt=Ct.timer,vt=yt.profile;function nt(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var It,Pt;function re(tr){It=Q.def(),tr(It,"=",nt(),";"),typeof Dt=="string"?tr(xt,".count+=",Dt,";"):tr(xt,".count++;"),me&&(Lt?(Pt=Q.def(),tr(Pt,"=",rt,".getNumPendingQueries();")):tr(rt,".beginQuery(",xt,");"))}function ie(tr){tr(xt,".cpuTime+=",nt(),"-",It,";"),me&&(Lt?tr(rt,".pushScopeStats(",Pt,",",rt,".getNumPendingQueries(),",xt,");"):tr(rt,".endQuery();"))}function Kt(tr){var Cr=Q.def(wt,".profile");Q(wt,".profile=",tr,";"),Q.exit(wt,".profile=",Cr,";")}var _e;if(vt){if(zu(vt)){vt.enable?(re(Q),ie(Q.exit),Kt("true")):Kt("false");return}_e=vt.append(ot,Q),Kt(_e)}else _e=Q.def(wt,".profile");var ir=ot.block();re(ir),Q("if(",_e,"){",ir,"}");var Xr=ot.block();ie(Xr),Q.exit("if(",_e,"){",Xr,"}")}function io(ot,Q,yt,Lt,Dt){var Ct=ot.shared;function xt(rt){switch(rt){case kv:case Rv:case su:return 2;case by:case _y:case Jx:return 3;case Wd:case Nv:case lu:return 4;default:return 1}}function wt(rt,vt,nt){var It=Ct.gl,Pt=Q.def(rt,".location"),re=Q.def(Ct.attributes,"[",Pt,"]"),ie=nt.state,Kt=nt.buffer,_e=[nt.x,nt.y,nt.z,nt.w],ir=["buffer","normalized","offset","stride"];function Xr(){Q("if(!",re,".buffer){",It,".enableVertexAttribArray(",Pt,");}");var Cr=nt.type,jr;if(nt.size?jr=Q.def(nt.size,"||",vt):jr=vt,Q("if(",re,".type!==",Cr,"||",re,".size!==",jr,"||",ir.map(function(Ji){return re+"."+Ji+"!=="+nt[Ji]}).join("||"),"){",It,".bindBuffer(",Xc,",",Kt,".buffer);",It,".vertexAttribPointer(",[Pt,jr,Cr,nt.normalized,nt.stride,nt.offset],");",re,".type=",Cr,";",re,".size=",jr,";",ir.map(function(Ji){return re+"."+Ji+"="+nt[Ji]+";"}).join(""),"}"),pe){var Ln=nt.divisor;Q("if(",re,".divisor!==",Ln,"){",ot.instancing,".vertexAttribDivisorANGLE(",[Pt,Ln],");",re,".divisor=",Ln,";}")}}function tr(){Q("if(",re,".buffer){",It,".disableVertexAttribArray(",Pt,");",re,".buffer=null;","}if(",jc.map(function(Cr,jr){return re+"."+Cr+"!=="+_e[jr]}).join("||"),"){",It,".vertexAttrib4f(",Pt,",",_e,");",jc.map(function(Cr,jr){return re+"."+Cr+"="+_e[jr]+";"}).join(""),"}")}ie===bo?Xr():ie===YC?tr():(Q("if(",ie,"===",bo,"){"),Xr(),Q("}else{"),tr(),Q("}"))}Lt.forEach(function(rt){var vt=rt.name,nt=yt.attributes[vt],It;if(nt){if(!Dt(nt))return;It=nt.append(ot,Q)}else{if(!Dt(nw))return;var Pt=ot.scopeAttrib(vt);W.optional(function(){ot.assert(Q,Pt+".state","missing attribute "+vt)}),It={},Object.keys(new Ot).forEach(function(re){It[re]=Q.def(Pt,".",re)})}wt(ot.link(rt),xt(rt.info.type),It)})}function Bn(ot,Q,yt,Lt,Dt){for(var Ct=ot.shared,xt=Ct.gl,wt,rt=0;rt1?Q(Li(Cr,function(rs){return Array.isArray(Kt)?Kt[rs]:Kt+"["+rs+"]"})):(W(!Array.isArray(Kt),"uniform value must not be an array"),Q(Kt));Q(");")}}function br(ot,Q,yt,Lt){var Dt=ot.shared,Ct=Dt.gl,xt=Dt.draw,wt=Lt.draw;function rt(){var jr=wt.elements,Ln,Ji=Q;return jr?((jr.contextDep&&Lt.contextDynamic||jr.propDep)&&(Ji=yt),Ln=jr.append(ot,Ji)):Ln=Ji.def(xt,".",Ud),Ln&&Ji("if("+Ln+")"+Ct+".bindBuffer("+An+","+Ln+".buffer.buffer);"),Ln}function vt(){var jr=wt.count,Ln,Ji=Q;return jr?((jr.contextDep&&Lt.contextDynamic||jr.propDep)&&(Ji=yt),Ln=jr.append(ot,Ji),W.optional(function(){jr.MISSING&&ot.assert(Q,"false","missing vertex count"),jr.DYNAMIC&&ot.assert(Ji,Ln+">=0","missing vertex count")})):(Ln=Ji.def(xt,".",Hc),W.optional(function(){ot.assert(Ji,Ln+">=0","missing vertex count")})),Ln}var nt=rt();function It(jr){var Ln=wt[jr];return Ln?Ln.contextDep&&Lt.contextDynamic||Ln.propDep?Ln.append(ot,yt):Ln.append(ot,Q):Q.def(xt,".",jr)}var Pt=It(Wf),re=It(yy),ie=vt();if(typeof ie=="number"){if(ie===0)return}else yt("if(",ie,"){"),yt.exit("}");var Kt,_e;pe&&(Kt=It(xy),_e=ot.instancing);var ir=nt+".type",Xr=wt.elements&&zu(wt.elements);function tr(){function jr(){yt(_e,".drawElementsInstancedANGLE(",[Pt,ie,ir,re+"<<(("+ir+"-"+Wc+")>>1)",Kt],");")}function Ln(){yt(_e,".drawArraysInstancedANGLE(",[Pt,re,ie,Kt],");")}nt?Xr?jr():(yt("if(",nt,"){"),jr(),yt("}else{"),Ln(),yt("}")):Ln()}function Cr(){function jr(){yt(Ct+".drawElements("+[Pt,ie,ir,re+"<<(("+ir+"-"+Wc+")>>1)"]+");")}function Ln(){yt(Ct+".drawArrays("+[Pt,re,ie]+");")}nt?Xr?jr():(yt("if(",nt,"){"),jr(),yt("}else{"),Ln(),yt("}")):Ln()}pe&&(typeof Kt!="number"||Kt>=0)?typeof Kt=="string"?(yt("if(",Kt,">0){"),tr(),yt("}else if(",Kt,"<0){"),Cr(),yt("}")):tr():Cr()}function hn(ot,Q,yt,Lt,Dt){var Ct=Er(),xt=Ct.proc("body",Dt);return W.optional(function(){Ct.commandStr=Q.commandStr,Ct.command=Ct.link(Q.commandStr)}),pe&&(Ct.instancing=xt.def(Ct.shared.extensions,".angle_instanced_arrays")),ot(Ct,xt,yt,Lt),Ct.compile().body}function Sn(ot,Q,yt,Lt){oa(ot,Q),yt.useVAO?yt.drawVAO?Q(ot.shared.vao,".setVAO(",yt.drawVAO.append(ot,Q),");"):Q(ot.shared.vao,".setVAO(",ot.shared.vao,".targetVAO);"):(Q(ot.shared.vao,".setVAO(null);"),io(ot,Q,yt,Lt.attributes,function(){return!0})),Bn(ot,Q,yt,Lt.uniforms,function(){return!0}),br(ot,Q,Q,yt)}function sa(ot,Q){var yt=ot.proc("draw",1);oa(ot,yt),ki(ot,yt,Q.context),Da(ot,yt,Q.framebuffer),Ra(ot,yt,Q),no(ot,yt,Q.state),Yr(ot,yt,Q,!1,!0);var Lt=Q.shader.progVar.append(ot,yt);if(yt(ot.shared.gl,".useProgram(",Lt,".program);"),Q.shader.program)Sn(ot,yt,Q,Q.shader.program);else{yt(ot.shared.vao,".setVAO(null);");var Dt=ot.global.def("{}"),Ct=yt.def(Lt,".id"),xt=yt.def(Dt,"[",Ct,"]");yt(ot.cond(xt).then(xt,".call(this,a0);").else(xt,"=",Dt,"[",Ct,"]=",ot.link(function(wt){return hn(Sn,ot,Q,wt,1)}),"(",Lt,");",xt,".call(this,a0);"))}Object.keys(Q.state).length>0&&yt(ot.shared.current,".dirty=true;")}function ju(ot,Q,yt,Lt){ot.batchId="a1",oa(ot,Q);function Dt(){return!0}io(ot,Q,yt,Lt.attributes,Dt),Bn(ot,Q,yt,Lt.uniforms,Dt),br(ot,Q,Q,yt)}function qd(ot,Q,yt,Lt){oa(ot,Q);var Dt=yt.contextDep,Ct=Q.def(),xt="a0",wt="a1",rt=Q.def();ot.shared.props=rt,ot.batchId=Ct;var vt=ot.scope(),nt=ot.scope();Q(vt.entry,"for(",Ct,"=0;",Ct,"<",wt,";++",Ct,"){",rt,"=",xt,"[",Ct,"];",nt,"}",vt.exit);function It(ir){return ir.contextDep&&Dt||ir.propDep}function Pt(ir){return!It(ir)}if(yt.needsContext&&ki(ot,nt,yt.context),yt.needsFramebuffer&&Da(ot,nt,yt.framebuffer),no(ot,nt,yt.state,It),yt.profile&&It(yt.profile)&&Yr(ot,nt,yt,!1,!0),Lt)yt.useVAO?yt.drawVAO?It(yt.drawVAO)?nt(ot.shared.vao,".setVAO(",yt.drawVAO.append(ot,nt),");"):vt(ot.shared.vao,".setVAO(",yt.drawVAO.append(ot,vt),");"):vt(ot.shared.vao,".setVAO(",ot.shared.vao,".targetVAO);"):(vt(ot.shared.vao,".setVAO(null);"),io(ot,vt,yt,Lt.attributes,Pt),io(ot,nt,yt,Lt.attributes,It)),Bn(ot,vt,yt,Lt.uniforms,Pt),Bn(ot,nt,yt,Lt.uniforms,It),br(ot,vt,nt,yt);else{var re=ot.global.def("{}"),ie=yt.shader.progVar.append(ot,nt),Kt=nt.def(ie,".id"),_e=nt.def(re,"[",Kt,"]");nt(ot.shared.gl,".useProgram(",ie,".program);","if(!",_e,"){",_e,"=",re,"[",Kt,"]=",ot.link(function(ir){return hn(ju,ot,yt,ir,2)}),"(",ie,");}",_e,".call(this,a0[",Ct,"],",Ct,");")}}function lt(ot,Q){var yt=ot.proc("batch",2);ot.batchId="0",oa(ot,yt);var Lt=!1,Dt=!0;Object.keys(Q.context).forEach(function(re){Lt=Lt||Q.context[re].propDep}),Lt||(ki(ot,yt,Q.context),Dt=!1);var Ct=Q.framebuffer,xt=!1;Ct?(Ct.propDep?Lt=xt=!0:Ct.contextDep&&Lt&&(xt=!0),xt||Da(ot,yt,Ct)):Da(ot,yt,null),Q.state.viewport&&Q.state.viewport.propDep&&(Lt=!0);function wt(re){return re.contextDep&&Lt||re.propDep}Ra(ot,yt,Q),no(ot,yt,Q.state,function(re){return!wt(re)}),(!Q.profile||!wt(Q.profile))&&Yr(ot,yt,Q,!1,"a1"),Q.contextDep=Lt,Q.needsContext=Dt,Q.needsFramebuffer=xt;var rt=Q.shader.progVar;if(rt.contextDep&&Lt||rt.propDep)qd(ot,yt,Q,null);else{var vt=rt.append(ot,yt);if(yt(ot.shared.gl,".useProgram(",vt,".program);"),Q.shader.program)qd(ot,yt,Q,Q.shader.program);else{yt(ot.shared.vao,".setVAO(null);");var nt=ot.global.def("{}"),It=yt.def(vt,".id"),Pt=yt.def(nt,"[",It,"]");yt(ot.cond(Pt).then(Pt,".call(this,a0,a1);").else(Pt,"=",nt,"[",It,"]=",ot.link(function(re){return hn(qd,ot,Q,re,2)}),"(",vt,");",Pt,".call(this,a0,a1);"))}}Object.keys(Q.state).length>0&&yt(ot.shared.current,".dirty=true;")}function jt(ot,Q){var yt=ot.proc("scope",3);ot.batchId="a2";var Lt=ot.shared,Dt=Lt.current;ki(ot,yt,Q.context),Q.framebuffer&&Q.framebuffer.append(ot,yt),rw(Object.keys(Q.state)).forEach(function(xt){var wt=Q.state[xt],rt=wt.append(ot,yt);aa(rt)?rt.forEach(function(vt,nt){yt.set(ot.next[xt],"["+nt+"]",vt)}):yt.set(Lt.next,"."+xt,rt)}),Yr(ot,yt,Q,!0,!0),[Ud,yy,Hc,xy,Wf].forEach(function(xt){var wt=Q.draw[xt];!wt||yt.set(Lt.draw,"."+xt,""+wt.append(ot,yt))}),Object.keys(Q.uniforms).forEach(function(xt){var wt=Q.uniforms[xt].append(ot,yt);Array.isArray(wt)&&(wt="["+wt.join()+"]"),yt.set(Lt.uniforms,"["+Z.id(xt)+"]",wt)}),Object.keys(Q.attributes).forEach(function(xt){var wt=Q.attributes[xt].append(ot,yt),rt=ot.scopeAttrib(xt);Object.keys(new Ot).forEach(function(vt){yt.set(rt,"."+vt,wt[vt])})}),Q.scopeVAO&&yt.set(Lt.vao,".targetVAO",Q.scopeVAO.append(ot,yt));function Ct(xt){var wt=Q.shader[xt];wt&&yt.set(Lt.shader,"."+xt,wt.append(ot,yt))}Ct(Ov),Ct(zd),Object.keys(Q.state).length>0&&(yt(Dt,".dirty=true;"),yt.exit(Dt,".dirty=true;")),yt("a1(",ot.shared.context,",a0,",ot.batchId,");")}function Nt(ot){if(!(typeof ot!="object"||aa(ot))){for(var Q=Object.keys(ot),yt=0;yt=0;--br){var hn=fe[br];hn&&hn(me,null,0)}ct.flush(),Ce&&Ce.update()}function Kr(){!on&&fe.length>0&&(on=Ve.next(Pr))}function yn(){on&&(Ve.cancel(Pr),on=null)}function $i(br){br.preventDefault(),Jt=!0,yn(),Er.forEach(function(hn){hn()})}function Oa(br){ct.getError(),Jt=!1,zt.restore(),ce.restore(),pe.restore(),Re.restore(),he.restore(),Oe.restore(),Le.restore(),Ce&&Ce.restore(),vr.procs.refresh(),Kr(),Vr.forEach(function(hn){hn()})}Me&&(Me.addEventListener(AI,$i,!1),Me.addEventListener(MI,Oa,!1));function cn(){fe.length=0,yn(),Me&&(Me.removeEventListener(AI,$i),Me.removeEventListener(MI,Oa)),ce.clear(),Oe.clear(),he.clear(),Re.clear(),He.clear(),pe.clear(),Le.clear(),Ce&&Ce.clear(),Je.forEach(function(br){br()})}function Qi(br){W(!!br,"invalid args to regl({...})"),W.type(br,"object","invalid args to regl({...})");function hn(Dt){var Ct=e({},Dt);delete Ct.uniforms,delete Ct.attributes,delete Ct.context,delete Ct.vao,"stencil"in Ct&&Ct.stencil.op&&(Ct.stencil.opBack=Ct.stencil.opFront=Ct.stencil.op,delete Ct.stencil.op);function xt(wt){if(wt in Ct){var rt=Ct[wt];delete Ct[wt],Object.keys(rt).forEach(function(vt){Ct[wt+"."+vt]=rt[vt]})}}return xt("blend"),xt("depth"),xt("cull"),xt("stencil"),xt("polygonOffset"),xt("scissor"),xt("sample"),"vao"in Dt&&(Ct.vao=Dt.vao),Ct}function Sn(Dt,Ct){var xt={},wt={};return Object.keys(Dt).forEach(function(rt){var vt=Dt[rt];if(Ye.isDynamic(vt)){wt[rt]=Ye.unbox(vt,rt);return}else if(Ct&&Array.isArray(vt)){for(var nt=0;nt0)return sn.call(this,yt(Dt|0),Dt|0)}else if(Array.isArray(Dt)){if(Dt.length)return sn.call(this,Dt,Dt.length)}else return Xe.call(this,Dt)}return e(Lt,{stats:jt,destroy:function(){Nt.destroy()}})}var bi=Oe.setFBO=Qi({framebuffer:Ye.define.call(null,Uu,"framebuffer")});function oi(br,hn){var Sn=0;vr.procs.poll();var sa=hn.color;sa&&(ct.clearColor(+sa[0]||0,+sa[1]||0,+sa[2]||0,+sa[3]||0),Sn|=CI),"depth"in hn&&(ct.clearDepth(+hn.depth),Sn|=wI),"stencil"in hn&&(ct.clearStencil(hn.stencil|0),Sn|=WB),W(!!Sn,"called regl.clear with no buffer specified"),ct.clear(Sn)}function ki(br){if(W(typeof br=="object"&&br,"regl.clear() takes an object as input"),"framebuffer"in br)if(br.framebuffer&&br.framebuffer_reglType==="framebufferCube")for(var hn=0;hn<6;++hn)bi(e({framebuffer:br.framebuffer.faces[hn]},br),oi);else bi(br,oi);else oi(null,br)}function Da(br){W.type(br,"function","regl.frame() callback must be a function"),fe.push(br);function hn(){var Sn=nb(fe,br);W(Sn>=0,"cannot cancel a frame twice");function sa(){var ju=nb(fe,sa);fe[ju]=fe[fe.length-1],fe.length-=1,fe.length<=0&&yn()}fe[Sn]=sa}return Kr(),{cancel:hn}}function Ra(){var br=Ge.viewport,hn=Ge.scissor_box;br[0]=br[1]=hn[0]=hn[1]=0,me.viewportWidth=me.framebufferWidth=me.drawingBufferWidth=br[2]=hn[2]=ct.drawingBufferWidth,me.viewportHeight=me.framebufferHeight=me.drawingBufferHeight=br[3]=hn[3]=ct.drawingBufferHeight}function no(){me.tick+=1,me.time=Yr(),Ra(),vr.procs.poll()}function oa(){Re.refresh(),Ra(),vr.procs.refresh(),Ce&&Ce.update()}function Yr(){return($n()-ye)/1e3}oa();function io(br,hn){W.type(hn,"function","listener callback must be a function");var Sn;switch(br){case"frame":return Da(hn);case"lost":Sn=Er;break;case"restore":Sn=Vr;break;case"destroy":Sn=Je;break;default:W.raise("invalid event, must be one of frame,lost,restore,destroy")}return Sn.push(hn),{cancel:function(){for(var sa=0;sa=0},read:Dr,destroy:cn,_gl:ct,_refresh:oa,poll:function(){no(),Ce&&Ce.update()},now:Yr,stats:ve});return Z.onDone(null,Bn),Bn}return ib})});var GY=ft((O3r,T_t)=>{T_t.exports=1e-6});var zY=ft((D3r,I_t)=>{I_t.exports=Bce;function Bce(){var r=new Float32Array(2);return r[0]=0,r[1]=0,r}});var O_t=ft((P3r,L_t)=>{L_t.exports=Gce;function Gce(r){var e=new Float32Array(2);return e[0]=r[0],e[1]=r[1],e}});var P_t=ft((k3r,D_t)=>{D_t.exports=zce;function zce(r,e){var t=new Float32Array(2);return t[0]=r,t[1]=e,t}});var R_t=ft((R3r,k_t)=>{k_t.exports=Uce;function Uce(r,e){return r[0]=e[0],r[1]=e[1],r}});var UY=ft((N3r,N_t)=>{N_t.exports=jce;function jce(r,e,t){return r[0]=e,r[1]=t,r}});var G_t=ft((F3r,B_t)=>{B_t.exports=Wce;var F_t=GY();function Wce(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=F_t*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=F_t*Math.max(1,Math.abs(n),Math.abs(a))}});var U_t=ft((B3r,z_t)=>{z_t.exports=Vce;function Vce(r,e){return r[0]===e[0]&&r[1]===e[1]}});var jY=ft((G3r,j_t)=>{j_t.exports=Hce;function Hce(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}});var jN=ft((z3r,W_t)=>{W_t.exports=Yce;function Yce(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}});var H_t=ft((U3r,V_t)=>{V_t.exports=jN()});var WY=ft((j3r,Y_t)=>{Y_t.exports=Xce;function Xce(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}});var q_t=ft((W3r,X_t)=>{X_t.exports=WY()});var VY=ft((V3r,K_t)=>{K_t.exports=qce;function qce(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}});var $_t=ft((H3r,Z_t)=>{Z_t.exports=VY()});var J_t=ft((Y3r,Q_t)=>{Q_t.exports=Kce;function Kce(r,e){return r[0]=1/e[0],r[1]=1/e[1],r}});var eSt=ft((X3r,tSt)=>{tSt.exports=Zce;function Zce(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}});var nSt=ft((q3r,rSt)=>{rSt.exports=$ce;function $ce(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}});var aSt=ft((K3r,iSt)=>{iSt.exports=Qce;function Qce(r,e,t){var n=Math.cos(t),i=Math.sin(t),a=e[0],o=e[1];return r[0]=a*n-o*i,r[1]=a*i+o*n,r}});var sSt=ft((Z3r,oSt)=>{oSt.exports=Jce;function Jce(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}});var uSt=ft(($3r,lSt)=>{lSt.exports=the;function the(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}});var cSt=ft((Q3r,fSt)=>{fSt.exports=ehe;function ehe(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r}});var dSt=ft((J3r,hSt)=>{hSt.exports=rhe;function rhe(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}});var vSt=ft((tGr,pSt)=>{pSt.exports=nhe;function nhe(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}});var HY=ft((eGr,mSt)=>{mSt.exports=ihe;function ihe(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.sqrt(t*t+n*n)}});var ySt=ft((rGr,gSt)=>{gSt.exports=HY()});var YY=ft((nGr,xSt)=>{xSt.exports=ahe;function ahe(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}});var _St=ft((iGr,bSt)=>{bSt.exports=YY()});var XY=ft((aGr,SSt)=>{SSt.exports=ohe;function ohe(r){var e=r[0],t=r[1];return Math.sqrt(e*e+t*t)}});var wSt=ft((oGr,CSt)=>{CSt.exports=XY()});var qY=ft((sGr,ESt)=>{ESt.exports=she;function she(r){var e=r[0],t=r[1];return e*e+t*t}});var MSt=ft((lGr,ASt)=>{ASt.exports=qY()});var ISt=ft((uGr,TSt)=>{TSt.exports=lhe;function lhe(r,e){return r[0]=-e[0],r[1]=-e[1],r}});var KY=ft((fGr,LSt)=>{LSt.exports=uhe;function uhe(r,e){var t=e[0],n=e[1],i=t*t+n*n;return i>0&&(i=1/Math.sqrt(i),r[0]=e[0]*i,r[1]=e[1]*i),r}});var ZY=ft((cGr,OSt)=>{OSt.exports=fhe;function fhe(r,e){return r[0]*e[0]+r[1]*e[1]}});var PSt=ft((hGr,DSt)=>{DSt.exports=che;function che(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}});var RSt=ft((dGr,kSt)=>{kSt.exports=hhe;function hhe(r,e,t,n){var i=e[0],a=e[1];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r}});var FSt=ft((pGr,NSt)=>{NSt.exports=dhe;function dhe(r,e){e=e||1;var t=Math.random()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}});var GSt=ft((vGr,BSt)=>{BSt.exports=phe;function phe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i,r[1]=t[1]*n+t[3]*i,r}});var USt=ft((mGr,zSt)=>{zSt.exports=vhe;function vhe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i+t[4],r[1]=t[1]*n+t[3]*i+t[5],r}});var WSt=ft((gGr,jSt)=>{jSt.exports=mhe;function mhe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[3]*i+t[6],r[1]=t[1]*n+t[4]*i+t[7],r}});var HSt=ft((yGr,VSt)=>{VSt.exports=ghe;function ghe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[4]*i+t[12],r[1]=t[1]*n+t[5]*i+t[13],r}});var XSt=ft((xGr,YSt)=>{YSt.exports=yhe;var _S=zY()();function yhe(r,e,t,n,i,a){var o,s;for(e||(e=2),t||(t=0),n?s=Math.min(n*e+t,r.length):s=r.length,o=t;o{qSt.exports=xhe;function xhe(r,e,t){var n=e[0]*e[0]+e[1]*e[1];if(n>t*t){var i=Math.sqrt(n);r[0]=e[0]/i*t,r[1]=e[1]/i*t}else r[0]=e[0],r[1]=e[1];return r}});var $St=ft((_Gr,ZSt)=>{ZSt.exports={EPSILON:GY(),create:zY(),clone:O_t(),fromValues:P_t(),copy:R_t(),set:UY(),equals:G_t(),exactEquals:U_t(),add:jY(),subtract:jN(),sub:H_t(),multiply:WY(),mul:q_t(),divide:VY(),div:$_t(),inverse:J_t(),min:eSt(),max:nSt(),rotate:aSt(),floor:sSt(),ceil:uSt(),round:cSt(),scale:dSt(),scaleAndAdd:vSt(),distance:HY(),dist:ySt(),squaredDistance:YY(),sqrDist:_St(),length:XY(),len:wSt(),squaredLength:qY(),sqrLen:MSt(),negate:ISt(),normalize:KY(),dot:ZY(),cross:PSt(),lerp:RSt(),random:FSt(),transformMat2:GSt(),transformMat2d:USt(),transformMat3:WSt(),transformMat4:HSt(),forEach:XSt(),limit:KSt()}});var tCt=ft((SGr,WN)=>{var bhe=jY(),$Y=UY(),QSt=KY(),_he=jN(),She=ZY(),JSt=[0,0];WN.exports.computeMiter=function(e,t,n,i,a){return bhe(e,n,i),QSt(e,e),$Y(t,-e[1],e[0]),$Y(JSt,-n[1],n[0]),a/She(t,JSt)};WN.exports.normal=function(e,t){return $Y(e,-t[1],t[0]),e};WN.exports.direction=function(e,t,n){return _he(e,t,n),QSt(e,e),e}});var dX=ft((oT,hX)=>{(function(e,t){typeof oT=="object"&&typeof hX=="object"?hX.exports=t():typeof define=="function"&&define.amd?define([],t):typeof oT=="object"?oT.Hierarchy=t():e.Hierarchy=t()})(typeof self!="undefined"?self:oT,function(){return function(r){var e={};function t(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return r[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=r,t.c=e,t.d=function(n,i,a){t.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:a})},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},t.p="",t(t.s=31)}([function(r,e,t){"use strict";var n=t(4);e.a=function(i){return Array.isArray?Array.isArray(i):Object(n.a)(i,"Array")}},function(r,e,t){"use strict";var n=function(i){return i!==null&&typeof i!="function"&&isFinite(i.length)};e.a=n},function(r,e,t){"use strict";var n=t(0),i=t(13);function a(o,s){if(!!o){var l;if(Object(n.a)(o))for(var u=0,f=o.length;u-1:!1};e.a=i},function(r,e,t){"use strict";e.a=function(n){var i=typeof n;return n!==null&&i==="object"||i==="function"}},function(r,e,t){"use strict";var n=t(2),i=t(1),a=function(o,s){if(!Object(i.a)(o))return o;var l=[];return Object(n.a)(o,function(u,f){s(u,f)&&l.push(u)}),l};e.a=a},function(r,e,t){"use strict";var n=function(i){return typeof i=="object"&&i!==null};e.a=n},function(r,e,t){"use strict";e.a=i;function n(a,o){for(var s in o)o.hasOwnProperty(s)&&s!=="constructor"&&o[s]!==void 0&&(a[s]=o[s])}function i(a,o,s,l){return o&&n(a,o),s&&n(a,s),l&&n(a,l),a}},function(r,e,t){var n=t(30),i=["LR","RL","TB","BT","H","V"],a=["LR","RL","H"],o=function(u){return a.indexOf(u)>-1},s=i[0];r.exports=function(l,u,f){var c=u.direction||s;if(u.isHorizontal=o(c),c&&i.indexOf(c)===-1)throw new TypeError("Invalid direction: "+c);if(c===i[0])f(l,u);else if(c===i[1])f(l,u),l.right2left();else if(c===i[2])f(l,u);else if(c===i[3])f(l,u),l.bottom2top();else if(c===i[4]||c===i[5]){var h=n(l,u),d=h.left,p=h.right;f(d,u),f(p,u),u.isHorizontal?d.right2left():d.bottom2top(),p.translate(d.x-p.x,d.y-p.y),l.x=d.x,l.y=p.y;var v=l.getBoundingBox();u.isHorizontal?v.top<0&&l.translate(0,-v.top):v.left<0&&l.translate(-v.left,0)}var m=u.fixedRoot;return m===void 0&&(m=!0),m&&l.translate(-(l.x+l.width/2+l.hgap),-(l.y+l.height/2+l.vgap)),l}},function(r,e,t){var n=t(7),i=18,a=i*2,o=i,s={getId:function(c){return c.id||c.name},getPreH:function(c){return c.preH||0},getPreV:function(c){return c.preV||0},getHGap:function(c){return c.hgap||o},getVGap:function(c){return c.vgap||o},getChildren:function(c){return c.children},getHeight:function(c){return c.height||a},getWidth:function(c){var h=c.label||" ";return c.width||h.split("").length*i}};function l(f,c){var h=this;if(h.vgap=h.hgap=0,f instanceof l)return f;h.data=f;var d=c.getHGap(f),p=c.getVGap(f);return h.preH=c.getPreH(f),h.preV=c.getPreV(f),h.width=c.getWidth(f),h.height=c.getHeight(f),h.width+=h.preH,h.height+=h.preV,h.id=c.getId(f),h.x=h.y=0,h.depth=0,h.children||(h.children=[]),h.addGap(d,p),h}n.assign(l.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(c,h){var d=this;d.hgap+=c,d.vgap+=h,d.width+=2*c,d.height+=2*h},eachNode:function(c){for(var h=this,d=[h],p;p=d.shift();)c(p),d=p.children.concat(d)},DFTraverse:function(c){this.eachNode(c)},BFTraverse:function(c){for(var h=this,d=[h],p;p=d.shift();)c(p),d=d.concat(p.children)},getBoundingBox:function(){var c={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(h){c.left=Math.min(c.left,h.x),c.top=Math.min(c.top,h.y),c.width=Math.max(c.width,h.x+h.width),c.height=Math.max(c.height,h.y+h.height)}),c},translate:function(c,h){c===void 0&&(c=0),h===void 0&&(h=0),this.eachNode(function(d){d.x+=c,d.y+=h,d.x+=d.preH,d.y+=d.preV})},right2left:function(){var c=this,h=c.getBoundingBox();c.eachNode(function(d){d.x=d.x-(d.x-h.left)*2-d.width}),c.translate(h.width,0)},bottom2top:function(){var c=this,h=c.getBoundingBox();c.eachNode(function(d){d.y=d.y-(d.y-h.top)*2-d.height}),c.translate(0,h.height)}});function u(f,c,h){c===void 0&&(c={}),c=n.assign({},s,c);var d=new l(f,c),p=[d],v;if(!h&&!f.collapsed){for(;v=p.shift();)if(!v.data.collapsed){var m=c.getChildren(v.data),g=m?m.length:0;if(v.children=new Array(g),m&&g)for(var x=0;x-1;)i.call(s,h,1);return s};e.a=o},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(9),o=function(s,l,u){if(!Object(i.a)(s)&&!Object(a.a)(s))return s;var f=u;return Object(n.a)(s,function(c,h){f=l(f,c,h)}),f};e.a=o},function(r,e,t){"use strict";var n=t(1),i=t(21),a=function(o,s){var l=[];if(!Object(n.a)(o))return l;for(var u=-1,f=[],c=o.length;++uh[p])return 1;if(c[p]o?o:i};e.a=n},function(r,e,t){"use strict";var n=function(i,a){var o=a.toString(),s=o.indexOf(".");if(s===-1)return Math.round(i);var l=o.substr(s+1).length;return l>20&&(l=20),parseFloat(i.toFixed(l))};e.a=n},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a%1!=0};e.a=i},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a%2==0};e.a=i},function(r,e,t){"use strict";var n=t(5),i=Number.isInteger?Number.isInteger:function(a){return Object(n.a)(a)&&a%1==0};e.a=i},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a<0};e.a=i},function(r,e,t){"use strict";e.a=i;var n=1e-5;function i(a,o,s){return s===void 0&&(s=n),Math.abs(a-o)0};e.a=i},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(3);e.a=function(o,s){if(!!Object(i.a)(o)){var l=o[0],u;Object(a.a)(s)?u=s(o[0]):u=o[0][s];var f;return Object(n.a)(o,function(c){Object(a.a)(s)?f=s(c):f=c[s],f>u&&(l=c,u=f)}),l}}},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(3);e.a=function(o,s){if(!!Object(i.a)(o)){var l=o[0],u;Object(a.a)(s)?u=s(o[0]):u=o[0][s];var f;return Object(n.a)(o,function(c){Object(a.a)(s)?f=s(c):f=c[s],fi?(o&&(clearTimeout(o),o=null),f=d,u=n.apply(s,l),o||(s=l=null)):!o&&a.trailing!==!1&&(o=setTimeout(c,p)),u};return h.cancel=function(){clearTimeout(o),f=0,o=s=l=null},h}},function(r,e,t){"use strict";var n=t(1);e.a=function(i){return Object(n.a)(i)?Array.prototype.slice.call(i):[]}},function(r,e,t){"use strict";var n={};e.a=function(i){return i=i||"g",n[i]?n[i]+=1:n[i]=1,i+n[i]}},function(r,e,t){"use strict";e.a=function(){}},function(r,e,t){"use strict";e.a=function(n){return n}},function(r,e,t){"use strict";e.a=a;var n=t(6),i=t(1);function a(o){return Object(n.a)(o)?0:Object(i.a)(o)?o.length:Object.keys(o).length}},function(r,e,t){"use strict";var n=function(){function i(){this.map={}}return i.prototype.has=function(a){return this.map[a]!==void 0},i.prototype.get=function(a,o){var s=this.map[a];return s===void 0?o:s},i.prototype.set=function(a,o){this.map[a]=o},i.prototype.clear=function(){this.map={}},i.prototype.delete=function(a){delete this.map[a]},i.prototype.size=function(){return Object.keys(this.map).length},i}();e.a=n},function(r,e){function t(l,u,f,c){c===void 0&&(c=[]);var h=this;h.w=l||0,h.h=u||0,h.y=f||0,h.x=0,h.c=c||[],h.cs=c.length,h.prelim=0,h.mod=0,h.shift=0,h.change=0,h.tl=null,h.tr=null,h.el=null,h.er=null,h.msel=0,h.mser=0}t.fromNode=function(l,u){if(!l)return null;var f=[];return l.children.forEach(function(c){f.push(t.fromNode(c,u))}),u?new t(l.height,l.width,l.x,f):new t(l.width,l.height,l.y,f)};function n(l,u,f){f?l.y+=u:l.x+=u,l.children.forEach(function(c){n(c,u,f)})}function i(l,u){var f=u?l.y:l.x;return l.children.forEach(function(c){f=Math.min(i(c,u),f)}),f}function a(l,u){var f=i(l,u);n(l,-f,u)}function o(l,u,f){f?u.y=l.x:u.x=l.x,l.c.forEach(function(c,h){o(c,u.children[h],f)})}function s(l,u,f){f===void 0&&(f=0),u?(l.x=f,f+=l.width):(l.y=f,f+=l.height),l.children.forEach(function(c){s(c,u,f)})}r.exports=function(l,u){u===void 0&&(u={});var f=u.isHorizontal;function c(O){if(O.cs===0){h(O);return}c(O.c[0]);for(var M=L(g(O.c[0].el),0,null),I=1;II.low&&(I=I.nxt);var G=P+R.prelim+R.w-(D+F.prelim);G>0&&(D+=G,p(O,M,I.index,G));var U=g(R),j=g(F);U<=j&&(R=m(R),R!==null&&(P+=R.mod)),U>=j&&(F=v(F),F!==null&&(D+=F.mod))}!R&&!!F?x(O,M,F,D):!!R&&!F&&b(O,M,R,P)}function p(O,M,I,R){O.c[M].mod+=R,O.c[M].msel+=R,O.c[M].mser+=R,w(O,M,I,R)}function v(O){return O.cs===0?O.tl:O.c[0]}function m(O){return O.cs===0?O.tr:O.c[O.cs-1]}function g(O){return O.y+O.h}function x(O,M,I,R){var P=O.c[0].el;P.tl=I;var F=R-I.mod-O.c[0].msel;P.mod+=F,P.prelim-=F,O.c[0].el=O.c[M].el,O.c[0].msel=O.c[M].msel}function b(O,M,I,R){var P=O.c[M].er;P.tr=I;var F=R-I.mod-O.c[M].mser;P.mod+=F,P.prelim-=F,O.c[M].er=O.c[M-1].er,O.c[M].mser=O.c[M-1].mser}function S(O){O.prelim=(O.c[0].prelim+O.c[0].mod+O.c[O.cs-1].mod+O.c[O.cs-1].prelim+O.c[O.cs-1].w)/2-O.w/2}function C(O,M){M+=O.mod,O.x=O.prelim+M,A(O);for(var I=0;I=I.low;)I=I.nxt;return{low:O,index:M,nxt:I}}s(l,f);var k=t.fromNode(l,f);return c(k),C(k,0),o(k,l,f),a(l,f),l}},function(r,e,t){function n(c,h){c.prototype=Object.create(h.prototype),c.prototype.constructor=c,c.__proto__=h}var i=t(11),a=t(115),o=t(17),s=t(7),l=function(c){n(h,c);function h(){return c.apply(this,arguments)||this}var d=h.prototype;return d.execute=function(){var v=this;return v.rootNode.width=0,o(v.rootNode,v.options,a)},h}(i),u={};function f(c,h){return h=s.assign({},u,h),new l(c,h).execute()}r.exports=f},function(r,e,t){var n=t(7);function i(s,l){s===void 0&&(s=0),l===void 0&&(l=[]);var u=this;u.x=u.y=0,u.leftChild=u.rightChild=null,u.height=0,u.children=l}var a={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function o(s,l,u){u?(l.x=s.x,l.y=s.y):(l.x=s.y,l.y=s.x),s.children.forEach(function(f,c){o(f,l.children[c],u)})}r.exports=function(s,l){l===void 0&&(l={}),l=n.assign({},a,l);var u=0;function f(v){if(!v)return null;v.width=0,v.depth&&v.depth>u&&(u=v.depth);var m=v.children,g=m.length,x=new i(v.height,[]);return m.forEach(function(b,S){var C=f(b);x.children.push(C),S===0&&(x.leftChild=C),S===g-1&&(x.rightChild=C)}),x.originNode=v,x.isLeaf=v.isLeaf(),x}function c(v){if(v.isLeaf||v.children.length===0)v.drawingDepth=u;else{var m=v.children.map(function(x){return c(x)}),g=Math.min.apply(null,m);v.drawingDepth=g-1}return v.drawingDepth}var h;function d(v){v.x=v.drawingDepth*l.rankSep,v.isLeaf?(v.y=0,h&&(v.y=h.y+h.height+l.nodeSep,v.originNode.parent!==h.originNode.parent&&(v.y+=l.subTreeSep)),h=v):(v.children.forEach(function(m){d(m)}),v.y=(v.leftChild.y+v.rightChild.y)/2)}var p=f(s);return c(p),d(p),o(p,s,l.isHorizontal),s}},function(r,e,t){function n(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,d.__proto__=p}var i=t(11),a=t(117),o=t(30),s=t(7),l=["LR","RL","H"],u=l[0],f=function(d){n(p,d);function p(){return d.apply(this,arguments)||this}var v=p.prototype;return v.execute=function(){var g=this,x=g.options,b=g.rootNode;x.isHorizontal=!0;var S=x.indent,C=S===void 0?20:S,w=x.dropCap,A=w===void 0?!0:w,L=x.direction||u;if(L&&l.indexOf(L)===-1)throw new TypeError("Invalid direction: "+L);if(L===l[0])a(b,C,A);else if(L===l[1])a(b,C,A),b.right2left();else if(L===l[2]){var k=o(b,x),O=k.left,M=k.right;a(O,C,A),O.right2left(),a(M,C,A);var I=O.getBoundingBox();M.translate(I.width,0),b.x=M.x-b.width/2}return b},p}(i),c={};function h(d,p){return p=s.assign({},c,p),new f(d,p).execute()}r.exports=h},function(r,e){function t(n,i,a,o){var s=typeof a=="function"?a(n):a*n.depth;if(!o)try{if(n.id===n.parent.children[0].id){n.x+=s,n.y=i?i.y:0;return}}catch(l){}n.x+=s,n.y=i?i.y+i.height:0}r.exports=function(n,i,a){var o=null;n.eachNode(function(s){t(s,o,i,a),o=s})}},function(r,e,t){function n(c,h){c.prototype=Object.create(h.prototype),c.prototype.constructor=c,c.__proto__=h}var i=t(11),a=t(119),o=t(17),s=t(7),l=function(c){n(h,c);function h(){return c.apply(this,arguments)||this}var d=h.prototype;return d.execute=function(){var v=this;return o(v.rootNode,v.options,a)},h}(i),u={};function f(c,h){return h=s.assign({},u,h),new l(c,h).execute()}r.exports=f},function(r,e,t){var n=t(7);function i(s,l){var u=0;return s.children.length?s.children.forEach(function(f){u+=i(f,l)}):u=s.height,s._subTreeSep=l.getSubTreeSep(s.data),s.totalHeight=Math.max(s.height,u)+2*s._subTreeSep,s.totalHeight}function a(s){var l=s.children,u=l.length;if(u){l.forEach(function(v){a(v)});var f=l[0],c=l[u-1],h=c.y-f.y+c.height,d=0;if(l.forEach(function(v){d+=v.totalHeight}),h>s.height)s.y=f.y+h/2-s.height/2;else if(l.length!==1||s.height>d){var p=s.y+(s.height-h)/2-f.y;l.forEach(function(v){v.translate(0,p)})}else s.y=(f.y+f.height/2+c.y+c.height/2)/2-s.height/2}}var o={getSubTreeSep:function(){return 0}};r.exports=function(s,l){l===void 0&&(l={}),l=n.assign({},o,l),s.parent={x:0,width:0,height:0,y:0},s.BFTraverse(function(u){u.x=u.parent.x+u.parent.width}),s.parent=null,i(s,l),s.startY=0,s.y=s.totalHeight/2-s.height/2,s.eachNode(function(u){var f=u.children,c=f.length;if(c){var h=f[0];if(h.startY=u.startY+u._subTreeSep,c===1)h.y=u.y+u.height/2-h.height/2;else{h.y=h.startY+h.totalHeight/2-h.height/2;for(var d=1;d{var jwt=[],sT=[],_de="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function Wwt(r,e){if(e=e||{},r===void 0)throw new Error(_de);var t=e.prepend===!0?"prepend":"append",n=e.container!==void 0?e.container:document.querySelector("head"),i=jwt.indexOf(n);i===-1&&(i=jwt.push(n)-1,sT[i]={});var a;return sT[i]!==void 0&&sT[i][t]!==void 0?a=sT[i][t]:(a=sT[i][t]=Sde(),t==="prepend"?n.insertBefore(a,n.childNodes[0]):n.appendChild(a)),r.charCodeAt(0)===65279&&(r=r.substr(1,r.length)),a.styleSheet?a.styleSheet.cssText+=r:a.textContent+=r,a}function Sde(){var r=document.createElement("style");return r.setAttribute("type","text/css"),r}CX.exports=Wwt;CX.exports.insertCss=Wwt});var eMt=ft(($X,QX)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof QX=="object"&&typeof $X!="undefined"?QX.exports=e():r.Papa=e()})($X,function r(){"use strict";var e=typeof self!="undefined"?self:typeof window!="undefined"?window:e!==void 0?e:{},t=!e.document&&!!e.postMessage,n=t&&/blob:/i.test((e.location||{}).protocol),i={},a=0,o={parse:function(w,A){var L=(A=A||{}).dynamicTyping||!1;if(C(L)&&(A.dynamicTypingFunction=L,L={}),A.dynamicTyping=L,A.transform=!!C(A.transform)&&A.transform,A.worker&&o.WORKERS_SUPPORTED){var k=function(){if(!o.WORKERS_SUPPORTED)return!1;var M=(R=e.URL||e.webkitURL||null,P=r.toString(),o.BLOB_URL||(o.BLOB_URL=R.createObjectURL(new Blob(["(",P,")();"],{type:"text/javascript"})))),I=new e.Worker(M),R,P;return I.onmessage=m,I.id=a++,i[I.id]=I}();return k.userStep=A.step,k.userChunk=A.chunk,k.userComplete=A.complete,k.userError=A.error,A.step=C(A.step),A.chunk=C(A.chunk),A.complete=C(A.complete),A.error=C(A.error),delete A.worker,void k.postMessage({input:w,config:A,workerId:k.id})}var O=null;return o.NODE_STREAM_INPUT,typeof w=="string"?O=A.download?new u(A):new c(A):w.readable===!0&&C(w.read)&&C(w.on)?O=new h(A):(e.File&&w instanceof File||w instanceof Object)&&(O=new f(A)),O.stream(w)},unparse:function(w,A){var L=!1,k=!0,O=",",M=`\r `,I='"',R=I+I,P=!1,F=null,D=!1;(function(){if(typeof A=="object"){if(typeof A.delimiter!="string"||o.BAD_DELIMITERS.filter(function(H){return A.delimiter.indexOf(H)!==-1}).length||(O=A.delimiter),(typeof A.quotes=="boolean"||typeof A.quotes=="function"||Array.isArray(A.quotes))&&(L=A.quotes),typeof A.skipEmptyLines!="boolean"&&typeof A.skipEmptyLines!="string"||(P=A.skipEmptyLines),typeof A.newline=="string"&&(M=A.newline),typeof A.quoteChar=="string"&&(I=A.quoteChar),typeof A.header=="boolean"&&(k=A.header),Array.isArray(A.columns)){if(A.columns.length===0)throw new Error("Option columns is empty");F=A.columns}A.escapeChar!==void 0&&(R=A.escapeChar+I),typeof A.escapeFormulae=="boolean"&&(D=A.escapeFormulae)}})();var G=new RegExp(p(I),"g");if(typeof w=="string"&&(w=JSON.parse(w)),Array.isArray(w)){if(!w.length||Array.isArray(w[0]))return U(null,w,P);if(typeof w[0]=="object")return U(F||Object.keys(w[0]),w,P)}else if(typeof w=="object")return typeof w.data=="string"&&(w.data=JSON.parse(w.data)),Array.isArray(w.data)&&(w.fields||(w.fields=w.meta&&w.meta.fields),w.fields||(w.fields=Array.isArray(w.data[0])?w.fields:typeof w.data[0]=="object"?Object.keys(w.data[0]):[]),Array.isArray(w.data[0])||typeof w.data[0]=="object"||(w.data=[w.data])),U(w.fields||[],w.data||[],P);throw new Error("Unable to serialize unrecognized input");function U(H,tt,et){var ut="";typeof H=="string"&&(H=JSON.parse(H)),typeof tt=="string"&&(tt=JSON.parse(tt));var $=Array.isArray(H)&&0=this._config.preview;if(n)e.postMessage({results:M,workerId:o.WORKER_ID,finished:R});else if(C(this._config.chunk)&&!L){if(this._config.chunk(M,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);M=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(M.data),this._completeResults.errors=this._completeResults.errors.concat(M.errors),this._completeResults.meta=M.meta),this._completed||!R||!C(this._config.complete)||M&&M.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),R||M&&M.meta.paused||this._nextChunk(),M}this._halted=!0},this._sendError=function(A){C(this._config.error)?this._config.error(A):n&&this._config.error&&e.postMessage({workerId:o.WORKER_ID,error:A,finished:!1})}}function u(w){var A;(w=w||{}).chunkSize||(w.chunkSize=o.RemoteChunkSize),l.call(this,w),this._nextChunk=t?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(L){this._input=L,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(A=new XMLHttpRequest,this._config.withCredentials&&(A.withCredentials=this._config.withCredentials),t||(A.onload=S(this._chunkLoaded,this),A.onerror=S(this._chunkError,this)),A.open(this._config.downloadRequestBody?"POST":"GET",this._input,!t),this._config.downloadRequestHeaders){var L=this._config.downloadRequestHeaders;for(var k in L)A.setRequestHeader(k,L[k])}if(this._config.chunkSize){var O=this._start+this._config.chunkSize-1;A.setRequestHeader("Range","bytes="+this._start+"-"+O)}try{A.send(this._config.downloadRequestBody)}catch(M){this._chunkError(M.message)}t&&A.status===0&&this._chunkError()}},this._chunkLoaded=function(){A.readyState===4&&(A.status<200||400<=A.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:A.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(L){var k=L.getResponseHeader("Content-Range");return k===null?-1:parseInt(k.substring(k.lastIndexOf("/")+1))}(A),this.parseChunk(A.responseText)))},this._chunkError=function(L){var k=A.statusText||L;this._sendError(new Error(k))}}function f(w){var A,L;(w=w||{}).chunkSize||(w.chunkSize=o.LocalChunkSize),l.call(this,w);var k=typeof FileReader!="undefined";this.stream=function(O){this._input=O,L=O.slice||O.webkitSlice||O.mozSlice,k?((A=new FileReader).onload=S(this._chunkLoaded,this),A.onerror=S(this._chunkError,this)):A=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(O.target.result)},this._chunkError=function(){this._sendError(A.error)}}function c(w){var A;l.call(this,w=w||{}),this.stream=function(L){return A=L,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var L,k=this._config.chunkSize;return k?(L=A.substring(0,k),A=A.substring(k)):(L=A,A=""),this._finished=!A,this.parseChunk(L)}}}function h(w){l.call(this,w=w||{});var A=[],L=!0,k=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(O){this._input=O,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){k&&A.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),A.length?this.parseChunk(A.shift()):L=!0},this._streamData=S(function(O){try{A.push(typeof O=="string"?O:O.toString(this._config.encoding)),L&&(L=!1,this._checkIsFinished(),this.parseChunk(A.shift()))}catch(M){this._streamError(M)}},this),this._streamError=S(function(O){this._streamCleanUp(),this._sendError(O)},this),this._streamEnd=S(function(){this._streamCleanUp(),k=!0,this._streamData("")},this),this._streamCleanUp=S(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function d(w){var A,L,k,O=Math.pow(2,53),M=-O,I=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,R=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,P=this,F=0,D=0,G=!1,U=!1,j=[],H={data:[],errors:[],meta:{}};if(C(w.step)){var tt=w.step;w.step=function(dt){if(H=dt,$())ut();else{if(ut(),H.data.length===0)return;F+=dt.data.length,w.preview&&F>w.preview?L.abort():(H.data=H.data[0],tt(H,P))}}}function et(dt){return w.skipEmptyLines==="greedy"?dt.join("").trim()==="":dt.length===1&&dt[0].length===0}function ut(){if(H&&k&&(_t("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),k=!1),w.skipEmptyLines)for(var dt=0;dt=j.length?"__parsed_extra":j[Y]),w.transform&&(Rt=w.transform(Rt,K)),Rt=st(K,Rt),K==="__parsed_extra"?(it[K]=it[K]||[],it[K].push(Rt)):it[K]=Rt}return w.header&&(Y>j.length?_t("FieldMismatch","TooManyFields","Too many fields: expected "+j.length+" fields but parsed "+Y,D+$t):Y=Xt.length/2?`\r `:"\r"}(dt,Ut)),k=!1,w.delimiter)C(w.delimiter)&&(w.delimiter=w.delimiter(dt),H.meta.delimiter=w.delimiter);else{var $t=function(it,K,Rt,Xt,Zt){var Ae,We,$e,W;Zt=Zt||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var Te=0;Te=I)return W(!0)}else for(K=F,F++;;){if((K=G.indexOf(A,K+1))===-1)return j||_t.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:st.length,index:F}),We();if(K===H-1)return We(G.substring(F,K).replace(it,A));if(A!==P||G[K+1]!==P){if(A===P||K===0||G[K-1]!==P){$t!==-1&&$t=I)return W(!0);break}_t.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:st.length,index:F}),K++}}else K++}return We();function Zt(ne){st.push(ne),gt=F}function Ae(ne){var pt=0;if(ne!==-1){var Et=G.substring(K+1,ne);Et&&Et.trim()===""&&(pt=Et.length)}return pt}function We(ne){return j||(ne===void 0&&(ne=G.substring(F)),dt.push(ne),F=H,Zt(dt),$&&Te()),W()}function $e(ne){F=ne,Zt(dt),dt=[],Y=G.indexOf(k,F)}function W(ne){return{data:st,errors:_t,meta:{delimiter:L,linebreak:k,aborted:D,truncated:!!ne,cursor:gt+(U||0)}}}function Te(){M(W()),st=[],_t=[]}},this.abort=function(){D=!0},this.getCharIndex=function(){return F}}function m(w){var A=w.data,L=i[A.workerId],k=!1;if(A.error)L.userError(A.error,A.file);else if(A.results&&A.results.data){var O={abort:function(){k=!0,g(A.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:x,resume:x};if(C(L.userStep)){for(var M=0;Mi9});var i3=class extends Error{},G9=class extends i3{},z9=class extends i3{},K2t=(r,e=",")=>r.join(e),Z2t={accept:"*",multiple:!1,strict:!1},U9=r=>{let{accept:e,multiple:t,strict:n}=wl(wl({},Z2t),r),i=J2t({multiple:t,accept:Array.isArray(e)?K2t(e):e});return new Promise(a=>{i.onchange=()=>{a($2t(i.files,t,n)),i.remove()},i.click()})},$2t=(r,e,t)=>new Promise((n,i)=>{if(!r)return i(new G9);let a=Q2t(r,e,t);if(!a)return i(new z9);n(a)}),Q2t=(r,e,t)=>!e&&t?r.length===1?r[0]:null:r.length?r:null,J2t=({accept:r,multiple:e})=>{let t=document.createElement("input");return t.type="file",t.multiple=e,t.accept=r,t};function j9(r){return typeof r=="undefined"||r===null}function tLt(r){return typeof r=="object"&&r!==null}function eLt(r){return Array.isArray(r)?r:j9(r)?[]:[r]}function rLt(r,e){var t,n,i,a;if(e)for(a=Object.keys(e),t=0,n=a.length;ts&&(a=" ... ",e=n-s+a.length),t-n>s&&(o=" ...",t=n+s-o.length),{str:a+r.slice(e,t).replace(/\t/g,"\u2192")+o,pos:n-e+a.length}}function o3(r,e){return _o.repeat(" ",e-r.length)+r}function cLt(r,e){if(e=Object.create(e||null),!r.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,n=[0],i=[],a,o=-1;a=t.exec(r.buffer);)i.push(a.index),n.push(a.index+a[0].length),r.position<=a.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var s="",l,u,f=Math.min(r.line+e.linesAfter,i.length).toString().length,c=e.maxLength-(e.indent+f+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=a3(r.buffer,n[o-l],i[o-l],r.position-(n[o]-n[o-l]),c),s=_o.repeat(" ",e.indent)+o3((r.line-l+1).toString(),f)+" | "+u.str+` `+s;for(u=a3(r.buffer,n[o],i[o],r.position,c),s+=_o.repeat(" ",e.indent)+o3((r.line+1).toString(),f)+" | "+u.str+` `,s+=_o.repeat("-",e.indent+f+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)u=a3(r.buffer,n[o+l],i[o+l],r.position-(n[o]-n[o+l]),c),s+=_o.repeat(" ",e.indent)+o3((r.line+l+1).toString(),f)+" | "+u.str+` `;return s.replace(/\n$/,"")}var hLt=cLt,dLt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],pLt=["scalar","sequence","mapping"];function vLt(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(n){e[String(n)]=t})}),e}function mLt(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(dLt.indexOf(t)===-1)throw new Us('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.options=e,this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=vLt(e.styleAliases||null),pLt.indexOf(this.kind)===-1)throw new Us('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}var ns=mLt;function V9(r,e){var t=[];return r[e].forEach(function(n){var i=t.length;t.forEach(function(a,o){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=o)}),t[i]=n}),t}function gLt(){var r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,t;function n(i){i.multi?(r.multi[i.kind].push(i),r.multi.fallback.push(i)):r[i.kind][i.tag]=r.fallback[i.tag]=i}for(e=0,t=arguments.length;e=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),LLt=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function OLt(r){return!(r===null||!LLt.test(r)||r[r.length-1]==="_")}function DLt(r){var e,t;return e=r.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}var PLt=/^[-+]?[0-9]+e/;function kLt(r,e){var t;if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_o.isNegativeZero(r))return"-0.0";return t=r.toString(10),PLt.test(t)?t.replace("e",".e"):t}function RLt(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!=0||_o.isNegativeZero(r))}var J9=new ns("tag:yaml.org,2002:float",{kind:"scalar",resolve:OLt,construct:DLt,predicate:RLt,represent:kLt,defaultStyle:"lowercase"}),t7=K9.extend({implicit:[Z9,$9,Q9,J9]}),e7=t7,r7=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n7=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function NLt(r){return r===null?!1:r7.exec(r)!==null||n7.exec(r)!==null}function FLt(r){var e,t,n,i,a,o,s,l=0,u=null,f,c,h;if(e=r7.exec(r),e===null&&(e=n7.exec(r)),e===null)throw new Error("Date resolve error");if(t=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(t,n,i));if(a=+e[4],o=+e[5],s=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(f=+e[10],c=+(e[11]||0),u=(f*60+c)*6e4,e[9]==="-"&&(u=-u)),h=new Date(Date.UTC(t,n,i,a,o,s,l)),u&&h.setTime(h.getTime()-u),h}function BLt(r){return r.toISOString()}var i7=new ns("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:NLt,construct:FLt,instanceOf:Date,represent:BLt});function GLt(r){return r==="<<"||r===null}var a7=new ns("tag:yaml.org,2002:merge",{kind:"scalar",resolve:GLt}),l3=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function zLt(r){if(r===null)return!1;var e,t,n=0,i=r.length,a=l3;for(t=0;t64)){if(e<0)return!1;n+=6}return n%8==0}function ULt(r){var e,t,n=r.replace(/[\r\n=]/g,""),i=n.length,a=l3,o=0,s=[];for(e=0;e>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(n.charAt(e));return t=i%4*6,t===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):t===18?(s.push(o>>10&255),s.push(o>>2&255)):t===12&&s.push(o>>4&255),new Uint8Array(s)}function jLt(r){var e="",t=0,n,i,a=r.length,o=l3;for(n=0;n>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[n];return i=a%3,i===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):i===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):i===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function WLt(r){return Object.prototype.toString.call(r)==="[object Uint8Array]"}var o7=new ns("tag:yaml.org,2002:binary",{kind:"scalar",resolve:zLt,construct:ULt,predicate:WLt,represent:jLt}),VLt=Object.prototype.hasOwnProperty,HLt=Object.prototype.toString;function YLt(r){if(r===null)return!0;var e=[],t,n,i,a,o,s=r;for(t=0,n=s.length;t>10)+55296,(r-65536&1023)+56320)}var g7=new Array(256),y7=new Array(256);for(Ty=0;Ty<256;Ty++)g7[Ty]=m7(Ty)?1:0,y7[Ty]=m7(Ty);var Ty;function lOt(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||u3,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function x7(r,e){var t={name:r.filename,buffer:r.input.slice(0,-1),position:r.position,line:r.line,column:r.position-r.lineStart};return t.snippet=hLt(t),new Us(e,t)}function Br(r,e){throw x7(r,e)}function zI(r,e){r.onWarning&&r.onWarning.call(null,x7(r,e))}var b7={YAML:function(e,t,n){var i,a,o;e.version!==null&&Br(e,"duplication of %YAML directive"),n.length!==1&&Br(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Br(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&Br(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&zI(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,a;n.length!==2&&Br(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],d7.test(i)||Br(e,"ill-formed tag handle (first argument) of the TAG directive"),Uv.call(e.tagMap,i)&&Br(e,'there is a previously declared suffix for "'+i+'" tag handle'),p7.test(a)||Br(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch(o){Br(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a}};function jv(r,e,t,n){var i,a,o,s;if(e1&&(r.result+=_o.repeat(` `,e-1))}function uOt(r,e,t){var n,i,a,o,s,l,u,f,c=r.kind,h=r.result,d;if(d=r.input.charCodeAt(r.position),El(d)||sb(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=r.input.charCodeAt(r.position+1),El(i)||t&&sb(i)))return!1;for(r.kind="scalar",r.result="",a=o=r.position,s=!1;d!==0;){if(d===58){if(i=r.input.charCodeAt(r.position+1),El(i)||t&&sb(i))break}else if(d===35){if(n=r.input.charCodeAt(r.position-1),El(n))break}else{if(r.position===r.lineStart&&UI(r)||t&&sb(d))break;if($c(d))if(l=r.line,u=r.lineStart,f=r.lineIndent,ao(r,!1,-1),r.lineIndent>=e){s=!0,d=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=u,r.lineIndent=f;break}}s&&(jv(r,a,o,!1),h3(r,r.line-l),a=o=r.position,s=!1),My(d)||(o=r.position+1),d=r.input.charCodeAt(++r.position)}return jv(r,a,o,!1),r.result?!0:(r.kind=c,r.result=h,!1)}function fOt(r,e){var t,n,i;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,n=i=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(jv(r,n,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)n=r.position,r.position++,i=r.position;else return!0;else $c(t)?(jv(r,n,i,!0),h3(r,ao(r,!1,e)),n=i=r.position):r.position===r.lineStart&&UI(r)?Br(r,"unexpected end of the document within a single quoted scalar"):(r.position++,i=r.position);Br(r,"unexpected end of the stream within a single quoted scalar")}function cOt(r,e){var t,n,i,a,o,s;if(s=r.input.charCodeAt(r.position),s!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=n=r.position;(s=r.input.charCodeAt(r.position))!==0;){if(s===34)return jv(r,t,r.position,!0),r.position++,!0;if(s===92){if(jv(r,t,r.position,!0),s=r.input.charCodeAt(++r.position),$c(s))ao(r,!1,e);else if(s<256&&g7[s])r.result+=y7[s],r.position++;else if((o=aOt(s))>0){for(i=o,a=0;i>0;i--)s=r.input.charCodeAt(++r.position),(o=iOt(s))>=0?a=(a<<4)+o:Br(r,"expected hexadecimal character");r.result+=sOt(a),r.position++}else Br(r,"unknown escape sequence");t=n=r.position}else $c(s)?(jv(r,t,n,!0),h3(r,ao(r,!1,e)),t=n=r.position):r.position===r.lineStart&&UI(r)?Br(r,"unexpected end of the document within a double quoted scalar"):(r.position++,n=r.position)}Br(r,"unexpected end of the stream within a double quoted scalar")}function hOt(r,e){var t=!0,n,i,a,o=r.tag,s,l=r.anchor,u,f,c,h,d,p=Object.create(null),v,m,g,x;if(x=r.input.charCodeAt(r.position),x===91)f=93,d=!1,s=[];else if(x===123)f=125,d=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),x=r.input.charCodeAt(++r.position);x!==0;){if(ao(r,!0,e),x=r.input.charCodeAt(r.position),x===f)return r.position++,r.tag=o,r.anchor=l,r.kind=d?"mapping":"sequence",r.result=s,!0;t?x===44&&Br(r,"expected the node content, but found ','"):Br(r,"missed comma between flow collection entries"),m=v=g=null,c=h=!1,x===63&&(u=r.input.charCodeAt(r.position+1),El(u)&&(c=h=!0,r.position++,ao(r,!0,e))),n=r.line,i=r.lineStart,a=r.position,ub(r,e,BI,!1,!0),m=r.tag,v=r.result,ao(r,!0,e),x=r.input.charCodeAt(r.position),(h||r.line===n)&&x===58&&(c=!0,x=r.input.charCodeAt(++r.position),ao(r,!0,e),ub(r,e,BI,!1,!0),g=r.result),d?lb(r,s,p,m,v,g,n,i,a):c?s.push(lb(r,null,p,m,v,g,n,i,a)):s.push(v),ao(r,!0,e),x=r.input.charCodeAt(r.position),x===44?(t=!0,x=r.input.charCodeAt(++r.position)):t=!1}Br(r,"unexpected end of the stream within a flow collection")}function dOt(r,e){var t,n,i=f3,a=!1,o=!1,s=e,l=0,u=!1,f,c;if(c=r.input.charCodeAt(r.position),c===124)n=!1;else if(c===62)n=!0;else return!1;for(r.kind="scalar",r.result="";c!==0;)if(c=r.input.charCodeAt(++r.position),c===43||c===45)f3===i?i=c===43?h7:tOt:Br(r,"repeat of a chomping mode identifier");else if((f=oOt(c))>=0)f===0?Br(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Br(r,"repeat of an indentation width identifier"):(s=e+f-1,o=!0);else break;if(My(c)){do c=r.input.charCodeAt(++r.position);while(My(c));if(c===35)do c=r.input.charCodeAt(++r.position);while(!$c(c)&&c!==0)}for(;c!==0;){for(c3(r),r.lineIndent=0,c=r.input.charCodeAt(r.position);(!o||r.lineIndents&&(s=r.lineIndent),$c(c)){l++;continue}if(r.lineIndente)&&l!==0)Br(r,"bad indentation of a sequence entry");else if(r.lineIndente)&&(m&&(o=r.line,s=r.lineStart,l=r.position),ub(r,e,GI,!0,i)&&(m?p=r.result:v=r.result),m||(lb(r,c,h,d,p,v,o,s,l),d=p=v=null),ao(r,!0,-1),x=r.input.charCodeAt(r.position)),(r.line===a||r.lineIndent>e)&&x!==0)Br(r,"bad indentation of a mapping entry");else if(r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndent tag; it should be "scalar", not "'+r.kind+'"'),c=0,h=r.implicitTypes.length;c"),r.result!==null&&p.kind!==r.kind&&Br(r,"unacceptable node kind for !<"+r.tag+'> tag; it should be "'+p.kind+'", not "'+r.kind+'"'),p.resolve(r.result,r.tag)?(r.result=p.construct(r.result,r.tag),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):Br(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")}return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||f}function yOt(r){var e=r.position,t,n,i,a=!1,o;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap=Object.create(null),r.anchorMap=Object.create(null);(o=r.input.charCodeAt(r.position))!==0&&(ao(r,!0,-1),o=r.input.charCodeAt(r.position),!(r.lineIndent>0||o!==37));){for(a=!0,o=r.input.charCodeAt(++r.position),t=r.position;o!==0&&!El(o);)o=r.input.charCodeAt(++r.position);for(n=r.input.slice(t,r.position),i=[],n.length<1&&Br(r,"directive name must not be less than one character in length");o!==0;){for(;My(o);)o=r.input.charCodeAt(++r.position);if(o===35){do o=r.input.charCodeAt(++r.position);while(o!==0&&!$c(o));break}if($c(o))break;for(t=r.position;o!==0&&!El(o);)o=r.input.charCodeAt(++r.position);i.push(r.input.slice(t,r.position))}o!==0&&c3(r),Uv.call(b7,n)?b7[n](r,n,i):zI(r,'unknown document directive "'+n+'"')}if(ao(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,ao(r,!0,-1)):a&&Br(r,"directives end mark is expected"),ub(r,r.lineIndent-1,GI,!1,!0),ao(r,!0,-1),r.checkLineBreaks&&rOt.test(r.input.slice(e,r.position))&&zI(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&UI(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,ao(r,!0,-1));return}if(r.position=55296&&t<=56319&&e+1=56320&&n<=57343)?(t-55296)*1024+n-56320+65536:t}function R7(r){var e=/^\n* /;return e.test(r)}var N7=1,m3=2,F7=3,B7=4,fb=5;function qOt(r,e,t,n,i,a,o,s){var l,u=0,f=null,c=!1,h=!1,d=n!==-1,p=-1,v=YOt(vw(r,0))&&XOt(vw(r,r.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(u=vw(r,l),!pw(u))return fb;v=v&&k7(u,f,s),f=u}else{for(l=0;l=65536?l+=2:l++){if(u=vw(r,l),u===hw)c=!0,d&&(h=h||l-p-1>n&&r[p+1]!==" ",p=l);else if(!pw(u))return fb;v=v&&k7(u,f,s),f=u}h=h||d&&l-p-1>n&&r[p+1]!==" "}return!c&&!h?v&&!o&&!i(r)?N7:a===dw?fb:m3:t>9&&R7(r)?fb:o?a===dw?fb:m3:h?B7:F7}function KOt(r,e,t,n,i){r.dump=function(){if(e.length===0)return r.quotingType===dw?'""':"''";if(!r.noCompatMode&&(GOt.indexOf(e)!==-1||zOt.test(e)))return r.quotingType===dw?'"'+e+'"':"'"+e+"'";var a=r.indent*Math.max(1,t),o=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-a),s=n||r.flowLevel>-1&&t>=r.flowLevel;function l(u){return HOt(r,u)}switch(qOt(e,s,r.indent,o,l,r.quotingType,r.forceQuotes&&!n,i)){case N7:return e;case m3:return"'"+e.replace(/'/g,"''")+"'";case F7:return"|"+G7(e,r.indent)+z7(D7(e,a));case B7:return">"+G7(e,r.indent)+z7(D7(ZOt(e,o),a));case fb:return'"'+$Ot(e)+'"';default:throw new Us("impossible error: invalid scalar style")}}()}function G7(r,e){var t=R7(r)?String(e):"",n=r[r.length-1]===` `,i=n&&(r[r.length-2]===` `||r===` `),a=i?"+":n?"":"-";return t+a+` `}function z7(r){return r[r.length-1]===` `?r.slice(0,-1):r}function ZOt(r,e){for(var t=/(\n+)([^\n]*)/g,n=function(){var u=r.indexOf(` `);return u=u!==-1?u:r.length,t.lastIndex=u,U7(r.slice(0,u),e)}(),i=r[0]===` `||r[0]===" ",a,o;o=t.exec(r);){var s=o[1],l=o[2];a=l[0]===" ",n+=s+(!i&&!a&&l!==""?` `:"")+U7(l,e),i=a}return n}function U7(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,n,i=0,a,o=0,s=0,l="";n=t.exec(r);)s=n.index,s-i>e&&(a=o>i?o:s,l+=` `+r.slice(i,a),i=a+1),o=s;return l+=` `,r.length-i>e&&o>i?l+=r.slice(i,o)+` `+r.slice(o+1):l+=r.slice(i),l.slice(1)}function $Ot(r){for(var e="",t=0,n,i=0;i=65536?i+=2:i++)t=vw(r,i),n=Cs[t],!n&&pw(t)?(e+=r[i],t>=65536&&(e+=r[i+1])):e+=n||jOt(t);return e}function QOt(r,e,t){var n="",i=r.tag,a,o,s;for(a=0,o=t.length;a1024&&(f+="? "),f+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),!!Qd(r,e,u,!1,!1)&&(f+=r.dump,n+=f));r.tag=i,r.dump="{"+n+"}"}function tDt(r,e,t,n){var i="",a=r.tag,o=Object.keys(t),s,l,u,f,c,h;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new Us("sortKeys must be a boolean or a function");for(s=0,l=o.length;s1024,c&&(r.dump&&hw===r.dump.charCodeAt(0)?h+="?":h+="? "),h+=r.dump,c&&(h+=v3(r,e)),!!Qd(r,e+1,f,!0,c)&&(r.dump&&hw===r.dump.charCodeAt(0)?h+=":":h+=": ",h+=r.dump,i+=h));r.tag=a,r.dump=i||"{}"}function W7(r,e,t){var n,i,a,o,s,l;for(i=t?r.explicitTypes:r.implicitTypes,a=0,o=i.length;a tag resolver accepts not "'+l+'" style');r.dump=n}return!0}return!1}function Qd(r,e,t,n,i,a,o){r.tag=null,r.dump=t,W7(r,t,!1)||W7(r,t,!0);var s=E7.call(r.dump),l=n,u;n&&(n=r.flowLevel<0||r.flowLevel>e);var f=s==="[object Object]"||s==="[object Array]",c,h;if(f&&(c=r.duplicates.indexOf(t),h=c!==-1),(r.tag!==null&&r.tag!=="?"||h||r.indent!==2&&e>0)&&(i=!1),h&&r.usedDuplicates[c])r.dump="*ref_"+c;else{if(f&&h&&!r.usedDuplicates[c]&&(r.usedDuplicates[c]=!0),s==="[object Object]")n&&Object.keys(r.dump).length!==0?(tDt(r,e,r.dump,i),h&&(r.dump="&ref_"+c+r.dump)):(JOt(r,e,r.dump),h&&(r.dump="&ref_"+c+" "+r.dump));else if(s==="[object Array]")n&&r.dump.length!==0?(r.noArrayIndent&&!o&&e>0?j7(r,e-1,r.dump,i):j7(r,e,r.dump,i),h&&(r.dump="&ref_"+c+r.dump)):(QOt(r,e,r.dump),h&&(r.dump="&ref_"+c+" "+r.dump));else if(s==="[object String]")r.tag!=="?"&&KOt(r,r.dump,e,a,l);else{if(s==="[object Undefined]")return!1;if(r.skipInvalid)return!1;throw new Us("unacceptable kind of an object to dump "+s)}r.tag!==null&&r.tag!=="?"&&(u=encodeURI(r.tag[0]==="!"?r.tag.slice(1):r.tag).replace(/!/g,"%21"),r.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",r.dump=u+" "+r.dump)}return!0}function eDt(r,e){var t=[],n=[],i,a;for(g3(r,t,n),i=0,a=n.length;i2&&(o.children=arguments.length>3?mw.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(a in r.defaultProps)o[a]===void 0&&(o[a]=r.defaultProps[a]);return gw(r,o,n,i,null)}function gw(r,e,t,n,i){var a={type:r,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++H7:i};return i==null&&Tr.vnode!=null&&Tr.vnode(a),a}function b3(){return{current:null}}function ws(r){return r.children}function Vu(r,e){this.props=r,this.context=e}function yw(r,e){if(e==null)return r.__?yw(r.__,r.__.__k.indexOf(r)+1):null;for(var t;ee&&Iy.sort(x3));HI.__r=0}function Q7(r,e,t,n,i,a,o,s,l,u){var f,c,h,d,p,v,m,g=n&&n.__k||K7,x=g.length;for(t.__k=[],f=0;f0?gw(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)!=null){if(d.__=t,d.__b=t.__b+1,(h=g[f])===null||h&&d.key==h.key&&d.type===h.type)g[f]=void 0;else for(c=0;c=0;e--)if((t=r.__k[e])&&(n=eq(t)))return n}return null}function SDt(r,e,t,n,i){var a;for(a in t)a==="children"||a==="key"||a in e||YI(r,a,null,t[a],n);for(a in e)i&&typeof e[a]!="function"||a==="children"||a==="key"||a==="value"||a==="checked"||t[a]===e[a]||YI(r,a,e[a],t[a],n)}function rq(r,e,t){e[0]==="-"?r.setProperty(e,t==null?"":t):r[e]=t==null?"":typeof t!="number"||_Dt.test(e)?t:t+"px"}function YI(r,e,t,n,i){var a;t:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof n=="string"&&(r.style.cssText=n=""),n)for(e in n)t&&e in t||rq(r.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||rq(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")a=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+a]=t,t?n||r.addEventListener(e,a?iq:nq,a):r.removeEventListener(e,a?iq:nq,a);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in r)try{r[e]=t==null?"":t;break t}catch(o){}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?r.removeAttribute(e):r.setAttribute(e,t))}}function nq(r){return this.l[r.type+!1](Tr.event?Tr.event(r):r)}function iq(r){return this.l[r.type+!0](Tr.event?Tr.event(r):r)}function S3(r,e,t,n,i,a,o,s,l){var u,f,c,h,d,p,v,m,g,x,b,S,C,w,A,L=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,s=e.__e=t.__e,e.__h=null,a=[s]),(u=Tr.__b)&&u(e);try{t:if(typeof L=="function"){if(m=e.props,g=(u=L.contextType)&&n[u.__c],x=u?g?g.props.value:u.__:n,t.__c?v=(f=e.__c=t.__c).__=f.__E:("prototype"in L&&L.prototype.render?e.__c=f=new L(m,x):(e.__c=f=new Vu(m,x),f.constructor=L,f.render=wDt),g&&g.sub(f),f.props=m,f.state||(f.state={}),f.context=x,f.__n=n,c=f.__d=!0,f.__h=[],f._sb=[]),f.__s==null&&(f.__s=f.state),L.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Jd({},f.__s)),Jd(f.__s,L.getDerivedStateFromProps(m,f.__s))),h=f.props,d=f.state,f.__v=e,c)L.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(L.getDerivedStateFromProps==null&&m!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(m,x),!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(m,f.__s,x)===!1||e.__v===t.__v){for(e.__v!==t.__v&&(f.props=m,f.state=f.__s,f.__d=!1),f.__e=!1,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(k){k&&(k.__=e)}),b=0;b2&&(o.children=arguments.length>3?mw.call(arguments,2):t),gw(r.type,o,n||r.key,i||r.ref,null)}function w3(r,e){var t={__c:e="__cC"+q7++,__:r,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=[],(a={})[e]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(s){s.__e=!0,_3(s)})},this.sub=function(o){i.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),s&&s.call(o)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t}mw=K7.slice,Tr={__e:function(r,e,t,n){for(var i,a,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(r)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(r,n||{}),o=i.__d),o)return i.__E=i}catch(s){r=s}throw r}},H7=0,bDt=function(r){return r!=null&&r.constructor===void 0},Vu.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Jd({},this.state),typeof r=="function"&&(r=r(Jd({},t),this.props)),r&&Jd(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),_3(this))},Vu.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),_3(this))},Vu.prototype.render=ws,Iy=[],X7=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x3=function(r,e){return r.__v.__b-e.__v.__b},HI.__r=0,q7=0;var Ly,la,E3,uq,hb=0,fq=[],XI=[],cq=Tr.__b,hq=Tr.__r,dq=Tr.diffed,pq=Tr.__c,vq=Tr.unmount;function db(r,e){Tr.__h&&Tr.__h(la,r,hb||e),hb=0;var t=la.__H||(la.__H={__:[],__h:[]});return r>=t.__.length&&t.__.push({__V:XI}),t.__[r]}function xw(r){return hb=1,A3(bq,r)}function A3(r,e,t){var n=db(Ly++,2);if(n.t=r,!n.__c&&(n.__=[t?t(e):bq(void 0,e),function(s){var l=n.__N?n.__N[0]:n.__[0],u=n.t(l,s);l!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=la,!la.u)){var i=function(s,l,u){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(h){return h.__c});if(f.every(function(h){return!h.__N}))return!a||a.call(this,s,l,u);var c=!1;return f.forEach(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(c=!0)}}),!(!c&&n.__c.props===s)&&(!a||a.call(this,s,l,u))};la.u=!0;var a=la.shouldComponentUpdate,o=la.componentWillUpdate;la.componentWillUpdate=function(s,l,u){if(this.__e){var f=a;a=void 0,i(s,l,u),a=f}o&&o.call(this,s,l,u)},la.shouldComponentUpdate=i}return n.__N||n.__}function De(r,e){var t=db(Ly++,3);!Tr.__s&&T3(t.__H,e)&&(t.__=r,t.i=e,la.__H.__h.push(t))}function bw(r,e){var t=db(Ly++,4);!Tr.__s&&T3(t.__H,e)&&(t.__=r,t.i=e,la.__h.push(t))}function Fa(r){return hb=5,qI(function(){return{current:r}},[])}function ur(r,e,t){hb=6,bw(function(){return typeof r=="function"?(r(e()),function(){return r(null)}):r?(r.current=e(),function(){return r.current=null}):void 0},t==null?t:t.concat(r))}function qI(r,e){var t=db(Ly++,7);return T3(t.__H,e)?(t.__V=r(),t.i=e,t.__h=r,t.__V):t.__}function KI(r,e){return hb=8,qI(function(){return r},e)}function mq(r){var e=la.context[r.__c],t=db(Ly++,9);return t.c=r,e?(t.__==null&&(t.__=!0,e.sub(la)),e.props.value):r.__}function gq(r,e){Tr.useDebugValue&&Tr.useDebugValue(e?e(r):r)}function yq(){var r=db(Ly++,11);if(!r.__){for(var e=la.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);r.__="P"+t[0]+"-"+t[1]++}return r.__}function EDt(){for(var r;r=fq.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(ZI),r.__H.__h.forEach(M3),r.__H.__h=[]}catch(e){r.__H.__h=[],Tr.__e(e,r.__v)}}Tr.__b=function(r){la=null,cq&&cq(r)},Tr.__r=function(r){hq&&hq(r),Ly=0;var e=(la=r.__c).__H;e&&(E3===la?(e.__h=[],la.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=XI,t.__N=t.i=void 0})):(e.__h.forEach(ZI),e.__h.forEach(M3),e.__h=[])),E3=la},Tr.diffed=function(r){dq&&dq(r);var e=r.__c;e&&e.__H&&(e.__H.__h.length&&(fq.push(e)!==1&&uq===Tr.requestAnimationFrame||((uq=Tr.requestAnimationFrame)||ADt)(EDt)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==XI&&(t.__=t.__V),t.i=void 0,t.__V=XI})),E3=la=null},Tr.__c=function(r,e){e.some(function(t){try{t.__h.forEach(ZI),t.__h=t.__h.filter(function(n){return!n.__||M3(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Tr.__e(n,t.__v)}}),pq&&pq(r,e)},Tr.unmount=function(r){vq&&vq(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{ZI(n)}catch(i){e=i}}),t.__H=void 0,e&&Tr.__e(e,t.__v))};var xq=typeof requestAnimationFrame=="function";function ADt(r){var e,t=function(){clearTimeout(n),xq&&cancelAnimationFrame(e),setTimeout(r)},n=setTimeout(t,100);xq&&(e=requestAnimationFrame(t))}function ZI(r){var e=la,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),la=e}function M3(r){var e=la;r.__c=r.__(),la=e}function T3(r,e){return!r||r.length!==e.length||e.some(function(t,n){return t!==r[n]})}function bq(r,e){return typeof e=="function"?e(r):e}function _q(r,e){for(var t in e)r[t]=e[t];return r}function I3(r,e){for(var t in r)if(t!=="__source"&&!(t in e))return!0;for(var n in e)if(n!=="__source"&&r[n]!==e[n])return!0;return!1}function L3(r,e){return r===e&&(r!==0||1/r==1/e)||r!=r&&e!=e}function O3(r){this.props=r}function MDt(r,e){function t(i){var a=this.props.ref,o=a==i.ref;return!o&&a&&(a.call?a(null):a.current=null),e?!e(this.props,i)||!o:I3(this.props,i)}function n(i){return this.shouldComponentUpdate=t,si(r,i)}return n.displayName="Memo("+(r.displayName||r.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(O3.prototype=new Vu).isPureReactComponent=!0,O3.prototype.shouldComponentUpdate=function(r,e){return I3(this.props,r)||I3(this.state,e)};var Sq=Tr.__b;Tr.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),Sq&&Sq(r)};var TDt=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function cr(r){function e(t){var n=_q({},t);return delete n.ref,r(n,t.ref||null)}return e.$$typeof=TDt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(r.displayName||r.name)+")",e}var Cq=function(r,e){return r==null?null:Qc(Qc(r).map(e))},IDt={map:Cq,forEach:Cq,count:function(r){return r?Qc(r).length:0},only:function(r){var e=Qc(r);if(e.length!==1)throw"Children.only";return e[0]},toArray:Qc},LDt=Tr.__e;Tr.__e=function(r,e,t,n){if(r.then){for(var i,a=e;a=a.__;)if((i=a.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(r,e)}LDt(r,e,t,n)};var wq=Tr.unmount;function Eq(r,e,t){return r&&(r.__c&&r.__c.__H&&(r.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),r.__c.__H=null),(r=_q({},r)).__c!=null&&(r.__c.__P===t&&(r.__c.__P=e),r.__c=null),r.__k=r.__k&&r.__k.map(function(n){return Eq(n,e,t)})),r}function Aq(r,e,t){return r&&(r.__v=null,r.__k=r.__k&&r.__k.map(function(n){return Aq(n,e,t)}),r.__c&&r.__c.__P===e&&(r.__e&&t.insertBefore(r.__e,r.__d),r.__c.__e=!0,r.__c.__P=t)),r}function $I(){this.__u=0,this.t=null,this.__b=null}function Mq(r){var e=r.__.__c;return e&&e.__a&&e.__a(r)}function ODt(r){var e,t,n;function i(a){if(e||(e=r()).then(function(o){t=o.default||o},function(o){n=o}),n)throw n;if(!t)throw e;return si(t,a)}return i.displayName="Lazy",i.__f=!0,i}function _w(){this.u=null,this.o=null}Tr.unmount=function(r){var e=r.__c;e&&e.__R&&e.__R(),e&&r.__h===!0&&(r.type=null),wq&&wq(r)},($I.prototype=new Vu).__c=function(r,e){var t=e.__c,n=this;n.t==null&&(n.t=[]),n.t.push(t);var i=Mq(n.__v),a=!1,o=function(){a||(a=!0,t.__R=null,i?i(s):s())};t.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Aq(u,u.__c.__P,u.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.t.pop();)f.forceUpdate()}},l=e.__h===!0;n.__u++||l||n.setState({__a:n.__b=n.__v.__k[0]}),r.then(o,o)},$I.prototype.componentWillUnmount=function(){this.t=[]},$I.prototype.render=function(r,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Eq(this.__b,t,n.__O=n.__P)}this.__b=null}var i=e.__a&&si(ws,null,r.fallback);return i&&(i.__h=null),[si(ws,null,e.__a?null:r.children),i]};var Tq=function(r,e,t){if(++t[1]===t[0]&&r.o.delete(e),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(t=r.u;t;){for(;t.length>3;)t.pop()();if(t[1]>>1,1),e.i.removeChild(n)}}),cb(si(DDt,{context:e.context},r.__v),e.l)):e.l&&e.componentWillUnmount()}function kDt(r,e){var t=si(PDt,{__v:r,i:e});return t.containerInfo=e,t}(_w.prototype=new Vu).__a=function(r){var e=this,t=Mq(e.__v),n=e.o.get(r);return n[0]++,function(i){var a=function(){e.props.revealOrder?(n.push(i),Tq(e,r,n)):i()};t?t(a):a()}},_w.prototype.render=function(r){this.u=null,this.o=new Map;var e=Qc(r.children);r.revealOrder&&r.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return r.children},_w.prototype.componentDidUpdate=_w.prototype.componentDidMount=function(){var r=this;this.o.forEach(function(e,t){Tq(r,t,e)})};var Iq=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,RDt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,NDt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,FDt=/[A-Z0-9]/g,BDt=typeof document!="undefined",GDt=function(r){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(r)};function QI(r,e,t){return e.__k==null&&(e.textContent=""),cb(r,e),typeof t=="function"&&t(),r?r.__c:null}function zDt(r,e,t){return C3(r,e),typeof t=="function"&&t(),r?r.__c:null}Vu.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(r){Object.defineProperty(Vu.prototype,r,{configurable:!0,get:function(){return this["UNSAFE_"+r]},set:function(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})});var Lq=Tr.event;function UDt(){}function jDt(){return this.cancelBubble}function WDt(){return this.defaultPrevented}Tr.event=function(r){return Lq&&(r=Lq(r)),r.persist=UDt,r.isPropagationStopped=jDt,r.isDefaultPrevented=WDt,r.nativeEvent=r};var D3,VDt={enumerable:!1,configurable:!0,get:function(){return this.class}},Oq=Tr.vnode;Tr.vnode=function(r){typeof r.type=="string"&&function(e){var t=e.props,n=e.type,i={};for(var a in t){var o=t[a];if(!(a==="value"&&"defaultValue"in t&&o==null||BDt&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in t&&t.value==null?a="value":a==="download"&&o===!0?o="":s==="ondoubleclick"?a="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||GDt(t.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":NDt.test(a)?a=s:n.indexOf("-")===-1&&RDt.test(a)?a=a.replace(FDt,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&i[a=s]&&(a="oninputCapture"),i[a]=o}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Qc(t.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Qc(t.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",VDt)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(r),r.$$typeof=Iq,Oq&&Oq(r)};var Dq=Tr.__r;Tr.__r=function(r){Dq&&Dq(r),D3=r.__c};var Pq=Tr.diffed;Tr.diffed=function(r){Pq&&Pq(r);var e=r.props,t=r.__e;t!=null&&r.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),D3=null};var HDt={ReactCurrentDispatcher:{current:{readContext:function(r){return D3.__n[r.__c].props.value}}}};function YDt(r){return si.bind(null,r)}function kq(r){return!!r&&r.$$typeof===Iq}function XDt(r){return kq(r)?lq.apply(null,arguments):r}function P3(r){return!!r.__k&&(cb(null,r),!0)}function qDt(r){return r&&(r.base||r.nodeType===1&&r)||null}var KDt=function(r,e){return r(e)},ZDt=function(r,e){return r(e)},$Dt=ws;function Rq(r){r()}function QDt(r){return r}function JDt(){return[!1,Rq]}var tPt=bw;function ePt(r,e){var t=e(),n=xw({h:{__:t,v:e}}),i=n[0].h,a=n[1];return bw(function(){i.__=t,i.v=e,L3(i.__,e())||a({h:i})},[r,t,e]),De(function(){return L3(i.__,i.v())||a({h:i}),r(function(){L3(i.__,i.v())||a({h:i})})},[r]),t}var ht={useState:xw,useId:yq,useReducer:A3,useEffect:De,useLayoutEffect:bw,useInsertionEffect:tPt,useTransition:JDt,useDeferredValue:QDt,useSyncExternalStore:ePt,startTransition:Rq,useRef:Fa,useImperativeHandle:ur,useMemo:qI,useCallback:KI,useContext:mq,useDebugValue:gq,version:"17.0.2",Children:IDt,render:QI,hydrate:zDt,unmountComponentAtNode:P3,createPortal:kDt,createElement:si,createContext:w3,createFactory:YDt,cloneElement:XDt,createRef:b3,Fragment:ws,isValidElement:kq,findDOMNode:qDt,Component:Vu,PureComponent:O3,memo:MDt,forwardRef:cr,flushSync:ZDt,unstable_batchedUpdates:KDt,StrictMode:$Dt,Suspense:$I,SuspenseList:_w,lazy:ODt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:HDt};var kF=z(require("obsidian"));var nA={};Dn(nA,{Action:()=>Ir,BRUSH_FILTER_EVENTS:()=>fs,Chart:()=>EE,ComponentController:()=>Bl,Coordinate:()=>hh,DIRECTION:()=>xe,ELEMENT_RANGE_HIGHLIGHT_EVENTS:()=>nf,Element:()=>i1,Event:()=>zn,Facet:()=>Hs,Geometry:()=>Wo,GeometryLabel:()=>Ch,Interaction:()=>xE,InteractionAction:()=>Ir,LAYER:()=>di,Scale:()=>qu,TooltipController:()=>r1,Util:()=>ea,VERSION:()=>O6t,VIEW_LIFE_CIRCLE:()=>wr,View:()=>wE,getActionClass:()=>rc,getAnimation:()=>AE,getEngine:()=>u2,getFacet:()=>NL,getGeometryLabel:()=>$L,getGeometryLabelLayout:()=>QL,getInteraction:()=>EU,getShapeFactory:()=>ME,getTheme:()=>Qu,registerAction:()=>nr,registerAnimation:()=>Ms,registerComponentController:()=>Ju,registerEngine:()=>Ew,registerFacet:()=>fp,registerGeometry:()=>Fl,registerGeometryLabel:()=>gp,registerGeometryLabelLayout:()=>us,registerInteraction:()=>xr,registerShape:()=>or,registerShapeFactory:()=>jo,registerTheme:()=>s0});var rK=z(Sw()),{__extends:V,__assign:E,__rest:rr,__decorate:pge,__param:vge,__metadata:mge,__awaiter:Xf,__generator:qf,__exportStar:gge,__createBinding:yge,__values:xge,__read:bge,__spread:_ge,__spreadArrays:dn,__spreadArray:mn,__await:Sge,__asyncGenerator:Cge,__asyncDelegator:wge,__asyncValues:Ege,__makeTemplateObject:Age,__importStar:Mge,__importDefault:Tge,__classPrivateFieldGet:Ige,__classPrivateFieldSet:Lge}=rK.default;var e1=z(q());var di;(function(r){r.FORE="fore",r.MID="mid",r.BG="bg"})(di||(di={}));var xe;(function(r){r.TOP="top",r.TOP_LEFT="top-left",r.TOP_RIGHT="top-right",r.RIGHT="right",r.RIGHT_TOP="right-top",r.RIGHT_BOTTOM="right-bottom",r.LEFT="left",r.LEFT_TOP="left-top",r.LEFT_BOTTOM="left-bottom",r.BOTTOM="bottom",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_RIGHT="bottom-right",r.RADIUS="radius",r.CIRCLE="circle",r.NONE="none"})(xe||(xe={}));var ua;(function(r){r.AXIS="axis",r.GRID="grid",r.LEGEND="legend",r.TOOLTIP="tooltip",r.ANNOTATION="annotation",r.SLIDER="slider",r.SCROLLBAR="scrollbar",r.OTHER="other"})(ua||(ua={}));var Wv={FORE:3,MID:2,BG:1},wr;(function(r){r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_PAINT="beforepaint",r.AFTER_PAINT="afterpaint",r.BEFORE_CHANGE_DATA="beforechangedata",r.AFTER_CHANGE_DATA="afterchangedata",r.BEFORE_CLEAR="beforeclear",r.AFTER_CLEAR="afterclear",r.BEFORE_DESTROY="beforedestroy",r.BEFORE_CHANGE_SIZE="beforechangesize",r.AFTER_CHANGE_SIZE="afterchangesize"})(wr||(wr={}));var Vv;(function(r){r.BEFORE_DRAW_ANIMATE="beforeanimate",r.AFTER_DRAW_ANIMATE="afteranimate"})(Vv||(Vv={}));var js;(function(r){r.MOUSE_ENTER="plot:mouseenter",r.MOUSE_DOWN="plot:mousedown",r.MOUSE_MOVE="plot:mousemove",r.MOUSE_UP="plot:mouseup",r.MOUSE_LEAVE="plot:mouseleave",r.TOUCH_START="plot:touchstart",r.TOUCH_MOVE="plot:touchmove",r.TOUCH_END="plot:touchend",r.TOUCH_CANCEL="plot:touchcancel",r.CLICK="plot:click",r.DBLCLICK="plot:dblclick",r.CONTEXTMENU="plot:contextmenu",r.LEAVE="plot:leave",r.ENTER="plot:enter"})(js||(js={}));var ww;(function(r){r.ACTIVE="active",r.INACTIVE="inactive",r.SELECTED="selected",r.DEFAULT="default"})(ww||(ww={}));var Py=["color","shape","size"],Tn="_origin",n4=1,i4=1,a4=.25;var BZ={};function u2(r){var e=BZ[r];if(!e)throw new Error("G engine '".concat(r,"' is not exist, please register it at first."));return e}function Ew(r,e){BZ[r]=e}function Ws(r,e,t){if(r){if(typeof r.addEventListener=="function")return r.addEventListener(e,t,!1),{remove:function(){r.removeEventListener(e,t,!1)}};if(typeof r.attachEvent=="function")return r.attachEvent("on"+e,t),{remove:function(){r.detachEvent("on"+e,t)}}}}var Aw,o4,GZ,s4;function VBt(){Aw=document.createElement("table"),o4=document.createElement("tr"),GZ=/^\s*<(\w+|!)[^>]*>/,s4={tr:document.createElement("tbody"),tbody:Aw,thead:Aw,tfoot:Aw,td:o4,th:o4,"*":document.createElement("div")}}function en(r){Aw||VBt();var e=GZ.test(r)&&RegExp.$1;(!e||!(e in s4))&&(e="*");var t=s4[e];r=r.replace(/(^\s*)|(\s*$)/g,""),t.innerHTML=""+r;var n=t.childNodes[0];return t.removeChild(n),n}function oo(r,e,t){var n;try{n=window.getComputedStyle?window.getComputedStyle(r,null)[e]:r.style[e]}catch(i){}finally{n=n===void 0?t:n}return n}function f2(r,e){var t=oo(r,"height",e);return t==="auto"&&(t=r.offsetHeight),parseFloat(t)}function c2(r,e){var t=f2(r,e),n=parseFloat(oo(r,"borderTopWidth"))||0,i=parseFloat(oo(r,"paddingTop"))||0,a=parseFloat(oo(r,"paddingBottom"))||0,o=parseFloat(oo(r,"borderBottomWidth"))||0,s=parseFloat(oo(r,"marginTop"))||0,l=parseFloat(oo(r,"marginBottom"))||0;return t+n+o+i+a+s+l}function h2(r,e){var t=oo(r,"width",e);return t==="auto"&&(t=r.offsetWidth),parseFloat(t)}function d2(r,e){var t=h2(r,e),n=parseFloat(oo(r,"borderLeftWidth"))||0,i=parseFloat(oo(r,"paddingLeft"))||0,a=parseFloat(oo(r,"paddingRight"))||0,o=parseFloat(oo(r,"borderRightWidth"))||0,s=parseFloat(oo(r,"marginRight"))||0,l=parseFloat(oo(r,"marginLeft"))||0;return t+n+o+i+a+l+s}function yr(r,e){if(r)for(var t in e)e.hasOwnProperty(t)&&(r.style[t]=e[t]);return r}function HBt(r){var e=getComputedStyle(r);return{width:(r.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10),height:(r.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)}}function zZ(r){return typeof r=="number"&&!isNaN(r)}function l4(r,e,t,n){var i=t,a=n;if(e){var o=HBt(r);i=o.width?o.width:i,a=o.height?o.height:a}return{width:Math.max(zZ(i)?i:n4,n4),height:Math.max(zZ(a)?a:i4,i4)}}function UZ(r){var e=r.parentNode;e&&e.removeChild(r)}var Qe=z(q());var YBt="*",XBt=function(){function r(){this._events={}}return r.prototype.on=function(e,t,n){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!n}),this},r.prototype.once=function(e,t){return this.on(e,t,!0),this},r.prototype.emit=function(e){for(var t=this,n=[],i=1;iu4,fillPath:()=>s3t,fillPathByDiff:()=>d4,formatPath:()=>m2,intersection:()=>n3t,parsePathArray:()=>VZ,parsePathString:()=>ky,pathToAbsolute:()=>f4,pathToCurve:()=>c4,rectPath:()=>XZ});var Mw=z(q()),Tw=` \v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029`,KBt=new RegExp("([a-z])["+Tw+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Tw+"]*,?["+Tw+"]*)+)","ig"),ZBt=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Tw+"]*,?["+Tw+"]*","ig"),ky=function(r){if(!r)return null;if((0,Mw.isArray)(r))return r;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(r).replace(KBt,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(ZBt,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return r}),t},u4=function(r,e){for(var t=[],n=0,i=r.length;i-2*!e>n;n+=2){var a=[{x:+r[n-2],y:+r[n-1]},{x:+r[n],y:+r[n+1]},{x:+r[n+2],y:+r[n+3]},{x:+r[n+4],y:+r[n+5]}];e?n?i-4===n?a[3]={x:+r[0],y:+r[1]}:i-2===n&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[i-2],y:+r[i-1]}:i-4===n?a[3]=a[2]:n||(a[0]={x:+r[n],y:+r[n+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},p2=function(r,e,t,n,i){var a=[];if(i===null&&n===null&&(n=t),r=+r,e=+e,t=+t,n=+n,i!==null){var o=Math.PI/180,s=r+t*Math.cos(-n*o),l=r+t*Math.cos(-i*o),u=e+t*Math.sin(-n*o),f=e+t*Math.sin(-i*o);a=[["M",s,u],["A",t,t,0,+(i-n>180),0,l,f]]}else a=[["M",r,e],["m",0,-n],["a",t,n,0,1,1,0,2*n],["a",t,n,0,1,1,0,-2*n],["z"]];return a},f4=function(r){if(r=ky(r),!r||!r.length)return[["M",0,0]];var e=[],t=0,n=0,i=0,a=0,o=0,s,l;r[0][0]==="M"&&(t=+r[0][1],n=+r[0][2],i=t,a=n,o++,e[0]=["M",t,n]);for(var u=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",f=void 0,c=void 0,h=o,d=r.length;h1&&(C=Math.sqrt(C),t=C*t,n=C*n);var w=t*t,A=n*n,L=(a===o?-1:1)*Math.sqrt(Math.abs((w*A-w*S*S-A*b*b)/(w*S*S+A*b*b)));m=L*t*S/n+(r+s)/2,g=L*-n*b/t+(e+l)/2,p=Math.asin(((e-g)/n).toFixed(9)),v=Math.asin(((l-g)/n).toFixed(9)),p=rv&&(p=p-Math.PI*2),!o&&v>p&&(v=v-Math.PI*2)}var k=v-p;if(Math.abs(k)>f){var O=v,M=s,I=l;v=p+f*(o&&v>p?1:-1),s=m+t*Math.cos(v),l=g+n*Math.sin(v),h=WZ(s,l,t,n,i,0,o,M,I,[v,O,m,g])}k=v-p;var R=Math.cos(p),P=Math.sin(p),F=Math.cos(v),D=Math.sin(v),G=Math.tan(k/4),U=4/3*t*G,j=4/3*n*G,H=[r,e],tt=[r+U*P,e-j*R],et=[s+U*D,l-j*F],ut=[s,l];if(tt[0]=2*H[0]-tt[0],tt[1]=2*H[1]-tt[1],u)return[tt,et,ut].concat(h);h=[tt,et,ut].concat(h).join().split(",");for(var $=[],st=0,_t=h.length;st<_t;st++)$[st]=st%2?x(h[st-1],h[st],c).y:x(h[st],h[st+1],c).x;return $},c4=function(r,e){var t=f4(r),n=e&&f4(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],l="",u="",f,c=function(b,S,C){var w,A;if(!b)return["C",S.x,S.y,S.x,S.y,S.x,S.y];switch(!(b[0]in{T:1,Q:1})&&(S.qx=S.qy=null),b[0]){case"M":S.X=b[1],S.Y=b[2];break;case"A":b=["C"].concat(WZ.apply(0,[S.x,S.y].concat(b.slice(1))));break;case"S":C==="C"||C==="S"?(w=S.x*2-S.bx,A=S.y*2-S.by):(w=S.x,A=S.y),b=["C",w,A].concat(b.slice(1));break;case"T":C==="Q"||C==="T"?(S.qx=S.x*2-S.qx,S.qy=S.y*2-S.qy):(S.qx=S.x,S.qy=S.y),b=["C"].concat(jZ(S.x,S.y,S.qx,S.qy,b[1],b[2]));break;case"Q":S.qx=b[1],S.qy=b[2],b=["C"].concat(jZ(S.x,S.y,b[1],b[2],b[3],b[4]));break;case"L":b=["C"].concat(v2(S.x,S.y,b[1],b[2]));break;case"H":b=["C"].concat(v2(S.x,S.y,b[1],S.y));break;case"V":b=["C"].concat(v2(S.x,S.y,S.x,b[1]));break;case"Z":b=["C"].concat(v2(S.x,S.y,S.X,S.Y));break;default:break}return b},h=function(b,S){if(b[S].length>7){b[S].shift();for(var C=b[S];C.length;)o[S]="A",n&&(s[S]="A"),b.splice(S++,0,["C"].concat(C.splice(0,6)));b.splice(S,1),f=Math.max(t.length,n&&n.length||0)}},d=function(b,S,C,w,A){b&&S&&b[A][0]==="M"&&S[A][0]!=="M"&&(S.splice(A,0,["M",w.x,w.y]),C.bx=0,C.by=0,C.x=b[A][1],C.y=b[A][2],f=Math.max(t.length,n&&n.length||0))};f=Math.max(t.length,n&&n.length||0);for(var p=0;p1?1:l<0?0:l;for(var u=l/2,f=12,c=[-.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],d=0,p=0;p0&&d<1&&l.push(d);continue}var v=c*c-4*h*f,m=Math.sqrt(v);if(!(v<0)){var g=(-c+m)/(2*f);g>0&&g<1&&l.push(g);var x=(-c-m)/(2*f);x>0&&x<1&&l.push(x)}}for(var b=l.length,S=b,C;b--;)d=l[b],C=1-d,u[0][b]=C*C*C*r+3*C*C*d*t+3*C*d*d*i+d*d*d*o,u[1][b]=C*C*C*e+3*C*C*d*n+3*C*d*d*a+d*d*d*s;return u[0][S]=r,u[1][S]=e,u[0][S+1]=o,u[1][S+1]=s,u[0].length=u[1].length=S+2,{min:{x:Math.min.apply(0,u[0]),y:Math.min.apply(0,u[1])},max:{x:Math.max.apply(0,u[0]),y:Math.max.apply(0,u[1])}}},JBt=function(r,e,t,n,i,a,o,s){if(!(Math.max(r,t)Math.max(i,o)||Math.max(e,n)Math.max(a,s))){var l=(r*n-e*t)*(i-o)-(r-t)*(i*s-a*o),u=(r*n-e*t)*(a-s)-(e-n)*(i*s-a*o),f=(r-t)*(a-s)-(e-n)*(i-o);if(!!f){var c=l/f,h=u/f,d=+c.toFixed(2),p=+h.toFixed(2);if(!(d<+Math.min(r,t).toFixed(2)||d>+Math.max(r,t).toFixed(2)||d<+Math.min(i,o).toFixed(2)||d>+Math.max(i,o).toFixed(2)||p<+Math.min(e,n).toFixed(2)||p>+Math.max(e,n).toFixed(2)||p<+Math.min(a,s).toFixed(2)||p>+Math.max(a,s).toFixed(2)))return{x:c,y:h}}}},Yv=function(r,e,t){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},XZ=function(r,e,t,n,i){if(i)return[["M",+r+ +i,e],["l",t-i*2,0],["a",i,i,0,0,1,i,i],["l",0,n-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-t,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-n],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",r,e],["l",t,0],["l",0,n],["l",-t,0],["z"]];return a.parsePathArray=VZ,a},h4=function(r,e,t,n){return r===null&&(r=e=t=n=0),e===null&&(e=r.y,t=r.width,n=r.height,r=r.x),{x:r,y:e,width:t,w:t,height:n,h:n,x2:r+t,y2:e+n,cx:r+t/2,cy:e+n/2,r1:Math.min(t,n)/2,r2:Math.max(t,n)/2,r0:Math.sqrt(t*t+n*n)/2,path:XZ(r,e,t,n),vb:[r,e,t,n].join(" ")}},t3t=function(r,e){return r=h4(r),e=h4(e),Yv(e,r.x,r.y)||Yv(e,r.x2,r.y)||Yv(e,r.x,r.y2)||Yv(e,r.x2,r.y2)||Yv(r,e.x,e.y)||Yv(r,e.x2,e.y)||Yv(r,e.x,e.y2)||Yv(r,e.x2,e.y2)||(r.xe.x||e.xr.x)&&(r.ye.y||e.yr.y)},qZ=function(r,e,t,n,i,a,o,s){(0,Mw.isArray)(r)||(r=[r,e,t,n,i,a,o,s]);var l=QBt.apply(null,r);return h4(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},KZ=function(r,e,t,n,i,a,o,s,l){var u=1-l,f=Math.pow(u,3),c=Math.pow(u,2),h=l*l,d=h*l,p=f*r+c*3*l*t+u*3*l*l*i+d*o,v=f*e+c*3*l*n+u*3*l*l*a+d*s,m=r+2*l*(t-r)+h*(i-2*t+r),g=e+2*l*(n-e)+h*(a-2*n+e),x=t+2*l*(i-t)+h*(o-2*i+t),b=n+2*l*(a-n)+h*(s-2*a+n),S=u*r+l*t,C=u*e+l*n,w=u*i+l*o,A=u*a+l*s,L=90-Math.atan2(m-x,g-b)*180/Math.PI;return{x:p,y:v,m:{x:m,y:g},n:{x,y:b},start:{x:S,y:C},end:{x:w,y:A},alpha:L}},e3t=function(r,e,t){var n=qZ(r),i=qZ(e);if(!t3t(n,i))return t?0:[];for(var a=YZ.apply(0,r),o=YZ.apply(0,e),s=~~(a/8),l=~~(o/8),u=[],f=[],c={},h=t?0:[],d=0;d=0&&A<=1&&L>=0&&L<=1&&(t?h+=1:h.push({x:w.x,y:w.y,t1:A,t2:L}))}}return h},r3t=function(r,e,t){r=c4(r),e=c4(e);for(var n,i,a,o,s,l,u,f,c,h,d=t?0:[],p=0,v=r.length;p=3&&(c.length===3&&h.push("Q"),h=h.concat(c[1])),c.length===2&&h.push("L"),h=h.concat(c[c.length-1]),h});return f}var o3t=function(r,e,t){if(t===1)return[[].concat(r)];var n=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")n=n.concat(a3t(r,e,t));else{var i=[].concat(r);i[0]==="M"&&(i[0]="L");for(var a=0;a<=t-1;a++)n.push(i)}return n},s3t=function(r,e){if(r.length===1)return r;var t=r.length-1,n=e.length-1,i=t/n,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o=0;l--)o=a[l].index,a[l].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}n=r.length;var c=i-n;if(n0)t=p4(t,r[n-1],1);else{r[n]=e[n];break}r[n]=["Q"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"T":r[n]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(n>0)t=p4(t,r[n-1],2);else{r[n]=e[n];break}r[n]=["C"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(t.length<2)if(n>0)t=p4(t,r[n-1],1);else{r[n]=e[n];break}r[n]=["S"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;default:r[n]=e[n]}return r};var c3t=function(){function r(e,t){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=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}(),Yu=c3t;var Gn=z(q());function g2(r,e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)}var v4=typeof window!="undefined"&&typeof window.document!="undefined";function y2(r,e){if(r.isCanvas())return!0;for(var t=e.getParent(),n=!1;t;){if(t===r){n=!0;break}t=t.getParent()}return n}function Xv(r){return r.cfg.visible&&r.cfg.capture}var h3t=function(r){V(e,r);function e(t){var n=r.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=(0,Gn.mix)(i,t),n}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,n){this.cfg[t]=n},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(Hv),Ry=h3t;var $Z=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;nX3t,adjoint:()=>P3t,clone:()=>A3t,copy:()=>M3t,create:()=>m4,determinant:()=>k3t,equals:()=>$3t,exactEquals:()=>Z3t,frob:()=>Y3t,fromMat2d:()=>U3t,fromMat4:()=>E3t,fromQuat:()=>j3t,fromRotation:()=>G3t,fromScaling:()=>z3t,fromTranslation:()=>B3t,fromValues:()=>T3t,identity:()=>L3t,invert:()=>D3t,mul:()=>Q3t,multiply:()=>e$,multiplyScalar:()=>q3t,multiplyScalarAndAdd:()=>K3t,normalFromMat4:()=>W3t,projection:()=>V3t,rotate:()=>N3t,scale:()=>F3t,set:()=>I3t,str:()=>H3t,sub:()=>J3t,subtract:()=>r$,translate:()=>R3t,transpose:()=>O3t});function m4(){var r=new Ei(9);return Ei!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function E3t(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[4],r[4]=e[5],r[5]=e[6],r[6]=e[8],r[7]=e[9],r[8]=e[10],r}function A3t(r){var e=new Ei(9);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function M3t(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function T3t(r,e,t,n,i,a,o,s,l){var u=new Ei(9);return u[0]=r,u[1]=e,u[2]=t,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u[8]=l,u}function I3t(r,e,t,n,i,a,o,s,l,u){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=l,r[8]=u,r}function L3t(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function O3t(r,e){if(r===e){var t=e[1],n=e[2],i=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=n,r[7]=i}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}function D3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=f*o-s*u,h=-f*a+s*l,d=u*a-o*l,p=t*c+n*h+i*d;return p?(p=1/p,r[0]=c*p,r[1]=(-f*n+i*u)*p,r[2]=(s*n-i*o)*p,r[3]=h*p,r[4]=(f*t-i*l)*p,r[5]=(-s*t+i*a)*p,r[6]=d*p,r[7]=(-u*t+n*l)*p,r[8]=(o*t-n*a)*p,r):null}function P3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8];return r[0]=o*f-s*u,r[1]=i*u-n*f,r[2]=n*s-i*o,r[3]=s*l-a*f,r[4]=t*f-i*l,r[5]=i*a-t*s,r[6]=a*u-o*l,r[7]=n*l-t*u,r[8]=t*o-n*a,r}function k3t(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],l=r[7],u=r[8];return e*(u*a-o*l)+t*(-u*i+o*s)+n*(l*i-a*s)}function e$(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=t[0],d=t[1],p=t[2],v=t[3],m=t[4],g=t[5],x=t[6],b=t[7],S=t[8];return r[0]=h*n+d*o+p*u,r[1]=h*i+d*s+p*f,r[2]=h*a+d*l+p*c,r[3]=v*n+m*o+g*u,r[4]=v*i+m*s+g*f,r[5]=v*a+m*l+g*c,r[6]=x*n+b*o+S*u,r[7]=x*i+b*s+S*f,r[8]=x*a+b*l+S*c,r}function R3t(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=t[0],d=t[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r[6]=h*n+d*o+u,r[7]=h*i+d*s+f,r[8]=h*a+d*l+c,r}function N3t(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=Math.sin(t),d=Math.cos(t);return r[0]=d*n+h*o,r[1]=d*i+h*s,r[2]=d*a+h*l,r[3]=d*o-h*n,r[4]=d*s-h*i,r[5]=d*l-h*a,r[6]=u,r[7]=f,r[8]=c,r}function F3t(r,e,t){var n=t[0],i=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=i*e[3],r[4]=i*e[4],r[5]=i*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function B3t(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=e[0],r[7]=e[1],r[8]=1,r}function G3t(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=-t,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function z3t(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=e[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function U3t(r,e){return r[0]=e[0],r[1]=e[1],r[2]=0,r[3]=e[2],r[4]=e[3],r[5]=0,r[6]=e[4],r[7]=e[5],r[8]=1,r}function j3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,l=i+i,u=t*o,f=n*o,c=n*s,h=i*o,d=i*s,p=i*l,v=a*o,m=a*s,g=a*l;return r[0]=1-c-p,r[3]=f-g,r[6]=h+m,r[1]=f+g,r[4]=1-u-p,r[7]=d-v,r[2]=h-m,r[5]=d+v,r[8]=1-u-c,r}function W3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],x=t*s-n*o,b=t*l-i*o,S=t*u-a*o,C=n*l-i*s,w=n*u-a*s,A=i*u-a*l,L=f*v-c*p,k=f*m-h*p,O=f*g-d*p,M=c*m-h*v,I=c*g-d*v,R=h*g-d*m,P=x*R-b*I+S*M+C*O-w*k+A*L;return P?(P=1/P,r[0]=(s*R-l*I+u*M)*P,r[1]=(l*O-o*R-u*k)*P,r[2]=(o*I-s*O+u*L)*P,r[3]=(i*I-n*R-a*M)*P,r[4]=(t*R-i*O+a*k)*P,r[5]=(n*O-t*I-a*L)*P,r[6]=(v*A-m*w+g*C)*P,r[7]=(m*S-p*A-g*b)*P,r[8]=(p*w-v*S+g*x)*P,r):null}function V3t(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function H3t(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function Y3t(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function X3t(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r}function r$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r}function q3t(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r}function K3t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r}function Z3t(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]}function $3t(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],l=r[6],u=r[7],f=r[8],c=e[0],h=e[1],d=e[2],p=e[3],v=e[4],m=e[5],g=e[6],x=e[7],b=e[8];return Math.abs(t-c)<=pn*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(n-h)<=pn*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=pn*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-p)<=pn*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-v)<=pn*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-m)<=pn*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(l-g)<=pn*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-x)<=pn*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(f-b)<=pn*Math.max(1,Math.abs(f),Math.abs(b))}var Q3t=e$,J3t=r$;var _r={};Dn(_r,{add:()=>FGt,adjoint:()=>sGt,clone:()=>eGt,copy:()=>rGt,create:()=>tGt,determinant:()=>lGt,equals:()=>UGt,exactEquals:()=>zGt,frob:()=>NGt,fromQuat:()=>AGt,fromQuat2:()=>_Gt,fromRotation:()=>gGt,fromRotationTranslation:()=>a$,fromRotationTranslationScale:()=>wGt,fromRotationTranslationScaleOrigin:()=>EGt,fromScaling:()=>mGt,fromTranslation:()=>vGt,fromValues:()=>nGt,fromXRotation:()=>yGt,fromYRotation:()=>xGt,fromZRotation:()=>bGt,frustum:()=>MGt,getRotation:()=>CGt,getScaling:()=>o$,getTranslation:()=>SGt,identity:()=>n$,invert:()=>oGt,lookAt:()=>PGt,mul:()=>jGt,multiply:()=>i$,multiplyScalar:()=>BGt,multiplyScalarAndAdd:()=>GGt,ortho:()=>OGt,orthoNO:()=>l$,orthoZO:()=>DGt,perspective:()=>TGt,perspectiveFromFieldOfView:()=>LGt,perspectiveNO:()=>s$,perspectiveZO:()=>IGt,rotate:()=>cGt,rotateX:()=>hGt,rotateY:()=>dGt,rotateZ:()=>pGt,scale:()=>fGt,set:()=>iGt,str:()=>RGt,sub:()=>WGt,subtract:()=>u$,targetTo:()=>kGt,translate:()=>uGt,transpose:()=>aGt});function tGt(){var r=new Ei(16);return Ei!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function eGt(r){var e=new Ei(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function rGt(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function nGt(r,e,t,n,i,a,o,s,l,u,f,c,h,d,p,v){var m=new Ei(16);return m[0]=r,m[1]=e,m[2]=t,m[3]=n,m[4]=i,m[5]=a,m[6]=o,m[7]=s,m[8]=l,m[9]=u,m[10]=f,m[11]=c,m[12]=h,m[13]=d,m[14]=p,m[15]=v,m}function iGt(r,e,t,n,i,a,o,s,l,u,f,c,h,d,p,v,m){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=l,r[8]=u,r[9]=f,r[10]=c,r[11]=h,r[12]=d,r[13]=p,r[14]=v,r[15]=m,r}function n$(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function aGt(r,e){if(r===e){var t=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=a,r[11]=e[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function oGt(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],x=t*s-n*o,b=t*l-i*o,S=t*u-a*o,C=n*l-i*s,w=n*u-a*s,A=i*u-a*l,L=f*v-c*p,k=f*m-h*p,O=f*g-d*p,M=c*m-h*v,I=c*g-d*v,R=h*g-d*m,P=x*R-b*I+S*M+C*O-w*k+A*L;return P?(P=1/P,r[0]=(s*R-l*I+u*M)*P,r[1]=(i*I-n*R-a*M)*P,r[2]=(v*A-m*w+g*C)*P,r[3]=(h*w-c*A-d*C)*P,r[4]=(l*O-o*R-u*k)*P,r[5]=(t*R-i*O+a*k)*P,r[6]=(m*S-p*A-g*b)*P,r[7]=(f*A-h*S+d*b)*P,r[8]=(o*I-s*O+u*L)*P,r[9]=(n*O-t*I-a*L)*P,r[10]=(p*w-v*S+g*x)*P,r[11]=(c*S-f*w-d*x)*P,r[12]=(s*k-o*M-l*L)*P,r[13]=(t*M-n*k+i*L)*P,r[14]=(v*b-p*C-m*x)*P,r[15]=(f*C-c*b+h*x)*P,r):null}function sGt(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15];return r[0]=s*(h*g-d*m)-c*(l*g-u*m)+v*(l*d-u*h),r[1]=-(n*(h*g-d*m)-c*(i*g-a*m)+v*(i*d-a*h)),r[2]=n*(l*g-u*m)-s*(i*g-a*m)+v*(i*u-a*l),r[3]=-(n*(l*d-u*h)-s*(i*d-a*h)+c*(i*u-a*l)),r[4]=-(o*(h*g-d*m)-f*(l*g-u*m)+p*(l*d-u*h)),r[5]=t*(h*g-d*m)-f*(i*g-a*m)+p*(i*d-a*h),r[6]=-(t*(l*g-u*m)-o*(i*g-a*m)+p*(i*u-a*l)),r[7]=t*(l*d-u*h)-o*(i*d-a*h)+f*(i*u-a*l),r[8]=o*(c*g-d*v)-f*(s*g-u*v)+p*(s*d-u*c),r[9]=-(t*(c*g-d*v)-f*(n*g-a*v)+p*(n*d-a*c)),r[10]=t*(s*g-u*v)-o*(n*g-a*v)+p*(n*u-a*s),r[11]=-(t*(s*d-u*c)-o*(n*d-a*c)+f*(n*u-a*s)),r[12]=-(o*(c*m-h*v)-f*(s*m-l*v)+p*(s*h-l*c)),r[13]=t*(c*m-h*v)-f*(n*m-i*v)+p*(n*h-i*c),r[14]=-(t*(s*m-l*v)-o*(n*m-i*v)+p*(n*l-i*s)),r[15]=t*(s*h-l*c)-o*(n*h-i*c)+f*(n*l-i*s),r}function lGt(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],l=r[7],u=r[8],f=r[9],c=r[10],h=r[11],d=r[12],p=r[13],v=r[14],m=r[15],g=e*o-t*a,x=e*s-n*a,b=e*l-i*a,S=t*s-n*o,C=t*l-i*o,w=n*l-i*s,A=u*p-f*d,L=u*v-c*d,k=u*m-h*d,O=f*v-c*p,M=f*m-h*p,I=c*m-h*v;return g*I-x*M+b*O+S*k-C*L+w*A}function i$(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=e[9],d=e[10],p=e[11],v=e[12],m=e[13],g=e[14],x=e[15],b=t[0],S=t[1],C=t[2],w=t[3];return r[0]=b*n+S*s+C*c+w*v,r[1]=b*i+S*l+C*h+w*m,r[2]=b*a+S*u+C*d+w*g,r[3]=b*o+S*f+C*p+w*x,b=t[4],S=t[5],C=t[6],w=t[7],r[4]=b*n+S*s+C*c+w*v,r[5]=b*i+S*l+C*h+w*m,r[6]=b*a+S*u+C*d+w*g,r[7]=b*o+S*f+C*p+w*x,b=t[8],S=t[9],C=t[10],w=t[11],r[8]=b*n+S*s+C*c+w*v,r[9]=b*i+S*l+C*h+w*m,r[10]=b*a+S*u+C*d+w*g,r[11]=b*o+S*f+C*p+w*x,b=t[12],S=t[13],C=t[14],w=t[15],r[12]=b*n+S*s+C*c+w*v,r[13]=b*i+S*l+C*h+w*m,r[14]=b*a+S*u+C*d+w*g,r[15]=b*o+S*f+C*p+w*x,r}function uGt(r,e,t){var n=t[0],i=t[1],a=t[2],o,s,l,u,f,c,h,d,p,v,m,g;return e===r?(r[12]=e[0]*n+e[4]*i+e[8]*a+e[12],r[13]=e[1]*n+e[5]*i+e[9]*a+e[13],r[14]=e[2]*n+e[6]*i+e[10]*a+e[14],r[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],u=e[3],f=e[4],c=e[5],h=e[6],d=e[7],p=e[8],v=e[9],m=e[10],g=e[11],r[0]=o,r[1]=s,r[2]=l,r[3]=u,r[4]=f,r[5]=c,r[6]=h,r[7]=d,r[8]=p,r[9]=v,r[10]=m,r[11]=g,r[12]=o*n+f*i+p*a+e[12],r[13]=s*n+c*i+v*a+e[13],r[14]=l*n+h*i+m*a+e[14],r[15]=u*n+d*i+g*a+e[15]),r}function fGt(r,e,t){var n=t[0],i=t[1],a=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*i,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11]*a,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function cGt(r,e,t,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),l,u,f,c,h,d,p,v,m,g,x,b,S,C,w,A,L,k,O,M,I,R,P,F;return s0?(t[0]=(s*o+f*n+l*a-u*i)*2/c,t[1]=(l*o+f*i+u*n-s*a)*2/c,t[2]=(u*o+f*a+s*i-l*n)*2/c):(t[0]=(s*o+f*n+l*a-u*i)*2,t[1]=(l*o+f*i+u*n-s*a)*2,t[2]=(u*o+f*a+s*i-l*n)*2),a$(r,e,t),r}function SGt(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}function o$(r,e){var t=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],u=e[9],f=e[10];return r[0]=Math.hypot(t,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(l,u,f),r}function CGt(r,e){var t=new Ei(3);o$(t,e);var n=1/t[0],i=1/t[1],a=1/t[2],o=e[0]*n,s=e[1]*i,l=e[2]*a,u=e[4]*n,f=e[5]*i,c=e[6]*a,h=e[8]*n,d=e[9]*i,p=e[10]*a,v=o+f+p,m=0;return v>0?(m=Math.sqrt(v+1)*2,r[3]=.25*m,r[0]=(c-d)/m,r[1]=(h-l)/m,r[2]=(s-u)/m):o>f&&o>p?(m=Math.sqrt(1+o-f-p)*2,r[3]=(c-d)/m,r[0]=.25*m,r[1]=(s+u)/m,r[2]=(h+l)/m):f>p?(m=Math.sqrt(1+f-o-p)*2,r[3]=(h-l)/m,r[0]=(s+u)/m,r[1]=.25*m,r[2]=(c+d)/m):(m=Math.sqrt(1+p-o-f)*2,r[3]=(s-u)/m,r[0]=(h+l)/m,r[1]=(c+d)/m,r[2]=.25*m),r}function wGt(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,f=o+o,c=i*l,h=i*u,d=i*f,p=a*u,v=a*f,m=o*f,g=s*l,x=s*u,b=s*f,S=n[0],C=n[1],w=n[2];return r[0]=(1-(p+m))*S,r[1]=(h+b)*S,r[2]=(d-x)*S,r[3]=0,r[4]=(h-b)*C,r[5]=(1-(c+m))*C,r[6]=(v+g)*C,r[7]=0,r[8]=(d+x)*w,r[9]=(v-g)*w,r[10]=(1-(c+p))*w,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function EGt(r,e,t,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,f=o+o,c=s+s,h=a*u,d=a*f,p=a*c,v=o*f,m=o*c,g=s*c,x=l*u,b=l*f,S=l*c,C=n[0],w=n[1],A=n[2],L=i[0],k=i[1],O=i[2],M=(1-(v+g))*C,I=(d+S)*C,R=(p-b)*C,P=(d-S)*w,F=(1-(h+g))*w,D=(m+x)*w,G=(p+b)*A,U=(m-x)*A,j=(1-(h+v))*A;return r[0]=M,r[1]=I,r[2]=R,r[3]=0,r[4]=P,r[5]=F,r[6]=D,r[7]=0,r[8]=G,r[9]=U,r[10]=j,r[11]=0,r[12]=t[0]+L-(M*L+P*k+G*O),r[13]=t[1]+k-(I*L+F*k+U*O),r[14]=t[2]+O-(R*L+D*k+j*O),r[15]=1,r}function AGt(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,l=i+i,u=t*o,f=n*o,c=n*s,h=i*o,d=i*s,p=i*l,v=a*o,m=a*s,g=a*l;return r[0]=1-c-p,r[1]=f+g,r[2]=h-m,r[3]=0,r[4]=f-g,r[5]=1-u-p,r[6]=d+v,r[7]=0,r[8]=h+m,r[9]=d-v,r[10]=1-u-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function MGt(r,e,t,n,i,a,o){var s=1/(t-e),l=1/(i-n),u=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*l,r[6]=0,r[7]=0,r[8]=(t+e)*s,r[9]=(i+n)*l,r[10]=(o+a)*u,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*u,r[15]=0,r}function s$(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var TGt=s$;function IGt(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function LGt(r,e,t,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=-((o-s)*l*.5),r[9]=(i-a)*u*.5,r[10]=n/(t-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*t/(t-n),r[15]=0,r}function l$(r,e,t,n,i,a,o){var s=1/(e-t),l=1/(n-i),u=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*u,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*l,r[14]=(o+a)*u,r[15]=1,r}var OGt=l$;function DGt(r,e,t,n,i,a,o){var s=1/(e-t),l=1/(n-i),u=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=u,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*l,r[14]=a*u,r[15]=1,r}function PGt(r,e,t,n){var i,a,o,s,l,u,f,c,h,d,p=e[0],v=e[1],m=e[2],g=n[0],x=n[1],b=n[2],S=t[0],C=t[1],w=t[2];return Math.abs(p-S)0&&(d=1/Math.sqrt(d),f*=d,c*=d,h*=d);var p=l*h-u*c,v=u*f-s*h,m=s*c-l*f;return d=p*p+v*v+m*m,d>0&&(d=1/Math.sqrt(d),p*=d,v*=d,m*=d),r[0]=p,r[1]=v,r[2]=m,r[3]=0,r[4]=c*m-h*v,r[5]=h*p-f*m,r[6]=f*v-c*p,r[7]=0,r[8]=f,r[9]=c,r[10]=h,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function RGt(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function NGt(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function FGt(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r}function u$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r}function BGt(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r}function GGt(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r[9]=e[9]+t[9]*n,r[10]=e[10]+t[10]*n,r[11]=e[11]+t[11]*n,r[12]=e[12]+t[12]*n,r[13]=e[13]+t[13]*n,r[14]=e[14]+t[14]*n,r[15]=e[15]+t[15]*n,r}function zGt(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]}function UGt(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],l=r[6],u=r[7],f=r[8],c=r[9],h=r[10],d=r[11],p=r[12],v=r[13],m=r[14],g=r[15],x=e[0],b=e[1],S=e[2],C=e[3],w=e[4],A=e[5],L=e[6],k=e[7],O=e[8],M=e[9],I=e[10],R=e[11],P=e[12],F=e[13],D=e[14],G=e[15];return Math.abs(t-x)<=pn*Math.max(1,Math.abs(t),Math.abs(x))&&Math.abs(n-b)<=pn*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-S)<=pn*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(a-C)<=pn*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(o-w)<=pn*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-A)<=pn*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(l-L)<=pn*Math.max(1,Math.abs(l),Math.abs(L))&&Math.abs(u-k)<=pn*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(f-O)<=pn*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(c-M)<=pn*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(h-I)<=pn*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(d-R)<=pn*Math.max(1,Math.abs(d),Math.abs(R))&&Math.abs(p-P)<=pn*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(v-F)<=pn*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(m-D)<=pn*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(g-G)<=pn*Math.max(1,Math.abs(g),Math.abs(G))}var jGt=i$,WGt=u$;var Nr={};Dn(Nr,{add:()=>u4t,calculateW:()=>Q5t,clone:()=>a4t,conjugate:()=>r4t,copy:()=>s4t,create:()=>O4,dot:()=>I$,equals:()=>v4t,exactEquals:()=>p4t,exp:()=>E$,fromEuler:()=>n4t,fromMat3:()=>M$,fromValues:()=>o4t,getAngle:()=>q5t,getAxisAngle:()=>X5t,identity:()=>Y5t,invert:()=>e4t,len:()=>h4t,length:()=>L$,lerp:()=>c4t,ln:()=>A$,mul:()=>f4t,multiply:()=>w$,normalize:()=>D4,pow:()=>J5t,random:()=>t4t,rotateX:()=>K5t,rotateY:()=>Z5t,rotateZ:()=>$5t,rotationTo:()=>m4t,scale:()=>T$,set:()=>l4t,setAxes:()=>y4t,setAxisAngle:()=>C$,slerp:()=>E2,sqlerp:()=>g4t,sqrLen:()=>d4t,squaredLength:()=>O$,str:()=>i4t});var Ft={};Dn(Ft,{add:()=>XGt,angle:()=>h5t,bezier:()=>a5t,ceil:()=>qGt,clone:()=>VGt,copy:()=>HGt,create:()=>b2,cross:()=>Iw,dist:()=>b5t,distance:()=>p$,div:()=>x5t,divide:()=>d$,dot:()=>S2,equals:()=>m5t,exactEquals:()=>v5t,floor:()=>KGt,forEach:()=>C5t,fromValues:()=>_2,hermite:()=>i5t,inverse:()=>r5t,len:()=>x4,length:()=>f$,lerp:()=>n5t,max:()=>$Gt,min:()=>ZGt,mul:()=>y5t,multiply:()=>h$,negate:()=>e5t,normalize:()=>g4,random:()=>o5t,rotateX:()=>u5t,rotateY:()=>f5t,rotateZ:()=>c5t,round:()=>QGt,scale:()=>JGt,scaleAndAdd:()=>t5t,set:()=>YGt,sqrDist:()=>_5t,sqrLen:()=>S5t,squaredDistance:()=>v$,squaredLength:()=>m$,str:()=>p5t,sub:()=>g5t,subtract:()=>c$,transformMat3:()=>y4,transformMat4:()=>s5t,transformQuat:()=>l5t,zero:()=>d5t});function b2(){var r=new Ei(3);return Ei!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function VGt(r){var e=new Ei(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function f$(r){var e=r[0],t=r[1],n=r[2];return Math.hypot(e,t,n)}function _2(r,e,t){var n=new Ei(3);return n[0]=r,n[1]=e,n[2]=t,n}function HGt(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function YGt(r,e,t,n){return r[0]=e,r[1]=t,r[2]=n,r}function XGt(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function c$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function h$(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}function d$(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r}function qGt(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r}function KGt(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r}function ZGt(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r}function $Gt(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r}function QGt(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r}function JGt(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}function t5t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r}function p$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return Math.hypot(t,n,i)}function v$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return t*t+n*n+i*i}function m$(r){var e=r[0],t=r[1],n=r[2];return e*e+t*t+n*n}function e5t(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r}function r5t(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r}function g4(r,e){var t=e[0],n=e[1],i=e[2],a=t*t+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r}function S2(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Iw(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return r[0]=i*l-a*s,r[1]=a*o-n*l,r[2]=n*s-i*o,r}function n5t(r,e,t,n){var i=e[0],a=e[1],o=e[2];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r}function i5t(r,e,t,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),f=o*(3-2*a);return r[0]=e[0]*s+t[0]*l+n[0]*u+i[0]*f,r[1]=e[1]*s+t[1]*l+n[1]*u+i[1]*f,r[2]=e[2]*s+t[2]*l+n[2]*u+i[2]*f,r}function a5t(r,e,t,n,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,f=3*a*s,c=3*l*o,h=l*a;return r[0]=e[0]*u+t[0]*f+n[0]*c+i[0]*h,r[1]=e[1]*u+t[1]*f+n[1]*c+i[1]*h,r[2]=e[2]*u+t[2]*f+n[2]*c+i[2]*h,r}function o5t(r,e){e=e||1;var t=Tl()*2*Math.PI,n=Tl()*2-1,i=Math.sqrt(1-n*n)*e;return r[0]=Math.cos(t)*i,r[1]=Math.sin(t)*i,r[2]=n*e,r}function s5t(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[3]*n+t[7]*i+t[11]*a+t[15];return o=o||1,r[0]=(t[0]*n+t[4]*i+t[8]*a+t[12])/o,r[1]=(t[1]*n+t[5]*i+t[9]*a+t[13])/o,r[2]=(t[2]*n+t[6]*i+t[10]*a+t[14])/o,r}function y4(r,e,t){var n=e[0],i=e[1],a=e[2];return r[0]=n*t[0]+i*t[3]+a*t[6],r[1]=n*t[1]+i*t[4]+a*t[7],r[2]=n*t[2]+i*t[5]+a*t[8],r}function l5t(r,e,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],f=i*u-a*l,c=a*s-n*u,h=n*l-i*s,d=i*h-a*c,p=a*f-n*h,v=n*c-i*f,m=o*2;return f*=m,c*=m,h*=m,d*=2,p*=2,v*=2,r[0]=s+f+d,r[1]=l+c+p,r[2]=u+h+v,r}function u5t(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function f5t(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function c5t(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function h5t(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2],l=Math.sqrt(t*t+n*n+i*i),u=Math.sqrt(a*a+o*o+s*s),f=l*u,c=f&&S2(r,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function d5t(r){return r[0]=0,r[1]=0,r[2]=0,r}function p5t(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function v5t(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function m5t(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2];return Math.abs(t-a)<=pn*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-o)<=pn*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=pn*Math.max(1,Math.abs(i),Math.abs(s))}var g5t=c$,y5t=h$,x5t=d$,b5t=p$,_5t=v$,x4=f$,S5t=m$,C5t=function(){var r=b2();return function(e,t,n,i,a,o){var s,l;for(t||(t=3),n||(n=0),i?l=Math.min(i*t+n,e.length):l=e.length,s=n;sw4,ceil:()=>w5t,clone:()=>b4,copy:()=>S4,create:()=>g$,cross:()=>D5t,dist:()=>U5t,distance:()=>_$,div:()=>z5t,divide:()=>b$,dot:()=>M4,equals:()=>L4,exactEquals:()=>I4,floor:()=>E5t,forEach:()=>H5t,fromValues:()=>_4,inverse:()=>O5t,len:()=>W5t,length:()=>C2,lerp:()=>T4,max:()=>M5t,min:()=>A5t,mul:()=>G5t,multiply:()=>x$,negate:()=>L5t,normalize:()=>A4,random:()=>P5t,round:()=>T5t,scale:()=>E4,scaleAndAdd:()=>I5t,set:()=>C4,sqrDist:()=>j5t,sqrLen:()=>V5t,squaredDistance:()=>S$,squaredLength:()=>w2,str:()=>F5t,sub:()=>B5t,subtract:()=>y$,transformMat4:()=>k5t,transformQuat:()=>R5t,zero:()=>N5t});function g$(){var r=new Ei(4);return Ei!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function b4(r){var e=new Ei(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function _4(r,e,t,n){var i=new Ei(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function S4(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function C4(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function w4(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function y$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}function x$(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r[3]=e[3]*t[3],r}function b$(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r[3]=e[3]/t[3],r}function w5t(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r[3]=Math.ceil(e[3]),r}function E5t(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r[3]=Math.floor(e[3]),r}function A5t(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r[3]=Math.min(e[3],t[3]),r}function M5t(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r[3]=Math.max(e[3],t[3]),r}function T5t(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r[3]=Math.round(e[3]),r}function E4(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function I5t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r}function _$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return Math.hypot(t,n,i,a)}function S$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return t*t+n*n+i*i+a*a}function C2(r){var e=r[0],t=r[1],n=r[2],i=r[3];return Math.hypot(e,t,n,i)}function w2(r){var e=r[0],t=r[1],n=r[2],i=r[3];return e*e+t*t+n*n+i*i}function L5t(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}function O5t(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r[3]=1/e[3],r}function A4(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function M4(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function D5t(r,e,t,n){var i=t[0]*n[1]-t[1]*n[0],a=t[0]*n[2]-t[2]*n[0],o=t[0]*n[3]-t[3]*n[0],s=t[1]*n[2]-t[2]*n[1],l=t[1]*n[3]-t[3]*n[1],u=t[2]*n[3]-t[3]*n[2],f=e[0],c=e[1],h=e[2],d=e[3];return r[0]=c*u-h*l+d*s,r[1]=-(f*u)+h*o-d*a,r[2]=f*l-c*o+d*i,r[3]=-(f*s)+c*a-h*i,r}function T4(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r[3]=s+n*(t[3]-s),r}function P5t(r,e){e=e||1;var t,n,i,a,o,s;do t=Tl()*2-1,n=Tl()*2-1,o=t*t+n*n;while(o>=1);do i=Tl()*2-1,a=Tl()*2-1,s=i*i+a*a;while(s>=1);var l=Math.sqrt((1-o)/s);return r[0]=e*t,r[1]=e*n,r[2]=e*i*l,r[3]=e*a*l,r}function k5t(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3];return r[0]=t[0]*n+t[4]*i+t[8]*a+t[12]*o,r[1]=t[1]*n+t[5]*i+t[9]*a+t[13]*o,r[2]=t[2]*n+t[6]*i+t[10]*a+t[14]*o,r[3]=t[3]*n+t[7]*i+t[11]*a+t[15]*o,r}function R5t(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2],u=t[3],f=u*n+s*a-l*i,c=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return r[0]=f*u+d*-o+c*-l-h*-s,r[1]=c*u+d*-s+h*-o-f*-l,r[2]=h*u+d*-l+f*-s-c*-o,r[3]=e[3],r}function N5t(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function F5t(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function I4(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function L4(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(t-o)<=pn*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=pn*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-l)<=pn*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=pn*Math.max(1,Math.abs(a),Math.abs(u))}var B5t=y$,G5t=x$,z5t=b$,U5t=_$,j5t=S$,W5t=C2,V5t=w2,H5t=function(){var r=g$();return function(e,t,n,i,a,o){var s,l;for(t||(t=4),n||(n=0),i?l=Math.min(i*t+n,e.length):l=e.length,s=n;spn?(r[0]=e[0]/n,r[1]=e[1]/n,r[2]=e[2]/n):(r[0]=1,r[1]=0,r[2]=0),t}function q5t(r,e){var t=I$(r,e);return Math.acos(2*t*t-1)}function w$(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1],u=t[2],f=t[3];return r[0]=n*f+o*s+i*u-a*l,r[1]=i*f+o*l+a*s-n*u,r[2]=a*f+o*u+n*l-i*s,r[3]=o*f-n*s-i*l-a*u,r}function K5t(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return r[0]=n*l+o*s,r[1]=i*l+a*s,r[2]=a*l-i*s,r[3]=o*l-n*s,r}function Z5t(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return r[0]=n*l-a*s,r[1]=i*l+o*s,r[2]=a*l+n*s,r[3]=o*l-i*s,r}function $5t(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return r[0]=n*l+i*s,r[1]=i*l-n*s,r[2]=a*l+o*s,r[3]=o*l-a*s,r}function Q5t(r,e){var t=e[0],n=e[1],i=e[2];return r[0]=t,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-t*t-n*n-i*i)),r}function E$(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=Math.exp(a),l=o>0?s*Math.sin(o)/o:0;return r[0]=t*l,r[1]=n*l,r[2]=i*l,r[3]=s*Math.cos(o),r}function A$(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=t*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(t*t+n*n+i*i+a*a),r}function J5t(r,e,t){return A$(r,e),T$(r,r,t),E$(r,r),r}function E2(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=t[0],u=t[1],f=t[2],c=t[3],h,d,p,v,m;return d=i*l+a*u+o*f+s*c,d<0&&(d=-d,l=-l,u=-u,f=-f,c=-c),1-d>pn?(h=Math.acos(d),p=Math.sin(h),v=Math.sin((1-n)*h)/p,m=Math.sin(n*h)/p):(v=1-n,m=n),r[0]=v*i+m*l,r[1]=v*a+m*u,r[2]=v*o+m*f,r[3]=v*s+m*c,r}function t4t(r){var e=Tl(),t=Tl(),n=Tl(),i=Math.sqrt(1-e),a=Math.sqrt(e);return r[0]=i*Math.sin(2*Math.PI*t),r[1]=i*Math.cos(2*Math.PI*t),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function e4t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-t*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function r4t(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function M$(r,e){var t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[a*3+a]-e[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(e[a*3+o]-e[o*3+a])*n,r[a]=(e[a*3+i]+e[i*3+a])*n,r[o]=(e[o*3+i]+e[i*3+o])*n}return r}function n4t(r,e,t,n){var i=.5*Math.PI/180;e*=i,t*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(t),l=Math.cos(t),u=Math.sin(n),f=Math.cos(n);return r[0]=a*l*f-o*s*u,r[1]=o*s*f+a*l*u,r[2]=o*l*u-a*s*f,r[3]=o*l*f+a*s*u,r}function i4t(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var a4t=b4,o4t=_4,s4t=S4,l4t=C4,u4t=w4,f4t=w$,T$=E4,I$=M4,c4t=T4,L$=C2,h4t=L$,O$=w2,d4t=O$,D4=A4,p4t=I4,v4t=L4,m4t=function(){var r=b2(),e=_2(1,0,0),t=_2(0,1,0);return function(n,i,a){var o=S2(i,a);return o<-.999999?(Iw(r,e,i),x4(r)<1e-6&&Iw(r,t,i),g4(r,r),C$(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Iw(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,D4(n,n))}}(),g4t=function(){var r=O4(),e=O4();return function(t,n,i,a,o,s){return E2(r,n,o,s),E2(e,i,a,s),E2(t,r,e,2*s*(1-s)),t}}(),y4t=function(){var r=m4();return function(e,t,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-t[0],r[5]=-t[1],r[8]=-t[2],D4(e,M$(e,r))}}();var oe={};Dn(oe,{add:()=>C4t,angle:()=>U4t,ceil:()=>w4t,clone:()=>x4t,copy:()=>_4t,create:()=>D$,cross:()=>P4t,dist:()=>K4t,distance:()=>N$,div:()=>q4t,divide:()=>R$,dot:()=>k4,equals:()=>V4t,exactEquals:()=>R4,floor:()=>E4t,forEach:()=>Q4t,fromValues:()=>b4t,inverse:()=>D4t,len:()=>H4t,length:()=>B$,lerp:()=>k4t,max:()=>M4t,min:()=>A4t,mul:()=>X4t,multiply:()=>k$,negate:()=>O4t,normalize:()=>P4,random:()=>R4t,rotate:()=>z4t,round:()=>T4t,scale:()=>I4t,scaleAndAdd:()=>L4t,set:()=>S4t,sqrDist:()=>Z4t,sqrLen:()=>$4t,squaredDistance:()=>F$,squaredLength:()=>G$,str:()=>W4t,sub:()=>Y4t,subtract:()=>P$,transformMat2:()=>N4t,transformMat2d:()=>F4t,transformMat3:()=>B4t,transformMat4:()=>G4t,zero:()=>j4t});function D$(){var r=new Ei(2);return Ei!=Float32Array&&(r[0]=0,r[1]=0),r}function x4t(r){var e=new Ei(2);return e[0]=r[0],e[1]=r[1],e}function b4t(r,e){var t=new Ei(2);return t[0]=r,t[1]=e,t}function _4t(r,e){return r[0]=e[0],r[1]=e[1],r}function S4t(r,e,t){return r[0]=e,r[1]=t,r}function C4t(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function P$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function k$(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}function R$(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}function w4t(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}function E4t(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}function A4t(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function M4t(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}function T4t(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r}function I4t(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}function L4t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}function N$(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.hypot(t,n)}function F$(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}function B$(r){var e=r[0],t=r[1];return Math.hypot(e,t)}function G$(r){var e=r[0],t=r[1];return e*e+t*t}function O4t(r,e){return r[0]=-e[0],r[1]=-e[1],r}function D4t(r,e){return r[0]=1/e[0],r[1]=1/e[1],r}function P4(r,e){var t=e[0],n=e[1],i=t*t+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r}function k4(r,e){return r[0]*e[0]+r[1]*e[1]}function P4t(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}function k4t(r,e,t,n){var i=e[0],a=e[1];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r}function R4t(r,e){e=e||1;var t=Tl()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}function N4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i,r[1]=t[1]*n+t[3]*i,r}function F4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i+t[4],r[1]=t[1]*n+t[3]*i+t[5],r}function B4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[3]*i+t[6],r[1]=t[1]*n+t[4]*i+t[7],r}function G4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[4]*i+t[12],r[1]=t[1]*n+t[5]*i+t[13],r}function z4t(r,e,t,n){var i=e[0]-t[0],a=e[1]-t[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+t[0],r[1]=i*o+a*s+t[1],r}function U4t(r,e){var t=r[0],n=r[1],i=e[0],a=e[1],o=Math.sqrt(t*t+n*n)*Math.sqrt(i*i+a*a),s=o&&(t*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function j4t(r){return r[0]=0,r[1]=0,r}function W4t(r){return"vec2("+r[0]+", "+r[1]+")"}function R4(r,e){return r[0]===e[0]&&r[1]===e[1]}function V4t(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=pn*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=pn*Math.max(1,Math.abs(n),Math.abs(a))}var H4t=B$,Y4t=P$,X4t=k$,q4t=R$,K4t=N$,Z4t=F$,$4t=G$,Q4t=function(){var r=D$();return function(e,t,n,i,a,o){var s,l;for(t||(t=2),n||(n=0),i?l=Math.min(i*t+n,e.length):l=e.length,s=n;sezt,direction:()=>W$,leftRotate:()=>U$,leftScale:()=>j$,leftTranslate:()=>z$,transform:()=>tzt,vertical:()=>rzt});function z$(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return Ai.fromTranslation(n,t),Ai.multiply(r,n,e)}function U$(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return Ai.fromRotation(n,t),Ai.multiply(r,n,e)}function j$(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return Ai.fromScaling(n,t),Ai.multiply(r,n,e)}function J4t(r,e,t){return Ai.multiply(r,t,e)}function tzt(r,e){for(var t=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=e.length;n=0;return t?i?Math.PI*2-n:n:i?n:Math.PI*2-n}function rzt(r,e,t){return t?(r[0]=e[1],r[1]=-1*e[0]):(r[0]=-1*e[1],r[1]=e[0]),r}function N4(r,e){var t=[],n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],u=r[6],f=r[7],c=r[8],h=e[0],d=e[1],p=e[2],v=e[3],m=e[4],g=e[5],x=e[6],b=e[7],S=e[8];return t[0]=h*n+d*o+p*u,t[1]=h*i+d*s+p*f,t[2]=h*a+d*l+p*c,t[3]=v*n+m*o+g*u,t[4]=v*i+m*s+g*f,t[5]=v*a+m*l+g*c,t[6]=x*n+b*o+S*u,t[7]=x*i+b*s+S*f,t[8]=x*a+b*l+S*c,t}function pu(r,e){var t=[],n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Ny(r){var e=[],t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],l=r[6],u=r[7],f=r[8],c=f*o-s*u,h=-f*a+s*l,d=u*a-o*l,p=t*c+n*h+i*d;return p?(p=1/p,e[0]=c*p,e[1]=(-f*n+i*u)*p,e[2]=(s*n-i*o)*p,e[3]=h*p,e[4]=(f*t-i*l)*p,e[5]=(-s*t+i*a)*p,e[6]=d*p,e[7]=(-u*t+n*l)*p,e[8]=(o*t-n*a)*p,e):null}var Lw=gr.transform,F4="matrix",nzt=["zIndex","capture","visible","type"],izt=["repeat"],azt=":",ozt="*";function szt(r){for(var e=[],t=0;to.delay&&(0,Hn.each)(e.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),r}var czt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.attrs={};var i=n.getDefaultAttrs();return(0,Hn.mix)(i,t.attrs),n.attrs=i,n.initAttrs(i),n.initAnimate(),n}return 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,n=[],i=0;i0?a=fzt(a,S):i.addAnimator(this),a.push(S),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var n=this;t===void 0&&(t=!0);var i=this.get("animations");(0,Hn.each)(i,function(a){t&&(a.onFrame?n.attr(a.onFrame(1)):n.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),n=this.get("animations"),i=t.getTime();return(0,Hn.each)(n,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),n=t.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return(0,Hn.each)(i,function(o){o.startTime=o.startTime+(n-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},e.prototype.emitDelegation=function(t,n){var i=this,a=n.propagationPath,o=this.getEvents(),s;t==="mouseenter"?s=n.fromShape:t==="mouseleave"&&(s=n.toShape);for(var l=function(h){var d=a[h],p=d.get("name");if(p){if((d.isGroup()||d.isCanvas&&d.isCanvas())&&s&&y2(d,s))return"break";(0,Hn.isArray)(p)?(0,Hn.each)(p,function(v){i.emitDelegateEvent(d,v,n)}):u.emitDelegateEvent(d,p,n)}},u=this,f=0;f0)});l.length>0?((0,Gn.each)(l,function(f){var c=f.getBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=(0,eh.min)(o),n=(0,eh.max)(o),i=(0,eh.min)(s),a=(0,eh.max)(s)):(t=0,n=0,i=0,a=0);var u={x:t,y:i,minX:t,minY:i,maxX:n,maxY:a,width:n-t,height:a-i};return u},e.prototype.getCanvasBBox=function(){var t=1/0,n=-1/0,i=1/0,a=-1/0,o=[],s=[],l=this.getChildren().filter(function(f){return f.get("visible")&&(!f.isGroup()||f.isGroup()&&f.getChildren().length>0)});l.length>0?((0,Gn.each)(l,function(f){var c=f.getCanvasBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=(0,eh.min)(o),n=(0,eh.max)(o),i=(0,eh.min)(s),a=(0,eh.max)(s)):(t=0,n=0,i=0,a=0);var u={x:t,y:i,minX:t,minY:i,maxX:n,maxY:a,width:n-t,height:a-i};return u},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,n,i){if(r.prototype.onAttrChange.call(this,t,n,i),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var n=this.getTotalMatrix();r.prototype.applyMatrix.call(this,t);var i=this.getTotalMatrix();i!==n&&this._applyChildrenMarix(i)},e.prototype._applyChildrenMarix=function(t){var n=this.getChildren();(0,Gn.each)(n,function(i){i.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],n=0;n=0;s--){var l=t[s];if(Xv(l)&&(l.isGroup()?o=l.getShape(n,i,a):l.isHit(n,i)&&(o=l)),o)break}return o},e.prototype.add=function(t){var n=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&hzt(o,t,!1),t.set("parent",this),n&&H$(t,n),a&&Y$(t,a),i.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var n=this.getTotalMatrix();n&&t.applyMatrix(n)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t=this.getChildren();(0,Gn.each)(t,function(n,i){return n[B4]=i,n}),t.sort(dzt(function(n,i){return n.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),n=t.length-1;n>=0;n--)t[n].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.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){var n=this.getChildren();return n[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var n=this.getChildren();return n.indexOf(t)>-1},e.prototype.removeChild=function(t,n){n===void 0&&(n=!0),this.contain(t)&&t.remove(n)},e.prototype.findAll=function(t){var n=[],i=this.getChildren();return(0,Gn.each)(i,function(a){t(a)&&n.push(a),a.isGroup()&&(n=n.concat(a.findAll(t)))}),n},e.prototype.find=function(t){var n=null,i=this.getChildren();return(0,Gn.each)(i,function(a){if(t(a)?n=a:a.isGroup()&&(n=a.find(t)),n)return!1}),n},e.prototype.findById=function(t){return this.find(function(n){return n.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(n){return n.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(n){return n.get("name")===t})},e}(A2),M2=pzt;var By=z(q());var yb=0,Ow=0,Dw=0,X$=1e3,T2,Pw,I2=0,Fy=0,L2=0,kw=typeof performance=="object"&&performance.now?performance:Date,q$=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function G4(){return Fy||(q$(vzt),Fy=kw.now()+L2)}function vzt(){Fy=0}function z4(){this._call=this._time=this._next=null}z4.prototype=xb.prototype={constructor:z4,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?G4():+t)+(e==null?0:+e),!this._next&&Pw!==this&&(Pw?Pw._next=this:T2=this,Pw=this),this._call=r,this._time=t,U4()},stop:function(){this._call&&(this._call=null,this._time=1/0,U4())}};function xb(r,e,t){var n=new z4;return n.restart(r,e,t),n}function K$(){G4(),++yb;for(var r=T2,e;r;)(e=Fy-r._time)>=0&&r._call.call(null,e),r=r._next;--yb}function Z$(){Fy=(I2=kw.now())+L2,yb=Ow=0;try{K$()}finally{yb=0,gzt(),Fy=0}}function mzt(){var r=kw.now(),e=r-I2;e>X$&&(L2-=e,I2=r)}function gzt(){for(var r,e=T2,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:T2=t);Pw=r,U4(n)}function U4(r){if(!yb){Ow&&(Ow=clearTimeout(Ow));var e=r-Fy;e>24?(r<1/0&&(Ow=setTimeout(Z$,r-kw.now()-L2)),Dw&&(Dw=clearInterval(Dw))):(Dw||(I2=kw.now(),Dw=setInterval(mzt,X$)),yb=1,q$(Z$))}}var D2={};Dn(D2,{easeBack:()=>$4,easeBackIn:()=>pQ,easeBackInOut:()=>$4,easeBackOut:()=>vQ,easeBounce:()=>bb,easeBounceIn:()=>hQ,easeBounceInOut:()=>dQ,easeBounceOut:()=>bb,easeCircle:()=>q4,easeCircleIn:()=>fQ,easeCircleInOut:()=>q4,easeCircleOut:()=>cQ,easeCubic:()=>W4,easeCubicIn:()=>tQ,easeCubicInOut:()=>W4,easeCubicOut:()=>eQ,easeElastic:()=>tz,easeElasticIn:()=>mQ,easeElasticInOut:()=>gQ,easeElasticOut:()=>tz,easeExp:()=>X4,easeExpIn:()=>lQ,easeExpInOut:()=>X4,easeExpOut:()=>uQ,easeLinear:()=>$$,easePoly:()=>H4,easePolyIn:()=>rQ,easePolyInOut:()=>H4,easePolyOut:()=>nQ,easeQuad:()=>j4,easeQuadIn:()=>Q$,easeQuadInOut:()=>j4,easeQuadOut:()=>J$,easeSin:()=>Y4,easeSinIn:()=>oQ,easeSinInOut:()=>Y4,easeSinOut:()=>sQ});function $$(r){return+r}function Q$(r){return r*r}function J$(r){return r*(2-r)}function j4(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function tQ(r){return r*r*r}function eQ(r){return--r*r*r+1}function W4(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var V4=3,rQ=function r(e){e=+e;function t(n){return Math.pow(n,e)}return t.exponent=r,t}(V4),nQ=function r(e){e=+e;function t(n){return 1-Math.pow(1-n,e)}return t.exponent=r,t}(V4),H4=function r(e){e=+e;function t(n){return((n*=2)<=1?Math.pow(n,e):2-Math.pow(2-n,e))/2}return t.exponent=r,t}(V4);var iQ=Math.PI,aQ=iQ/2;function oQ(r){return+r==1?1:1-Math.cos(r*aQ)}function sQ(r){return Math.sin(r*aQ)}function Y4(r){return(1-Math.cos(iQ*r))/2}function rh(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function lQ(r){return rh(1-+r)}function uQ(r){return 1-rh(r)}function X4(r){return((r*=2)<=1?rh(1-r):2-rh(r-1))/2}function fQ(r){return 1-Math.sqrt(1-r*r)}function cQ(r){return Math.sqrt(1- --r*r)}function q4(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var K4=4/11,yzt=6/11,xzt=8/11,bzt=3/4,_zt=9/11,Szt=10/11,Czt=15/16,wzt=21/22,Ezt=63/64,O2=1/K4/K4;function hQ(r){return 1-bb(1-r)}function bb(r){return(r=+r)>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?R2(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?R2(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Mzt.exec(r))?new vu(e[1],e[2],e[3],1):(e=Tzt.exec(r))?new vu(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Izt.exec(r))?R2(e[1],e[2],e[3],e[4]):(e=Lzt.exec(r))?R2(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ozt.exec(r))?wQ(e[1],e[2]/100,e[3]/100,1):(e=Dzt.exec(r))?wQ(e[1],e[2]/100,e[3]/100,e[4]):yQ.hasOwnProperty(r)?_Q(yQ[r]):r==="transparent"?new vu(NaN,NaN,NaN,0):null}function _Q(r){return new vu(r>>16&255,r>>8&255,r&255,1)}function R2(r,e,t,n){return n<=0&&(r=e=t=NaN),new vu(r,e,t,n)}function kzt(r){return r instanceof Rw||(r=qv(r)),r?(r=r.rgb(),new vu(r.r,r.g,r.b,r.opacity)):new vu}function Cb(r,e,t,n){return arguments.length===1?kzt(r):new vu(r,e,t,n==null?1:n)}function vu(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}P2(vu,Cb,ez(Rw,{brighter:function(r){return r=r==null?k2:Math.pow(k2,r),new vu(this.r*r,this.g*r,this.b*r,this.opacity)},darker:function(r){return r=r==null?Nw:Math.pow(Nw,r),new vu(this.r*r,this.g*r,this.b*r,this.opacity)},rgb:function(){return this},displayable:function(){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:SQ,formatHex:SQ,formatRgb:CQ,toString:CQ}));function SQ(){return"#"+rz(this.r)+rz(this.g)+rz(this.b)}function CQ(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(r===1?")":", "+r+")")}function rz(r){return r=Math.max(0,Math.min(255,Math.round(r)||0)),(r<16?"0":"")+r.toString(16)}function wQ(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ih(r,e,t,n)}function EQ(r){if(r instanceof ih)return new ih(r.h,r.s,r.l,r.opacity);if(r instanceof Rw||(r=qv(r)),!r)return new ih;if(r instanceof ih)return r;r=r.rgb();var e=r.r/255,t=r.g/255,n=r.b/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(t-n)/s+(t0&&l<1?0:o,new ih(o,s,l,r.opacity)}function AQ(r,e,t,n){return arguments.length===1?EQ(r):new ih(r,e,t,n==null?1:n)}function ih(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}P2(ih,AQ,ez(Rw,{brighter:function(r){return r=r==null?k2:Math.pow(k2,r),new ih(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=r==null?Nw:Math.pow(Nw,r),new ih(this.h,this.s,this.l*r,this.opacity)},rgb:function(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,i=2*t-n;return new vu(nz(r>=240?r-240:r+120,i,n),nz(r,i,n),nz(r<120?r+240:r-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(r===1?")":", "+r+")")}}));function nz(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}function iz(r,e,t,n,i){var a=r*r,o=a*r;return((1-3*r+3*a-o)*e+(4-6*a+3*o)*t+(1+3*r+3*a-3*o)*n+o*i)/6}function MQ(r){var e=r.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,e-1):Math.floor(t*e),i=r[n],a=r[n+1],o=n>0?r[n-1]:2*i-a,s=nt&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Gw(n,i)})),t=uz.lastIndex;return tu.length?(l=ky(a[s]),u=ky(i[s]),u=d4(u,l),u=m2(u,l),e.fromAttrs.path=u,e.toAttrs.path=l):e.pathFormatted||(l=ky(a[s]),u=ky(i[s]),u=m2(u,l),e.fromAttrs.path=u,e.toAttrs.path=l,e.pathFormatted=!0),n[s]=[];for(var f=0;f0){for(var s=e.animators.length-1;s>=0;s--){if(n=e.animators[s],n.destroyed){e.removeAnimator(s);continue}if(!n.isAnimatePaused()){i=n.get("animations");for(var l=i.length-1;l>=0;l--)a=i[l],t=zzt(n,a,o),t&&(i.splice(l,1),t=!1,a.callback&&a.callback())}i.length===0&&e.removeAnimator(s)}var u=e.canvas.get("autoDraw");u||e.canvas.draw()}})},r.prototype.addAnimator=function(e){this.animators.push(e)},r.prototype.removeAnimator=function(e){this.animators.splice(e,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),FQ=Uzt;var jzt=40,BQ=0;var GQ=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function zQ(r,e,t){t.name=e,t.target=r,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}function Wzt(r,e,t){if(t.bubbles){var n=void 0,i=!1;if(e==="mouseenter"?(n=t.fromShape,i=!0):e==="mouseleave"&&(i=!0,n=t.toShape),r.isCanvas()&&i)return;if(n&&y2(r,n)){t.bubbles=!1;return}t.name=e,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}}var Vzt=function(){function r(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(n){var i=n.type;t._triggerEvent(i,n)},this._onDocumentMove=function(n){var i=t.canvas,a=i.get("el");if(a!==n.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(n);t.dragging&&t._emitEvent("drag",n,o,t.draggingShape)}},this._onDocumentMouseUp=function(n){var i=t.canvas,a=i.get("el");if(a!==n.target&&t.dragging){var o=t._getPointInfo(n);t.draggingShape&&t._emitEvent("drop",n,o,null),t._emitEvent("dragend",n,o,t.draggingShape),t._afterDrag(t.draggingShape,o,n)}},this.canvas=e.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");(0,Gn.each)(GQ,function(n){t.addEventListener(n,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");(0,Gn.each)(GQ,function(n){t.removeEventListener(n,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(e,t,n,i,a,o){var s=new Yu(e,t);return s.fromShape=a,s.toShape=o,s.x=n.x,s.y=n.y,s.clientX=n.clientX,s.clientY=n.clientY,s.propagationPath.push(i),s},r.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},r.prototype._getPointInfo=function(e){var t=this.canvas,n=t.getClientByEvent(e),i=t.getPointByEvent(e);return{x:i.x,y:i.y,clientX:n.x,clientY:n.y}},r.prototype._triggerEvent=function(e,t){var n=this._getPointInfo(t),i=this._getShape(n,t),a=this["_on"+e],o=!1;if(a)a.call(this,n,i,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,n,null,null,i),i&&this._emitEvent(e,t,n,i,null,i),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,n,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,n,s,s,null),this._emitEvent(e,t,n,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,n,null)):this._emitEvent(e,t,n,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var l=this.canvas,u=l.get("el");u.style.cursor=i.attr("cursor")||l.get("cursor")}},r.prototype._onmousedown=function(e,t,n){n.button===BQ&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,e,t,null,null)},r.prototype._emitMouseoverEvents=function(e,t,n,i){var a=this.canvas.get("el");n!==i&&(n&&(this._emitEvent("mouseout",e,t,n,n,i),this._emitEvent("mouseleave",e,t,n,n,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",e,t,i,n,i),this._emitEvent("mouseenter",e,t,i,n,i)))},r.prototype._emitDragoverEvents=function(e,t,n,i,a){i?(i!==n&&(n&&this._emitEvent("dragleave",e,t,n,n,i),this._emitEvent("dragenter",e,t,i,n,i)),a||this._emitEvent("dragover",e,t,i)):n&&this._emitEvent("dragleave",e,t,n,n,i),a&&this._emitEvent("dragover",e,t,i)},r.prototype._afterDrag=function(e,t,n){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(t,n);i!==e&&this._emitMouseoverEvents(n,t,e,i),this.currentShape=i},r.prototype._onmouseup=function(e,t,n){if(n.button===BQ){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",n,e,t),this._emitEvent("dragend",n,e,i),this._afterDrag(i,e,n)):(this._emitEvent("mouseup",n,e,t),t===this.mousedownShape&&this._emitEvent("click",n,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(e,t,n){n.preventDefault();var i=this.currentShape;this._emitDragoverEvents(n,e,i,t,!0)},r.prototype._onmousemove=function(e,t,n){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,e,a,t,!1),this._emitEvent("drag",n,e,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,u=n.timeStamp,f=u-this.mousedownTimeStamp,c=s.clientX-e.clientX,h=s.clientY-e.clientY,d=c*c+h*h;f>120||d>jzt?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,e,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t)):(this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t))}else this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t)}},r.prototype._emitEvent=function(e,t,n,i,a,o){var s=this._getEventObj(e,t,n,i,a,o);if(i){s.shape=i,zQ(i,e,s);for(var l=i.getParent();l;)l.emitDelegation(e,s),s.propagationStopped||Wzt(l,e,s),s.propagationPath.push(l),l=l.getParent()}else{var u=this.canvas;zQ(u,e,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),UQ=Vzt;var jQ="px",WQ=x2(),Hzt=WQ&&WQ.name==="firefox",Yzt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");(0,Gn.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var n=this.get("container");n.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new UQ({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new FQ(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,n){var i=this.get("el");v4&&(i.style.width=t+jQ,i.style.height=n+jQ)},e.prototype.changeSize=function(t,n){this.setDOMSize(t,n),this.set("width",t),this.set("height",n),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 n=this.get("el");v4&&n&&(n.style.cursor=t)},e.prototype.getPointByEvent=function(t){var n=this.get("supportCSSTransform");if(n){if(Hzt&&!(0,Gn.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,Gn.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var i=this.getClientByEvent(t),a=i.x,o=i.y;return this.getPointByClient(a,o)},e.prototype.getClientByEvent=function(t){var n=t;return t.touches&&(t.type==="touchend"?n=t.changedTouches[0]:n=t.touches[0]),{x:n.clientX,y:n.clientY}},e.prototype.getPointByClient=function(t,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t-a.left,y:n-a.top}},e.prototype.getClientByPoint=function(t,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t+a.left,y:n+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},e}(M2),Gy=Yzt;var Xzt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=r.prototype.clone.call(this),n=this.getChildren(),i=0;i=t&&i.minY<=n&&i.maxY>=n},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t),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(t){r.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),n=this.getTotalMatrix(),i=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(n){var l=pu(n,[t.minX,t.minY]),u=pu(n,[t.maxX,t.minY]),f=pu(n,[t.minX,t.maxY]),c=pu(n,[t.maxX,t.maxY]);i=Math.min(l[0],u[0],f[0],c[0]),o=Math.max(l[0],u[0],f[0],c[0]),a=Math.min(l[1],u[1],f[1],c[1]),s=Math.max(l[1],u[1],f[1],c[1])}var h=this.attrs;if(h.shadowColor){var d=h.shadowBlur,p=d===void 0?0:d,v=h.shadowOffsetX,m=v===void 0?0:v,g=h.shadowOffsetY,x=g===void 0?0:g,b=i-p+m,S=o+p+m,C=a-p+x,w=s+p+x;i=Math.min(i,b),o=Math.max(o,S),a=Math.min(a,C),s=Math.max(s,w)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},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,n){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,n){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,n,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],u=this._isInBBox(s,l);return this.isOnlyHitBox()?u:!!(u&&!this.isClipped(s,l)&&(this.isInShape(s,l)||i&&i.isHit(s,l)||a&&a.isHit(s,l)))},e}(A2),$v=qzt;var VQ=new Map;function Kf(r,e){VQ.set(r,e)}function Qv(r){return VQ.get(r)}function fz(r){var e=r.attr(),t=e.x,n=e.y,i=e.width,a=e.height;return{x:t,y:n,width:i,height:a}}function cz(r){var e=r.attr(),t=e.x,n=e.y,i=e.r;return{x:t-i,y:n-i,width:i*2,height:i*2}}var wb={};Dn(wb,{distance:()=>ba,getBBoxByArray:()=>ep,getBBoxRange:()=>Kzt,isNumberEqual:()=>zy,piMod:()=>rp});function G2(r){return Math.min.apply(null,r)}function z2(r){return Math.max.apply(null,r)}function ba(r,e,t,n){var i=r-t,a=e-n;return Math.sqrt(i*i+a*a)}function zy(r,e){return Math.abs(r-e)<.001}function ep(r,e){var t=G2(r),n=G2(e),i=z2(r),a=z2(e);return{x:t,y:n,width:i-t,height:a-n}}function Kzt(r,e,t,n){return{minX:G2([r,t]),maxX:z2([r,t]),minY:G2([e,n]),maxY:z2([e,n])}}function rp(r){return(r+Math.PI*2)%(Math.PI*2)}var Vi={box:function(r,e,t,n){return ep([r,t],[e,n])},length:function(r,e,t,n){return ba(r,e,t,n)},pointAt:function(r,e,t,n,i){return{x:(1-i)*r+i*t,y:(1-i)*e+i*n}},pointDistance:function(r,e,t,n,i,a){var o=(t-r)*(i-r)+(n-e)*(a-e);if(o<0)return ba(r,e,i,a);var s=(t-r)*(t-r)+(n-e)*(n-e);return o>s?ba(t,n,i,a):this.pointToLine(r,e,t,n,i,a)},pointToLine:function(r,e,t,n,i,a){var o=[t-r,n-e];if(R4(o,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-e)*(a-e));var s=[-o[1],o[0]];P4(s,s);var l=[i-r,a-e];return Math.abs(k4(l,s))},tangentAngle:function(r,e,t,n){return Math.atan2(n-e,t-r)}};var Zzt=1e-4;function U2(r,e,t,n,i,a){var o,s=1/0,l=[t,n],u=20;a&&a>200&&(u=a/10);for(var f=1/u,c=f/10,h=0;h<=u;h++){var d=h*f,p=[i.apply(null,r.concat([d])),i.apply(null,e.concat([d]))],v=ba(l[0],l[1],p[0],p[1]);v=0&&v=0?[i]:[]}function XQ(r,e,t,n){return 2*(1-n)*(e-r)+2*n*(t-e)}function qQ(r,e,t,n,i,a,o){var s=Jv(r,t,i,o),l=Jv(e,n,a,o),u=Vi.pointAt(r,e,t,n,o),f=Vi.pointAt(t,n,i,a,o);return[[r,e,u.x,u.y,s,l],[s,l,f.x,f.y,i,a]]}function hz(r,e,t,n,i,a,o){if(o===0)return(ba(r,e,t,n)+ba(t,n,i,a)+ba(r,e,i,a))/2;var s=qQ(r,e,t,n,i,a,.5),l=s[0],u=s[1];return l.push(o-1),u.push(o-1),hz.apply(null,l)+hz.apply(null,u)}var zw={box:function(r,e,t,n,i,a){var o=YQ(r,t,i)[0],s=YQ(e,n,a)[0],l=[r,i],u=[e,a];return o!==void 0&&l.push(Jv(r,t,i,o)),s!==void 0&&u.push(Jv(e,n,a,s)),ep(l,u)},length:function(r,e,t,n,i,a){return hz(r,e,t,n,i,a,3)},nearestPoint:function(r,e,t,n,i,a,o,s){return U2([r,t,i],[e,n,a],o,s,Jv)},pointDistance:function(r,e,t,n,i,a,o,s){var l=this.nearestPoint(r,e,t,n,i,a,o,s);return ba(l.x,l.y,o,s)},interpolationAt:Jv,pointAt:function(r,e,t,n,i,a,o){return{x:Jv(r,t,i,o),y:Jv(e,n,a,o)}},divide:function(r,e,t,n,i,a,o){return qQ(r,e,t,n,i,a,o)},tangentAngle:function(r,e,t,n,i,a,o){var s=XQ(r,t,i,o),l=XQ(e,n,a,o),u=Math.atan2(l,s);return rp(u)}};function tm(r,e,t,n,i){var a=1-i;return a*a*a*r+3*e*i*a*a+3*t*i*i*a+n*i*i*i}function KQ(r,e,t,n,i){var a=1-i;return 3*(a*a*(e-r)+2*a*i*(t-e)+i*i*(n-t))}function dz(r,e,t,n){var i=-3*r+9*e-9*t+3*n,a=6*r-12*e+6*t,o=3*e-3*r,s=[],l,u,f;if(zy(i,0))zy(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var c=a*a-4*i*o;zy(c,0)?s.push(-a/(2*i)):c>0&&(f=Math.sqrt(c),l=(-a+f)/(2*i),u=(-a-f)/(2*i),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function ZQ(r,e,t,n,i,a,o,s,l){var u=tm(r,t,i,o,l),f=tm(e,n,a,s,l),c=Vi.pointAt(r,e,t,n,l),h=Vi.pointAt(t,n,i,a,l),d=Vi.pointAt(i,a,o,s,l),p=Vi.pointAt(c.x,c.y,h.x,h.y,l),v=Vi.pointAt(h.x,h.y,d.x,d.y,l);return[[r,e,c.x,c.y,p.x,p.y,u,f],[u,f,v.x,v.y,d.x,d.y,o,s]]}function pz(r,e,t,n,i,a,o,s,l){if(l===0)return HQ([r,t,i,o],[e,n,a,s]);var u=ZQ(r,e,t,n,i,a,o,s,.5),f=u[0],c=u[1];return f.push(l-1),c.push(l-1),pz.apply(null,f)+pz.apply(null,c)}var np={extrema:dz,box:function(r,e,t,n,i,a,o,s){for(var l=[r,o],u=[e,s],f=dz(r,t,i,o),c=dz(e,n,a,s),h=0;h0?t:t*-1}var QQ={box:function(r,e,t,n){return{x:r-t,y:e-n,width:t*2,height:n*2}},length:function(r,e,t,n){return Math.PI*(3*(t+n)-Math.sqrt((3*t+n)*(t+3*n)))},nearestPoint:function(r,e,t,n,i,a){var o=t,s=n;if(o===0||s===0)return{x:r,y:e};for(var l=i-r,u=a-e,f=Math.abs(l),c=Math.abs(u),h=o*o,d=s*s,p=Math.PI/4,v,m,g=0;g<4;g++){v=o*Math.cos(p),m=s*Math.sin(p);var x=(h-d)*Math.pow(Math.cos(p),3)/o,b=(d-h)*Math.pow(Math.sin(p),3)/s,S=v-x,C=m-b,w=f-x,A=c-b,L=Math.hypot(C,S),k=Math.hypot(A,w),O=L*Math.asin((S*A-C*w)/(L*k)),M=O/Math.sqrt(h+d-v*v-m*m);p+=M,p=Math.min(Math.PI/2,Math.max(0,p))}return{x:r+$Q(v,l),y:e+$Q(m,u)}},pointDistance:function(r,e,t,n,i,a){var o=this.nearestPoint(r,e,t,n,i,a);return ba(o.x,o.y,i,a)},pointAt:function(r,e,t,n,i){var a=2*Math.PI*i;return{x:r+t*Math.cos(a),y:e+n*Math.sin(a)}},tangentAngle:function(r,e,t,n,i){var a=2*Math.PI*i,o=Math.atan2(n*Math.cos(a),-t*Math.sin(a));return rp(o)}};function $zt(r,e,t,n,i,a,o,s){return-1*t*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}function Qzt(r,e,t,n,i,a,o,s){return-1*t*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}function Jzt(r,e,t){return Math.atan(-e/r*Math.tan(t))}function tUt(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function JQ(r,e,t,n,i,a){return t*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function tJ(r,e,t,n,i,a){return t*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+e}function eUt(r,e,t,n){var i=Math.atan2(n*r,t*e);return(i+Math.PI*2)%(Math.PI*2)}function eJ(r,e,t){return{x:r*Math.cos(t),y:e*Math.sin(t)}}function rJ(r,e,t){var n=Math.cos(t),i=Math.sin(t);return[r*n-e*i,r*i+e*n]}var vz={box:function(r,e,t,n,i,a,o){for(var s=Jzt(t,n,i),l=1/0,u=-1/0,f=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var h=s+c;au&&(u=d)}for(var p=tUt(t,n,i),v=1/0,m=-1/0,g=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var x=p+c;am&&(m=b)}return{x:l,y:v,width:u-l,height:m-v}},length:function(r,e,t,n,i,a,o){},nearestPoint:function(r,e,t,n,i,a,o,s,l){var u=rJ(s-r,l-e,-i),f=u[0],c=u[1],h=QQ.nearestPoint(0,0,t,n,f,c),d=eUt(t,n,h.x,h.y);do&&(h=eJ(t,n,o));var p=rJ(h.x,h.y,i);return{x:p[0]+r,y:p[1]+e}},pointDistance:function(r,e,t,n,i,a,o,s,l){var u=this.nearestPoint(r,e,t,n,s,l);return ba(u.x,u.y,s,l)},pointAt:function(r,e,t,n,i,a,o,s){var l=(o-a)*s+a;return{x:JQ(r,e,t,n,i,l),y:tJ(r,e,t,n,i,l)}},tangentAngle:function(r,e,t,n,i,a,o,s){var l=(o-a)*s+a,u=$zt(r,e,t,n,i,a,o,l),f=Qzt(r,e,t,n,i,a,o,l);return rp(Math.atan2(f,u))}};function nJ(r){for(var e=0,t=[],n=0;n1||e<0||r.length<2)return null;var t=nJ(r),n=t.segments,i=t.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s=a&&e<=a+c){var h=(e-a)/c;o=Vi.pointAt(u[0],u[1],f[0],f[1],h);break}a+=c}return o}function yz(r,e){if(e>1||e<0||r.length<2)return 0;for(var t=nJ(r),n=t.segments,i=t.totalLength,a=0,o=0,s=0;s=a&&e<=a+c){o=Math.atan2(f[1]-u[1],f[0]-u[0]);break}a+=c}return o}function xz(r,e,t){for(var n=1/0,i=0;i1){var i=rUt(e,t);return e*n+i*(n-1)}return e}function rUt(r,e){return e?e-r:r*.14}function sJ(r,e){var t=Uy(),n=0;if((0,Gn.isNil)(r)||r==="")return n;if(t.save(),t.font=e,(0,Gn.isString)(r)&&r.includes(` `)){var i=r.split(` `);(0,Gn.each)(i,function(a){var o=t.measureText(a).width;n1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}(0,Vy.each)(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[n]=t}),e}var _z=aUt;function sUt(r,e,t,n){var i=[],a=!!n,o,s,l,u,f,c,h;if(a){l=n[0],u=n[1];for(var d=0,p=r.length;d2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var hUt=/[a-z]/;function fJ(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function Yy(r){var e=Zf(r);if(!e||!e.length)return[["M",0,0]];for(var t=!1,n=0;n=0){t=!0;break}}if(!t)return e;var a=[],o=0,s=0,l=0,u=0,f=0,c,h,d=e[0];(d[0]==="M"||d[0]==="m")&&(o=+d[1],s=+d[2],l=o,u=s,f++,a[0]=["M",o,s]);for(var n=f,p=e.length;n1&&(t*=Math.sqrt(d),n*=Math.sqrt(d));var p=t*t*(h*h)+n*n*(c*c),v=p?Math.sqrt((t*t*(n*n)-p)/p):1;a===o&&(v*=-1),isNaN(v)&&(v=0);var m=n?v*t*h/n:0,g=t?v*-n*c/t:0,x=(s+u)/2+Math.cos(i)*m-Math.sin(i)*g,b=(l+f)/2+Math.sin(i)*m+Math.cos(i)*g,S=[(c-m)/t,(h-g)/n],C=[(-1*c-m)/t,(-1*h-g)/n],w=cJ([1,0],S),A=cJ(S,C);return Sz(S,C)<=-1&&(A=Math.PI),Sz(S,C)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:b,rx:V2(r,[u,f])?0:t,ry:V2(r,[u,f])?0:n,startAngle:w,endAngle:w+A,xRotation:i,arcFlag:a,sweepFlag:o}}function hJ(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function Mb(r){r=_z(r);for(var e=[],t=null,n=null,i=null,a=0,o=r.length,s=0;s=e&&r<=t};function Y2(r,e,t,n){var i=.001,a={x:t.x-r.x,y:t.y-r.y},o={x:e.x-r.x,y:e.y-r.y},s={x:n.x-t.x,y:n.y-t.y},l=o.x*s.y-o.y*s.x,u=l*l,f=o.x*o.x+o.y*o.y,c=s.x*s.x+s.y*s.y,h=null;if(u>i*f*c){var d=(a.x*s.y-a.y*s.x)/l,p=(a.x*o.y-a.y*o.x)/l;dJ(d,0,1)&&dJ(p,0,1)&&(h={x:r.x+d*o.x,y:r.y+d*o.y})}return h}var mUt=1e-6;function Cz(r){return Math.abs(r)0!=Cz(s[1]-t)>0&&Cz(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(n=!n)}return n}var Ww=z(q());function pJ(r){for(var e=[],t=r.length,n=0;n1){var o=r[0],s=r[t-1];e.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return e}function yUt(r,e){var t=!1;return(0,Ww.each)(r,function(n){if(Y2(n.from,n.to,e.from,e.to))return t=!0,!1}),t}function vJ(r){var e=r.map(function(n){return n[0]}),t=r.map(function(n){return n[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function xUt(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxYMath.PI/2?Math.PI-u:u,f=f>Math.PI/2?Math.PI-f:f;var c={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(f-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return c}function mJ(r){var e=r.attr(),t=e.path,n=e.stroke,i=n?e.lineWidth:0,a=r.get("segments")||Mb(t),o=bUt(a,i),s=o.x,l=o.y,u=o.width,f=o.height,c={minX:s,minY:l,maxX:s+u,maxY:l+f};return c=Ab(r,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function gJ(r){var e=r.attr(),t=e.x1,n=e.y1,i=e.x2,a=e.y2,o=Math.min(t,i),s=Math.max(t,i),l=Math.min(n,a),u=Math.max(n,a),f={minX:o,maxX:s,minY:l,maxY:u};return f=Ab(r,f),{x:f.minX,y:f.minY,width:f.maxX-f.minX,height:f.maxY-f.minY}}function yJ(r){var e=r.attr(),t=e.x,n=e.y,i=e.rx,a=e.ry;return{x:t-i,y:n-a,width:i*2,height:a*2}}Kf("rect",fz);Kf("image",fz);Kf("circle",cz);Kf("marker",cz);Kf("polyline",aJ);Kf("polygon",oJ);Kf("text",lJ);Kf("path",mJ);Kf("line",gJ);Kf("ellipse",yJ);var rm=z(q());var wz=0,xJ=1/2,bJ=1/2,_J=.05;var _Ut=function(){function r(e){var t=e.xField,n=e.yField,i=e.adjustNames,a=i===void 0?["x","y"]:i;this.adjustNames=a,this.xField=t,this.yField=n}return r.prototype.isAdjust=function(e){return this.adjustNames.indexOf(e)>=0},r.prototype.getAdjustRange=function(e,t,n){var i=this.yField,a=n.indexOf(t),o=n.length,s,l;return!i&&this.isAdjust("y")?(s=0,l=1):o>1?(s=n[a===0?0:a-1],l=n[a===o-1?o-1:a+1],a!==0?s+=(t-s)/2:s-=(l-t)/2,a!==o-1?l-=(l-t)/2:l+=(t-n[o-2])/2):(s=t===0?0:t-.5,l=t===0?1:t+.5),{pre:s,next:l}},r.prototype.adjustData=function(e,t){var n=this,i=this.getDimValues(t);rm.each(e,function(a,o){rm.each(i,function(s,l){n.adjustDim(l,s,a,o)})})},r.prototype.groupData=function(e,t){return rm.each(e,function(n){n[t]===void 0&&(n[t]=wz)}),rm.groupBy(e,t)},r.prototype.adjustDim=function(e,t,n,i){},r.prototype.getDimValues=function(e){var t=this,n=t.xField,i=t.yField,a={},o=[];if(n&&this.isAdjust("x")&&o.push(n),i&&this.isAdjust("y")&&o.push(i),o.forEach(function(l){a[l]=rm.valuesOfKey(e,l).sort(function(u,f){return u-f})}),!i&&this.isAdjust("y")){var s="y";a[s]=[wz,1]}return a},r}(),$f=_Ut;var SJ={},Vw=function(r){return SJ[r.toLowerCase()]},Tb=function(r,e){if(Vw(r))throw new Error("Adjust type '"+r+"' existed.");SJ[r.toLowerCase()]=e};var VJ=z(WJ()),{__extends:nm,__assign:ah,__rest:SCe,__decorate:CCe,__param:wCe,__metadata:ECe,__awaiter:ACe,__generator:MCe,__exportStar:TCe,__createBinding:ICe,__values:LCe,__read:OCe,__spread:DCe,__spreadArrays:PCe,__await:kCe,__asyncGenerator:RCe,__asyncDelegator:NCe,__asyncValues:FCe,__makeTemplateObject:BCe,__importStar:GCe,__importDefault:zCe,__classPrivateFieldGet:UCe,__classPrivateFieldSet:jCe}=VJ.default;var fa=z(q());var SUt=function(r){nm(e,r);function e(t){var n=r.call(this,t)||this;n.cacheMap={},n.adjustDataArray=[],n.mergeData=[];var i=t.marginRatio,a=i===void 0?xJ:i,o=t.dodgeRatio,s=o===void 0?bJ:o,l=t.dodgeBy,u=t.intervalPadding,f=t.dodgePadding,c=t.xDimensionLength,h=t.groupNum,d=t.defaultSize,p=t.maxColumnWidth,v=t.minColumnWidth,m=t.columnWidthRatio;return n.marginRatio=a,n.dodgeRatio=s,n.dodgeBy=l,n.intervalPadding=u,n.dodgePadding=f,n.xDimensionLegenth=c,n.groupNum=h,n.defaultSize=d,n.maxColumnWidth=p,n.minColumnWidth=v,n.columnWidthRatio=m,n}return e.prototype.process=function(t){var n=fa.clone(t),i=fa.flatten(n),a=this.dodgeBy,o=a?fa.group(i,a):n;return this.cacheMap={},this.adjustDataArray=o,this.mergeData=i,this.adjustData(o,i),this.adjustDataArray=[],this.mergeData=[],n},e.prototype.adjustDim=function(t,n,i,a){var o=this,s=this.getDistribution(t),l=this.groupData(i,t);return fa.each(l,function(u,f){var c;n.length===1?c={pre:n[0]-1,next:n[0]+1}:c=o.getAdjustRange(t,parseFloat(f),n),fa.each(u,function(h){var d=h[t],p=s[d],v=p.indexOf(a);h[t]=o.getDodgeOffset(c,v,p.length)})}),[]},e.prototype.getDodgeOffset=function(t,n,i){var a=this,o=a.dodgeRatio,s=a.marginRatio,l=a.intervalPadding,u=a.dodgePadding,f=t.pre,c=t.next,h=c-f,d;if(!fa.isNil(l)&&fa.isNil(u)&&l>=0){var p=this.getIntervalOnlyOffset(i,n);d=f+p}else if(!fa.isNil(u)&&fa.isNil(l)&&u>=0){var p=this.getDodgeOnlyOffset(i,n);d=f+p}else if(!fa.isNil(l)&&!fa.isNil(u)&&l>=0&&u>=0){var p=this.getIntervalAndDodgeOffset(i,n);d=f+p}else{var v=h*o/i,m=s*v,p=1/2*(h-i*v-(i-1)*m)+((n+1)*v+n*m)-1/2*v-1/2*h;d=(f+c)/2+p}return d},e.prototype.getIntervalOnlyOffset=function(t,n){var i=this,a=i.defaultSize,o=i.intervalPadding,s=i.xDimensionLegenth,l=i.groupNum,u=i.dodgeRatio,f=i.maxColumnWidth,c=i.minColumnWidth,h=i.columnWidthRatio,d=o/s,p=(1-(l-1)*d)/l*u/(t-1),v=((1-d*(l-1))/l-p*(t-1))/t;if(v=fa.isNil(h)?v:1/l/t*h,!fa.isNil(f)){var m=f/s;v=Math.min(v,m)}if(!fa.isNil(c)){var g=c/s;v=Math.max(v,g)}v=a?a/s:v,p=((1-(l-1)*d)/l-t*v)/(t-1);var x=((1/2+n)*v+n*p+1/2*d)*l-d/2;return x},e.prototype.getDodgeOnlyOffset=function(t,n){var i=this,a=i.defaultSize,o=i.dodgePadding,s=i.xDimensionLegenth,l=i.groupNum,u=i.marginRatio,f=i.maxColumnWidth,c=i.minColumnWidth,h=i.columnWidthRatio,d=o/s,p=1*u/(l-1),v=((1-p*(l-1))/l-d*(t-1))/t;if(v=h?1/l/t*h:v,!fa.isNil(f)){var m=f/s;v=Math.min(v,m)}if(!fa.isNil(c)){var g=c/s;v=Math.max(v,g)}v=a?a/s:v,p=(1-(v*t+d*(t-1))*l)/(l-1);var x=((1/2+n)*v+n*d+1/2*p)*l-p/2;return x},e.prototype.getIntervalAndDodgeOffset=function(t,n){var i=this,a=i.intervalPadding,o=i.dodgePadding,s=i.xDimensionLegenth,l=i.groupNum,u=a/s,f=o/s,c=((1-u*(l-1))/l-f*(t-1))/t,h=((1/2+n)*c+n*f+1/2*u)*l-u/2;return h},e.prototype.getDistribution=function(t){var n=this.adjustDataArray,i=this.cacheMap,a=i[t];return a||(a={},fa.each(n,function(o,s){var l=fa.valuesOfKey(o,t);l.length||l.push(0),fa.each(l,function(u){a[u]||(a[u]=[]),a[u].push(s)})}),i[t]=a),a},e}($f),HJ=SUt;var Xy=z(q());function CUt(r,e){return(e-r)*Math.random()+r}var wUt=function(r){nm(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var n=Xy.clone(t),i=Xy.flatten(n);return this.adjustData(n,i),n},e.prototype.adjustDim=function(t,n,i){var a=this,o=this.groupData(i,t);return Xy.each(o,function(s,l){return a.adjustGroup(s,t,parseFloat(l),n)})},e.prototype.getAdjustOffset=function(t){var n=t.pre,i=t.next,a=(i-n)*_J;return CUt(n+a,i-a)},e.prototype.adjustGroup=function(t,n,i,a){var o=this,s=this.getAdjustRange(n,i,a);return Xy.each(t,function(l){l[n]=o.getAdjustOffset(s)}),t},e}($f),YJ=wUt;var ip=z(q());var Az=ip.Cache,EUt=function(r){nm(e,r);function e(t){var n=r.call(this,t)||this,i=t.adjustNames,a=i===void 0?["y"]:i,o=t.height,s=o===void 0?NaN:o,l=t.size,u=l===void 0?10:l,f=t.reverseOrder,c=f===void 0?!1:f;return n.adjustNames=a,n.height=s,n.size=u,n.reverseOrder=c,n}return e.prototype.process=function(t){var n=this,i=n.yField,a=n.reverseOrder,o=i?this.processStack(t):this.processOneDimStack(t);return a?this.reverse(o):o},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var n=this,i=n.xField,a=n.yField,o=n.reverseOrder,s=o?this.reverse(t):t,l=new Az,u=new Az;return s.map(function(f){return f.map(function(c){var h,d=ip.get(c,i,0),p=ip.get(c,[a]),v=d.toString();if(p=ip.isArray(p)?p[1]:p,!ip.isNil(p)){var m=p>=0?l:u;m.has(v)||m.set(v,0);var g=m.get(v),x=p+g;return m.set(v,x),ah(ah({},c),(h={},h[a]=[g,x],h))}return c})})},e.prototype.processOneDimStack=function(t){var n=this,i=this,a=i.xField,o=i.height,s=i.reverseOrder,l="y",u=s?this.reverse(t):t,f=new Az;return u.map(function(c){return c.map(function(h){var d,p=n.size,v=h[a],m=p*2/o;f.has(v)||f.set(v,m/2);var g=f.get(v);return f.set(v,g+m),ah(ah({},h),(d={},d[l]=g,d))})})},e}($f),XJ=EUt;var Es=z(q());var AUt=function(r){nm(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var n=Es.flatten(t),i=this,a=i.xField,o=i.yField,s=this.getXValuesMaxMap(n),l=Math.max.apply(Math,Object.keys(s).map(function(u){return s[u]}));return Es.map(t,function(u){return Es.map(u,function(f){var c,h,d=f[o],p=f[a];if(Es.isArray(d)){var v=(l-s[p])/2;return ah(ah({},f),(c={},c[o]=Es.map(d,function(g){return v+g}),c))}var m=(l-d)/2;return ah(ah({},f),(h={},h[o]=[m,d+m],h))})})},e.prototype.getXValuesMaxMap=function(t){var n=this,i=this,a=i.xField,o=i.yField,s=Es.groupBy(t,function(l){return l[a]});return Es.mapValues(s,function(l){return n.getDimMaxValue(l,o)})},e.prototype.getDimMaxValue=function(t,n){var i=Es.map(t,function(o){return Es.get(o,n,[])}),a=Es.flatten(i);return Math.max.apply(Math,a)},e}($f),qJ=AUt;Tb("Dodge",HJ);Tb("Jitter",YJ);Tb("Stack",XJ);Tb("Symmetric",qJ);var Lb=z(q()),KJ=function(r,e){return(0,Lb.isString)(e)?e:r.invert(r.scale(e))},MUt=function(){function r(e){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(e)}return r.prototype.mapping=function(){for(var e=this,t=[],n=0;n1?1:Number(e),n=r.length-1,i=Math.floor(n*t),a=n*t-i,o=r[i],s=i===n?o:r[i+1];return ytt([Tz(o,s,a,0),Tz(o,s,a,1),Tz(o,s,a,2)])},J2,btt=function(r){if(r[0]==="#"&&r.length===7)return r;J2||(J2=PUt()),J2.style.color=r;var e=document.defaultView.getComputedStyle(J2,"").getPropertyValue("color"),t=TUt.exec(e),n=t[1].split(/\s*,\s*/).map(function(i){return Number(i)});return e=ytt(n),e},RUt=function(r){var e=(0,im.isString)(r)?r.split("-"):r,t=(0,im.map)(e,function(n){return xtt(n.indexOf("#")===-1?btt(n):n)});return function(n){return kUt(t,n)}},NUt=function(r){if(DUt(r)){var e,t=void 0;if(r[0]==="l"){var n=IUt.exec(r),i=+n[1]+90;t=n[2],e="linear-gradient("+i+"deg, "}else if(r[0]==="r"){e="radial-gradient(";var n=LUt.exec(r);t=n[4]}var a=t.match(OUt);return(0,im.each)(a,function(o,s){var l=o.split(":");e+=l[1]+" "+l[0]*100+"%",s!==a.length-1&&(e+=", ")}),e+=")",e}return r},gu={rgb2arr:xtt,gradient:RUt,toRGB:(0,im.memoize)(btt),toCSSGradient:NUt};var _tt=z(q());var FUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="color",n.names=["color"],(0,_tt.isString)(n.values)&&(n.linear=!0),n.gradient=gu.gradient(n.values),n}return e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(mu),Lz=FUt;var BUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="opacity",n.names=["opacity"],n}return e}(mu),Stt=BUt;var Db=z(q());var GUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.names=["x","y"],n.type="position",n}return e.prototype.mapping=function(t,n){var i=this.scales,a=i[0],o=i[1];return(0,Db.isNil)(t)||(0,Db.isNil)(n)?[]:[(0,Db.isArray)(t)?t.map(function(s){return a.scale(s)}):a.scale(t),(0,Db.isArray)(n)?n.map(function(s){return o.scale(s)}):o.scale(n)]},e}(mu),Ctt=GUt;var zUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="shape",n.names=["shape"],n}return e.prototype.getLinearValue=function(t){var n=Math.round((this.values.length-1)*t);return this.values[n]},e}(mu),wtt=zUt;var UUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="size",n.names=["size"],n}return e}(mu),Ett=UUt;var Uo=z(q());var Att={};function tL(r){return Att[r]}function Xu(r,e){Att[r]=e}var jUt=function(){function r(e){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=e,this.initCfg(),this.init()}return r.prototype.translate=function(e){return e},r.prototype.change=function(e){(0,Uo.assign)(this.__cfg__,e),this.init()},r.prototype.clone=function(){return this.constructor(this.__cfg__)},r.prototype.getTicks=function(){var e=this;return(0,Uo.map)(this.ticks,function(t,n){return(0,Uo.isObject)(t)?t:{text:e.getText(t,n),tickValue:t,value:e.scale(t)}})},r.prototype.getText=function(e,t){var n=this.formatter,i=n?n(e,t):e;return(0,Uo.isNil)(i)||!(0,Uo.isFunction)(i.toString)?"":i.toString()},r.prototype.getConfig=function(e){return this.__cfg__[e]},r.prototype.init=function(){(0,Uo.assign)(this,this.__cfg__),this.setDomain(),(0,Uo.isEmpty)(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},r.prototype.initCfg=function(){},r.prototype.setDomain=function(){},r.prototype.calculateTicks=function(){var e=this.tickMethod,t=[];if((0,Uo.isString)(e)){var n=tL(e);if(!n)throw new Error("There is no method to to calculate ticks!");t=n(this)}else(0,Uo.isFunction)(e)&&(t=e(this));return t},r.prototype.rangeMin=function(){return this.range[0]},r.prototype.rangeMax=function(){return this.range[1]},r.prototype.calcPercent=function(e,t,n){return(0,Uo.isNumber)(e)?(e-t)/(n-t):NaN},r.prototype.calcValue=function(e,t,n){return t+e*(n-t)},r}(),qu=jUt;var Pb=z(q());var WUt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cat",t.isCategory=!0,t}return e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;tthis.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var n=[],i=1;i1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(qu),sh=WUt;var iL=z(q());var kb=z(q());var Pz={};Dn(Pz,{assign:()=>sm,default:()=>Dz,defaultI18n:()=>Oz,format:()=>Utt,parse:()=>jtt,setGlobalDateI18n:()=>Ptt,setGlobalDateMasks:()=>ztt});var Mtt=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,am="[1-9]\\d?",om="\\d\\d",VUt="\\d{3}",HUt="\\d{4}",Hw="[^\\s]+",Ttt=/\[([^]*?)\]/gm;function Itt(r,e){for(var t=[],n=0,i=r.length;n-1?i:null}};function sm(r){for(var e=[],t=1;t3?0:(r-r%10!=10?1:0)*r%10]}},eL=sm({},Oz),Ptt=function(r){return eL=sm(eL,r)},ktt=function(r){return r.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Ll=function(r,e){for(e===void 0&&(e=2),r=String(r);r.length0?"-":"+")+Ll(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(r){var e=r.getTimezoneOffset();return(e>0?"-":"+")+Ll(Math.floor(Math.abs(e)/60),2)+":"+Ll(Math.abs(e)%60,2)}},Rtt=function(r){return+r-1},Ntt=[null,am],Ftt=[null,Hw],Btt=["isPm",Hw,function(r,e){var t=r.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],Gtt=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(r){var e=(r+"").match(/([+-]|\d\d)/gi);if(e){var t=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?t:-t}return 0}],KUt={D:["day",am],DD:["day",om],Do:["day",am+Hw,function(r){return parseInt(r,10)}],M:["month",am,Rtt],MM:["month",om,Rtt],YY:["year",om,function(r){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+r>68?t-1:t)+r)}],h:["hour",am,void 0,"isPm"],hh:["hour",om,void 0,"isPm"],H:["hour",am],HH:["hour",om],m:["minute",am],mm:["minute",om],s:["second",am],ss:["second",om],YYYY:["year",HUt],S:["millisecond","\\d",function(r){return+r*100}],SS:["millisecond",om,function(r){return+r*10}],SSS:["millisecond",VUt],d:Ntt,dd:Ntt,ddd:Ftt,dddd:Ftt,MMM:["month",Hw,Ltt("monthNamesShort")],MMMM:["month",Hw,Ltt("monthNames")],a:Btt,A:Btt,ZZ:Gtt,Z:Gtt},rL={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"},ztt=function(r){return sm(rL,r)},Utt=function(r,e,t){if(e===void 0&&(e=rL.default),t===void 0&&(t={}),typeof r=="number"&&(r=new Date(r)),Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))throw new Error("Invalid Date pass to format");e=rL[e]||e;var n=[];e=e.replace(Ttt,function(a,o){return n.push(o),"@@@"});var i=sm(sm({},eL),t);return e=e.replace(Mtt,function(a){return qUt[a](r,i)}),e.replace(/@@@/g,function(){return n.shift()})};function jtt(r,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=rL[e]||e,r.length>1e3)return null;var n=new Date,i={year:n.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(Ttt,function(S,C){return o.push(ktt(C)),"@@@"}),l={},u={};s=ktt(s).replace(Mtt,function(S){var C=KUt[S],w=C[0],A=C[1],L=C[3];if(l[w])throw new Error("Invalid format. "+w+" specified twice in format");return l[w]=!0,L&&(u[L]=!0),a.push(C),"("+A+")"}),Object.keys(u).forEach(function(S){if(!l[S])throw new Error("Invalid format. "+S+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var f=r.match(new RegExp(s,"i"));if(!f)return null;for(var c=sm(sm({},eL),t),h=1;h>>1;r(e[s])>t?o=s:a=s+1}return a}}var Vtt="format";function nL(r,e){var t=Pz[Vtt]||Dz[Vtt];return t(r,e)}function Rb(r){return(0,kb.isString)(r)&&(r.indexOf("T")>0?r=new Date(r).getTime():r=new Date(r.replace(/-/gi,"/")).getTime()),(0,kb.isDate)(r)&&(r=r.getTime()),r}var Ku=1e3,lm=60*Ku,um=60*lm,lh=24*um,Nb=lh*31,Rz=lh*365;var Yw=[["HH:mm:ss",Ku],["HH:mm:ss",Ku*10],["HH:mm:ss",Ku*30],["HH:mm",lm],["HH:mm",lm*10],["HH:mm",lm*30],["HH",um],["HH",um*6],["HH",um*12],["YYYY-MM-DD",lh],["YYYY-MM-DD",lh*4],["YYYY-WW",lh*7],["YYYY-MM",Nb],["YYYY-MM",Nb*4],["YYYY-MM",Nb*6],["YYYY",lh*380]];function Htt(r,e,t){var n=(e-r)/t,i=Wtt(function(o){return o[1]})(Yw,n)-1,a=Yw[i];return i<0?a=Yw[0]:i>=Yw.length&&(a=(0,kb.last)(Yw)),a}var $Ut=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="timeCat",t}return e.prototype.translate=function(t){t=Rb(t);var n=this.values.indexOf(t);return n===-1&&((0,iL.isNumber)(t)&&t-1){var a=this.values[i],o=this.formatter;return a=o?o(a,n):nL(a,this.mask),a}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var t=this.values;(0,iL.each)(t,function(n,i){t[i]=Rb(n)}),t.sort(function(n,i){return n-i}),r.prototype.setDomain.call(this)},e}(sh),Ytt=$Ut;var Ol=z(q());var QUt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isContinuous=!0,t}return e.prototype.scale=function(t){if((0,Ol.isNil)(t))return NaN;var n=this.rangeMin(),i=this.rangeMax(),a=this.max,o=this.min;if(a===o)return n;var s=this.getScalePercent(t);return n+s*(i-n)},e.prototype.init=function(){r.prototype.init.call(this);var t=this.ticks,n=(0,Ol.head)(t),i=(0,Ol.last)(t);nthis.max&&(this.max=i),(0,Ol.isNil)(this.minLimit)||(this.min=n),(0,Ol.isNil)(this.maxLimit)||(this.max=i)},e.prototype.setDomain=function(){var t=(0,Ol.getRange)(this.values),n=t.min,i=t.max;(0,Ol.isNil)(this.min)&&(this.min=n),(0,Ol.isNil)(this.max)&&(this.max=i),this.min>this.max&&(this.min=n,this.max=i)},e.prototype.calculateTicks=function(){var t=this,n=r.prototype.calculateTicks.call(this);return this.nice||(n=(0,Ol.filter)(n,function(i){return i>=t.min&&i<=t.max})),n},e.prototype.getScalePercent=function(t){var n=this.max,i=this.min;return(t-i)/(n-i)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(qu),fm=QUt;var JUt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return e.prototype.invert=function(t){var n=this.getInvertPercent(t);return this.min+n*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(fm),Qf=JUt;var aL=z(q());function uh(r,e){var t=Math.E,n;return e>=0?n=Math.pow(t,Math.log(e)/r):n=Math.pow(t,Math.log(-e)/r)*-1,n}function Dl(r,e){return r===1?1:Math.log(e)/Math.log(r)}function oL(r,e,t){(0,aL.isNil)(t)&&(t=Math.max.apply(null,r));var n=t;return(0,aL.each)(r,function(i){i>0&&i1&&(n=1),n}var tjt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="log",t}return e.prototype.invert=function(t){var n=this.base,i=Dl(n,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=Dl(n,l/n);var u=1/(i-s)*o;if(t=0?1:-1;return Math.pow(s,i)*l},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var n=this.max,i=this.min;if(n===i)return 0;var a=this.exponent,o=(uh(a,t)-uh(a,i))/(uh(a,n)-uh(a,i));return o},e}(fm),qtt=ejt;var Pl=z(q());var rjt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="time",t}return e.prototype.getText=function(t,n){var i=this.translate(t),a=this.formatter;return a?a(i,n):nL(i,this.mask)},e.prototype.scale=function(t){var n=t;return((0,Pl.isString)(n)||(0,Pl.isDate)(n))&&(n=this.translate(n)),r.prototype.scale.call(this,n)},e.prototype.translate=function(t){return Rb(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,n=this.getConfig("min"),i=this.getConfig("max");if((!(0,Pl.isNil)(n)||!(0,Pl.isNumber)(n))&&(this.min=this.translate(this.min)),(!(0,Pl.isNil)(i)||!(0,Pl.isNumber)(i))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;(0,Pl.each)(t,function(u){var f=Rb(u);if(isNaN(f))throw new TypeError("Invalid Time: "+u+" in time scale!");o>f?(s=o,o=f):s>f&&(s=f),l1&&(this.minTickInterval=s-o),(0,Pl.isNil)(n)&&(this.min=o),(0,Pl.isNil)(i)&&(this.max=l)}},e}(Qf),Ktt=rjt;var fh=z(q());var njt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantize",t}return e.prototype.invert=function(t){var n=this.ticks,i=n.length,a=this.getInvertPercent(t),o=Math.floor(a*(i-1));if(o>=i-1)return(0,fh.last)(n);if(o<0)return(0,fh.head)(n);var s=n[o],l=n[o+1],u=o/(i-1),f=(o+1)/(i-1);return s+(a-u)/(f-u)*(l-s)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var t=r.prototype.calculateTicks.call(this);return this.nice||((0,fh.last)(t)!==this.max&&t.push(this.max),(0,fh.head)(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var n=this.ticks;if(t<(0,fh.head)(n))return 0;if(t>(0,fh.last)(n))return 1;var i=0;return(0,fh.each)(n,function(a,o){if(t>=a)i=o;else return!1}),i/(n.length-1)},e}(fm),sL=njt;var ijt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantile",t}return e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(sL),Ztt=ijt;var $tt={};function Fb(r){return $tt[r]}function Zu(r,e){if(Fb(r))throw new Error("type '"+r+"' existed.");$tt[r]=e}var Qtt=z(q());var ajt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,Qtt.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var n=this.range;return tn[1]?NaN:this.values[0]},e}(qu),Jtt=ajt;var ap=z(q());var ch=z(q());function cm(r){return Math.abs(r)<1e-15?r:parseFloat(r.toFixed(15))}var ojt=[1,5,2,2.5,4,3];var tet=Number.EPSILON*100;function sjt(r,e){return(r%e+e)%e}function ljt(r){return Math.round(r*1e12)/1e12}function ujt(r,e,t,n,i,a){var o=(0,ch.size)(e),s=(0,ch.indexOf)(e,r),l=0,u=sjt(n,a);return(u=0&&(l=1),1-s/(o-1)-t+l}function fjt(r,e,t){var n=(0,ch.size)(e),i=(0,ch.indexOf)(e,r),a=1;return 1-i/(n-1)-t+a}function cjt(r,e,t,n,i,a){var o=(r-1)/(a-i),s=(e-1)/(Math.max(a,n)-Math.min(t,i));return 2-Math.max(o/s,s/o)}function hjt(r,e){return r>=e?2-(r-1)/(e-1):1}function djt(r,e,t,n){var i=e-r;return 1-.5*(Math.pow(e-n,2)+Math.pow(r-t,2))/Math.pow(.1*i,2)}function pjt(r,e,t){var n=e-r;if(t>n){var i=(t-n)/2;return 1-Math.pow(i,2)/Math.pow(.1*n,2)}return 1}function vjt(){return 1}function Xw(r,e,t,n,i,a){t===void 0&&(t=5),n===void 0&&(n=!0),i===void 0&&(i=ojt),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(r)||Number.isNaN(e)||typeof r!="number"||typeof e!="number"||!o)return{min:0,max:0,ticks:[]};if(e-r<1e-15||o===1)return{min:r,max:e,ticks:[r]};for(var s={score:-2,lmin:0,lmax:0,lstep:0},l=1;l<1/0;){for(var u=0;us.score&&(!n||A<=r&&L>=e)&&(s.lmin=A,s.lmax=L,s.lstep=k,s.score=P)}v+=1}h+=1}}l+=1}var F=cm(s.lmax),D=cm(s.lmin),G=cm(s.lstep),U=Math.floor(ljt((F-D)/G))+1,j=new Array(U);j[0]=cm(D);for(var u=1;u=a&&u<=o});return l.map(function(u){return e[u]})}return e.slice(a,o+1)}var Zy=z(q());function Nz(r){var e=r.min,t=r.max,n=r.nice,i=r.tickCount,a=new mjt;return a.domain([e,t]),n&&a.nice(i),a.ticks(i)}var Fz=5,eet=Math.sqrt(50),ret=Math.sqrt(10),net=Math.sqrt(2),mjt=function(){function r(){this._domain=[0,1]}return r.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},r.prototype.nice=function(e){var t,n;e===void 0&&(e=Fz);var i=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],u;return l0?(s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u,u=lL(s,l,e)):u<0&&(s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u,u=lL(s,l,e)),u>0?(i[a]=Math.floor(s/u)*u,i[o]=Math.ceil(l/u)*u,this.domain(i)):u<0&&(i[a]=Math.ceil(s*u)/u,i[o]=Math.floor(l*u)/u,this.domain(i)),this},r.prototype.ticks=function(e){return e===void 0&&(e=Fz),gjt(this._domain[0],this._domain[this._domain.length-1],e||Fz)},r}();function gjt(r,e,t){var n,i=-1,a,o,s;if(e=+e,r=+r,t=+t,r===e&&t>0)return[r];if((n=e0)for(r=Math.ceil(r/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-r+1));++i=0?(a>=eet?10:a>=ret?5:a>=net?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=eet?10:a>=ret?5:a>=net?2:1)}var uL=z(q());function iet(r,e,t){var n;return t==="ceil"?n=Math.ceil(r/e):t==="floor"?n=Math.floor(r/e):n=Math.round(r/e),n*e}function qy(r,e,t){var n=iet(r,t,"floor"),i=iet(e,t,"ceil");n=(0,uL.fixedBase)(n,t),i=(0,uL.fixedBase)(i,t);for(var a=[],o=n;o<=i;o=o+t){var s=(0,uL.fixedBase)(o,t);a.push(s)}return{min:n,max:i,ticks:a}}var Kw=z(q());function Ky(r,e,t){var n,i=r.minLimit,a=r.maxLimit,o=r.min,s=r.max,l=r.tickCount,u=l===void 0?5:l,f=(0,Kw.isNil)(i)?(0,Kw.isNil)(e)?o:e:i,c=(0,Kw.isNil)(a)?(0,Kw.isNil)(t)?s:t:a;if(f>c&&(n=[f,c],c=n[0],f=n[1]),u<=2)return[f,c];for(var h=(c-f)/(u-1),d=[],p=0;p0)o=Math.floor(Dl(e,n));else{var l=oL(a,e,i);o=Math.floor(Dl(e,l))}for(var u=s-o,f=Math.ceil(u/t),c=[],h=o;h=0?1:-1;return Math.pow(o,e)*s})}function yjt(r,e){var t=r.length*e;return e===1?r[r.length-1]:e===0?r[0]:t%1!=0?r[Math.ceil(t)-1]:r.length%2==0?(r[t-1]+r[t])/2:r[t]}function jz(r){var e=r.tickCount,t=r.values;if(!t||!t.length)return[];for(var n=t.slice().sort(function(s,l){return s-l}),i=[],a=0;a1&&(i=i*Math.ceil(s)),n&&iRz)for(var l=fL(t),u=Math.ceil(a/Rz),f=s;f<=l+u;f=f+u)o.push(xjt(f));else if(a>Nb)for(var c=Math.ceil(a/Nb),h=Xz(e),d=bjt(e,t),f=0;f<=d+c;f=f+c)o.push(_jt(s,f+h));else if(a>lh)for(var p=new Date(e),v=p.getFullYear(),m=p.getMonth(),g=p.getDate(),x=Math.ceil(a/lh),b=Sjt(e,t),f=0;fum)for(var p=new Date(e),v=p.getFullYear(),m=p.getMonth(),x=p.getDate(),S=p.getHours(),C=Math.ceil(a/um),w=Cjt(e,t),f=0;f<=w+C;f=f+C)o.push(new Date(v,m,x,S+f).getTime());else if(a>lm)for(var A=wjt(e,t),L=Math.ceil(a/lm),f=0;f<=A+L;f=f+L)o.push(e+f*lm);else{var k=a;k=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}Xu("cat",qw);Xu("time-cat",Yz);Xu("wilkinson-extended",Gz);Xu("r-pretty",Wz);Xu("time",Vz);Xu("time-pretty",qz);Xu("log",zz);Xu("pow",Uz);Xu("quantile",jz);Xu("d3-linear",Bz);Zu("cat",sh);Zu("category",sh);Zu("identity",Jtt);Zu("linear",Qf);Zu("log",Xtt);Zu("pow",qtt);Zu("time",Ktt);Zu("timeCat",Ytt);Zu("quantize",sL);Zu("quantile",Ztt);var aet={},$w=function(r){return aet[r.toLowerCase()]},Bb=function(r,e){if($w(r))throw new Error("Attribute type '"+r+"' existed.");aet[r.toLowerCase()]=e};Bb("Color",Lz);Bb("Opacity",Stt);Bb("Position",Ctt);Bb("Shape",wtt);Bb("Size",Ett);var oet=z(q()),Ejt=function(){function r(e){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var t=e.start,n=e.end,i=e.matrix,a=i===void 0?[1,0,0,0,1,0,0,0,1]:i,o=e.isTransposed,s=o===void 0?!1:o;this.start=t,this.end=n,this.matrix=a,this.originalMatrix=mn([],a),this.isTransposed=s}return r.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},r.prototype.update=function(e){(0,oet.assign)(this,e),this.initial()},r.prototype.convertDim=function(e,t){var n,i=this[t],a=i.start,o=i.end;return this.isReflect(t)&&(n=[o,a],a=n[0],o=n[1]),a+e*(o-a)},r.prototype.invertDim=function(e,t){var n,i=this[t],a=i.start,o=i.end;return this.isReflect(t)&&(n=[o,a],a=n[0],o=n[1]),(e-a)/(o-a)},r.prototype.applyMatrix=function(e,t,n){n===void 0&&(n=0);var i=this.matrix,a=[e,t,n];return Ft.transformMat3(a,a,i),a},r.prototype.invertMatrix=function(e,t,n){n===void 0&&(n=0);var i=this.matrix,a=Ai.invert([0,0,0,0,0,0,0,0,0],i),o=[e,t,n];return a&&Ft.transformMat3(o,o,a),o},r.prototype.convert=function(e){var t=this.convertPoint(e),n=t.x,i=t.y,a=this.applyMatrix(n,i,1);return{x:a[0],y:a[1]}},r.prototype.invert=function(e){var t=this.invertMatrix(e.x,e.y,1);return this.invertPoint({x:t[0],y:t[1]})},r.prototype.rotate=function(e){var t=this.matrix,n=this.center;return gr.leftTranslate(t,t,[-n.x,-n.y]),gr.leftRotate(t,t,e),gr.leftTranslate(t,t,[n.x,n.y]),this},r.prototype.reflect=function(e){return e==="x"?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},r.prototype.scale=function(e,t){var n=this.matrix,i=this.center;return gr.leftTranslate(n,n,[-i.x,-i.y]),gr.leftScale(n,n,[e,t]),gr.leftTranslate(n,n,[i.x,i.y]),this},r.prototype.translate=function(e,t){var n=this.matrix;return gr.leftTranslate(n,n,[e,t]),this},r.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},r.prototype.getCenter=function(){return this.center},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRadius=function(){return this.radius},r.prototype.isReflect=function(e){return e==="x"?this.isReflectX:this.isReflectY},r.prototype.resetMatrix=function(e){this.matrix=e||mn([],this.originalMatrix)},r}(),hh=Ejt;var Ajt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.isRect=!0,n.type="cartesian",n.initial(),n}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=this.start,n=this.end;this.x={start:t.x,end:n.x},this.y={start:t.y,end:n.y}},e.prototype.convertPoint=function(t){var n,i=t.x,a=t.y;return this.isTransposed&&(n=[a,i],i=n[0],a=n[1]),{x:this.convertDim(i,"x"),y:this.convertDim(a,"y")}},e.prototype.invertPoint=function(t){var n,i=this.invertDim(t.x,"x"),a=this.invertDim(t.y,"y");return this.isTransposed&&(n=[a,i],i=n[0],a=n[1]),{x:i,y:a}},e}(hh),Kz=Ajt;var cL=z(q());var Mjt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.isHelix=!0,n.type="helix";var i=t.startAngle,a=i===void 0?1.25*Math.PI:i,o=t.endAngle,s=o===void 0?7.25*Math.PI:o,l=t.innerRadius,u=l===void 0?0:l,f=t.radius;return n.startAngle=a,n.endAngle=s,n.innerRadius=u,n.radius=f,n.initial(),n}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=(this.endAngle-this.startAngle)/(2*Math.PI)+1,n=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(n=n*this.radius),this.d=Math.floor(n*(1-this.innerRadius)/t),this.a=this.d/(Math.PI*2),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*n,end:this.innerRadius*n+this.d*.99}},e.prototype.convertPoint=function(t){var n,i=t.x,a=t.y;this.isTransposed&&(n=[a,i],i=n[0],a=n[1]);var o=this.convertDim(i,"x"),s=this.a*o,l=this.convertDim(a,"y");return{x:this.center.x+Math.cos(o)*(s+l),y:this.center.y+Math.sin(o)*(s+l)}},e.prototype.invertPoint=function(t){var n,i=this.d+this.y.start,a=oe.subtract([0,0],[t.x,t.y],[this.center.x,this.center.y]),o=gr.angleTo(a,[1,0],!0),s=o*this.a;oe.length(a)this.width/n?(s=this.width/n,this.circleCenter={x:this.center.x-(.5-a)*this.width,y:this.center.y-(.5-o)*s*i}):(s=this.height/i,this.circleCenter={x:this.center.x-(.5-a)*s*n,y:this.center.y-(.5-o)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=s*this.radius:(this.radius<=0||this.radius>s)&&(this.polarRadius=s):this.polarRadius=s,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var n,i=this.getCenter(),a=t.x,o=t.y;return this.isTransposed&&(n=[o,a],a=n[0],o=n[1]),a=this.convertDim(a,"x"),o=this.convertDim(o,"y"),{x:i.x+Math.cos(a)*o,y:i.y+Math.sin(a)*o}},e.prototype.invertPoint=function(t){var n,i=this.getCenter(),a=[t.x-i.x,t.y-i.y],o=this,s=o.startAngle,l=o.endAngle;this.isReflect("x")&&(n=[l,s],s=n[0],l=n[1]);var u=[1,0,0,0,1,0,0,0,1];gr.leftRotate(u,u,s);var f=[1,0,0];Ft.transformMat3(f,f,u);var c=[f[0],f[1]],h=gr.angleTo(c,a,l0?p:-p;var v=this.invertDim(d,"y"),m={x:0,y:0};return m.x=this.isTransposed?v:p,m.y=this.isTransposed?p:v,m},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,n=this.endAngle;if(Math.abs(n-t)>=Math.PI*2)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var i=[0,Math.cos(t),Math.cos(n)],a=[0,Math.sin(t),Math.sin(n)],o=Math.min(t,n);oCet,DataMarker:()=>Aet,DataRegion:()=>Met,Html:()=>Let,Image:()=>Eet,Line:()=>bet,Region:()=>wet,RegionFilter:()=>Tet,Shape:()=>Iet,Text:()=>_et});var mL=z(q());var so=z(q());function Qw(r,e,t){var n=new Yu(e,t);n.target=r,n.propagationPath.push(r),r.emitDelegation(e,n);for(var i=r.getParent();i;)i.emitDelegation(e,n),n.propagationPath.push(i),i=i.getParent()}var het=[1,0,0,0,1,0,0,0,1];function Jf(r,e,t){if(t===void 0&&(t=het),!e)return null;var n=gr.transform(t,[["t",-r.x,-r.y],["r",e],["t",r.x,r.y]]);return n}function Jw(r,e){return!r.x&&!r.y?null:gr.transform(e||het,[["t",r.x,r.y]])}function det(r){var e=[1,0,0],t=[0,0,0];return Ft.transformMat3(t,e,r),Math.atan2(t[1],t[0])}function dL(r,e){var t=[0,0];return oe.transformMat3(t,e,r),t}function pet(r,e){var t=dL(r,[e.minX,e.minY]),n=dL(r,[e.maxX,e.minY]),i=dL(r,[e.minX,e.maxY]),a=dL(r,[e.maxX,e.maxY]),o=Math.min(t[0],n[0],i[0],a[0]),s=Math.max(t[0],n[0],i[0],a[0]),l=Math.min(t[1],n[1],i[1],a[1]),u=Math.max(t[1],n[1],i[1],a[1]);return{x:o,y:l,minX:o,minY:l,maxX:s,maxY:u,width:s-o,height:u-l}}function pL(r,e,t,n){if(e){var i=Jf({x:t,y:n},e,r.getMatrix());r.setMatrix(i)}}function hm(r,e,t){var n=Jw({x:e,y:t});r.attr("matrix",n)}var dh=z(q());function Jy(r){var e=0,t=0,n=0,i=0;return(0,dh.isNumber)(r)?e=t=n=i=r:(0,dh.isArray)(r)&&(e=r[0],n=(0,dh.isNil)(r[1])?r[0]:r[1],i=(0,dh.isNil)(r[2])?r[0]:r[2],t=(0,dh.isNil)(r[3])?n:r[3]),[e,n,i,t]}function zb(r){for(var e=r.childNodes,t=e.length,n=t-1;n>=0;n--)r.removeChild(e[n])}function vet(r,e){return!!r.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function op(r){var e=r.start,t=r.end,n=Math.min(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.x,t.x),o=Math.max(e.y,t.y);return{x:n,y:i,minX:n,minY:i,maxX:a,maxY:o,width:a-n,height:o-i}}function met(r){var e=r.map(function(s){return s.x}),t=r.map(function(s){return s.y}),n=Math.min.apply(Math,e),i=Math.min.apply(Math,t),a=Math.max.apply(Math,e),o=Math.max.apply(Math,t);return{x:n,y:i,minX:n,minY:i,maxX:a,maxY:o,width:a-n,height:o-i}}function Ub(r,e,t,n){var i=r+t,a=e+n;return{x:r,y:e,width:t,height:n,minX:r,minY:e,maxX:isNaN(i)?0:i,maxY:isNaN(a)?0:a}}function sp(r,e,t){return(1-t)*r+e*t}function dm(r,e,t){return{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}}function Ijt(r,e){var t=e.x-r.x,n=e.y-r.y;return Math.sqrt(t*t+n*n)}var tE=function(r,e,t){return t===void 0&&(t=Math.pow(Number.EPSILON,.5)),[r,e].includes(1/0)?Math.abs(r)===Math.abs(e):Math.abs(r-e)0?(0,dh.each)(l,function(u){if(u.get("visible")){if(u.isGroup()&&u.get("children").length===0)return!0;var f=Zz(u),c=u.applyToMatrix([f.minX,f.minY,1]),h=u.applyToMatrix([f.minX,f.maxY,1]),d=u.applyToMatrix([f.maxX,f.minY,1]),p=u.applyToMatrix([f.maxX,f.maxY,1]),v=Math.min(c[0],h[0],d[0],p[0]),m=Math.max(c[0],h[0],d[0],p[0]),g=Math.min(c[1],h[1],d[1],p[1]),x=Math.max(c[1],h[1],d[1],p[1]);va&&(a=m),gs&&(s=x)}}):(i=0,a=0,o=0,s=0),n=Ub(i,o,a-i,s-o)}return t?Ljt(n,t):n}function get(r,e){if(!(!r.getClip()&&!e.getClip())){var t=e.getClip();if(!t){r.setClip(null);return}var n={type:t.get("type"),attrs:t.attr()};r.setClip(n)}}function As(r){return r+"px"}function vL(r,e,t,n){var i=Ijt(r,e),a=n/i,o=0;return t==="start"?o=0-a:t==="end"&&(o=1+a),{x:sp(r.x,e.x,o),y:sp(r.y,e.y,o)}}var yu=z(q()),Ojt={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},Djt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.initCfg(),n}return e.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},e.prototype.clear=function(){},e.prototype.update=function(t){var n=this,i=this.get("defaultCfg")||{};(0,yu.each)(t,function(a,o){var s=n.get(o),l=a;s!==a&&((0,yu.isObject)(a)&&i[o]&&(l=(0,yu.deepMix)({},i[o],a)),n.set(o,l))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){(0,yu.hasKey)(t,"visible")&&(t.visible?this.show():this.hide()),(0,yu.hasKey)(t,"capture")&&this.setCapture(t.capture)},e.prototype.getLayoutBBox=function(){return this.getBBox()},e.prototype.getLocationType=function(){return this.get("locationType")},e.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},e.prototype.setOffset=function(t,n){this.update({offsetX:t,offsetY:n})},e.prototype.setLocation=function(t){var n=E({},t);this.update(n)},e.prototype.getLocation=function(){var t=this,n={},i=this.get("locationType"),a=Ojt[i];return(0,yu.each)(a,function(o){n[o]=t.get(o)}),n},e.prototype.isList=function(){return!1},e.prototype.isSlider=function(){return!1},e.prototype.init=function(){},e.prototype.initCfg=function(){var t=this,n=this.get("defaultCfg");(0,yu.each)(n,function(i,a){var o=t.get(a);if((0,yu.isObject)(o)){var s=(0,yu.deepMix)({},i,o);t.set(a,s)}})},e}(Ry),jb=Djt;var t0="update_status",Pjt=["visible","tip","delegateObject"],kjt=["container","group","shapesMap","isRegister","isUpdating","destroyed"],Rjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear();var t=this.get("group");t.remove()},e.prototype.clear=function(){var t=this.get("group");t.clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var n=this.getElementById(t),i=n&&n.get("component");return i},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var n=this.getElementId(t);return this.getElementById(n)},e.prototype.getElementsByName=function(t){var n=[];return(0,so.each)(this.get("shapesMap"),function(i){i.get("name")===t&&n.push(i)}),n},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var n=this.get("group");this.updateElements(t,n),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){var t=this.get("group");t.show(),this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("group");t.hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){var n=this.get("group");n.set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),r.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),n=this.getInnerLayoutBBox(),i=t.getTotalMatrix();return i&&(n=pet(i,n)),n},e.prototype.on=function(t,n,i){var a=this.get("group");return a.on(t,n,i),this},e.prototype.off=function(t,n){var i=this.get("group");return i&&i.off(t,n),this},e.prototype.emit=function(t,n){var i=this.get("group");i.emit(t,n)},e.prototype.init=function(){r.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,n){var i=this.get("group");n.target=i,i.emit(t,n),Qw(i,t,n)},e.prototype.createOffScreenGroup=function(){var t=this.get("group"),n=t.getGroupBase(),i=new n({delegateObject:this.getDelegateObject()});return i},e.prototype.applyOffset=function(){var t=this.get("offsetX"),n=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:n})},e.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",Zz(t)),t},e.prototype.addGroup=function(t,n){this.appendDelegateObject(t,n);var i=t.addGroup(n);return this.get("isRegister")&&this.registerElement(i),i},e.prototype.addShape=function(t,n){this.appendDelegateObject(t,n);var i=t.addShape(n);return this.get("isRegister")&&this.registerElement(i),i},e.prototype.addComponent=function(t,n){var i=n.id,a=n.component,o=rr(n,["id","component"]),s=new a(E(E({},o),{id:i,container:t,updateAutoRender:this.get("updateAutoRender")}));return s.init(),s.render(),this.get("isRegister")&&this.registerElement(s.get("group")),s},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){var t=this.get("group");t.off()},e.prototype.getElementId=function(t){var n=this.get("id"),i=this.get("name");return n+"-"+i+"-"+t},e.prototype.registerElement=function(t){var n=t.get("id");this.get("shapesMap")[n]=t},e.prototype.unregisterElement=function(t){var n=t.get("id");delete this.get("shapesMap")[n]},e.prototype.moveElementTo=function(t,n){var i=Jw(n);t.attr("matrix",i)},e.prototype.addAnimation=function(t,n,i){var a=n.attr("opacity");(0,so.isNil)(a)&&(a=1),n.attr("opacity",0),n.animate({opacity:a},i)},e.prototype.removeAnimation=function(t,n,i){n.animate({opacity:0},i)},e.prototype.updateAnimation=function(t,n,i,a){n.animate(i,a)},e.prototype.updateElements=function(t,n){var i=this,a=this.get("animate"),o=this.get("animateOption"),s=t.getChildren().slice(0),l;(0,so.each)(s,function(u){var f=u.get("id"),c=i.getElementById(f),h=u.get("name");if(c)if(u.get("isComponent")){var d=u.get("component"),p=c.get("component"),v=(0,so.pick)(d.cfg,(0,so.difference)((0,so.keys)(d.cfg),kjt));p.update(v),c.set(t0,"update")}else{var m=i.getReplaceAttrs(c,u);a&&o.update?i.updateAnimation(h,c,m,o.update):c.attr(m),u.isGroup()&&i.updateElements(u,c),(0,so.each)(Pjt,function(S){c.set(S,u.get(S))}),get(c,u),l=c,c.set(t0,"update")}else{n.add(u);var g=n.getChildren();if(g.splice(g.length-1,1),l){var x=g.indexOf(l);g.splice(x+1,0,u)}else g.unshift(u);if(i.registerElement(u),u.set(t0,"add"),u.get("isComponent")){var d=u.get("component");d.set("container",n)}else u.isGroup()&&i.registerNewGroup(u);if(l=u,a){var b=i.get("isInit")?o.appear:o.enter;b&&i.addAnimation(h,u,b)}}})},e.prototype.clearUpdateStatus=function(t){var n=t.getChildren();(0,so.each)(n,function(i){i.set(t0,null)})},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t,n=this.get("name"),i=(t={},t[n]=this,t.component=this,t);return i},e.prototype.appendDelegateObject=function(t,n){var i=t.get("delegateObject");n.delegateObject||(n.delegateObject={}),(0,so.mix)(n.delegateObject,i)},e.prototype.getReplaceAttrs=function(t,n){var i=t.attr(),a=n.attr();return(0,so.each)(i,function(o,s){a[s]===void 0&&(a[s]=void 0)}),a},e.prototype.registerNewGroup=function(t){var n=this,i=t.getChildren();(0,so.each)(i,function(a){n.registerElement(a),a.set(t0,"add"),a.isGroup()&&n.registerNewGroup(a)})},e.prototype.deleteElements=function(){var t=this,n=this.get("shapesMap"),i=[];(0,so.each)(n,function(s,l){!s.get(t0)||s.destroyed?i.push([l,s]):s.set(t0,null)});var a=this.get("animate"),o=this.get("animateOption");(0,so.each)(i,function(s){var l=s[0],u=s[1];if(!u.destroyed){var f=u.get("name");if(a&&o.leave){var c=(0,so.mix)({callback:function(){t.removeElement(u)}},o.leave);t.removeAnimation(f,u,c)}else t.removeElement(u)}delete n[l]})},e.prototype.removeElement=function(t){if(t.get("isGroup")){var n=t.get("component");n&&n.destroy()}t.remove()},e}(jb),Yn=Rjt;var Qz=z(q());var pm=z(q());var $z="\u2026";function yet(r){for(var e=0,t=0;t0&&r.charCodeAt(e)<128?1:2}function xet(r,e,t){t===void 0&&(t="tail");var n=r.length,i="";if(t==="tail"){for(var a=0,o=0;a=19968&&s<=40869?a+=2:a+=1}a>t&&(t=a,n=i)}return r[n].getBBox().width}function eE(r){if(r.length>Bjt)return Gjt(r);var e=0;return(0,pm.each)(r,function(t){var n=t.getBBox(),i=n.width;e=0?h=xet(a,c,n):h=Njt,h&&(e.attr("text",h),f=!0)}return f?e.set("tip",a):e.set("tip",null),f}function mm(r,e){var t=e.x,n=e.y,i=e.content,a=e.style,o=e.id,s=e.name,l=e.rotate,u=e.maxLength,f=e.autoEllipsis,c=e.isVertical,h=e.ellipsisPosition,d=e.background,p=r.addGroup({id:o+"-group",name:s+"-group",attrs:{x:t,y:n}}),v=p.addShape({type:"text",id:o,name:s,attrs:E({x:0,y:0,text:i},a)}),m=Jy((0,Qz.get)(d,"padding",0));if(u&&f){var g=u-(m[1]+m[3]);vm(!c,v,g,h)}if(d){var x=(0,Qz.get)(d,"style",{}),b=v.getCanvasBBox(),S=b.minX,C=b.minY,w=b.width,A=b.height,L=p.addShape("rect",{id:o+"-bg",name:o+"-bg",attrs:E({x:S-m[3],y:C-m[0],width:w+m[1]+m[3],height:A+m[0]+m[2]},x)});L.toBack()}hm(p,t,n),pL(p,l,t,n)}var Gr={fontFamily:` BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimSun, "sans-serif"`,textColor:"#2C3542",activeTextColor:"#333333",uncheckedColor:"#D8D8D8",lineColor:"#416180",regionColor:"#CCD7EB",verticalAxisRotate:-Math.PI/4,horizontalAxisRotate:Math.PI/4};var Ujt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:Gr.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:Gr.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:Gr.lineColor,lineWidth:1}}}})},e.prototype.renderInner=function(t){this.renderLine(t),this.get("text")&&this.renderLabel(t)},e.prototype.renderLine=function(t){var n=this.get("start"),i=this.get("end"),a=this.get("style");this.addShape(t,{type:"line",id:this.getElementId("line"),name:"annotation-line",attrs:E({x1:n.x,y1:n.y,x2:i.x,y2:i.y},a)})},e.prototype.getLabelPoint=function(t,n,i){var a;return i==="start"?a=0:i==="center"?a=.5:(0,mL.isString)(i)&&i.indexOf("%")!==-1?a=parseInt(i,10)/100:(0,mL.isNumber)(i)?a=i:a=1,(a>1||a<0)&&(a=1),{x:sp(t.x,n.x,a),y:sp(t.y,n.y,a)}},e.prototype.renderLabel=function(t){var n=this.get("text"),i=this.get("start"),a=this.get("end"),o=n.position,s=n.content,l=n.style,u=n.offsetX,f=n.offsetY,c=n.autoRotate,h=n.maxLength,d=n.autoEllipsis,p=n.ellipsisPosition,v=n.background,m=n.isVertical,g=m===void 0?!1:m,x=this.getLabelPoint(i,a,o),b=x.x+u,S=x.y+f,C={id:this.getElementId("line-text"),name:"annotation-line-text",x:b,y:S,content:s,style:l,maxLength:h,autoEllipsis:d,ellipsisPosition:p,background:v,isVertical:g};if(c){var w=[a.x-i.x,a.y-i.y];C.rotate=Math.atan2(w[1],w[0])}mm(t,C)},e}(Yn),bet=Ujt;var jjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:Gr.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:Gr.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var n=this.getLocation(),i=n.x,a=n.y,o=this.get("content"),s=this.get("style"),l=this.getElementId("text"),u=this.get("name")+"-text",f=this.get("maxLength"),c=this.get("autoEllipsis"),h=this.get("isVertical"),d=this.get("ellipsisPosition"),p=this.get("background"),v=this.get("rotate"),m={id:l,name:u,x:i,y:a,content:o,style:s,maxLength:f,autoEllipsis:c,isVertical:h,ellipsisPosition:d,background:p,rotate:v};mm(t,m)},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var n=this.getLocation(),i=n.x,a=n.y,o=this.get("rotate");hm(t,i,a),pL(t,o,i,a)}},e}(Yn),_et=jjt;var Wjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2,style:{stroke:"#999",lineWidth:1}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),n=t.center,i=t.radius,a=t.startAngle,o=t.endAngle,s=dm(n,i,a),l=dm(n,i,o),u=o-a>Math.PI?1:0,f=[["M",s.x,s.y]];if(o-a==Math.PI*2){var c=dm(n,i,a+Math.PI);f.push(["A",i,i,0,u,1,c.x,c.y]),f.push(["A",i,i,0,u,1,l.x,l.y])}else f.push(["A",i,i,0,u,1,l.x,l.y]);return f},e.prototype.renderArc=function(t){var n=this.getArcPath(),i=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:E({path:n},i)})},e}(Yn),Cet=Wjt;var Vjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:Gr.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var n=this.get("start"),i=this.get("end"),a=this.get("style"),o=op({start:n,end:i});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:E({x:o.x,y:o.y,width:o.width,height:o.height},a)})},e}(Yn),wet=Vjt;var Hjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),n=this.get("end"),i=this.get("style"),a=op({start:t,end:n}),o=this.get("src");return E({x:a.x,y:a.y,img:o,width:a.width,height:a.height},i)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(Yn),Eet=Hjt;var tc=z(q());var Yjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:Gr.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:Gr.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:Gr.fontFamily}}}})},e.prototype.renderInner=function(t){(0,tc.get)(this.get("line"),"display")&&this.renderLine(t),(0,tc.get)(this.get("text"),"display")&&this.renderText(t),(0,tc.get)(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var n=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:n})},e.prototype.renderLine=function(t){var n=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:n})},e.prototype.renderText=function(t){var n=this.getShapeAttrs().text,i=n.x,a=n.y,o=n.text,s=rr(n,["x","y","text"]),l=this.get("text"),u=l.background,f=l.maxLength,c=l.autoEllipsis,h=l.isVertival,d=l.ellipsisPosition,p={x:i,y:a,id:this.getElementId("text"),name:"annotation-text",content:o,style:s,background:u,maxLength:f,autoEllipsis:c,isVertival:h,ellipsisPosition:d};mm(t,p)},e.prototype.autoAdjust=function(t){var n=this.get("direction"),i=this.get("x"),a=this.get("y"),o=(0,tc.get)(this.get("line"),"length",0),s=this.get("coordinateBBox"),l=t.getBBox(),u=l.minX,f=l.maxX,c=l.minY,h=l.maxY,d=t.findById(this.getElementId("text-group")),p=t.findById(this.getElementId("text")),v=t.findById(this.getElementId("line"));if(!!s){if(d){if(i+u<=s.minX){var m=s.minX-(i+u);hm(d,d.attr("x")+m,d.attr("y"))}if(i+f>=s.maxX){var m=i+f-s.maxX;hm(d,d.attr("x")-m,d.attr("y"))}}if(n==="upward"&&a+c<=s.minY||n!=="upward"&&a+h>=s.maxY){var g=void 0,x=void 0;n==="upward"&&a+c<=s.minY?(g="top",x=1):(g="bottom",x=-1),p.attr("textBaseline",g),v&&v.attr("path",[["M",0,0],["L",0,o*x]]),hm(d,d.attr("x"),(o+2)*x)}}},e.prototype.getShapeAttrs=function(){var t=(0,tc.get)(this.get("line"),"display"),n=(0,tc.get)(this.get("point"),"style",{}),i=(0,tc.get)(this.get("line"),"style",{}),a=(0,tc.get)(this.get("text"),"style",{}),o=this.get("direction"),s=t?(0,tc.get)(this.get("line"),"length",0):0,l=o==="upward"?-1:1;return{point:E({x:0,y:0},n),line:E({path:[["M",0,0],["L",0,s*l]]},i),text:E({x:0,y:(s+2)*l,text:(0,tc.get)(this.get("text"),"content",""),textBaseline:o==="upward"?"bottom":"top"},a)}},e}(Yn),Aet=Yjt;var Jz=z(q());var Xjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:Gr.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:Gr.textColor,fontFamily:Gr.fontFamily}}}})},e.prototype.renderInner=function(t){var n=(0,Jz.get)(this.get("region"),"style",{}),i=(0,Jz.get)(this.get("text"),"style",{}),a=this.get("lineLength")||0,o=this.get("points");if(!!o.length){var s=met(o),l=[];l.push(["M",o[0].x,s.minY-a]),o.forEach(function(f){l.push(["L",f.x,f.y])}),l.push(["L",o[o.length-1].x,o[o.length-1].y-a]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:E({path:l},n)});var u=E({id:this.getElementId("text"),name:"annotation-text",x:(s.minX+s.maxX)/2,y:s.minY-a},this.get("text"));mm(t,u)}},e}(Yn),Met=Xjt;var gL=z(q());var qjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var n=this,i=this.get("start"),a=this.get("end"),o=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});(0,gL.each)(this.get("shapes"),function(l,u){var f=l.get("type"),c=(0,gL.clone)(l.attr());n.adjustShapeAttrs(c),n.addShape(o,{id:n.getElementId("shape-"+f+"-"+u),capture:!1,type:f,attrs:c})});var s=op({start:i,end:a});o.setClip({type:"rect",attrs:{x:s.minX,y:s.minY,width:s.width,height:s.height}})},e.prototype.adjustShapeAttrs=function(t){var n=this.get("color");t.fill&&(t.fill=t.fillStyle=n),t.stroke=t.strokeStyle=n},e}(Yn),Tet=qjt;var yL=z(q());var Kjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"shape",draw:yL.noop})},e.prototype.renderInner=function(t){var n=this.get("render");(0,yL.isFunction)(n)&&n(t)},e}(Yn),Iet=Kjt;var Wb=z(q());var $u=z(q());var Zjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{container:null,containerTpl:"
",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){var t=this.get("container");t.style.display="",this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("container");t.style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var n=this.getContainer(),i=t?"auto":"none";n.style.pointerEvents=i,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer(),n=parseFloat(t.style.left)||0,i=parseFloat(t.style.top)||0;return Ub(n,i,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){var t=this.get("container");zb(t)},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),r.prototype.destroy.call(this)},e.prototype.init=function(){r.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if((0,$u.isNil)(t)){t=this.createDom();var n=this.get("parent");(0,$u.isString)(n)&&(n=document.getElementById(n),this.set("parent",n)),n.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else(0,$u.isString)(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),n=this.get("defaultStyles");t?t=(0,$u.deepMix)({},n,t):t=n,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(!!t){var n=this.getContainer();this.applyChildrenStyles(n,t);var i=this.get("containerClassName");if(i&&vet(n,i)){var a=t[i];yr(n,a)}}},e.prototype.applyChildrenStyles=function(t,n){(0,$u.each)(n,function(i,a){var o=t.getElementsByClassName(a);(0,$u.each)(o,function(s){yr(s,i)})})},e.prototype.applyStyle=function(t,n){var i=this.get("domStyles");yr(n,i[t])},e.prototype.createDom=function(){var t=this.get("containerTpl");return en(t)},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){(0,$u.hasKey)(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(jb),gm=Zjt;var $jt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),n=this.get("html");zb(t);var i=(0,Wb.isFunction)(n)?n(t):n;(0,Wb.isElement)(i)?t.appendChild(i):(0,Wb.isString)(i)&&t.appendChild(en(i)),this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),n=this.getLocation(),i=n.x,a=n.y,o=this.get("alignX"),s=this.get("alignY"),l=this.get("offsetX"),u=this.get("offsetY"),f=d2(t),c=c2(t),h={x:i,y:a};o==="middle"?h.x-=Math.round(f/2):o==="right"&&(h.x-=Math.round(f)),s==="middle"?h.y-=Math.round(c/2):s==="bottom"&&(h.y-=Math.round(c)),l&&(h.x+=l),u&&(h.y+=u),yr(t,{position:"absolute",left:h.x+"px",top:h.y+"px",zIndex:this.get("zIndex")})},e}(gm),Let=$jt;var aE={};Dn(aE,{Base:()=>Vb,Circle:()=>Get,Line:()=>Bet});var kl=z(q());var Xn=z(q());var xL=z(q());function r0(r,e,t){var n=e+"Style",i=null;return(0,xL.each)(t,function(a,o){r[o]&&a[n]&&(i||(i={}),(0,xL.mix)(i,a[n]))}),i}var Qjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:Gr.lineColor}},tickLine:{style:{lineWidth:1,stroke:Gr.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:Gr.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:Gr.textColor,fontFamily:Gr.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:Gr.textColor,textBaseline:"middle",fontFamily:Gr.fontFamily,textAlign:"center"}},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:Gr.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,n){(0,Xn.mix)(t,n),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,n,i){t[n]=i,this.updateTickStates(t)},e.prototype.hasState=function(t,n){return!!t[n]},e.prototype.getItemStates=function(t){var n=this.get("tickStates"),i=[];return(0,Xn.each)(n,function(a,o){t[o]&&i.push(o)}),i},e.prototype.clearItemsState=function(t){var n=this,i=this.getItemsByState(t);(0,Xn.each)(i,function(a){n.setItemState(a,t,!1)})},e.prototype.getItemsByState=function(t){var n=this,i=this.getItems();return(0,Xn.filter)(i,function(a){return n.hasState(a,t)})},e.prototype.getSidePoint=function(t,n){var i=this,a=i.getSideVector(n,t);return{x:t.x+a[0],y:t.y+a[1]}},e.prototype.getTextAnchor=function(t){var n;return(0,Xn.isNumberEqual)(t[0],0)?n="center":t[0]>0?n="start":t[0]<0&&(n="end"),n},e.prototype.getTextBaseline=function(t){var n;return(0,Xn.isNumberEqual)(t[1],0)?n="middle":t[1]>0?n="top":t[1]<0&&(n="bottom"),n},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var n=this.getLinePath(),i=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:(0,Xn.mix)({path:n},i.style)})},e.prototype.getTickLineItems=function(t){var n=this,i=[],a=this.get("tickLine"),o=a.alignTick,s=a.length,l=1,u=t.length;return u>=2&&(l=t[1].value-t[0].value),(0,Xn.each)(t,function(f){var c=f.point;o||(c=n.getTickPoint(f.value-l/2));var h=n.getSidePoint(c,s);i.push({startPoint:c,tickValue:f.value,endPoint:h,tickId:f.id,id:"tickline-"+f.id})}),i},e.prototype.getSubTickLineItems=function(t){var n=[],i=this.get("subTickLine"),a=i.count,o=t.length;if(o>=2)for(var s=0;s0){var i=(0,Xn.size)(n);if(i>t.threshold){var a=Math.ceil(i/t.threshold),o=n.filter(function(s,l){return l%a==0});this.set("ticks",o),this.set("originalTicks",n)}}},e.prototype.getLabelAttrs=function(t,n,i){var a=this.get("label"),o=a.offset,s=a.offsetX,l=a.offsetY,u=a.rotate,f=a.formatter,c=this.getSidePoint(t.point,o),h=this.getSideVector(o,c),d=f?f(t.name,t,n):t.name,p=a.style;p=(0,Xn.isFunction)(p)?(0,Xn.get)(this.get("theme"),["label","style"],{}):p;var v=(0,Xn.mix)({x:c.x+s,y:c.y+l,text:d,textAlign:this.getTextAnchor(h),textBaseline:this.getTextBaseline(h)},p);return u&&(v.matrix=Jf(c,u)),v},e.prototype.drawLabels=function(t){var n=this,i=this.get("ticks"),a=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});(0,Xn.each)(i,function(h,d){n.addShape(a,{type:"text",name:"axis-label",id:n.getElementId("label-"+h.id),attrs:n.getLabelAttrs(h,d,i),delegateObject:{tick:h,item:h,index:d}})}),this.processOverlap(a);var o=a.getChildren(),s=(0,Xn.get)(this.get("theme"),["label","style"],{}),l=this.get("label"),u=l.style,f=l.formatter;if((0,Xn.isFunction)(u)){var c=o.map(function(h){return(0,Xn.get)(h.get("delegateObject"),"tick")});(0,Xn.each)(o,function(h,d){var p=h.get("delegateObject").tick,v=f?f(p.name,p,d):p.name,m=(0,Xn.mix)({},s,u(v,d,c));h.attr(m)})}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),n=t.style,i=t.position,a=t.offset,o=t.spacing,s=o===void 0?0:o,l=t.autoRotate,u=n.fontSize,f=.5;i==="start"?f=0:i==="end"&&(f=1);var c=this.getTickPoint(f),h=this.getSidePoint(c,a||s+u/2),d=(0,Xn.mix)({x:h.x,y:h.y,text:t.text},n),p=t.rotate,v=p;if((0,Xn.isNil)(p)&&l){var m=this.getAxisVector(c),g=[1,0];v=gr.angleTo(m,g,!0)}if(v){var x=Jf(h,v);d.matrix=x}return d},e.prototype.drawTitle=function(t){this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:this.getTitleAttrs()})},e.prototype.applyTickStates=function(t,n){var i=this.getItemStates(t);if(i.length){var a=this.get("tickStates"),o=this.getElementId("label-"+t.id),s=n.findById(o);if(s){var l=r0(t,"label",a);l&&s.attr(l)}var u=this.getElementId("tickline-"+t.id),f=n.findById(u);if(f){var c=r0(t,"tickLine",a);c&&f.attr(c)}}},e.prototype.updateTickStates=function(t){var n=this.getItemStates(t),i=this.get("tickStates"),a=this.get("label"),o=this.getElementByLocalId("label-"+t.id),s=this.get("tickLine"),l=this.getElementByLocalId("tickline-"+t.id);if(n.length){if(o){var u=r0(t,"label",i);u&&o.attr(u)}if(l){var f=r0(t,"tickLine",i);f&&l.attr(f)}}else o&&o.attr(a.style),l&&l.attr(s.style)},e}(Yn),Vb=Qjt;var iE={};Dn(iE,{autoEllipsis:()=>eU,autoHide:()=>nU,autoRotate:()=>iU});var eU={};Dn(eU,{ellipsisHead:()=>tWt,ellipsisMiddle:()=>eWt,ellipsisTail:()=>Det,getDefault:()=>Jjt});var Oet=z(q());function tU(r,e,t,n){var i=e.getChildren(),a=!1;return(0,Oet.each)(i,function(o){var s=vm(r,o,t,n);a=a||s}),a}function Jjt(){return Det}function tWt(r,e,t){return tU(r,e,t,"head")}function Det(r,e,t){return tU(r,e,t,"tail")}function eWt(r,e,t){return tU(r,e,t,"middle")}var nU={};Dn(nU,{equidistance:()=>Ret,equidistanceWithReverseBoth:()=>sWt,getDefault:()=>nWt,reserveBoth:()=>oWt,reserveFirst:()=>iWt,reserveLast:()=>aWt});function rWt(r){var e=r.attr("matrix");return e&&e[0]!==1}function Pet(r){var e=rWt(r)?det(r.attr("matrix")):0;return e%360}function rU(r,e,t,n){var i=!1,a=Pet(e),o=Math.abs(r?t.attr("y")-e.attr("y"):t.attr("x")-e.attr("x")),s=(r?t.attr("y")>e.attr("y"):t.attr("x")>e.attr("x"))?e.getBBox():t.getBBox();if(r){var l=Math.abs(Math.cos(a));tE(l,0,Math.PI/180)?i=s.width+n>o:i=s.height/l+n>o}else{var l=Math.abs(Math.sin(a));tE(l,0,Math.PI/180)?i=s.width+n>o:i=s.height/l+n>o}return i}function nE(r,e,t,n){var i=(n==null?void 0:n.minGap)||0,a=e.getChildren().slice().filter(function(p){return p.get("visible")});if(!a.length)return!1;var o=!1;t&&a.reverse();for(var s=a.length,l=a[0],u=l,f=1;f1){h=Math.ceil(h);for(var v=0;v2){var o=i[0],s=i[i.length-1];o.get("visible")||(o.show(),nE(r,e,!1,n)&&(a=!0)),s.get("visible")||(s.show(),nE(r,e,!0,n)&&(a=!0))}return a}var iU={};Dn(iU,{fixedAngle:()=>Fet,getDefault:()=>uWt,unfixedAngle:()=>fWt});var bL=z(q());function lWt(r,e){(0,bL.each)(r,function(t){var n=t.attr("x"),i=t.attr("y"),a=Jf({x:n,y:i},e);t.attr("matrix",a)})}function Net(r,e,t,n){var i=e.getChildren();if(!i.length||!r&&i.length<2)return!1;var a=eE(i),o=!1;if(r)o=!!t&&a>t;else{var s=Math.abs(i[1].attr("x")-i[0].attr("x"));o=a>s}if(o){var l=n(t,a);lWt(i,l)}return o}function uWt(){return Fet}function Fet(r,e,t,n){return Net(r,e,t,function(){return(0,bL.isNumber)(n)?n:r?Gr.verticalAxisRotate:Gr.horizontalAxisRotate})}function fWt(r,e,t){return Net(r,e,t,function(n,i){if(!n)return r?Gr.verticalAxisRotate:Gr.horizontalAxisRotate;if(r)return-Math.acos(n/i);var a=0;return n>i?a=Math.PI/4:(a=Math.asin(n/i),a>Math.PI/4&&(a=Math.PI/4)),a})}var cWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),n=this.get("end"),i=[];return i.push(["M",t.x,t.y]),i.push(["L",n.x,n.y]),i},e.prototype.getInnerLayoutBBox=function(){var t=this.get("start"),n=this.get("end"),i=r.prototype.getInnerLayoutBBox.call(this),a=Math.min(t.x,n.x,i.x),o=Math.min(t.y,n.y,i.y),s=Math.max(t.x,n.x,i.maxX),l=Math.max(t.y,n.y,i.maxY);return{x:a,y:o,minX:a,minY:o,maxX:s,maxY:l,width:s-a,height:l-o}},e.prototype.isVertical=function(){var t=this.get("start"),n=this.get("end");return(0,kl.isNumberEqual)(t.x,n.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),n=this.get("end");return(0,kl.isNumberEqual)(t.y,n.y)},e.prototype.getTickPoint=function(t){var n=this,i=n.get("start"),a=n.get("end"),o=a.x-i.x,s=a.y-i.y;return{x:i.x+o*t,y:i.y+s*t}},e.prototype.getSideVector=function(t){var n=this.getAxisVector(),i=oe.normalize([0,0],n),a=this.get("verticalFactor"),o=[i[1],i[0]*-1];return oe.scale([0,0],o,t*a)},e.prototype.getAxisVector=function(){var t=this.get("start"),n=this.get("end");return[n.x-t.x,n.y-t.y]},e.prototype.processOverlap=function(t){var n=this,i=this.isVertical(),a=this.isHorizontal();if(!(!i&&!a)){var o=this.get("label"),s=this.get("title"),l=this.get("verticalLimitLength"),u=o.offset,f=l,c=0,h=0;s&&(c=s.style.fontSize,h=s.spacing),f&&(f=f-u-h-c);var d=this.get("overlapOrder");if((0,kl.each)(d,function(m){o[m]&&n.canProcessOverlap(m)&&n.autoProcessOverlap(m,o[m],t,f)}),s&&(0,kl.isNil)(s.offset)){var p=t.getCanvasBBox(),v=i?p.width:p.height;s.offset=u+v+h+c/2}}},e.prototype.canProcessOverlap=function(t){var n=this.get("label");return t==="autoRotate"?(0,kl.isNil)(n.rotate):!0},e.prototype.autoProcessOverlap=function(t,n,i,a){var o=this,s=this.isVertical(),l=!1,u=iE[t];if(n===!0){var f=this.get("label");l=u.getDefault()(s,i,a)}else if((0,kl.isFunction)(n))l=n(s,i,a);else if((0,kl.isObject)(n)){var c=n;u[c.type]&&(l=u[c.type](s,i,a,c.cfg))}else u[n]&&(l=u[n](s,i,a));if(t==="autoRotate"){if(l){var h=i.getChildren(),d=this.get("verticalFactor");(0,kl.each)(h,function(v){var m=v.attr("textAlign");if(m==="center"){var g=d>0?"end":"start";v.attr("textAlign",g)}})}}else if(t==="autoHide"){var p=i.getChildren().slice(0);(0,kl.each)(p,function(v){v.get("visible")||(o.get("isRegister")&&o.unregisterElement(v),v.remove())})}},e}(Vb),Bet=cWt;var ec=z(q());var hWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getLinePath=function(){var t=this.get("center"),n=t.x,i=t.y,a=this.get("radius"),o=a,s=this.get("startAngle"),l=this.get("endAngle"),u=[];if(Math.abs(l-s)===Math.PI*2)u=[["M",n,i-o],["A",a,o,0,1,1,n,i+o],["A",a,o,0,1,1,n,i-o],["Z"]];else{var f=this.getCirclePoint(s),c=this.getCirclePoint(l),h=Math.abs(l-s)>Math.PI?1:0,d=s>l?0:1;u=[["M",n,i],["L",f.x,f.y],["A",a,o,0,h,d,c.x,c.y],["L",n,i]]}return u},e.prototype.getTickPoint=function(t){var n=this.get("startAngle"),i=this.get("endAngle"),a=n+(i-n)*t;return this.getCirclePoint(a)},e.prototype.getSideVector=function(t,n){var i=this.get("center"),a=[n.x-i.x,n.y-i.y],o=this.get("verticalFactor"),s=oe.length(a);return oe.scale(a,a,o*t/s),a},e.prototype.getAxisVector=function(t){var n=this.get("center"),i=[t.x-n.x,t.y-n.y];return[i[1],-1*i[0]]},e.prototype.getCirclePoint=function(t,n){var i=this.get("center");return n=n||this.get("radius"),{x:i.x+Math.cos(t)*n,y:i.y+Math.sin(t)*n}},e.prototype.canProcessOverlap=function(t){var n=this.get("label");return t==="autoRotate"?(0,ec.isNil)(n.rotate):!0},e.prototype.processOverlap=function(t){var n=this,i=this.get("label"),a=this.get("title"),o=this.get("verticalLimitLength"),s=i.offset,l=o,u=0,f=0;a&&(u=a.style.fontSize,f=a.spacing),l&&(l=l-s-f-u);var c=this.get("overlapOrder");if((0,ec.each)(c,function(d){i[d]&&n.canProcessOverlap(d)&&n.autoProcessOverlap(d,i[d],t,l)}),a&&(0,ec.isNil)(a.offset)){var h=t.getCanvasBBox().height;a.offset=s+h+f+u/2}},e.prototype.autoProcessOverlap=function(t,n,i,a){var o=this,s=!1,l=iE[t];if(a>0)if(n===!0)s=l.getDefault()(!1,i,a);else if((0,ec.isFunction)(n))s=n(!1,i,a);else if((0,ec.isObject)(n)){var u=n;l[u.type]&&(s=l[u.type](!1,i,a,u.cfg))}else l[n]&&(s=l[n](!1,i,a));if(t==="autoRotate"){if(s){var f=i.getChildren(),c=this.get("verticalFactor");(0,ec.each)(f,function(d){var p=d.attr("textAlign");if(p==="center"){var v=c>0?"end":"start";d.attr("textAlign",v)}})}}else if(t==="autoHide"){var h=i.getChildren().slice(0);(0,ec.each)(h,function(d){d.get("visible")||(o.get("isRegister")&&o.unregisterElement(d),d.remove())})}},e}(Vb),Get=hWt;var i0={};Dn(i0,{Base:()=>Hb,Circle:()=>jet,Html:()=>Vet,Line:()=>Uet});var zet=z(q());var dWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:Gr.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:Gr.textColor,textAlign:"center",textBaseline:"middle",fontFamily:Gr.fontFamily}},textBackground:{padding:5,style:{stroke:Gr.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var n=this.get("text"),i=n.style,a=n.autoRotate,o=n.content;if(!(0,zet.isNil)(o)){var s=this.getTextPoint(),l=null;if(a){var u=this.getRotateAngle();l=Jf(s,u)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:E(E(E({},s),{text:o,matrix:l}),i)})}},e.prototype.renderLine=function(t){var n=this.getLinePath(),i=this.get("line"),a=i.style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:E({path:n},a)})},e.prototype.renderBackground=function(t){var n=this.getElementId("text"),i=t.findById(n),a=this.get("textBackground");if(a&&i){var o=i.getBBox(),s=Jy(a.padding),l=a.style,u=this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:E({x:o.x-s[3],y:o.y-s[0],width:o.width+s[1]+s[3],height:o.height+s[0]+s[2],matrix:i.attr("matrix")},l)});u.toBack()}},e}(Yn),Hb=dWt;var pWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),n=t.start,i=t.end,a=this.get("text").position,o=Math.atan2(i.y-n.y,i.x-n.x),s=a==="start"?o-Math.PI/2:o+Math.PI/2;return s},e.prototype.getTextPoint=function(){var t=this.getLocation(),n=t.start,i=t.end,a=this.get("text"),o=a.position,s=a.offset;return vL(n,i,o,s)},e.prototype.getLinePath=function(){var t=this.getLocation(),n=t.start,i=t.end;return[["M",n.x,n.y],["L",i.x,i.y]]},e}(Hb),Uet=pWt;var vWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),n=t.startAngle,i=t.endAngle,a=this.get("text").position,o=a==="start"?n+Math.PI/2:i-Math.PI/2;return o},e.prototype.getTextPoint=function(){var t=this.get("text"),n=t.position,i=t.offset,a=this.getLocation(),o=a.center,s=a.radius,l=a.startAngle,u=a.endAngle,f=n==="start"?l:u,c=this.getRotateAngle()-Math.PI,h=dm(o,s,f),d=Math.cos(c)*i,p=Math.sin(c)*i;return{x:h.x+d,y:h.y+p}},e.prototype.getLinePath=function(){var t=this.getLocation(),n=t.center,i=t.radius,a=t.startAngle,o=t.endAngle,s=null;if(o-a==Math.PI*2){var l=n.x,u=n.y;s=[["M",l,u-i],["A",i,i,0,1,1,l,u+i],["A",i,i,0,1,1,l,u-i],["Z"]]}else{var f=dm(n,i,a),c=dm(n,i,o),h=Math.abs(o-a)>Math.PI?1:0,d=a>o?0:1;s=[["M",f.x,f.y],["A",i,i,0,h,d,c.x,c.y]]}return s},e}(Hb),jet=vWt;var _L=z(q());var n0="g2-crosshair",oE=n0+"-line",sE=n0+"-text";var lE,Wet=(lE={},lE[""+n0]={position:"relative"},lE[""+oE]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},lE[""+sE]={position:"absolute",color:Gr.textColor,fontFamily:Gr.fontFamily},lE);var mWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'
',crosshairTpl:'
',textTpl:'{content}',domStyles:null,containerClassName:n0,defaultStyles:Wet,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),n=this.get("crosshairTpl"),i=en(n);t.appendChild(i),this.applyStyle(oE,i),this.set("crosshairEl",i)},e.prototype.getTextPoint=function(){var t=this.getLocation(),n=t.start,i=t.end,a=this.get("text"),o=a.position,s=a.offset;return vL(n,i,o,s)},e.prototype.resetText=function(){var t=this.get("text"),n=this.get("textEl");if(t){var i=t.content;if(!n){var a=this.getContainer(),o=(0,_L.substitute)(this.get("textTpl"),t);n=en(o),a.appendChild(n),this.applyStyle(sE,n),this.set("textEl",n)}n.innerHTML=i}else n&&n.remove()},e.prototype.isVertical=function(t,n){return t.x===n.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var n=this.get("start"),i=this.get("end"),a=Math.min(n.x,i.x),o=Math.min(n.y,i.y);this.isVertical(n,i)?yr(t,{width:"1px",height:As(Math.abs(i.y-n.y))}):yr(t,{height:"1px",width:As(Math.abs(i.x-n.x))}),yr(t,{top:As(o),left:As(a)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var n=this.get("text").align,i=t.clientWidth,a=this.getTextPoint();switch(n){case"center":a.x=a.x-i/2;break;case"right":a.x=a.x-i;case"left":break}yr(t,{top:As(a.y),left:As(a.x)})}},e.prototype.updateInner=function(t){(0,_L.hasKey)(t,"text")&&this.resetText(),r.prototype.updateInner.call(this,t)},e}(gm),Vet=mWt;var uE={};Dn(uE,{Base:()=>Yb,Circle:()=>Het,Line:()=>Xet});var ym=z(q());var gWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:Gr.lineColor}}}})},e.prototype.getLineType=function(){var t=this.get("line")||this.get("defaultCfg").line;return t.type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,n){var i=this.getGridPath(t),a=n.slice(0).reverse(),o=this.getGridPath(a,!0),s=this.get("closed");return s?i=i.concat(o):(o[0][0]="L",i=i.concat(o),i.push(["Z"])),i},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var n=this,i=this.get("line"),a=this.get("items"),o=this.get("alternateColor"),s=null;(0,ym.each)(a,function(l,u){var f=l.id||u;if(i){var c=n.getPathStyle();c=(0,ym.isFunction)(c)?c(l,u,a):c;var h=n.getElementId("line-"+f),d=n.getGridPath(l.points);n.addShape(t,{type:"path",name:"grid-line",id:h,attrs:(0,ym.mix)({path:d},c)})}if(o&&u>0){var p=n.getElementId("region-"+f),v=u%2==0;if((0,ym.isString)(o))v&&n.drawAlternateRegion(p,t,s.points,l.points,o);else{var m=v?o[1]:o[0];n.drawAlternateRegion(p,t,s.points,l.points,m)}}s=l})},e.prototype.drawAlternateRegion=function(t,n,i,a,o){var s=this.getAlternatePath(i,a);this.addShape(n,{type:"path",id:t,name:"grid-region",attrs:{path:s,fill:o}})},e}(Yn),Yb=gWt;var aU=z(q());function yWt(r,e,t,n){var i=t-r,a=n-e;return Math.sqrt(i*i+a*a)}var xWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,n){var i=this.getLineType(),a=this.get("closed"),o=[];if(t.length)if(i==="circle"){var s=this.get("center"),l=t[0],u=yWt(s.x,s.y,l.x,l.y),f=n?0:1;a?(o.push(["M",s.x,s.y-u]),o.push(["A",u,u,0,0,f,s.x,s.y+u]),o.push(["A",u,u,0,0,f,s.x,s.y-u]),o.push(["Z"])):(0,aU.each)(t,function(c,h){h===0?o.push(["M",c.x,c.y]):o.push(["A",u,u,0,0,f,c.x,c.y])})}else(0,aU.each)(t,function(c,h){h===0?o.push(["M",c.x,c.y]):o.push(["L",c.x,c.y])}),a&&o.push(["Z"]);return o},e}(Yb),Het=xWt;var Yet=z(q());var bWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"line"})},e.prototype.getGridPath=function(t){var n=[];return(0,Yet.each)(t,function(i,a){a===0?n.push(["M",i.x,i.y]):n.push(["L",i.x,i.y])}),n},e}(Yb),Xet=bWt;var fE={};Dn(fE,{Base:()=>Xb,Category:()=>Ket,Continuous:()=>$et});var _i=z(q());var _Wt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var t=r.prototype.getLayoutBBox.call(this),n=this.get("maxWidth"),i=this.get("maxHeight"),a=t.width,o=t.height;return n&&(a=Math.min(a,n)),i&&(o=Math.min(o,i)),Ub(t.minX,t.minY,a,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),n=this.get("y"),i=this.get("offsetX"),a=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+i,y:n+a})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var n=this.get("background"),i=t.getBBox(),a=Jy(n.padding),o=E({x:0,y:0,width:i.width+a[1]+a[3],height:i.height+a[0]+a[2]},n.style),s=this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:o});s.toBack()},e.prototype.drawTitle=function(t){var n=this.get("currentPoint"),i=this.get("title"),a=i.spacing,o=i.style,s=i.text,l=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:E({text:s,x:n.x,y:n.y},o)}),u=l.getBBox();this.set("currentPoint",{x:n.x,y:u.maxY+a})},e.prototype.resetDraw=function(){var t=this.get("background"),n={x:0,y:0};if(t){var i=Jy(t.padding);n.x=i[3],n.y=i[0]}this.set("currentPoint",n)},e}(Yn),Xb=_Wt;var oU={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},SL={fill:Gr.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:Gr.fontFamily,fontWeight:"normal",lineHeight:12},sU="navigation-arrow-right",lU="navigation-arrow-left",qet={right:90*Math.PI/180,left:(360-90)*Math.PI/180,up:0,down:180*Math.PI/180},SWt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.currentPageIndex=1,t.totalPagesCnt=1,t.pageWidth=0,t.pageHeight=0,t.startX=0,t.startY=0,t.onNavigationBack=function(){var n=t.getElementByLocalId("item-group");if(t.currentPageIndex>1){t.currentPageIndex-=1,t.updateNavigation();var i=t.getCurrentNavigationMatrix();t.get("animate")?n.animate({matrix:i},100):n.attr({matrix:i})}},t.onNavigationAfter=function(){var n=t.getElementByLocalId("item-group");if(t.currentPageIndexm&&(m=A),d==="horizontal"?(g&&gS&&(S=M.width)}),C=S,S+=h,u&&(S=Math.min(u,S),C=Math.min(u,C)),this.pageWidth=S,this.pageHeight=f-Math.max(m.height,d+w);var k=Math.floor(this.pageHeight/(d+w));(0,_i.each)(l,function(O,M){M!==0&&M%k==0&&(x+=1,g.x+=S,g.y=o),i.moveElementTo(O,g),O.getParent().setClip({type:"rect",attrs:{x:g.x,y:g.y,width:S,height:d}}),g.y+=d+w}),this.totalPagesCnt=x,this.moveElementTo(v,{x:a+C/2-m.width/2-m.minX,y:f-m.height-m.minY})}this.pageHeight&&this.pageWidth&&n.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),s==="horizontal"&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(x/this.get("maxRow")):this.totalPagesCnt=x,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(v),n.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,n,i,a){var o={x:0,y:0},s=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),l=(0,_i.get)(a.marker,"style",{}),u=l.size,f=u===void 0?12:u,c=rr(l,["size"]),h=this.drawArrow(s,o,lU,n==="horizontal"?"up":"left",f,c);h.on("click",this.onNavigationBack);var d=h.getBBox();o.x+=d.width+2;var p=this.addShape(s,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:E({x:o.x,y:o.y+f/2,text:i,textBaseline:"middle"},(0,_i.get)(a.text,"style"))}),v=p.getBBox();o.x+=v.width+2;var m=this.drawArrow(s,o,sU,n==="horizontal"?"down":"right",f,c);return m.on("click",this.onNavigationAfter),s},e.prototype.updateNavigation=function(t){var n=(0,_i.deepMix)({},oU,this.get("pageNavigator")),i=n.marker.style,a=i.fill,o=i.opacity,s=i.inactiveFill,l=i.inactiveOpacity,u=this.currentPageIndex+"/"+this.totalPagesCnt,f=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),c=t?t.findById(this.getElementId(lU)):this.getElementByLocalId(lU),h=t?t.findById(this.getElementId(sU)):this.getElementByLocalId(sU);f.attr("text",u),c.attr("opacity",this.currentPageIndex===1?l:o),c.attr("fill",this.currentPageIndex===1?s:a),c.attr("cursor",this.currentPageIndex===1?"not-allowed":"pointer"),h.attr("opacity",this.currentPageIndex===this.totalPagesCnt?l:o),h.attr("fill",this.currentPageIndex===this.totalPagesCnt?s:a),h.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var d=c.getBBox().maxX+2;f.attr("x",d),d+=f.getBBox().width+2,this.updateArrowPath(h,{x:d,y:0})},e.prototype.drawArrow=function(t,n,i,a,o,s){var l=n.x,u=n.y,f=this.addShape(t,{type:"path",id:this.getElementId(i),name:i,attrs:E({size:o,direction:a,path:[["M",l+o/2,u],["L",l,u+o],["L",l+o,u+o],["Z"]],cursor:"pointer"},s)});return f.attr("matrix",Jf({x:l+o/2,y:u+o/2},qet[a])),f},e.prototype.updateArrowPath=function(t,n){var i=n.x,a=n.y,o=t.attr(),s=o.size,l=o.direction,u=Jf({x:i+s/2,y:a+s/2},qet[l]);t.attr("path",[["M",i+s/2,a],["L",i,a+s],["L",i+s,a+s],["Z"]]),t.attr("matrix",u)},e.prototype.getCurrentNavigationMatrix=function(){var t=this,n=t.currentPageIndex,i=t.pageWidth,a=t.pageHeight,o=this.get("layout"),s=o==="horizontal"?{x:0,y:a*(1-n)}:{x:i*(1-n),y:0};return Jw(s)},e.prototype.applyItemStates=function(t,n){var i=this.getItemStates(t),a=i.length>0;if(a){var o=n.getChildren(),s=this.get("itemStates");(0,_i.each)(o,function(l){var u=l.get("name"),f=u.split("-")[2],c=r0(t,f,s);c&&(l.attr(c),f==="marker"&&!(l.get("isStroke")&&l.get("isFill"))&&(l.get("isStroke")&&l.attr("fill",null),l.get("isFill")&&l.attr("stroke",null)))})}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),n=this.get("maxItemWidth");return n?t&&(n=t<=n?t:n):t&&(n=t),n},e}(Xb),Ket=SWt;var xm=z(q());var CWt=1.4,Zet=.4,wWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:Gr.textColor,textBaseline:"middle",fontFamily:Gr.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:Gr.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,n){this.update({min:t,max:n})},e.prototype.setValue=function(t){var n=this.getValue();this.set("value",t);var i=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(i),this.delegateEmit("valuechanged",{originValue:n,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var n=this;t.on("legend-handler-min:drag",function(i){var a=n.getValueByCanvasPoint(i.x,i.y),o=n.getCurrentValue(),s=o[1];sa&&(s=a),n.setValue([s,a])})},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var n=this,i=null;t.on("legend-track:dragstart",function(a){i={x:a.x,y:a.y}}),t.on("legend-track:drag",function(a){if(!!i){var o=n.getValueByCanvasPoint(i.x,i.y),s=n.getValueByCanvasPoint(a.x,a.y),l=n.getCurrentValue(),u=l[1]-l[0],f=n.getRange(),c=s-o;c<0?l[0]+c>f.min?n.setValue([l[0]+c,l[1]+c]):n.setValue([f.min,f.min+u]):c>0&&(c>0&&l[1]+co&&(c=o),c0&&this.changeRailLength(a,s,i[s]-d)}},e.prototype.changeRailLength=function(t,n,i){var a=t.getBBox(),o;n==="height"?o=this.getRailPath(a.x,a.y,a.width,i):o=this.getRailPath(a.x,a.y,i,a.height),t.attr("path",o)},e.prototype.changeRailPosition=function(t,n,i){var a=t.getBBox(),o=this.getRailPath(n,i,a.width,a.height);t.attr("path",o)},e.prototype.fixedHorizontal=function(t,n,i,a){var o=this.get("label"),s=o.align,l=o.spacing,u=i.getBBox(),f=t.getBBox(),c=n.getBBox(),h=u.height;this.fitRailLength(f,c,u,i),u=i.getBBox(),s==="rail"?(t.attr({x:a.x,y:a.y+h/2}),this.changeRailPosition(i,a.x+f.width+l,a.y),n.attr({x:a.x+f.width+u.width+l*2,y:a.y+h/2})):s==="top"?(t.attr({x:a.x,y:a.y}),n.attr({x:a.x+u.width,y:a.y}),this.changeRailPosition(i,a.x,a.y+f.height+l)):(this.changeRailPosition(i,a.x,a.y),t.attr({x:a.x,y:a.y+u.height+l}),n.attr({x:a.x+u.width,y:a.y+u.height+l}))},e.prototype.fixedVertail=function(t,n,i,a){var o=this.get("label"),s=o.align,l=o.spacing,u=i.getBBox(),f=t.getBBox(),c=n.getBBox();if(this.fitRailLength(f,c,u,i),u=i.getBBox(),s==="rail")t.attr({x:a.x,y:a.y}),this.changeRailPosition(i,a.x,a.y+f.height+l),n.attr({x:a.x,y:a.y+f.height+u.height+l*2});else if(s==="right")t.attr({x:a.x+u.width+l,y:a.y}),this.changeRailPosition(i,a.x,a.y),n.attr({x:a.x+u.width+l,y:a.y+u.height});else{var h=Math.max(f.width,c.width);t.attr({x:a.x,y:a.y}),this.changeRailPosition(i,a.x+h+l,a.y),n.attr({x:a.x,y:a.y+u.height})}},e}(Xb),$et=wWt;var TL={};Dn(TL,{Html:()=>ert});var vh=z(q());var is={};Dn(is,{CONTAINER_CLASS:()=>cE,CROSSHAIR_X:()=>AL,CROSSHAIR_Y:()=>ML,LIST_CLASS:()=>dE,LIST_ITEM_CLASS:()=>CL,MARKER_CLASS:()=>wL,NAME_CLASS:()=>Qet,TITLE_CLASS:()=>hE,VALUE_CLASS:()=>EL});var cE="g2-tooltip",hE="g2-tooltip-title",dE="g2-tooltip-list",CL="g2-tooltip-list-item",wL="g2-tooltip-marker",EL="g2-tooltip-value",Qet="g2-tooltip-name",AL="g2-tooltip-crosshair-x",ML="g2-tooltip-crosshair-y";var ph,Jet=(ph={},ph[""+cE]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:Gr.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},ph[""+hE]={marginBottom:"4px"},ph[""+dE]={margin:"0px",listStyleType:"none",padding:"0px"},ph[""+CL]={listStyleType:"none",marginBottom:"4px"},ph[""+wL]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},ph[""+EL]={display:"inline-block",float:"right",marginLeft:"30px"},ph[""+AL]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ph[""+ML]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ph);function EWt(r,e,t,n,i){var a={left:ri.x+i.width,top:ei.y+i.height};return a}function AWt(r,e,t,n,i,a){var o=r,s=e;switch(a){case"left":o=r-n-t,s=e-i/2;break;case"right":o=r+t,s=e-i/2;break;case"top":o=r-n/2,s=e-i-t;break;case"bottom":o=r-n/2,s=e+t;break;default:o=r+t,s=e-i-t;break}return{x:o,y:s}}function trt(r,e,t,n,i,a,o){var s=AWt(r,e,t,n,i,a);if(o){var l=EWt(s.x,s.y,n,i,o);a==="auto"?(l.right&&(s.x=Math.max(0,r-n-t)),l.top&&(s.y=Math.max(0,e-i-t))):a==="top"||a==="bottom"?(l.left&&(s.x=o.x),l.right&&(s.x=o.x+o.width-n),a==="top"&&l.top&&(s.y=e+t),a==="bottom"&&l.bottom&&(s.y=e-i-t)):(l.top&&(s.y=o.y),l.bottom&&(s.y=o.y+o.height-i),a==="left"&&l.left&&(s.x=r+t),a==="right"&&l.right&&(s.x=r-n-t))}return s}function MWt(r,e){var t=!1;return(0,vh.each)(e,function(n){if((0,vh.hasKey)(r,n))return t=!0,!1}),t}var TWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'
    ',itemTpl:'
  • {name}: {value}
  • `,xCrosshairTpl:'
    ',yCrosshairTpl:'
    ',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:cE,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:Jet})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!0),yr(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!1),yr(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var n=t?"":"none",i=this.get("xCrosshairDom"),a=this.get("yCrosshairDom");i&&yr(i,{display:n}),a&&yr(a,{display:n})},e.prototype.initContainer=function(){if(r.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var t=this.getHtmlContentNode();this.get("parent").appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()}},e.prototype.updateInner=function(t){this.get("customContent")?this.renderCustomContent():(MWt(t,["title","showTitle"])&&this.resetTitle(),(0,vh.hasKey)(t,"items")&&this.renderItems()),r.prototype.updateInner.call(this,t)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){r.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t=this.get("x"),n=this.get("y"),i=this.get("offset"),a=this.getOffset(),o=a.offsetX,s=a.offsetY,l=this.get("position"),u=this.get("region"),f=this.getContainer(),c=this.getBBox(),h=c.width,d=c.height,p;u&&(p=op(u));var v=trt(t,n,i,h,d,l,p);yr(f,{left:As(v.x+o),top:As(v.y+s)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),n=this.get("parent"),i=this.get("container");i&&i.parentNode===n?n.replaceChild(t,i):n.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,n=this.get("customContent");if(n){var i=n(this.get("title"),this.get("items"));(0,vh.isElement)(i)?t=i:t=en(i)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),n=t.getElementsByClassName(hE)[0],i=t.getElementsByClassName(dE)[0];this.set("titleDom",n),this.set("listDom",i)},e.prototype.resetTitle=function(){var t=this.get("title"),n=this.get("showTitle");n&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var n=this.get("titleDom");n&&(n.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),n=this.get("crosshairs");if(!t||!n)this.clearCrosshairs();else{var i=op(t),a=this.get("xCrosshairDom"),o=this.get("yCrosshairDom");n==="x"?(this.resetCrosshair("x",i),o&&(o.remove(),this.set("yCrosshairDom",null))):n==="y"?(this.resetCrosshair("y",i),a&&(a.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",i),this.resetCrosshair("y",i)),this.setCrossHairsVisible(this.get("visible"))}},e.prototype.resetCrosshair=function(t,n){var i=this.checkCrosshair(t),a=this.get(t);t==="x"?yr(i,{left:As(a),top:As(n.y),height:As(n.height)}):yr(i,{top:As(a),left:As(n.x),width:As(n.width)})},e.prototype.checkCrosshair=function(t){var n=t+"CrosshairDom",i=t+"CrosshairTpl",a="CROSSHAIR_"+t.toUpperCase(),o=is[a],s=this.get(n),l=this.get("parent");return s||(s=en(this.get(i)),this.applyStyle(o,s),l.appendChild(s),this.set(n,s)),s},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),n=this.get("itemTpl"),i=this.get("listDom");i&&((0,vh.each)(t,function(a){var o=gu.toCSSGradient(a.color),s=E(E({},a),{color:o}),l=(0,vh.substitute)(n,s),u=en(l);i.appendChild(u)}),this.applyChildrenStyles(i,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&zb(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),n=this.get("yCrosshairDom");t&&t.remove(),n&&n.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(gm),ert=TWt;var Si=z(q());var rrt={opacity:0},nrt={stroke:"#C5C5C5",strokeOpacity:.85},irt={fill:"#CACED4",opacity:.85};var mh=z(q());function IWt(r){return(0,mh.map)(r,function(e,t){var n=t===0?"M":"L",i=e[0],a=e[1];return[n,i,a]})}function art(r){return IWt(r)}function LWt(r){if(r.length<=2)return art(r);var e=[];(0,mh.each)(r,function(o){(0,mh.isEqual)(o,e.slice(e.length-2))||e.push(o[0],o[1])});var t=Hy(e,!1),n=(0,mh.head)(r),i=n[0],a=n[1];return t.unshift(["M",i,a]),t}function ort(r,e,t,n){n===void 0&&(n=!0);var i=new Qf({values:r}),a=new sh({values:(0,mh.map)(r,function(s,l){return l})}),o=(0,mh.map)(r,function(s,l){return[a.scale(l)*e,t-i.scale(s)*t]});return n?LWt(o):art(o)}function OWt(r,e){var t=new Qf({values:r}),n=Math.max(0,t.min);return e-t.scale(n)*e}function srt(r,e,t,n){var i=dn(r),a=OWt(n,t);return i.push(["L",e,a]),i.push(["L",0,a]),i.push(["Z"]),i}var lrt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:rrt,lineStyle:nrt,areaStyle:irt})},e.prototype.renderInner=function(t){var n=this.cfg,i=n.width,a=n.height,o=n.data,s=n.smooth,l=n.isArea,u=n.backgroundStyle,f=n.lineStyle,c=n.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:E({x:0,y:0,width:i,height:a},u)});var h=ort(o,i,a,s);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:E({path:h},f)}),l){var d=srt(h,i,a,o);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:E({path:d},c)})}},e.prototype.applyOffset=function(){var t=this.cfg,n=t.x,i=t.y;this.moveElementTo(this.get("group"),{x:n,y:i})},e}(Yn);var uU={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},fU=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"handler",x:0,y:0,width:10,height:24,style:uU})},e.prototype.renderInner=function(t){var n=this.cfg,i=n.width,a=n.height,o=n.style,s=o.fill,l=o.stroke,u=o.radius,f=o.opacity,c=o.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:i,height:a,fill:s,stroke:l,radius:u,opacity:f,cursor:c}});var h=1/3*i,d=2/3*i,p=1/4*a,v=3/4*a;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:h,y1:p,x2:h,y2:v,stroke:l,cursor:c}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:d,y1:p,x2:d,y2:v,stroke:l,cursor:c}})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var n=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",n),t.draw()}),this.get("group").on("mouseleave",function(){var n=t.get("style").fill;t.getElementByLocalId("background").attr("fill",n),t.draw()})},e.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},e}(Yn);var urt={fill:"#416180",opacity:.05},frt={fill:"#5B8FF9",opacity:.15,cursor:"move"},pE=10,crt={width:pE,height:24},hrt={textBaseline:"middle",fill:"#000",opacity:.45},drt="sliderchange";var vE=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.onMouseDown=function(n){return function(i){t.currentTarget=n;var a=i.originalEvent;a.stopPropagation(),a.preventDefault(),t.prevX=(0,Si.get)(a,"touches.0.pageX",a.pageX),t.prevY=(0,Si.get)(a,"touches.0.pageY",a.pageY);var o=t.getContainerDOM();o.addEventListener("mousemove",t.onMouseMove),o.addEventListener("mouseup",t.onMouseUp),o.addEventListener("mouseleave",t.onMouseUp),o.addEventListener("touchmove",t.onMouseMove),o.addEventListener("touchend",t.onMouseUp),o.addEventListener("touchcancel",t.onMouseUp)}},t.onMouseMove=function(n){var i=t.cfg.width,a=[t.get("start"),t.get("end")];n.stopPropagation(),n.preventDefault();var o=(0,Si.get)(n,"touches.0.pageX",n.pageX),s=(0,Si.get)(n,"touches.0.pageY",n.pageY),l=o-t.prevX,u=t.adjustOffsetRange(l/i);t.updateStartEnd(u),t.updateUI(t.getElementByLocalId("foreground"),t.getElementByLocalId("minText"),t.getElementByLocalId("maxText")),t.prevX=o,t.prevY=s,t.draw(),t.emit(drt,[t.get("start"),t.get("end")].sort()),t.delegateEmit("valuechanged",{originValue:a,value:[t.get("start"),t.get("end")]})},t.onMouseUp=function(){t.currentTarget&&(t.currentTarget=void 0);var n=t.getContainerDOM();n&&(n.removeEventListener("mousemove",t.onMouseMove),n.removeEventListener("mouseup",t.onMouseUp),n.removeEventListener("mouseleave",t.onMouseUp),n.removeEventListener("touchmove",t.onMouseMove),n.removeEventListener("touchend",t.onMouseUp),n.removeEventListener("touchcancel",t.onMouseUp))},t}return e.prototype.setRange=function(t,n){this.set("minLimit",t),this.set("maxLimit",n);var i=this.get("start"),a=this.get("end"),o=(0,Si.clamp)(i,t,n),s=(0,Si.clamp)(a,t,n);!this.get("isInit")&&(i!==o||a!==s)&&this.setValue([o,s])},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var n=this.getRange();if((0,Si.isArray)(t)&&t.length===2){var i=[this.get("start"),this.get("end")];this.update({start:(0,Si.clamp)(t[0],n.min,n.max),end:(0,Si.clamp)(t[1],n.min,n.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:i,value:t})}},e.prototype.getValue=function(){return[this.get("start"),this.get("end")]},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:urt,foregroundStyle:frt,handlerStyle:crt,textStyle:hrt}})},e.prototype.update=function(t){var n=t.start,i=t.end,a=E({},t);(0,Si.isNil)(n)||(a.start=(0,Si.clamp)(n,0,1)),(0,Si.isNil)(i)||(a.end=(0,Si.clamp)(i,0,1)),r.prototype.update.call(this,a),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},e.prototype.init=function(){this.set("start",(0,Si.clamp)(this.get("start"),0,1)),this.set("end",(0,Si.clamp)(this.get("end"),0,1)),r.prototype.init.call(this)},e.prototype.render=function(){r.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},e.prototype.renderInner=function(t){var n=this.cfg,i=n.start,a=n.end,o=n.width,s=n.height,l=n.trendCfg,u=l===void 0?{}:l,f=n.minText,c=n.maxText,h=n.backgroundStyle,d=h===void 0?{}:h,p=n.foregroundStyle,v=p===void 0?{}:p,m=n.textStyle,g=m===void 0?{}:m,x=(0,Si.deepMix)({},uU,this.cfg.handlerStyle),b=i*o,S=a*o;(0,Si.size)((0,Si.get)(u,"data"))&&(this.trend=this.addComponent(t,E({component:lrt,id:this.getElementId("trend"),x:0,y:0,width:o,height:s},u))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:E({x:0,y:0,width:o,height:s},d)});var C=this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:E({y:s/2,textAlign:"right",text:f,silent:!1},g)}),w=this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:E({y:s/2,textAlign:"left",text:c,silent:!1},g)}),A=this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:E({y:0,height:s},v)}),L=(0,Si.get)(x,"width",pE),k=(0,Si.get)(x,"height",24);this.minHandler=this.addComponent(t,{component:fU,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(s-k)/2,width:L,height:k,cursor:"ew-resize",style:x}),this.maxHandler=this.addComponent(t,{component:fU,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(s-k)/2,width:L,height:k,cursor:"ew-resize",style:x})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.updateUI=function(t,n,i){var a=this.cfg,o=a.start,s=a.end,l=a.width,u=a.minText,f=a.maxText,c=a.handlerStyle,h=a.height,d=o*l,p=s*l;this.trend&&(this.trend.update({width:l,height:h}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",d),t.attr("width",p-d);var v=(0,Si.get)(c,"width",pE);n.attr("text",u),i.attr("text",f);var m=this._dodgeText([d,p],n,i),g=m[0],x=m[1];this.minHandler&&(this.minHandler.update({x:d-v/2}),this.get("updateAutoRender")||this.minHandler.render()),(0,Si.each)(g,function(b,S){return n.attr(S,b)}),this.maxHandler&&(this.maxHandler.update({x:p-v/2}),this.get("updateAutoRender")||this.maxHandler.render()),(0,Si.each)(x,function(b,S){return i.attr(S,b)})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var n=t.findById(this.getElementId("foreground"));n.on("mousedown",this.onMouseDown("foreground")),n.on("touchstart",this.onMouseDown("foreground"))},e.prototype.adjustOffsetRange=function(t){var n=this.cfg,i=n.start,a=n.end;switch(this.currentTarget){case"minHandler":{var o=0-i,s=1-i;return Math.min(s,Math.max(o,t))}case"maxHandler":{var o=0-a,s=1-a;return Math.min(s,Math.max(o,t))}case"foreground":{var o=0-i,s=1-a;return Math.min(s,Math.max(o,t))}}},e.prototype.updateStartEnd=function(t){var n=this.cfg,i=n.start,a=n.end;switch(this.currentTarget){case"minHandler":i+=t;break;case"maxHandler":a+=t;break;case"foreground":i+=t,a+=t;break}this.set("start",i),this.set("end",a)},e.prototype._dodgeText=function(t,n,i){var a,o,s=this.cfg,l=s.handlerStyle,u=s.width,f=2,c=(0,Si.get)(l,"width",pE),h=t[0],d=t[1],p=!1;h>d&&(a=[d,h],h=a[0],d=a[1],o=[i,n],n=o[0],i=o[1],p=!0);var v=n.getBBox(),m=i.getBBox(),g=v.width>h-f?{x:h+c/2+f,textAlign:"left"}:{x:h-c/2-f,textAlign:"right"},x=m.width>u-d-f?{x:d-c/2-f,textAlign:"right"}:{x:d+c/2+f,textAlign:"left"};return p?[x,g]:[g,x]},e.prototype.draw=function(){var t=this.get("container"),n=t&&t.get("canvas");n&&n.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),n=t&&t.get("canvas");return n&&n.get("container")},e}(Yn);var as=z(q());var DWt={trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},cU={default:DWt,hover:{thumbColor:"rgba(0,0,0,0.2)"}},IL=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.clearEvents=as.noop,t.onStartEvent=function(n){return function(i){t.isMobile=n,i.originalEvent.preventDefault();var a=n?(0,as.get)(i.originalEvent,"touches.0.clientX"):i.clientX,o=n?(0,as.get)(i.originalEvent,"touches.0.clientY"):i.clientY;t.startPos=t.cfg.isHorizontal?a:o,t.bindLaterEvent()}},t.bindLaterEvent=function(){var n=t.getContainerDOM(),i=[];t.isMobile?i=[Ws(n,"touchmove",t.onMouseMove),Ws(n,"touchend",t.onMouseUp),Ws(n,"touchcancel",t.onMouseUp)]:i=[Ws(n,"mousemove",t.onMouseMove),Ws(n,"mouseup",t.onMouseUp),Ws(n,"mouseleave",t.onMouseUp)],t.clearEvents=function(){i.forEach(function(a){a.remove()})}},t.onMouseMove=function(n){var i=t.cfg,a=i.isHorizontal,o=i.thumbOffset;n.preventDefault();var s=t.isMobile?(0,as.get)(n,"touches.0.clientX"):n.clientX,l=t.isMobile?(0,as.get)(n,"touches.0.clientY"):n.clientY,u=a?s:l,f=u-t.startPos;t.startPos=u,t.updateThumbOffset(o+f)},t.onMouseUp=function(n){n.preventDefault(),t.clearEvents()},t.onTrackClick=function(n){var i=t.cfg,a=i.isHorizontal,o=i.x,s=i.y,l=i.thumbLen,u=t.getContainerDOM(),f=u.getBoundingClientRect(),c=n.clientX,h=n.clientY,d=a?c-f.left-o-l/2:h-f.top-s-l/2,p=t.validateRange(d);t.updateThumbOffset(p)},t.onThumbMouseOver=function(){var n=t.cfg.theme.hover.thumbColor;t.getElementByLocalId("thumb").attr("stroke",n),t.draw()},t.onThumbMouseOut=function(){var n=t.cfg.theme.default.thumbColor;t.getElementByLocalId("thumb").attr("stroke",n),t.draw()},t}return e.prototype.setRange=function(t,n){this.set("minLimit",t),this.set("maxLimit",n);var i=this.getValue(),a=(0,as.clamp)(i,t,n);i!==a&&!this.get("isInit")&&this.setValue(a)},e.prototype.getRange=function(){var t=this.get("minLimit")||0,n=this.get("maxLimit")||1;return{min:t,max:n}},e.prototype.setValue=function(t){var n=this.getRange(),i=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*(0,as.clamp)(t,n.min,n.max)}),this.delegateEmit("valuechange",{originalValue:i,value:this.getValue()})},e.prototype.getValue=function(){return(0,as.clamp)(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:cU})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var n=this.cfg,i=n.trackLen,a=n.theme,o=a===void 0?{default:{}}:a,s=(0,as.deepMix)({},cU,o).default,l=s.lineCap,u=s.trackColor,f=s.size,c=(0,as.get)(this.cfg,"size",f),h=this.get("isHorizontal")?{x1:0+c/2,y1:c/2,x2:i-c/2,y2:c/2,lineWidth:c,stroke:u,lineCap:l}:{x1:c/2,y1:0+c/2,x2:c/2,y2:i-c/2,lineWidth:c,stroke:u,lineCap:l};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:h})},e.prototype.renderThumbShape=function(t){var n=this.cfg,i=n.thumbOffset,a=n.thumbLen,o=n.theme,s=(0,as.deepMix)({},cU,o).default,l=s.size,u=s.lineCap,f=s.thumbColor,c=(0,as.get)(this.cfg,"size",l),h=this.get("isHorizontal")?{x1:i+c/2,y1:c/2,x2:i+a-c/2,y2:c/2,lineWidth:c,stroke:f,lineCap:u,cursor:"default"}:{x1:c/2,y1:i+c/2,x2:c/2,y2:i+a-c/2,lineWidth:c,stroke:f,lineCap:u,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:h})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp);var n=t.findById(this.getElementId("track"));n.on("click",this.onTrackClick);var i=t.findById(this.getElementId("thumb"));i.on("mouseover",this.onThumbMouseOver),i.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),n=t&&t.get("canvas");return n&&n.get("container")},e.prototype.validateRange=function(t){var n=this.cfg,i=n.thumbLen,a=n.trackLen,o=t;return t+i>a?o=a-i:t+ia.x?a.x:e,t=ta.y?a.y:n,i=i=n&&r<=i}function Srt(r,e,t){if((0,DL.isString)(r))return r.padEnd(e,t);if((0,DL.isArray)(r)){var n=r.length;if(n=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.add=function(){for(var e=[],t=0;te.minX&&this.minYe.minY},r.prototype.size=function(){return this.width*this.height},r.prototype.isPointIn=function(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY},r}();function Crt(r){return[[r.minX,r.minY],[r.maxX,r.minY],[r.maxX,r.maxY],[r.minX,r.maxY]]}function yh(r){if(r.isPolar&&!r.isTransposed)return(r.endAngle-r.startAngle)*r.getRadius();var e=r.convert({x:0,y:0}),t=r.convert({x:1,y:0});return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function wrt(r){if(r.isPolar){var e=r.startAngle,t=r.endAngle;return t-e==Math.PI*2}return!1}function bm(r,e){var t=r.getCenter();return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mE(r,e){var t=!1;if(r)if(r.type==="theta"){var n=r.start,i=r.end;t=up(e.x,n.x,i.x)&&up(e.y,n.y,i.y)}else{var a=r.invert(e);t=up(a.x,0,1)&&up(a.y,0,1)}return t}function xh(r,e){var t=r.getCenter();return Math.atan2(e.y-t.y,e.x-t.x)}function PL(r,e){e===void 0&&(e=0);var t=r.start,n=r.end,i=r.getWidth(),a=r.getHeight();if(r.isPolar){var o=r.startAngle,s=r.endAngle,l=r.getCenter(),u=r.getRadius();return{type:"path",startState:{path:xu(l.x,l.y,u+e,o,o)},endState:function(c){var h=(s-o)*c+o,d=xu(l.x,l.y,u+e,o,h);return{path:d}},attrs:{path:xu(l.x,l.y,u+e,o,s)}}}var f;return r.isTransposed?f={height:a+e*2}:f={width:i+e*2},{type:"rect",startState:{x:t.x-e,y:n.y-e,width:r.isTransposed?i+e*2:0,height:r.isTransposed?0:a+e*2},endState:f,attrs:{x:t.x-e,y:n.y-e,width:i+e*2,height:a+e*2}}}function Ert(r,e){e===void 0&&(e=0);var t=r.start,n=r.end,i=r.getWidth(),a=r.getHeight(),o=Math.min(t.x,n.x),s=Math.min(t.y,n.y);return _a.fromRange(o-e,s-e,o+i+e,s+a+e)}var kWt=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function RWt(r){var e="linear";return kWt.test(r)?e="timeCat":(0,os.isString)(r)&&(e="cat"),e}function Art(r,e,t){var n=e||[];if((0,os.isNumber)(r)||(0,os.isNil)((0,os.firstValue)(n,r))&&(0,os.isEmpty)(t)){var i=Fb("identity");return new i({field:r.toString(),values:[r]})}var a=(0,os.valuesOfKey)(n,r),o=(0,os.get)(t,"type",RWt(a[0])),s=Fb(o);return new s(E({field:r,values:a},t))}function Mrt(r,e){if(r.type!=="identity"&&e.type!=="identity"){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);r.change(t)}}function _m(r){return r.alias||r.field}function kL(r,e,t){var n=r.values,i=n.length,a;if(i===1)a=[.5,1];else{var o=1,s=0;wrt(e)?e.isTransposed?(o=(0,os.get)(t,"widthRatio.multiplePie",1/1.3),s=1/i*o,a=[s/2,1-s/2]):a=[0,1-1/i]:(s=1/i/2,a=[s,1-s])}return a}function Trt(r){var e=r.values.filter(function(t){return!(0,os.isNil)(t)&&!isNaN(t)});return Math.max.apply(Math,mn(mn([],e,!1),[(0,os.isNil)(r.max)?-1/0:r.max],!1))}function NWt(r){var e,t;switch(r){case xe.TOP:e={x:0,y:1},t={x:1,y:1};break;case xe.RIGHT:e={x:1,y:0},t={x:1,y:1};break;case xe.BOTTOM:e={x:0,y:0},t={x:1,y:0};break;case xe.LEFT:e={x:0,y:0},t={x:0,y:1};break;default:e=t={x:0,y:0}}return{start:e,end:t}}function FWt(r){var e,t;return r.isTransposed?(e={x:0,y:0},t={x:1,y:0}):(e={x:0,y:0},t={x:0,y:1}),{start:e,end:t}}function gE(r,e){var t={start:{x:0,y:0},end:{x:0,y:0}};r.isRect?t=NWt(e):r.isPolar&&(t=FWt(r));var n=t.start,i=t.end;return{start:r.convert(n),end:r.convert(i)}}function pU(r){var e=r.start,t=r.end;return e.x===t.x}function vU(r,e){var t=r.start,n=r.end,i=pU(r);return i?(t.y-n.y)*(e.x-t.x)>0?1:-1:(n.x-t.x)*(t.y-e.y)>0?-1:1}function yE(r,e){var t=(0,ss.get)(r,["components","axis"],{});return(0,ss.deepMix)({},(0,ss.get)(t,["common"],{}),(0,ss.deepMix)({},(0,ss.get)(t,[e],{})))}function mU(r,e,t){var n=(0,ss.get)(r,["components","axis"],{});return(0,ss.deepMix)({},(0,ss.get)(n,["common","title"],{}),(0,ss.deepMix)({},(0,ss.get)(n,[e,"title"],{})),t)}function RL(r){var e=r.x,t=r.y,n=r.circleCenter,i=t.start>t.end,a=r.isTransposed?r.convert({x:i?0:1,y:0}):r.convert({x:0,y:i?0:1}),o=[a.x-n.x,a.y-n.y],s=[1,0],l=a.y>n.y?oe.angle(o,s):oe.angle(o,s)*-1,u=l+(e.end-e.start),f=Math.sqrt(Math.pow(a.x-n.x,2)+Math.pow(a.y-n.y,2));return{center:n,radius:f,startAngle:l,endAngle:u}}function Kb(r,e){return(0,ss.isBoolean)(r)?r===!1?!1:{}:(0,ss.get)(r,[e])}function gU(r,e){return(0,ss.get)(r,"position",e)}function yU(r,e){return(0,ss.get)(e,["title","text"],_m(r))}var Hs=function(){function r(e,t){this.destroyed=!1,this.facets=[],this.view=e,this.cfg=(0,Vs.deepMix)({},this.getDefaultCfg(),t)}return r.prototype.init=function(){this.container||(this.container=this.createContainer());var e=this.view.getData();this.facets=this.generateFacets(e)},r.prototype.render=function(){this.renderViews()},r.prototype.update=function(){},r.prototype.clear=function(){this.clearFacetViews()},r.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},r.prototype.facetToView=function(e){var t=e.region,n=e.data,i=e.padding,a=i===void 0?this.cfg.padding:i,o=this.view.createView({region:t,padding:a});o.data(n||[]),e.view=o,this.beforeEachView(o,e);var s=this.cfg.eachView;return s&&s(o,e),this.afterEachView(o,e),o},r.prototype.createContainer=function(){var e=this.view.getLayer(di.FORE);return e.addGroup()},r.prototype.renderViews=function(){this.createFacetViews()},r.prototype.createFacetViews=function(){var e=this;return this.facets.map(function(t){return e.facetToView(t)})},r.prototype.clearFacetViews=function(){var e=this;(0,Vs.each)(this.facets,function(t){t.view&&(e.view.removeView(t.view),t.view=void 0)})},r.prototype.parseSpacing=function(){var e=this.view.viewBBox,t=e.width,n=e.height,i=this.cfg.spacing;return i.map(function(a,o){return(0,Vs.isNumber)(a)?a/(o===0?t:n):parseFloat(a)/100})},r.prototype.getFieldValues=function(e,t){var n=[],i={};return(0,Vs.each)(e,function(a){var o=a[t];!(0,Vs.isNil)(o)&&!i[o]&&(n.push(o),i[o]=!0)}),n},r.prototype.getRegion=function(e,t,n,i){var a=this.parseSpacing(),o=a[0],s=a[1],l=(1+o)/(t===0?1:t)-o,u=(1+s)/(e===0?1:e)-s,f={x:(l+o)*n,y:(u+s)*i},c={x:f.x+l,y:f.y+u};return{start:f,end:c}},r.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},r.prototype.getDefaultTitleCfg=function(){var e=this.view.getTheme().fontFamily;return{style:{fontSize:14,fill:"#666",fontFamily:e}}},r.prototype.processAxis=function(e,t){var n=e.getOptions(),i=n.coordinate,a=e.geometries,o=(0,Vs.get)(i,"type","rect");if(o==="rect"&&a.length){(0,Vs.isNil)(n.axes)&&(n.axes={});var s=n.axes,l=a[0].getXYFields(),u=l[0],f=l[1],c=Kb(s,u),h=Kb(s,f);c!==!1&&(n.axes[u]=this.getXAxisOption(u,s,c,t)),h!==!1&&(n.axes[f]=this.getYAxisOption(f,s,h,t))}},r.prototype.getFacetDataFilter=function(e){return function(t){return(0,Vs.every)(e,function(n){var i=n.field,a=n.value;return!(0,Vs.isNil)(a)&&i?t[i]===a:!0})}},r}();var Irt={},NL=function(r){return Irt[(0,xU.lowerCase)(r)]},fp=function(r,e){Irt[(0,xU.lowerCase)(r)]=e};var pp=z(q());var Ka=z(q());var Lrt=z(q()),BWt=function(){function r(e,t){this.context=e,this.cfg=t,e.addAction(this)}return r.prototype.applyCfg=function(e){(0,Lrt.assign)(this,e)},r.prototype.init=function(){this.applyCfg(this.cfg)},r.prototype.destroy=function(){this.context.removeAction(this),this.context=null},r}(),Ir=BWt;var GWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.callback=null},e}(Ir),Ort=GWt;var Drt=z(q()),bU={};function _U(r,e){var t=bU[r],n=null;if(t){var i=t.ActionClass,a=t.cfg;n=new i(e,a),n.name=r,n.init()}return n}function rc(r){var e=bU[r];return(0,Drt.get)(e,"ActionClass")}function nr(r,e,t){bU[r]={ActionClass:e,cfg:t}}function Prt(r,e){var t=new Ort(e);return t.callback=r,t.name="callback",t}var YL=z(q());var nc=z(q());var FL=z(q());function zWt(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var n=1,i=r.length;n=o[u]?1:0,h=f>Math.PI?1:0,d=t.convert(s),p=bm(t,d);if(p>=.5)if(f===Math.PI*2){var v={x:(s.x+o.x)/2,y:(s.y+o.y)/2},m=t.convert(v);l.push(["A",p,p,0,h,c,m.x,m.y]),l.push(["A",p,p,0,h,c,d.x,d.y])}else l.push(["A",p,p,0,h,c,d.x,d.y]);return l}function jWt(r){(0,FL.each)(r,function(e,t){var n=e;if(n[0].toLowerCase()==="a"){var i=r[t-1],a=r[t+1];a&&a[0].toLowerCase()==="a"?i&&i[0].toLowerCase()==="l"&&(i[0]="M"):i&&i[0].toLowerCase()==="a"&&a&&a[0].toLowerCase()==="l"&&(a[0]="M")}})}var WWt=function(r,e,t,n){var i=[],a=!!n,o,s,l,u,f,c,h;if(a){l=n[0],u=n[1];for(var d=0,p=r.length;d=e||i.height>=e?i:null}function VWt(r,e){var t=r.event,n=t.target,i=n.getCanvasBBox();return i.width>=e||i.height>=e?n.attr("path"):null}function bu(r){var e=r.event,t,n=e.target;return n&&(t=n.get("element")),t}function ic(r){var e=r.event,t=e.target,n;return t&&(n=t.get("delegateObject")),n}function BL(r){var e=r.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function hp(r){return r&&r.component&&r.component.isList()}function GL(r){return r&&r.component&&r.component.isSlider()}function dp(r){var e=r.event,t=e.target;return t&&t.get("name")==="mask"}function Zb(r,e){var t=r.event.target;if(t.get("type")==="path"){var n=VWt(r,e);return n?YWt(r.view,n):void 0}var i=Frt(r,e);return i?jL(r.view,i):null}function zL(r,e,t){var n=Frt(r,t);if(!n)return null;var i=r.view,a=VL(i,e,{x:n.x,y:n.y}),o=VL(i,e,{x:n.maxX,y:n.maxY}),s={minX:a.x,minY:a.y,maxX:o.x,maxY:o.y};return jL(e,s)}function Hi(r){var e=r.geometries,t=[];return(0,nc.each)(e,function(n){var i=n.elements;t=t.concat(i)}),r.views&&r.views.length&&(0,nc.each)(r.views,function(n){t=t.concat(Hi(n))}),t}function Brt(r,e,t){var n=Hi(r);return n.filter(function(i){return ls(i,e)===t})}function UL(r,e){var t=r.geometries,n=[];return(0,nc.each)(t,function(i){var a=i.getElementsBy(function(o){return o.hasState(e)});n=n.concat(a)}),n}function ls(r,e){var t=r.getModel(),n=t.data,i;return(0,nc.isArray)(n)?i=n[0][e]:i=n[e],i}function HWt(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxY=e.x&&r.y<=e.y&&r.maxY>e.y}function Nl(r){var e=r.parent,t=null;return e&&(t=e.views.filter(function(n){return n!==r})),t}function XWt(r,e){var t=r.getCoordinate();return t.invert(e)}function VL(r,e,t){var n=XWt(r,t);return e.getCoordinate().convert(n)}function HL(r,e,t,n){var i=!1;return(0,nc.each)(r,function(a){if(a[t]===e[t]&&a[n]===e[n])return i=!0,!1}),i}function bh(r,e){var t=r.getScaleByField(e);return!t&&r.views&&(0,nc.each)(r.views,function(n){if(t=bh(n,e),t)return!1}),t}var qWt=function(){function r(e){this.actions=[],this.event=null,this.cacheMap={},this.view=e}return r.prototype.cache=function(){for(var e=[],t=0;t=0&&t.splice(n,1)},r.prototype.getCurrentPoint=function(){var e=this.event;if(e)if(e.target instanceof HTMLElement){var t=this.view.getCanvas(),n=t.getPointByClient(e.clientX,e.clientY);return n}else return{x:e.x,y:e.y};return null},r.prototype.getCurrentShape=function(){return(0,YL.get)(this.event,["gEvent","shape"])},r.prototype.isInPlot=function(){var e=this.getCurrentPoint();return e?this.view.isPointInPlot(e):!1},r.prototype.isInShape=function(e){var t=this.getCurrentShape();return t?t.get("name")===e:!1},r.prototype.isInComponent=function(e){var t=WL(this.view),n=this.getCurrentPoint();return n?!!t.find(function(i){var a=i.getBBox();return e?i.get("name")===e&&wU(a,n):wU(a,n)}):!1},r.prototype.destroy=function(){(0,YL.each)(this.actions.slice(),function(e){e.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},r}(),Urt=qWt;var KWt=function(){function r(e,t){this.view=e,this.cfg=t}return r.prototype.init=function(){this.initEvents()},r.prototype.initEvents=function(){},r.prototype.clearEvents=function(){},r.prototype.destroy=function(){this.clearEvents()},r}(),xE=KWt;function jrt(r,e,t){var n=r.split(":"),i=n[0],a=e.getAction(i)||_U(i,e);if(!a)throw new Error("There is no action named ".concat(i));var o=n[1];return{action:a,methodName:o,arg:t}}function Wrt(r){var e=r.action,t=r.methodName,n=r.arg;if(e[t])e[t](n);else throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(t))}var _u={START:"start",SHOW_ENABLE:"showEnable",END:"end",ROLLBACK:"rollback",PROCESSING:"processing"},ZWt=function(r){V(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.callbackCaches={},i.emitCaches={},i.steps=n,i}return e.prototype.init=function(){this.initContext(),r.prototype.init.call(this)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;(0,Ka.each)(this.steps,function(n,i){(0,Ka.each)(n,function(a){var o=t.getActionCallback(i,a);o&&t.bindEvent(a.trigger,o)})})},e.prototype.clearEvents=function(){var t=this;(0,Ka.each)(this.steps,function(n,i){(0,Ka.each)(n,function(a){var o=t.getActionCallback(i,a);o&&t.offEvent(a.trigger,o)})})},e.prototype.initContext=function(){var t=this.view,n=new Urt(t);this.context=n;var i=this.steps;(0,Ka.each)(i,function(a){(0,Ka.each)(a,function(o){if((0,Ka.isFunction)(o.action))o.actionObject={action:Prt(o.action,n),methodName:"execute"};else if((0,Ka.isString)(o.action))o.actionObject=jrt(o.action,n,o.arg);else if((0,Ka.isArray)(o.action)){var s=o.action,l=(0,Ka.isArray)(o.arg)?o.arg:[o.arg];o.actionObject=[],(0,Ka.each)(s,function(u,f){o.actionObject.push(jrt(u,n,l[f]))})}})})},e.prototype.isAllowStep=function(t){var n=this.currentStepName,i=this.steps;if(n===t||t===_u.SHOW_ENABLE)return!0;if(t===_u.PROCESSING)return n===_u.START;if(t===_u.START)return n!==_u.PROCESSING;if(t===_u.END)return n===_u.PROCESSING||n===_u.START;if(t===_u.ROLLBACK){if(i[_u.END])return n===_u.END;if(n===_u.START)return!0}return!1},e.prototype.isAllowExecute=function(t,n){if(this.isAllowStep(t)){var i=this.getKey(t,n);return n.once&&this.emitCaches[i]?!1:n.isEnable?n.isEnable(this.context):!0}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,n){t!==_u.SHOW_ENABLE&&this.currentStepName!==t&&this.enterStep(t);var i=this.getKey(t,n);this.emitCaches[i]=!0},e.prototype.getKey=function(t,n){return t+n.trigger+n.action},e.prototype.getActionCallback=function(t,n){var i=this,a=this.context,o=this.callbackCaches,s=n.actionObject;if(n.action&&s){var l=this.getKey(t,n);if(!o[l]){var u=function(f){a.event=f,i.isAllowExecute(t,n)?((0,Ka.isArray)(s)?(0,Ka.each)(s,function(c){a.event=f,Wrt(c)}):(a.event=f,Wrt(s)),i.afterExecute(t,n),n.callback&&(a.event=f,n.callback(a))):a.event=null};n.debounce?o[l]=(0,Ka.debounce)(u,n.debounce.wait,n.debounce.immediate):n.throttle?o[l]=(0,Ka.throttle)(u,n.throttle.wait,{leading:n.throttle.leading,trailing:n.throttle.trailing}):o[l]=u}return o[l]}return null},e.prototype.bindEvent=function(t,n){var i=t.split(":");i[0]==="window"?window.addEventListener(i[1],n):i[0]==="document"?document.addEventListener(i[1],n):this.view.on(t,n)},e.prototype.offEvent=function(t,n){var i=t.split(":");i[0]==="window"?window.removeEventListener(i[1],n):i[0]==="document"?document.removeEventListener(i[1],n):this.view.off(t,n)},e}(xE),Vrt=ZWt;var Hrt={};function EU(r){return Hrt[(0,pp.lowerCase)(r)]}function xr(r,e){Hrt[(0,pp.lowerCase)(r)]=e}function Yrt(r,e,t){var n=EU(r);if(!n)return null;if((0,pp.isPlainObject)(n)){var i=(0,pp.mix)((0,pp.clone)(n),t);return new Vrt(e,i)}else{var a=n;return new a(e,t)}}var _E=z(q());var Xrt=z(q());var AU=z(q());function $Wt(r){return{title:{autoRotate:!0,position:"center",spacing:r.axisTitleSpacing,style:{fill:r.axisTitleTextFillColor,fontSize:r.axisTitleTextFontSize,lineHeight:r.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:r.axisLabelOffset,style:{fill:r.axisLabelFillColor,fontSize:r.axisLabelFontSize,lineHeight:r.axisLabelLineHeight,fontFamily:r.fontFamily}},line:{style:{lineWidth:r.axisLineBorder,stroke:r.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:r.axisGridBorderColor,lineWidth:r.axisGridBorder,lineDash:r.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:r.axisTickLineBorder,stroke:r.axisTickLineBorderColor},alignTick:!0,length:r.axisTickLineLength},subTickLine:null,animate:!0}}function QWt(r){return{title:null,marker:{symbol:"circle",spacing:r.legendMarkerSpacing,style:{r:r.legendCircleMarkerSize,fill:r.legendMarkerColor}},itemName:{spacing:5,style:{fill:r.legendItemNameFillColor,fontFamily:r.fontFamily,fontSize:r.legendItemNameFontSize,lineHeight:r.legendItemNameLineHeight,fontWeight:r.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:r.legendPageNavigatorMarkerSize,inactiveFill:r.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:r.legendPageNavigatorMarkerInactiveFillOpacity,fill:r.legendPageNavigatorMarkerFillColor,opacity:r.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:r.legendPageNavigatorTextFillColor,fontSize:r.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:r.legendItemSpacing,itemMarginBottom:r.legendItemMarginBottom,padding:r.legendPadding}}function XL(r){var e,t={point:{default:{fill:r.pointFillColor,r:r.pointSize,stroke:r.pointBorderColor,lineWidth:r.pointBorder,fillOpacity:r.pointFillOpacity},active:{stroke:r.pointActiveBorderColor,lineWidth:r.pointActiveBorder},selected:{stroke:r.pointSelectedBorderColor,lineWidth:r.pointSelectedBorder},inactive:{fillOpacity:r.pointInactiveFillOpacity,strokeOpacity:r.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:r.hollowPointFillColor,lineWidth:r.hollowPointBorder,stroke:r.hollowPointBorderColor,strokeOpacity:r.hollowPointBorderOpacity,r:r.hollowPointSize},active:{stroke:r.hollowPointActiveBorderColor,strokeOpacity:r.hollowPointActiveBorderOpacity},selected:{lineWidth:r.hollowPointSelectedBorder,stroke:r.hollowPointSelectedBorderColor,strokeOpacity:r.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:r.hollowPointInactiveBorderOpacity}},area:{default:{fill:r.areaFillColor,fillOpacity:r.areaFillOpacity,stroke:null},active:{fillOpacity:r.areaActiveFillOpacity},selected:{fillOpacity:r.areaSelectedFillOpacity},inactive:{fillOpacity:r.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:r.hollowAreaBorderColor,lineWidth:r.hollowAreaBorder,strokeOpacity:r.hollowAreaBorderOpacity},active:{fill:null,lineWidth:r.hollowAreaActiveBorder},selected:{fill:null,lineWidth:r.hollowAreaSelectedBorder},inactive:{strokeOpacity:r.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:r.intervalFillColor,fillOpacity:r.intervalFillOpacity},active:{stroke:r.intervalActiveBorderColor,lineWidth:r.intervalActiveBorder},selected:{stroke:r.intervalSelectedBorderColor,lineWidth:r.intervalSelectedBorder},inactive:{fillOpacity:r.intervalInactiveFillOpacity,strokeOpacity:r.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:r.hollowIntervalFillColor,stroke:r.hollowIntervalBorderColor,lineWidth:r.hollowIntervalBorder,strokeOpacity:r.hollowIntervalBorderOpacity},active:{stroke:r.hollowIntervalActiveBorderColor,lineWidth:r.hollowIntervalActiveBorder,strokeOpacity:r.hollowIntervalActiveBorderOpacity},selected:{stroke:r.hollowIntervalSelectedBorderColor,lineWidth:r.hollowIntervalSelectedBorder,strokeOpacity:r.hollowIntervalSelectedBorderOpacity},inactive:{stroke:r.hollowIntervalInactiveBorderColor,lineWidth:r.hollowIntervalInactiveBorder,strokeOpacity:r.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:r.lineBorderColor,lineWidth:r.lineBorder,strokeOpacity:r.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:r.lineActiveBorder},selected:{lineWidth:r.lineSelectedBorder},inactive:{strokeOpacity:r.lineInactiveBorderOpacity}}},n=$Wt(r),i=QWt(r);return{background:r.backgroundColor,defaultColor:r.brandColor,subColor:r.subColor,semanticRed:r.paletteSemanticRed,semanticGreen:r.paletteSemanticGreen,padding:"auto",fontFamily:r.fontFamily,columnWidthRatio:1/2,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:r.paletteQualitative10,colors20:r.paletteQualitative20,sequenceColors:r.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:function(a){var o=a.geometry.coordinate;if(o.isPolar&&o.isTransposed){var s=lp(a.getModel(),o),l=s.startAngle,u=s.endAngle,f=(l+u)/2,c=7.5,h=c*Math.cos(f),d=c*Math.sin(f);return{matrix:gr.transform(null,[["t",h,d]])}}return t.interval.selected}}},"hollow-rect":{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},line:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},tick:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},funnel:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}},pyramid:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},line:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},dot:{default:{style:E(E({},t.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:E(E({},t.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:E(E({},t.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:E(E({},t.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:E(E({},t.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:E(E({},t.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:E(E({},t.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:E(E({},t.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hvh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},polygon:{polygon:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},point:{circle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},square:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},bowtie:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},diamond:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},hexagon:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},triangle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"triangle-down":{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"hollow-circle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-square":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-bowtie":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-diamond":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-hexagon":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle-down":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},cross:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},tick:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},plus:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},hyphen:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},line:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}}},area:{area:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},smooth:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},line:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"smooth-line":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}},schema:{candle:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},box:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}}},edge:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},arc:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},violin:{violin:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hollow:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"hollow-smooth":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}}},components:{axis:{common:n,top:{position:"top",grid:null,title:null,verticalLimitLength:1/2},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:1/2},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:(0,AU.deepMix)({},n.grid,{line:{type:"line"}})},radius:{title:null,grid:(0,AU.deepMix)({},n.grid,{line:{type:"circle"}})}},legend:{common:i,right:{layout:"vertical",padding:r.legendVerticalPadding},left:{layout:"vertical",padding:r.legendVerticalPadding},top:{layout:"horizontal",padding:r.legendHorizontalPadding},bottom:{layout:"horizontal",padding:r.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:r.sliderRailHeight,defaultLength:r.sliderRailWidth,style:{fill:r.sliderRailFillColor,stroke:r.sliderRailBorderColor,lineWidth:r.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:r.sliderLabelTextFillColor,fontSize:r.sliderLabelTextFontSize,lineHeight:r.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily}},handler:{size:r.sliderHandlerWidth,style:{fill:r.sliderHandlerFillColor,stroke:r.sliderHandlerBorderColor}},slidable:!0,padding:i.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:r.tooltipCrosshairsBorderColor,lineWidth:r.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(is.CONTAINER_CLASS)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:r.tooltipContainerFillColor,opacity:r.tooltipContainerFillOpacity,boxShadow:r.tooltipContainerShadow,borderRadius:"".concat(r.tooltipContainerBorderRadius,"px"),color:r.tooltipTextFillColor,fontSize:"".concat(r.tooltipTextFontSize,"px"),fontFamily:r.fontFamily,lineHeight:"".concat(r.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(is.TITLE_CLASS)]={marginBottom:"12px",marginTop:"12px"},e["".concat(is.LIST_CLASS)]={margin:0,listStyleType:"none",padding:0},e["".concat(is.LIST_ITEM_CLASS)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(is.MARKER_CLASS)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(is.VALUE_CLASS)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:r.annotationArcBorderColor,lineWidth:r.annotationArcBorder},animate:!0},line:{style:{stroke:r.annotationLineBorderColor,lineDash:r.annotationLineDash,lineWidth:r.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textAlign:"start",fontFamily:r.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:r.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:r.annotationRegionBorder,stroke:r.annotationRegionBorderColor,fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:r.brandColor,lineWidth:2}},line:{style:{stroke:r.annotationLineBorderColor,lineWidth:r.annotationLineBorder},length:r.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:r.cSliderBackgroundFillColor,opacity:r.cSliderBackgroundFillOpacity},foregroundStyle:{fill:r.cSliderForegroundFillColor,opacity:r.cSliderForegroundFillOpacity},handlerStyle:{width:r.cSliderHandlerWidth,height:r.cSliderHandlerHeight,fill:r.cSliderHandlerFillColor,opacity:r.cSliderHandlerFillOpacity,stroke:r.cSliderHandlerBorderColor,lineWidth:r.cSliderHandlerBorder,radius:r.cSliderHandlerBorderRadius,highLightFill:r.cSliderHandlerHighlightFillColor},textStyle:{fill:r.cSliderTextFillColor,opacity:r.cSliderTextFillOpacity,fontSize:r.cSliderTextFontSize,lineHeight:r.cSliderTextLineHeight,fontWeight:r.cSliderTextFontWeight,stroke:r.cSliderTextBorderColor,lineWidth:r.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:r.scrollbarTrackFillColor,thumbColor:r.scrollbarThumbFillColor}},hover:{style:{thumbColor:r.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:r.labelFillColor,fontSize:r.labelFontSize,fontFamily:r.fontFamily,stroke:r.labelBorderColor,lineWidth:r.labelBorder},fillColorDark:r.labelFillColorDark,fillColorLight:r.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:r.innerLabelFillColor,fontSize:r.innerLabelFontSize,fontFamily:r.fontFamily,stroke:r.innerLabelBorderColor,lineWidth:r.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:r.overflowLabelFillColor,fontSize:r.overflowLabelFontSize,fontFamily:r.fontFamily,stroke:r.overflowLabelBorderColor,lineWidth:r.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:r.labelLineBorder}},autoRotate:!0}}}var ni={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},bE={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},JWt=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],t6t=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],e6t=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],MU=function(r){r===void 0&&(r={});var e=r.backgroundColor,t=e===void 0?"transparent":e,n=r.subColor,i=n===void 0?"rgba(0,0,0,0.05)":n,a=r.paletteQualitative10,o=a===void 0?JWt:a,s=r.paletteQualitative20,l=s===void 0?t6t:s,u=r.paletteSemanticRed,f=u===void 0?"#F4664A":u,c=r.paletteSemanticGreen,h=c===void 0?"#30BF78":c,d=r.paletteSemanticYellow,p=d===void 0?"#FAAD14":d,v=r.paletteSequence,m=v===void 0?e6t:v,g=r.fontFamily,x=g===void 0?`"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`:g,b=r.brandColor,S=b===void 0?o[0]:b;return{backgroundColor:t,brandColor:S,subColor:i,paletteQualitative10:o,paletteQualitative20:l,paletteSemanticRed:f,paletteSemanticGreen:h,paletteSemanticYellow:p,paletteSequence:m,fontFamily:x,axisLineBorderColor:ni[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:ni[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisTickLineBorderColor:ni[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:ni[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:ni[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:ni[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:ni[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:S,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:ni[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:ni[100],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:ni[100],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:ni[45],legendPageNavigatorTextFontSize:12,sliderRailFillColor:ni[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:ni[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:ni[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:ni[25],annotationArcBorderColor:ni[15],annotationArcBorder:1,annotationLineBorderColor:ni[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:ni[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:ni[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:ni[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:ni[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:ni[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:bE[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:ni[65],overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:bE[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:ni[25],cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:S,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:bE[100],pointBorderOpacity:1,pointActiveBorderColor:ni[100],pointSelectedBorder:2,pointSelectedBorderColor:ni[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:S,hollowPointBorderOpacity:.95,hollowPointFillColor:bE[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:ni[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:ni[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:S,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:S,areaFillOpacity:.25,areaActiveFillColor:S,areaActiveFillOpacity:.5,areaSelectedFillColor:S,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:S,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:ni[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:ni[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:S,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:ni[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:ni[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:S,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:bE[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:ni[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:ni[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3}},ZOe=MU();function o0(r){var e=r.styleSheet,t=e===void 0?{}:e,n=rr(r,["styleSheet"]),i=MU(t);return(0,Xrt.deepMix)({},XL(i),n)}var r6t=o0({}),TU={default:r6t};function Qu(r){return(0,_E.get)(TU,(0,_E.lowerCase)(r),TU.default)}function s0(r,e){TU[(0,_E.lowerCase)(r)]=o0(e)}var Mi=z(q());function qrt(r,e,t){var n=t.translate(r),i=t.translate(e);return(0,Mi.isNumberEqual)(n,i)}function n6t(r,e){var t=e.coordinate,n=e.getXScale(),i=n.range,a=i[i.length-1],o=i[0],s=t.invert(r),l=s.x;return t.isPolar&&l>(1+a)/2&&(l=o),n.translate(n.invert(l))}function Krt(r,e,t){var n=t.coordinate,i=t.getYScale(),a=i.field,o=n.invert(e),s=i.invert(o.y),l=(0,Mi.find)(r,function(u){var f=u[Tn];return f[a][0]<=s&&f[a][1]>=s});return l||r[r.length-1]}var i6t=(0,Mi.memoize)(function(r){if(r.isCategory)return 1;for(var e=r.values,t=e.length,n=r.translate(e[0]),i=n,a=0;ai&&(i=s)}return(i-n)/(t-1)});function a6t(r,e,t){var n=e.getAttribute("position"),i=n.getFields(),a=e.scales,o=(0,Mi.isFunction)(t)||!t?i[0]:t,s=a[o],l=s?s.getText(r[o]):r[o]||o;return(0,Mi.isFunction)(t)?t(l,r):l}function o6t(r){var e=(0,Mi.values)(r.attributes);return(0,Mi.filter)(e,function(t){return(0,Mi.contains)(Py,t.type)})}function Zrt(r){for(var e=o6t(r),t,n=0,i=e;n=S)if(L)(0,Mi.isArray)(l)||(l=[]),l.push(k);else{l=k;break}}(0,Mi.isArray)(l)&&(l=Krt(l,r,t))}else{var O=void 0;if(!i.isLinear&&i.type!=="timeCat"){for(var p=0;pi.translate(A)||Si.max||SMath.abs(i.translate(O[Tn][o])-S)&&(b=O)}var F=i6t(t.getXScale());return!l&&Math.abs(i.translate(b[Tn][o])-S)<=F/2&&(l=b),l}function qL(r,e,t,n){t===void 0&&(t=""),n===void 0&&(n=!1);var i=r[Tn],a=a6t(i,e,t),o=e.tooltipOption,s=e.theme.defaultColor,l=[],u,f;function c(A,L){if(n||!(0,Mi.isNil)(L)&&L!==""){var k={title:a,data:i,mappingData:r,name:A,value:L,color:r.color||s,marker:!0};l.push(k)}}if((0,Mi.isObject)(o)){var h=o.fields,d=o.callback;if(d){var p=h.map(function(A){return r[Tn][A]}),v=d.apply(void 0,p),m=E({data:r[Tn],mappingData:r,title:a,color:r.color||s,marker:!0},v);l.push(m)}else for(var g=e.scales,x=0,b=h;x');O.appendChild(M);var I=l4(O,l,a,o),R=u2(h),P=new R.Canvas(E({container:M,pixelRatio:d,localRefresh:v,supportCSSTransform:b},I));return n=r.call(this,{parent:null,canvas:P,backgroundGroup:P.addGroup({zIndex:Wv.BG}),middleGroup:P.addGroup({zIndex:Wv.MID}),foregroundGroup:P.addGroup({zIndex:Wv.FORE}),padding:u,appendPadding:f,visible:g,options:w,limitInPlot:A,theme:L,syncViewPadding:k})||this,n.onResize=(0,e1.debounce)(function(){n.forceFit()},300),n.ele=O,n.canvas=P,n.width=I.width,n.height=I.height,n.autoFit=l,n.localRefresh=v,n.renderer=h,n.wrapperElement=M,n.updateCanvasStyle(),n.bindAutoFit(),n.initDefaultInteractions(C),n}return e.prototype.initDefaultInteractions=function(t){var n=this;(0,e1.each)(t,function(i){n.interaction(i)})},e.prototype.aria=function(t){var n="aria-label";t===!1?this.ele.removeAttribute(n):this.ele.setAttribute(n,t.label)},e.prototype.changeSize=function(t,n){return this.width===t&&this.height===n?this:(this.emit(wr.BEFORE_CHANGE_SIZE),this.width=t,this.height=n,this.canvas.changeSize(t,n),this.render(!0),this.emit(wr.AFTER_CHANGE_SIZE),this)},e.prototype.clear=function(){r.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),UZ(this.wrapperElement),this.wrapperElement=null},e.prototype.changeVisible=function(t){return r.prototype.changeVisible.call(this,t),this.wrapperElement.style.display=t?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=l4(this.ele,!0,this.width,this.height),n=t.width,i=t.height;this.changeSize(n,i)}},e.prototype.updateCanvasStyle=function(){yr(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(wE),EE=c6t;var lnt=z(q()),Bl=function(){function r(e){this.visible=!0,this.components=[],this.view=e}return r.prototype.clear=function(e){(0,lnt.each)(this.components,function(t){t.component.destroy()}),this.components=[]},r.prototype.destroy=function(){this.clear()},r.prototype.getComponents=function(){return this.components},r.prototype.changeVisible=function(e){this.visible!==e&&(this.components.forEach(function(t){e?t.component.show():t.component.hide()}),this.visible=e)},r}();var ei=z(q());function h6t(r){for(var e=[],t=function(i){var a=r[i],o=(0,ei.find)(e,function(s){return s.color===a.color&&s.name===a.name&&s.value===a.value&&s.title===a.title});o||e.push(a)},n=0;n1){for(var p=n[0],v=Math.abs(t.y-p[0].y),m=0,g=n;m'+s+"":s};return E(E({},t),{customContent:i})},e.prototype.getTitle=function(t){var n=t[0].title||t[0].name;return this.title=n,n},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),n={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},i=this.getTooltipCfg(),a=new qb(E(E({parent:t.get("el").parentNode,region:n},i),{visible:!1,crosshairs:null}));a.init(),this.tooltip=a},e.prototype.renderTooltipMarkers=function(t,n){for(var i=this.getTooltipMarkersGroup(),a=0,o=t;a-1)return;a.push(t),(t==="active"||t==="selected")&&(l==null||l.toFront())}else{if(f===-1)return;if(a.splice(f,1),t==="active"||t==="selected"){var c=this.geometry,h=c.sortZIndex,d=c.zIndexReversed,p=d?this.geometry.elements.length-this.elementIndex:this.elementIndex;h?l.setZIndex(p):l.set("zIndex",p)}}var v=o.drawShape(u,s,this.getOffscreenGroup());a.length?this.syncShapeStyle(l,v,a,null):this.syncShapeStyle(l,v,["reset"],null),v.remove(!0);var m={state:t,stateStatus:n,element:this,target:this.container};this.container.emit("statechange",m),Qw(this.shape,"statechange",m)},e.prototype.clearStates=function(){var t=this,n=this.states;(0,Za.each)(n,function(i){t.setState(i,!1)}),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this,n=t.shape,i=t.labelShape,a={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return n&&(a=n.getCanvasBBox()),i&&i.forEach(function(o){var s=o.getCanvasBBox();a.x=Math.min(s.x,a.x),a.y=Math.min(s.y,a.y),a.minX=Math.min(s.minX,a.minX),a.minY=Math.min(s.minY,a.minY),a.maxX=Math.max(s.maxX,a.maxX),a.maxY=Math.max(s.maxY,a.maxY)}),a.width=a.maxX-a.minX,a.height=a.maxY-a.minY,a},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this,n=t.shapeType,i=t.geometry,a=t.shapeFactory,o=i.stateOption,s=a.defaultShapeType,l=a.theme[n]||a.theme[s];this.statesStyle=(0,Za.deepMix)({},l,o)}return this.statesStyle},e.prototype.getStateStyle=function(t,n){var i=this.getStatesStyle(),a=(0,Za.get)(i,[t,"style"],{}),o=a[n]||a;return(0,Za.isFunction)(o)?o(this):o},e.prototype.getAnimateCfg=function(t){var n=this,i=this.animate;if(i){var a=i[t];return a&&E(E({},a),{callback:function(){var o;(0,Za.isFunction)(a.callback)&&a.callback(),(o=n.geometry)===null||o===void 0||o.emit(Vv.AFTER_DRAW_ANIMATE)}})}return null},e.prototype.drawShape=function(t,n){var i;n===void 0&&(n=!1);var a=this,o=a.shapeFactory,s=a.container,l=a.shapeType;if(this.shape=o.drawShape(l,t,s),this.shape){this.setShapeInfo(this.shape,t);var u=this.shape.cfg.name;u?(0,Za.isString)(u)&&(this.shape.cfg.name=["element",u]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var f=n?"enter":"appear",c=this.getAnimateCfg(f);c&&((i=this.geometry)===null||i===void 0||i.emit(Vv.BEFORE_DRAW_ANIMATE),mp(this.shape,c,{coordinate:o.coordinate,toAttrs:E({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,n){var i=this;if(t.cfg.origin=n,t.cfg.element=this,t.isGroup()){var a=t.get("children");a.forEach(function(o){i.setShapeInfo(o,n)})}},e.prototype.syncShapeStyle=function(t,n,i,a,o){var s=this,l;if(i===void 0&&(i=[]),o===void 0&&(o=0),!(!t||!n)){var u=t.get("clipShape"),f=n.get("clipShape");if(this.syncShapeStyle(u,f,i,a),t.isGroup())for(var c=t.get("children"),h=n.get("children"),d=0;d=0?a=n:i<=0?a=i:a=0,a},e.prototype.createAttrOption=function(t,n,i){if((0,sr.isNil)(n)||(0,sr.isObject)(n))(0,sr.isObject)(n)&&(0,sr.isEqual)(Object.keys(n),["values"])?(0,sr.set)(this.attributeOption,t,{fields:n.values}):(0,sr.set)(this.attributeOption,t,n);else{var a={};(0,sr.isNumber)(n)?a.values=[n]:a.fields=a1(n),i&&((0,sr.isFunction)(i)?a.callback=i:a.values=i),(0,sr.set)(this.attributeOption,t,a)}},e.prototype.initAttributes=function(){var t=this,n=this,i=n.attributes,a=n.attributeOption,o=n.theme,s=n.shapeType;this.groupScales=[];var l={},u=function(h){if(a.hasOwnProperty(h)){var d=a[h];if(!d)return{value:void 0};var p=E({},d),v=p.callback,m=p.values,g=p.fields,x=g===void 0?[]:g,b=x.map(function(C){var w=t.scales[C];return w.isCategory&&!l[C]&&Py.includes(h)&&(t.groupScales.push(w),l[C]=!0),w});p.scales=b,h!=="position"&&b.length===1&&b[0].type==="identity"?p.values=b[0].values:!v&&!m&&(h==="size"?p.values=o.sizes:h==="shape"?p.values=o.shapes[s]||[]:h==="color"&&(b.length?p.values=b[0].values.length<=10?o.colors10:o.colors20:p.values=o.colors10));var S=$w(h);i[h]=new S(p)}};for(var f in a){var c=u(f);if(typeof c=="object")return c.value}},e.prototype.processData=function(t){this.hasSorted=!1;for(var n=this.getAttribute("position").scales,i=n.filter(function(C){return C.isCategory}),a=this.groupData(t),o=[],s=0,l=a.length;ss&&(s=c)}var h=this.scaleDefs,d={};ot.max&&!(0,sr.get)(h,[a,"max"])&&(d.max=s),t.change(d)},e.prototype.beforeMapping=function(t){var n=t;if(this.sortable&&this.sort(n),this.generatePoints)for(var i=0,a=n.length;i1)for(var h=0;h0})}var rO=z(q());function PU(r,e,t){var n=t.data,i=t.origin,a=t.animateCfg,o=t.coordinate,s=(0,rO.get)(a,"update");r.set("data",n),r.set("origin",i),r.set("animateCfg",a),r.set("coordinate",o),r.set("visible",e.get("visible")),r.getChildren().forEach(function(l,u){var f=e.getChildByIndex(u);if(!f)r.removeChild(l),l.remove(!0);else{l.set("data",n),l.set("origin",i),l.set("animateCfg",a),l.set("coordinate",o);var c=OL(l,f);s?mp(l,s,{toAttrs:c,coordinate:o}):l.attr(c),f.isGroup()&&PU(l,f,t)}}),(0,rO.each)(e.getChildren(),function(l,u){u>=r.getCount()&&(l.destroyed||r.add(l))})}var C6t=function(){function r(e){this.shapesMap={},this.lastShapesMap={};var t=e.layout,n=e.container;this.layout=t,this.container=n}return r.prototype.render=function(e,t,n){var i=this;n===void 0&&(n=!1),this.shapesMap={};var a=this.container,o=this.createOffscreenGroup();if(e.length){for(var s=0,l=e;s0||n===1?u[s]=i*l:u[s]=i*l*-1,u},r.prototype.getLabelPoint=function(e,t,n){var i=this.getCoordinate(),a=e.content.length;function o(m,g,x){x===void 0&&(x=!1);var b=m;return(0,qn.isArray)(b)&&(e.content.length===1?x?b=bnt(b):b.length<=2?b=b[m.length-1]:b=bnt(b):b=b[g]),b}var s={content:e.content[n],x:0,y:0,start:{x:0,y:0},color:"#fff"},l=(0,qn.isArray)(t.shape)?t.shape[0]:t.shape,u=l==="funnel"||l==="pyramid";if(this.geometry.type==="polygon"){var f=_rt(t.x,t.y);s.x=f[0],s.y=f[1]}else this.geometry.type==="interval"&&!u?(s.x=o(t.x,n,!0),s.y=o(t.y,n)):(s.x=o(t.x,n),s.y=o(t.y,n));if(u){var c=(0,qn.get)(t,"nextPoints"),h=(0,qn.get)(t,"points");if(c){var d=i.convert(h[1]),p=i.convert(c[1]);s.x=(d.x+p.x)/2,s.y=(d.y+p.y)/2}else if(l==="pyramid"){var d=i.convert(h[1]),p=i.convert(h[2]);s.x=(d.x+p.x)/2,s.y=(d.y+p.y)/2}}e.position&&this.setLabelPosition(s,t,n,e.position);var v=this.getLabelOffsetPoint(e,n,a);return s.start={x:s.x,y:s.y},s.x+=v.x,s.y+=v.y,s.color=t.color,s},r.prototype.getLabelAlign=function(e,t,n){var i="center",a=this.getCoordinate();if(a.isTransposed){var o=e.offset;o<0?i="right":o===0?i="center":i="left",n>1&&t===0&&(i==="right"?i="left":i==="left"&&(i="right"))}return i},r.prototype.getLabelId=function(e){var t=this.geometry,n=t.type,i=t.getXScale(),a=t.getYScale(),o=e[Tn],s=t.getElementId(e);return n==="line"||n==="area"?s+=" ".concat(o[i.field]):n==="path"&&(s+=" ".concat(o[i.field],"-").concat(o[a.field])),s},r.prototype.getLabelsRenderer=function(){var e=this.geometry,t=e.labelsContainer,n=e.labelOption,i=e.canvasRegion,a=e.animateOption,o=this.geometry.coordinate,s=this.labelsRenderer;return s||(s=new xnt({container:t,layout:(0,qn.get)(n,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=s),s.region=i,s.animate=a?ZL("label",o):!1,s},r.prototype.getLabelCfgs=function(e){var t=this,n=this.geometry,i=n.labelOption,a=n.scales,o=n.coordinate,s=i,l=s.fields,u=s.callback,f=s.cfg,c=l.map(function(d){return a[d]}),h=[];return(0,qn.each)(e,function(d,p){var v=d[Tn],m=t.getLabelText(v,c),g;if(u){var x=l.map(function(A){return v[A]});if(g=u.apply(void 0,x),(0,qn.isNil)(g)){h.push(null);return}}var b=E(E({id:t.getLabelId(d),elementId:t.geometry.getElementId(d),data:v,mappingData:d,coordinate:o},f),g);(0,qn.isFunction)(b.position)&&(b.position=b.position(v,d,p));var S=t.getLabelOffset(b.offset||0),C=t.getDefaultLabelCfg(S,b.position);b=(0,qn.deepMix)({},C,b),b.offset=t.getLabelOffset(b.offset||0);var w=b.content;(0,qn.isFunction)(w)?b.content=w(v,d,p):(0,qn.isUndefined)(w)&&(b.content=m[0]),h.push(b)}),h},r.prototype.getLabelText=function(e,t){var n=[];return(0,qn.each)(t,function(i){var a=e[i.field];(0,qn.isArray)(a)?a=a.map(function(o){return i.getText(o)}):a=i.getText(a),(0,qn.isNil)(a)||a===""?n.push(null):n.push(a)}),n},r.prototype.getOffsetVector=function(e){e===void 0&&(e=0);var t=this.getCoordinate(),n=0;return(0,qn.isNumber)(e)&&(n=e),t.isTransposed?t.applyMatrix(n,0):t.applyMatrix(0,n)},r.prototype.getGeometryShapes=function(){var e=this.geometry,t={};return(0,qn.each)(e.elementsMap,function(n,i){t[i]=n.shape}),(0,qn.each)(e.getOffscreenGroup().getChildren(),function(n){var i=e.getElementId(n.get("origin").mappingData);t[i]=n}),t},r}(),Ch=w6t;function LE(r,e,t){if(!r)return t;var n;if(r.callback&&r.callback.length>1){var i=Array(r.callback.length-1).fill("");n=r.mapping.apply(r,mn([e],i,!1)).join("")}else n=r.mapping(e).join("");return n||t}var ta=z(q());var tf={hexagon:function(r,e,t){var n=t/2*Math.sqrt(3);return[["M",r,e-t],["L",r+n,e-t/2],["L",r+n,e+t/2],["L",r,e+t],["L",r-n,e+t/2],["L",r-n,e-t/2],["Z"]]},bowtie:function(r,e,t){var n=t-1.5;return[["M",r-t,e-n],["L",r+t,e+n],["L",r+t,e-n],["L",r-t,e+n],["Z"]]},cross:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e+t],["M",r+t,e-t],["L",r-t,e+t]]},tick:function(r,e,t){return[["M",r-t/2,e-t],["L",r+t/2,e-t],["M",r,e-t],["L",r,e+t],["M",r-t/2,e+t],["L",r+t/2,e+t]]},plus:function(r,e,t){return[["M",r-t,e],["L",r+t,e],["M",r,e-t],["L",r,e+t]]},hyphen:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},line:function(r,e,t){return[["M",r,e-t],["L",r,e+t]]}};var E6t=["line","cross","tick","plus","hyphen"];function A6t(r,e){return(0,ta.isFunction)(e)?e(r):(0,ta.deepMix)({},r,e)}function M6t(r,e){var t=r.symbol;if((0,ta.isString)(t)&&E6t.indexOf(t)!==-1){var n=(0,ta.get)(r,"style",{}),i=(0,ta.get)(n,"lineWidth",1),a=n.stroke||n.fill||e;r.style=(0,ta.deepMix)({},r.style,{lineWidth:i,stroke:a,fill:null})}}function _nt(r){var e=r.symbol;(0,ta.isString)(e)&&tf[e]&&(r.symbol=tf[e])}function nO(r){return r.startsWith(xe.LEFT)||r.startsWith(xe.RIGHT)?"vertical":"horizontal"}function iO(r,e,t,n,i){var a=t.getScale(t.type);if(a.isCategory){var o=a.field,s=e.getAttribute("color"),l=e.getAttribute("shape"),u=r.getTheme().defaultColor,f=e.coordinate.isPolar;return a.getTicks().map(function(c,h){var d,p=c.text,v=c.value,m=p,g=a.invert(v),x=r.filterFieldData(o,[(d={},d[o]=g,d)]).length===0;(0,ta.each)(r.views,function(A){var L;A.filterFieldData(o,[(L={},L[o]=g,L)]).length||(x=!0)});var b=LE(s,g,u),S=LE(l,g,"point"),C=e.getShapeMarker(S,{color:b,isInPolar:f}),w=i;return(0,ta.isFunction)(w)&&(w=w(m,h,E({name:m,value:g},(0,ta.deepMix)({},n,C)))),C=(0,ta.deepMix)({},n,C,So(E({},w),["style"])),M6t(C,b),w&&w.style&&(C.style=A6t(C.style,w.style)),_nt(C),{id:g,name:m,value:g,marker:C,unchecked:x}})}return[]}function Snt(r,e,t){return t.map(function(n,i){var a=e;(0,ta.isFunction)(a)&&(a=a(n.name,i,(0,ta.deepMix)({},r,n)));var o=(0,ta.isFunction)(n.marker)?n.marker(n.name,i,(0,ta.deepMix)({},r,n)):n.marker,s=(0,ta.deepMix)({},r,a,o);return _nt(s),n.marker=s,n})}function kU(r,e){var t=(0,ta.get)(r,["components","legend"],{});return(0,ta.deepMix)({},(0,ta.get)(t,["common"],{}),(0,ta.deepMix)({},(0,ta.get)(t,[e],{})))}var RU=z(q());function NU(r){return r?!1:r==null||isNaN(r)}function Cnt(r){if((0,RU.isArray)(r))return NU(r[1].y);var e=r.y;return(0,RU.isArray)(e)?NU(e[0]):NU(e)}function Sm(r,e,t){if(e===void 0&&(e=!1),t===void 0&&(t=!0),!r.length||r.length===1&&!t)return[];if(e){for(var n=[],i=0,a=r.length;iGy,AbstractGroup:()=>Zv,AbstractShape:()=>$v,Base:()=>Ry,Canvas:()=>Gl,Event:()=>Yu,Group:()=>c1,PathUtil:()=>gb,Shape:()=>bp,assembleFont:()=>Wy,getArcParams:()=>wm,getBBoxMethod:()=>Qv,getOffScreenContext:()=>Uy,getTextHeight:()=>jy,invert:()=>Ny,isAllowCapture:()=>Xv,multiplyVec2:()=>pu,version:()=>fVt});var bp={};Dn(bp,{Base:()=>Ga,Circle:()=>Bnt,Ellipse:()=>Gnt,Image:()=>Unt,Line:()=>jnt,Marker:()=>Vnt,Path:()=>DE,Polygon:()=>Ynt,Polyline:()=>Xnt,Rect:()=>qnt,Text:()=>Knt});var ln=z(q());function Ent(){return window?window.devicePixelRatio:1}function uO(r,e,t,n){var i=r-t,a=e-n;return Math.sqrt(i*i+a*a)}function wh(r,e,t,n,i,a){return i>=r&&i<=r+t&&a>=e&&a<=e+n}function Cm(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxY=0&&i<1/2*Math.PI?(s={x:o.minX,y:o.minY},l={x:o.maxX,y:o.maxY}):1/2*Math.PI<=i&&i1&&(t*=Math.sqrt(d),n*=Math.sqrt(d));var p=t*t*(h*h)+n*n*(c*c),v=p?Math.sqrt((t*t*(n*n)-p)/p):1;a===o&&(v*=-1),isNaN(v)&&(v=0);var m=n?v*t*h/n:0,g=t?v*-n*c/t:0,x=(s+u)/2+Math.cos(i)*m-Math.sin(i)*g,b=(l+f)/2+Math.sin(i)*m+Math.cos(i)*g,S=[(c-m)/t,(h-g)/n],C=[(-1*c-m)/t,(-1*h-g)/n],w=Ont([1,0],S),A=Ont(S,C);return UU(S,C)<=-1&&(A=Math.PI),UU(S,C)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:b,rx:zU(r,[u,f])?0:t,ry:zU(r,[u,f])?0:n,startAngle:w,endAngle:w+A,xRotation:i,arcFlag:a,sweepFlag:o}}var cO=Math.sin,hO=Math.cos,jU=Math.atan2,dO=Math.PI;function Dnt(r,e,t,n,i,a,o){var s=e.stroke,l=e.lineWidth,u=t-i,f=n-a,c=jU(f,u),h=new DE({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*hO(dO/6)+","+10*cO(dO/6)+" L0,0 L"+10*hO(dO/6)+",-"+10*cO(dO/6),stroke:s,lineWidth:l}});h.translate(i,a),h.rotateAtPoint(i,a,c),r.set(o?"startArrowShape":"endArrowShape",h)}function Pnt(r,e,t,n,i,a,o){var s=e.startArrow,l=e.endArrow,u=e.stroke,f=e.lineWidth,c=o?s:l,h=c.d,d=c.fill,p=c.stroke,v=c.lineWidth,m=rr(c,["d","fill","stroke","lineWidth"]),g=t-i,x=n-a,b=jU(x,g);h&&(i=i-hO(b)*h,a=a-cO(b)*h);var S=new DE({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:E(E({},m),{stroke:p||u,lineWidth:v||f,fill:d})});S.translate(i,a),S.rotateAtPoint(i,a,b),r.set(o?"startArrowShape":"endArrowShape",S)}function Eh(r,e,t,n,i){var a=jU(n-e,t-r);return{dx:hO(a)*i,dy:cO(a)*i}}function u1(r,e,t,n,i,a){typeof e.startArrow=="object"?Pnt(r,e,t,n,i,a,!0):e.startArrow?Dnt(r,e,t,n,i,a,!0):r.set("startArrowShape",null)}function f1(r,e,t,n,i,a){typeof e.endArrow=="object"?Pnt(r,e,t,n,i,a,!1):e.endArrow?Dnt(r,e,t,n,i,a,!1):r.set("startArrowShape",null)}var knt={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function xp(r,e){var t=e.attr();for(var n in t){var i=t[n],a=knt[n]?knt[n]:n;a==="matrix"&&i?r.transform(i[0],i[1],i[3],i[4],i[6],i[7]):a==="lineDash"&&r.setLineDash?(0,sc.isArray)(i)&&r.setLineDash(i):(a==="strokeStyle"||a==="fillStyle"?i=Int(r,e,i):a==="globalAlpha"&&(i=i*r.globalAlpha),r[a]=i)}}function PE(r,e,t){for(var n=0;nC?S:C,M=S>C?1:S/C,I=S>C?C/S:1;e.translate(x,b),e.rotate(L),e.scale(M,I),e.arc(0,0,O,w,A,1-k),e.scale(1/M,1/I),e.rotate(-L),e.translate(-x,-b)}break}case"Z":e.closePath();break;default:break}if(h==="Z")s=l;else{var R=c.length;s=[c[R-2],c[R-1]]}}}}function vO(r,e){var t=r.get("canvas");t&&(e==="remove"&&(r._cacheCanvasBBox=r.get("cacheCanvasBBox")),r.get("hasChanged")||(r.set("hasChanged",!0),r.cfg.parent&&r.cfg.parent.get("hasChanged")||(t.refreshElement(r,e,t),t.get("autoDraw")&&t.draw())))}function j6t(r){var e;if(r.destroyed)e=r._cacheCanvasBBox;else{var t=r.get("cacheCanvasBBox"),n=t&&!!(t.width&&t.height),i=r.getCanvasBBox(),a=i&&!!(i.width&&i.height);n&&a?e=Ant(t,i):n?e=t:a&&(e=i)}return e}function Nnt(r){if(!r.length)return null;var e=[],t=[],n=[],i=[];return(0,sc.each)(r,function(a){var o=j6t(a);o&&(e.push(o.minX),t.push(o.minY),n.push(o.maxX),i.push(o.maxY))}),{minX:(0,sc.min)(e),minY:(0,sc.min)(t),maxX:(0,sc.max)(n),maxY:(0,sc.max)(i)}}function Fnt(r,e){return!r||!e||!Cm(r,e)?null:{minX:Math.max(r.minX,e.minX),minY:Math.max(r.minY,e.minY),maxX:Math.min(r.maxX,e.maxX),maxY:Math.min(r.maxY,e.maxY)}}var Em=z(q());var W6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){vO(this,t)},e.prototype.getShapeBase=function(){return bp},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,n){n&&(t.save(),xp(t,n),n.createPath(t),t.restore(),t.clip(),n._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,n=[],i=[];(0,Em.each)(t,function(h){var d=h.cfg.cacheCanvasBBox;d&&h.cfg.isInView&&(n.push(d.minX,d.maxX),i.push(d.minY,d.maxY))});var a=null;if(n.length){var o=(0,Em.min)(n),s=(0,Em.max)(n),l=(0,Em.min)(i),u=(0,Em.max)(i);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:u,width:s-o,height:u-l};var f=this.cfg.canvas;if(f){var c=f.getViewRange();this.set("isInView",Cm(a,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},e.prototype.draw=function(t,n){var i=this.cfg.children,a=n?this.cfg.refresh:!0;i.length&&a&&(t.save(),xp(t,this),this._applyClip(t,this.getClip()),PE(t,i,n),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}(Zv),c1=W6t;var V6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return bp},e.prototype.getGroupBase=function(){return c1},e.prototype.onCanvasChange=function(t){vO(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),n=this.getHitLineWidth(),i=Qv(t),a=i(this),o=n/2,s=a.x-o,l=a.y-o,u=a.x+a.width+o,f=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+n,height:a.height+n,maxX:u,maxY:f}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,n){n&&(t.save(),xp(t,n),n.createPath(t),t.restore(),t.clip(),n._afterDraw())},e.prototype.draw=function(t,n){var i=this.cfg.clipShape;if(n){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!Cm(n,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),xp(t,this),this._applyClip(t,i),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 n=this.getCanvasBBox(),i=Cm(n,t);this.set("isInView",i),i?this.set("cacheCanvasBBox",n):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 n=this.attrs,i=n.lineWidth,a=n.opacity,o=n.strokeOpacity,s=n.fillOpacity;this.isFill()&&(!(0,ln.isNil)(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&i>0&&(!(0,ln.isNil)(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,n){var i=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,n,i,a,o)},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}($v),Ga=V6t;var H6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.attr(),l=s.x,u=s.y,f=s.r,c=o/2,h=uO(l,u,t,n);return a&&i?h<=f+c:a?h<=f:i?h>=f-c&&h<=f+c:!1},e.prototype.createPath=function(t){var n=this.attr(),i=n.x,a=n.y,o=n.r;t.beginPath(),t.arc(i,a,o,0,Math.PI*2,!1),t.closePath()},e}(Ga),Bnt=H6t;function mO(r,e,t,n){return r/(t*t)+e/(n*n)}var Y6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.attr(),l=o/2,u=s.x,f=s.y,c=s.rx,h=s.ry,d=(t-u)*(t-u),p=(n-f)*(n-f);return a&&i?mO(d,p,c+l,h+l)<=1:a?mO(d,p,c,h)<=1:i?mO(d,p,c-l,h-l)>=1&&mO(d,p,c+l,h+l)<=1:!1},e.prototype.createPath=function(t){var n=this.attr(),i=n.x,a=n.y,o=n.rx,s=n.ry;if(t.beginPath(),t.ellipse)t.ellipse(i,a,o,s,0,0,Math.PI*2,!1);else{var l=o>s?o:s,u=o>s?1:o/s,f=o>s?s/o:1;t.save(),t.translate(i,a),t.scale(u,f),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},e}(Ga),Gnt=Y6t;function znt(r){return r instanceof HTMLElement&&(0,ln.isString)(r.nodeName)&&r.nodeName.toUpperCase()==="CANVAS"}var X6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{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(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var n=this,i=this.attrs;if((0,ln.isString)(t)){var a=new Image;a.onload=function(){if(n.destroyed)return!1;n.attr("img",a),n.set("loading",!1),n._afterLoading();var o=n.get("callback");o&&o.call(n)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(i.width||(i.width=t.width),i.height||(i.height=t.height)):znt(t)&&(i.width||(i.width=Number(t.getAttribute("width"))),i.height||(i.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),t==="img"&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var n=this.attr(),i=n.x,a=n.y,o=n.width,s=n.height,l=n.sx,u=n.sy,f=n.swidth,c=n.sheight,h=n.img;(h instanceof Image||znt(h))&&(!(0,ln.isNil)(l)&&!(0,ln.isNil)(u)&&!(0,ln.isNil)(f)&&!(0,ln.isNil)(c)?t.drawImage(h,l,u,f,c,i,a,o,s):t.drawImage(h,i,a,o,s))},e}(Ga),Unt=X6t;function Su(r,e,t,n,i,a,o){var s=Math.min(r,t),l=Math.max(r,t),u=Math.min(e,n),f=Math.max(e,n),c=i/2;return a>=s-c&&a<=l+c&&o>=u-c&&o<=f+c?Vi.pointToLine(r,e,t,n,a,o)<=i/2:!1}var q6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&u1(this,t,a,o,n,i),l&&f1(this,t,n,i,a,o)},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){if(!i||!o)return!1;var s=this.attr(),l=s.x1,u=s.y1,f=s.x2,c=s.y2;return Su(l,u,f,c,o,t,n)},e.prototype.createPath=function(t){var n=this.attr(),i=n.x1,a=n.y1,o=n.x2,s=n.y2,l=n.startArrow,u=n.endArrow,f={dx:0,dy:0},c={dx:0,dy:0};l&&l.d&&(f=Eh(i,a,o,s,n.startArrow.d)),u&&u.d&&(c=Eh(i,a,o,s,n.endArrow.d)),t.beginPath(),t.moveTo(i+f.dx,a+f.dy),t.lineTo(o-c.dx,s-c.dy)},e.prototype.afterDrawPath=function(t){var n=this.get("startArrowShape"),i=this.get("endArrowShape");n&&n.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),n=t.x1,i=t.y1,a=t.x2,o=t.y2;return Vi.length(n,i,a,o)},e.prototype.getPoint=function(t){var n=this.attr(),i=n.x1,a=n.y1,o=n.x2,s=n.y2;return Vi.pointAt(i,a,o,s,t)},e}(Ga),jnt=q6t;var Wnt=z(q());var K6t={circle:function(r,e,t){return[["M",r-t,e],["A",t,t,0,1,0,r+t,e],["A",t,t,0,1,0,r-t,e]]},square:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},diamond:function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},triangle:function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e+n],["L",r,e-n],["L",r+t,e+n],["Z"]]},"triangle-down":function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e-n],["L",r+t,e-n],["L",r,e+n],["Z"]]}},Z6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return(0,Wnt.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t=this.attr(),n=t.x,i=t.y,a=t.symbol||"circle",o=this._getR(t),s,l;if((0,ln.isFunction)(a))s=a,l=s(n,i,o),l=Yy(l);else{if(s=e.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;l=s(n,i,o)}return l},e.prototype.createPath=function(t){var n=this._getPath(),i=this.get("paramsCache");pO(this,t,{path:n},i)},e.Symbols=K6t,e}(Ga),Vnt=Z6t;var Mm=z(q());function kE(r,e,t){var n=Uy();return r.createPath(n),n.isPointInPath(e,t)}var $6t=1e-6;function YU(r){return Math.abs(r)<$6t?0:r<0?-1:1}function Q6t(r,e,t){return(t[0]-r[0])*(e[1]-r[1])==(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}function RE(r,e,t){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a0!=YU(s[1]-t)>0&&YU(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(n=!n)}return n}function Am(r,e,t,n,i,a,o,s){var l=(Math.atan2(s-e,o-r)+Math.PI*2)%(Math.PI*2);if(li)return!1;var u={x:r+t*Math.cos(l),y:e+t*Math.sin(l)};return uO(u.x,u.y,o,s)<=a/2}var J6t=gr.transform;function tVt(r){for(var e=!1,t=r.length,n=0;nb?x:b,k=x>b?1:x/b,O=x>b?b/x:1,M=J6t(null,[["t",-m,-g],["r",-w],["s",1/k,1/O]]);y4(A,A,M),a=Am(0,0,L,S,C,e,A[0],A[1]);break;default:break}if(a)break}}return a}function rVt(r){for(var e=r.length,t=[],n=[],i=[],a=0;a0&&n.push(i),{polygons:t,polylines:n}}var NE=E({hasArc:tVt,extractPolygons:rVt,isPointInStroke:eVt},gb);function Hnt(r,e,t){for(var n=!1,i=0;i=f[0]&&t<=f[1]&&(i=(t-f[0])/(f[1]-f[0]),a=c)});var s=o[a];if((0,Mm.isNil)(s)||(0,Mm.isNil)(a))return null;var l=s.length,u=o[a+1];return np.pointAt(s[l-2],s[l-1],u[1],u[2],u[3],u[4],u[5],u[6],i)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",NE.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,n=0,i=[],a,o,s,l,u=this.get("curve");if(!!u){if((0,Mm.each)(u,function(f,c){s=u[c+1],l=f.length,s&&(t+=np.length(f[l-2],f[l-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}(0,Mm.each)(u,function(f,c){s=u[c+1],l=f.length,s&&(a=[],a[0]=n/t,o=np.length(f[l-2],f[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),n+=o||0,a[1]=n/t,i.push(a))}),this.set("tCache",i)}},e.prototype.getStartTangent=function(){var t=this.getSegments(),n;if(t.length>1){var i=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([a[0],a[1]]),n.push([i[0],i[1]]))}return n},e.prototype.getEndTangent=function(){var t=this.getSegments(),n=t.length,i;if(n>1){var a=t[n-2].currentPoint,o=t[n-1].currentPoint,s=t[n-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i},e}(Ga),DE=nVt;function FE(r,e,t,n,i){var a=r.length;if(a<2)return!1;for(var o=0;o=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Vi.pointAt(n[o][0],n[o][1],n[o+1][0],n[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var n=this.getTotalLength();if(!(n<=0)){var i=0,a=[],o,s;(0,BE.each)(t,function(l,u){t[u+1]&&(o=[],o[0]=i/n,s=Vi.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/n,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,n=[];return n.push([t[1][0],t[1][1]]),n.push([t[0][0],t[0][1]]),n},e.prototype.getEndTangent=function(){var t=this.attr().points,n=t.length-1,i=[];return i.push([t[n-1][0],t[n-1][1]]),i.push([t[n][0],t[n][1]]),i},e}(Ga),Xnt=aVt;function XU(r,e,t,n,i,a,o){var s=i/2;return wh(r-s,e-s,t,i,a,o)||wh(r+t-s,e-s,i,n,a,o)||wh(r+s,e+n-s,t,i,a,o)||wh(r-s,e+s,i,n,a,o)}function qU(r,e,t,n,i,a,o,s){var l=a/2;return Su(r+i,e,r+t-i,e,a,o,s)||Su(r+t,e+i,r+t,e+n-i,a,o,s)||Su(r+t-i,e+n,r+i,e+n,a,o,s)||Su(r,e+n-i,r,e+i,a,o,s)||Am(r+t-i,e+i,i,1.5*Math.PI,2*Math.PI,a,o,s)||Am(r+t-i,e+n-i,i,0,.5*Math.PI,a,o,s)||Am(r+i,e+n-i,i,.5*Math.PI,Math.PI,a,o,s)||Am(r+i,e+i,i,Math.PI,1.5*Math.PI,a,o,s)}var oVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.attr(),l=s.x,u=s.y,f=s.width,c=s.height,h=s.radius;if(h){var p=!1;return i&&(p=qU(l,u,f,c,h,o,t,n)),!p&&a&&(p=kE(this,t,n)),p}else{var d=o/2;if(a&&i)return wh(l-d,u-d,f+d,c+d,t,n);if(a)return wh(l,u,f,c,t,n);if(i)return XU(l,u,f,c,o,t,n)}},e.prototype.createPath=function(t){var n=this.attr(),i=n.x,a=n.y,o=n.width,s=n.height,l=n.radius;if(t.beginPath(),l===0)t.rect(i,a,o,s);else{var u=Lnt(l),f=u[0],c=u[1],h=u[2],d=u[3];t.moveTo(i+f,a),t.lineTo(i+o-c,a),c!==0&&t.arc(i+o-c,a+c,c,-Math.PI/2,0),t.lineTo(i+o,a+s-h),h!==0&&t.arc(i+o-h,a+s-h,h,0,Math.PI/2),t.lineTo(i+d,a+s),d!==0&&t.arc(i+d,a+s-d,d,Math.PI/2,Math.PI),t.lineTo(i,a+f),f!==0&&t.arc(i+f,a+f,f,Math.PI,Math.PI*1.5),t.closePath()}},e}(Ga),qnt=oVt;var sVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{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=Wy(t)},e.prototype._setText=function(t){var n=null;(0,ln.isString)(t)&&t.indexOf(` `)!==-1&&(n=t.split(` `)),this.set("textArr",n)},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,n=t.lineHeight,i=t.fontSize*1;return n?n-i:i*.14},e.prototype._drawTextArr=function(t,n,i){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,u=a.fontSize*1,f=this._getSpaceingY(),c=jy(a.text,a.fontSize,a.lineHeight),h;(0,ln.each)(n,function(d,p){h=l+p*(f+u)-c+u,o==="middle"&&(h+=c-u-(c-u)/2),o==="top"&&(h+=c-u),(0,ln.isNil)(d)||(i?t.fillText(d,s,h):t.strokeText(d,s,h))})},e.prototype._drawText=function(t,n){var i=this.attr(),a=i.x,o=i.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,n);else{var l=i.text;(0,ln.isNil)(l)||(n?t.fillText(l,a,o):t.strokeText(l,a,o))}},e.prototype.strokeAndFill=function(t){var n=this.attrs,i=n.lineWidth,a=n.opacity,o=n.strokeOpacity,s=n.fillOpacity;this.isStroke()&&i>0&&(!(0,ln.isNil)(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!(0,ln.isNil)(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(Ga),Knt=sVt;function lVt(r,e){if(e){var t=Ny(e);return pu(t,r)}return r}function Znt(r,e,t){var n=r.getTotalMatrix();if(n){var i=lVt([e,t,1],n),a=i[0],o=i[1];return[a,o]}return[e,t]}function $nt(r,e,t){if(r.isCanvas&&r.isCanvas())return!0;if(!Xv(r)||r.cfg.isInView===!1)return!1;if(r.cfg.clipShape){var n=Znt(r,e,t),i=n[0],a=n[1];if(r.isClipped(i,a))return!1}var o=r.cfg.cacheCanvasBBox||r.getCanvasBBox();return e>=o.minX&&e<=o.maxX&&t>=o.minY&&t<=o.maxY}function KU(r,e,t){if(!$nt(r,e,t))return null;for(var n=null,i=r.getChildren(),a=i.length,o=a-1;o>=0;o--){var s=i[o];if(s.isGroup())n=KU(s,e,t);else if($nt(s,e,t)){var l=s,u=Znt(s,e,t),f=u[0],c=u[1];l.isInShape(f,c)&&(n=s)}if(n)break}return n}var uVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},e.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return bp},e.prototype.getGroupBase=function(){return c1},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||Ent();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"),n=t.getContext("2d");return this.set("context",n),t},e.prototype.setDOMSize=function(t,n){r.prototype.setDOMSize.call(this,t,n);var i=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*n,o>1&&i.scale(o,o)},e.prototype.clear=function(){r.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),n=this.get("el");t.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(t,n){var i;return this.get("quickHit")?i=KU(this,t,n):i=r.prototype.getShape.call(this,t,n,null),i},e.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),n=this.getViewRange(),i;if(t.length&&t[0]===this)i=n;else if(i=Nnt(t),i){i.minX=Math.floor(i.minX),i.minY=Math.floor(i.minY),i.maxX=Math.ceil(i.maxX),i.maxY=Math.ceil(i.maxY),i.maxY+=1;var a=this.get("clipView");a&&(i=Fnt(i,n))}return i},e.prototype.refreshElement=function(t){var n=this.get("refreshElements");n.push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&((0,ln.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"),n=this.get("el"),i=this.getChildren();t.clearRect(0,0,n.width,n.height),xp(t,this),PE(t,i),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),n=this.get("refreshElements"),i=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),xp(t,this),Rnt(this,i,a),PE(t,i,a),t.restore()):n.length&&VU(n),(0,ln.each)(n,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,n=this.get("drawFrame");n||(n=(0,ln.requestAnimationFrame)(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)}),this.set("drawFrame",n))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(Gy),Gl=uVt;var fVt="0.5.12";var tj={};Dn(tj,{AbstractCanvas:()=>Gy,AbstractGroup:()=>Zv,AbstractShape:()=>$v,Base:()=>Ry,Canvas:()=>Mh,Event:()=>Yu,Group:()=>h1,PathUtil:()=>gb,Shape:()=>Sp,assembleFont:()=>Wy,getBBoxMethod:()=>Qv,getOffScreenContext:()=>Uy,getTextHeight:()=>jy,invert:()=>Ny,isAllowCapture:()=>Xv,multiplyVec2:()=>pu,version:()=>jVt});var Sp={};Dn(Sp,{Base:()=>Sa,Circle:()=>nit,Dom:()=>ait,Ellipse:()=>sit,Image:()=>lit,Line:()=>uit,Marker:()=>fit,Path:()=>cit,Polygon:()=>hit,Polyline:()=>dit,Rect:()=>vit,Text:()=>git});var Qnt=z(q());var GE={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},rn={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 lo(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function gO(r){var e=GE[r.type],t=r.getParent();if(!e)throw new Error("the type "+r.type+" is not supported by svg");var n=lo(e);if(r.get("id")&&(n.id=r.get("id")),r.set("el",n),r.set("attrs",{}),t){var i=t.get("el");i||(i=t.createDom(),t.set("el",i)),i.appendChild(n)}return n}function yO(r,e){var t=r.get("el"),n=(0,Qnt.toArray)(t.children).sort(e),i=document.createDocumentFragment();n.forEach(function(a){i.appendChild(a)}),t.appendChild(i)}function Jnt(r,e){var t=r.parentNode,n=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),i=n[e],a=n.indexOf(r);if(i){if(a>e)t.insertBefore(r,i);else if(a0&&(n?"stroke"in i?this._setColor(t,"stroke",s):"strokeStyle"in i&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),f&&h.setAttribute(rn.strokeOpacity,f),c&&h.setAttribute(rn.lineWidth,c))},e.prototype._setColor=function(t,n,i){var a=this.get("el");if(!i){a.setAttribute(rn[n],"none");return}if(i=i.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(i)){var o=t.find("gradient",i);o||(o=t.addGradient(i)),a.setAttribute(rn[n],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(i)){var o=t.find("pattern",i);o||(o=t.addPattern(i)),a.setAttribute(rn[n],"url(#"+o+")")}else a.setAttribute(rn[n],i)},e.prototype.shadow=function(t,n){var i=this.attr(),a=n||i,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,u=a.shadowColor;(o||s||l||u)&&tit(this,t)},e.prototype.transform=function(t){var n=this.attr(),i=(t||n).matrix;i&&Ah(this)},e.prototype.isInShape=function(t,n){return this.isPointInPath(t,n)},e.prototype.isPointInPath=function(t,n){var i=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=n+o.top,u=document.elementFromPoint(s,l);return!!(u&&u.isEqualNode(i))},e.prototype.getHitLineWidth=function(){var t=this.attrs,n=t.lineWidth,i=t.lineAppendWidth;return this.isStroke()?n+i:0},e}($v),Sa=hVt;var rit=z(q());var dVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,rit.each)(n||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):rn[s]&&a.setAttribute(rn[s],o)})},e}(Sa),nit=dVt;var iit=z(q());var pVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");if((0,iit.each)(n||i,function(u,f){rn[f]&&a.setAttribute(rn[f],u)}),typeof i.html=="function"){var o=i.html.call(this,i);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,l=s.length-1;l>=0;l--)a.removeChild(s[l]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=i.html},e}(Sa),ait=pVt;var oit=z(q());var vVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,oit.each)(n||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):rn[s]&&a.setAttribute(rn[s],o)})},e}(Sa),sit=vVt;var zE=z(q());var mVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,n){var i=this,a=this.attr(),o=this.get("el");(0,zE.each)(n||a,function(s,l){l==="img"?i._setImage(a.img):rn[l]&&o.setAttribute(rn[l],s)})},e.prototype.setAttr=function(t,n){this.attrs[t]=n,t==="img"&&this._setImage(n)},e.prototype._setImage=function(t){var n=this.attr(),i=this.get("el");if((0,zE.isString)(t))i.setAttribute("href",t);else if(t instanceof window.Image)n.width||(i.setAttribute("width",t.width),this.attr("width",t.width)),n.height||(i.setAttribute("height",t.height),this.attr("height",t.height)),i.setAttribute("href",t.src);else if(t instanceof HTMLElement&&(0,zE.isString)(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")i.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),n.width||(i.setAttribute("width",""+t.width),this.attr("width",t.width)),n.height||(i.setAttribute("height",""+t.height),this.attr("height",t.height)),i.setAttribute("href",a.toDataURL())}},e}(Sa),lit=mVt;var _O=z(q());var gVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,_O.each)(n||i,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=(0,_O.isObject)(o)?t.addArrow(i,rn[s]):t.getDefaultArrow(i,rn[s]);a.setAttribute(rn[s],"url(#"+l+")")}else a.removeAttribute(rn[s]);else rn[s]&&a.setAttribute(rn[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),n=t.x1,i=t.y1,a=t.x2,o=t.y2;return Vi.length(n,i,a,o)},e.prototype.getPoint=function(t){var n=this.attr(),i=n.x1,a=n.y1,o=n.x2,s=n.y2;return Vi.pointAt(i,a,o,s,t)},e}(Sa),uit=gVt;var CO=z(q());var SO={circle:function(r,e,t){return[["M",r,e],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},diamond:function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},triangle:function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e+n],["L",r,e-n],["L",r+t,e+n],["z"]]},triangleDown:function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e-n],["L",r+t,e-n],["L",r,e+n],["Z"]]}},$U={get:function(r){return SO[r]},register:function(r,e){SO[r]=e},remove:function(r){delete SO[r]},getAll:function(){return SO}};var yVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t){var n=this.get("el");n.setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return(0,CO.isArray)(t)?t.map(function(n){return n.join(" ")}).join(""):t},e.prototype._getPath=function(){var t=this.attr(),n=t.x,i=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return(0,CO.isFunction)(o)?s=o:s=$U.get(o),s?s(n,i,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=$U,e}(Sa),fit=yVt;var d1=z(q());var xVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,n){var i=this,a=this.attr(),o=this.get("el");(0,d1.each)(n||a,function(s,l){if(l==="path"&&(0,d1.isArray)(s))o.setAttribute("d",i._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var u=(0,d1.isObject)(s)?t.addArrow(a,rn[l]):t.getDefaultArrow(a,rn[l]);o.setAttribute(rn[l],"url(#"+u+")")}else o.removeAttribute(rn[l]);else rn[l]&&o.setAttribute(rn[l],s)})},e.prototype._formatPath=function(t){var n=t.map(function(i){return i.join(" ")}).join("");return~n.indexOf("NaN")?"":n},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var n=this.get("el"),i=this.getTotalLength();if(i===0)return null;var a=n?n.getPointAtLength(t*i):null;return a?{x:a.x,y:a.y}:null},e}(Sa),cit=xVt;var wO=z(q());var bVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,wO.each)(n||i,function(o,s){s==="points"&&(0,wO.isArray)(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):rn[s]&&a.setAttribute(rn[s],o)})},e}(Sa),hit=bVt;var Tm=z(q());var _Vt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,Tm.each)(n||i,function(o,s){s==="points"&&(0,Tm.isArray)(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):rn[s]&&a.setAttribute(rn[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,n=this.get("totalLength");return(0,Tm.isNil)(n)?(this.set("totalLength",Eb.length(t)),this.get("totalLength")):n},e.prototype.getPoint=function(t){var n=this.attr().points,i=this.get("tCache");i||(this._setTcache(),i=this.get("tCache"));var a,o;return(0,Tm.each)(i,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Vi.pointAt(n[o][0],n[o][1],n[o+1][0],n[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var n=this.getTotalLength();if(!(n<=0)){var i=0,a=[],o,s;(0,Tm.each)(t,function(l,u){t[u+1]&&(o=[],o[0]=i/n,s=Vi.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/n,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,n=[];return n.push([t[1][0],t[1][1]]),n.push([t[0][0],t[0][1]]),n},e.prototype.getEndTangent=function(){var t=this.attr().points,n=t.length-1,i=[];return i.push([t[n-1][0],t[n-1][1]]),i.push([t[n][0],t[n][1]]),i},e}(Sa),dit=_Vt;var AO=z(q());var EO=z(q());function pit(r){var e=0,t=0,n=0,i=0;return(0,EO.isArray)(r)?r.length===1?e=t=n=i=r[0]:r.length===2?(e=n=r[0],t=i=r[1]):r.length===3?(e=r[0],t=i=r[1],n=r[2]):(e=r[0],t=r[1],n=r[2],i=r[3]):e=t=n=i=r,{r1:e,r2:t,r3:n,r4:i}}var SVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,n){var i=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];(0,AO.each)(n||a,function(u,f){l.indexOf(f)!==-1&&!s?(o.setAttribute("d",i._assembleRect(a)),s=!0):l.indexOf(f)===-1&&rn[f]&&o.setAttribute(rn[f],u)})},e.prototype._assembleRect=function(t){var n=t.x,i=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+n+","+i+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=pit(s);(0,AO.isArray)(s)?s.length===1?l.r1=l.r2=l.r3=l.r4=s[0]:s.length===2?(l.r1=l.r3=s[0],l.r2=l.r4=s[1]):s.length===3?(l.r1=s[0],l.r2=l.r4=s[1],l.r3=s[2]):(l.r1=s[0],l.r2=s[1],l.r3=s[2],l.r4=s[3]):l.r1=l.r2=l.r3=l.r4=s;var u=[["M "+(n+l.r1)+","+i],["l "+(a-l.r1-l.r2)+",0"],["a "+l.r2+","+l.r2+",0,0,1,"+l.r2+","+l.r2],["l 0,"+(o-l.r2-l.r3)],["a "+l.r3+","+l.r3+",0,0,1,"+-l.r3+","+l.r3],["l "+(l.r3+l.r4-a)+",0"],["a "+l.r4+","+l.r4+",0,0,1,"+-l.r4+","+-l.r4],["l 0,"+(l.r4+l.r1-o)],["a "+l.r1+","+l.r1+",0,0,1,"+l.r1+","+-l.r1],["z"]];return u.join(" ")},e}(Sa),vit=SVt;var QU=z(q());var mit=.3,CVt={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},wVt={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},EVt={left:"left",start:"left",center:"middle",right:"end",end:"end"},AVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{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,n){var i=this,a=this.attr(),o=this.get("el");this._setFont(),(0,QU.each)(n||a,function(s,l){l==="text"?i._setText(""+s):l==="matrix"&&s?Ah(i):rn[l]&&o.setAttribute(rn[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),n=this.attr(),i=n.textBaseline,a=n.textAlign,o=x2();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",wVt[i]||"alphabetic"):t.setAttribute("alignment-baseline",CVt[i]||"baseline"),t.setAttribute("text-anchor",EVt[a]||"left")},e.prototype._setText=function(t){var n=this.get("el"),i=this.attr(),a=i.x,o=i.textBaseline,s=o===void 0?"bottom":o;if(!t)n.innerHTML="";else if(~t.indexOf(` `)){var l=t.split(` `),u=l.length-1,f="";(0,QU.each)(l,function(c,h){h===0?s==="alphabetic"?f+=''+c+"":s==="top"?f+=''+c+"":s==="middle"?f+=''+c+"":s==="bottom"?f+=''+c+"":s==="hanging"&&(f+=''+c+""):f+=''+c+""}),n.innerHTML=f}else n.innerHTML=t},e}(Sa),git=AVt;var Eit=z(q());var Im=z(q());var MVt=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,TVt=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,IVt=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function yit(r){var e=r.match(IVt);if(!e)return"";var t="";return e.sort(function(n,i){return n=n.split(":"),i=i.split(":"),Number(n[0])-Number(i[0])}),(0,Im.each)(e,function(n){n=n.split(":"),t+=''}),t}function LVt(r,e){var t=MVt.exec(r),n=(0,Im.mod)((0,Im.toRadian)(parseFloat(t[1])),Math.PI*2),i=t[2],a,o;n>=0&&n<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=n&&n`;t.innerHTML=n},r}(),bit=RVt;var MO=z(q());var NVt=function(){function r(e,t){this.cfg={};var n=lo("marker"),i=(0,MO.uniqueId)("marker_");n.setAttribute("id",i);var a=lo("path");a.setAttribute("stroke",e.stroke||"none"),a.setAttribute("fill",e.fill||"none"),n.appendChild(a),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=a,this.id=i;var o=e[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=e.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(e.lineWidth,a)),this}return r.prototype.match=function(){return!1},r.prototype._setDefaultPath=function(e,t){var n=this.el;t.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)},r.prototype._setMarker=function(e,t){var n=this.el,i=this.cfg.path,a=this.cfg.d;(0,MO.isArray)(i)&&(i=i.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",i),n.appendChild(t),a&&n.setAttribute("refX",""+a/e)},r.prototype.update=function(e){var t=this.child;t.attr?t.attr("fill",e):t.setAttribute("fill",e)},r}(),JU=NVt;var _it=z(q());var FVt=function(){function r(e){this.type="clip",this.cfg={};var t=lo("clipPath");this.el=t,this.id=(0,_it.uniqueId)("clip_"),t.id=this.id;var n=e.cfg.el;return t.appendChild(n),this.cfg=e,this}return r.prototype.match=function(){return!1},r.prototype.remove=function(){var e=this.el;e.parentNode.removeChild(e)},r}(),Sit=FVt;var Cit=z(q());var BVt=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,GVt=function(){function r(e){this.cfg={};var t=lo("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var n=lo("image");t.appendChild(n);var i=(0,Cit.uniqueId)("pattern_");t.id=i,this.el=t,this.id=i,this.cfg=e;var a=BVt.exec(e),o=a[2];n.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function l(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?l():(s.onload=l,s.src=s.src),this}return r.prototype.match=function(e,t){return this.cfg===t},r}(),wit=GVt;var zVt=function(){function r(e){var t=lo("defs"),n=(0,Eit.uniqueId)("defs_");t.id=n,e.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=e}return r.prototype.find=function(e,t){for(var n=this.children,i=null,a=0;a0&&(d[0][0]="L")),a=a.concat(d)}),a.push(["Z"])}return a}function Lm(r,e,t,n,i){for(var a=gn(r,e,!e,"lineWidth"),o=r.connectNulls,s=r.isInCircle,l=r.points,u=r.showSinglePoint,f=Sm(l,o,u),c=[],h=0,d=f.length;ho&&(o=l),l=n[0]}));for(var p=this.scales[h],v=0,m=t;ve&&(t=t?e/(1+n/t):0,n=e-t),i+a>e&&(i=i?e/(1+a/i):0,a=e-i),[t||0,n||0,i||0,a||0]}function IO(r,e,t){var n=[];if(t.isRect){var i=t.isTransposed?{x:t.start.x,y:e[0].y}:{x:e[0].x,y:t.start.y},a=t.isTransposed?{x:t.end.x,y:e[2].y}:{x:e[3].x,y:t.end.y},o=(0,Om.get)(r,["background","style","radius"]);if(o){var s=t.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,l=t.isTransposed?t.getWidth():t.getHeight(),u=Dit(o,Math.min(s,l)),f=u[0],c=u[1],h=u[2],d=u[3];n.push(["M",i.x,a.y+f]),f!==0&&n.push(["A",f,f,0,0,1,i.x+f,a.y]),n.push(["L",a.x-c,a.y]),c!==0&&n.push(["A",c,c,0,0,1,a.x,a.y+c]),n.push(["L",a.x,i.y-h]),h!==0&&n.push(["A",h,h,0,0,1,a.x-h,i.y]),n.push(["L",i.x+d,i.y]),d!==0&&n.push(["A",d,d,0,0,1,i.x,i.y-d])}else n.push(["M",i.x,i.y]),n.push(["L",a.x,i.y]),n.push(["L",a.x,a.y]),n.push(["L",i.x,a.y]),n.push(["L",i.x,i.y]);n.push(["z"])}if(t.isPolar){var p=t.getCenter(),v=lp(r,t),m=v.startAngle,g=v.endAngle;if(t.type!=="theta"&&!t.isTransposed)n=xu(p.x,p.y,t.getRadius(),m,g);else{var x=function(C){return Math.pow(C,2)},f=Math.sqrt(x(p.x-e[0].x)+x(p.y-e[0].y)),c=Math.sqrt(x(p.x-e[2].x)+x(p.y-e[2].y));n=xu(p.x,p.y,f,t.startAngle,t.endAngle,c)}}return n}function Pit(r,e,t){var n=t.getWidth(),i=t.getHeight(),a=t.type==="rect",o=[],s=(r[2].x-r[1].x)/2,l=t.isTransposed?s*i/n:s*n/i;return e==="round"?(a?(o.push(["M",r[0].x,r[0].y+l]),o.push(["L",r[1].x,r[1].y-l]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y-l]),o.push(["L",r[3].x,r[3].y+l]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y+l])):(o.push(["M",r[0].x,r[0].y]),o.push(["L",r[1].x,r[1].y]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y]),o.push(["L",r[3].x,r[3].y]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y])),o.push(["z"])):o=jE(r),o}function LO(r,e,t){var n=[];return(0,Om.isNil)(e)?t?n.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",(r[2].x+r[3].x)/2,(r[2].y+r[3].y)/2],["Z"]):n.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",r[2].x,r[2].y],["L",r[3].x,r[3].y],["Z"]):n.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),n}function WE(r,e){return[e,r]}function kit(r,e,t){var n,i,a,o,s,l,u,f=mn([],r,!0),c=f[0],h=f[1],d=f[2],p=f[3],v=typeof t=="number"?Array(4).fill(t):t,m=v[0],g=v[1],x=v[2],b=v[3];e.isTransposed&&(n=WE(h,p),h=n[0],p=n[1],i=[b,m,g,x],m=i[0],g=i[1],x=i[2],b=i[3]),e.isReflect("y")&&(a=WE(c,h),c=a[0],h=a[1],o=WE(d,p),d=o[0],p=o[1]),e.isReflect("x")&&(s=WE(c,p),c=s[0],p=s[1],l=WE(h,d),h=l[0],d=l[1]);var S=[],C=function(w){return Math.abs(w)};return u=Dit([m,g,x,b],Math.min(C(p.x-c.x),C(h.y-c.y))).map(function(w){return C(w)}),m=u[0],g=u[1],x=u[2],b=u[3],c.yo&&(i=o)}return i}function KVt(r,e){if(e){var t=(0,ef.flatten)(r),n=(0,ef.valuesOfKey)(t,e);return n.length}return r.length}function g1(r){var e=r.theme,t=r.coordinate,n=r.getXScale(),i=n.values,a=r.beforeMappingData,o=i.length,s=yh(r.coordinate),l=r.intervalPadding,u=r.dodgePadding,f=r.maxColumnWidth||e.maxColumnWidth,c=r.minColumnWidth||e.minColumnWidth,h=r.columnWidthRatio||e.columnWidthRatio,d=r.multiplePieWidthRatio||e.multiplePieWidthRatio,p=r.roseWidthRatio||e.roseWidthRatio;if(n.isLinear&&i.length>1){i.sort();var v=qVt(i,n);o=(n.max-n.min)/v,i.length>o&&(o=i.length)}var m=n.range,g=1/o,x=1;if(t.isPolar?t.isTransposed&&o>1?x=d:x=p:(n.isLinear&&(g*=m[1]-m[0]),x=h),!(0,ef.isNil)(l)&&l>=0){var b=l/s;g=(1-(o-1)*b)/o}else g*=x;if(r.getAdjust("dodge")){var S=r.getAdjust("dodge"),C=S.dodgeBy,w=KVt(a,C);if(!(0,ef.isNil)(u)&&u>=0){var A=u/s;g=(g-A*(w-1))/w}else!(0,ef.isNil)(l)&&l>=0&&(g*=x),g=g/w;g=g>=0?g:0}if(!(0,ef.isNil)(f)&&f>=0){var L=f/s;g>L&&(g=L)}if(!(0,ef.isNil)(c)&&c>=0){var k=c/s;g0&&!(0,ej.get)(n,[i,"min"])&&t.change({min:0}),o<=0&&!(0,ej.get)(n,[i,"max"])&&t.change({max:0}))}},e.prototype.getDrawCfg=function(t){var n=r.prototype.getDrawCfg.call(this,t);return n.background=this.background,n},e}(Wo),Rit=ZVt;var $Vt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.type="line";var i=t.sortable,a=i===void 0?!1:i;return n.sortable=a,n}return e}(p1),Nit=$Vt;var Bit=z(q());var OO=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],Fit=["cross","tick","plus","hyphen","line"];function y1(r,e,t,n,i){var a=gn(e,i,!i,"r"),o=r.parsePoints(e.points),s=o[0];if(e.isStack)s=o[1];else if(o.length>1){for(var l=t.addGroup(),u=0,f=o;u2?"weight":"normal",a;if(r.isInCircle){var o={x:0,y:1};return i==="normal"?a=i8t(n[0],n[1],o):(t.fill=t.stroke,a=a8t(n,o)),a=this.parsePath(a),e.addShape("path",{attrs:E(E({},t),{path:a})})}else{if(i==="normal")return n=this.parsePoints(n),a=LL((n[1].x+n[0].x)/2,n[0].y,Math.abs(n[1].x-n[0].x)/2,Math.PI,Math.PI*2),e.addShape("path",{attrs:E(E({},t),{path:a})});var s=HE(n[1],n[3]),l=HE(n[2],n[0]);return a=[["M",n[0].x,n[0].y],["L",n[1].x,n[1].y],s,["L",n[3].x,n[3].y],["L",n[2].x,n[2].y],l,["Z"]],a=this.parsePath(a),t.fill=t.stroke,e.addShape("path",{attrs:E(E({},t),{path:a})})}},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});function o8t(r,e){var t=HE(r,e),n=[["M",r.x,r.y]];return n.push(t),n}or("edge","smooth",{draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=r.points,i=this.parsePath(o8t(n[0],n[1]));return e.addShape("path",{attrs:E(E({},t),{path:i})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});var Hit=z(q());var PO=1/3;function s8t(r,e){var t=[];t.push({x:r.x,y:r.y*(1-PO)+e.y*PO}),t.push({x:e.x,y:r.y*(1-PO)+e.y*PO}),t.push(e);var n=[["M",r.x,r.y]];return(0,Hit.each)(t,function(i){n.push(["L",i.x,i.y])}),n}or("edge","vhv",{draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=r.points,i=this.parsePath(s8t(n[0],n[1]));return e.addShape("path",{attrs:E(E({},t),{path:i})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});or("interval","funnel",{getPoints:function(r){return r.size=r.size*2,m1(r)},draw:function(r,e){var t=gn(r,!1,!0),n=this.parsePath(LO(r.points,r.nextPoints,!1)),i=e.addShape("path",{attrs:E(E({},t),{path:n}),name:"interval"});return i},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});or("interval","hollow-rect",{draw:function(r,e){var t=gn(r,!0,!1),n=e,i=r==null?void 0:r.background;if(i){n=e.addGroup();var a=sO(r),o=IO(r,this.parsePoints(r.points),this.coordinate);n.addShape("path",{attrs:E(E({},a),{path:o}),zIndex:-1,name:n1})}var s=this.parsePath(jE(r.points)),l=n.addShape("path",{attrs:E(E({},t),{path:s}),name:"interval"});return i?n:l},getMarker:function(r){var e=r.color,t=r.isInPolar;return t?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}});var rj=z(q());function l8t(r){var e=r.x,t=r.y,n=r.y0;return(0,rj.isArray)(t)?t.map(function(i,a){return{x:(0,rj.isArray)(e)?e[a]:e,y:i}}):[{x:e,y:n},{x:e,y:t}]}or("interval","line",{getPoints:function(r){return l8t(r)},draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=So(E({},t),["fill"]),i=this.parsePath(jE(r.points,!1)),a=e.addShape("path",{attrs:E(E({},n),{path:i}),name:"interval"});return a},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return[["M",t,n-i],["L",t,n+i]]},style:{r:5,stroke:e}}}});or("interval","pyramid",{getPoints:function(r){return r.size=r.size*2,m1(r)},draw:function(r,e){var t=gn(r,!1,!0),n=this.parsePath(LO(r.points,r.nextPoints,!0)),i=e.addShape("path",{attrs:E(E({},t),{path:n}),name:"interval"});return i},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});var Yit=z(q());function u8t(r){var e=r.x,t=r.y,n=r.y0,i=r.size,a,o;(0,Yit.isArray)(t)?(a=t[0],o=t[1]):(a=n,o=t);var s=e+i/2,l=e-i/2;return[{x:e,y:a},{x:e,y:o},{x:l,y:a},{x:s,y:a},{x:l,y:o},{x:s,y:o}]}function f8t(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y]]}or("interval","tick",{getPoints:function(r){return u8t(r)},draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(f8t(r.points)),i=e.addShape("path",{attrs:E(E({},t),{path:n}),name:"interval"});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return[["M",t-i/2,n-i],["L",t+i/2,n-i],["M",t,n-i],["L",t,n+i],["M",t-i/2,n+i],["L",t+i/2,n+i]]},style:{r:5,stroke:e}}}});var kO=z(q());var c8t=function(r,e,t){var n=r.x,i=r.y,a=e.x,o=e.y,s;switch(t){case"hv":s=[{x:a,y:i}];break;case"vh":s=[{x:n,y:o}];break;case"hvh":var l=(a+n)/2;s=[{x:l,y:i},{x:l,y:o}];break;case"vhv":var u=(i+o)/2;s=[{x:n,y:u},{x:a,y:u}];break;default:break}return s};function h8t(r,e){var t=[];return(0,kO.each)(r,function(n,i){var a=r[i+1];if(t.push(n),a){var o=c8t(n,a,e);t=t.concat(o)}}),t}function d8t(r){return r.map(function(e,t){return t===0?["M",e.x,e.y]:["L",e.x,e.y]})}function p8t(r,e){var t=Sm(r.points,r.connectNulls,r.showSinglePoint),n=[];return(0,kO.each)(t,function(i){var a=h8t(i,e);n=n.concat(d8t(a))}),E(E({},gn(r,!0,!1,"lineWidth")),{path:n})}(0,kO.each)(["hv","vh","hvh","vhv"],function(r){or("line",r,{draw:function(e,t){var n=p8t(e,r),i=t.addShape({type:"path",attrs:n,name:"line"});return i},getMarker:function(e){return lO(e,r)}})});var Xit=z(q());(0,Xit.each)(Fit,function(r){or("point",r,{draw:function(e,t){return y1(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:tf[r],style:{r:4.5,stroke:t,fill:null}}}})});or("point","image",{draw:function(r,e){var t=gn(r,!1,!1,"r").r,n=this.parsePoints(r.points),i=n[0];if(r.isStack)i=n[1];else if(n.length>1){for(var a=e.addGroup(),o=0,s=n;o1?e[1]:t,a=e.length>3?e[3]:n,o=e.length>2?e[2]:i;return{min:t,max:n,min1:i,max1:a,median:o}}function Zit(r,e,t){var n=t/2,i;if((0,YE.isArray)(e)){var a=Kit(e),o=a.min,s=a.max,l=a.median,u=a.min1,f=a.max1,c=r-n,h=r+n;i=[[c,s],[h,s],[r,s],[r,f],[c,u],[c,f],[h,f],[h,u],[r,u],[r,o],[c,o],[h,o],[c,l],[h,l]]}else{e=(0,YE.isNil)(e)?.5:e;var d=Kit(r),o=d.min,s=d.max,l=d.median,u=d.min1,f=d.max1,p=e-n,v=e+n;i=[[o,p],[o,v],[o,e],[u,e],[u,p],[u,v],[f,v],[f,p],[f,e],[s,e],[s,p],[s,v],[l,p],[l,v]]}return i.map(function(m){return{x:m[0],y:m[1]}})}function v8t(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y],["L",r[6].x,r[6].y],["L",r[7].x,r[7].y],["L",r[4].x,r[4].y],["Z"],["M",r[8].x,r[8].y],["L",r[9].x,r[9].y],["M",r[10].x,r[10].y],["L",r[11].x,r[11].y],["M",r[12].x,r[12].y],["L",r[13].x,r[13].y]]}or("schema","box",{getPoints:function(r){var e=r.x,t=r.y,n=r.size;return Zit(e,t,n)},draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(v8t(r.points)),i=e.addShape("path",{attrs:E(E({},t),{path:n,name:"schema"})});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){var a=[n-6,n-3,n,n+3,n+6],o=Zit(t,a,i);return[["M",o[0].x+1,o[0].y],["L",o[1].x-1,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["M",o[4].x,o[4].y],["L",o[5].x,o[5].y],["L",o[6].x,o[6].y],["L",o[7].x,o[7].y],["L",o[4].x,o[4].y],["Z"],["M",o[8].x,o[8].y],["L",o[9].x,o[9].y],["M",o[10].x+1,o[10].y],["L",o[11].x-1,o[11].y],["M",o[12].x,o[12].y],["L",o[13].x,o[13].y]]},style:{r:6,lineWidth:1,stroke:e}}}});var $it=z(q());function m8t(r){var e=(0,$it.isArray)(r)?r:[r],t=e.sort(function(n,i){return i-n});return Srt(t,4,t[t.length-1])}function Qit(r,e,t){var n=m8t(e);return[{x:r,y:n[0]},{x:r,y:n[1]},{x:r-t/2,y:n[2]},{x:r-t/2,y:n[1]},{x:r+t/2,y:n[1]},{x:r+t/2,y:n[2]},{x:r,y:n[2]},{x:r,y:n[3]}]}function g8t(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]}or("schema","candle",{getPoints:function(r){var e=r.x,t=r.y,n=r.size;return Qit(e,t,n)},draw:function(r,e){var t=gn(r,!0,!0),n=this.parsePath(g8t(r.points)),i=e.addShape("path",{attrs:E(E({},t),{path:n,name:"schema"})});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){var a=[n+7.5,n+3,n-3,n-7.5],o=Qit(t,a,i);return[["M",o[0].x,o[0].y],["L",o[1].x,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["L",o[4].x,o[4].y],["L",o[5].x,o[5].y],["Z"],["M",o[6].x,o[6].y],["L",o[7].x,o[7].y]]},style:{lineWidth:1,stroke:e,fill:e,r:6}}}});var RO=z(q());function y8t(r,e){var t=Math.abs(r[0].x-r[2].x),n=Math.abs(r[0].y-r[2].y),i=Math.min(t,n);e&&(i=(0,RO.clamp)(e,0,Math.min(t,n))),i=i/2;var a=(r[0].x+r[2].x)/2,o=(r[0].y+r[2].y)/2;return{x:a-i,y:o-i,width:i*2,height:i*2}}or("polygon","square",{draw:function(r,e){if(!(0,RO.isEmpty)(r.points)){var t=gn(r,!0,!0),n=this.parsePoints(r.points);return e.addShape("rect",{attrs:E(E({},t),y8t(n,r.size)),name:"polygon"})}},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});or("violin","smooth",{draw:function(r,e){var t=gn(r,!0,!0),n=this.parsePath(oO(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{stroke:null,r:4,fill:e}}}});or("violin","hollow",{draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(aO(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});or("violin","hollow-smooth",{draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(oO(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});var Xs=z(q());var x8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelValueDir=function(t){var n="y",i=t.points;return i[0][n]<=i[2][n]?1:-1},e.prototype.getLabelOffsetPoint=function(t,n,i,a){var o,s=r.prototype.getLabelOffsetPoint.call(this,t,n,i),l=this.getCoordinate(),u=l.isTransposed,f=u?"x":"y",c=this.getLabelValueDir(t.mappingData);return s=E(E({},s),(o={},o[f]=s[f]*c,o)),l.isReflect("x")&&(s=E(E({},s),{x:s.x*-1})),l.isReflect("y")&&(s=E(E({},s),{y:s.y*-1})),s},e.prototype.getThemedLabelCfg=function(t){var n=this.geometry,i=this.getDefaultLabelCfg(),a=n.theme;return(0,Xs.deepMix)({},i,a.labels,t.position==="middle"?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,n,i,a){var o=this.getCoordinate(),s=o.isTransposed,l=n.points,u=o.convert(l[0]),f=o.convert(l[2]),c=this.getLabelValueDir(n),h,d,p,v,m=(0,Xs.isArray)(n.shape)?n.shape[0]:n.shape;if(m==="funnel"||m==="pyramid"){var g=(0,Xs.get)(n,"nextPoints"),x=(0,Xs.get)(n,"points");if(g){var b=o.convert(x[0]),S=o.convert(x[1]),C=o.convert(g[0]),w=o.convert(g[1]);s?(h=Math.min(C.y,b.y),p=Math.max(C.y,b.y),d=(S.x+w.x)/2,v=(b.x+C.x)/2):(h=Math.min((S.y+w.y)/2,(b.y+C.y)/2),p=Math.max((S.y+w.y)/2,(b.y+C.y)/2),d=w.x,v=b.x)}else h=Math.min(f.y,u.y),p=Math.max(f.y,u.y),d=f.x,v=u.x}else h=Math.min(f.y,u.y),p=Math.max(f.y,u.y),d=f.x,v=u.x;switch(a){case"right":t.x=d,t.y=(h+p)/2,t.textAlign=(0,Xs.get)(t,"textAlign",c>0?"left":"right");break;case"left":t.x=v,t.y=(h+p)/2,t.textAlign=(0,Xs.get)(t,"textAlign",c>0?"left":"right");break;case"bottom":s&&(t.x=(d+v)/2),t.y=p,t.textAlign=(0,Xs.get)(t,"textAlign","center"),t.textBaseline=(0,Xs.get)(t,"textBaseline",c>0?"bottom":"top");break;case"middle":s&&(t.x=(d+v)/2),t.y=(h+p)/2,t.textAlign=(0,Xs.get)(t,"textAlign","center"),t.textBaseline=(0,Xs.get)(t,"textBaseline","middle");break;case"top":s&&(t.x=(d+v)/2),t.y=h,t.textAlign=(0,Xs.get)(t,"textAlign","center"),t.textBaseline=(0,Xs.get)(t,"textBaseline",c>0?"bottom":"top");break;default:break}},e}(Ch),Jit=x8t;var f0=z(q());var qs=z(q());var NO=Math.PI/2,b8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelOffset=function(t){var n=this.getCoordinate(),i=0;if((0,qs.isNumber)(t))i=t;else if((0,qs.isString)(t)&&t.indexOf("%")!==-1){var a=n.getRadius();n.innerRadius>0&&(a=a*(1-n.innerRadius)),i=parseFloat(t)*.01*a}return i},e.prototype.getLabelItems=function(t){var n=r.prototype.getLabelItems.call(this,t),i=this.geometry.getYScale();return(0,qs.map)(n,function(a){if(a&&i){var o=i.scale((0,qs.get)(a.data,i.field));return E(E({},a),{percent:o})}return a})},e.prototype.getLabelAlign=function(t){var n=this.getCoordinate(),i;if(t.labelEmit)i=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(!n.isTransposed)i="center";else{var a=n.getCenter(),o=t.offset;Math.abs(t.x-a.x)<1?i="center":t.angle>Math.PI||t.angle<=0?i=o>0?"left":"right":i=o>0?"right":"left"}return i},e.prototype.getLabelPoint=function(t,n,i){var a=1,o,s=t.content[i];this.isToMiddle(n)?o=this.getMiddlePoint(n.points):(t.content.length===1&&i===0?i=1:i===0&&(a=-1),o=this.getArcPoint(n,i));var l=t.offset*a,u=this.getPointAngle(o),f=t.labelEmit,c=this.getCirclePoint(u,l,o,f);return c.r===0?c.content="":(c.content=s,c.angle=u,c.color=n.color),c.rotate=t.autoRotate?this.getLabelRotate(u,l,f):t.rotate,c.start={x:o.x,y:o.y},c},e.prototype.getArcPoint=function(t,n){return n===void 0&&(n=0),!(0,qs.isArray)(t.x)&&!(0,qs.isArray)(t.y)?{x:t.x,y:t.y}:{x:(0,qs.isArray)(t.x)?t.x[n]:t.x,y:(0,qs.isArray)(t.y)?t.y[n]:t.y}},e.prototype.getPointAngle=function(t){return xh(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,n,i,a){var o=this.getCoordinate(),s=o.getCenter(),l=bm(o,i);if(l===0)return E(E({},s),{r:l});var u=t;if(o.isTransposed&&l>n&&!a){var f=Math.asin(n/(2*l));u=t+f*2}else l=l+n;return{x:s.x+l*Math.cos(u),y:s.y+l*Math.sin(u),r:l}},e.prototype.getLabelRotate=function(t,n,i){var a=t+NO;return i&&(a-=NO),a&&(a>NO?a=a-Math.PI:a<-NO&&(a=a+Math.PI)),a},e.prototype.getMiddlePoint=function(t){var n=this.getCoordinate(),i=t.length,a={x:0,y:0};return(0,qs.each)(t,function(o){a.x+=o.x,a.y+=o.y}),a.x/=i,a.y/=i,a=n.convert(a),a},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(Ch),FO=b8t;var _8t=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.defaultLayout="distribute",t}return e.prototype.getDefaultLabelCfg=function(t,n){var i=r.prototype.getDefaultLabelCfg.call(this,t,n);return(0,f0.deepMix)({},i,(0,f0.get)(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(t){return r.prototype.getLabelOffset.call(this,t)||0},e.prototype.getLabelRotate=function(t,n,i){var a;return n<0&&(a=t,a>Math.PI/2&&(a=a-Math.PI),a<-Math.PI/2&&(a=a+Math.PI)),a},e.prototype.getLabelAlign=function(t){var n=this.getCoordinate(),i=n.getCenter(),a;return t.angle<=Math.PI/2&&t.x>=i.x?a="left":a="right",t.offset<=0&&(a==="right"?a="left":a="right"),a},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var n=this.getCoordinate(),i={x:(0,f0.isArray)(t.x)?t.x[0]:t.x,y:t.y[0]},a={x:(0,f0.isArray)(t.x)?t.x[1]:t.x,y:t.y[1]},o,s=xh(n,i);if(t.points&&t.points[0].y===t.points[1].y)o=s;else{var l=xh(n,a);s>=l&&(l=l+Math.PI*2),o=s+(l-s)/2}return o},e.prototype.getCirclePoint=function(t,n){var i=this.getCoordinate(),a=i.getCenter(),o=i.getRadius()+n;return E(E({},Ri(a.x,a.y,o,t)),{angle:t,r:o})},e}(FO),tat=_8t;var Cp=z(q());var eat=4;function S8t(r,e,t,n,i,a){var o=!0,s=n.start,l=n.end,u=Math.min(s.y,l.y),f=Math.abs(s.y-l.y),c,h=0,d=Number.MIN_VALUE,p=e.map(function(C){return C.y>h&&(h=C.y),C.yf&&(f=h-u);o;)for(p.forEach(function(C){var w=(Math.min.apply(d,C.targets)+Math.max.apply(d,C.targets))/2;C.pos=Math.min(Math.max(d,w-C.size/2),f-C.size)}),o=!1,c=p.length;c--;)if(c>0){var v=p[c-1],m=p[c];v.pos+v.size>m.pos&&(v.size+=m.size,v.targets=v.targets.concat(m.targets),v.pos+v.size>f&&(v.pos=f-v.size),p.splice(c,1),o=!0)}c=0,p.forEach(function(C){var w=u+t/2;C.targets.forEach(function(){e[c].y=C.pos+w,w+=t,c++})});for(var g={},x=0,b=r;x0){var l=14,u=o+i,f=u*2+l*2,c={start:a.start,end:a.end},h=[[],[]];r.forEach(function(d){!d||(d.textAlign==="right"?h[0].push(d):h[1].push(d))}),h.forEach(function(d,p){var v=f/l;d.length>v&&(d.sort(function(m,g){return g["..percent"]-m["..percent"]}),d.splice(v,d.length-v)),d.sort(function(m,g){return m.y-g.y}),S8t(e,d,l,c,s,p)})}(0,Cp.each)(r,function(d){if(d&&d.labelLine){var p=d.offset,v=d.angle,m=Ri(s.x,s.y,o,v),g=Ri(s.x,s.y,o+p/2,v),x=d.x+(0,Cp.get)(d,"offsetX",0),b=d.y+(0,Cp.get)(d,"offsetY",0),S={x:x-Math.cos(v)*eat,y:b-Math.sin(v)*eat};(0,Cp.isObject)(d.labelLine)||(d.labelLine={}),d.labelLine.path=["M ".concat(m.x),"".concat(m.y," Q").concat(g.x),"".concat(g.y," ").concat(S.x),S.y].join(",")}})}}var Vo=z(q());function BO(r,e,t){var n=r.filter(function(p){return!p.invisible});n.sort(function(p,v){return p.y-v.y});var i=!0,a=t.minY,o=t.maxY,s=Math.abs(a-o),l,u=0,f=Number.MIN_VALUE,c=n.map(function(p){return p.y>u&&(u=p.y),p.ys&&(s=u-a);i;)for(c.forEach(function(p){var v=(Math.min.apply(f,p.targets)+Math.max.apply(f,p.targets))/2;p.pos=Math.min(Math.max(f,v-p.size/2),s-p.size),p.pos=Math.max(0,p.pos)}),i=!1,l=c.length;l--;)if(l>0){var h=c[l-1],d=c[l];h.pos+h.size>d.pos&&(h.size+=d.size,h.targets=h.targets.concat(d.targets),h.pos+h.size>s&&(h.pos=s-h.size),c.splice(l,1),i=!0)}l=0,c.forEach(function(p){var v=a+e/2;p.targets.forEach(function(){n[l].y=p.pos+v,v+=e,l++})})}var nat=4;function C8t(r,e){var t=e.getCenter(),n=e.getRadius();if(r&&r.labelLine){var i=r.angle,a=r.offset,o=Ri(t.x,t.y,n,i),s=r.x+(0,Vo.get)(r,"offsetX",0)*(Math.cos(i)>0?1:-1),l=r.y+(0,Vo.get)(r,"offsetY",0)*(Math.sin(i)>0?1:-1),u={x:s-Math.cos(i)*nat,y:l-Math.sin(i)*nat},f=r.labelLine.smooth,c=[],h=u.x-t.x,d=u.y-t.y,p=Math.atan(d/h);if(h<0&&(p+=Math.PI),f===!1){(0,Vo.isObject)(r.labelLine)||(r.labelLine={});var v=0;(i<0&&i>-Math.PI/2||i>Math.PI*1.5)&&u.y>o.y&&(v=1),i>=0&&io.y&&(v=1),i>=Math.PI/2&&iu.y&&(v=1),(i<-Math.PI/2||i>=Math.PI&&iu.y&&(v=1);var m=a/2>4?4:Math.max(a/2-1,0),g=Ri(t.x,t.y,n+m,i),x=Ri(t.x,t.y,n+a/2,p),b=0;c.push("M ".concat(o.x," ").concat(o.y)),c.push("L ".concat(g.x," ").concat(g.y)),c.push("A ".concat(t.x," ").concat(t.y," 0 ").concat(b," ").concat(v," ").concat(x.x," ").concat(x.y)),c.push("L ".concat(u.x," ").concat(u.y))}else{var g=Ri(t.x,t.y,n+(a/2>4?4:Math.max(a/2-1,0)),i),S=o.xMath.pow(Math.E,-16)&&c.push.apply(c,["C",u.x+S*4,u.y,2*g.x-o.x,2*g.y-o.y,o.x,o.y]),c.push("L ".concat(o.x," ").concat(o.y))}r.labelLine.path=c.join(" ")}}function iat(r,e,t,n){var i=(0,Vo.filter)(r,function(w){return!(0,Vo.isNil)(w)}),a=e[0]&&e[0].get("coordinate");if(!!a){for(var o=a.getCenter(),s=a.getRadius(),l={},u=0,f=e;uL&&(w.sort(function(k,O){return O.percent-k.percent}),(0,Vo.each)(w,function(k,O){O+1>L&&(l[k.id].set("visible",!1),k.invisible=!0)})),BO(w,h,C)}),(0,Vo.each)(m,function(w,A){(0,Vo.each)(w,function(L){var k=A===v,O=l[L.id],M=O.getChildByIndex(0);if(M){var I=s+d,R=L.y-o.y,P=Math.pow(I,2),F=Math.pow(R,2),D=P-F>0?P-F:0,G=Math.sqrt(D),U=Math.abs(Math.cos(L.angle)*I);k?L.x=o.x+Math.max(G,U):L.x=o.x-Math.max(G,U)}M&&(M.attr("y",L.y),M.attr("x",L.x)),C8t(L,a)})})}}}var Ho=z(q());var nj=4,w8t=4,aat=4;function E8t(r,e,t){var n=e.getCenter(),i=e.getRadius(),a={x:r.x-(t?aat:-aat),y:r.y},o=Ri(n.x,n.y,i+nj,r.angle),s={x:a.x,y:a.y},l={x:o.x,y:o.y},u=Ri(n.x,n.y,i,r.angle),f="";if(a.y!==o.y){var c=t?4:-4;s.y=a.y,r.angle<0&&r.angle>=-Math.PI/2&&(s.x=Math.max(o.x,a.x-c),a.y0&&r.angleo.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-c))),r.angle>Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-c))),r.angle<-Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.ya.x||w.x===a.x&&w.y>a.y,k=(0,Ho.isNil)(w.offsetX)?w8t:w.offsetX,O=Ri(a.x,a.y,o+nj,w.angle),M=h+k;w.x=a.x+(L?1:-1)*(o+M),w.y=O.y}});var d=i.start,p=i.end,v="left",m="right",g=(0,Ho.groupBy)(r,function(w){return w.xx&&(x=Math.min(A,Math.abs(d.y-p.y)))});var b={minX:d.x,maxX:p.x,minY:a.y-x/2,maxY:a.y+x/2};(0,Ho.each)(g,function(w,A){var L=x/c;w.length>L&&(w.sort(function(k,O){return O.percent-k.percent}),(0,Ho.each)(w,function(k,O){O>L&&(s[k.id].set("visible",!1),k.invisible=!0)})),BO(w,c,b)});var S=b.minY,C=b.maxY;(0,Ho.each)(g,function(w,A){var L=A===m;(0,Ho.each)(w,function(k){var O=(0,Ho.get)(s,k&&[k.id]);if(!!O){if(k.yC){O.set("visible",!1);return}var M=O.getChildByIndex(0),I=M.getCanvasBBox(),R={x:L?I.x:I.maxX,y:I.y+I.height/2};Sh(M,k.x-R.x,k.y-R.y),k.labelLine&&E8t(k,i,L)}})})}}var sat=z(q());function lat(r,e,t,n){(0,sat.each)(e,function(i){var a=n.minX,o=n.minY,s=n.maxX,l=n.maxY,u=i.getCanvasBBox(),f=u.minX,c=u.minY,h=u.maxX,d=u.maxY,p=u.x,v=u.y,m=u.width,g=u.height,x=p,b=v;(fs?x=s-m:h>s&&(x=x-(h-s)),c>l?b=l-g:d>l&&(b=b-(d-l)),(x!==p||b!==v)&&Sh(i,x-p,b-v)})}var uat=z(q());function fat(r,e,t,n){(0,uat.each)(e,function(i,a){var o=i.getCanvasBBox(),s=t[a].getBBox();(o.minXs.maxX||o.maxY>s.maxY)&&i.remove(!0)})}var ij=z(q()),A8t=100,cat=function(){function r(e){e===void 0&&(e={}),this.bitmap={};var t=e.xGap,n=t===void 0?1:t,i=e.yGap,a=i===void 0?8:i;this.xGap=n,this.yGap=a}return r.prototype.hasGap=function(e){for(var t=!0,n=this.bitmap,i=Math.round(e.minX),a=Math.round(e.maxX),o=Math.round(e.minY),s=Math.round(e.maxY),l=i;l<=a;l+=1){if(!n[l]){n[l]={};continue}if(l===i||l===a){for(var u=o;u<=s;u++)if(n[l][u]){t=!1;break}}else if(n[l][o]||n[l][s]){t=!1;break}}return t},r.prototype.fillGap=function(e){for(var t=this.bitmap,n=Math.round(e.minX),i=Math.round(e.maxX),a=Math.round(e.minY),o=Math.round(e.maxY),s=n;s<=i;s+=1)t[s]||(t[s]={});for(var s=n;s<=i;s+=this.xGap){for(var l=a;l<=o;l+=this.yGap)t[s][l]=!0;t[s][o]=!0}if(this.yGap!==1)for(var s=a;s<=o;s+=1)t[n][s]=!0,t[i][s]=!0;if(this.xGap!==1)for(var s=n;s<=i;s+=1)t[s][a]=!0,t[s][o]=!0},r.prototype.destroy=function(){this.bitmap={}},r}();function M8t(r,e,t){t===void 0&&(t=A8t);var n=-1,i=r.attr(),a=i.x,o=i.y,s=r.getCanvasBBox(),l=Math.sqrt(s.width*s.width+s.height*s.height),u,f=-n,c=0,h=0,d=function(g){var x=g*.1;return[x*Math.cos(x),x*Math.sin(x)]};if(e.hasGap(s))return e.fillGap(s),!0;for(var p=!1,v=0,m={};Math.min(Math.abs(c),Math.abs(h))4)return[];var e=function(i,a){return[a.x-i.x,a.y-i.y]},t=e(r[0],r[1]),n=e(r[1],r[2]);return[t,n]}function GO(r,e,t){e===void 0&&(e=0),t===void 0&&(t={x:0,y:0});var n=r.x,i=r.y;return{x:(n-t.x)*Math.cos(-e)+(i-t.y)*Math.sin(-e)+t.x,y:(t.x-n)*Math.sin(-e)+(i-t.y)*Math.cos(-e)+t.y}}function mat(r){var e=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}],t=r.rotation;return t?[GO(e[0],t,e[0]),GO(e[1],t,e[0]),GO(e[2],t,e[0]),GO(e[3],t,e[0])]:e}function gat(r,e){if(r.length>4)return{min:0,max:0};var t=[];return r.forEach(function(n){t.push(I8t([n.x,n.y],e))}),{min:Math.min.apply(Math,t),max:Math.max.apply(Math,t)}}function L8t(r,e){return r.max>e.min&&r.minr.x+r.width+t||e.x+e.widthr.y+r.height+t||e.y+e.height=a.height:o.width>=a.width}function k8t(r,e,t){var n=!!r.getAdjust("stack");return n||e.every(function(i,a){var o=t[a];return P8t(r,i,o)})}function R8t(r,e,t){var n=r.coordinate,i=_a.fromObject(t.getBBox()),a=ac(e);n.isTransposed?a.attr({x:i.minX+i.width/2,textAlign:"center"}):a.attr({y:i.minY+i.height/2,textBaseline:"middle"})}function wat(r,e,t){var n;if(t.length!==0){var i=(n=t[0])===null||n===void 0?void 0:n.get("element"),a=i==null?void 0:i.geometry;if(!(!a||a.type!=="interval")){var o=k8t(a,e,t);o&&t.forEach(function(s,l){var u=e[l];R8t(a,u,s)})}}}var rf=z(q());function N8t(r){var e=500,t=[],n=Math.max(Math.floor(r.length/e),1);return(0,rf.each)(r,function(i,a){a%n==0?t.push(i):i.set("visible",!1)}),t}function Eat(r,e,t){var n;if(t.length!==0){var i=(n=t[0])===null||n===void 0?void 0:n.get("element"),a=i==null?void 0:i.geometry;if(!(!a||a.type!=="interval")){var o=N8t(e),s=a.getXYFields()[0],l=[],u=[],f=(0,rf.groupBy)(o,function(v){return v.get("data")[s]}),c=(0,rf.uniq)((0,rf.map)(o,function(v){return v.get("data")[s]})),h;o.forEach(function(v){v.set("visible",!0)});var d=function(v){v&&(v.length&&u.push(v.pop()),u.push.apply(u,v))};for((0,rf.size)(c)>0&&(h=c.shift(),d(f[h])),(0,rf.size)(c)>0&&(h=c.pop(),d(f[h])),(0,rf.each)(c.reverse(),function(v){d(f[v])});u.length>0;){var p=u.shift();p.get("visible")&&(ynt(p,l)?p.set("visible",!1):l.push(p))}}}}var x1=z(q());function F8t(r,e){var t=r.getXYFields()[1],n=[],i=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return i.length>0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,i),n}function Aat(r,e,t){return r.some(function(n){return t(n,e)})}function B8t(r,e,t){t===void 0&&(t=0);var n=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),i=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return n*i}function Mat(r,e){return Aat(r,e,function(t,n){var i=ac(t),a=ac(n);return B8t(i.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function Tat(r,e,t,n,i){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||l.type!=="point")){var u=l.getXYFields(),f=u[0],c=u[1],h=(0,x1.groupBy)(e,function(v){return v.get("data")[f]}),d=[],p=i&&i.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;(0,x1.map)((0,x1.keys)(h).reverse(),function(v){for(var m=F8t(l,h[v]);m.length;){var g=m.shift(),x=ac(g);if(Aat(d,g,function(C,w){return C.get("data")[f]===w.get("data")[f]&&C.get("data")[c]===w.get("data")[c]})){x.set("visible",!1);continue}var b=Mat(d,g),S=!1;if(b&&(x.attr("y",x.attr("y")+2*p),S=Mat(d,g)),S){x.set("visible",!1);continue}d.push(g)}})}}}var b1=z(q());function G8t(r,e){var t=r.getXYFields()[1],n=[],i=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return i.length>0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,i),n}function Iat(r,e,t){return r.some(function(n){return t(n,e)})}function z8t(r,e,t){t===void 0&&(t=0);var n=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),i=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return n*i}function Lat(r,e){return Iat(r,e,function(t,n){var i=ac(t),a=ac(n);return z8t(i.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function Oat(r,e,t,n,i){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||["path","line","area"].indexOf(l.type)<0)){var u=l.getXYFields(),f=u[0],c=u[1],h=(0,b1.groupBy)(e,function(v){return v.get("data")[f]}),d=[],p=i&&i.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;(0,b1.map)((0,b1.keys)(h).reverse(),function(v){for(var m=G8t(l,h[v]);m.length;){var g=m.shift(),x=ac(g);if(Iat(d,g,function(C,w){return C.get("data")[f]===w.get("data")[f]&&C.get("data")[c]===w.get("data")[c]})){x.set("visible",!1);continue}var b=Lat(d,g),S=!1;if(b&&(x.attr("y",x.attr("y")+2*p),S=Lat(d,g)),S){x.set("visible",!1);continue}d.push(g)}})}}}var UO=z(q());var wp=z(q());var oj;function Dat(){return oj||(oj=document.createElement("canvas").getContext("2d")),oj}var zO=(0,wp.memoize)(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant,s=Dat();return s.font=[a,o,i,"".concat(t,"px"),n].join(" "),s.measureText((0,wp.isString)(r)?r:"").width},function(r,e){return e===void 0&&(e={}),mn([r],(0,wp.values)(e),!0).join("")}),Pat=function(r,e,t){var n=16,i=zO("...",t),a;(0,wp.isString)(r)?a=r:a=(0,wp.toString)(r);var o=e,s=[],l,u;if(zO(r,t)<=e)return r;for(;l=a.substr(0,n),u=zO(l,t),!(u+i>o&&u>o);)if(s.push(l),o-=u,a=a.substr(n),!a)return s.join("");for(;l=a.substr(0,1),u=zO(l,t),!(u+i>o);)if(s.push(l),o-=u,a=a.substr(1),!a)return s.join("");return"".concat(s.join(""),"...")};function kat(r,e,t,n,i){if(!(e.length<=0)){var a=(i==null?void 0:i.direction)||["top","right","bottom","left"],o=(i==null?void 0:i.action)||"translate",s=(i==null?void 0:i.margin)||0,l=e[0].get("coordinate");if(!!l){var u=Ert(l,s),f=u.minX,c=u.minY,h=u.maxX,d=u.maxY;(0,UO.each)(e,function(p){var v=p.getCanvasBBox(),m=v.minX,g=v.minY,x=v.maxX,b=v.maxY,S=v.x,C=v.y,w=v.width,A=v.height,L=S,k=C;if(a.indexOf("left")>=0&&(m=0&&(g=0&&(m>h?L=h-w:x>h&&(L=L-(x-h))),a.indexOf("bottom")>=0&&(g>d?k=d-A:b>d&&(k=k-(b-d))),L!==S||k!==C){var O=L-S;if(o==="translate")Sh(p,O,k-C);else if(o==="ellipsis"){var M=p.findAll(function(I){return I.get("type")==="text"});M.forEach(function(I){var R=(0,UO.pick)(I.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),P=I.getCanvasBBox(),F=Pat(I.attr("text"),P.width-Math.abs(O),R);I.attr("text",F)})}else p.hide()}})}}}var jO=z(q());function Rat(r,e,t){var n={fillOpacity:(0,jO.isNil)(r.attr("fillOpacity"))?1:r.attr("fillOpacity"),strokeOpacity:(0,jO.isNil)(r.attr("strokeOpacity"))?1:r.attr("strokeOpacity"),opacity:(0,jO.isNil)(r.attr("opacity"))?1:r.attr("opacity")};r.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),r.animate(n,e)}function Nat(r,e,t){var n={fillOpacity:0,strokeOpacity:0,opacity:0},i=e.easing,a=e.duration,o=e.delay;r.animate(n,a,i,function(){r.remove(!0)},o)}function U8t(r,e,t){var n,i=e[0],a=e[1];return r.applyToMatrix([i,a,1]),t==="x"?(r.setMatrix(gr.transform(r.getMatrix(),[["t",-i,-a],["s",.01,1],["t",i,a]])),n=gr.transform(r.getMatrix(),[["t",-i,-a],["s",100,1],["t",i,a]])):t==="y"?(r.setMatrix(gr.transform(r.getMatrix(),[["t",-i,-a],["s",1,.01],["t",i,a]])),n=gr.transform(r.getMatrix(),[["t",-i,-a],["s",1,100],["t",i,a]])):t==="xy"&&(r.setMatrix(gr.transform(r.getMatrix(),[["t",-i,-a],["s",.01,.01],["t",i,a]])),n=gr.transform(r.getMatrix(),[["t",-i,-a],["s",100,100],["t",i,a]])),n}function WO(r,e,t,n,i){var a=t.start,o=t.end,s=t.getWidth(),l=t.getHeight(),u,f;i==="y"?(u=a.x+s/2,f=n.ya.x?n.x:a.x,f=a.y+l/2):i==="xy"&&(t.isPolar?(u=t.getCenter().x,f=t.getCenter().y):(u=(a.x+o.x)/2,f=(a.y+o.y)/2));var c=U8t(r,[u,f],i);r.animate({matrix:c},e)}function Fat(r,e,t){var n=t.coordinate,i=t.minYPoint;WO(r,e,n,i,"x")}function Bat(r,e,t){var n=t.coordinate,i=t.minYPoint;WO(r,e,n,i,"y")}function Gat(r,e,t){var n=t.coordinate,i=t.minYPoint;WO(r,e,n,i,"xy")}function zat(r,e,t){var n=r.getTotalLength();r.attr("lineDash",[n]),r.animate(function(i){return{lineDashOffset:(1-i)*n}},e)}function Uat(r,e,t){var n=t.toAttrs,i=n.x,a=n.y;delete n.x,delete n.y,r.attr(n),r.animate({x:i,y:a},e)}function jat(r,e,t){var n=r.getBBox(),i=r.get("origin").mappingData,a=i.points,o=a[0].y-a[1].y>0?n.maxX:n.minX,s=(n.minY+n.maxY)/2;r.applyToMatrix([o,s,1]);var l=gr.transform(r.getMatrix(),[["t",-o,-s],["s",.01,1],["t",o,s]]);r.setMatrix(l),r.animate({matrix:gr.transform(r.getMatrix(),[["t",-o,-s],["s",100,1],["t",o,s]])},e)}function Wat(r,e,t){var n=r.getBBox(),i=r.get("origin").mappingData,a=(n.minX+n.maxX)/2,o=i.points,s=o[0].y-o[1].y<=0?n.maxY:n.minY;r.applyToMatrix([a,s,1]);var l=gr.transform(r.getMatrix(),[["t",-a,-s],["s",1,.01],["t",a,s]]);r.setMatrix(l),r.animate({matrix:gr.transform(r.getMatrix(),[["t",-a,-s],["s",1,100],["t",a,s]])},e)}var Ep=z(q());function Vat(r,e){var t,n=wm(r,e),i=n.startAngle,a=n.endAngle;return!(0,Ep.isNumberEqual)(i,-Math.PI*.5)&&i<-Math.PI*.5&&(i+=Math.PI*2),!(0,Ep.isNumberEqual)(a,-Math.PI*.5)&&a<-Math.PI*.5&&(a+=Math.PI*2),e[5]===0&&(t=[a,i],i=t[0],a=t[1]),(0,Ep.isNumberEqual)(i,Math.PI*1.5)&&(i=Math.PI*-.5),(0,Ep.isNumberEqual)(a,Math.PI*-.5)&&(a=Math.PI*1.5),{startAngle:i,endAngle:a}}function Hat(r){var e;return r[0]==="M"||r[0]==="L"?e=[r[1],r[2]]:(r[0]==="a"||r[0]==="A"||r[0]==="C")&&(e=[r[r.length-2],r[r.length-1]]),e}function Yat(r){var e,t,n,i=r.filter(function(b){return b[0]==="A"||b[0]==="a"});if(i.length===0)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var a=i[0],o=i.length>1?i[1]:i[0],s=r.indexOf(a),l=r.indexOf(o),u=Hat(r[s-1]),f=Hat(r[l-1]),c=Vat(u,a),h=c.startAngle,d=c.endAngle,p=Vat(f,o),v=p.startAngle,m=p.endAngle;(0,Ep.isNumberEqual)(h,v)&&(0,Ep.isNumberEqual)(d,m)?(t=h,n=d):(t=Math.min(h,v),n=Math.max(d,m));var g=a[1],x=i[i.length-1][1];return g=0;s--)for(var l=this.getFacetsByLevel(t,s),u=0,f=l;u=d){var m=i.parsePosition([p[l],p[s.field]]);m&&h.push(m)}if(p[l]===c)return!1}),h},e.prototype.parsePercentPosition=function(t){var n=parseFloat(t[0])/100,i=parseFloat(t[1])/100,a=this.view.getCoordinate(),o=a.start,s=a.end,l={x:Math.min(o.x,s.x),y:Math.min(o.y,s.y)},u=a.getWidth()*n+l.x,f=a.getHeight()*i+l.y;return{x:u,y:f}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),n=t.start,i=t.end,a=t.getWidth(),o=t.getHeight(),s={x:Math.min(n.x,i.x),y:Math.min(n.y,i.y)};return{x:s.x,y:s.y,minX:s.x,minY:s.y,maxX:s.x+a,maxY:s.y+o,width:a,height:o}},e.prototype.getAnnotationCfg=function(t,n,i){var a=this,o=this.view.getCoordinate(),s=this.view.getCanvas(),l={};if((0,Cn.isNil)(n))return null;var u=n.start,f=n.end,c=n.position,h=this.parsePosition(u),d=this.parsePosition(f),p=this.parsePosition(c);if(["arc","image","line","region","regionFilter"].includes(t)&&(!h||!d))return null;if(["text","dataMarker","html"].includes(t)&&!p)return null;if(t==="arc"){var v=n,m=v.start,g=v.end,x=rr(v,["start","end"]),b=xh(o,h),S=xh(o,d);b>S&&(S=Math.PI*2+S),l=E(E({},x),{center:o.getCenter(),radius:bm(o,h),startAngle:b,endAngle:S})}else if(t==="image"){var C=n,w=C.start,A=C.end,x=rr(C,["start","end"]);l=E(E({},x),{start:h,end:d,src:n.src})}else if(t==="line"){var L=n,k=L.start,O=L.end,x=rr(L,["start","end"]);l=E(E({},x),{start:h,end:d,text:(0,Cn.get)(n,"text",null)})}else if(t==="region"){var M=n,I=M.start,R=M.end,x=rr(M,["start","end"]);l=E(E({},x),{start:h,end:d})}else if(t==="text"){var P=this.view.getData(),F=n,D=F.position,G=F.content,x=rr(F,["position","content"]),U=G;(0,Cn.isFunction)(G)&&(U=G(P)),l=E(E(E({},p),x),{content:U})}else if(t==="dataMarker"){var j=n,H=j.position,tt=j.point,et=j.line,ut=j.text,$=j.autoAdjust,st=j.direction,x=rr(j,["position","point","line","text","autoAdjust","direction"]);l=E(E(E({},x),p),{coordinateBBox:this.getCoordinateBBox(),point:tt,line:et,text:ut,autoAdjust:$,direction:st})}else if(t==="dataRegion"){var _t=n,dt=_t.start,gt=_t.end,Tt=_t.region,ut=_t.text,Ut=_t.lineLength,x=rr(_t,["start","end","region","text","lineLength"]);l=E(E({},x),{points:this.getRegionPoints(dt,gt),region:Tt,text:ut,lineLength:Ut})}else if(t==="regionFilter"){var $t=n,Y=$t.start,it=$t.end,K=$t.apply,Rt=$t.color,x=rr($t,["start","end","apply","color"]),Xt=this.view.geometries,Zt=[],Ae=function(Ue){!Ue||(Ue.isGroup()?Ue.getChildren().forEach(function(Ht){return Ae(Ht)}):Zt.push(Ue))};(0,Cn.each)(Xt,function(Ue){K?(0,Cn.contains)(K,Ue.type)&&(0,Cn.each)(Ue.elements,function(Ht){Ae(Ht.shape)}):(0,Cn.each)(Ue.elements,function(Ht){Ae(Ht.shape)})}),l=E(E({},x),{color:Rt,shapes:Zt,start:h,end:d})}else if(t==="shape"){var We=n,$e=We.render,W=rr(We,["render"]),Te=function(ee){if((0,Cn.isFunction)(n.render))return $e(ee,a.view,{parsePosition:a.parsePosition.bind(a)})};l=E(E({},W),{render:Te})}else if(t==="html"){var ne=n,pt=ne.html,Et=ne.position,W=rr(ne,["html","position"]),St=function(Ue){return(0,Cn.isFunction)(pt)?pt(Ue,a.view):pt};l=E(E(E({},W),p),{parent:s.get("el").parentNode,html:St})}var Wt=(0,Cn.deepMix)({},i,E(E({},l),{top:n.top,style:n.style,offsetX:n.offsetX,offsetY:n.offsetY}));return t!=="html"&&(Wt.container=this.getComponentContainer(Wt)),Wt.animate=this.view.getOptions().animate&&Wt.animate&&(0,Cn.get)(n,"animate",Wt.animate),Wt.animateOption=(0,Cn.deepMix)({},vp,Wt.animateOption,n.animateOption),Wt},e.prototype.isTop=function(t){return(0,Cn.get)(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return(0,Cn.get)(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var n=this.cache.get(this.getCacheKey(t));if(n){var i=t.type,a=this.getAnnotationTheme(i),o=this.getAnnotationCfg(i,t,a);o&&So(o,["container"]),n.component.update(E(E({},o||{}),{visible:!!o})),(0,Cn.includes)(YO,t.type)&&n.component.render()}else n=this.createAnnotation(t),n&&(n.component.init(),(0,Cn.includes)(YO,t.type)&&n.component.render());return n},e.prototype.syncCache=function(t){var n=this,i=new Map(this.cache);return t.forEach(function(a,o){i.set(o,a)}),i.forEach(function(a,o){(0,Cn.find)(n.option,function(s){return o===n.getCacheKey(s)})||(a.component.destroy(),i.delete(o))}),i},e.prototype.getCacheKey=function(t){return t},e}(Bl),aot=q8t;var Ci=z(q());var Ih=z(q());function uj(r,e){var t=(0,Ih.deepMix)({},(0,Ih.get)(r,["components","axis","common"]),(0,Ih.get)(r,["components","axis",e]));return(0,Ih.get)(t,["grid"],{})}function qE(r,e,t,n){var i=[],a=e.getTicks();return r.isPolar&&a.push({value:1,text:"",tickValue:""}),a.reduce(function(o,s,l){var u=s.value;if(n)i.push({points:[r.convert(t==="y"?{x:0,y:u}:{x:u,y:0}),r.convert(t==="y"?{x:1,y:u}:{x:u,y:1})]});else if(l){var f=o.value,c=(f+u)/2;i.push({points:[r.convert(t==="y"?{x:0,y:c}:{x:c,y:0}),r.convert(t==="y"?{x:1,y:c}:{x:c,y:1})]})}return s},a[0]),i}function XO(r,e,t,n,i){var a=e.values.length,o=[],s=t.getTicks();return s.reduce(function(l,u){var f=l?l.value:u.value,c=u.value,h=(f+c)/2;return i==="x"?o.push({points:[r.convert({x:n?c:h,y:0}),r.convert({x:n?c:h,y:1})]}):o.push({points:(0,Ih.map)(Array(a+1),function(d,p){return r.convert({x:p/a,y:n?c:h})})}),u},s[0]),o}function fj(r,e){var t=(0,Ih.get)(e,"grid");if(t===null)return!1;var n=(0,Ih.get)(r,"grid");return!(t===void 0&&n===null)}var km=["container"],oot=E(E({},vp),{appear:null}),K8t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.cache=new Map,n.gridContainer=n.view.getLayer(di.BG).addGroup(),n.gridForeContainer=n.view.getLayer(di.FORE).addGroup(),n.axisContainer=n.view.getLayer(di.BG).addGroup(),n.axisForeContainer=n.view.getLayer(di.FORE).addGroup(),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,n=this.view.getCoordinate();(0,Ci.each)(this.getComponents(),function(i){var a=i.component,o=i.direction,s=i.type,l=i.extra,u=l.dim,f=l.scale,c=l.alignTick,h;if(s===ua.AXIS)n.isPolar?u==="x"?h=n.isTransposed?gE(n,o):RL(n):u==="y"&&(h=n.isTransposed?RL(n):gE(n,o)):h=gE(n,o);else if(s===ua.GRID)if(n.isPolar){var d=void 0;n.isTransposed?d=u==="x"?XO(n,t.view.getYScales()[0],f,c,u):qE(n,f,u,c):d=u==="x"?qE(n,f,u,c):XO(n,t.view.getXScale(),f,c,u),h={items:d,center:t.view.getCoordinate().getCenter()}}else h={items:qE(n,f,u,c)};a.update(h)})},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var n=new Map;this.cache.forEach(function(i,a){t.has(a)?n.set(a,i):i.component.destroy()}),this.cache=n},e.prototype.clear=function(){r.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(n){t.push(n)}),t},e.prototype.updateXAxes=function(t){var n=this.view.getXScale();if(!(!n||n.isIdentity)){var i=Kb(this.option,n.field);if(i!==!1){var a=gU(i,xe.BOTTOM),o=di.BG,s="x",l=this.view.getCoordinate(),u=this.getId("axis",n.field),f=this.getId("grid",n.field);if(l.isRect){var c=this.cache.get(u);if(c){var h=this.getLineAxisCfg(n,i,a);So(h,km),c.component.update(h),t.set(u,c)}else c=this.createLineAxis(n,i,o,a,s),this.cache.set(u,c),t.set(u,c);var d=this.cache.get(f);if(d){var h=this.getLineGridCfg(n,i,a,s);So(h,km),d.component.update(h),t.set(f,d)}else d=this.createLineGrid(n,i,o,a,s),d&&(this.cache.set(f,d),t.set(f,d))}else if(l.isPolar){var c=this.cache.get(u);if(c){var h=l.isTransposed?this.getLineAxisCfg(n,i,xe.RADIUS):this.getCircleAxisCfg(n,i,a);So(h,km),c.component.update(h),t.set(u,c)}else{if(l.isTransposed){if((0,Ci.isUndefined)(i))return;c=this.createLineAxis(n,i,o,xe.RADIUS,s)}else c=this.createCircleAxis(n,i,o,a,s);this.cache.set(u,c),t.set(u,c)}var d=this.cache.get(f);if(d){var h=l.isTransposed?this.getCircleGridCfg(n,i,xe.RADIUS,s):this.getLineGridCfg(n,i,xe.CIRCLE,s);So(h,km),d.component.update(h),t.set(f,d)}else{if(l.isTransposed){if((0,Ci.isUndefined)(i))return;d=this.createCircleGrid(n,i,o,xe.RADIUS,s)}else d=this.createLineGrid(n,i,o,xe.CIRCLE,s);d&&(this.cache.set(f,d),t.set(f,d))}}}}},e.prototype.updateYAxes=function(t){var n=this,i=this.view.getYScales();(0,Ci.each)(i,function(a,o){if(!(!a||a.isIdentity)){var s=a.field,l=Kb(n.option,s);if(l!==!1){var u=di.BG,f="y",c=n.getId("axis",s),h=n.getId("grid",s),d=n.view.getCoordinate();if(d.isRect){var p=gU(l,o===0?xe.LEFT:xe.RIGHT),v=n.cache.get(c);if(v){var m=n.getLineAxisCfg(a,l,p);So(m,km),v.component.update(m),t.set(c,v)}else v=n.createLineAxis(a,l,u,p,f),n.cache.set(c,v),t.set(c,v);var g=n.cache.get(h);if(g){var m=n.getLineGridCfg(a,l,p,f);So(m,km),g.component.update(m),t.set(h,g)}else g=n.createLineGrid(a,l,u,p,f),g&&(n.cache.set(h,g),t.set(h,g))}else if(d.isPolar){var v=n.cache.get(c);if(v){var m=d.isTransposed?n.getCircleAxisCfg(a,l,xe.CIRCLE):n.getLineAxisCfg(a,l,xe.RADIUS);So(m,km),v.component.update(m),t.set(c,v)}else{if(d.isTransposed){if((0,Ci.isUndefined)(l))return;v=n.createCircleAxis(a,l,u,xe.CIRCLE,f)}else v=n.createLineAxis(a,l,u,xe.RADIUS,f);n.cache.set(c,v),t.set(c,v)}var g=n.cache.get(h);if(g){var m=d.isTransposed?n.getLineGridCfg(a,l,xe.CIRCLE,f):n.getCircleGridCfg(a,l,xe.RADIUS,f);So(m,km),g.component.update(m),t.set(h,g)}else{if(d.isTransposed){if((0,Ci.isUndefined)(l))return;g=n.createLineGrid(a,l,u,xe.CIRCLE,f)}else g=n.createCircleGrid(a,l,u,xe.RADIUS,f);g&&(n.cache.set(h,g),t.set(h,g))}}}}})},e.prototype.createLineAxis=function(t,n,i,a,o){var s={component:new prt(this.getLineAxisCfg(t,n,a)),layer:i,direction:a===xe.RADIUS?xe.NONE:a,type:ua.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createLineGrid=function(t,n,i,a,o){var s=this.getLineGridCfg(t,n,a,o);if(s){var l={component:new mrt(s),layer:i,direction:xe.NONE,type:ua.GRID,extra:{dim:o,scale:t,alignTick:(0,Ci.get)(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.createCircleAxis=function(t,n,i,a,o){var s={component:new vrt(this.getCircleAxisCfg(t,n,a)),layer:i,direction:a,type:ua.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createCircleGrid=function(t,n,i,a,o){var s=this.getCircleGridCfg(t,n,a,o);if(s){var l={component:new grt(s),layer:i,direction:xe.NONE,type:ua.GRID,extra:{dim:o,scale:t,alignTick:(0,Ci.get)(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.getLineAxisCfg=function(t,n,i){var a=(0,Ci.get)(n,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=gE(o,i),l=yU(t,n),u=yE(this.view.getTheme(),i),f=(0,Ci.get)(n,["title"])?(0,Ci.deepMix)({title:{style:{text:l}}},{title:mU(this.view.getTheme(),i,n.title)},n):n,c=(0,Ci.deepMix)(E(E({container:a},s),{ticks:t.getTicks().map(function(b){return{id:"".concat(b.tickValue),name:b.text,value:b.value}}),verticalFactor:o.isPolar?vU(s,o.getCenter())*-1:vU(s,o.getCenter()),theme:u}),u,f),h=this.getAnimateCfg(c),d=h.animate,p=h.animateOption;c.animateOption=p,c.animate=d;var v=pU(s),m=(0,Ci.get)(c,"verticalLimitLength",v?1/3:1/2);if(m<=1){var g=this.view.getCanvas().get("width"),x=this.view.getCanvas().get("height");c.verticalLimitLength=m*(v?g:x)}return c},e.prototype.getLineGridCfg=function(t,n,i,a){if(!!fj(yE(this.view.getTheme(),i),n)){var o=uj(this.view.getTheme(),i),s=(0,Ci.deepMix)({container:(0,Ci.get)(n,["top"])?this.gridForeContainer:this.gridContainer},o,(0,Ci.get)(n,"grid"),this.getAnimateCfg(n));return s.items=qE(this.view.getCoordinate(),t,a,(0,Ci.get)(s,"alignTick",!0)),s}},e.prototype.getCircleAxisCfg=function(t,n,i){var a=(0,Ci.get)(n,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=t.getTicks().map(function(v){return{id:"".concat(v.tickValue),name:v.text,value:v.value}});!t.isCategory&&Math.abs(o.endAngle-o.startAngle)===Math.PI*2&&s.pop();var l=yU(t,n),u=yE(this.view.getTheme(),xe.CIRCLE),f=(0,Ci.get)(n,["title"])?(0,Ci.deepMix)({title:{style:{text:l}}},{title:mU(this.view.getTheme(),i,n.title)},n):n,c=(0,Ci.deepMix)(E(E({container:a},RL(this.view.getCoordinate())),{ticks:s,verticalFactor:1,theme:u}),u,f),h=this.getAnimateCfg(c),d=h.animate,p=h.animateOption;return c.animate=d,c.animateOption=p,c},e.prototype.getCircleGridCfg=function(t,n,i,a){if(!!fj(yE(this.view.getTheme(),i),n)){var o=uj(this.view.getTheme(),xe.RADIUS),s=(0,Ci.deepMix)({container:(0,Ci.get)(n,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},o,(0,Ci.get)(n,"grid"),this.getAnimateCfg(n)),l=(0,Ci.get)(s,"alignTick",!0),u=a==="x"?this.view.getYScales()[0]:this.view.getXScale();return s.items=XO(this.view.getCoordinate(),u,t,l,a),s}},e.prototype.getId=function(t,n){var i=this.view.getCoordinate();return"".concat(t,"-").concat(n,"-").concat(i.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&(0,Ci.get)(t,"animate"),animateOption:t&&t.animateOption?(0,Ci.deepMix)({},oot,t.animateOption):oot}},e}(Bl),sot=K8t;var Vn=z(q());function uc(r,e,t){return t===xe.TOP?[r.minX+r.width/2-e.width/2,r.minY]:t===xe.BOTTOM?[r.minX+r.width/2-e.width/2,r.maxY-e.height]:t===xe.LEFT?[r.minX,r.minY+r.height/2-e.height/2]:t===xe.RIGHT?[r.maxX-e.width,r.minY+r.height/2-e.height/2]:t===xe.TOP_LEFT||t===xe.LEFT_TOP?[r.tl.x,r.tl.y]:t===xe.TOP_RIGHT||t===xe.RIGHT_TOP?[r.tr.x-e.width,r.tr.y]:t===xe.BOTTOM_LEFT||t===xe.LEFT_BOTTOM?[r.bl.x,r.bl.y-e.height]:t===xe.BOTTOM_RIGHT||t===xe.RIGHT_BOTTOM?[r.br.x-e.width,r.br.y-e.height]:[0,0]}function lot(r,e){return(0,Vn.isBoolean)(r)?r===!1?!1:{}:(0,Vn.get)(r,[e],r)}function qO(r){return(0,Vn.get)(r,"position",xe.BOTTOM)}var Z8t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.container=n.view.getLayer(di.FORE).addGroup(),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,(0,Vn.each)(this.components,function(n){var i=n.component,a=n.direction,o=nO(a),s=i.get("maxWidthRatio"),l=i.get("maxHeightRatio"),u=t.getCategoryLegendSizeCfg(o,s,l),f=i.get("maxWidth"),c=i.get("maxHeight");i.update({maxWidth:Math.min(u.maxWidth,f||0),maxHeight:Math.min(u.maxHeight,c||0)});var h=i.get("padding"),d=i.getLayoutBBox(),p=new _a(d.x,d.y,d.width,d.height).expand(h),v=uc(t.view.viewBBox,p,a),m=v[0],g=v[1],x=uc(t.layoutBBox,p,a),b=x[0],S=x[1],C=0,w=0;a.startsWith("top")||a.startsWith("bottom")?(C=m,w=S):(C=b,w=g),i.setLocation({x:C+h[3],y:w+h[0]}),t.layoutBBox=t.layoutBBox.cut(p,a)})},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var n={},i=function(h,d,p){var v=t.getId(p.field),m=t.getComponentById(v);if(m){var g=void 0,x=lot(t.option,p.field);x!==!1&&((0,Vn.get)(x,"custom")?g=t.getCategoryCfg(h,d,p,x,!0):p.isLinear?g=t.getContinuousCfg(h,d,p,x):p.isCategory&&(g=t.getCategoryCfg(h,d,p,x))),g&&(So(g,["container"]),m.direction=qO(x),m.component.update(g),n[v]=!0)}else{var b=t.createFieldLegend(h,d,p);b&&(b.component.init(),t.components.push(b),n[v]=!0)}};if((0,Vn.get)(this.option,"custom")){var a="global-custom",o=this.getComponentById(a);if(o){var s=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);So(s,["container"]),o.component.update(s),n[a]=!0}else{var l=this.createCustomLegend(void 0,void 0,void 0,this.option);if(l){l.init();var u=di.FORE,f=qO(this.option);this.components.push({id:a,component:l,layer:u,direction:f,type:ua.LEGEND,extra:void 0}),n[a]=!0}}}else this.loopLegends(i);var c=[];(0,Vn.each)(this.getComponents(),function(h){n[h.id]?c.push(h):h.component.destroy()}),this.components=c},e.prototype.clear=function(){r.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var n=this,i=t.geometries;return(0,Vn.each)(t.views,function(a){i=i.concat(n.getGeometries(a))}),i},e.prototype.loopLegends=function(t){var n=this.view.getRootView()===this.view;if(!!n){var i=this.getGeometries(this.view),a={};(0,Vn.each)(i,function(o){var s=o.getGroupAttributes();(0,Vn.each)(s,function(l){var u=l.getScale(l.type);!u||u.type==="identity"||a[u.field]||(t(o,l,u),a[u.field]=!0)})})}},e.prototype.createFieldLegend=function(t,n,i){var a,o=lot(this.option,i.field),s=di.FORE,l=qO(o);if(o!==!1&&((0,Vn.get)(o,"custom")?a=this.createCustomLegend(t,n,i,o):i.isLinear?a=this.createContinuousLegend(t,n,i,o):i.isCategory&&(a=this.createCategoryLegend(t,n,i,o))),a)return a.set("field",i.field),{id:this.getId(i.field),component:a,layer:s,direction:l,type:ua.LEGEND,extra:{scale:i}}},e.prototype.createCustomLegend=function(t,n,i,a){var o=this.getCategoryCfg(t,n,i,a,!0);return new hU(o)},e.prototype.createContinuousLegend=function(t,n,i,a){var o=this.getContinuousCfg(t,n,i,So(a,["value"]));return new yrt(o)},e.prototype.createCategoryLegend=function(t,n,i,a){var o=this.getCategoryCfg(t,n,i,a);return new hU(o)},e.prototype.getContinuousCfg=function(t,n,i,a){var o=i.getTicks(),s=(0,Vn.find)(o,function(v){return v.value===0}),l=(0,Vn.find)(o,function(v){return v.value===1}),u=o.map(function(v){var m=v.value,g=v.tickValue,x=n.mapping(i.invert(m)).join("");return{value:g,attrValue:x,color:x,scaleValue:m}});s||u.push({value:i.min,attrValue:n.mapping(i.invert(0)).join(""),color:n.mapping(i.invert(0)).join(""),scaleValue:0}),l||u.push({value:i.max,attrValue:n.mapping(i.invert(1)).join(""),color:n.mapping(i.invert(1)).join(""),scaleValue:1}),u.sort(function(v,m){return v.value-m.value});var f={min:(0,Vn.head)(u).value,max:(0,Vn.last)(u).value,colors:[],rail:{type:n.type},track:{}};n.type==="size"&&(f.track={style:{fill:n.type==="size"?this.view.getTheme().defaultColor:void 0}}),n.type==="color"&&(f.colors=u.map(function(v){return v.attrValue}));var c=this.container,h=qO(a),d=nO(h),p=(0,Vn.get)(a,"title");return p&&(p=(0,Vn.deepMix)({text:_m(i)},p)),f.container=c,f.layout=d,f.title=p,f.animateOption=vp,this.mergeLegendCfg(f,a,"continuous")},e.prototype.getCategoryCfg=function(t,n,i,a,o){var s=this.container,l=(0,Vn.get)(a,"position",xe.BOTTOM),u=kU(this.view.getTheme(),l),f=(0,Vn.get)(u,["marker"]),c=(0,Vn.get)(a,"marker"),h=nO(l),d=(0,Vn.get)(u,["pageNavigator"]),p=(0,Vn.get)(a,"pageNavigator"),v=o?Snt(f,c,a.items):iO(this.view,t,n,f,c),m=(0,Vn.get)(a,"title");m&&(m=(0,Vn.deepMix)({text:i?_m(i):""},m));var g=(0,Vn.get)(a,"maxWidthRatio"),x=(0,Vn.get)(a,"maxHeightRatio"),b=this.getCategoryLegendSizeCfg(h,g,x);b.container=s,b.layout=h,b.items=v,b.title=m,b.animateOption=vp,b.pageNavigator=(0,Vn.deepMix)({},d,p);var S=this.mergeLegendCfg(b,a,l);S.reversed&&S.items.reverse();var C=(0,Vn.get)(S,"maxItemWidth");return C&&C<=1&&(S.maxItemWidth=this.view.viewBBox.width*C),S},e.prototype.mergeLegendCfg=function(t,n,i){var a=i.split("-")[0],o=kU(this.view.getTheme(),a);return(0,Vn.deepMix)({},o,t,n)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return(0,Vn.find)(this.components,function(n){return n.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,n,i){n===void 0&&(n=a4),i===void 0&&(i=a4);var a=this.view.viewBBox,o=a.width,s=a.height;return t==="vertical"?{maxWidth:o*n,maxHeight:s}:{maxWidth:o,maxHeight:s*i}},e}(Bl),uot=Z8t;var vi=z(q());var $8t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.onChangeFn=vi.noop,n.resetMeasure=function(){n.clear()},n.onValueChange=function(i){var a=i[0],o=i[1];n.start=a,n.end=o,n.changeViewData(a,o)},n.container=n.view.getLayer(di.FORE).addGroup(),n.onChangeFn=(0,vi.throttle)(n.onValueChange,20,{leading:!0}),n.width=0,n.view.on(wr.BEFORE_CHANGE_DATA,n.resetMeasure),n.view.on(wr.BEFORE_CHANGE_SIZE,n.resetMeasure),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(wr.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(wr.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),n=t.start,i=t.end;(0,vi.isNil)(this.start)&&(this.start=n,this.end=i);var a=this.view.getOptions().data;this.option&&!(0,vi.isEmpty)(a)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var n=this.view.coordinateBBox.width,i=this.slider.component.get("padding"),a=i[0],o=i[1],s=i[2],l=i[3],u=this.slider.component.getLayoutBBox(),f=new _a(u.x,u.y,Math.min(u.width,n),u.height).expand(i),c=this.getMinMaxText(this.start,this.end),h=c.minText,d=c.maxText,p=uc(this.view.viewBBox,f,xe.BOTTOM),v=p[0],m=p[1],g=uc(this.view.coordinateBBox,f,xe.BOTTOM),x=g[0],b=g[1];this.slider.component.update(E(E({},this.getSliderCfg()),{x:x+l,y:m+a,width:this.width,start:this.start,end:this.end,minText:h,maxText:d})),this.view.viewBBox=this.view.viewBBox.cut(f,xe.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),n=new vE(E({container:this.container},t));return n.init(),{component:n,layer:di.FORE,direction:xe.BOTTOM,type:ua.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var n=this.getMinMaxText(this.start,this.end),i=n.minText,a=n.maxText;t=E(E({},t),{width:this.width,start:this.start,end:this.end,minText:i,maxText:a})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if((0,vi.isObject)(this.option)){var n=E({data:this.getData()},(0,vi.get)(this.option,"trendCfg",{}));t=(0,vi.deepMix)({},t,this.getThemeOptions(),this.option),t=E(E({},t),{trendCfg:n})}return t.start=(0,vi.clamp)(Math.min((0,vi.isNil)(t.start)?0:t.start,(0,vi.isNil)(t.end)?1:t.end),0,1),t.end=(0,vi.clamp)(Math.max((0,vi.isNil)(t.start)?0:t.start,(0,vi.isNil)(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,n=this.view.getYScales()[0],i=this.view.getGroupScales();if(i.length){var a=i[0],o=a.field,s=a.ticks;return t.reduce(function(l,u){return u[o]===s[0]&&l.push(u[n.field]),l},[])}return t.map(function(l){return l[n.field]||0})},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,vi.get)(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,n){var i=this.view.getOptions().data,a=this.view.getXScale(),o=!0,s=(0,vi.valuesOfKey)(i,a.field);a.isLinear&&(s=s.sort());var l=o?s:s.reverse(),u=(0,vi.size)(i);if(!a||!u)return{};var f=(0,vi.size)(l),c=Math.floor(t*(f-1)),h=Math.floor(n*(f-1)),d=(0,vi.get)(l,[c]),p=(0,vi.get)(l,[h]),v=this.getSliderCfg().formatter;return v&&(d=v(d,i[c],c),p=v(p,i[h],h)),{minText:d,maxText:p}},e.prototype.changeViewData=function(t,n){var i=this.view.getOptions().data,a=this.view.getXScale(),o=(0,vi.size)(i);if(!(!a||!o)){var s=!0,l=(0,vi.valuesOfKey)(i,a.field),u=this.view.getXScale().isLinear?l.sort(function(p,v){return Number(p)-Number(v)}):l,f=s?u:u.reverse(),c=(0,vi.size)(f),h=Math.floor(t*(c-1)),d=Math.floor(n*(c-1));this.view.filter(a.field,function(p,v){var m=f.indexOf(p);return m>-1?up(m,h,d):!0}),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(Bl),fot=$8t;var Ca=z(q());var KO=0,cot=8,Q8t=32,J8t=20,tHt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.onChangeFn=Ca.noop,n.resetMeasure=function(){n.clear()},n.onValueChange=function(i){var a=i.ratio,o=n.getValidScrollbarCfg().animate;n.ratio=(0,Ca.clamp)(a,0,1);var s=n.view.getOptions().animate;o||n.view.animate(!1),n.changeViewData(n.getScrollRange(),!0),n.view.animate(s)},n.container=n.view.getLayer(di.FORE).addGroup(),n.onChangeFn=(0,Ca.throttle)(n.onValueChange,20,{leading:!0}),n.trackLen=0,n.thumbLen=0,n.ratio=0,n.view.on(wr.BEFORE_CHANGE_DATA,n.resetMeasure),n.view.on(wr.BEFORE_CHANGE_SIZE,n.resetMeasure),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(wr.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(wr.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var n=this.view.coordinateBBox.width,i=this.scrollbar.component.get("padding"),a=this.scrollbar.component.getLayoutBBox(),o=new _a(a.x,a.y,Math.min(a.width,n),a.height).expand(i),s=this.getScrollbarComponentCfg(),l=void 0,u=void 0;if(s.isHorizontal){var f=uc(this.view.viewBBox,o,xe.BOTTOM),c=f[0],h=f[1],d=uc(this.view.coordinateBBox,o,xe.BOTTOM),p=d[0],v=d[1];l=p,u=h}else{var m=uc(this.view.viewBBox,o,xe.RIGHT),c=m[0],h=m[1],g=uc(this.view.viewBBox,o,xe.RIGHT),p=g[0],v=g[1];l=p,u=h}l+=i[3],u+=i[0],this.trackLen?this.scrollbar.component.update(E(E({},s),{x:l,y:u,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(E(E({},s),{x:l,y:u})),this.view.viewBBox=this.view.viewBBox.cut(o,s.isHorizontal?xe.BOTTOM:xe.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Ca.get)(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var n=(0,Ca.get)(this.view.getTheme(),["components","scrollbar"]),i=t||{},a=i.thumbHighlightColor,o=rr(i,["thumbHighlightColor"]);return{default:(0,Ca.deepMix)({},(0,Ca.get)(n,["default","style"],{}),o),hover:(0,Ca.deepMix)({},(0,Ca.get)(n,["hover","style"],{}),{thumbColor:a})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),n=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var i=this.getScrollbarComponentCfg(),a=i.trackLen,o=i.thumbLen;this.trackLen=a,this.thumbLen=o,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=n},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*(0,Ca.clamp)(this.ratio,0,1)),n=Math.min(t+this.step-1,this.cnt-1);return[t,n]},e.prototype.changeViewData=function(t,n){var i=this,a=t[0],o=t[1],s=this.getValidScrollbarCfg().type,l=s!=="vertical",u=(0,Ca.valuesOfKey)(this.data,this.xScaleCfg.field),f=this.view.getXScale().isLinear?u.sort(function(h,d){return Number(h)-Number(d)}):u,c=l?f:f.reverse();this.yScalesCfg.forEach(function(h){i.view.scale(h.field,{formatter:h.formatter,type:h.type,min:h.min,max:h.max,tickMethod:h.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(h){var d=c.indexOf(h);return d>-1?up(d,a,o):!0}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t=this.getValidScrollbarCfg().type,n=t!=="vertical",i=new IL(E(E({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return i.init(),{component:i,layer:di.FORE,direction:n?xe.BOTTOM:xe.RIGHT,type:ua.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),n=this.trackLen?E(E({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):E({},t);return this.scrollbar.component.update(n),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,n=this.getValidScrollbarCfg(),i=n.type,a=n.categorySize,o=i!=="vertical";return Math.floor((o?t.width:t.height)/a)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),n=this.getScrollbarData(),i=(0,Ca.valuesOfKey)(n,t.field);return(0,Ca.size)(i)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,n=t.coordinateBBox,i=t.viewBBox,a=this.getValidScrollbarCfg(),o=a.type,s=a.padding,l=a.width,u=a.height,f=a.style,c=o!=="vertical",h=s[0],d=s[1],p=s[2],v=s[3],m=c?{x:n.minX+v,y:i.maxY-u-p}:{x:i.maxX-l-d,y:n.minY+h},g=this.getStep(),x=this.getCnt(),b=c?n.width-v-d:n.height-h-p,S=Math.max(b*(0,Ca.clamp)(g/x,0,1),J8t);return E(E({},this.getThemeOptions()),{x:m.x,y:m.y,size:c?u:l,isHorizontal:c,trackLen:b,thumbLen:S,thumbOffset:0,theme:this.getScrollbarTheme(f)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:Q8t,width:cot,height:cot,padding:[0,0,0,0],animate:!0,style:{}};return(0,Ca.isObject)(this.option)&&(t=E(E({},t),this.option)),(!(0,Ca.isObject)(this.option)||!this.option.padding)&&(t.padding=t.type==="horizontal"?[KO,0,KO,0]:[0,KO,0,KO]),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),n=this.getValidScrollbarCfg(),i=this.view.getOptions().data||[];return t.isReflect("y")&&n.type==="vertical"&&(i=mn([],i,!0).reverse()),i},e}(Bl),hot=tHt;var za=z(q());var eHt={fill:"#CCD6EC",opacity:.3};function rHt(r,e,t){var n=Jrt(r,e,t);if(n.length){n=(0,za.flatten)(n);for(var i=0,a=n;i1){for(var p=n[0],v=Math.abs(e.y-p[0].y),m=0,g=n;md.maxY&&(d=j)):(j.minXd.maxX&&(d=j)),p.x=Math.min(j.minX,p.minX),p.y=Math.min(j.minY,p.minY),p.width=Math.max(j.maxX,p.maxX)-p.x,p.height=Math.max(j.maxY,p.maxY)-p.y});var v=n.backgroundGroup,m=n.coordinateBBox,g=void 0;if(c.isRect){var x=n.getXScale(),b=t||{},S=b.appendRatio,C=b.appendWidth;(0,za.isNil)(C)&&(S=(0,za.isNil)(S)?x.isLinear?0:.25:S,C=c.isTransposed?S*d.height:S*h.width);var w=void 0,A=void 0,L=void 0,k=void 0;c.isTransposed?(w=m.minX,A=Math.min(d.minY,h.minY)-C,L=m.width,k=p.height+C*2):(w=Math.min(h.minX,d.minX)-C,A=m.minY,L=p.width+C*2,k=m.height),g=[["M",w,A],["L",w+L,A],["L",w+L,A+k],["L",w,A+k],["Z"]]}else{var O=(0,za.head)(u),M=(0,za.last)(u),I=lp(O.getModel(),c).startAngle,R=lp(M.getModel(),c).endAngle,P=c.getCenter(),F=c.getRadius(),D=c.innerRadius*F;g=xu(P.x,P.y,F,I,R,D)}if(this.regionPath)this.regionPath.attr("path",g),this.regionPath.show();else{var G=(0,za.get)(t,"style",eHt);this.regionPath=v.addShape({type:"path",name:"active-region",capture:!1,attrs:E(E({},G),{path:g})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),r.prototype.destroy.call(this)},e}(Ir),dot=nHt;var cj=z(q());var ZO=z(q());var iHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.show=function(){var t=this.context,n=t.event,i=t.view,a=i.isTooltipLocked();if(!a){var o=this.timeStamp,s=+new Date,l=(0,ZO.get)(t.view.getOptions(),"tooltip.showDelay",16);if(s-o>l){var u=this.location,f={x:n.x,y:n.y};(!u||!(0,ZO.isEqual)(u,f))&&this.showTooltip(i,f),this.timeStamp=s,this.location=f}}},e.prototype.hide=function(){var t=this.context.view,n=t.getController("tooltip"),i=this.context.event,a=i.clientX,o=i.clientY;n.isCursorEntered({x:a,y:o})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,n){t.showTooltip(n)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(Ir),$O=iHt;var aHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.showTooltip=function(t,n){var i=Nl(t);(0,cj.each)(i,function(a){var o=VL(t,a,n);a.showTooltip(o)})},e.prototype.hideTooltip=function(t){var n=Nl(t);(0,cj.each)(n,function(i){i.hideTooltip()})},e}($O),pot=aHt;var _1=z(q());var oHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context,n=t.event,i=this.timeStamp,a=+new Date;if(a-i>16){var o=this.location,s={x:n.x,y:n.y};(!o||!(0,_1.isEqual)(o,s))&&this.showTooltip(s),this.timeStamp=a,this.location=s}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var n=this.context,i=n.event,a=i.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=a.get("tip");this.tooltip.update(E({title:o},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,n=this.context.view,i=n.canvas,a={start:{x:0,y:0},end:{x:i.get("width"),y:i.get("height")}},o=n.getTheme(),s=(0,_1.get)(o,["components","tooltip","domStyles"],{}),l=new qb({parent:i.get("el").parentNode,region:a,visible:!1,crosshairs:null,domStyles:E({},(0,_1.deepMix)({},s,(t={},t[is.CONTAINER_CLASS]={"max-width":"50%"},t[is.TITLE_CLASS]={"word-break":"break-all"},t)))});l.init(),l.setCapture(!1),this.tooltip=l},e}(Ir),vot=oHt;var C1=z(q());var mot=z(q());var sHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t}return e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,n){t.setState(this.stateName,n)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var n=this,i=UL(t,this.stateName);(0,mot.each)(i,function(a){n.setElementState(a,!1)})},e}(Ir),S1=sHt;function got(r){return(0,C1.get)(r.get("delegateObject"),"item")}var lHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.ignoreListItemStates=["unchecked"],t}return e.prototype.isItemIgnore=function(t,n){var i=this.ignoreListItemStates,a=i.filter(function(o){return n.hasState(t,o)});return!!a.length},e.prototype.setStateByComponent=function(t,n,i){var a=this.context.view,o=t.get("field"),s=Hi(a);this.setElementsStateByItem(s,o,n,i)},e.prototype.setStateByElement=function(t,n){this.setElementState(t,n)},e.prototype.isMathItem=function(t,n,i){var a=this.context.view,o=bh(a,n),s=ls(t,n);return!(0,C1.isNil)(s)&&i.name===o.getText(s)},e.prototype.setElementsStateByItem=function(t,n,i,a){var o=this;(0,C1.each)(t,function(s){o.isMathItem(s,n,i)&&s.setState(o.stateName,a)})},e.prototype.setStateEnable=function(t){var n=bu(this.context);if(n)BL(this.context)&&this.setStateByElement(n,t);else{var i=ic(this.context);if(hp(i)){var a=i.item,o=i.component;if(a&&o&&!this.isItemIgnore(a,o)){var s=this.context.event.gEvent;if(s&&s.fromShape&&s.toShape&&got(s.fromShape)===got(s.toShape))return;this.setStateByComponent(o,a,t)}}}},e.prototype.toggle=function(){var t=bu(this.context);if(t){var n=t.hasState(this.stateName);this.setElementState(t,!n)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(S1),w1=lHt;var uHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(w1),yot=uHt;var E1=z(q()),fHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.cache={},t}return e.prototype.getColorScale=function(t,n){var i=n.geometry.getAttribute("color");if(!i)return null;var a=t.getScaleByField(i.getFields()[0]);return a},e.prototype.getLinkPath=function(t,n){var i=this.context.view,a=i.getCoordinate().isTransposed,o=t.shape.getCanvasBBox(),s=n.shape.getCanvasBBox(),l=a?[["M",o.minX,o.minY],["L",s.minX,s.maxY],["L",s.maxX,s.maxY],["L",o.maxX,o.minY],["Z"]]:[["M",o.maxX,o.minY],["L",s.minX,s.minY],["L",s.minX,s.maxY],["L",o.maxX,o.maxY],["Z"]];return l},e.prototype.addLinkShape=function(t,n,i,a){var o={opacity:.4,fill:n.shape.attr("fill")};t.addShape({type:"path",attrs:E(E({},(0,E1.deepMix)({},o,(0,E1.isFunction)(a)?a(o,n):a)),{path:this.getLinkPath(n,i)})})},e.prototype.linkByElement=function(t,n){var i=this,a=this.context.view,o=this.getColorScale(a,t);if(!!o){var s=ls(t,o.field);if(!this.cache[s]){var l=Brt(a,o.field,s),u=this.linkGroup,f=u.addGroup();this.cache[s]=f;var c=l.length;(0,E1.each)(l,function(h,d){if(d=0},n)},e}(A1),dj=yHt;var xHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,n){var i=this.context.view,a=Hi(i);QO(a,function(o){return t===o},n)},e.prototype.clear=function(){var t=this.context.view;T1(t)},e}(M1),wot=xHt;var bHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(A1),Eot=bHt;var _Ht=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(w1),Aot=_Ht;var SHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(M1),Mot=SHt;var QE=z(q());var CHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t.ignoreItemStates=[],t}return e.prototype.getTriggerListInfo=function(){var t=ic(this.context),n=null;return hp(t)&&(n={item:t.item,list:t.component}),n},e.prototype.getAllowComponents=function(){var t=this,n=this.context.view,i=WL(n),a=[];return(0,QE.each)(i,function(o){o.isList()&&t.allowSetStateByElement(o)&&a.push(o)}),a},e.prototype.hasState=function(t,n){return t.hasState(n,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,n=this.getAllowComponents();(0,QE.each)(n,function(i){i.clearItemsState(t.stateName)})},e.prototype.allowSetStateByElement=function(t){var n=t.get("field");if(!n)return!1;if(this.cfg&&this.cfg.componentNames){var i=t.get("name");if(this.cfg.componentNames.indexOf(i)===-1)return!1}var a=this.context.view,o=bh(a,n);return o&&o.isCategory},e.prototype.allowSetStateByItem=function(t,n){var i=this.ignoreItemStates;if(i.length){var a=i.filter(function(o){return n.hasState(t,o)});return a.length===0}return!0},e.prototype.setStateByElement=function(t,n,i){var a=t.get("field"),o=this.context.view,s=bh(o,a),l=ls(n,a),u=s.getText(l);this.setItemsState(t,u,i)},e.prototype.setStateEnable=function(t){var n=this,i=bu(this.context);if(i){var a=this.getAllowComponents();(0,QE.each)(a,function(u){n.setStateByElement(u,i,t)})}else{var o=ic(this.context);if(hp(o)){var s=o.item,l=o.component;this.allowSetStateByElement(l)&&this.allowSetStateByItem(s,l)&&this.setItemState(l,s,t)}}},e.prototype.setItemsState=function(t,n,i){var a=this,o=t.getItems();(0,QE.each)(o,function(s){s.name===n&&a.setItemState(t,s,i)})},e.prototype.setItemState=function(t,n,i){t.setItemState(n,this.stateName,i)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var n=t.list,i=t.item,a=this.hasState(n,i);this.setItemState(n,i,!a)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(Ir),zl=CHt;var wHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(zl),Tot=wHt;var JE=z(q());var Iot=z(q()),Lot="inactive",Oot="active";function Dot(r){var e=r.getItems();(0,Iot.each)(e,function(t){r.hasState(t,Oot)&&r.setItemState(t,Oot,!1),r.hasState(t,Lot)&&r.setItemState(t,Lot,!1)})}var tA="inactive",c0="active",EHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=c0,t.ignoreItemStates=["unchecked"],t}return e.prototype.setItemsState=function(t,n,i){this.setHighlightBy(t,function(a){return a.name===n},i)},e.prototype.setItemState=function(t,n,i){var a=t.getItems();this.setHighlightBy(t,function(o){return o===n},i)},e.prototype.setHighlightBy=function(t,n,i){var a=t.getItems();if(i)(0,JE.each)(a,function(l){n(l)?(t.hasState(l,tA)&&t.setItemState(l,tA,!1),t.setItemState(l,c0,!0)):t.hasState(l,c0)||t.setItemState(l,tA,!0)});else{var o=t.getItemsByState(c0),s=!0;(0,JE.each)(o,function(l){if(!n(l))return s=!1,!1}),s?this.clear():(0,JE.each)(a,function(l){n(l)&&(t.hasState(l,c0)&&t.setItemState(l,c0,!1),t.setItemState(l,tA,!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t=this.getTriggerListInfo();if(t)Dot(t.list);else{var n=this.getAllowComponents();(0,JE.each)(n,function(i){i.clearItemsState(c0),i.clearItemsState(tA)})}},e}(zl),tD=EHt;var AHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(zl),Pot=AHt;var MHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="unchecked",t}return e.prototype.unchecked=function(){this.setState()},e}(zl),kot=MHt;var eA=z(q());var L1="unchecked",eD="checked",THt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=eD,t}return e.prototype.setItemState=function(t,n,i){this.setCheckedBy(t,function(a){return a===n},i)},e.prototype.setCheckedBy=function(t,n,i){var a=t.getItems();i&&(0,eA.each)(a,function(o){n(o)?(t.hasState(o,L1)&&t.setItemState(o,L1,!1),t.setItemState(o,eD,!0)):t.hasState(o,eD)||t.setItemState(o,L1,!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var n=t.list,i=t.item,a=!(0,eA.some)(n.getItems(),function(o){return n.hasState(o,L1)});a||n.hasState(i,L1)?this.setItemState(n,i,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();(0,eA.each)(t,function(n){n.clearItemsState(eD),n.clearItemsState(L1)})},e}(zl),Rot=THt;var O1="unchecked",IHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t==null?void 0:t.item){var n=t.list,i=t.item,a=n.getItems(),o=a.filter(function(x){return!n.hasState(x,O1)}),s=a.filter(function(x){return n.hasState(x,O1)}),l=o[0];if(a.length===o.length)for(var u=0,f=a;u16&&o.get("name")==="legend-item-radio"){var s=this.location,l={x:n.x,y:n.y};this.timeStamp=a,this.location=l,(!s||!(0,Fot.isEqual)(s,l))&&this.showTooltip(l)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var n=this.context,i=n.event,a=i.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=n.view.getCanvas().get("el").getBoundingClientRect(),s=o.x,l=o.y;this.tooltip.update(E(E({title:a.get("tip")},t),{x:t.x+s,y:t.y+l})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,n=(t={},t[is.CONTAINER_CLASS]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[is.TITLE_CLASS]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(pj)&&document.body.removeChild(document.getElementById(pj));var i=new qb({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:n,containerId:pj});i.init(),i.setCapture(!1),this.tooltip=i},e}(zl),Got=LHt;var zot=z(q());var rD=z(q());var OHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.maskShape=null,t.points=[],t.starting=!1,t.moving=!1,t.preMovePoint=null,t.shapeType="path",t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var n="mask:".concat(t),i=this.context.view,a=this.context.event;i.emit(n,{target:this.maskShape,shape:this.maskShape,points:this.points,x:a.x,y:a.y})},e.prototype.createMask=function(){var t=this.context.view,n=this.getMaskAttrs(),i=t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:E({fill:"#C5D4EB",opacity:.3},n)});return i},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(t==null?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(!(!this.moving||!this.maskShape)){var t=this.getCurrentPoint(),n=this.preMovePoint,i=t.x-n.x,a=t.y-n.y,o=this.points;(0,rD.each)(o,function(s){s.x+=i,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var n=(0,rD.deepMix)({},this.getMaskAttrs(),t);this.maskShape.attr(n)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,r.prototype.destroy.call(this)},e}(Ir),D1=OHt;var DHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t}return e.prototype.getMaskAttrs=function(){var t=this.points,n=(0,zot.last)(this.points),i=0,a=0,o=0;if(t.length){var s=t[0];i=$b(s,n)/2,a=(n.x+s.x)/2,o=(n.y+s.y)/2}return{x:a,y:o,r:i}},e}(D1),Uot=DHt;var h0=z(q());var nD=z(q());var PHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="rect",t}return e.prototype.getRegion=function(){var t=this.points;return{start:(0,nD.head)(t),end:(0,nD.last)(t)}},e.prototype.getMaskAttrs=function(){var t=this.getRegion(),n=t.start,i=t.end,a=Math.min(n.x,i.x),o=Math.min(n.y,i.y),s=Math.abs(i.x-n.x),l=Math.abs(i.y-n.y);return{x:a,y:o,width:s,height:l}},e}(D1),iD=PHt;function jot(r){r.x=(0,h0.clamp)(r.x,0,1),r.y=(0,h0.clamp)(r.y,0,1)}var kHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return e.prototype.getRegion=function(){var t=null,n=null,i=this.points,a=this.dim,o=this.context.view.getCoordinate(),s=o.invert((0,h0.head)(i)),l=o.invert((0,h0.last)(i));return this.inPlot&&(jot(s),jot(l)),a==="x"?(t=o.convert({x:s.x,y:0}),n=o.convert({x:l.x,y:1})):(t=o.convert({x:0,y:s.y}),n=o.convert({x:1,y:l.y})),{start:t,end:n}},e}(iD),vj=kHt;var Wot=z(q());var RHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){var t=this.points,n=[];return t.length&&((0,Wot.each)(t,function(i,a){a===0?n.push(["M",i.x,i.y]):n.push(["L",i.x,i.y])}),n.push(["L",t[0].x,t[0].y])),n},e.prototype.getMaskAttrs=function(){return{path:this.getMaskPath()}},e.prototype.addPoint=function(){this.resize()},e}(D1),aD=RHt;var NHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){var t=this.points;return zrt(t,!0)},e}(aD),Vot=NHt;var FHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setCursor=function(t){var n=this.context.view;n.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e}(Ir),Hot=FHt;var Yot=z(q());var BHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,n,i){var a=this;t.getScaleByField(n)&&t.filter(n,i),t.views&&t.views.length&&(0,Yot.each)(t.views,function(o){a.filterView(o,n,i)})},e.prototype.filter=function(){var t=ic(this.context);if(t){var n=this.context.view,i=t.component,a=i.get("field");if(hp(t)){if(a){var o=i.getItemsByState("unchecked"),s=bh(n,a),l=o.map(function(h){return h.name});l.length?this.filterView(n,a,function(h){var d=s.getText(h);return!l.includes(d)}):this.filterView(n,a,null),n.render(!0)}}else if(GL(t)){var u=i.getValue(),f=u[0],c=u[1];this.filterView(n,a,function(h){return h>=f&&h<=c}),n.render(!0)}}},e}(Ir),Xot=BHt;function qot(r,e,t,n){var i=Math.min(t[e],n[e]),a=Math.max(t[e],n[e]),o=r.range,s=o[0],l=o[1];if(il&&(a=l),i===l&&a===l)return null;var u=r.invert(i),f=r.invert(a);if(r.isCategory){var c=r.values.indexOf(u),h=r.values.indexOf(f),d=r.values.slice(c,h+1);return function(p){return d.includes(p)}}else return function(p){return p>=u&&p<=f}}var fs;(function(r){r.FILTER="brush-filter-processing",r.RESET="brush-filter-reset",r.BEFORE_FILTER="brush-filter:beforefilter",r.AFTER_FILTER="brush-filter:afterfilter",r.BEFORE_RESET="brush-filter:beforereset",r.AFTER_RESET="brush-filter:afterreset"})(fs||(fs={}));var GHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=["x","y"],t.startPoint=null,t.isStarted=!1,t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,n;if(dp(this.context)){var i=this.context.event.target,a=i.getCanvasBBox();t={x:a.x,y:a.y},n={x:a.maxX,y:a.maxY}}else{if(!this.isStarted)return;t=this.startPoint,n=this.context.getCurrentPoint()}if(!(Math.abs(t.x-n.x)<5||Math.abs(t.x-n.y)<5)){var o=this.context,s=o.view,l=o.event,u={view:s,event:l,dims:this.dims};s.emit(fs.BEFORE_FILTER,zn.fromData(s,fs.BEFORE_FILTER,u));var f=s.getCoordinate(),c=f.invert(n),h=f.invert(t);if(this.hasDim("x")){var d=s.getXScale(),p=qot(d,"x",c,h);this.filterView(s,d.field,p)}if(this.hasDim("y")){var v=s.getYScales()[0],p=qot(v,"y",c,h);this.filterView(s,v.field,p)}this.reRender(s,{source:fs.FILTER}),s.emit(fs.AFTER_FILTER,zn.fromData(s,fs.AFTER_FILTER,u))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(fs.BEFORE_RESET,zn.fromData(t,fs.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var n=t.getXScale();this.filterView(t,n.field,null)}if(this.hasDim("y")){var i=t.getYScales()[0];this.filterView(t,i.field,null)}this.reRender(t,{source:fs.RESET}),t.emit(fs.AFTER_RESET,zn.fromData(t,fs.AFTER_RESET,{}))},e.prototype.filterView=function(t,n,i){t.filter(n,i)},e.prototype.reRender=function(t,n){t.render(!0,n)},e}(Ir),P1=GHt;var mj=z(q());var zHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,n,i){var a=Nl(t);(0,mj.each)(a,function(o){o.filter(n,i)})},e.prototype.reRender=function(t){var n=Nl(t);(0,mj.each)(n,function(i){i.render(!0)})},e}(P1),oD=zHt;var rA=z(q());var UHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filter=function(){var t=ic(this.context),n=this.context.view,i=Hi(n);if(dp(this.context)){var a=Zb(this.context,10);a&&(0,rA.each)(i,function(p){a.includes(p)?p.show():p.hide()})}else if(t){var o=t.component,s=o.get("field");if(hp(t)){if(s){var l=o.getItemsByState("unchecked"),u=bh(n,s),f=l.map(function(p){return p.name});(0,rA.each)(i,function(p){var v=ls(p,s),m=u.getText(v);f.indexOf(m)>=0?p.hide():p.show()})}}else if(GL(t)){var c=o.getValue(),h=c[0],d=c[1];(0,rA.each)(i,function(p){var v=ls(p,s);v>=h&&v<=d?p.show():p.hide()})}}},e.prototype.clear=function(){var t=Hi(this.context.view);(0,rA.each)(t,function(n){n.show()})},e.prototype.reset=function(){this.clear()},e}(Ir),Kot=UHt;var d0=z(q());var jHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.byRecord=!1,t}return e.prototype.filter=function(){dp(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,n=Zb(this.context,10);if(!!n){var i=t.getXScale().field,a=t.getYScales()[0].field,o=n.map(function(l){return l.getModel().data}),s=Nl(t);(0,d0.each)(s,function(l){var u=Hi(l);(0,d0.each)(u,function(f){var c=f.getModel().data;HL(o,c,i,a)?f.show():f.hide()})})}},e.prototype.filterByBBox=function(){var t=this,n=this.context.view,i=Nl(n);(0,d0.each)(i,function(a){var o=zL(t.context,a,10),s=Hi(a);o&&(0,d0.each)(s,function(l){o.includes(l)?l.show():l.hide()})})},e.prototype.reset=function(){var t=Nl(this.context.view);(0,d0.each)(t,function(n){var i=Hi(n);(0,d0.each)(i,function(a){a.show()})})},e}(Ir),gj=jHt;var Zot=z(q());var WHt=10,VHt=5,HHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},t}return e.prototype.getButtonCfg=function(){return(0,Zot.deepMix)(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),n=this.context.view.foregroundGroup.addGroup({name:t.name}),i=n.addShape({type:"text",name:"button-text",attrs:E({text:t.text},t.textStyle)}),a=i.getBBox(),o=Qb(t.padding),s=n.addShape({type:"rect",name:"button-rect",attrs:E({x:a.x-o[3],y:a.y-o[0],width:a.width+o[1]+o[3],height:a.height+o[0]+o[2]},t.style)});s.toBack(),n.on("mouseenter",function(){s.attr(t.activeStyle)}),n.on("mouseleave",function(){s.attr(t.style)}),this.buttonGroup=n},e.prototype.resetPosition=function(){var t=this.context.view,n=t.getCoordinate(),i=n.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=gr.transform(null,[["t",i.x-o.width-WHt,i.y+o.height+VHt]]);a.setMatrix(s)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),r.prototype.destroy.call(this)},e}(Ir),$ot=HHt;var YHt=4,XHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.dragStart=!1,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(!!this.startPoint){var t=this.context.getCurrentPoint(),n=this.context.view,i=this.context.event;this.dragStart?n.emit("drag",{target:i.target,x:i.x,y:i.y}):$b(t,this.startPoint)>YHt&&(n.emit("dragstart",{target:i.target,x:i.x,y:i.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,n=this.context.event;t.emit("dragend",{target:n.target,x:n.x,y:n.y})}this.starting=!1,this.dragStart=!1},e}(Ir),Qot=XHt;var qHt=5,KHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.isMoving=!1,t.startPoint=null,t.startMatrix=null,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(!!this.starting){var t=this.startPoint,n=this.context.getCurrentPoint(),i=$b(t,n);if(i>qHt&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var a=this.context.view,o=gr.transform(this.startMatrix,[["t",n.x-t.x,n.y-t.y]]);a.backgroundGroup.setMatrix(o),a.foregroundGroup.setMatrix(o),a.middleGroup.setMatrix(o)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},e}(Ir),Jot=KHt;var yj=z(q());var tst="x",est="y",ZHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=[tst,est],t.cfgFields=["dims"],t.cacheScaleDefs={},t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var n=this.context.view;return t==="x"?n.getXScale():n.getYScales()[0]},e.prototype.resetDim=function(t){var n=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var i=this.getScale(t);n.scale(i.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim(tst),this.resetDim(est);var t=this.context.view;t.render(!0)},e}(Ir),sD=ZHt;var $Ht=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.startPoint=null,t.starting=!1,t.startCache={},t}return e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var n=this.dims;(0,yj.each)(n,function(i){var a=t.getScale(i),o=a.min,s=a.max,l=a.values;t.startCache[i]={min:o,max:s,values:l}})},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(!!this.starting){var n=this.startPoint,i=this.context.view.getCoordinate(),a=this.context.getCurrentPoint(),o=i.invert(n),s=i.invert(a),l=s.x-o.x,u=s.y-o.y,f=this.context.view,c=this.dims;(0,yj.each)(c,function(h){t.translateDim(h,{x:l*-1,y:u*-1})}),f.render(!0)}},e.prototype.translateDim=function(t,n){if(this.hasDim(t)){var i=this.getScale(t);i.isLinear&&this.translateLinear(t,i,n)}},e.prototype.translateLinear=function(t,n,i){var a=this.context.view,o=this.startCache[t],s=o.min,l=o.max,u=l-s,f=i[t]*u;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:n.nice,min:s,max:l}),a.scale(n.field,{nice:!1,min:s+f,max:l+f})},e.prototype.reset=function(){r.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(sD),rst=$Ht;var nst=z(q());var QHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.zoomRatio=.05,t}return e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var n=this,i=this.dims;(0,nst.each)(i,function(a){n.zoomDim(a,t)}),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,n){if(this.hasDim(t)){var i=this.getScale(t);i.isLinear&&this.zoomLinear(t,i,n)}},e.prototype.zoomLinear=function(t,n,i){var a=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:n.nice,min:n.min,max:n.max});var o=this.cacheScaleDefs[t],s=o.max-o.min,l=n.min,u=n.max,f=i*s,c=l-f,h=u+f,d=h-c,p=d/s;h>c&&p<100&&p>.01&&a.scale(n.field,{nice:!1,min:l-f,max:u+f})},e}(sD),ist=QHt;var p0=z(q());function JHt(r){var e=r.gEvent.originalEvent;return e.deltaY>0}var tYt=1,eYt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.scroll=function(t){var n=this.context,i=n.view,a=n.event;if(!!i.getOptions().scrollbar){var o=(t==null?void 0:t.wheelDelta)||tYt,s=i.getController("scrollbar"),l=i.getXScale(),u=i.getOptions().data,f=(0,p0.size)((0,p0.valuesOfKey)(u,l.field)),c=(0,p0.size)(l.values),h=s.getValue(),d=Math.floor((f-c)*h),p=d+(JHt(a)?o:-o),v=o/(f-c)/1e4,m=(0,p0.clamp)(p/(f-c)+v,0,1);s.setValue(m)}},e}(Ir),ast=eYt;s0("dark",XL(wnt));Ew("canvas",ZU);Ew("svg",tj);Fl("Polygon",zit);Fl("Interval",Rit);Fl("Schema",Uit);Fl("Path",p1);Fl("Point",Git);Fl("Line",Nit);Fl("Area",Iit);Fl("Edge",Lit);Fl("Heatmap",Oit);Fl("Violin",Wit);gp("base",Ch);gp("interval",Jit);gp("pie",tat);gp("polar",FO);us("overlap",dat);us("distribute",rat);us("fixed-overlap",hat);us("hide-overlap",bat);us("limit-in-shape",fat);us("limit-in-canvas",lat);us("limit-in-plot",kat);us("pie-outer",iat);us("adjust-color",Cat);us("interval-adjust-position",wat);us("interval-hide-overlap",Eat);us("point-adjust-position",Tat);us("pie-spider",oat);us("path-adjust-position",Oat);Ms("fade-in",Rat);Ms("fade-out",Nat);Ms("grow-in-x",Fat);Ms("grow-in-xy",Gat);Ms("grow-in-y",Bat);Ms("scale-in-x",jat);Ms("scale-in-y",Wat);Ms("wave-in",qat);Ms("zoom-in",Zat);Ms("zoom-out",$at);Ms("position-update",Uat);Ms("sector-path-update",Xat);Ms("path-in",zat);fp("rect",rot);fp("mirror",eot);fp("list",Jat);fp("matrix",tot);fp("circle",Qat);fp("tree",not);Ju("axis",sot);Ju("legend",uot);Ju("tooltip",r1);Ju("annotation",aot);Ju("slider",fot);Ju("scrollbar",hot);nr("tooltip",$O);nr("sibling-tooltip",pot);nr("ellipsis-text",vot);nr("element-active",yot);nr("element-single-active",_ot);nr("element-range-active",bot);nr("element-highlight",I1);nr("element-highlight-by-x",Cot);nr("element-highlight-by-color",Sot);nr("element-single-highlight",wot);nr("element-range-highlight",dj);nr("element-sibling-highlight",dj,{effectSiblings:!0,effectByRecord:!0});nr("element-selected",Aot);nr("element-single-selected",Mot);nr("element-range-selected",Eot);nr("element-link-by-color",xot);nr("active-region",dot);nr("list-active",Tot);nr("list-selected",Pot);nr("list-highlight",tD);nr("list-unchecked",kot);nr("list-checked",Rot);nr("list-focus",Not);nr("list-radio",Got);nr("legend-item-highlight",tD,{componentNames:["legend"]});nr("axis-label-highlight",tD,{componentNames:["axis"]});nr("rect-mask",iD);nr("x-rect-mask",vj,{dim:"x"});nr("y-rect-mask",vj,{dim:"y"});nr("circle-mask",Uot);nr("path-mask",aD);nr("smooth-path-mask",Vot);nr("cursor",Hot);nr("data-filter",Xot);nr("brush",P1);nr("brush-x",P1,{dims:["x"]});nr("brush-y",P1,{dims:["y"]});nr("sibling-filter",oD);nr("sibling-x-filter",oD);nr("sibling-y-filter",oD);nr("element-filter",Kot);nr("element-sibling-filter",gj);nr("element-sibling-filter-record",gj,{byRecord:!0});nr("view-drag",Qot);nr("view-move",Jot);nr("scale-translate",rst);nr("scale-zoom",ist);nr("reset-button",$ot,{name:"reset-button",text:"reset"});nr("mousewheel-scroll",ast);function Nm(r){return r.isInPlot()}xr("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]});xr("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]});xr("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]});xr("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]});xr("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]});xr("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]});xr("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]});xr("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]});xr("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]});xr("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]});xr("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]});xr("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(r){return!r.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(r){return!r.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]});xr("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Nm,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:Nm,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Nm,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]});xr("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]});xr("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Nm,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:Nm,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Nm,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]});xr("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Nm,action:"path-mask:start"},{trigger:"mousedown",isEnable:Nm,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]});xr("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]});xr("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(r){return!r.isInShape("legend-item-radio")},action:["list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]});xr("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]});xr("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]});xr("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["list-unchecked:toggle","element-filter:filter"]}]});xr("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]});function ost(r){return r.gEvent.preventDefault(),r.gEvent.originalEvent.deltaY>0}xr("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(r){return ost(r.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(r){return!ost(r.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]});xr("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]});xr("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var WA={};Dn(WA,{Area:()=>d6,Bar:()=>p6,BidirectionalBar:()=>Y6,Box:()=>b6,Bullet:()=>v6,Chord:()=>I6,CirclePacking:()=>V6,Column:()=>m6,DualAxes:()=>P6,FUNNEL_CONVERSATION_FIELD:()=>wo,Facet:()=>H6,Funnel:()=>g6,G2:()=>nA,Gauge:()=>w6,Heatmap:()=>S6,Histogram:()=>y6,Line:()=>x6,Liquid:()=>_6,Mix:()=>jA,MultiView:()=>jA,Pie:()=>C6,Plot:()=>ke,Progress:()=>E6,Radar:()=>A6,RadialBar:()=>G6,RingProgress:()=>M6,Rose:()=>T6,Sankey:()=>z6,Scatter:()=>L6,Stock:()=>B6,Sunburst:()=>F6,TinyArea:()=>O6,TinyColumn:()=>D6,TinyLine:()=>k6,Treemap:()=>U6,Venn:()=>W6,Violin:()=>j6,Waterfall:()=>R6,WordCloud:()=>N6,adaptors:()=>u6,default:()=>oQt,flow:()=>Fe,getCanvasPattern:()=>W1,measureTextWidth:()=>aA});var hD=z(q());function Fe(){for(var r=[],e=0;e"},key:(l===0?"top":"bottom")+"-statistic"},Hr(s,["offsetX","offsetY","rotate","style","formatter"])))}})},bj=function(r,e,t){var n=e.statistic,i=n.title,a=n.content;[i,a].forEach(function(o){if(!!o){var s=(0,Zs.isFunction)(o.style)?o.style(t):o.style;r.annotation().html(E({position:["50%","100%"],html:function(l,u){var f=u.getCoordinate(),c=u.views[0].getCoordinate(),h=c.getCenter(),d=c.getRadius(),p=Math.max(Math.sin(c.startAngle),Math.sin(c.endAngle))*d,v=h.y+p-f.y.start-parseFloat((0,Zs.get)(s,"fontSize",0)),m=f.getRadius()*f.innerRadius*2;pst(l,E({width:m+"px",transform:"translate(-50%, "+v+"px)"},dst(s)));var g=u.getData();if(o.customHtml)return o.customHtml(l,u,t,g);var x=o.content;return o.formatter&&(x=o.formatter(t,g)),x?(0,Zs.isString)(x)?x:""+x:"
    "}},Hr(o,["offsetX","offsetY","rotate","style","formatter"])))}})};var N1=z(q());var _j;function vst(){return _j||(_j=document.createElement("canvas").getContext("2d")),_j}var aA=(0,N1.memoize)(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=n===void 0?"sans-serif":n,a=e.fontWeight,o=e.fontStyle,s=e.fontVariant,l=vst();l.font=[o,a,s,t+"px",i].join(" ");var u=l.measureText((0,N1.isString)(r)?r:"");return u.width},function(r,e){return e===void 0&&(e={}),dn([r],(0,N1.values)(e)).join("")});function fc(r){return typeof r=="number"&&!isNaN(r)}function Sj(r,e,t){var n=Math.min(e,t),i=Math.max(e,t);return r>=n&&r<=i}var Fm=z(q());function F1(r,e){if(!r)return{};var t=r.filter(function(a){var o=(0,Fm.get)(a,[e]);return(0,Fm.isNumber)(o)&&!isNaN(o)}),n=t.every(function(a){return(0,Fm.get)(a,[e])>=0}),i=t.every(function(a){return(0,Fm.get)(a,[e])<=0});return n?{min:0}:i?{max:0}:{}}function fD(r,e,t,n,i){if(i===void 0&&(i=[]),!Array.isArray(r))return{nodes:[],links:[]};var a=[],o={},s=-1;return r.forEach(function(l){var u=l[e],f=l[t],c=l[n],h=Hr(l,i);o[u]||(o[u]=E({id:++s,name:u},h)),o[f]||(o[f]=E({id:++s,name:f},h)),a.push(E({source:o[u].id,target:o[f].id,value:c},h))}),{nodes:Object.values(o).sort(function(l,u){return l.id-u.id}),links:a}}function Oh(r,e){var t=(0,Fm.filter)(r,function(n){var i=n[e];return i===null||typeof i=="number"&&!isNaN(i)});return Ts(Yo.WARN,t.length===r.length,"illegal data existed in chart data."),t}var cD=z(q());function cc(r){if((0,cD.isNumber)(r))return[r,r,r,r];if((0,cD.isArray)(r)){var e=r.length;if(e===1)return[r[0],r[0],r[0],r[0]];if(e===2)return[r[0],r[1],r[0],r[1]];if(e===3)return[r[0],r[1],r[2],r[1]];if(e===4)return r}return[0,0,0,0]}function Bm(r,e,t){e===void 0&&(e="bottom"),t===void 0&&(t=25);var n=cc(r),i=[e.startsWith("top")?t:0,e.startsWith("right")?t:0,e.startsWith("bottom")?t:0,e.startsWith("left")?t:0];return[n[0]+i[0],n[1]+i[1],n[2]+i[2],n[3]+i[3]]}function B1(r){var e=r.map(function(n){return cc(n)}),t=[0,0,0,0];return e.length>0&&(t=t.map(function(n,i){return e.forEach(function(a,o){n+=e[o][i]}),n})),t}var cYt=z(q()),mst={locale:"en-US"};var dD={};function Cj(r,e){dD[r]=e}function y0(r){return{get:function(e,t){return iA((0,hD.get)(dD[r],e)||(0,hD.get)(dD[mst.locale],e)||(0,hD.get)(dD["en-US"],e)||e,t)}}}var gst={locale:"en-US",general:{increase:"Increase",decrease:"Decrease",root:"Root"},statistic:{total:"Total"},conversionTag:{label:"Rate"},legend:{},tooltip:{},slider:{},scrollbar:{},waterfall:{total:"Total"}};var yst={locale:"zh-CN",general:{increase:"\u589E\u52A0",decrease:"\u51CF\u5C11",root:"\u521D\u59CB"},statistic:{total:"\u603B\u8BA1"},conversionTag:{label:"\u8F6C\u5316\u7387"},legend:{},tooltip:{},slider:{},scrollbar:{},waterfall:{total:"\u603B\u8BA1"}};var bD=z(q());var Ast=z(Est());var Mst="data-chart-source-type",Mj=["padding","appendPadding","renderer","pixelRatio","syncViewPadding","supportCSSTransform","limitInPlot"],ke=function(r){V(e,r);function e(t,n){var i=r.call(this)||this;return i.container=typeof t=="string"?document.getElementById(t):t,i.options=mt({},i.getDefaultOptions(),n),i.createG2(),i.bindEvents(),i}return e.getDefaultOptions=function(){return{renderer:"canvas",xAxis:{nice:!0,label:{autoRotate:!1,autoHide:{type:"equidistance",cfg:{minGap:6}}}},yAxis:{nice:!0,label:{autoHide:!0,autoRotate:!1}},animation:!0}},e.prototype.createG2=function(){var t=this.options,n=t.width,i=t.height,a=t.defaultInteractions;this.chart=new EE(E(E(E(E({container:this.container,autoFit:!1},this.getChartSize(n,i)),{localRefresh:!1}),Hr(this.options,Mj)),{defaultInteractions:a})),this.container.setAttribute(Mst,"G2Plot")},e.prototype.getChartSize=function(t,n){var i=k1(this.container);return{width:t||i.width||400,height:n||i.height||400}},e.prototype.bindEvents=function(){var t=this;this.chart&&this.chart.on("*",function(n){(n==null?void 0:n.type)&&t.emit(n.type,n)})},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){this.chart.clear(),this.chart.options={data:[],animate:!0},this.chart.views=[],this.execAdaptor(),this.chart.render(),this.bindSizeSensor()},e.prototype.update=function(t){this.updateOption(t),this.render()},e.prototype.updateOption=function(t){this.options=mt({},this.options,t)},e.prototype.setState=function(t,n,i){i===void 0&&(i=!0);var a=m0(this.chart);(0,bD.each)(a,function(o){n(o.getData())&&o.setState(t,i)})},e.prototype.getStates=function(){var t=m0(this.chart),n=[];return(0,bD.each)(t,function(i){var a=i.getData(),o=i.getStates();(0,bD.each)(o,function(s){n.push({data:a,state:s,geometry:i.geometry,element:i})})}),n},e.prototype.changeData=function(t){this.update({data:t})},e.prototype.changeSize=function(t,n){this.chart.changeSize(t,n)},e.prototype.addAnnotations=function(t){var n=dn(t),i=this.chart.getController("annotation"),a=i.getComponents().map(function(l){return l.extra});i.clear(!0);for(var o=function(l){var u=a[l],f=n.findIndex(function(c){return c.id&&c.id===u.id});f!==-1&&(u=mt({},u,n[f]),n.splice(f,1)),i.annotation(u)},s=0;sb){var C=S/v.length,w=Math.max(1,Math.ceil(b/C)-1),A=v.slice(0,w)+"...";x.attr("text",A)}}}}function QYt(r,e,t){ZYt(r,e,t),$Yt(r,e,t)}function Fst(r,e,t){return e===void 0&&(e=!0),t===void 0&&(t=!1),function(n){var i=n.options,a=n.chart,o=i.conversionTag,s=i.theme;return o&&!t&&(a.theme(mt({},(0,Wm.isObject)(s)?s:Qu(s),{columnWidthRatio:1/3})),a.annotation().shape({render:function(l,u){var f=l.addGroup({id:a.id+"-conversion-tag-group",name:"conversion-tag-group"}),c=(0,Wm.find)(a.geometries,function(p){return p.type==="interval"}),h={view:u,geometry:c,group:f,field:r,horizontal:e,options:KYt(o,e)},d=c.elements;(0,Wm.each)(d,function(p,v){v>0&&QYt(h,d[v-1],p)})}})),n}}var C0={hover:"__interval-connected-area-hover__",click:"__interval-connected-area-click__"},kj=function(r,e){return r==="hover"?[{trigger:"interval:mouseenter",action:["element-highlight-by-color:highlight","element-link-by-color:link"],arg:[null,{style:e}]}]:[{trigger:"interval:click",action:["element-highlight-by-color:clear","element-highlight-by-color:highlight","element-link-by-color:clear","element-link-by-color:unlink","element-link-by-color:link"],arg:[null,null,null,null,{style:e}]}]};xr(C0.hover,{start:kj(C0.hover),end:[{trigger:"interval:mouseleave",action:["element-highlight-by-color:reset","element-link-by-color:unlink"]}]});xr(C0.click,{start:kj(C0.click),end:[{trigger:"document:mousedown",action:["element-highlight-by-color:clear","element-link-by-color:clear"]}]});function Bst(r){return r===void 0&&(r=!1),function(e){var t=e.chart,n=e.options,i=n.connectedArea,a=function(){t.removeInteraction(C0.hover),t.removeInteraction(C0.click)};if(!r&&i){var o=i.trigger||"hover";a(),t.interaction(C0[o],{start:kj(o,i.style)})}else a();return e}}var Ust=z(q());var Gst=z(q());var JYt=10,tXt=5,eXt={padding:[8,10],text:"reset",textStyle:{default:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"}},buttonStyle:{default:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},active:{fill:"#e6e6e6"}}},zst=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg=E({name:"button"},eXt),t}return e.prototype.getButtonCfg=function(){var t=this.context.view,n=(0,Gst.get)(t,["interactions","filter-action","cfg","buttonConfig"]);return mt(this.buttonCfg,n,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),n=this.context.view.foregroundGroup.addGroup({name:t.name}),i=this.drawText(n);this.drawBackground(n,i.getBBox()),this.buttonGroup=n},e.prototype.drawText=function(t){var n,i=this.getButtonCfg();return t.addShape({type:"text",name:"button-text",attrs:E({text:i.text},(n=i.textStyle)===null||n===void 0?void 0:n.default)})},e.prototype.drawBackground=function(t,n){var i,a=this.getButtonCfg(),o=cc(a.padding),s=t.addShape({type:"rect",name:"button-rect",attrs:E({x:n.x-o[3],y:n.y-o[0],width:n.width+o[1]+o[3],height:n.height+o[0]+o[2]},(i=a.buttonStyle)===null||i===void 0?void 0:i.default)});return s.toBack(),t.on("mouseenter",function(){var l;s.attr((l=a.buttonStyle)===null||l===void 0?void 0:l.active)}),t.on("mouseleave",function(){var l;s.attr((l=a.buttonStyle)===null||l===void 0?void 0:l.default)}),s},e.prototype.resetPosition=function(){var t=this.context.view,n=t.getCoordinate(),i=n.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=ea.transform(null,[["t",i.x-o.width-JYt,i.y+o.height+tXt]]);a.setMatrix(s)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),r.prototype.destroy.call(this)},e}(Ir);nr("brush-reset-button",zst,{name:"brush-reset-button"});xr("filter-action",{});function Op(r){return r.isInPlot()}function Vm(r,e,t){var n=e||"rect";switch(r){case"brush":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Op,action:["brush:start",n+"-mask:start",n+"-mask:show"],arg:[null,{maskStyle:t==null?void 0:t.style}]}],processing:[{trigger:"mousemove",isEnable:Op,action:[n+"-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Op,action:["brush:filter","brush:end",n+"-mask:end",n+"-mask:hide","brush-reset-button:show"]}],rollback:[{trigger:"brush-reset-button:click",action:["brush:reset","brush-reset-button:hide","cursor:crosshair"]}]};case"brush-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:[n+"-mask:start",n+"-mask:show"],arg:[{maskStyle:t==null?void 0:t.style}]},{trigger:"mask:dragstart",action:[n+"-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:[n+"-mask:resize"]},{trigger:"mask:drag",action:[n+"-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:[n+"-mask:end"]},{trigger:"mask:dragend",action:[n+"-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear",n+"-mask:hide"]}]};case"brush-x":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Op,action:["brush-x:start",n+"-mask:start",n+"-mask:show"],arg:[null,{maskStyle:t==null?void 0:t.style}]}],processing:[{trigger:"mousemove",isEnable:Op,action:[n+"-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Op,action:["brush-x:filter","brush-x:end",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]};case"brush-x-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:[n+"-mask:start",n+"-mask:show"],arg:[{maskStyle:t==null?void 0:t.style}]},{trigger:"mask:dragstart",action:[n+"-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:[n+"-mask:resize"]},{trigger:"mask:drag",action:[n+"-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:[n+"-mask:end"]},{trigger:"mask:dragend",action:[n+"-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear",n+"-mask:hide"]}]};case"brush-y":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Op,action:["brush-y:start",n+"-mask:start",n+"-mask:show"],arg:[null,{maskStyle:t==null?void 0:t.style}]}],processing:[{trigger:"mousemove",isEnable:Op,action:[n+"-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Op,action:["brush-y:filter","brush-y:end",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-y:reset"]}]};case"brush-y-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:[n+"-mask:start",n+"-mask:show"],arg:[{maskStyle:t==null?void 0:t.style}]},{trigger:"mask:dragstart",action:[n+"-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:[n+"-mask:resize"]},{trigger:"mask:drag",action:[n+"-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:[n+"-mask:end"]},{trigger:"mask:dragend",action:[n+"-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear",n+"-mask:hide"]}]};default:return{}}}xr("brush",Vm("brush"));xr("brush-highlight",Vm("brush-highlight"));xr("brush-x",Vm("brush-x","x-rect"));xr("brush-y",Vm("brush-y","y-rect"));xr("brush-x-highlight",Vm("brush-x-highlight","x-rect"));xr("brush-y-highlight",Vm("brush-y-highlight","y-rect"));var jst=["brush","brush-x","brush-y","brush-highlight","brush-x-highlight","brush-y-highlight"];function OD(r){var e=r.options,t=e.brush,n=(0,Ust.filter)(e.interactions||[],function(i){return jst.indexOf(i.type)===-1});return(t==null?void 0:t.enabled)&&(jst.forEach(function(i){var a,o=!1;switch(t.type){case"x-rect":o=i===(t.action==="highlight"?"brush-x-highlight":"brush-x");break;case"y-rect":o=i===(t.action==="highlight"?"brush-y-highlight":"brush-y");break;default:o=i===(t.action==="highlight"?"brush-highlight":"brush");break}var s={type:i,enable:o};(((a=t.mask)===null||a===void 0?void 0:a.style)||t.type)&&(s.cfg=Vm(i,t.type,t.mask)),n.push(s)}),(t==null?void 0:t.action)!=="highlight"&&n.push({type:"filter-action",cfg:{buttonConfig:t.button}})),mt({},r,{options:{interactions:n}})}function rXt(r){var e=r.options,t=e.legend,n=e.seriesField,i=e.isStack;return n?t!==!1&&(t=E({position:i?"right-top":"top-left"},t)):t=!1,r.options.legend=t,r}function nXt(r){var e=r.chart,t=r.options,n=t.data,i=t.columnStyle,a=t.color,o=t.columnWidthRatio,s=t.isPercent,l=t.isGroup,u=t.isStack,f=t.xField,c=t.yField,h=t.seriesField,d=t.groupField,p=t.tooltip,v=t.shape,m=s&&l&&u?Rst(n,c,[f,d],c):Rh(n,c,f,c,s),g=[];u&&h&&!l?m.forEach(function(S){var C=g.find(function(w){return w[f]===S[f]&&w[h]===S[h]});C?C[c]+=S[c]||0:g.push(E({},S))}):g=m,e.data(g);var x=s?E({formatter:function(S){return{name:l&&u?S[h]+" - "+S[d]:S[h]||S[f],value:(Number(S[c])*100).toFixed(2)+"%"}}},p):p,b=mt({},r,{options:{data:g,widthRatio:o,tooltip:x,interval:{shape:v,style:i,color:a}}});return gi(b),b}function Y1(r){var e,t,n=r.options,i=n.xAxis,a=n.yAxis,o=n.xField,s=n.yField,l=n.data,u=n.isPercent,f=u?{max:1,min:0,minLimit:0,maxLimit:1}:{};return Fe(un((e={},e[o]=i,e[s]=a,e),(t={},t[o]={type:"cat"},t[s]=E(E({},F1(l,s)),f),t)))(r)}function iXt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(o,!1):e.axis(o,i),r}function aXt(r){var e=r.chart,t=r.options,n=t.legend,i=t.seriesField;return n&&i?e.legend(i,n):n===!1&&e.legend(!1),r}function oXt(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=t.isRange,o=mi(e,"interval");if(!n)o.label(!1);else{var s=n.callback,l=rr(n,["callback"]);o.label({fields:[i],callback:s,cfg:E({layout:(l==null?void 0:l.position)?void 0:[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Kn(a?E({content:function(u){var f;return(f=u[i])===null||f===void 0?void 0:f.join("-")}},l):l))})}return r}function sXt(r){var e=r.chart,t=r.options,n=t.tooltip,i=t.isGroup,a=t.isStack,o=t.groupField,s=t.data,l=t.xField,u=t.yField,f=t.seriesField;if(n===!1)e.tooltip(!1);else{var c=n;if(i&&a){var h=(c==null?void 0:c.formatter)||function(d){return{name:d[f]+" - "+d[o],value:d[u]}};c=E(E({},c),{customItems:function(d){var p=[];return(0,H1.each)(d,function(v){var m=(0,H1.filter)(s,function(g){return(0,H1.isMatch)(g,Hr(v.data,[l,f]))});m.forEach(function(g){p.push(E(E(E({},v),{value:g[u],data:g,mappingData:{_origin:g}}),h(g)))})}),p}})}e.tooltip(c)}return r}function Hm(r,e){e===void 0&&(e=!1);var t=r.options,n=t.seriesField;return Fe(rXt,lr,Xi("columnStyle"),Is,nXt,Y1,iXt,aXt,sXt,Dh,V1,oXt,OD,kr,Sr,nn(),Fst(t.yField,!e,!!n),Bst(!t.isStack),af)(r)}var Wst=mt({},ke.getDefaultOptions(),{columnWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]});var fA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="column",t}return e.getDefaultOptions=function(){return Wst},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options,i=n.yField,a=n.xField,o=n.isPercent,s=this,l=s.chart,u=s.options;Y1({chart:l,options:u}),this.chart.changeData(Rh(t,i,a,i,o))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Hm},e}(ke);function lXt(r){var e=r.options,t=e.xField,n=e.yField,i=e.xAxis,a=e.yAxis,o={left:"bottom",right:"top",top:"left",bottom:"right"},s=a!==!1?E({position:o[(a==null?void 0:a.position)||"left"]},a):!1,l=i!==!1?E({position:o[(i==null?void 0:i.position)||"bottom"]},i):!1;return E(E({},r),{options:E(E({},e),{xField:n,yField:t,xAxis:s,yAxis:l})})}function uXt(r){var e=r.options,t=e.label;return t&&!t.position&&(t.position="left",t.layout||(t.layout=[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}])),mt({},r,{options:{label:t}})}function fXt(r){var e=r.options,t=e.seriesField,n=e.isStack,i=e.legend;return t?i!==!1&&(i=E({position:n?"top-left":"right-top"},i||{})):i=!1,mt({},r,{options:{legend:i}})}function cXt(r){var e=r.chart;return e.coordinate({actions:[["transpose"],["reflect","y"]]}),r}function hXt(r){var e=r.chart,t=r.options,n=t.barStyle,i=t.barWidthRatio,a=t.minBarWidth,o=t.maxBarWidth,s=t.barBackground;return Hm({chart:e,options:E(E({},t),{columnStyle:n,columnWidthRatio:i,minColumnWidth:a,maxColumnWidth:o,columnBackground:s})},!0)}function DD(r){return Fe(lXt,uXt,fXt,wn,cXt,hXt)(r)}var Vst=mt({},ke.getDefaultOptions(),{barWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]});var cA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bar",t}return e.getDefaultOptions=function(){return Vst},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options,o=a.xField,s=a.yField,l=a.isPercent,u=E(E({},a),{xField:s,yField:o});Y1({chart:i,options:u}),i.changeData(Rh(t,o,s,o,l))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return DD},e}(ke);var Ea=z(q());var PD=mt({},ke.getDefaultOptions(),{legend:{position:"right",radio:{}},tooltip:{shared:!1,showTitle:!1,showMarkers:!1},label:{layout:{type:"limit-in-plot",cfg:{action:"ellipsis"}}},pieStyle:{stroke:"white",lineWidth:1},statistic:{title:{style:{fontWeight:300,color:"#4B535E",textAlign:"center",fontSize:"20px",lineHeight:1}},content:{style:{fontWeight:"bold",color:"rgba(44,53,66,0.85)",textAlign:"center",fontSize:"32px",lineHeight:1}}},theme:{components:{annotation:{text:{animate:!1}}}}});var w0=z(q());function Hst(r,e){var t=null;return(0,w0.each)(r,function(n){typeof n[e]=="number"&&(t+=n[e])}),t}function Yst(r,e){var t;switch(r){case"inner":return t="-30%",(0,w0.isString)(e)&&e.endsWith("%")?parseFloat(e)*.01>0?t:e:e<0?e:t;case"outer":return t=12,(0,w0.isString)(e)&&e.endsWith("%")?parseFloat(e)*.01<0?t:e:e>0?e:t;default:return e}}function X1(r,e){return(0,w0.every)(Oh(r,e),function(t){return t[e]===0})}var Xst=z(q());var dXt=[1,0,0,0,1,0,0,0,1];function hA(r,e){var t=e?dn(e):dn(dXt);return ea.transform(t,r)}var qst=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getActiveElements=function(){var t=ea.getDelegationObject(this.context);if(t){var n=this.context.view,i=t.component,a=t.item,o=i.get("field");if(o){var s=n.geometries[0].elements;return s.filter(function(l){return l.getModel().data[o]===a.value})}}return[]},e.prototype.getActiveElementLabels=function(){var t=this.context.view,n=this.getActiveElements(),i=t.geometries[0].labelsContainer.getChildren();return i.filter(function(a){return n.find(function(o){return(0,Xst.isEqual)(o.getData(),a.get("data"))})})},e.prototype.transfrom=function(t){t===void 0&&(t=7.5);var n=this.getActiveElements(),i=this.getActiveElementLabels();n.forEach(function(a,o){var s=i[o],l=a.geometry.coordinate;if(l.isPolar&&l.isTransposed){var u=ea.getAngle(a.getModel(),l),f=u.startAngle,c=u.endAngle,h=(f+c)/2,d=t,p=d*Math.cos(h),v=d*Math.sin(h);a.shape.setMatrix(hA([["t",p,v]])),s.setMatrix(hA([["t",p,v]]))}})},e.prototype.active=function(){this.transfrom()},e.prototype.reset=function(){this.transfrom(0)},e}(Ir);var E0=z(q());function Kst(r){var e=r.event,t,n=e.target;return n&&(t=n.get("element")),t}var Zst=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAnnotations=function(t){var n=t||this.context.view;return n.getController("annotation").option},e.prototype.getInitialAnnotation=function(){return this.initialAnnotation},e.prototype.init=function(){var t=this,n=this.context.view;n.removeInteraction("tooltip"),n.on("afterchangesize",function(){var i=t.getAnnotations(n);t.initialAnnotation=i})},e.prototype.change=function(t){var n=this.context,i=n.view,a=n.event;this.initialAnnotation||(this.initialAnnotation=this.getAnnotations());var o=(0,E0.get)(a,["data","data"]);if(a.type.match("legend-item")){var s=ea.getDelegationObject(this.context),l=i.getGroupedFields()[0];if(s&&l){var u=s.item;o=i.getData().find(function(d){return d[l]===u.value})}}if(o){var f=(0,E0.get)(t,"annotations",[]),c=(0,E0.get)(t,"statistic",{});i.getController("annotation").clear(!0),(0,E0.each)(f,function(d){typeof d=="object"&&i.annotation()[d.type](d)}),Lp(i,{statistic:c,plotType:"pie"},o),i.render(!0)}var h=Kst(this.context);h&&h.shape.toFront()},e.prototype.reset=function(){var t=this.context.view,n=t.getController("annotation");n.clear(!0);var i=this.getInitialAnnotation();(0,E0.each)(i,function(a){t.annotation()[a.type](a)}),t.render(!0)},e}(Ir);var Rj="pie-statistic";nr(Rj,Zst);xr("pie-statistic-active",{start:[{trigger:"element:mouseenter",action:"pie-statistic:change"}],end:[{trigger:"element:mouseleave",action:"pie-statistic:reset"}]});nr("pie-legend",qst);xr("pie-legend-active",{start:[{trigger:"legend-item:mouseenter",action:"pie-legend:active"}],end:[{trigger:"legend-item:mouseleave",action:"pie-legend:reset"}]});function pXt(r){var e=r.chart,t=r.options,n=t.data,i=t.angleField,a=t.colorField,o=t.color,s=t.pieStyle,l=Oh(n,i);if(X1(l,i)){var u="$$percentage$$";l=l.map(function(c){var h;return E(E({},c),(h={},h[u]=1/l.length,h))}),e.data(l);var f=mt({},r,{options:{xField:"1",yField:u,seriesField:a,isStack:!0,interval:{color:o,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});gi(f)}else{e.data(l);var f=mt({},r,{options:{xField:"1",yField:i,seriesField:a,isStack:!0,interval:{color:o,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});gi(f)}return r}function vXt(r){var e,t=r.chart,n=r.options,i=n.meta,a=n.colorField,o=mt({},i);return t.scale(o,(e={},e[a]={type:"cat"},e)),r}function mXt(r){var e=r.chart,t=r.options,n=t.radius,i=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"theta",cfg:{radius:n,innerRadius:i,startAngle:a,endAngle:o}}),r}function gXt(r){var e=r.chart,t=r.options,n=t.label,i=t.colorField,a=t.angleField,o=e.geometries[0];if(!n)o.label(!1);else{var s=n.callback,l=rr(n,["callback"]),u=Kn(l);if(u.content){var f=u.content;u.content=function(p,v,m){var g=p[i],x=p[a],b=e.getScaleByField(a),S=b==null?void 0:b.scale(x);return(0,Ea.isFunction)(f)?f(E(E({},p),{percent:S}),v,m):(0,Ea.isString)(f)?iA(f,{value:x,name:g,percentage:(0,Ea.isNumber)(S)&&!(0,Ea.isNil)(x)?(S*100).toFixed(2)+"%":null}):f}}var c={inner:"",outer:"pie-outer",spider:"pie-spider"},h=u.type?c[u.type]:"pie-outer",d=u.layout?(0,Ea.isArray)(u.layout)?u.layout:[u.layout]:[];u.layout=(h?[{type:h}]:[]).concat(d),o.label({fields:i?[a,i]:[a],callback:s,cfg:E(E({},u),{offset:Yst(u.type,u.offset),type:"pie"})})}return r}function $st(r){var e=r.innerRadius,t=r.statistic,n=r.angleField,i=r.colorField,a=r.meta,o=r.locale,s=y0(o);if(e&&t){var l=mt({},PD.statistic,t),u=l.title,f=l.content;return u!==!1&&(u=mt({},{formatter:function(c){return c?c[i]:(0,Ea.isNil)(u.content)?s.get(["statistic","total"]):u.content}},u)),f!==!1&&(f=mt({},{formatter:function(c,h){var d=c?c[n]:Hst(h,n),p=(0,Ea.get)(a,[n,"formatter"])||function(v){return v};return c||(0,Ea.isNil)(f.content)?p(d):f.content}},f)),mt({},{statistic:{title:u,content:f}},r)}return r}function Nj(r){var e=r.chart,t=r.options,n=$st(t),i=n.innerRadius,a=n.statistic;return e.getController("annotation").clear(!0),Fe(nn())(r),i&&a&&Lp(e,{statistic:a,plotType:"pie"}),r}function yXt(r){var e=r.chart,t=r.options,n=t.tooltip,i=t.colorField,a=t.angleField,o=t.data;if(n===!1)e.tooltip(n);else if(e.tooltip(mt({},n,{shared:!1})),X1(o,a)){var s=(0,Ea.get)(n,"fields"),l=(0,Ea.get)(n,"formatter");(0,Ea.isEmpty)((0,Ea.get)(n,"fields"))&&(s=[i,a],l=l||function(u){return{name:u[i],value:(0,Ea.toString)(u[a])}}),e.geometries[0].tooltip(s.join("*"),b0(s,l))}return r}function xXt(r){var e=r.chart,t=r.options,n=$st(t),i=n.interactions,a=n.statistic,o=n.annotations;return(0,Ea.each)(i,function(s){var l,u;if(s.enable===!1)e.removeInteraction(s.type);else if(s.type==="pie-statistic-active"){var f=[];((l=s.cfg)===null||l===void 0?void 0:l.start)||(f=[{trigger:"element:mouseenter",action:Rj+":change",arg:{statistic:a,annotations:o}}]),(0,Ea.each)((u=s.cfg)===null||u===void 0?void 0:u.start,function(c){f.push(E(E({},c),{arg:{statistic:a,annotations:o}}))}),e.interaction(s.type,mt({},s.cfg,{start:f}))}else e.interaction(s.type,s.cfg||{})}),r}function kD(r){return Fe(Xi("pieStyle"),pXt,vXt,lr,mXt,Ul,yXt,gXt,Is,Nj,xXt,Sr)(r)}var dA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="pie",t}return e.getDefaultOptions=function(){return PD},e.prototype.changeData=function(t){this.chart.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this.chart,wr.BEFORE_CHANGE_DATA,null));var n=this.options,i=this.options.angleField,a=Oh(n.data,i),o=Oh(t,i);X1(a,i)||X1(o,i)?this.update({data:t}):(this.updateOption({data:t}),this.chart.data(o),Nj({chart:this.chart,options:this.options}),this.chart.render(!0)),this.chart.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this.chart,wr.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kD},e}(ke);var q1=z(q());function bXt(r){var e=r.chart,t=r.options,n=t.data,i=t.sectorStyle,a=t.color;return e.data(n),Fe(gi)(mt({},r,{options:{marginRatio:1,interval:{style:i,color:a}}})),r}function _Xt(r){var e=r.chart,t=r.options,n=t.label,i=t.xField,a=mi(e,"interval");if(n===!1)a.label(!1);else if((0,q1.isObject)(n)){var o=n.callback,s=n.fields,l=rr(n,["callback","fields"]),u=l.offset,f=l.layout;(u===void 0||u>=0)&&(f=f?(0,q1.isArray)(f)?f:[f]:[],l.layout=(0,q1.filter)(f,function(c){return c.type!=="limit-in-shape"}),l.layout.length||delete l.layout),a.label({fields:s||[i],callback:o,cfg:Kn(l)})}else Ts(Yo.WARN,n===null,"the label option must be an Object."),a.label({fields:[i]});return r}function SXt(r){var e=r.chart,t=r.options,n=t.legend,i=t.seriesField;return n===!1?e.legend(!1):i&&e.legend(i,n),r}function CXt(r){var e=r.chart,t=r.options,n=t.radius,i=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:n,innerRadius:i,startAngle:a,endAngle:o}}),r}function wXt(r){var e,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return Fe(un((e={},e[a]=n,e[o]=i,e)))(r)}function EXt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n?e.axis(a,n):e.axis(a,!1),i?e.axis(o,i):e.axis(o,!1),r}function Qst(r){Fe(Xi("sectorStyle"),bXt,wXt,_Xt,CXt,EXt,SXt,wn,kr,Sr,lr,nn(),Is)(r)}var Jst=mt({},ke.getDefaultOptions(),{xAxis:!1,yAxis:!1,legend:{position:"right",radio:{}},sectorStyle:{stroke:"#fff",lineWidth:1},label:{layout:{type:"limit-in-shape"}},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});var Fj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rose",t}return e.getDefaultOptions=function(){return Jst},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Qst},e}(ke);var BD=z(q());var Ym=z(q());var K1=z(q()),AXt={font:function(){return"serif"},padding:1,size:[500,500],spiral:"archimedean",timeInterval:3e3};function tlt(r,e){return e=(0,K1.assign)({},AXt,e),MXt(r,e)}function MXt(r,e){var t=zXt();["font","fontSize","fontWeight","padding","rotate","size","spiral","timeInterval","random"].forEach(function(l){(0,K1.isNil)(e[l])||t[l](e[l])}),t.words(r),e.imageMask&&t.createMask(e.imageMask);var n=t.start(),i=n._tags;i.forEach(function(l){l.x+=e.size[0]/2,l.y+=e.size[1]/2});var a=e.size,o=a[0],s=a[1];return i.push({text:"",value:0,x:0,y:0,opacity:0}),i.push({text:"",value:0,x:o,y:s,opacity:0}),i}var Bj=Math.PI/180,pA=1<<11>>5,RD=1<<11;function TXt(r){return r.text}function IXt(){return"serif"}function elt(){return"normal"}function LXt(r){return r.value}function OXt(){return~~(Math.random()*2)*90}function DXt(){return 1}function PXt(r,e,t,n){if(!e.sprite){var i=r.context,a=r.ratio;i.clearRect(0,0,(pA<<5)/a,RD/a);var o=0,s=0,l=0,u=t.length;for(--n;++n>5<<5,c=~~Math.max(Math.abs(v+m),Math.abs(v-m))}else f=f+31>>5<<5;if(c>l&&(l=c),o+f>=pA<<5&&(o=0,s+=l,l=0),s+c>=RD)break;i.translate((o+(f>>1))/a,(s+(c>>1))/a),e.rotate&&i.rotate(e.rotate*Bj),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=f,e.height=c,e.xoff=o,e.yoff=s,e.x1=f>>1,e.y1=c>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=f}for(var x=i.getImageData(0,0,(pA<<5)/a,RD/a).data,b=[];--n>=0;)if(e=t[n],!!e.hasText){for(var f=e.width,S=f>>5,c=e.y1-e.y0,C=0;C>5),O=x[(s+L)*(pA<<5)+(o+C)<<2]?1<<31-C%32:0;b[k]|=O,w|=O}w?A=L:(e.y0++,c--,L--,s++)}e.y1=e.y0+A,e.sprite=b.slice(0,(e.y1-e.y0)*S)}}}function kXt(r,e,t){t>>=5;for(var n=r.sprite,i=r.width>>5,a=r.x-(i<<4),o=a&127,s=32-o,l=r.y1-r.y0,u=(r.y+r.y0)*t+(a>>5),f,c=0;c>>o:0))&e[u+h])return!0;u+=t}return!1}function RXt(r,e){var t=r[0],n=r[1];e.x+e.x0n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function NXt(r,e){return r.x+r.x1>e[0].x&&r.x+r.x0e[0].y&&r.y+r.y0>5)*r[1]),S=l.length,C=[],w=l.map(function(O,M,I){return O.text=f.call(this,O,M,I),O.font=e.call(this,O,M,I),O.style=c.call(this,O,M,I),O.weight=n.call(this,O,M,I),O.rotate=i.call(this,O,M,I),O.size=~~t.call(this,O,M,I),O.padding=a.call(this,O,M,I),O}).sort(function(O,M){return M.size-O.size}),A=-1,L=d.board?[{x:0,y:0},{x:m,y:g}]:null;k();function k(){for(var O=Date.now();Date.now()-O>1,M.y=g*(s()+.5)>>1,PXt(x,M,w,A),M.hasText&&v(b,M,L)&&(C.push(M),L?d.hasImage||RXt(L,M):L=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=r[0]>>1,M.y-=r[1]>>1)}d._tags=C,d._bounds=L}return d};function p(m){m.width=m.height=1;var g=Math.sqrt(m.getContext("2d").getImageData(0,0,1,1).data.length>>2);m.width=(pA<<5)/g,m.height=RD/g;var x=m.getContext("2d");return x.fillStyle=x.strokeStyle="red",x.textAlign="center",{context:x,ratio:g}}function v(m,g,x){for(var b=g.x,S=g.y,C=Math.sqrt(r[0]*r[0]+r[1]*r[1]),w=o(r),A=s()<.5?1:-1,L,k=-A,O,M;(L=w(k+=A))&&(O=~~L[0],M=~~L[1],!(Math.min(Math.abs(O),Math.abs(M))>=C));)if(g.x=b+O,g.y=S+M,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>r[0]||g.y+g.y1>r[1])&&(!x||!kXt(g,m,r[0]))&&(!x||NXt(g,x))){for(var I=g.sprite,R=g.width>>5,P=r[0]>>5,F=g.x-(R<<4),D=F&127,G=32-D,U=g.y1-g.y0,j=void 0,H=(g.y+g.y0)*P+(F>>5),tt=0;tt>>D:0);H+=P}return delete g.sprite,!0}return!1}return d.createMask=function(m){var g=document.createElement("canvas"),x=r[0],b=r[1];if(!(!x||!b)){var S=x>>5,C=nlt((x>>5)*b);g.width=x,g.height=b;var w=g.getContext("2d");w.drawImage(m,0,0,m.width,m.height,0,0,x,b);for(var A=w.getImageData(0,0,x,b).data,L=0;L>5),M=L*x+k<<2,I=A[M]>=250&&A[M+1]>=250&&A[M+2]>=250,R=I?1<<31-k%32:0;C[O]|=R}d.board=C,d.hasImage=!0}},d.timeInterval=function(m){u=m==null?1/0:m},d.words=function(m){l=m},d.size=function(m){r=[+m[0],+m[1]]},d.font=function(m){e=dc(m)},d.fontWeight=function(m){n=dc(m)},d.rotate=function(m){i=dc(m)},d.spiral=function(m){o=GXt[m]||m},d.fontSize=function(m){t=dc(m)},d.padding=function(m){a=dc(m)},d.random=function(m){s=dc(m)},d}function ND(r){var e=r.options,t=r.chart,n=t,i=n.width,a=n.height,o=n.padding,s=n.appendPadding,l=n.ele,u=e.data,f=e.imageMask,c=e.wordField,h=e.weightField,d=e.colorField,p=e.wordStyle,v=e.timeInterval,m=e.random,g=e.spiral,x=e.autoFit,b=x===void 0?!0:x,S=e.placementStrategy;if(!u||!u.length)return[];var C=p.fontFamily,w=p.fontWeight,A=p.padding,L=p.fontSize,k=VXt(u,h),O=[XXt(k),qXt(k)],M=u.map(function(P){return{text:P[c],value:P[h],color:P[d],datum:P}}),I={imageMask:f,font:C,fontSize:WXt(L,O),fontWeight:w,size:UXt({width:i,height:a,padding:o,appendPadding:s,autoFit:b,container:l}),padding:A,timeInterval:v,random:m,spiral:g,rotate:HXt(e)};if((0,Ym.isFunction)(S)){var R=M.map(function(P,F,D){return E(E(E({},P),{hasText:!!P.text,font:dc(I.font)(P,F,D),weight:dc(I.fontWeight)(P,F,D),rotate:dc(I.rotate)(P,F,D),size:dc(I.fontSize)(P,F,D),style:"normal"}),S.call(t,P,F,D))});return R.push({text:"",value:0,x:0,y:0,opacity:0}),R.push({text:"",value:0,x:I.size[0],y:I.size[1],opacity:0}),R}return tlt(M,I)}function UXt(r){var e=r.width,t=r.height,n=r.container,i=r.autoFit,a=r.padding,o=r.appendPadding;if(i){var s=k1(n);e=s.width,t=s.height}e=e||400,t=t||400;var l=jXt({padding:a,appendPadding:o}),u=l[0],f=l[1],c=l[2],h=l[3],d=[e-(h+f),t-(u+c)];return d}function jXt(r){var e=cc(r.padding),t=cc(r.appendPadding),n=e[0]+t[0],i=e[1]+t[1],a=e[2]+t[2],o=e[3]+t[3];return[n,i,a,o]}function ilt(r){return new Promise(function(e,t){if(r instanceof HTMLImageElement){e(r);return}if((0,Ym.isString)(r)){var n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=function(){e(n)},n.onerror=function(){Ts(Yo.ERROR,!1,"image %s load failed !!!",r),t()};return}Ts(Yo.WARN,r===void 0,"The type of imageMask option must be String or HTMLImageElement."),t()})}function WXt(r,e){if((0,Ym.isFunction)(r))return r;if((0,Ym.isArray)(r)){var t=r[0],n=r[1];if(!e)return function(){return(n+t)/2};var i=e[0],a=e[1];return a===i?function(){return(n+t)/2}:function(s){var l=s.value;return(n-t)/(a-i)*(l-i)+t}}return function(){return r}}function VXt(r,e){return r.map(function(t){return t[e]}).filter(function(t){return typeof t=="number"&&!isNaN(t)})}function HXt(r){var e=YXt(r),t=e.rotation,n=e.rotationSteps;if(!(0,Ym.isArray)(t))return t;var i=t[0],a=t[1],o=n===1?0:(a-i)/(n-1);return function(){return a===i?a:Math.floor(Math.random()*n)*o}}function YXt(r){var e=r.wordStyle.rotationSteps;return e<1&&(Ts(Yo.WARN,!1,"The rotationSteps option must be greater than or equal to 1."),e=1),{rotation:r.wordStyle.rotation,rotationSteps:e}}function XXt(r){return Math.min.apply(Math,r)}function qXt(r){return Math.max.apply(Math,r)}var FD="color",alt=mt({},ke.getDefaultOptions(),{timeInterval:2e3,legend:!1,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!1,fields:["text","value",FD],formatter:function(r){return{name:r.text,value:r.value}}},wordStyle:{fontFamily:"Verdana",fontWeight:"normal",padding:1,fontSize:[12,60],rotation:[0,90],rotationSteps:2,rotateRatio:.5}});function KXt(r){var e=r.chart,t=r.options,n=t.colorField,i=t.color,a=ND(r);e.data(a);var o=mt({},r,{options:{xField:"x",yField:"y",seriesField:n&&FD,rawFields:(0,BD.isFunction)(i)&&dn((0,BD.get)(t,"rawFields",[]),["datum"]),point:{color:i,shape:"word-cloud"}}}),s=Gi(o).ext;return s.geometry.label(!1),e.coordinate().reflect("y"),e.axis(!1),r}function ZXt(r){return Fe(un({x:{nice:!1},y:{nice:!1}}))(r)}function $Xt(r){var e=r.chart,t=r.options,n=t.legend,i=t.colorField;return n===!1?e.legend(!1):i&&e.legend(FD,n),r}function olt(r){Fe(KXt,ZXt,wn,$Xt,kr,Sr,lr,Is)(r)}or("point","word-cloud",{draw:function(r,e){var t=r.x,n=r.y,i=e.addShape("text",{attrs:E(E({},QXt(r)),{x:t,y:n})}),a=r.data.rotate;return typeof a=="number"&&ea.rotate(i,a*Math.PI/180),i}});function QXt(r){return{fontSize:r.data.size,text:r.data.text,textAlign:"center",fontFamily:r.data.font,fontWeight:r.data.weight,fill:r.color||r.defaultStyle.stroke,textBaseline:"alphabetic"}}var Gj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="word-cloud",t}return e.getDefaultOptions=function(){return alt},e.prototype.changeData=function(t){this.updateOption({data:t}),this.options.imageMask?this.render():this.chart.changeData(ND({chart:this.chart,options:this.options}))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){var t=this;return new Promise(function(n){var i=t.options.imageMask;if(!i){r.prototype.render.call(t),n();return}var a=function(o){t.options=E(E({},t.options),{imageMask:o||null}),r.prototype.render.call(t),n()};ilt(i).then(a).catch(a)})},e.prototype.getSchemaAdaptor=function(){return olt},e.prototype.triggerResize=function(){var t=this;this.chart.destroyed||(this.execAdaptor(),window.setTimeout(function(){r.prototype.triggerResize.call(t)}))},e}(ke);var hlt=z(q());var Wl=z(llt()),of=z(q());var JXt={exp:Wl.regressionExp,linear:Wl.regressionLinear,loess:Wl.regressionLoess,log:Wl.regressionLog,poly:Wl.regressionPoly,pow:Wl.regressionPow,quad:Wl.regressionQuad};function ult(r,e){var t=10,n={regionStyle:[{position:{start:[r,"max"],end:["max",e]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:["min","max"],end:[r,e]},style:{fill:"#a3dda1",opacity:.4}},{position:{start:["min",e],end:[r,"min"]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:[r,e],end:["max","min"]},style:{fill:"#a3dda1",opacity:.4}}],lineStyle:{stroke:"#9ba29a",lineWidth:1},labelStyle:[{position:["max",e],offsetX:-t,offsetY:-t,style:{textAlign:"right",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:-t,style:{textAlign:"left",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:t,style:{textAlign:"left",textBaseline:"top",fontSize:14,fill:"#ccc"}},{position:["max",e],offsetX:-t,offsetY:t,style:{textAlign:"right",textBaseline:"top",fontSize:14,fill:"#ccc"}}]};return n}var t9t=function(r,e){var t=e.view,n=e.options,i=n.xField,a=n.yField,o=t.getScaleByField(i),s=t.getScaleByField(a),l=r.map(function(u){return t.getCoordinate().convert({x:o.scale(u[0]),y:s.scale(u[1])})});return xj(l,!1)},flt=function(r){var e=r.options,t=e.xField,n=e.yField,i=e.data,a=e.regressionLine,o=a.type,s=o===void 0?"linear":o,l=a.algorithm,u;if(l)u=(0,of.isArray)(l)?l:l(i);else{var f=JXt[s]().x(function(c){return c[t]}).y(function(c){return c[n]});u=f(i)}return t9t(u,r)},clt=function(r){var e,t=r.meta,n=t===void 0?{}:t,i=r.xField,a=r.yField,o=r.data,s=o[0][i],l=o[0][a],u=s>0,f=l>0;function c(h,d){var p=(0,of.get)(n,[h]);function v(g){return(0,of.get)(p,g)}var m={};return d==="x"?((0,of.isNumber)(s)&&((0,of.isNumber)(v("min"))||(m.min=u?0:s*2),(0,of.isNumber)(v("max"))||(m.max=u?s*2:0)),m):((0,of.isNumber)(l)&&((0,of.isNumber)(v("min"))||(m.min=f?0:l*2),(0,of.isNumber)(v("max"))||(m.max=f?l*2:0)),m)}return E(E({},n),(e={},e[i]=E(E({},n[i]),c(i,"x")),e[a]=E(E({},n[a]),c(a,"y")),e))};function zj(r){var e=r.data,t=e===void 0?[]:e,n=r.xField,i=r.yField;if(t.length){for(var a=!0,o=!0,s=t[0],l=void 0,u=1;u0){var s=this.view.geometries[0],l=s.dataArray,u=o[0].name,f=[];return l.forEach(function(c){c.forEach(function(h){var d=ea.getTooltipItems(h,s),p=d[0];if(!i&&p&&p.name===u){var v=(0,Uj.isNil)(a)?u:a;f.push(E(E({},p),{name:p.title,title:v}))}else if(i&&p){var v=(0,Uj.isNil)(a)?p.name||u:a;f.push(E(E({},p),{name:p.title,title:v}))}})}),f}return[]},e}(r1);Ju("radar-tooltip",d9t);var vlt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(){var t=this.context.view;t.removeInteraction("tooltip")},e.prototype.show=function(){var t=this.context.event,n=this.getTooltipController();n.showTooltip({x:t.x,y:t.y})},e.prototype.hide=function(){var t=this.getTooltipController();t.hideTooltip()},e.prototype.getTooltipController=function(){var t=this.context.view;return t.getController("radar-tooltip")},e}(Ir);nr("radar-tooltip",vlt);xr("radar-tooltip",{start:[{trigger:"plot:mousemove",action:"radar-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"radar-tooltip:hide"}]});var jj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radar",t}return e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return mt({},r.prototype.getDefaultOptions.call(this),{xAxis:{label:{offset:15},grid:{line:{type:"line"}}},yAxis:{grid:{line:{type:"circle"}}},legend:{position:"top"},tooltip:{shared:!0,showCrosshairs:!0,showMarkers:!0,crosshairs:{type:"xy",line:{style:{stroke:"#565656",lineDash:[4]}},follow:!0}}})},e.prototype.getSchemaAdaptor=function(){return plt},e}(ke);var ra=z(q());var A0=z(q());var Xm;(function(r){r.Left="Left",r.Right="Right"})(Xm||(Xm={}));var Dp;(function(r){r.Line="line",r.Column="column"})(Dp||(Dp={}));var Vl="left-axes-view",Hl="right-axes-view",mlt={nice:!0,label:{autoHide:!0,autoRotate:!1}},glt=E(E({},mlt),{position:"left"}),ylt=E(E({},mlt),{position:"right",grid:null});function gA(r){return(0,A0.get)(r,"geometry")===Dp.Line}function yA(r){return(0,A0.get)(r,"geometry")===Dp.Column}function Wj(r,e,t){return yA(t)?mt({},{geometry:Dp.Column,label:t.label&&t.isRange?{content:function(n){var i;return(i=n[e])===null||i===void 0?void 0:i.join("-")}}:void 0},t):E({geometry:Dp.Line},t)}function Vj(r,e){var t=r[0],n=r[1];if((0,A0.isArray)(e)){var i=e[0],a=e[1];return[i,a]}var o=(0,A0.get)(e,t),s=(0,A0.get)(e,n);return[o,s]}function Hj(r,e){return e===Xm.Left?r===!1?!1:mt({},glt,r):e===Xm.Right?r===!1?!1:mt({},ylt,r):r}var Nh=z(q());function Yj(r){var e=r.view,t=r.geometryOption,n=r.yField,i=r.legend,a=(0,Nh.get)(i,"marker"),o=mi(e,gA(t)?"line":"interval");if(!t.seriesField){var s=(0,Nh.get)(e,"options.scales."+n+".alias")||n,l=o.getAttribute("color"),u=e.getTheme().defaultColor;l&&(u=ea.getMappingValue(l,s,(0,Nh.get)(l,["values",0],u)));var f=((0,Nh.isFunction)(a)?a:!(0,Nh.isEmpty)(a)&&mt({},{style:{stroke:u,fill:u}},a))||(gA(t)?{symbol:function(h,d,p){return[["M",h-p,d],["L",h+p,d]]},style:{lineWidth:2,r:6,stroke:u}}:{symbol:"square",style:{fill:u}});return[{value:n,name:s,marker:f,isGeometry:!0,viewId:e.id}]}var c=o.getGroupAttributes();return(0,Nh.reduce)(c,function(h,d){var p=ea.getLegendItems(e,o,d,e.getTheme(),a);return h.concat(p)},[])}var xlt=z(q());function blt(r){var e=r.options,t=r.chart,n=e.geometryOption,i=n.isStack,a=n.color,o=n.seriesField,s=n.groupField,l=n.isGroup,u=["xField","yField"];if(gA(n)){jl(mt({},r,{options:E(E(E({},Hr(e,u)),n),{line:{color:n.color,style:n.lineStyle}})})),Gi(mt({},r,{options:E(E(E({},Hr(e,u)),n),{point:n.point&&E({color:a,shape:"circle"},n.point)})}));var f=[];l&&f.push({type:"dodge",dodgeBy:s||o,customOffset:0}),i&&f.push({type:"stack"}),f.length&&(0,xlt.each)(t.geometries,function(c){c.adjust(f)})}return yA(n)&&Hm(mt({},r,{options:E(E(E({},Hr(e,u)),n),{widthRatio:n.columnWidthRatio,interval:E(E({},Hr(n,["color"])),{style:n.columnStyle})})})),r}var xA=z(q());var Xj=function(r,e){var t=e[0],n=e[1],i=r.getOptions().data,a=r.getXScale(),o=(0,xA.size)(i);if(!(!a||!o)){var s=!0,l=(0,xA.valuesOfKey)(i,a.field),u=s?l:l.reverse(),f=(0,xA.size)(u),c=Math.floor(t*(f-1)),h=Math.floor(n*(f-1));r.filter(a.field,function(d){var p=u.indexOf(d);return p>-1?Sj(p,c,h):!0}),r.render(!0)}};function p9t(r){var e,t=r.options,n=t.geometryOptions,i=n===void 0?[]:n,a=t.xField,o=t.yField,s=(0,ra.every)(i,function(l){var u=l.geometry;return u===Dp.Line||u===void 0});return mt({},{options:{geometryOptions:[],meta:(e={},e[a]={type:"cat",sync:!0,range:s?[0,1]:void 0},e),tooltip:{showMarkers:s,showCrosshairs:s,shared:!0,crosshairs:{type:"x"}},interactions:s?[{type:"legend-visible-filter"}]:[{type:"legend-visible-filter"},{type:"active-region"}],legend:{position:"top-left"}}},r,{options:{yAxis:Vj(o,t.yAxis),geometryOptions:[Wj(a,o[0],i[0]),Wj(a,o[1],i[1])],annotations:Vj(o,t.annotations)}})}function v9t(r){var e,t,n=r.chart,i=r.options,a=i.geometryOptions,o={line:0,column:1},s=[{type:(e=a[0])===null||e===void 0?void 0:e.geometry,id:Vl},{type:(t=a[1])===null||t===void 0?void 0:t.geometry,id:Hl}];return s.sort(function(l,u){return-o[l.type]+o[u.type]}).forEach(function(l){return n.createView({id:l.id})}),r}function m9t(r){var e=r.chart,t=r.options,n=t.xField,i=t.yField,a=t.geometryOptions,o=t.data,s=t.tooltip,l=[E(E({},a[0]),{id:Vl,data:o[0],yField:i[0]}),E(E({},a[1]),{id:Hl,data:o[1],yField:i[1]})];return l.forEach(function(u){var f=u.id,c=u.data,h=u.yField,d=yA(u)&&u.isPercent,p=d?Dj(c,h,n,h):c,v=qr(e,f).data(p),m=d?E({formatter:function(g){return{name:g[u.seriesField]||h,value:(Number(g[h])*100).toFixed(2)+"%"}}},s):s;blt({chart:v,options:{xField:n,yField:h,tooltip:m,geometryOption:u}})}),r}function g9t(r){var e,t=r.chart,n=r.options,i=n.geometryOptions,a=((e=t.getTheme())===null||e===void 0?void 0:e.colors10)||[],o=0;return t.once("beforepaint",function(){(0,ra.each)(i,function(s,l){var u=qr(t,l===0?Vl:Hl);if(!s.color){var f=u.getGroupScales(),c=(0,ra.get)(f,[0,"values","length"],1),h=a.slice(o,o+c).concat(l===0?[]:a);u.geometries.forEach(function(d){s.seriesField?d.color(s.seriesField,h):d.color(h[0])}),o+=c}}),t.render(!0)}),r}function y9t(r){var e,t,n=r.chart,i=r.options,a=i.xAxis,o=i.yAxis,s=i.xField,l=i.yField;return un((e={},e[s]=a,e[l[0]]=o[0],e))(mt({},r,{chart:qr(n,Vl)})),un((t={},t[s]=a,t[l[1]]=o[1],t))(mt({},r,{chart:qr(n,Hl)})),r}function x9t(r){var e=r.chart,t=r.options,n=qr(e,Vl),i=qr(e,Hl),a=t.xField,o=t.yField,s=t.xAxis,l=t.yAxis;return e.axis(a,!1),e.axis(o[0],!1),e.axis(o[1],!1),n.axis(a,s),n.axis(o[0],Hj(l[0],Xm.Left)),i.axis(a,!1),i.axis(o[1],Hj(l[1],Xm.Right)),r}function b9t(r){var e=r.chart,t=r.options,n=t.tooltip,i=qr(e,Vl),a=qr(e,Hl);return e.tooltip(n),i.tooltip({shared:!0}),a.tooltip({shared:!0}),r}function _9t(r){var e=r.chart;return kr(mt({},r,{chart:qr(e,Vl)})),kr(mt({},r,{chart:qr(e,Hl)})),r}function S9t(r){var e=r.chart,t=r.options,n=t.annotations,i=(0,ra.get)(n,[0]),a=(0,ra.get)(n,[1]);return nn(i)(mt({},r,{chart:qr(e,Vl),options:{annotations:i}})),nn(a)(mt({},r,{chart:qr(e,Hl),options:{annotations:a}})),r}function C9t(r){var e=r.chart;return lr(mt({},r,{chart:qr(e,Vl)})),lr(mt({},r,{chart:qr(e,Hl)})),lr(r),r}function w9t(r){var e=r.chart;return Sr(mt({},r,{chart:qr(e,Vl)})),Sr(mt({},r,{chart:qr(e,Hl)})),r}function E9t(r){var e=r.chart,t=r.options,n=t.yAxis;return af(mt({},r,{chart:qr(e,Vl),options:{yAxis:n[0]}})),af(mt({},r,{chart:qr(e,Hl),options:{yAxis:n[1]}})),r}function A9t(r){var e=r.chart,t=r.options,n=t.legend,i=t.geometryOptions,a=t.yField,o=t.data,s=qr(e,Vl),l=qr(e,Hl);if(n===!1)e.legend(!1);else if((0,ra.isObject)(n)&&n.custom===!0)e.legend(n);else{var u=(0,ra.get)(i,[0,"legend"],n),f=(0,ra.get)(i,[1,"legend"],n);e.once("beforepaint",function(){var c=o[0].length?Yj({view:s,geometryOption:i[0],yField:a[0],legend:u}):[],h=o[1].length?Yj({view:l,geometryOption:i[1],yField:a[1],legend:f}):[];e.legend(mt({},n,{custom:!0,items:c.concat(h)}))}),i[0].seriesField&&s.legend(i[0].seriesField,u),i[1].seriesField&&l.legend(i[1].seriesField,f),e.on("legend-item:click",function(c){var h=(0,ra.get)(c,"gEvent.delegateObject",{});if(h&&h.item){var d=h.item,p=d.value,v=d.isGeometry,m=d.viewId;if(v){var g=(0,ra.findIndex)(a,function(S){return S===p});if(g>-1){var x=(0,ra.get)(qr(e,m),"geometries");(0,ra.each)(x,function(S){S.changeVisible(!h.item.unchecked)})}}else{var b=(0,ra.get)(e.getController("legend"),"option.items",[]);(0,ra.each)(e.views,function(S){var C=S.getGroupScales();(0,ra.each)(C,function(w){w.values&&w.values.indexOf(p)>-1&&S.filter(w.field,function(A){var L=(0,ra.find)(b,function(k){return k.value===A});return!L.unchecked})}),e.render(!0)})}}})}return r}function M9t(r){var e=r.chart,t=r.options,n=t.slider,i=qr(e,Vl),a=qr(e,Hl);return n&&(i.option("slider",n),i.on("slider:valuechanged",function(o){var s=o.event,l=s.value,u=s.originValue;(0,ra.isEqual)(l,u)||Xj(a,l)}),e.once("afterpaint",function(){if(!(0,ra.isBoolean)(n)){var o=n.start,s=n.end;(o||s)&&Xj(a,[o,s])}})),r}function _lt(r){return Fe(p9t,v9t,C9t,m9t,y9t,x9t,E9t,b9t,_9t,S9t,w9t,g9t,A9t,M9t)(r)}var qj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dual-axes",t}return e.prototype.getDefaultOptions=function(){return mt({},r.prototype.getDefaultOptions.call(this),{yAxis:[],syncViewPadding:!0})},e.prototype.getSchemaAdaptor=function(){return _lt},e}(ke);var Slt=z(q()),qm="x",Pp="y",Kj={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return""+(0,Slt.get)(e,[0,"data","y"],0)},containerTpl:'
    ',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}},showCrosshairs:!0,crosshairs:{type:"x"}},Clt={appendPadding:2,tooltip:E({},Kj),animation:{}};var wlt=z(q());function Cu(r){return(0,wlt.map)(r||[],function(e,t){return{x:""+t,y:e}})}function T9t(r){var e=r.chart,t=r.options,n=t.data,i=t.color,a=t.areaStyle,o=t.point,s=t.line,l=o==null?void 0:o.state,u=Cu(n);e.data(u);var f=mt({},r,{options:{xField:qm,yField:Pp,area:{color:i,style:a},line:s,point:o}}),c=mt({},f,{options:{tooltip:!1}}),h=mt({},f,{options:{tooltip:!1,state:l}});return Ph(f),jl(c),Gi(h),e.axis(!1),e.legend(!1),r}function pc(r){var e,t,n=r.options,i=n.xAxis,a=n.yAxis,o=n.data,s=Cu(o);return Fe(un((e={},e[qm]=i,e[Pp]=a,e),(t={},t[qm]={type:"cat"},t[Pp]=F1(s,Pp),t)))(r)}function UD(r){return Fe(Xi("areaStyle"),T9t,pc,wn,lr,Sr,nn())(r)}function I9t(r){var e=r.chart,t=r.options,n=t.data,i=t.color,a=t.lineStyle,o=t.point,s=o==null?void 0:o.state,l=Cu(n);e.data(l);var u=mt({},r,{options:{xField:qm,yField:Pp,line:{color:i,style:a},point:o}}),f=mt({},u,{options:{tooltip:!1,state:s}});return jl(u),Gi(f),e.axis(!1),e.legend(!1),r}function jD(r){return Fe(I9t,pc,lr,wn,Sr,nn())(r)}var bA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-line",t}return e.getDefaultOptions=function(){return Clt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options;pc({chart:i,options:a}),i.changeData(Cu(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jD},e}(ke);function L9t(r){var e=r.chart,t=r.options,n=t.data,i=t.color,a=t.columnStyle,o=t.columnWidthRatio,s=Cu(n);e.data(s);var l=mt({},r,{options:{xField:qm,yField:Pp,widthRatio:o,interval:{style:a,color:i}}});return gi(l),e.axis(!1),e.legend(!1),e.interaction("element-active"),r}function WD(r){return Fe(lr,Xi("columnStyle"),L9t,pc,wn,Sr,nn())(r)}var Elt=z(q()),O9t={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return""+(0,Elt.get)(e,[0,"data","y"],0)},containerTpl:'
    ',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}}},Alt={appendPadding:2,tooltip:E({},O9t),animation:{}};var _A=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-column",t}return e.getDefaultOptions=function(){return Alt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options;pc({chart:i,options:a}),i.changeData(Cu(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return WD},e}(ke);var Mlt={appendPadding:2,tooltip:E({},Kj),color:"l(90) 0:#E5EDFE 1:#ffffff",areaStyle:{fillOpacity:.6},line:{size:1,color:"#5B8FF9"},animation:{}};var SA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-area",t}return e.getDefaultOptions=function(){return Mlt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options;pc({chart:i,options:a}),i.changeData(Cu(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return UD},e}(ke);var Co=z(q());function Tlt(r,e,t){if(t===1)return[0,e];var n=Math.floor(r/e);return[e*n,e*(n+1)]}function D9t(r){return Math.ceil(Math.log(r.length)/Math.LN2)+1}function VD(r,e,t,n,i){var a=(0,Co.clone)(r);(0,Co.sortBy)(a,e);var o=(0,Co.valuesOfKey)(a,e),s=(0,Co.getRange)(o),l=s.max-s.min,u=t;if(!t&&n&&(u=n>1?l/(n-1):s.max),!t&&!n){var f=D9t(o);u=l/f}var c={},h=(0,Co.groupBy)(a,i);(0,Co.isEmpty)(h)?(0,Co.each)(a,function(p){var v=p[e],m=Tlt(v,u,n),g=m[0]+"-"+m[1];(0,Co.hasKey)(c,g)||(c[g]={range:m,count:0}),c[g].count+=1}):Object.keys(h).forEach(function(p){(0,Co.each)(h[p],function(v){var m=v[e],g=Tlt(m,u,n),x=g[0]+"-"+g[1],b=x+"-"+p;(0,Co.hasKey)(c,b)||(c[b]={range:g,count:0},c[b][i]=p),c[b].count+=1})});var d=[];return(0,Co.each)(c,function(p){d.push(p)}),d}var CA="range",Z1="count",Ilt=mt({},ke.getDefaultOptions(),{columnStyle:{stroke:"#FFFFFF"},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});function P9t(r){var e=r.chart,t=r.options,n=t.data,i=t.binField,a=t.binNumber,o=t.binWidth,s=t.color,l=t.stackField,u=t.legend,f=t.columnStyle,c=VD(n,i,o,a,l);e.data(c);var h=mt({},r,{options:{xField:CA,yField:Z1,seriesField:l,isStack:!0,interval:{color:s,style:f}}});return gi(h),u&&l&&e.legend(l,u),r}function k9t(r){var e,t=r.options,n=t.xAxis,i=t.yAxis;return Fe(un((e={},e[CA]=n,e[Z1]=i,e)))(r)}function R9t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis;return n===!1?e.axis(CA,!1):e.axis(CA,n),i===!1?e.axis(Z1,!1):e.axis(Z1,i),r}function N9t(r){var e=r.chart,t=r.options,n=t.label,i=mi(e,"interval");if(!n)i.label(!1);else{var a=n.callback,o=rr(n,["callback"]);i.label({fields:[Z1],callback:a,cfg:Kn(o)})}return r}function HD(r){return Fe(lr,Xi("columnStyle"),P9t,k9t,R9t,Is,N9t,wn,kr,Sr)(r)}var wA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="histogram",t}return e.getDefaultOptions=function(){return Ilt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options,i=n.binField,a=n.binNumber,o=n.binWidth,s=n.stackField;this.chart.changeData(VD(t,i,o,a,s))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return HD},e}(ke);var Dlt=z(q());var Zj=["#FAAD14","#E8EDF3"],Llt={percent:.2,color:Zj,animation:{}};var Olt=z(q());function $1(r){var e=(0,Olt.clamp)(fc(r)?r:0,0,1);return[{type:"current",percent:e},{type:"target",percent:1-e}]}function $j(r){var e=r.chart,t=r.options,n=t.percent,i=t.progressStyle,a=t.color,o=t.barWidthRatio;e.data($1(n));var s=mt({},r,{options:{xField:"1",yField:"percent",seriesField:"type",isStack:!0,widthRatio:o,interval:{style:i,color:(0,Dlt.isString)(a)?[a,Zj[1]]:a},args:{zIndexReversed:!0,sortZIndex:!0}}});return gi(s),e.tooltip(!1),e.axis(!1),e.legend(!1),r}function F9t(r){var e=r.chart;return e.coordinate("rect").transpose(),r}function YD(r){return Fe($j,un({}),F9t,Sr,lr,nn())(r)}var EA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="process",t}return e.getDefaultOptions=function(){return Llt},e.prototype.changeData=function(t){this.updateOption({percent:t}),this.chart.changeData($1(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YD},e}(ke);var XD=z(q());function B9t(r){var e=r.chart,t=r.options,n=t.innerRadius,i=t.radius;return e.coordinate("theta",{innerRadius:n,radius:i}),r}function Qj(r,e){var t=r.chart,n=r.options,i=n.innerRadius,a=n.statistic,o=n.percent,s=n.meta;if(t.getController("annotation").clear(!0),i&&a){var l=(0,XD.get)(s,["percent","formatter"])||function(f){return(f*100).toFixed(2)+"%"},u=a.content;u&&(u=mt({},u,{content:(0,XD.isNil)(u.content)?l(o):u.content})),Lp(t,{statistic:E(E({},a),{content:u}),plotType:"ring-progress"},{percent:o})}return e&&t.render(!0),r}function qD(r){return Fe($j,un({}),B9t,Qj,Sr,lr,nn())(r)}var Plt={percent:.2,innerRadius:.8,radius:.98,color:["#FAAD14","#E8EDF3"],statistic:{title:!1,content:{style:{fontSize:"14px",fontWeight:300,fill:"#4D4D4D",textAlign:"center",textBaseline:"middle"}}},animation:{}};var AA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ring-process",t}return e.getDefaultOptions=function(){return Plt},e.prototype.changeData=function(t){this.chart.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this.chart,wr.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data($1(t)),Qj({chart:this.chart,options:this.options},!0),this.chart.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this.chart,wr.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return qD},e}(ke);var klt=z(q());function G9t(r){var e=r.chart,t=r.options,n=t.data,i=t.type,a=t.xField,o=t.yField,s=t.colorField,l=t.sizeField,u=t.sizeRatio,f=t.shape,c=t.color,h=t.tooltip,d=t.heatmapStyle;e.data(n);var p="polygon";i==="density"&&(p="heatmap");var v=wa(h,[a,o,s]),m=v.fields,g=v.formatter,x=1;return(u||u===0)&&(!f&&!l?console.warn("sizeRatio is not in effect: Must define shape or sizeField first"):u<0||u>1?console.warn("sizeRatio is not in effect: It must be a number in [0,1]"):x=u),Bi(mt({},r,{options:{type:p,colorField:s,tooltipFields:m,shapeField:l||"",label:void 0,mapping:{tooltip:g,shape:f&&(l?function(b){var S=n.map(function(A){return A[l]}),C=Math.min.apply(Math,S),w=Math.max.apply(Math,S);return[f,((0,klt.get)(b,l)-C)/(w-C),x]}:function(){return[f,1,x]}),color:c||s&&e.getTheme().sequenceColors.join("-"),style:d}}})),r}function z9t(r){var e,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return Fe(un((e={},e[a]=n,e[o]=i,e)))(r)}function U9t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(o,!1):e.axis(o,i),r}function j9t(r){var e=r.chart,t=r.options,n=t.legend,i=t.colorField,a=t.sizeField,o=t.sizeLegend,s=n!==!1;return i&&e.legend(i,s?n:!1),a&&e.legend(a,o===void 0?n:o),!s&&!o&&e.legend(!1),r}function W9t(r){var e=r.chart,t=r.options,n=t.label,i=t.colorField,a=t.type,o=mi(e,a==="density"?"heatmap":"polygon");if(!n)o.label(!1);else if(i){var s=n.callback,l=rr(n,["callback"]);o.label({fields:[i],callback:s,cfg:Kn(l)})}return r}function V9t(r){var e=r.chart,t=r.options,n=t.coordinate,i=t.reflect;return n&&e.coordinate({type:n.type||"rect",cfg:n.cfg}),i&&e.coordinate().reflect(i),r}function Rlt(r){return Fe(lr,Xi("heatmapStyle"),z9t,V9t,G9t,U9t,j9t,wn,W9t,nn(),kr,Sr,Is)(r)}var Nlt=mt({},ke.getDefaultOptions(),{type:"polygon",legend:!1,coordinate:{type:"rect"},xAxis:{tickLine:null,line:null,grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}},yAxis:{grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}}});or("polygon","circle",{draw:function(r,e){var t,n,i=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l)/2,f=Number(r.shape[1]),c=Number(r.shape[2]),h=Math.sqrt(c),d=u*h*Math.sqrt(f),p=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((n=r.defaultStyle)===null||n===void 0?void 0:n.fill),v=e.addShape("circle",{attrs:E(E(E({x:i,y:a,r:d},r.defaultStyle),r.style),{fill:p})});return v}});or("polygon","square",{draw:function(r,e){var t,n,i=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l),f=Number(r.shape[1]),c=Number(r.shape[2]),h=Math.sqrt(c),d=u*h*Math.sqrt(f),p=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((n=r.defaultStyle)===null||n===void 0?void 0:n.fill),v=e.addShape("rect",{attrs:E(E(E({x:i-d/2,y:a-d/2,width:d,height:d},r.defaultStyle),r.style),{fill:p})});return v}});var Jj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="heatmap",t}return e.getDefaultOptions=function(){return Nlt},e.prototype.getSchemaAdaptor=function(){return Rlt},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);var $D=z(q());var tW,Km="$$range$$",H9t="low-q1-median-q3-high",Flt="$$y_outliers$$",KD="outliers_view",Blt=mt({},ke.getDefaultOptions(),{meta:(tW={},tW[Km]={min:0,alias:H9t},tW),interactions:[{type:"active-region"}],tooltip:{showMarkers:!1,shared:!0},boxStyle:{lineWidth:1}});var Glt=z(q());var ZD=function(r,e){var t=r;if(Array.isArray(e)){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4];t=(0,Glt.map)(r,function(l){return l[Km]=[l[n],l[i],l[a],l[o],l[s]],l})}return t};function Y9t(r){var e=r.chart,t=r.options,n=t.xField,i=t.yField,a=t.groupField,o=t.color,s=t.tooltip,l=t.boxStyle;e.data(ZD(t.data,i));var u=(0,$D.isArray)(i)?Km:i,f=i?(0,$D.isArray)(i)?i:[i]:[],c=s;c!==!1&&(c=mt({},{fields:(0,$D.isArray)(i)?i:[]},c));var h=Um(mt({},r,{options:{xField:n,yField:u,seriesField:a,tooltip:c,rawFields:f,label:!1,schema:{shape:"box",color:o,style:l}}})).ext;return a&&h.geometry.adjust("dodge"),r}function X9t(r){var e=r.chart,t=r.options,n=t.xField,i=t.data,a=t.outliersField,o=t.outliersStyle,s=t.padding,l=t.label;if(!a)return r;var u=e.createView({padding:s,id:KD}),f=i.reduce(function(c,h){var d=h[a];return d.forEach(function(p){var v;return c.push(E(E({},h),(v={},v[a]=p,v)))}),c},[]);return u.data(f),Gi({chart:u,options:{xField:n,yField:a,point:{shape:"circle",style:o},label:l}}),u.axis(!1),r}function q9t(r){var e,t,n=r.chart,i=r.options,a=i.meta,o=i.xAxis,s=i.yAxis,l=i.xField,u=i.yField,f=i.outliersField,c=Array.isArray(u)?Km:u,h={};if(f){var d=Flt;h=(e={},e[f]={sync:d,nice:!0},e[c]={sync:d,nice:!0},e)}var p=mt(h,a,(t={},t[l]=Hr(o,Ua),t[c]=Hr(s,Ua),t));return n.scale(p),r}function K9t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField,s=Array.isArray(o)?Km:o;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(Km,!1):e.axis(s,i),r}function Z9t(r){var e=r.chart,t=r.options,n=t.legend,i=t.groupField;return i?n?e.legend(i,n):e.legend(i,{position:"bottom"}):e.legend(!1),r}function zlt(r){return Fe(Y9t,X9t,q9t,K9t,Z9t,wn,kr,Sr,lr)(r)}var eW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="box",t}return e.getDefaultOptions=function(){return Blt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options.yField,i=this.chart.views.find(function(a){return a.id===KD});i&&i.data(t),this.chart.changeData(ZD(t,n))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return zlt},e}(ke);var mc=z(q());var Fh=z(q()),Klt=z(Hlt());function Ylt(r,e){var t=r.length*e;if(r.length===0)throw new Error("quantile requires at least one data point.");if(e<0||e>1)throw new Error("quantiles must be between 0 and 1");return e===1?r[r.length-1]:e===0?r[0]:t%1!=0?r[Math.ceil(t)-1]:r.length%2==0?(r[t-1]+r[t])/2:r[t]}function MA(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function JD(r,e,t,n){for(t=t||0,n=n||r.length-1;n>t;){if(n-t>600){var i=n-t+1,a=e-t+1,o=Math.log(i),s=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*s*(i-s)/i);a-i/2<0&&(l*=-1);var u=Math.max(t,Math.floor(e-a*s/i+l)),f=Math.min(n,Math.floor(e+(i-a)*s/i+l));JD(r,e,u,f)}var c=r[e],h=t,d=n;for(MA(r,t,e),r[n]>c&&MA(r,t,n);hc;)d--}r[t]===c?MA(r,t,d):(d++,MA(r,d,n)),d<=e&&(t=d+1),e<=d&&(n=d-1)}}function Q1(r,e){var t=r.slice();if(Array.isArray(e)){t7t(t,e);for(var n=[],i=0;ie?e:r},lighten:function(r,e){return r>e?r:e},dodge:function(r,e){return r===255?255:(r=255*(e/255)/(1-r/255),r>255?255:r)},burn:function(r,e){return e===255?255:r===0?0:255*(1-Math.min(1,(1-e/255)/(r/255)))}},c7t=function(r){if(!iut[r])throw new Error("unknown blend mode "+r);return iut[r]};function aut(r,e,t){t===void 0&&(t="normal");var n=f7t(c7t(t))(iP(r),iP(e)),i=iP(r),a=i[0],o=i[1],s=i[2],l=i[3],u=iP(e),f=u[0],c=u[1],h=u[2],d=u[3],p=Number((l+d*(1-l)).toFixed(2)),v=Math.round((l*(1-d)*(a/255)+l*d*(n[0]/255)+(1-l)*d*(f/255))/p*255),m=Math.round((l*(1-d)*(o/255)+l*d*(n[1]/255)+(1-l)*d*(c/255))/p*255),g=Math.round((l*(1-d)*(s/255)+l*d*(n[2]/255)+(1-l)*d*(h/255))/p*255);return"rgba("+v+", "+m+", "+g+", "+p+")"}function iP(r){var e=r.replace("/s+/g",""),t;return typeof e=="string"&&!e.startsWith("rgba")&&!e.startsWith("#")?t=gu.rgb2arr(gu.toRGB(e)).concat([1]):(e.startsWith("rgba")&&(t=e.replace("rgba(","").replace(")","").split(",")),e.startsWith("#")&&(t=gu.rgb2arr(e).concat([1])),t.map(function(n,i){return i===3?Number(n):n|0}))}var Os=z(oW());var sut=1e-10;function TA(r,e){var t=d7t(r),n=t.filter(function(A){return h7t(A,r)}),i=0,a=0,o,s=[];if(n.length>1){var l=fW(n);for(o=0;o-1){var v=r[c.parentIndex[p]],m=Math.atan2(c.x-v.x,c.y-v.y),g=Math.atan2(f.x-v.x,f.y-v.y),x=g-m;x<0&&(x+=2*Math.PI);var b=g-x/2,S=Eu(h,{x:v.x+v.radius*Math.sin(b),y:v.y+v.radius*Math.cos(b)});S>v.radius*2&&(S=v.radius*2),(d===null||d.width>S)&&(d={circle:v,width:S,p1:c,p2:f})}d!==null&&(s.push(d),i+=sW(d.circle.radius,d.width),f=c)}}else{var C=r[0];for(o=1;oMath.abs(C.radius-r[o].radius)){w=!0;break}w?i=a=0:(i=C.radius*C.radius*Math.PI,s.push({circle:C,p1:{x:C.x,y:C.y+C.radius},p2:{x:C.x-sut,y:C.y+C.radius},width:C.radius*2}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=t),i+a}function h7t(r,e){for(var t=0;te[t].radius+sut)return!1;return!0}function d7t(r){for(var e=[],t=0;t=r+e)return 0;if(t<=Math.abs(r-e))return Math.PI*Math.min(r,e)*Math.min(r,e);var n=r-(t*t-e*e+r*r)/(2*t),i=e-(t*t-r*r+e*e)/(2*t);return sW(r,n)+sW(e,i)}function uW(r,e){var t=Eu(r,e),n=r.radius,i=e.radius;if(t>=n+i||t<=Math.abs(n-i))return[];var a=(n*n-i*i+t*t)/(2*t),o=Math.sqrt(n*n-a*a),s=r.x+a*(e.x-r.x)/t,l=r.y+a*(e.y-r.y)/t,u=-(e.y-r.y)*(o/t),f=-(e.x-r.x)*(o/t);return[{x:s+u,y:l-f},{x:s-u,y:l+f}]}function fW(r){for(var e={x:0,y:0},t=0;tu?1:-1}),n=0;n=Math.min(e[o].size,e[s].size)?c=1:a.size<=1e-10&&(c=-1),i[o][s]=i[s][o]=c}),{distances:n,constraints:i}}function m7t(r,e,t,n){var i=0,a;for(a=0;a0&&p<=c||h<0&&p>=c||(i+=2*v*v,e[2*a]+=4*v*(o-u),e[2*a+1]+=4*v*(s-f),e[2*l]+=4*v*(u-o),e[2*l+1]+=4*v*(f-s))}return i}function g7t(r,e){var t=x7t(r,e),n=e.lossFunction||hW;if(r.length>=8){var i=y7t(r,e),a=n(i,r),o=n(t,r);a+1e-8=Math.min(n[f].size,n[c].size)&&(u=0),i[f].push({set:c,size:l.size,weight:u}),i[c].push({set:f,size:l.size,weight:u})}var h=[];for(a in i)if(i.hasOwnProperty(a)){for(var d=0,o=0;o=o&&(a=t[n],o=s)}var l=(0,cut.nelderMead)(function(h){return-1*dW({x:h[0],y:h[1]},r,e)},[a.x,a.y],{maxIterations:500,minErrorDelta:1e-10}).x,u={x:l[0],y:l[1]},f=!0;for(n=0;nr[n].radius){f=!1;break}for(n=0;n0&&console.log("WARNING: area "+a+" not represented on screen")}return t}function S7t(r,e,t){var n=[],i=r-t,a=e;return n.push("M",i,a),n.push("A",t,t,0,1,0,i+2*t,a),n.push("A",t,t,0,1,0,i,a),n.join(" ")}function put(r){var e={};TA(r,e);var t=e.arcs;if(t.length===0)return"M 0 0";if(t.length==1){var n=t[0].circle;return S7t(n.x,n.y,n.radius)}else{for(var i=[` M`,t[0].p2.x,t[0].p2.y],a=0;as;i.push(` A`,s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return i.join(" ")}}var gc="id",IA="path",vut={appendPadding:[10,0,20,0],blendMode:"multiply",tooltip:{showTitle:!1,showMarkers:!1,fields:["id","size"],formatter:function(r){return{name:r.id,value:r.size}}},legend:{position:"top-left"},label:{style:{textAlign:"center",fill:"#fff"}},interactions:[{type:"legend-filter",enable:!1}],state:{active:{style:{stroke:"#000"}},selected:{style:{stroke:"#000",lineWidth:2}},inactive:{style:{fillOpacity:.3,strokeOpacity:.3}}},defaultInteractions:["tooltip","venn-legend-active"]};var mut=(0,oP.memoize)(function(r,e,t,n){var i=new Map,a=r.length;return e.forEach(function(o,s){if(o[n].length===1)i.set(o[gc],r[(s+a)%a]);else{var l=o[n].map(function(u){return i.get(u)});i.set(o[gc],l.slice(1).reduce(function(u,f){return aut(u,f,t)},l[0]))}}),i},function(){for(var r=[],e=0;e0;)u-=Math.PI*2;u=u/Math.PI/2*t;var f=a-r+u-r*2;l.push(["M",f,e]);for(var c=0,h=0;h1?n+"_"+v:""+n},m[t]=t?c[t]:String(h),m[n]=p,m))}),s.push((d={tKey:""+a},d[t]=t?c[t]:String(h),d[a]=c[a],d)),l.push(c[i],c[n],c[a])});var u=Math.min.apply(Math,l.flat(1/0)),f=Math.max.apply(Math,l.flat(1/0));return u=u>0?0:u,o==="vertical"&&s.reverse(),{min:u,max:f,ds:s}}function bqt(r){var e=r.chart,t=r.options,n=t.bulletStyle,i=t.targetField,a=t.rangeField,o=t.measureField,s=t.xField,l=t.color,u=t.layout,f=t.size,c=t.label,h=yP(t),d=h.min,p=h.max,v=h.ds;e.data(v);var m=mt({},r,{options:{xField:s,yField:a,seriesField:"rKey",isStack:!0,label:(0,uo.get)(c,"range"),interval:{color:(0,uo.get)(l,"range"),style:(0,uo.get)(n,"range"),size:(0,uo.get)(f,"range")}}});gi(m),e.geometries[0].tooltip(!1);var g=mt({},r,{options:{xField:s,yField:o,seriesField:"mKey",isStack:!0,label:(0,uo.get)(c,"measure"),interval:{color:(0,uo.get)(l,"measure"),style:(0,uo.get)(n,"measure"),size:(0,uo.get)(f,"measure")}}});gi(g);var x=mt({},r,{options:{xField:s,yField:i,seriesField:"tKey",label:(0,uo.get)(c,"target"),point:{color:(0,uo.get)(l,"target"),style:(0,uo.get)(n,"target"),size:(0,uo.isFunction)((0,uo.get)(f,"target"))?function(b){return(0,uo.get)(f,"target")(b)/2}:(0,uo.get)(f,"target")/2,shape:u==="horizontal"?"line":"hyphen"}}});return Gi(x),u==="horizontal"&&e.coordinate().transpose(),E(E({},r),{ext:{data:{min:d,max:p}}})}function xW(r){var e,t,n=r.options,i=r.ext,a=n.xAxis,o=n.yAxis,s=n.targetField,l=n.rangeField,u=n.measureField,f=n.xField,c=i.data;return Fe(un((e={},e[f]=a,e[u]=o,e),(t={},t[u]={min:c==null?void 0:c.min,max:c==null?void 0:c.max,sync:!0},t[s]={sync:""+u},t[l]={sync:""+u},t)))(r)}function _qt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.measureField,s=t.rangeField,l=t.targetField;return e.axis(""+s,!1),e.axis(""+l,!1),n===!1?e.axis(""+a,!1):e.axis(""+a,n),i===!1?e.axis(""+o,!1):e.axis(""+o,i),r}function Sqt(r){var e=r.chart,t=r.options,n=t.legend;return e.removeInteraction("legend-filter"),e.legend(n),e.legend("rKey",!1),e.legend("mKey",!1),e.legend("tKey",!1),r}function Cqt(r){var e=r.chart,t=r.options,n=t.label,i=t.measureField,a=t.targetField,o=t.rangeField,s=e.geometries,l=s[0],u=s[1],f=s[2];return(0,uo.get)(n,"range")?l.label(""+o,E({layout:[{type:"limit-in-plot"}]},Kn(n.range))):l.label(!1),(0,uo.get)(n,"measure")?u.label(""+i,E({layout:[{type:"limit-in-plot"}]},Kn(n.measure))):u.label(!1),(0,uo.get)(n,"target")?f.label(""+a,E({layout:[{type:"limit-in-plot"}]},Kn(n.target))):f.label(!1),r}function Fut(r){Fe(bqt,xW,_qt,Sqt,lr,Cqt,wn,kr,Sr)(r)}var But=mt({},ke.getDefaultOptions(),{layout:"horizontal",size:{range:30,measure:20,target:20},xAxis:{tickLine:!1,line:null},bulletStyle:{range:{fillOpacity:.5}},label:{measure:{position:"right"}},tooltip:{showMarkers:!1}});var bW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bullet",t}return e.getDefaultOptions=function(){return But},e.prototype.changeData=function(t){this.updateOption({data:t});var n=yP(this.options),i=n.min,a=n.max,o=n.ds;xW({options:this.options,ext:{data:{min:i,max:a}},chart:this.chart}),this.chart.changeData(o)},e.prototype.getSchemaAdaptor=function(){return Fut},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);var tg=z(q()),_W="nodeIndex",SW="childNodeCount",DA="nodeAncestor",CW="Invalid field: it must be a string!";function n_(r,e){var t=r.field,n=r.fields;if((0,tg.isString)(t))return t;if((0,tg.isArray)(t))return console.warn(CW),t[0];if(console.warn(CW+" will try to get fields instead."),(0,tg.isString)(n))return n;if((0,tg.isArray)(n)&&n.length)return n[0];if(e)return e;throw new TypeError(CW)}function i_(r){var e=[];if(r&&r.each){var t,n;r.each(function(i){var a,o;i.parent!==t?(t=i.parent,n=0):n+=1;var s=(0,tg.filter)((((a=i.ancestors)===null||a===void 0?void 0:a.call(i))||[]).map(function(l){return e.find(function(u){return u.name===l.name})||l}),function(l){var u=l.depth;return u>0&&u1?(this.historyCache=t,this.drawBreadCrumb()):(this.historyCache=[],this.hideCrumbGroup())}},e.prototype.getButtonCfg=function(){var t=this.context.view,n=(0,lf.get)(t,["interactions","drill-down","cfg","drillDownConfig"]);return mt(this.breadCrumbCfg,n==null?void 0:n.breadCrumb,this.cfg)},e.prototype.drawBreadCrumb=function(){this.drawBreadCrumbGroup(),this.resetPosition(),this.breadCrumbGroup.show()},e.prototype.drawBreadCrumbGroup=function(){var t=this,n=this.getButtonCfg(),i=this.historyCache;this.breadCrumbGroup?this.breadCrumbGroup.clear():this.breadCrumbGroup=this.context.view.foregroundGroup.addGroup({name:Wut});var a=0;i.forEach(function(o,s){var l=t.breadCrumbGroup.addShape({type:"text",id:o.id,name:Wut+"_"+o.name+"_text",attrs:E(E({text:s===0&&!(0,lf.isNil)(n.rootText)?n.rootText:o.name},n.textStyle),{x:a,y:0})}),u=l.getBBox();if(a+=u.width+Uut,l.on("click",function(h){var d,p=h.target.get("id");if(p!==((d=(0,lf.last)(i))===null||d===void 0?void 0:d.id)){var v=i.slice(0,i.findIndex(function(m){return m.id===p})+1);t.backTo(v)}}),l.on("mouseenter",function(h){var d,p=h.target.get("id");p!==((d=(0,lf.last)(i))===null||d===void 0?void 0:d.id)?l.attr(n.activeTextStyle):l.attr({cursor:"default"})}),l.on("mouseleave",function(){l.attr(n.textStyle)}),sHut,hierarchy:()=>Gh,pack:()=>SP,packEnclose:()=>xP,packSiblings:()=>hft,partition:()=>wP,stratify:()=>gft,tree:()=>yft,treemap:()=>PW,treemapBinary:()=>xft,treemapDice:()=>zh,treemapResquarify:()=>_ft,treemapSlice:()=>ag,treemapSliceDice:()=>bft,treemapSquarify:()=>AP});function Aqt(r,e){return r.parent===e.parent?1:2}function Mqt(r){return r.reduce(Tqt,0)/r.length}function Tqt(r,e){return r+e.x}function Iqt(r){return 1+r.reduce(Lqt,0)}function Lqt(r,e){return Math.max(r,e.y)}function Oqt(r){for(var e;e=r.children;)r=e[0];return r}function Dqt(r){for(var e;e=r.children;)r=e[e.length-1];return r}function Hut(){var r=Aqt,e=1,t=1,n=!1;function i(a){var o,s=0;a.eachAfter(function(h){var d=h.children;d?(h.x=Mqt(d),h.y=Iqt(d)):(h.x=o?s+=r(h,o):0,h.y=0,o=h)});var l=Oqt(a),u=Dqt(a),f=l.x-r(l,u)/2,c=u.x+r(u,l)/2;return a.eachAfter(n?function(h){h.x=(h.x-a.x)*e,h.y=(a.y-h.y)*t}:function(h){h.x=(h.x-f)/(c-f)*e,h.y=(1-(a.y?h.y/a.y:1))*t})}return i.separation=function(a){return arguments.length?(r=a,i):r},i.size=function(a){return arguments.length?(n=!1,e=+a[0],t=+a[1],i):n?null:[e,t]},i.nodeSize=function(a){return arguments.length?(n=!0,e=+a[0],t=+a[1],i):n?[e,t]:null},i}function Pqt(r){var e=0,t=r.children,n=t&&t.length;if(!n)e=1;else for(;--n>=0;)e+=t[n].value;r.value=e}function Yut(){return this.eachAfter(Pqt)}function Xut(r,e){let t=-1;for(let n of this)r.call(e,n,++t,this);return this}function qut(r,e){for(var t=this,n=[t],i,a,o=-1;t=n.pop();)if(r.call(e,t,++o,this),i=t.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function Kut(r,e){for(var t=this,n=[t],i=[],a,o,s,l=-1;t=n.pop();)if(i.push(t),a=t.children)for(o=0,s=a.length;o=0;)t+=n[i].value;e.value=t})}function Qut(r){return this.eachBefore(function(e){e.children&&e.children.sort(r)})}function Jut(r){for(var e=this,t=kqt(e,r),n=[e];e!==t;)e=e.parent,n.push(e);for(var i=n.length;r!==t;)n.splice(i,0,r),r=r.parent;return n}function kqt(r,e){if(r===e)return r;var t=r.ancestors(),n=e.ancestors(),i=null;for(r=t.pop(),e=n.pop();r===e;)i=r,r=t.pop(),e=n.pop();return i}function tft(){for(var r=this,e=[r];r=r.parent;)e.push(r);return e}function eft(){return Array.from(this)}function rft(){var r=[];return this.eachBefore(function(e){e.children||r.push(e)}),r}function nft(){var r=this,e=[];return r.each(function(t){t!==r&&e.push({source:t.parent,target:t})}),e}function*ift(){var r=this,e,t=[r],n,i,a;do for(e=t.reverse(),t=[];r=e.pop();)if(yield r,n=r.children)for(i=0,a=n.length;i=0;--s)i.push(a=o[s]=new ng(o[s])),a.parent=n,a.depth=n.depth+1;return t.eachBefore(EW)}function Rqt(){return Gh(this).eachBefore(Bqt)}function Nqt(r){return r.children}function Fqt(r){return Array.isArray(r)?r[1]:null}function Bqt(r){r.data.value!==void 0&&(r.value=r.data.value),r.data=r.data.data}function EW(r){var e=0;do r.height=e;while((r=r.parent)&&r.height<++e)}function ng(r){this.data=r,this.depth=this.height=0,this.parent=null}ng.prototype=Gh.prototype={constructor:ng,count:Yut,each:Xut,eachAfter:Kut,eachBefore:qut,find:Zut,sum:$ut,sort:Qut,path:Jut,ancestors:tft,descendants:eft,leaves:rft,links:nft,copy:Rqt,[Symbol.iterator]:ift};function aft(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}function oft(r){for(var e=r.length,t,n;e;)n=Math.random()*e--|0,t=r[e],r[e]=r[n],r[n]=t;return r}function xP(r){for(var e=0,t=(r=oft(Array.from(r))).length,n=[],i,a;e0&&t*t>n*n+i*i}function AW(r,e){for(var t=0;tl?(i=(u+l-a)/(2*u),s=Math.sqrt(Math.max(0,l/u-i*i)),t.x=r.x-i*n-s*o,t.y=r.y-i*o+s*n):(i=(u+a-l)/(2*u),s=Math.sqrt(Math.max(0,a/u-i*i)),t.x=e.x+i*n-s*o,t.y=e.y+i*o+s*n)):(t.x=e.x+t.r,t.y=e.y)}function fft(r,e){var t=r.r+e.r-1e-6,n=e.x-r.x,i=e.y-r.y;return t>0&&t*t>n*n+i*i}function cft(r){var e=r._,t=r.next._,n=e.r+t.r,i=(e.x*t.r+t.x*e.r)/n,a=(e.y*t.r+t.y*e.r)/n;return i*i+a*a}function _P(r){this._=r,this.next=null,this.previous=null}function MW(r){if(!(i=(r=aft(r)).length))return 0;var e,t,n,i,a,o,s,l,u,f,c;if(e=r[0],e.x=0,e.y=0,!(i>1))return e.r;if(t=r[1],e.x=-t.r,t.x=e.r,t.y=0,!(i>2))return e.r+t.r;uft(t,e,n=r[2]),e=new _P(e),t=new _P(t),n=new _P(n),e.next=n.previous=t,t.next=e.previous=n,n.next=t.previous=e;t:for(s=3;s0)throw new Error("cycle");return l}return t.id=function(n){return arguments.length?(r=o_(n),t):r},t.parentId=function(n){return arguments.length?(e=o_(n),t):e},t}function Yqt(r,e){return r.parent===e.parent?1:2}function IW(r){var e=r.children;return e?e[0]:r.t}function LW(r){var e=r.children;return e?e[e.length-1]:r.t}function Xqt(r,e,t){var n=t/(e.i-r.i);e.c-=n,e.s+=t,r.c+=n,e.z+=t,e.m+=t}function qqt(r){for(var e=0,t=0,n=r.children,i=n.length,a;--i>=0;)a=n[i],a.z+=e,a.m+=e,e+=a.s+(t+=a.c)}function Kqt(r,e,t){return r.a.parent===e.parent?r.a:t}function EP(r,e){this._=r,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}EP.prototype=Object.create(ng.prototype);function Zqt(r){for(var e=new EP(r,0),t,n=[e],i,a,o,s;t=n.pop();)if(a=t._.children)for(t.children=new Array(s=a.length),o=s-1;o>=0;--o)n.push(i=t.children[o]=new EP(a[o],o)),i.parent=t;return(e.parent=new EP(null,0)).children=[e],e}function yft(){var r=Yqt,e=1,t=1,n=null;function i(u){var f=Zqt(u);if(f.eachAfter(a),f.parent.m=-f.z,f.eachBefore(o),n)u.eachBefore(l);else{var c=u,h=u,d=u;u.eachBefore(function(x){x.xh.x&&(h=x),x.depth>d.depth&&(d=x)});var p=c===h?1:r(c,h)/2,v=p-c.x,m=e/(h.x+p+v),g=t/(d.depth||1);u.eachBefore(function(x){x.x=(x.x+v)*m,x.y=x.depth*g})}return u}function a(u){var f=u.children,c=u.parent.children,h=u.i?c[u.i-1]:null;if(f){qqt(u);var d=(f[0].z+f[f.length-1].z)/2;h?(u.z=h.z+r(u._,h._),u.m=u.z-d):u.z=d}else h&&(u.z=h.z+r(u._,h._));u.parent.A=s(u,h,u.parent.A||c[0])}function o(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,f,c){if(f){for(var h=u,d=u,p=f,v=h.parent.children[0],m=h.m,g=d.m,x=p.m,b=v.m,S;p=LW(p),h=IW(h),p&&h;)v=IW(v),d=LW(d),d.a=u,S=p.z+x-h.z-m+r(p._,h._),S>0&&(Xqt(Kqt(p,u,c),u,S),m+=S,g+=S),x+=p.m,m+=h.m,b+=v.m,g+=d.m;p&&!LW(d)&&(d.t=p,d.m+=x-g),h&&!IW(v)&&(v.t=h,v.m+=m-b,c=u)}return c}function l(u){u.x*=e,u.y=u.depth*t}return i.separation=function(u){return arguments.length?(r=u,i):r},i.size=function(u){return arguments.length?(n=!1,e=+u[0],t=+u[1],i):n?null:[e,t]},i.nodeSize=function(u){return arguments.length?(n=!0,e=+u[0],t=+u[1],i):n?[e,t]:null},i}function ag(r,e,t,n,i){for(var a=r.children,o,s=-1,l=a.length,u=r.value&&(i-t)/r.value;++sx&&(x=u),w=m*m*C,b=Math.max(x/w,w/g),b>S){m-=u;break}S=b}o.push(l={value:m,dice:d1?n:1)},t}(OW);function PW(){var r=AP,e=!1,t=1,n=1,i=[0],a=Rp,o=Rp,s=Rp,l=Rp,u=Rp;function f(h){return h.x0=h.y0=0,h.x1=t,h.y1=n,h.eachBefore(c),i=[0],e&&h.eachBefore(CP),h}function c(h){var d=i[h.depth],p=h.x0+d,v=h.y0+d,m=h.x1-d,g=h.y1-d;m=h-1){var x=a[c];x.x0=p,x.y0=v,x.x1=m,x.y1=g;return}for(var b=u[c],S=d/2+b,C=c+1,w=h-1;C>>1;u[A]g-v){var O=d?(p*k+m*L)/d:m;f(c,C,L,p,v,O,g),f(C,h,k,O,v,m,g)}else{var M=d?(v*k+g*L)/d:g;f(c,C,L,p,v,m,M),f(C,h,k,p,M,m,g)}}}function bft(r,e,t,n,i){(r.depth&1?ag:zh)(r,e,t,n,i)}var _ft=function r(e){function t(n,i,a,o,s){if((l=n._squarify)&&l.ratio===e)for(var l,u,f,c,h=-1,d,p=l.length,v=n.value;++h1?n:1)},t}(OW);var og=z(q());var $qt={field:"value",size:[1,1],round:!1,padding:0,sort:function(r,e){return e.value-r.value},as:["x","y"],ignoreParentValue:!0};function Sft(r,e){e=(0,og.assign)({},$qt,e);var t=e.as;if(!(0,og.isArray)(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var n;try{n=n_(e)}catch(l){console.warn(l)}var i=function(l){return wP().size(e.size).round(e.round).padding(e.padding)(Gh(l).sum(function(u){return(0,og.size)(u.children)?e.ignoreParentValue?0:u[n]-(0,og.reduce)(u.children,function(f,c){return f+c[n]},0):u[n]}).sort(e.sort))},a=i(r),o=t[0],s=t[1];return a.each(function(l){var u,f;l[o]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((u=l.data)===null||u===void 0?void 0:u.name)||((f=l.data)===null||f===void 0?void 0:f.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(function(c){t.indexOf(c)===-1&&delete l[c]})}),i_(a)}var TP=z(q());var Qqt={field:"value",tile:"treemapSquarify",size:[1,1],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,as:["x","y"],sort:function(r,e){return e.value-r.value},ratio:.5*(1+Math.sqrt(5))};function Jqt(r,e){return r==="treemapSquarify"?MP[r].ratio(e):MP[r]}function IP(r,e){e=(0,TP.assign)({},Qqt,e);var t=e.as;if(!(0,TP.isArray)(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var n;try{n=n_(e)}catch(u){console.warn(u)}var i=Jqt(e.tile,e.ratio),a=function(u){return PW().tile(i).size(e.size).round(e.round).padding(e.padding).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(Gh(u).sum(function(f){return e.ignoreParentValue&&f.children?0:f[n]}).sort(e.sort))},o=a(r),s=t[0],l=t[1];return o.each(function(u){u[s]=[u.x0,u.x1,u.x1,u.x0],u[l]=[u.y1,u.y1,u.y0,u.y0],["x0","x1","y0","y1"].forEach(function(f){t.indexOf(f)===-1&&delete u[f]})}),i_(o)}function kW(r){var e=r.data,t=r.colorField,n=r.rawFields,i=r.hierarchyConfig,a=i===void 0?{}:i,o=a.activeDepth,s={partition:Sft,treemap:IP},l=r.seriesField,u=r.type||"partition",f=s[u](e,E(E({field:l||"value"},(0,Cft.omit)(a,["activeDepth"])),{type:"hierarchy."+u,as:["x","y"]})),c=[];return f.forEach(function(h){var d,p,v,m,g,x;if(h.depth===0||o>0&&h.depth>o)return null;for(var b=h.data.name,S=E({},h);S.depth>1;)b=((p=S.parent.data)===null||p===void 0?void 0:p.name)+" / "+b,S=S.parent;var C=E(E(E({},Hr(h.data,dn(n||[],[a.field]))),(d={},d[eg]=b,d[a_]=S.data.name,d)),h);l&&(C[l]=h.data[l]||((m=(v=h.parent)===null||v===void 0?void 0:v.data)===null||m===void 0?void 0:m[l])),t&&(C[t]=h.data[t]||((x=(g=h.parent)===null||g===void 0?void 0:g.data)===null||x===void 0?void 0:x[t])),C.ext=a,C[rg]={hierarchyConfig:a,colorField:t,rawFields:n},c.push(C)}),c}function tKt(r){var e=r.chart,t=r.options,n=t.color,i=t.colorField,a=i===void 0?a_:i,o=t.sunburstStyle,s=t.rawFields,l=s===void 0?[]:s,u=kW(t);e.data(u);var f;return o&&(f=function(c){return mt({},{fillOpacity:Math.pow(.85,c.depth)},(0,uf.isFunction)(o)?o(c):o)}),kh(mt({},r,{options:{xField:"x",yField:"y",seriesField:a,rawFields:(0,uf.uniq)(dn(Gut,l)),polygon:{color:n,style:f}}})),r}function eKt(r){var e=r.chart;return e.axis(!1),r}function rKt(r){var e=r.chart,t=r.options,n=t.label,i=mi(e,"polygon");if(!n)i.label(!1);else{var a=n.fields,o=a===void 0?["name"]:a,s=n.callback,l=rr(n,["fields","callback"]);i.label({fields:o,callback:s,cfg:Kn(l)})}return r}function nKt(r){var e=r.chart,t=r.options,n=t.innerRadius,i=t.radius,a=t.reflect,o=e.coordinate({type:"polar",cfg:{innerRadius:n,radius:i}});return a&&o.reflect(a),r}function iKt(r){var e,t=r.options,n=t.hierarchyConfig,i=t.meta;return Fe(un({},(e={},e[wW]=(0,uf.get)(i,(0,uf.get)(n,["field"],"value")),e)))(r)}function aKt(r){var e=r.chart,t=r.options,n=t.tooltip;if(n===!1)e.tooltip(!1);else{var i=n;(0,uf.get)(n,"fields")||(i=mt({},{customItems:function(a){return a.map(function(o){var s=(0,uf.get)(e.getOptions(),"scales"),l=(0,uf.get)(s,[eg,"formatter"],function(f){return f}),u=(0,uf.get)(s,[wW,"formatter"],function(f){return f});return E(E({},o),{name:l(o.data[eg]),value:u(o.data.value)})})}},i)),e.tooltip(i)}return r}function oKt(r){var e=r.drilldown,t=r.interactions,n=t===void 0?[]:t;return(e==null?void 0:e.enabled)?mt({},r,{interactions:dn(n,[{type:"drill-down",cfg:{drillDownConfig:e,transformData:kW}}])}):r}function sKt(r){var e=r.chart,t=r.options,n=t.drilldown;return kr({chart:e,options:oKt(t)}),(n==null?void 0:n.enabled)&&(e.appendPadding=Bm(e.appendPadding,(0,uf.get)(n,["breadCrumb","position"]))),r}function wft(r){return Fe(lr,Xi("sunburstStyle"),tKt,eKt,iKt,Ul,nKt,aKt,rKt,sKt,Sr,nn())(r)}var LP=z(q());function Eft(r){var e=(0,LP.get)(r,["event","data","data"],{});return(0,LP.isArray)(e.children)&&e.children.length>0}function Aft(r){var e=r.view.getCoordinate(),t=e.innerRadius;if(t){var n=r.event,i=n.x,a=n.y,o=e.center,s=o.x,l=o.y,u=e.getRadius()*t,f=Math.sqrt(Math.pow(s-i,2)+Math.pow(l-a,2));return f0&&s<1){var h=f-u;c=h/a/(s/(1-s)+1-1/a)}for(var d=c/(1-s)*s,p=e.addGroup(),v=this.coordinate.getCenter(),m=this.coordinate.getRadius(),g=ea.getAngle(r,this.coordinate),x=g.startAngle,b=g.endAngle,S=x;S0?f:c},p=mt({},r,{options:{xField:i,yField:Xl,seriesField:i,rawFields:[a,l_,NA,Xl],widthRatio:l,interval:{style:u,shape:"waterfall",color:d}}}),v=gi(p).ext,m=v.geometry;return m.customInfo({leaderLine:s}),r}function gKt(r){var e,t,n=r.options,i=n.xAxis,a=n.yAxis,o=n.xField,s=n.yField,l=n.meta,u=mt({},{alias:s},(0,L0.get)(l,s));return Fe(un((e={},e[o]=i,e[s]=a,e[Xl]=a,e),mt({},l,(t={},t[Xl]=u,t[l_]=u,t[RA]=u,t))))(r)}function yKt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?(e.axis(o,!1),e.axis(Xl,!1)):(e.axis(o,i),e.axis(Xl,i)),r}function xKt(r){var e=r.chart,t=r.options,n=t.legend,i=t.total,a=t.risingFill,o=t.fallingFill,s=t.locale,l=y0(s);if(n===!1)e.legend(!1);else{var u=[{name:l.get(["general","increase"]),value:"increase",marker:{symbol:"square",style:{r:5,fill:a}}},{name:l.get(["general","decrease"]),value:"decrease",marker:{symbol:"square",style:{r:5,fill:o}}}];i&&u.push({name:i.label||"",value:"total",marker:{symbol:"square",style:mt({},{r:5},(0,L0.get)(i,"style"))}}),e.legend(mt({},{custom:!0,position:"top",items:u},n)),e.removeInteraction("legend-filter")}return r}function bKt(r){var e=r.chart,t=r.options,n=t.label,i=t.labelMode,a=t.xField,o=mi(e,"interval");if(!n)o.label(!1);else{var s=n.callback,l=rr(n,["callback"]);o.label({fields:i==="absolute"?[RA,a]:[l_,a],callback:s,cfg:Kn(l)})}return r}function _Kt(r){var e=r.chart,t=r.options,n=t.tooltip,i=t.xField,a=t.yField;if(n!==!1){e.tooltip(E({showCrosshairs:!1,showMarkers:!1,shared:!0,fields:[a]},n));var o=e.geometries[0];(n==null?void 0:n.formatter)?o.tooltip(i+"*"+a,n.formatter):o.tooltip(a)}else e.tooltip(!1);return r}function Pft(r){return Fe(vKt,lr,mKt,gKt,yKt,xKt,_Kt,bKt,Is,kr,Sr,nn())(r)}var FW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="waterfall",t}return e.getDefaultOptions=function(){return Oft},e.prototype.changeData=function(t){var n=this.options,i=n.xField,a=n.yField,o=n.total;this.updateOption({data:t}),this.chart.changeData(BP(t,i,a,o))},e.prototype.getSchemaAdaptor=function(){return Pft},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);function kft(r,e,t){var n=t.map(function(o){return o[e]}).filter(function(o){return o!==void 0}),i=n.length>0?Math.max.apply(Math,n):0,a=Math.abs(r)%360;return a?i*360/a:i}function Rft(r,e,t){var n=[];return r.forEach(function(i){var a=n.find(function(o){return o[e]===i[e]});a?a[t]+=i[t]||null:n.push(E({},i))}),n}function SKt(r){var e=r.chart,t=r.options,n=t.barStyle,i=t.color,a=t.tooltip,o=t.colorField,s=t.type,l=t.xField,u=t.yField,f=t.data,c=Oh(f,u);e.data(c);var h=mt({},r,{options:{tooltip:a,seriesField:o,interval:{style:n,color:i,shape:s==="line"?"line":"intervel"},minColumnWidth:t.minBarWidth,maxColumnWidth:t.maxBarWidth,columnBackground:t.barBackground}});return gi(h),s==="line"&&Gi({chart:e,options:{xField:l,yField:u,seriesField:o,point:{shape:"circle",color:i}}}),r}function BW(r){var e,t=r.options,n=t.yField,i=t.xField,a=t.data,o=t.isStack,s=t.isGroup,l=t.colorField,u=t.maxAngle,f=o&&!s&&l?Rft(a,i,n):a,c=Oh(f,n);return Fe(un((e={},e[n]={min:0,max:kft(u,n,c)},e)))(r)}function CKt(r){var e=r.chart,t=r.options,n=t.radius,i=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:n,innerRadius:i,startAngle:a,endAngle:o}}).transpose(),r}function wKt(r){var e=r.chart,t=r.options,n=t.xField,i=t.xAxis;return e.axis(n,i),r}function EKt(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=mi(e,"interval");if(!n)a.label(!1);else{var o=n.callback,s=rr(n,["callback"]);a.label({fields:[i],callback:o,cfg:E(E({},Kn(s)),{type:"polar"})})}return r}function Nft(r){return Fe(Xi("barStyle"),SKt,BW,wKt,CKt,kr,Sr,lr,wn,Ul,nn(),EKt)(r)}var Fft=mt({},ke.getDefaultOptions(),{interactions:[{type:"element-active"}],legend:!1,tooltip:{showMarkers:!1},xAxis:{grid:null,tickLine:null,line:null},maxAngle:240});var GW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radial-bar",t}return e.getDefaultOptions=function(){return Fft},e.prototype.changeData=function(t){this.updateOption({data:t}),BW({chart:this.chart,options:this.options}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Nft},e}(ke);var FA=z(q());var ff="first-axes-view",cf="second-axes-view",Np="series-field-key";var Bft=z(q());function GP(r,e,t,n,i){var a=[];e.forEach(function(c){n.forEach(function(h){var d,p=(d={},d[r]=h[r],d[t]=c,d[c]=h[c],d);a.push(p)})});var o=Object.values((0,Bft.groupBy)(a,t)),s=o[0],l=s===void 0?[]:s,u=o[1],f=u===void 0?[]:u;return i?[l.reverse(),f.reverse()]:[l,f]}function xc(r){return r!=="vertical"}function Gft(r,e,t){var n=e[0],i=e[1],a=n.autoPadding,o=i.autoPadding,s=r.__axisPosition,l=s.layout,u=s.position;if(xc(l)&&u==="top"&&(n.autoPadding=t.instance(a.top,0,a.bottom,a.left),i.autoPadding=t.instance(o.top,a.left,o.bottom,0)),xc(l)&&u==="bottom"&&(n.autoPadding=t.instance(a.top,a.right/2+5,a.bottom,a.left),i.autoPadding=t.instance(o.top,o.right,o.bottom,a.right/2+5)),!xc(l)&&u==="bottom"){var f=a.left>=o.left?a.left:o.left;n.autoPadding=t.instance(a.top,a.right,a.bottom/2+5,f),i.autoPadding=t.instance(a.bottom/2+5,o.right,o.bottom,f)}if(!xc(l)&&u==="top"){var f=a.left>=o.left?a.left:o.left;n.autoPadding=t.instance(a.top,a.right,0,f),i.autoPadding=t.instance(0,o.right,a.top,f)}}function AKt(r){var e=r.chart,t=r.options,n=t.data,i=t.xField,a=t.yField,o=t.color,s=t.barStyle,l=t.widthRatio,u=t.legend,f=t.layout,c=GP(i,a,Np,n,xc(f));u?e.legend(Np,u):u===!1&&e.legend(!1);var h,d,p=c[0],v=c[1];xc(f)?(h=e.createView({region:{start:{x:0,y:0},end:{x:.5,y:1}},id:ff}),h.coordinate().transpose().reflect("x"),d=e.createView({region:{start:{x:.5,y:0},end:{x:1,y:1}},id:cf}),d.coordinate().transpose(),h.data(p),d.data(v)):(h=e.createView({region:{start:{x:0,y:0},end:{x:1,y:.5}},id:ff}),d=e.createView({region:{start:{x:0,y:.5},end:{x:1,y:1}},id:cf}),d.coordinate().reflect("y"),h.data(p),d.data(v));var m=mt({},r,{chart:h,options:{widthRatio:l,xField:i,yField:a[0],seriesField:Np,interval:{color:o,style:s}}});gi(m);var g=mt({},r,{chart:d,options:{xField:i,yField:a[1],seriesField:Np,widthRatio:l,interval:{color:o,style:s}}});return gi(g),r}function MKt(r){var e,t,n,i=r.options,a=r.chart,o=i.xAxis,s=i.yAxis,l=i.xField,u=i.yField,f=qr(a,ff),c=qr(a,cf),h={};return(0,FA.keys)((i==null?void 0:i.meta)||{}).map(function(d){(0,FA.get)(i==null?void 0:i.meta,[d,"alias"])&&(h[d]=i.meta[d].alias)}),a.scale((e={},e[Np]={sync:!0,formatter:function(d){return(0,FA.get)(h,d,d)}},e)),un((t={},t[l]=o,t[u[0]]=s[u[0]],t))(mt({},r,{chart:f})),un((n={},n[l]=o,n[u[1]]=s[u[1]],n))(mt({},r,{chart:c})),r}function TKt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField,s=t.layout,l=qr(e,ff),u=qr(e,cf);return(n==null?void 0:n.position)==="bottom"?u.axis(a,E(E({},n),{label:{formatter:function(){return""}}})):u.axis(a,!1),n===!1?l.axis(a,!1):l.axis(a,E({position:xc(s)?"top":"bottom"},n)),i===!1?(l.axis(o[0],!1),u.axis(o[1],!1)):(l.axis(o[0],i[o[0]]),u.axis(o[1],i[o[1]])),e.__axisPosition={position:l.getOptions().axes[a].position,layout:s},r}function IKt(r){var e=r.chart;return kr(mt({},r,{chart:qr(e,ff)})),kr(mt({},r,{chart:qr(e,cf)})),r}function LKt(r){var e=r.chart,t=r.options,n=t.yField,i=t.yAxis;return af(mt({},r,{chart:qr(e,ff),options:{yAxis:i[n[0]]}})),af(mt({},r,{chart:qr(e,cf),options:{yAxis:i[n[1]]}})),r}function OKt(r){var e=r.chart;return lr(mt({},r,{chart:qr(e,ff)})),lr(mt({},r,{chart:qr(e,cf)})),r}function DKt(r){var e=r.chart;return Sr(mt({},r,{chart:qr(e,ff)})),Sr(mt({},r,{chart:qr(e,cf)})),r}function PKt(r){var e=this,t,n,i=r.chart,a=r.options,o=a.label,s=a.yField,l=a.layout,u=qr(i,ff),f=qr(i,cf),c=mi(u,"interval"),h=mi(f,"interval");if(!o)c.label(!1),h.label(!1);else{var d=o.callback,p=rr(o,["callback"]);p.position||(p.position="middle"),p.offset===void 0&&(p.offset=2);var v=E({},p);if(xc(l)){var m=((t=v.style)===null||t===void 0?void 0:t.textAlign)||(p.position==="middle"?"center":"left");p.style=mt({},p.style,{textAlign:m});var g={left:"right",right:"left",center:"center"};v.style=mt({},v.style,{textAlign:g[m]})}else{var x={top:"bottom",bottom:"top",middle:"middle"};typeof p.position=="string"?p.position=x[p.position]:typeof p.position=="function"&&(p.position=function(){for(var C=[],w=0;wU)throw new Error("circular link");j=H,H=new Set}if(u)for(var et=Math.max(jP(G,function(st){return st.depth})+1,0),ut=void 0,$=0;$U)throw new Error("circular link");j=H,H=new Set}}function S(D){for(var G=D.nodes,U=Math.max(jP(G,function(gt){return gt.depth})+1,0),j=(t-r-i)/(U-1),H=new Array(U).fill(0).map(function(){return[]}),tt=0,et=G;tt0){var it=(st/_t-$.y0)*G;$.y0+=it,$.y1+=it,I($)}}f===void 0&&tt.sort(WP),tt.length&&k(tt,U)}}function L(D,G,U){for(var j=D.length,H=j-2;H>=0;--H){for(var tt=D[H],et=0,ut=tt;et0){var it=(st/_t-$.y0)*G;$.y0+=it,$.y1+=it,I($)}}f===void 0&&tt.sort(WP),tt.length&&k(tt,U)}}function k(D,G){var U=D.length>>1,j=D[U];M(D,j.y0-o,U-1,G),O(D,j.y1+o,U+1,G),M(D,n,D.length-1,G),O(D,e,0,G)}function O(D,G,U,j){for(;U1e-6&&(H.y0+=tt,H.y1+=tt),G=H.y1+o}}function M(D,G,U,j){for(;U>=0;--U){var H=D[U],tt=(H.y1-G)*j;tt>1e-6&&(H.y0-=tt,H.y1-=tt),G=H.y0-o}}function I(D){var G=D.sourceLinks,U=D.targetLinks;if(c===void 0){for(var j=0,H=U;j "+i,value:a}}},nodeWidthRatio:.008,nodePaddingRatio:.01,animation:{appear:{animation:"wave-in"},enter:{animation:"wave-in"}}}},e.prototype.changeData=function(t){this.updateOption({data:t});var n=VP(this.options,this.chart.width,this.chart.height),i=n.nodes,a=n.edges,o=qr(this.chart,c_),s=qr(this.chart,h_);o.changeData(i),s.changeData(a)},e.prototype.getSchemaAdaptor=function(){return tct},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);var oct=z(q());var O0=z(q()),rZt={y:0,nodeWidthRatio:.05,weight:!1,nodePaddingRatio:.1,id:function(r){return r.id},source:function(r){return r.source},target:function(r){return r.target},sourceWeight:function(r){return r.value||1},targetWeight:function(r){return r.value||1},sortBy:null};function nZt(r,e,t){(0,O0.forIn)(r,function(n,i){n.inEdges=e.filter(function(a){return""+t.target(a)==""+i}),n.outEdges=e.filter(function(a){return""+t.source(a)==""+i}),n.edges=n.outEdges.concat(n.inEdges),n.frequency=n.edges.length,n.value=0,n.inEdges.forEach(function(a){n.value+=t.targetWeight(a)}),n.outEdges.forEach(function(a){n.value+=t.sourceWeight(a)})})}function iZt(r,e){var t={weight:function(i,a){return a.value-i.value},frequency:function(i,a){return a.frequency-i.frequency},id:function(i,a){return(""+e.id(i)).localeCompare(""+e.id(a))}},n=t[e.sortBy];!n&&(0,O0.isFunction)(e.sortBy)&&(n=e.sortBy),n&&r.sort(n)}function aZt(r,e){var t=r.length;if(!t)throw new TypeError("Invalid nodes: it's empty!");if(e.weight){var n=e.nodePaddingRatio;if(n<0||n>=1)throw new TypeError("Invalid nodePaddingRatio: it must be in range [0, 1)!");var i=n/(2*t),a=e.nodeWidthRatio;if(a<=0||a>=1)throw new TypeError("Invalid nodeWidthRatio: it must be in range (0, 1)!");var o=0;r.forEach(function(l){o+=l.value}),r.forEach(function(l){l.weight=l.value/o,l.width=l.weight*(1-n),l.height=a}),r.forEach(function(l,u){for(var f=0,c=u-1;c>=0;c--)f+=r[c].width+2*i;var h=l.minX=i+f,d=l.maxX=l.minX+l.width,p=l.minY=e.y-a/2,v=l.maxY=p+a;l.x=[h,d,d,h],l.y=[p,p,v,v]})}else{var s=1/t;r.forEach(function(l,u){l.x=(u+.5)*s,l.y=e.y})}return r}function oZt(r,e,t){if(t.weight){var n={};(0,O0.forIn)(r,function(i,a){n[a]=i.value}),e.forEach(function(i){var a=t.source(i),o=t.target(i),s=r[a],l=r[o];if(s&&l){var u=n[a],f=t.sourceWeight(i),c=s.minX+(s.value-u)/s.value*s.width,h=c+f/s.value*s.width;n[a]-=f;var d=n[o],p=t.targetWeight(i),v=l.minX+(l.value-d)/l.value*l.width,m=v+p/l.value*l.width;n[o]-=p;var g=t.y;i.x=[c,h,v,m],i.y=[g,g,g,g],i.source=s,i.target=l}})}else e.forEach(function(i){var a=r[t.source(i)],o=r[t.target(i)];a&&o&&(i.x=[a.x,o.x],i.y=[a.y,o.y],i.source=a,i.target=o)});return e}function sZt(r){return(0,O0.assign)({},rZt,r)}function nct(r,e){var t=sZt(r),n={},i=e.nodes,a=e.links;i.forEach(function(l){var u=t.id(l);n[u]=l}),nZt(n,a,t),iZt(i,t);var o=aZt(i,t),s=oZt(n,a,t);return{nodes:o,links:s}}var ict=z(q()),t6="x",e6="y",r6="name",n6="source",act={nodeStyle:{opacity:1,fillOpacity:1,lineWidth:1},edgeStyle:{opacity:.5,lineWidth:2},label:{fields:["x","name"],callback:function(r,e){var t=(r[0]+r[1])/2,n=t>.5?-4:4;return{labelEmit:!0,style:{fill:"#8c8c8c"},offsetX:n,content:e}}},tooltip:{showTitle:!1,showMarkers:!1,fields:["source","target","value","isNode"],showContent:function(r){return!(0,ict.get)(r,[0,"data","isNode"])},formatter:function(r){var e=r.source,t=r.target,n=r.value;return{name:e+" -> "+t,value:n}}},interactions:[{type:"element-active"}],weight:!0,nodePaddingRatio:.1,nodeWidthRatio:.05};function lZt(r){var e=r.options,t=e.data,n=e.sourceField,i=e.targetField,a=e.weightField,o=e.nodePaddingRatio,s=e.nodeWidthRatio,l=e.rawFields,u=l===void 0?[]:l,f=fD(t,n,i,a),c=nct({weight:!0,nodePaddingRatio:o,nodeWidthRatio:s},f),h=c.nodes,d=c.links,p=h.map(function(m){return E(E({},Hr(m,dn(["id","x","y","name"],u))),{isNode:!0})}),v=d.map(function(m){return E(E({source:m.source.name,target:m.target.name,name:m.source.name||m.target.name},Hr(m,dn(["x","y","value"],u))),{isNode:!1})});return E(E({},r),{ext:E(E({},r.ext),{chordData:{nodesData:p,edgesData:v}})})}function uZt(r){var e,t=r.chart;return t.scale((e={x:{sync:!0,nice:!0},y:{sync:!0,nice:!0,max:1}},e[r6]={sync:"color"},e[n6]={sync:"color"},e)),r}function fZt(r){var e=r.chart;return e.axis(!1),r}function cZt(r){var e=r.chart;return e.legend(!1),r}function hZt(r){var e=r.chart,t=r.options,n=t.tooltip;return e.tooltip(n),r}function dZt(r){var e=r.chart;return e.coordinate("polar").reflect("y"),r}function pZt(r){var e=r.chart,t=r.options,n=r.ext.chordData.nodesData,i=t.nodeStyle,a=t.label,o=t.tooltip,s=e.createView();return s.data(n),kh({chart:s,options:{xField:t6,yField:e6,seriesField:r6,polygon:{style:i},label:a,tooltip:o}}),r}function vZt(r){var e=r.chart,t=r.options,n=r.ext.chordData.edgesData,i=t.edgeStyle,a=t.tooltip,o=e.createView();o.data(n);var s={xField:t6,yField:e6,seriesField:n6,edge:{style:i,shape:"arc"},tooltip:a};return sA({chart:o,options:s}),r}function mZt(r){var e=r.chart,t=r.options,n=t.animation;return typeof n=="boolean"?e.animate(n):e.animate(!0),(0,oct.each)(lst(e),function(i){i.animate(n)}),r}function sct(r){return Fe(lr,lZt,dZt,uZt,fZt,cZt,hZt,vZt,pZt,kr,Is,mZt)(r)}var i6=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="chord",t}return e.getDefaultOptions=function(){return act},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sct},e}(ke);var p_=z(q());var HP=z(q());var gZt={field:"value",as:["x","y","r"],sort:function(r,e){return e.value-r.value}};function lct(r,e){e=(0,HP.assign)({},gZt,e);var t=e.as;if(!(0,HP.isArray)(t)||t.length!==3)throw new TypeError('Invalid as: it must be an array with 3 strings (e.g. [ "x", "y", "r" ])!');var n;try{n=n_(e)}catch(u){console.warn(u)}var i=function(u){return SP().size(e.size).padding(e.padding)(Gh(u).sum(function(f){return f[n]}).sort(e.sort))},a=i(r),o=t[0],s=t[1],l=t[2];return a.each(function(u){u[o]=u.x,u[s]=u.y,u[l]=u.r}),i_(a)}function a6(r){var e=r.data,t=r.hierarchyConfig,n=r.rawFields,i=n===void 0?[]:n,a=r.enableDrillDown,o=lct(e,E(E({},t),{field:"value",as:["x","y","r"]})),s=[];return o.forEach(function(l){for(var u,f=l.data.name,c=E({},l);c.depth>1;)f=((u=c.parent.data)===null||u===void 0?void 0:u.name)+" / "+f,c=c.parent;if(a&&l.depth>2)return null;var h=mt({},l.data,E(E(E({},Hr(l.data,i)),{path:f}),l));h.ext=t,h[rg]={hierarchyConfig:t,rawFields:i,enableDrillDown:a},s.push(h)}),s}function o6(r,e,t){var n=B1([r,e]),i=n[0],a=n[1],o=n[2],s=n[3],l=t.width,u=t.height,f=l-(s+a),c=u-(i+o),h=Math.min(f,c),d=(f-h)/2,p=(c-h)/2,v=i+p,m=a+d,g=o+p,x=s+d,b=[v,m,g,x],S=h<0?0:h;return{finalPadding:b,finalSize:S}}var uct=["x","y","r","name","value","path","depth"],fct={colorField:"name",autoFit:!0,pointStyle:{lineWidth:0,stroke:"#fff"},legend:!1,hierarchyConfig:{size:[1,1],padding:0},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1}};function yZt(r){var e=r.chart,t=Math.min(e.viewBBox.width,e.viewBBox.height);return mt({options:{size:function(n){var i=n.r;return i*t}}},r)}function xZt(r){var e=r.options,t=r.chart,n=t.viewBBox,i=e.padding,a=e.appendPadding,o=e.drilldown,s=a;if(o==null?void 0:o.enabled){var l=Bm(t.appendPadding,(0,p_.get)(o,["breadCrumb","position"]));s=B1([l,a])}var u=o6(i,s,n).finalPadding;return t.padding=u,t.appendPadding=0,r}function bZt(r){var e=r.chart,t=r.options,n=e.padding,i=e.appendPadding,a=t.color,o=t.colorField,s=t.pointStyle,l=t.hierarchyConfig,u=t.sizeField,f=t.rawFields,c=f===void 0?[]:f,h=t.drilldown,d=a6({data:t.data,hierarchyConfig:l,enableDrillDown:h==null?void 0:h.enabled,rawFields:c});e.data(d);var p=e.viewBBox,v=o6(n,i,p).finalSize,m=function(g){var x=g.r;return x*v};return u&&(m=function(g){return g[u]*v}),Gi(mt({},r,{options:{xField:"x",yField:"y",seriesField:o,sizeField:u,rawFields:dn(uct,c),point:{color:a,style:s,shape:"circle",size:m}}})),r}function _Zt(r){return Fe(un({},{x:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0},y:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0}}))(r)}function SZt(r){var e=r.chart,t=r.options,n=t.tooltip;if(n===!1)e.tooltip(!1);else{var i=n;(0,p_.get)(n,"fields")||(i=mt({},{customItems:function(a){return a.map(function(o){var s=(0,p_.get)(e.getOptions(),"scales"),l=(0,p_.get)(s,["name","formatter"],function(f){return f}),u=(0,p_.get)(s,["value","formatter"],function(f){return f});return E(E({},o),{name:l(o.data.name),value:u(o.data.value)})})}},i)),e.tooltip(i)}return r}function CZt(r){var e=r.chart;return e.axis(!1),r}function wZt(r){var e=r.drilldown,t=r.interactions,n=t===void 0?[]:t;return(e==null?void 0:e.enabled)?mt({},r,{interactions:dn(n,[{type:"drill-down",cfg:{drillDownConfig:e,transformData:a6,enableDrillDown:!0}}])}):r}function EZt(r){var e=r.chart,t=r.options;return kr({chart:e,options:wZt(t)}),r}function cct(r){return Fe(Xi("pointStyle"),yZt,xZt,lr,_Zt,bZt,CZt,Ul,SZt,EZt,Sr,nn())(r)}var s6=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="circle-packing",t}return e.getDefaultOptions=function(){return fct},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return cct},e.prototype.triggerResize=function(){this.chart.destroyed||(this.chart.forceFit(),this.chart.clear(),this.execAdaptor(),this.chart.render(!0))},e}(ke);var AZt=function(r){V(e,r);function e(t,n,i,a){var o=r.call(this,t,mt({},a,n))||this;return o.type="g2-plot",o.defaultOptions=a,o.adaptor=i,o}return e.prototype.getDefaultOptions=function(){return this.defaultOptions},e.prototype.getSchemaAdaptor=function(){return this.adaptor},e}(ke);var Wh=z(q());var hct=z(q());var MZt={line:AD,pie:kD,column:Hm,bar:DD,area:TD,gauge:FP,"tiny-line":jD,"tiny-column":WD,"tiny-area":UD,"ring-progress":qD,progress:YD,scatter:zD,histogram:HD,funnel:pP},TZt={line:lA,pie:dA,column:fA,bar:cA,area:uA,gauge:kA,"tiny-line":bA,"tiny-column":_A,"tiny-area":SA,"ring-progress":AA,progress:EA,scatter:mA,histogram:wA,funnel:OA},IZt={pie:{label:!1},column:{tooltip:{showMarkers:!1}},bar:{tooltip:{showMarkers:!1}}};function YP(r,e,t){var n=TZt[r];if(!n){console.error("could not find "+r+" plot");return}var i=MZt[r];i({chart:e,options:mt({},n.getDefaultOptions(),(0,hct.get)(IZt,r,{}),t)})}function LZt(r){var e=r.chart,t=r.options,n=t.views,i=t.legend;return(0,Wh.each)(n,function(a){var o=a.region,s=a.data,l=a.meta,u=a.axes,f=a.coordinate,c=a.interactions,h=a.annotations,d=a.tooltip,p=a.geometries,v=e.createView({region:o});v.data(s);var m={};u&&(0,Wh.each)(u,function(g,x){m[x]=Hr(g,Ua)}),m=mt({},l,m),v.scale(m),u?(0,Wh.each)(u,function(g,x){v.axis(x,g)}):v.axis(!1),v.coordinate(f),(0,Wh.each)(p,function(g){var x=Bi({chart:v,options:g}).ext,b=g.adjust;b&&x.geometry.adjust(b)}),(0,Wh.each)(c,function(g){g.enable===!1?v.removeInteraction(g.type):v.interaction(g.type,g.cfg)}),(0,Wh.each)(h,function(g){v.annotation()[g.type](E({},g))}),typeof a.animation=="boolean"?v.animate(!1):(v.animate(!0),(0,Wh.each)(v.geometries,function(g){g.animate(a.animation)})),d&&(v.interaction("tooltip"),v.tooltip(d))}),i?(0,Wh.each)(i,function(a,o){e.legend(o,a)}):e.legend(!1),e.tooltip(t.tooltip),r}function OZt(r){var e=r.chart,t=r.options,n=t.plots;return(0,Wh.each)(n,function(i){var a=i.type,o=i.region,s=i.options,l=s===void 0?{}:s,u=l.tooltip,f=e.createView(E({region:o},Hr(l,Mj)));u&&f.interaction("tooltip"),YP(a,f,l)}),r}function dct(r){return Fe(Sr,LZt,OZt,kr,Sr,lr,wn)(r)}var $s=z(q());var XP=z(q());function pct(r,e){var t=r.getModel(),n=t.data,i;return(0,XP.isArray)(n)?i=n[0][e]:i=n[e],i}function vct(r){var e=R1(r);(0,XP.each)(e,function(t){t.hasState("active")&&t.setState("active",!1),t.hasState("selected")&&t.setState("selected",!1),t.hasState("inactive")&&t.setState("inactive",!1)})}var DZt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAssociationItems=function(t,n){var i,a=this.context.event,o=n||{},s=o.linkField,l=o.dim,u=[];if((i=a.data)===null||i===void 0?void 0:i.data){var f=a.data.data;(0,$s.each)(t,function(c){var h,d,p=s;if(l==="x"?p=c.getXScale().field:l==="y"?p=(h=c.getYScales().find(function(m){return m.field===p}))===null||h===void 0?void 0:h.field:p||(p=(d=c.getGroupScales()[0])===null||d===void 0?void 0:d.field),!!p){var v=(0,$s.map)(R1(c),function(m){var g=!1,x=!1,b=(0,$s.isArray)(f)?(0,$s.get)(f[0],p):(0,$s.get)(f,p);return pct(m,p)===b?g=!0:x=!0,{element:m,view:c,active:g,inactive:x}});u.push.apply(u,v)}})}return u},e.prototype.showTooltip=function(t){var n=lD(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){if(a.active){var o=a.element.shape.getCanvasBBox();a.view.showTooltip({x:o.minX+o.width/2,y:o.minY+o.height/2})}})},e.prototype.hideTooltip=function(){var t=lD(this.context.view);(0,$s.each)(t,function(n){n.hideTooltip()})},e.prototype.active=function(t){var n=g0(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){var o=a.active,s=a.element;o&&s.setState("active",!0)})},e.prototype.selected=function(t){var n=g0(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){var o=a.active,s=a.element;o&&s.setState("selected",!0)})},e.prototype.highlight=function(t){var n=g0(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){var o=a.inactive,s=a.element;o&&s.setState("inactive",!0)})},e.prototype.reset=function(){var t=g0(this.context.view);(0,$s.each)(t,function(n){vct(n)})},e}(Ir);nr("association",DZt);xr("association-active",{start:[{trigger:"element:mouseenter",action:"association:active"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});xr("association-selected",{start:[{trigger:"element:mouseenter",action:"association:selected"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});xr("association-highlight",{start:[{trigger:"element:mouseenter",action:"association:highlight"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});xr("association-tooltip",{start:[{trigger:"element:mousemove",action:"association:showTooltip"}],end:[{trigger:"element:mouseleave",action:"association:hideTooltip"}]});var v_=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="mix",t}return e.prototype.getSchemaAdaptor=function(){return dct},e}(ke);var P0=z(q());var D0=z(q());function mct(r,e){var t=e.data,n=e.coordinate,i=e.interactions,a=e.annotations,o=e.animation,s=e.tooltip,l=e.axes,u=e.meta,f=e.geometries;t&&r.data(t);var c={};l&&(0,D0.each)(l,function(h,d){c[d]=Hr(h,Ua)}),c=mt({},u,c),r.scale(c),n&&r.coordinate(n),l===!1?r.axis(!1):(0,D0.each)(l,function(h,d){r.axis(d,h)}),(0,D0.each)(f,function(h){var d=Bi({chart:r,options:h}).ext,p=h.adjust;p&&d.geometry.adjust(p)}),(0,D0.each)(i,function(h){h.enable===!1?r.removeInteraction(h.type):r.interaction(h.type,h.cfg)}),(0,D0.each)(a,function(h){r.annotation()[h.type](E({},h))}),typeof o=="boolean"?r.animate(!1):(r.animate(!0),(0,D0.each)(r.geometries,function(h){h.animate(o)})),s?(r.interaction("tooltip"),r.tooltip(s)):s===!1&&r.removeInteraction("tooltip")}function PZt(r){var e=r.chart,t=r.options,n=t.type,i=t.data,a=t.fields,o=t.eachView,s=(0,P0.omit)(t,["type","data","fields","eachView","axes","meta","tooltip","coordinate","theme","legend","interactions","annotations"]);return e.data(i),e.facet(n,E(E({},s),{fields:a,eachView:function(l,u){var f=o(l,u);if(f.geometries)mct(l,f);else{var c=f,h=c.options;h.tooltip&&l.interaction("tooltip"),YP(c.type,l,h)}}})),r}function kZt(r){var e=r.chart,t=r.options,n=t.axes,i=t.meta,a=t.tooltip,o=t.coordinate,s=t.theme,l=t.legend,u=t.interactions,f=t.annotations,c={};return n&&(0,P0.each)(n,function(h,d){c[d]=Hr(h,Ua)}),c=mt({},i,c),e.scale(c),e.coordinate(o),n?(0,P0.each)(n,function(h,d){e.axis(d,h)}):e.axis(!1),a?(e.interaction("tooltip"),e.tooltip(a)):a===!1&&e.removeInteraction("tooltip"),e.legend(l),s&&e.theme(s),(0,P0.each)(u,function(h){h.enable===!1?e.removeInteraction(h.type):e.interaction(h.type,h.cfg)}),(0,P0.each)(f,function(h){e.annotation()[h.type](E({},h))}),r}function gct(r){return Fe(lr,PZt,kZt)(r)}var yct={title:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},rowTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},columnTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}}};var l6=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="area",t}return e.getDefaultOptions=function(){return yct},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return gct},e}(ke);var m_;(function(r){r.DEV="DEV",r.BETA="BETA",r.STABLE="STABLE"})(m_||(m_={}));function RZt(r,e){console.warn(r===m_.DEV?"Plot '"+e+"' is in DEV stage, just give us issues.":r===m_.BETA?"Plot '"+e+"' is in BETA stage, DO NOT use it in production env.":r===m_.STABLE?"Plot '"+e+`' is in STABLE stage, import it by "import { `+e+` } from '@antv/g2plot'".`:"invalid Stage type.")}var NZt=function(){function r(){}return Object.defineProperty(r,"MultiView",{get:function(){return RZt(m_.STABLE,"MultiView"),v_},enumerable:!1,configurable:!0}),r}();Cj("en-US",gst);Cj("zh-CN",yst);var u6={scale:un,legend:Ul,tooltip:wn,annotation:nn,interaction:kr,theme:lr,animation:Sr};var UA=z(q());var FZt=function(r,e){var t=document.createElement("div");return e==="tooltip"&&(t.className="g2-tooltip"),ht.render(r,t),t},xct=FZt;var g_=function(r,e){var t={}.toString;return t.call(r)==="[object ".concat(e,"]")},f6=function(r){if(!r)return r;var e={};for(var t in r)e[t]=r[t];return e};var y_=function(r){if(!r||typeof r!="object")return r;var e;return Array.isArray(r)?e=r.map(function(t){return y_(t)}):(e={},Object.keys(r).forEach(function(t){return e[t]=y_(r[t])})),e},k0=function(r,e){for(var t=r,n=0;nYX,DagreGraph:()=>HX,DecompositionTreeGraph:()=>TAt,Edge:()=>D_,FlowAnalysisGraph:()=>MAt,FundFlowGraph:()=>DAt,G6:()=>Ur,Graph:()=>IS,IndentedTree:()=>XX,IndentedTreeGraph:()=>qX,Node:()=>pg,OrganizationGraph:()=>EAt,OrganizationTreeGraph:()=>WX,OrganizationalGraph:()=>KX,RadialGraph:()=>ZX,RadialTreeGraph:()=>AAt});var x_=z(q());var X6=z(q()),wct={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(e){return Object.assign(this,e),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(e){var t=this,n=this.events;this.graph=e,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!0),(0,X6.each)(n,function(i,a){e.on(a,i)}),document.addEventListener("visibilitychange",function(){t.keydown=!1})},unbind:function(e){var t=this.events,n=e.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!1),(0,X6.each)(t,function(i,a){e.off(a,i)}),e.get("canvas").set("draggable",n)},get:function(e){return this[e]},set:function(e,t){return this[e]=t,this}};var sQt=function(){function r(){}return r.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var n=(0,x_.clone)(wct);Object.assign(n,t);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var l=this.getEvents();this.events=null;var u={};l&&((0,x_.each)(l,function(f,c){u[c]=(0,x_.wrapBehavior)(s,f)}),this.events=u)};i.prototype=n,r.types[e]=i},r.hasBehavior=function(e){return!!r.types[e]},r.getBehavior=function(e){return r.types[e]},r.types={},r}(),ZP=sQt;var q6=ZP;var Lr=z(q());var mV={};Dn(mV,{GADDI:()=>vV,Stack:()=>E_,breadthFirstSearch:()=>K6,connectedComponent:()=>__,cosineSimilarity:()=>YA,default:()=>YQt,depthFirstSearch:()=>S_,detectAllCycles:()=>J6,detectAllDirectedCycle:()=>tk,detectAllUndirectedCycle:()=>JP,detectCycle:()=>ek,detectDirectedCycle:()=>Zct,dijkstra:()=>lg,findAllPath:()=>eV,findShortestPath:()=>tV,floydWarshall:()=>ug,getAdjMatrix:()=>hf,getDegree:()=>Fp,getInDegree:()=>$6,getNeighbors:()=>fo,getOutDegree:()=>Q6,iLouvain:()=>oV,kCore:()=>sV,kMeans:()=>lV,labelPropagation:()=>rV,louvain:()=>HA,minimumSpanningTree:()=>fV,nodesCosineSimilarity:()=>uV,pageRank:()=>cV});var lQt=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,f=o[l],c=o[u];!f&&f!==0||!c&&c!==0||(a[f][c]=1,t||(a[c][f]=1))}),a},hf=lQt;var uQt=function(e,t){return e===t},Ect=function(){function r(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return r.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},r}();var fQt=function(){function r(e){e===void 0&&(e=uQt),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new Ect(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new Ect(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},r.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,e)?(t=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,e)&&(this.tail=n),t},r.prototype.find=function(e){var t=e.value,n=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},r.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},r.prototype.fromArray=function(e){var t=this;return e.forEach(function(n){return t.append(n)}),this},r.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},r.prototype.reverse=function(){for(var e=this.head,t=null,n=null;e;)n=e.next,e.next=t,t=e,e=n;this.tail=this.head,this.head=t},r.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},r}(),$P=fQt;var cQt=function(){function r(){this.linkedList=new $P}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(e){this.linkedList.append(e)},r.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toString=function(e){return this.linkedList.toString(e)},r}(),Act=cQt;var fo=function(e,t,n){t===void 0&&(t=[]);var i=t.filter(function(l){return l.source===e||l.target===e});if(n==="target"){var a=function(u){return u.source===e};return i.filter(a).map(function(l){return l.target})}if(n==="source"){var o=function(u){return u.target===e};return i.filter(o).map(function(l){return l.source})}var s=function(u){return u.source===e?u.target:u.source};return i.map(s)},Mct=function(e,t){return t.filter(function(n){return n.source===e})},b_=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})},QP=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(n)};function hQt(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}var dQt=function(e,t,n,i){i===void 0&&(i=!0);var a=hQt(n),o=new Act,s=e.edges,l=s===void 0?[]:s;o.enqueue(t);for(var u="",f=function(){var h=o.dequeue();a.enter({current:h,previous:u}),fo(h,l,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:u,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:u}),u=h};!o.isEmpty();)f()},K6=dQt;var pQt=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l=[],u=function d(p){l.push(p),s[p.id]=!0;for(var v=fo(p.id,a),m=function(b){var S=v[b];if(!s[S]){var C=n.filter(function(w){return w.id===S});C.length>0&&d(C[0])}},g=0;g0;)h.push(l.pop());o.push(h)}}return o},Z6=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},f=[],c=0,h=function m(g){l[g.id]=c,u[g.id]=c,c+=1,o.push(g),s[g.id]=!0;for(var x=fo(g.id,a,"target").filter(function(A){return n.map(function(L){return L.id}).indexOf(A)>-1}),b=function(L){var k=x[L];if(!l[k]&&l[k]!==0){var O=n.filter(function(M){return M.id===k});O.length>0&&m(O[0]),u[g.id]=Math.min(u[g.id],u[k])}else s[k]&&(u[g.id]=Math.min(u[g.id],l[k]))},S=0;S0;){var w=o.pop();if(s[w.id]=!1,C.push(w),w===g)break}C.length>0&&f.push(C)}},d=0,p=n;d0;)for(var m=d.pop(),g=m.id,x=fo(g,e.edges),b=function(w){var A,L=x[w],k=e.nodes.find(function(F){return F.id===L});if(L===g)o.push((A={},A[L]=m,A));else if(!(L in v))p[L]=m,d.push(k),v[L]=new Set([m]);else if(!v[g].has(k)){for(var O=!0,M=[k,m],I=p[g];v[L].size&&!v[L].has(I)&&(M.push(I),I!==p[I.id]);)I=p[I.id];if(M.push(I),t&&n?(O=!1,M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!0)):t&&!n&&M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!1),O){for(var R={},P=1;P0;){var P=R.pop();a.has(P)&&(a.delete(P),o[P.id].forEach(function(F){R.push(F)}),o[P.id].clear())}},c=function M(I,R,P){var F=!1;if(t&&n===!1&&t.indexOf(I.id)>-1)return F;i.push(I),a.add(I);for(var D=P[I.id],G=0;G-1});ut<$.length;ut++){var st=$[ut];st===et.id&&!(n===!1&&t.indexOf(et.id)>-1)?s.push((R={},R[et.id]=et,R)):tt[et.id].push(u[st])}}return{component:H,adjList:tt,minIdx:F}},b=0;b=b}),C=Z6({nodes:S,edges:e.edges}).filter(function(M){return M.length>1});if(C.length===0)break;var w=x(C),A=w.minIdx,L=w.adjList,k=w.component;if(k.length>1){k.forEach(function(M){o[M.id]=new Set});var O=l[A];if(t&&n&&t.indexOf(O.id)===-1)return s;c(O,O,L),b=A+1}else break}return s},J6=function(e,t,n,i){return i===void 0&&(i=!0),t?tk(e,n,i):JP(e,n,i)},ek=mQt;var Ict=z(q());var gQt=function(e,t,n){for(var i=1/0,a,o=0;oc[C.id]+I?(c[M]=c[C.id]+I,h[M]=[C.id]):c[M]===c[C.id]+I&&h[M].push(C.id)})},v=0;v0&&f.length>0;){var d=f[f.length-1];if(d.length){var p=d.shift();p&&(l.push(p),u[p]=!0,h=i?fo(p,s,"target"):fo(p,s),f.push(h.filter(function(g){return!u[g]})))}else{var v=l.pop();u[v]=!1,f.pop();continue}if(l[l.length-1]===n){var m=l.map(function(x){return x});c.push(m);var v=l.pop();u[v]=!1,f.pop()}}return c};var xQt=function(e,t){for(var n=hf(e,t),i=[],a=n.length,o=0;oi[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},ug=xQt;var bQt=function(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},f={};o.forEach(function(S,C){var w=QP();S.clusterId=w,u[w]={id:w,nodes:[S]},f[S.id]={node:S,idx:C}});var c=hf(e,t),h=[],d={};c.forEach(function(S,C){var w=0,A=o[C].id;d[A]={},S.forEach(function(L,k){if(!!L){w+=L;var O=o[k].id;d[A][O]=L}}),h.push(w)});for(var p=0,v=function(){var C=!1;if(o.forEach(function(w){var A={};Object.keys(d[w.id]).forEach(function(F){var D=d[w.id][F],G=f[F].node,U=G.clusterId;A[U]||(A[U]=0),A[U]+=D});var L=-1/0,k=[];if(Object.keys(A).forEach(function(F){L=0&&k.splice(O,1),k&&k.length){C=!0;var M=u[w.clusterId],I=M.nodes.indexOf(w);M.nodes.splice(I,1);var R=Math.floor(Math.random()*k.length),P=u[k[R]];P.nodes.push(w),w.clusterId=P.id}}}),!C)return"break";p++};p0&&C>w&&C-ww&&(L=l.map(function(D){return{node:D,clusterId:D.clusterId}}),k=(0,Dct.clone)(v),w=C),O||A>100)break;A++,Object.keys(v).forEach(function(D){var G=0;f.forEach(function(U){var j=U.source,H=U.target,tt=m[j].node.clusterId,et=m[H].node.clusterId;(tt===D&&et!==D||et===D&&tt!==D)&&(G=G+(U[n]||1))}),v[D].sumTot=G}),l.forEach(function(D,G){var U=v[D.clusterId],j=0,H,tt=x[G]/(2*S),et=0,ut=U.nodes;ut.forEach(function(it){var K=m[it.id].idx;et+=g[G][K]||0});var $=et-U.sumTot*tt,st=ut.filter(function(it){return it.id!==D.id}),_t=[];st.forEach(function(it,K){_t[K]=c[it.originIndex]});var dt=aV(st,c)*o,gt=b[D.id];if(Object.keys(gt).forEach(function(it){var K=m[it].node,Rt=K.clusterId;if(Rt!==D.clusterId){var Xt=v[Rt],Zt=Xt.nodes;if(!(!Zt||!Zt.length)){var Ae=0;Zt.forEach(function(pt){var Et=m[pt.id].idx;Ae+=g[G][Et]||0});var We=Ae-Xt.sumTot*tt,$e=Zt.concat([D]),W=[];$e.forEach(function(pt,Et){W[Et]=c[pt.originIndex]});var Te=aV($e,c)*o,ne=We-$;a&&(ne=We+Te-($+dt)),ne>j&&(j=ne,H=Xt)}}}),j>0){H.nodes.push(D);var Tt=D.clusterId;D.clusterId=H.id;var Ut=U.nodes.indexOf(D);U.nodes.splice(Ut,1);var $t=0,Y=0;f.forEach(function(it){var K=it.source,Rt=it.target,Xt=m[K].node.clusterId,Zt=m[Rt].node.clusterId;(Xt===H.id&&Zt!==H.id||Zt===H.id&&Xt!==H.id)&&($t=$t+(it[n]||1)),(Xt===Tt&&Zt!==Tt||Zt===Tt&&Xt!==Tt)&&(Y=Y+(it[n]||1))}),H.sumTot=$t,U.sumTot=Y}})}var M={},I=0;Object.keys(k).forEach(function(D){var G=k[D];if(!G.nodes||!G.nodes.length){delete k[D];return}var U=String(I+1);U!==D&&(G.id=U,G.nodes=G.nodes.map(function(j){return{id:j.id,clusterId:U}}),k[U]=G,M[D]=U,delete k[D],I++)}),L.forEach(function(D){var G=D.node,U=D.clusterId;G.clusterId=U,G.clusterId&&M[G.clusterId]&&(G.clusterId=M[G.clusterId])});var R=[],P={};f.forEach(function(D){var G=D.source,U=D.target,j=D[n]||1,H=m[G].node.clusterId,tt=m[U].node.clusterId,et="".concat(H,"---").concat(tt);if(P[et])P[et].weight+=j,P[et].count++;else{var ut={source:H,target:tt,weight:j,count:1};P[et]=ut,R.push(ut)}});var F=[];return Object.keys(k).forEach(function(D){F.push(k[D])}),{clusters:F,clusterEdges:R}},HA=CQt;var wQt=function(e,t,n,i,a){return t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=1),HA(e,t,n,i,!0,a)},oV=wQt;var kct=z(q());var EQt=function(e,t){var n;t===void 0&&(t=1);for(var i=(0,kct.clone)(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,l=s===void 0?[]:s,u=function(){var h=Fp({nodes:o,edges:l}),d=Object.keys(h);d.sort(function(m,g){var x,b;return((x=h[m])===null||x===void 0?void 0:x.degree)-((b=h[g])===null||b===void 0?void 0:b.degree)});var p=d[0];if(!o.length||((n=h[p])===null||n===void 0?void 0:n.degree)>=t)return"break";var v=o.findIndex(function(m){return m.id===p});o.splice(v,1),l=l.filter(function(m){return!(m.source===p||m.target===p)})};;){var f=u();if(f==="break")break}return{nodes:o,edges:l}},sV=EQt;var AQt=function(e,t,n,i,a,o){t===void 0&&(t=3),n===void 0&&(n=[]),i===void 0&&(i=[]),a===void 0&&(a="properties"),o===void 0&&(o=R0.EuclideanDistance);for(var s=e.nodes,l=e.edges,u=C_(s,a),f=w_(u,n,i),c=0;cm&&(m=w,g=x)}h[c]=f[g],d.push(g),p[c]=[s[g]],s[g].clusterId=String(c)}for(var A=0;;){for(var c=0;c=1e3)break}var F=[],D={};return l.forEach(function(G){var U,j,H=G.source,tt=G.target,et=(U=s.find(function(_t){return _t.id===H}))===null||U===void 0?void 0:U.clusterId,ut=(j=s.find(function(_t){return _t.id===tt}))===null||j===void 0?void 0:j.clusterId,$="".concat(et,"---").concat(ut);if(D[$])D[$].count++;else{var st={source:et,target:ut,count:1};D[$]=st,F.push(st)}}),{clusters:p,clusterEdges:F}},lV=AQt;var MQt=function(e,t){var n=new Ds(t),i=n.norm2(),a=new Ds(e),o=a.norm2(),s=n.dot(a),l=i*o,u=l?s/l:0;return u},YA=MQt;var Rct=z(q());var TQt=function(e,t,n,i,a){e===void 0&&(e=[]),n===void 0&&(n=[]),i===void 0&&(i=[]),a===void 0&&(a="properties");var o=(0,Rct.clone)(e.filter(function(h){return h.id!==t.id})),s=e.findIndex(function(h){return h.id===t.id}),l=C_(e,a),u=w_(l,n,i),f=u[s],c=[];return o.forEach(function(h,d){if(h.id!==t.id){var p=u[d],v=YA(p,f);c.push(v),h.cosineSimilarity=v}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},uV=TQt;var IQt=function(){function r(e){this.count=e.length,this.parent={};for(var t=0,n=e;t0&&(this.list[0]=t,this.moveDown(0)),e},r.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},r.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var n=this.list[t];this.list[t]=this.list[e],this.list[e]=n,e=t,t=this.getParent(e)}},r.prototype.moveDown=function(e){var t,n=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i0?n=i:a!==null&&a0&&(n=a),e!==n&&(t=[this.list[n],this.list[e]],this.list[e]=t[0],this.list[n]=t[1],this.moveDown(n))},r}(),Fct=OQt;var DQt=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=a[0],u=new Set;u.add(l);var f=function(m,g){return t?m.weight-g.weight:0},c=new Fct(f);for(b_(l.id,s).forEach(function(v){c.insert(v)});!c.isEmpty();){var h=c.delMin(),d=h.source,p=h.target;u.has(d)&&u.has(p)||(n.push(h),u.has(d)||(u.add(d),b_(d,s).forEach(function(v){c.insert(v)})),u.has(p)||(u.add(p),b_(p,s).forEach(function(v){c.insert(v)})))}return n},Bct=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=s.map(function(d){return d});t&&l.sort(function(d,p){return d.weight-p.weight});for(var u=new Nct(a.map(function(d){return d.id}));l.length>0;){var f=l.shift(),c=f.source,h=f.target;u.connected(c,h)||(n.push(f),u.union(c,h))}return n},PQt=function(e,t,n){var i={prim:DQt,kruskal:Bct};return n?i[n](e,t):Bct(e,t)},fV=PQt;var kQt=function(e,t,n){typeof t!="number"&&(t=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,f=u===void 0?[]:u,c=l.length,h,d={},p={},v=0;v0&&i>t;){a=0;for(var v=0;v0&&(h+=p[C]/w)}d[g]=n*h,a+=d[g]}}a=(1-a)/c,i=0;for(var v=0;v=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;ad||i.hasNode(o[h.to])||(t.labelb;C--){var w=S(C);if(w==="break")break}if(g){var A=e.findMinLabel(m);o.dfsEdgeList.push(new N0(v,x,bc,A.edgeLabel,bc));var L=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[L]!==o.dfsEdgeList[L]?!1:c(m[A.edgeLabel].projected)}var k={};g=!1;var O=0;h.forEach(function(D){var G=new nk(D),U=e.findForwardPureEdges(i,G.edges[d[0]],p,G);U.length>0&&(g=!0,O=v,U.forEach(function(j){var H="".concat(j.label,"-").concat(a[j.to].label);k[H]||(k[H]={projected:[],edgeLabel:j.label,nodeLabel2:a[j.to].label}),k[H].projected.push({graphId:i.id,edge:j,preNode:D})}))});for(var M=d.length,I=function(G){if(g)return"break";var U=d[G];h.forEach(function(j){var H=new nk(j),tt=e.findForwardRmpathEdges(i,H.edges[U],p,H);tt.length>0&&(g=!0,O=o.dfsEdgeList[U].fromNode,tt.forEach(function(et){var ut="".concat(et.label,"-").concat(a[et.to].label);k[ut]||(k[ut]={projected:[],edgeLabel:et.label,nodeLabel2:a[et.to].label}),k[ut].projected.push({graphId:i.id,edge:et,preNode:j})}))})},C=0;C=0;p--){var v=t.findBackwardEdge(c,d.edges[a[p]],d.edges[a[0]],d);if(v){var m="".concat(t.dfsCode.dfsEdgeList[a[p]].fromNode,"-").concat(v.label);u[m]||(u[m]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[p]].fromNode,edgeLabel:v.label}),u[m].projected.push({graphId:f.graphId,edge:v,preNode:f})}}if(!(i>=t.maxNodeNum)){var g=t.findForwardPureEdges(c,d.edges[a[0]],s,d);g.forEach(function(b){var S="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);l[S]||(l[S]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),l[S].projected.push({graphId:f.graphId,edge:b,preNode:f})});for(var x=function(S){var C=t.findForwardRmpathEdges(c,d.edges[a[S]],s,d);C.forEach(function(w){var A="".concat(t.dfsCode.dfsEdgeList[a[S]].fromNode,"-").concat(w.label,"-").concat(h[w.to].label);l[A]||(l[A]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[S]].fromNode,edgeLabel:w.label,nodeLabel2:h[w.to].label}),l[A].projected.push({graphId:f.graphId,edge:w,preNode:f})})},p=0;pb){var S=b;b=x,x=S}var C=g.label,w="".concat(u,"-").concat(x,"-").concat(C,"-").concat(b),A="".concat(x,"-").concat(C,"-").concat(b);if(!o[A]){var L=o[A]||0;L++,o[A]=L}l[w]={graphId:u,nodeLabel1:x,edgeLabel:C,nodeLabel2:b}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f2*t)););if(m<2*t&&(s["".concat(f,"-").concat(v)]={start:f,end:v,distance:a[f][v]},c++,l++,l>=n))return s;if(h++,h>2*t)break}if(ch&&(l=h);var d=n[c.id].inDegree;u>d&&(u=d);var p=n[c.id].outDegree;f>p&&(f=p)}),e[t]={degree:l,inDegree:u,outDegree:f}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:f}},VQt=function(e,t,n,i,a,o,s){var l;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var f=ug(e,n),c=ug(t,n),h=qct(e.nodes,f,n),d=qct(t.nodes,c,n),p=Yct(e.nodes,o),v=p.nodeMap,m=p.nodeLabelMap,g=Yct(t.nodes,o),x=g.nodeMap,b=g.nodeLabelMap;Xct(e.edges,s,v);var S=Xct(t.edges,s,x).edgeLabelMap,C=[];c==null||c.forEach(function(W){C=C.concat(W)}),a||(a=Math.max.apply(Math,mn(mn([],C,!1),[2],!1))),i||(i=a);var w=Vct(e,f,o,i),A=Vct(t,c,o,i),L=Math.min(100,u*(u-1)/2),k=UQt(i,u,L,w,f),O=ik(k,w,e),M=10,I=1,R=1,P=4,F={graphs:O,nodeLabelProp:o,edgeLabelProp:s,minSupport:I,minNodeNum:R,maxNodeNum:P,directed:n},D=Wct(F).slice(0,M),G=D.length,U=[];D.forEach(function(W,Te){U[Te]={},Object.keys(O).forEach(function(ne){var pt=O[ne],Et=ak(pt,W,o,s);U[Te][ne]=Et})});var j=jQt(U,G,D),H=j.structure,tt=j.structureCountMap,et=t.nodes[0],ut=[],$=(l=t.nodes[0])===null||l===void 0?void 0:l[o],st=-1/0;t.nodes.forEach(function(W){var Te=W[o],ne=m[Te];(ne==null?void 0:ne.length)>st&&(st=ne.length,ut=ne,$=Te,et=W)});var _t={},dt={},gt={},Tt={},Ut={},$t={};Object.keys(b).forEach(function(W,Te){Ut[W]=[],n&&($t[W]=[]);var ne=-1/0,pt=b[W],Et={};pt.forEach(function(Ht){var ae=d["".concat(et.id,"-").concat(Ht.id)];if(ae&&Ut[W].push(ae),neUt[W][_n]){ga=!0;break}if(ga)return ut.splice(ae,1),"continue";var ii={};Ye.neighbors.forEach(function(En){var ci=h["".concat(ge.id,"-").concat(En.id)];ii["".concat(ge.id,"-").concat(En.id)]={start:v[ge.id].idx,end:v[En.id].idx,distance:ci}}),O=ik(ii,w,e,O);var xi=[];Object.keys(ii).forEach(function(En){if(tt[En]){xi.push(tt[En]);return}var ci=O[En];tt[En]=ak(ci,H,o,s),xi.push(tt[En])}),xi=xi.sort(function(En,ci){return ci-En});for(var Ki=!1,_n=0;_n<$n;_n++)if(xi[_n]=0;Ue--)ee(Ue)});var Y=[];ut==null||ut.forEach(function(W){for(var Te=v[W.id].idx,ne=Hct(e.nodes,f[Te],Te,o,a),pt=ne.neighbors,Et=pt.length,St=!1,Wt=Et-1;Wt>=0;Wt--){if(pt.length+1Ye){pt.splice(Wt,1);continue}if(n){var Ve="".concat(ee.id,"-").concat(W.id),$n=h[Ve];ge=$t[Ue].length-1;var ga=$t[Ue][ge];if($n>ga){pt.splice(Wt,1);continue}}var _n=tt[Ht]?tt[Ht]:WQt(e,W,ee,v,ae,w,H,o,s,tt,O),ii="".concat(et.id,"-").concat(Ue),xi=Tt[ii][Tt[ii].length-1];if(_n=0;ae--){var ga=$n(ae);if(ga==="break")break}if(Ve)return Y.splice(Te,1),"continue";ne.edges=Wt;var _n=lg(ne,ne.nodes[0].id,!1).length;if(Object.keys(_n).reverse().forEach(function(er){if(!(er===ne.nodes[0].id||Ve)){if(_n[er]===1/0){var ai=St[er].node[o];if(Et[ai]--,Et[ai]K[ji][K[ji].length-1]){var ai=St[er].node[o];if(Et[ai]--,Et[ai]=0;ci--){var Nn=ne.nodes[ci],Ia=St[Nn.id].degree,Li=St[Nn.id].inDegree,ko=St[Nn.id].outDegree,ku=Nn[o],Ro=Kct(_t,ku,x,b),ys=Ro.minPatternNodeLabelDegree,Jo=Ro.minPatternNodeLabelInDegree,vl=Ro.minPatternNodeLabelOutDegree,Fs=n?Ia=0;yo--){var Oi=Wt[yo];if(!St[Oi.source]||!St[Oi.target]){Wt.splice(yo,1);var xs=Oi[s];if(ee[xs]--,St[Oi.source]&&(St[Oi.source].degree--,St[Oi.source].outDegree--),St[Oi.target]&&(St[Oi.target].degree--,St[Oi.target].inDegree--),S[xs]&&ee[xs]=0;Zt--){var Ae=Xt(Zt);if(Ae==="break")break}for(var We=Y.length,$e=function(Te){var ne=Y[Te],pt={};ne.edges.forEach(function(Wt){var ee="".concat(Wt.source,"-").concat(Wt.target,"-").concat(Wt.label);pt[ee]?pt[ee]++:pt[ee]=1});for(var Et=function(ee){var Ue=Y[ee],Ht={};Ue.edges.forEach(function(ge){var Ye="".concat(ge.source,"-").concat(ge.target,"-").concat(ge.label);Ht[Ye]?Ht[Ye]++:Ht[Ye]=1});var ae=!0;Object.keys(Ht).length!==Object.keys(pt).length?ae=!1:Object.keys(pt).forEach(function(ge){Ht[ge]!==pt[ge]&&(ae=!1)}),ae&&Y.splice(ee,1)},St=We-1;St>Te;St--)Et(St);We=Y.length},Zt=0;Zt<=We-1;Zt++)$e(Zt);return Y}}},vV=VQt;var HQt=function(){function r(e){e===void 0&&(e=10),this.linkedList=new $P,this.maxStep=e}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),E_=HQt;var Zct=ek;var YQt={getAdjMatrix:hf,breadthFirstSearch:K6,connectedComponent:__,getDegree:Fp,getInDegree:$6,getOutDegree:Q6,detectCycle:ek,detectDirectedCycle:Zct,detectAllCycles:J6,detectAllDirectedCycle:tk,detectAllUndirectedCycle:JP,depthFirstSearch:S_,dijkstra:lg,findAllPath:eV,findShortestPath:tV,floydWarshall:ug,labelPropagation:rV,louvain:HA,iLouvain:oV,kCore:sV,kMeans:lV,cosineSimilarity:YA,nodesCosineSimilarity:uV,minimumSpanningTree:fV,pageRank:cV,getNeighbors:fo,Stack:E_,GADDI:vV};var IV={};Dn(IV,{Line:()=>cg,applyMatrix:()=>A_,compare:()=>XQt,distance:()=>M_,floydWarshall:()=>KQt,fractionToLine:()=>fk,getAdjMatrix:()=>ZQt,getBBoxBoundLine:()=>CV,getCircleCenterByPoints:()=>lk,getCircleIntersectByPoint:()=>yV,getDegree:()=>JQt,getEllipseIntersectByPoint:()=>xV,getLineIntersect:()=>sk,getPointsCenter:()=>EV,getRectIntersectByPoint:()=>gV,intersectBBox:()=>Qct,invertMatrix:()=>bV,isPointInPolygon:()=>T_,isPointsOverlap:()=>ck,isPolygonsIntersect:()=>SV,itemIntersectByLine:()=>wV,lerp:()=>TV,move:()=>uk,pointLineDistance:()=>nJt,pointLineSquareDist:()=>AV,pointRectSquareDist:()=>MV,rotate:()=>QQt,scale:()=>$Qt,scaleMatrix:()=>qQt,squareDist:()=>XA,translate:()=>_V});var fg=z(q()),ok=gr.transform,XQt=function(e){return function(t,n){return t[e]-n[e]}},$ct=function(e,t,n){return e>=t&&e<=n},sk=function(e,t,n,i){var a=1e-4,o={x:n.x-e.x,y:n.y-e.y},s={x:t.x-e.x,y:t.y-e.y},l={x:i.x-n.x,y:i.y-n.y},u=s.x*l.y-s.y*l.x,f=u*u,c=1/u,h=s.x*s.x+s.y*s.y,d=l.x*l.x+l.y*l.y;if(f>a*h*d){var p=(o.x*l.y-o.y*l.x)*c,v=(o.x*s.y-o.y*s.x)*c;return!$ct(p,0,1)||!$ct(v,0,1)?null:{x:e.x+p*s.x,y:e.y+p*s.y}}return null},gV=function(e,t){var n=e.x,i=e.y,a=e.width,o=e.height,s=n+a/2,l=i+o/2,u=[],f={x:s,y:l};u.push({x:n,y:i}),u.push({x:n+a,y:i}),u.push({x:n+a,y:i+o}),u.push({x:n,y:i+o}),u.push({x:n,y:i});for(var c=null,h=1;ht[i][o]+t[o][a]&&(t[i][a]=t[i][o]+t[o][a]);return t},ZQt=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,f=o[l],c=o[u];a[f][c]=1,t||(a[c][f]=1)}),a},_V=function(e,t){e.translate(t.x,t.y)},uk=function(e,t,n,i){i===void 0&&(i={duration:500});var a=e.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=e.getCanvasBBox(),s=t.x-o.minX,l=t.y-o.minY;if(n){var u=s*a[0],f=l*a[4],c=0,h=0,d=0,p=0;e.animate(function(m){return d=u*m,p=f*m,a=ok(a,[["t",d-c,p-h]]),c=d,h=p,{matrix:a}},i)}else{var v=ok(a,[["t",s,l]]);e.setMatrix(v)}},$Qt=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=t;(0,fg.isArray)(t)||(i=[t,t]),(0,fg.isArray)(t)&&t.length===1&&(i=[t[0],t[0]]),n=ok(n,[["s",i[0],i[1]]]),e.setMatrix(n)},QQt=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=ok(n,[["r",t]]),e.setMatrix(n)},JQt=function(e,t,n){for(var i=[],a=0;a0!=s(f[1]-n)>0&&s(t-(n-u[1])*(u[0]-f[0])/(u[1]-f[1])-u[0])<0&&(i=!i)}return i},Qct=function(e,t){return!(t.minX>e.maxX||t.maxXe.maxY||t.maxY1){var x=h[0],b=h[p-1];d.push({from:{x:b[0],y:b[1]},to:{x:x[0],y:x[1]}})}return d};if(e.length<2||t.length<2)return!1;var a=n(e),o=n(t);if(!Qct(a,o))return!1;var s=!1;if((0,fg.each)(t,function(c){if(T_(e,c[0],c[1]))return s=!0,!1}),s||((0,fg.each)(e,function(c){if(T_(t,c[0],c[1]))return s=!0,!1}),s))return!0;var l=i(e),u=i(t),f=!1;return(0,fg.each)(u,function(c){if(eJt(l,c))return f=!0,!1}),f},cg=function(){function r(e,t,n,i){this.x1=e,this.y1=t,this.x2=n,this.y2=i}return r.prototype.getBBox=function(){var e=Math.min(this.x1,this.x2),t=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:e,y:t,minX:e,minY:t,maxX:n,maxY:i,width:n-e,height:i-t};return a},r}();var CV=function(e,t){var n={top:[e.minX,e.minY,e.maxX,e.minY],left:[e.minX,e.minY,e.minX,e.maxY],bottom:[e.minX,e.maxY,e.maxX,e.maxY],right:[e.maxX,e.minY,e.maxX,e.maxY]};return n[t]},rJt=function(e,t){var n=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),i=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1),a=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},wV=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var l=CV(i,n[s]),u=l[0],f=l[1],c=l[2],h=l[3];o[s]=sk({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:u,y:f},{x:c,y:h}),o[s]&&(a+=1)}return[o,a]},fk=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var l=CV(i,n[s]),u=l[0],f=l[1],c=l[2],h=l[3],d=rJt(t,new cg(u,f,c,h));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d0){for(var i=0,a=e;it.x+t.width,a=e.y>t.y+t.height,o=e.yKA,getBBox:()=>I_,getComboBBox:()=>qA,getLabelPosition:()=>kV,getLetterWidth:()=>oht,getLoopCfgs:()=>PV,getTextSize:()=>RV,plainCombosToTrees:()=>pk,reconstructTree:()=>vk,shouldRefreshEdge:()=>uJt,traverseTree:()=>Ps,traverseTreeUp:()=>Hh});var hg="rgb(95, 149, 255)",iJt="rgb(255, 255, 255)",Jct="rgb(0, 0, 0)",LV="rgb(247, 250, 255)",tht="rgb(239, 244, 255)",hk="rgb(253, 253, 253)",eht="rgb(250, 250, 250)",dk="rgb(224, 224, 224)",rht="rgb(234, 234, 234)",aJt="rgb(245, 245, 245)",oJt="rgb(191, 213, 255)",nht="#4572d9",sJt="rgb(223, 234, 255)",Un={mainStroke:hg,mainFill:tht,activeStroke:hg,activeFill:LV,inactiveStroke:oJt,inactiveFill:LV,selectedStroke:hg,selectedFill:iJt,highlightStroke:nht,highlightFill:sJt,disableStroke:dk,disableFill:eht,edgeMainStroke:dk,edgeActiveStroke:hg,edgeInactiveStroke:rht,edgeSelectedStroke:hg,edgeHighlightStroke:hg,edgeDisableStroke:aJt,comboMainStroke:dk,comboMainFill:hk,comboActiveStroke:hg,comboActiveFill:LV,comboInactiveStroke:dk,comboInactiveFill:hk,comboSelectedStroke:hg,comboSelectedFill:hk,comboHighlightStroke:nht,comboHighlightFill:hk,comboDisableStroke:rht,comboDisableFill:eht},qe={version:"0.5.3",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:Un.mainStroke,fill:tht},size:20,color:Un.mainStroke,linkPoints:{size:8,lineWidth:1,fill:Un.activeFill,stroke:Un.activeStroke}},nodeStateStyles:{active:{fill:Un.activeFill,stroke:Un.activeStroke,lineWidth:2,shadowColor:Un.mainStroke,shadowBlur:10},selected:{fill:Un.selectedFill,stroke:Un.selectedStroke,lineWidth:4,shadowColor:Un.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:Un.highlightFill,stroke:Un.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:Un.inactiveFill,stroke:Un.inactiveStroke,lineWidth:1},disable:{fill:Un.disableFill,stroke:Un.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Jct,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:Un.edgeMainStroke,lineAppendWidth:2},color:Un.edgeMainStroke},edgeStateStyles:{active:{stroke:Un.edgeActiveStroke,lineWidth:1},selected:{stroke:Un.edgeSelectedStroke,lineWidth:2,shadowColor:Un.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Un.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:Un.edgeInactiveStroke,lineWidth:1},disable:{stroke:Un.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Jct,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Un.comboMainFill,lineWidth:1,stroke:Un.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:Un.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:Un.comboActiveStroke,lineWidth:1,fill:Un.comboActiveFill},selected:{stroke:Un.comboSelectedStroke,lineWidth:2,fill:Un.comboSelectedFill,shadowColor:Un.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Un.comboHighlightStroke,lineWidth:2,fill:Un.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:Un.comboInactiveStroke,fill:Un.comboInactiveFill,lineWidth:1},disable:{stroke:Un.comboDisableStroke,fill:Un.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window!="undefined"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"};var iht={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,"0":.6,"1":.40099945068359377,"2":.6,"3":.6,"4":.6,"5":.6,"6":.6,"7":.5469985961914062,"8":.6,"9":.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};var Eo=z(q()),Vh=Math.PI,OV=Math.sin,DV=Math.cos,Xo=OV(Vh/8),qo=DV(Vh/8),I_=function(e,t){var n=e.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(t){var o=t.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=A_(i,o),a=A_(a,o)}var s=i.x,l=i.y,u=a.x,f=a.y;return{x:s,y:l,minX:s,minY:l,maxX:u,maxY:f,width:u-s,height:f-l}},PV=function(e){var t=e.sourceNode||e.targetNode,n=t.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=t.getKeyShape(),o=a.getBBox(),s=e.loopCfg||{},l=s.dist||Math.max(o.width,o.height)*2,u=s.position||qe.defaultLoopPosition,f=[i[6],i[7]],c=[e.startPoint.x,e.startPoint.y],h=[e.endPoint.x,e.endPoint.y],d=o.height/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo;if(c[0]===h[0]&&c[1]===h[1]){switch(u){case"top":c=[f[0]-v,f[1]-m],h=[f[0]+g,f[1]-x];break;case"top-right":d=o.height/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+v,f[1]-m],h=[f[0]+x,f[1]-g];break;case"right":d=o.width/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+m,f[1]-v],h=[f[0]+x,f[1]+g];break;case"bottom-right":d=o.width/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+m,f[1]+v],h=[f[0]+g,f[1]+x];break;case"bottom":d=o.height/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+v,f[1]+m],h=[f[0]-g,f[1]+x];break;case"bottom-left":d=o.height/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-v,f[1]+m],h=[f[0]-x,f[1]+g];break;case"left":d=o.width/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-m,f[1]+v],h=[f[0]-x,f[1]-g];break;case"top-left":d=o.width/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-m,f[1]-v],h=[f[0]-g,f[1]-x];break;default:d=o.width/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-v,f[1]-m],h=[f[0]+g,f[1]-x]}if(s.clockwise===!1){var b=[c[0],c[1]];c=[h[0],h[1]],h=[b[0],b[1]]}}var S=[c[0]-f[0],c[1]-f[1]],C=(d+l)/d,w=(p+l)/p;s.clockwise===!1&&(C=(p+l)/p,w=(d+l)/d);var A=oe.scale([0,0],S,C),L=[f[0]+A[0],f[1]+A[1]],k=[h[0]-f[0],h[1]-f[1]],O=oe.scale([0,0],k,w),M=[f[0]+O[0],f[1]+O[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:h[0],y:h[1]},e.controlPoints=[{x:L[0],y:L[1]},{x:M[0],y:M[1]}],e},kV=function(e,t,n,i,a){var o=1e-4,s=[],l=e==null?void 0:e.getPoint(t);if(!l)return{x:0,y:0,angle:0};if(t1-o)s=e.getEndTangent();else{var u=e==null?void 0:e.getPoint(t+o);s.push([l.x,l.y]),s.push([u.x,u.y])}var f=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(f<0&&(f+=Vh*2),n&&(l.x+=DV(f)*n,l.y+=OV(f)*n),i){var c=f-Vh/2;f>1/2*Vh&&f<3*1/2*Vh&&(c-=Vh),l.x+=DV(c)*i,l.y+=OV(c)*i}var h={x:l.x,y:l.y,angle:f};return a?(f>.5*Vh&&f<1.5*Vh&&(f-=Vh),E({rotate:f},h)):h},aht=function r(e,t){if(t(e)===!1)return!1;if(e&&e.children){for(var n=e.children.length-1;n>=0;n--)if(!r(e.children[n],t))return!1}return!0},lJt=function r(e,t){if(e&&e.children){for(var n=e.children.length-1;n>=0;n--)if(!r(e.children[n],t))return}return t(e)!==!1},Ps=function(e,t){typeof t=="function"&&aht(e,t)},Hh=function(e,t){typeof t=="function"&&lJt(e,t)},oht=function(e,t){return t*(iht[e]||1)},RV=function(e,t){var n=0,i=new RegExp("[\u4E00-\u9FA5]+");return e.split("").forEach(function(a){i.test(a)?n+=t:n+=oht(a,t)}),[n,t]},pk=function(e,t){var n=[],i={},a={};e.forEach(function(l){a[l.id]=l}),e.forEach(function(l,u){var f=(0,Eo.clone)(l);f.itemType="combo",f.children=void 0,f.parentId===f.id?(console.warn("The parentId for combo ".concat(f.id," can not be the same as the combo's id")),delete f.parentId):f.parentId&&!a[f.parentId]&&(console.warn("The parent combo for combo ".concat(f.id," does not exist!")),delete f.parentId);var c=i[f.id];if(c){if(f.children=c.children,i[f.id]=f,c=f,!c.parentId){n.push(c);return}var h=i[c.parentId];if(h)h.children?h.children.push(f):h.children=[f];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[f.id]=f}return}if((0,Eo.isString)(l.parentId)){var p=i[l.parentId];if(p)p.children?p.children.push(f):p.children=[f],i[f.id]=f;else{var v={id:l.parentId,children:[f]};i[v.id]=v,i[f.id]=f}}else n.push(f),i[f.id]=f});var o={};(t||[]).forEach(function(l){o[l.id]=l;var u=i[l.comboId];if(u){var f={id:l.id,comboId:l.comboId};u.children?u.children.push(f):u.children=[f],f.itemType="node",i[l.id]=f}});var s=0;return n.forEach(function(l){l.depth=s+10,aht(l,function(u){var f,c=i[u.id].itemType;c==="node"?f=i[u.comboId]:f=i[u.parentId],f&&c==="node"?u.depth=s+1:u.depth=s+10,s-1&&i.splice(u,1),s||(a={id:t,itemType:"node",comboId:n},o[t]={children:void 0}),t){var f=!1;if(n){var c=0;(e||[]).forEach(function(d){f||Ps(d,function(p){return n===p.id?(f=!0,p.children?p.children.push(a):p.children=[a],c=p.depth,a.itemType==="node"?a.depth=c+2:a.depth=c+1,!1):!0})})}else(!n||!f)&&a.itemType!=="node"&&e.push(a);var h=a.depth;Ps(a,function(d){return d.itemType==="node"?h+=2:h+=1,d.depth=h,!0})}return e},qA=function(e,t,n){var i={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(!e||e.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,l=o.y;return{minX:s,minY:l,maxX:s,maxY:l,x:s,y:l,width:void 0,height:void 0}}return e.forEach(function(u){var f=t.findById(u.id);if(!(!f||!f.isVisible())){f.set("bboxCanvasCache",void 0);var c=f.getCanvasBBox();c.x&&i.minX>c.minX&&(i.minX=c.minX),c.y&&i.minY>c.minY&&(i.minY=c.minY),c.x&&i.maxXGV,cloneEvent:()=>cJt,formatPadding:()=>ZA,isNaN:()=>$A,isViewportChanged:()=>hJt,processParallelEdges:()=>dJt,uniqueId:()=>gk});var L_=z(q());var lht=function(r){V(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.item=n.item,i.canvasX=n.canvasX,i.canvasY=n.canvasY,i.wheelDelta=n.wheelDelta,i.detail=n.detail,i}return e}(Yu);var gk=function(e){return"".concat(e,"-").concat(Math.random()).concat(Date.now())},ZA=function(e){if((0,L_.isArray)(e))switch(e.length){case 4:return e;case 3:return e.push(e[1]),e;case 2:return e.concat(e);case 1:return[e[0],e[0],e[0],e[0]];default:return[0,0,0,0]}if((0,L_.isNumber)(e))return[e,e,e,e];if((0,L_.isString)(e)){var t=parseInt(e,10);return[t,t,t,t]}return[0,0,0,0]},cJt=function(e){var t=new lht(e.type,e);return t.clientX=e.clientX,t.clientY=e.clientY,t.x=e.x,t.y=e.y,t.target=e.target,t.currentTarget=e.currentTarget,t.bubbles=!0,t.item=e.item,t},hJt=function(e){if(!e)return!1;for(var t=9,n=[1,0,0,0,1,0,0,0,1],i=0;in&&(n=c),h>a&&(a=h)}var d=Math.floor(t),p=Math.floor(i),v=Math.ceil(n)-Math.floor(t),m=Math.ceil(a)-Math.floor(i);return{x:d,y:p,width:v,height:m,minX:t,minY:i,maxX:n,maxY:a}},dJt=function(e,t,n,i,a){t===void 0&&(t=15),n===void 0&&(n="quadratic"),i===void 0&&(i=void 0),a===void 0&&(a=void 0);for(var o=e.length,s=t*2,l=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},f=[],c={},h=0;hf&&(c=f),e.zoom(c,s)||console.warn("zoom failed, ratio out of range, ratio: %f",c)}},r.prototype.fitViewByRules=function(e){var t=e.onlyOutOfViewPort,n=t===void 0?!1:t,i=e.direction,a=i===void 0?"both":i,o=e.ratioRule,s=o===void 0?"min":o,l=this.graph,u=this.getFormatPadding(),f=l.get("width"),c=l.get("height"),h=l.get("group");h.resetMatrix();var d=h.getCanvasBBox();if(!(d.width===0||d.height===0)){var p=this.getViewCenter(),v={x:d.x+d.width/2,y:d.y+d.height/2};l.translate(p.x-v.x,p.y-v.y);var m=(f-u[1]-u[3])/d.width,g=(c-u[0]-u[2])/d.height,x;a==="x"?x=m:a==="y"?x=g:x=s==="max"?Math.max(m,g):Math.min(m,g),n&&(x=x<1?x:1);var b=l.getZoom(),S=b*x,C=l.get("minZoom");S=0&&(a.height=o),s>=0&&(a.width=s),i.marginTop&&(a.y+=i.marginTop),i.marginLeft&&(a.x+=i.marginLeft),a}function hht(r,e){var t;e===void 0&&(e={x:0,y:0});var n=E({x:0,y:0,width:0,height:0},e);if((t=r.children)===null||t===void 0?void 0:t.length){var i=r.attrs,a=i===void 0?{}:i,o=a.marginTop,s=E({},e);o&&(s.y+=o);for(var l=0;ln.width&&(n.width=f.width+f.x),f.height+f.y>n.height&&(n.height=f.height+f.y)}}}return r.bbox=gJt(r,e,n),r.attrs=E(E({},r.attrs),r.bbox),r}function dht(r,e){var t,n,i,a,o=(r||{}).type,s=((e==null?void 0:e.attrs)||{}).key;if(s&&r&&(r.attrs.key=s),!r&&e)return{action:"delete",val:e,type:o,key:s};if(r&&!e)return{action:"add",val:r,type:o};if(!r&&!e)return{action:"same",type:o};var l=[];if(((t=r.children)===null||t===void 0?void 0:t.length)>0||((n=e.children)===null||n===void 0?void 0:n.length)>0)for(var u=Math.max((i=r.children)===null||i===void 0?void 0:i.length,(a=e.children)===null||a===void 0?void 0:a.length),f=e.children||[],c=r.children||[],h=0;h-1)return;n.push(a)}else l>-1&&n.splice(l,1)}else if((0,ja.isString)(t)){var u=n.filter(function(h){return h.includes(o)});u.length>0&&this.clearStates(u),s=s.filter(function(h){return!h.includes(o)}),s.push(a),this.set("states",s)}if(i){var f=this.get("model"),c=f.type;i.setState(c,e,t,this)}},r.prototype.clearStates=function(e){var t=this,n=t.getStates(),i=t.get("shapeFactory"),a=t.get("model"),o=a.type;e||(e=n),(0,ja.isString)(e)&&(e=[e]);var s=n.filter(function(l){return e.indexOf(l)===-1});t.set("states",s),e.forEach(function(l){i.setState(o,l,!1,t)})},r.prototype.getContainer=function(){return this.get("group")},r.prototype.getKeyShape=function(){return this.get("keyShape")},r.prototype.getModel=function(){return this.get("model")},r.prototype.getType=function(){return this.get("type")},r.prototype.getID=function(){return this.get("id")},r.prototype.isItem=function(){return!0},r.prototype.getStates=function(){return this.get("states")},r.prototype.hasState=function(e){var t=this.getStates();return t.indexOf(e)>=0},r.prototype.refresh=function(e){var t=this.get("model");this.updatePosition(t),this.updateShape(e),this.afterUpdate(),this.clearCache()},r.prototype.getUpdateType=function(e){},r.prototype.update=function(e,t){t===void 0&&(t=void 0);var n=this.get("model");if(t==="move")this.updatePosition(e);else{var i=n.visible,a=e.visible;i!==a&&a!==void 0&&this.changeVisibility(a);var o={x:n.x,y:n.y};e.x=isNaN(+e.x)?n.x:+e.x,e.y=isNaN(+e.y)?n.y:+e.y;var s=this.get("styles");if(e.stateStyles){var l=e.stateStyles;(0,ja.mix)(s,l),delete e.stateStyles}Object.assign(n,e),(o.x!==e.x||o.y!==e.y)&&this.updatePosition(e),this.updateShape(t)}this.afterUpdate(),this.clearCache()},r.prototype.updateShape=function(e){var t=this.get("shapeFactory"),n=this.get("model"),i=n.type;if(t.shouldUpdate(i)&&i===this.get("currentShape")){var a=this.getShapeCfg(n,e);t.baseUpdate(i,a,this,e),e!=="move"&&this.setOriginStyle()}else this.draw();this.restoreStates(t,i)},r.prototype.updatePosition=function(e){var t=this.get("model"),n=isNaN(+e.x)?+t.x:+e.x,i=isNaN(+e.y)?+t.y:+e.y,a=this.get("group");if(isNaN(n)||isNaN(i))return!1;t.x=n,t.y=i;var o=a.getMatrix();return o&&o[6]===n&&o[7]===i?!1:(a.resetMatrix(),_V(a,{x:n,y:i}),this.clearCache(),!0)},r.prototype.getBBox=function(){var e=this.get(YV);return e||(e=this.calculateBBox(),this.set(YV,e)),e},r.prototype.getCanvasBBox=function(){var e=this.get(XV);return e||(e=this.calculateCanvasBBox(),this.set(XV,e)),e},r.prototype.toFront=function(){var e=this.get("group");e.toFront()},r.prototype.toBack=function(){var e=this.get("group");e.toBack()},r.prototype.show=function(){this.changeVisibility(!0)},r.prototype.hide=function(){this.changeVisibility(!1)},r.prototype.changeVisibility=function(e){var t=this.get("group");e?t.show():t.hide(),this.set("visible",e)},r.prototype.isVisible=function(){return this.get("visible")},r.prototype.enableCapture=function(e){var t=this.get("group");t&&t.set("capture",e)},r.prototype.destroy=function(){if(!this.destroyed){var e=this.get("animate"),t=this.get("group");e&&t.stopAnimate(),t.shapeMap={},this.clearCache(),t.remove(),this._cfg=null,this.destroyed=!0}},r}(),xk=xJt;var bk={source:"start",target:"end"},Yh="Node",O_="Point",bJt="Anchor",_Jt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,n){var i=bk[t]+O_,a=t+Yh,o=this.get(a);o&&!o.destroyed&&o.removeEdge(this),(0,df.isPlainObject)(n)?(this.set(i,n),this.set(a,null)):n&&(n.addEdge(this),this.set(a,n),this.set(i,null))},e.prototype.getLinkPoint=function(t,n,i){var a=bk[t]+O_,o=t+Yh,s=this.get(a);if(!s){var l=this.get(o),u=t+bJt,f=this.getPrePoint(t,i),c=n[u];(0,df.isNil)(c)||(s=l.getLinkPointByAnchor(c)),s=s||l.getLinkPoint(f),(0,df.isNil)(s.index)||this.set("".concat(t,"AnchorIndex"),s.index)}return s},e.prototype.getPrePoint=function(t,n){if(n&&n.length){var i=t==="source"?0:n.length-1;return n[i]}var a=t==="source"?"target":"source";return this.getEndPoint(a)},e.prototype.getEndPoint=function(t){var n=t+Yh,i=bk[t]+O_,a=this.get(n);return a?a.get("model"):this.get(i)},e.prototype.getControlPointsByCenter=function(t){var n=this.getEndPoint("source"),i=this.getEndPoint("target"),a=this.get("shapeFactory"),o=t.type;return a.getControlPoints(o,{startPoint:n,endPoint:i})},e.prototype.getEndCenter=function(t){var n=t+Yh,i=bk[t]+O_,a=this.get(n);if(a){var o=a.getBBox();return{x:o.centerX,y:o.centerY}}return this.get(i)},e.prototype.init=function(){r.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(t,n){var i=this,a=i.get("linkCenter"),o=(n==null?void 0:n.includes("move"))?t:r.prototype.getShapeCfg.call(this,t);if(a)o.startPoint=i.getEndCenter("source"),o.endPoint=i.getEndCenter("target");else{var s=o.controlPoints||i.getControlPointsByCenter(o);o.startPoint=i.getLinkPoint("source",t,s),o.endPoint=i.getLinkPoint("target",t,s)}return o.sourceNode=i.get("sourceNode"),o.targetNode=i.get("targetNode"),o},e.prototype.getModel=function(){var t=this.get("model"),n=this.get("source".concat(Yh)),i=this.get("target".concat(Yh));return n?delete t["source".concat(Yh)]:t.source=this.get("start".concat(O_)),i?delete t["target".concat(Yh)]:t.target=this.get("end".concat(O_)),!(0,df.isString)(t.source)&&!(0,df.isPlainObject)(t.source)&&(t.source=t.source.getID()),!(0,df.isString)(t.target)&&!(0,df.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,n){n===void 0&&(n=void 0);var i=this.get("model"),a=i.visible,o=t.visible;a!==o&&o!==void 0&&this.changeVisibility(o);var s=this.get("styles");if(t.stateStyles){var l=t.stateStyles;(0,df.mix)(s,l),delete t.stateStyles}Object.assign(i,t),this.updateShape(n),this.afterUpdate(),this.clearCache()},e.prototype.destroy=function(){var t=this.get("source".concat(Yh)),n=this.get("target".concat(Yh));t&&!t.destroyed&&t.removeEdge(this),n&&!n.destroyed&&n.removeEdge(this),r.prototype.destroy.call(this)},e}(xk),D_=_Jt;var dg=z(q());var qV="anchorPointsCache",SJt="bboxCache",CJt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getNearestPoint=function(t,n){for(var i=0,a=t[0],o=M_(t[0],n),s=0;s-1&&n.splice(i,1)},e.prototype.clearCache=function(){this.set(SJt,null),this.set(qV,null)},e.prototype.getUpdateType=function(t){var n,i,a,o,s;if(!!t){var l=!(0,dg.isNil)(t.x),u=!(0,dg.isNil)(t.y),f=Object.keys(t);if(f.length===1&&(l||u)||f.length===2&&l&&u)return"move";if((0,dg.isNumber)(t.x)||(0,dg.isNumber)(t.y)||t.type||t.anchorPoints||t.size||(t==null?void 0:t.style)&&(((n=t==null?void 0:t.style)===null||n===void 0?void 0:n.r)||((i=t==null?void 0:t.style)===null||i===void 0?void 0:i.width)||((a=t==null?void 0:t.style)===null||a===void 0?void 0:a.height)||((o=t==null?void 0:t.style)===null||o===void 0?void 0:o.rx)||((s=t==null?void 0:t.style)===null||s===void 0?void 0:s.ry)))return"bbox|label";var c=f.includes("label")||f.includes("labelCfg");return c?"style|label":"style"}},e}(xk),pg=CJt;var mht=z(q()),ght="bboxCache",yht="bboxCanvasCache",KV="sizeCache",xht="anchorPointsCache",wJt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},e.prototype.getShapeCfg=function(t){var n=this.get("styles"),i=this.get("bbox");if(n&&i){var a=t,o={r:Math.hypot(i.height,i.width)/2||qe.defaultCombo.size[0]/2,width:i.width||qe.defaultCombo.size[0],height:i.height||qe.defaultCombo.size[1]};a.style=E(E(E({},n),t.style),o);var s=t.padding||qe.defaultCombo.padding;return(0,mht.isNumber)(s)?(o.r+=s,o.width+=s*2,o.height+=s*2):(o.r+=s[0],o.width+=s[1]+s[3]||s[1]*2,o.height+=s[0]+s[2]||s[0]*2),this.set(KV,o),a}return t},e.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var t=this.get("keyShape"),n=this.get("group"),i=I_(t,n);i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2;var a=this.get(KV),o=this.get(ght)||{},s=o.x,l=o.x;if(a){a.width=Math.max(a.width,i.width),a.height=Math.max(a.height,i.height);var u=t.get("type");u==="circle"?(i.width=a.r*2,i.height=a.r*2):(i.width=a.width,i.height=a.height),i.minX=i.centerX-i.width/2,i.minY=i.centerY-i.height/2,i.maxX=i.centerX+i.width/2,i.maxY=i.centerY+i.height/2}else i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2;return i.x=i.minX,i.y=i.minY,(i.x!==s||i.y!==l)&&this.set(xht,null),i}},e.prototype.getChildren=function(){var t=this;return{nodes:t.getNodes(),combos:t.getCombos()}},e.prototype.getNodes=function(){var t=this;return t.get("nodes")},e.prototype.getCombos=function(){var t=this;return t.get("combos")},e.prototype.addChild=function(t){var n=this,i=t.getType();switch(i){case"node":n.addNode(t);break;case"combo":n.addCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.addCombo=function(t){var n=this;return n.get("combos").push(t),!0},e.prototype.addNode=function(t){var n=this;return n.get("nodes").push(t),!0},e.prototype.removeChild=function(t){var n=this,i=t.getType();switch(i){case"node":n.removeNode(t);break;case"combo":n.removeCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.removeCombo=function(t){if(!!t){var n=this.getCombos(),i=n.indexOf(t);return i>-1?(n.splice(i,1),!0):!1}},e.prototype.removeNode=function(t){if(!!t){var n=this.getNodes(),i=n.indexOf(t);return i>-1?(n.splice(i,1),!0):!1}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){this.set(yht,null);var t=this.calculateCanvasBBox();return t},e.prototype.clearCache=function(){this.set(ght,null),this.set(yht,null),this.set(xht,null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),n=this.get("group");t&&n.stopAnimate(),n.shapeMap={},this.clearCache(),this.set(KV,null),this.set("bbox",null),n.remove(),this._cfg=null,this.destroyed=!0}},e}(pg),_k=wJt;var JA="node",Sk="edge",bht="vedge",tM="combo",EJt="default",_ht="Mapper",Bp="stateStyles",AJt=function(){function r(e){var t=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,an.throttle)(function(n){var i,a=t.graph;if(!(!a||a.get("destroyed"))){var o=t.edgeToBeUpdateMap;!o||!((i=Object.keys(o))===null||i===void 0?void 0:i.length)||(Object.keys(o).forEach(function(s){var l=o[s].edge;!l||l.destroyed||l.refresh(o[s].updateType)}),t.edgeToBeUpdateMap={})}},16,{trailing:!0,leading:!0}),this.graph=e,this.destroyed=!1}return r.prototype.addItem=function(e,t){var n=this.graph,i=e===bht?Sk:e,a=n.get("".concat(i,"Group"))||n.get("group"),o=(0,an.upperFirst)(i),s=null,l=n.get(i+(0,an.upperFirst)(Bp))||{},u=n.get(EJt+o);t[Bp]&&(l=t[Bp]),u&&(0,an.each)(u,function(x,b){(0,an.isObject)(x)&&!(0,an.isArray)(x)?t[b]=(0,an.deepMix)({},x,t[b]):(0,an.isArray)(x)?t[b]=t[b]||(0,an.clone)(u[b]):t[b]=t[b]||u[b]});var f=n.get(i+_ht);if(f){var c=f(t);c[Bp]&&(l=c[Bp],delete c[Bp]),(0,an.each)(c,function(x,b){(0,an.isObject)(x)&&!(0,an.isArray)(x)?t[b]=(0,an.deepMix)({},t[b],x):t[b]=c[b]||t[b]})}if(n.emit("beforeadditem",{type:e,model:t}),e===Sk||e===bht){var h=void 0,d=void 0;if(h=t.source,d=t.target,h&&(0,an.isString)(h)&&(h=n.findById(h)),d&&(0,an.isString)(d)&&(d=n.findById(d)),!h||!d){console.warn("The source or target node of edge ".concat(t.id," does not exist!"));return}h.getType&&h.getType()==="combo"&&(t.isComboEdge=!0),d.getType&&d.getType()==="combo"&&(t.isComboEdge=!0),s=new D_({model:t,source:h,target:d,styles:l,linkCenter:n.get("linkCenter"),group:a.addGroup()})}else if(e===JA)s=new pg({model:t,styles:l,group:a.addGroup()});else if(e===tM){var p=t.children,v=qA(p,n);isNaN(v.x)?isNaN(t.x)&&(t.x=Math.random()*100):t.x=v.x,isNaN(v.y)?isNaN(t.y)&&(t.y=Math.random()*100):t.y=v.y;var m=a.addGroup();m.setZIndex(t.depth),s=new _k({model:t,styles:l,bbox:t.collapsed?qA([],n):v,group:m});var g=s.getModel();(p||[]).forEach(function(x){var b=n.findById(x.id);s.addChild(b),x.depth=g.depth+2}),t.collapsed&&setTimeout(function(){s.destroyed||n.collapseCombo(s)},0)}if(s)return n.get("".concat(e,"s")).push(s),n.get("itemMap")[s.get("id")]=s,n.emit("afteradditem",{item:s,model:t}),s},r.prototype.updateItem=function(e,t){var n=this,i,a,o=this.graph;if((0,an.isString)(e)&&(e=o.findById(e)),!(!e||e.destroyed)){var s="";e.getType&&(s=e.getType());var l=o.get(s+_ht),u=e.getModel(),f=e.getUpdateType(t);if(l){var c=(0,an.deepMix)({},u,t),h=l(c),d=(0,an.deepMix)({},u,h,t);h[Bp]&&(e.set("styles",d[Bp]),delete d[Bp]),(0,an.each)(d,function(C,w){t[w]=C})}else(0,an.each)(t,function(C,w){u[w]&&(0,an.isObject)(C)&&!(0,an.isArray)(C)&&(t[w]=E(E({},u[w]),t[w]))});if(o.emit("beforeupdateitem",{item:e,cfg:t}),s===Sk){if(t.source){var p=t.source;(0,an.isString)(p)&&(p=o.findById(p)),e.setSource(p)}if(t.target){var v=t.target;(0,an.isString)(v)&&(v=o.findById(v)),e.setTarget(v)}e.update(t)}if(s===JA||s===tM){e.update(t,f);var m=e.getEdges(),g=(f==null?void 0:f.includes("bbox"))||f==="move";if(s===JA)f==="move"?(0,an.each)(m,function(C){n.edgeToBeUpdateMap[C.getID()]={edge:C,updateType:f},n.throttleRefresh()}):g&&(0,an.each)(m,function(C){C.refresh(f)});else if(g&&s===tM){var x=e.get("shapeFactory"),b=u.type||"circle",S=u.animate===void 0||t.animate===void 0?(a=(i=x[b])===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.animate:u.animate||t.animate;S?setTimeout(function(){if(!(!e||e.destroyed)){var C=e.getKeyShape();!C||C.destroyed||(0,an.each)(m,function(w){w&&!w.destroyed&&w.refresh()})}},201):(0,an.each)(m,function(C){C.refresh()})}}o.emit("afterupdateitem",{item:e,cfg:t})}},r.prototype.updateCombo=function(e,t){var n=this,i,a,o=this.graph;if((0,an.isString)(e)&&(e=o.findById(e)),!(!e||e.destroyed)){var s=e.getModel(),l=qA(t,o,e),u=l.x,f=l.y;e.set("bbox",l),e.update({x:u||s.x,y:f||s.y});var c=e.get("shapeFactory"),h=s.type||"circle",d=s.animate===void 0?(a=(i=c[h])===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.animate:s.animate;d?setTimeout(function(){if(!(!e||e.destroyed)){var p=e.getKeyShape();!p||p.destroyed||(e.getShapeCfg(s),n.updateComboEdges(e))}},201):this.updateComboEdges(e)}},r.prototype.updateComboEdges=function(e){for(var t=e.getEdges()||[],n=0;n-1&&o.splice(s,1),a===Sk){var l=n.get("v".concat(a,"s")),u=l.indexOf(e);u>-1&&l.splice(u,1)}var f=e.get("id"),c=n.get("itemMap");delete c[f];var h=n.get("comboTrees"),d=e.get("id");if(a===JA){var p=e.getModel().comboId;if(h&&p){var v=h,m=!1;h.forEach(function(w){m||Ps(w,function(A){if(A.id===d&&v){var L=v.indexOf(A);return v.splice(L,1),m=!0,!1}return v=A.children,!0})})}for(var g=e.getEdges(),x=g.length-1;x>=0;x--)n.removeItem(g[x],!1);p&&n.updateCombo(p)}else if(a===tM){var b=e.getModel().parentId,S,C=!1;(h||[]).forEach(function(A){C||Ps(A,function(L){return L.id===d?(S=L,C=!0,!1):!0})}),S.removed=!0,S&&S.children&&S.children.forEach(function(A){t.removeItem(A.id)});for(var g=e.getEdges(),x=g.length;x>=0;x--)n.removeItem(g[x],!1);b&&n.updateCombo(b)}e.destroy(),n.emit("afterremoveitem",{item:i,type:a})}},r.prototype.setItemState=function(e,t,n){var i=this.graph,a=t;(0,an.isString)(n)&&(a="".concat(t,":").concat(n)),!(e.hasState(a)===n&&n||(0,an.isString)(n)&&e.hasState(a))&&(i.emit("beforeitemstatechange",{item:e,state:a,enabled:n}),e.setState(t,n),i.autoPaint(),i.emit("afteritemstatechange",{item:e,state:a,enabled:n}))},r.prototype.priorityState=function(e,t){var n=this.graph,i=e;(0,an.isString)(e)&&(i=n.findById(e)),this.setItemState(i,t,!1),this.setItemState(i,t,!0)},r.prototype.clearItemStates=function(e,t){var n=this.graph;(0,an.isString)(e)&&(e=n.findById(e)),n.emit("beforeitemstatesclear",{item:e,states:t}),e.clearStates(t),n.emit("afteritemstatesclear",{item:e,states:t})},r.prototype.refreshItem=function(e){var t=this.graph;(0,an.isString)(e)&&(e=t.findById(e)),t.emit("beforeitemrefresh",{item:e}),e.refresh(),t.emit("afteritemrefresh",{item:e})},r.prototype.addCombos=function(e,t){var n=this,i=this.graph;(e||[]).forEach(function(o){Hh(o,function(s){var l;return t.forEach(function(u){u.id===s.id&&(u.children=s.children,u.depth=s.depth,l=u)}),l&&n.addItem("combo",l),!0})});var a=i.get("comboGroup");a&&a.sort()},r.prototype.changeItemVisibility=function(e,t){var n=this,i=this.graph;if((0,an.isString)(e)&&(e=i.findById(e)),!e){console.warn("The item to be shown or hidden does not exist!");return}if(i.emit("beforeitemvisibilitychange",{item:e,visible:t}),e.changeVisibility(t),e.getType&&e.getType()===JA){var a=e.getEdges();(0,an.each)(a,function(f){t&&!(f.get("source").isVisible()&&f.get("target").isVisible())||n.changeItemVisibility(f,t)})}else if(e.getType&&e.getType()===tM){var o=i.get("comboTrees"),s=e.get("id"),l=[],u=!1;(o||[]).forEach(function(c){u||!c.children||c.children.length===0||Ps(c,function(h){return h.id===s?(l=h.children,u=!0,!1):!0})}),l&&(!t||t&&!e.getModel().collapsed)&&l.forEach(function(c){var h=i.findById(c.id);n.changeItemVisibility(h,t)});var a=e.getEdges();(0,an.each)(a,function(c){t&&!(c.get("source").isVisible()&&c.get("target").isVisible())||n.changeItemVisibility(c,t)})}return i.emit("afteritemvisibilitychange",{item:e,visible:t}),e},r.prototype.destroy=function(){this.graph=null,this.destroyed=!0},r}(),ZV=AJt;var eM=z(q()),F0=null,MJt=function(){function r(e){this.graph=e,this.cachedStates={enabled:{},disabled:{}},this.destroyed=!1}return r.checkCache=function(e,t,n){if(!!n[t]){var i=n[t].indexOf(e);i>=0&&n[t].splice(i,1)}},r.cacheState=function(e,t,n){n[t]||(n[t]=[]),n[t].push(e)},r.prototype.updateState=function(e,t,n){var i=this,a=r.checkCache,o=r.cacheState;if(!e.destroyed){var s=this.cachedStates,l=s.enabled,u=s.disabled;n?(a(e,t,u),o(e,t,l)):(a(e,t,l),o(e,t,u)),F0&&clearTimeout(F0),F0=setTimeout(function(){F0=null,i.updateGraphStates()},16)}},r.prototype.updateStates=function(e,t,n){var i=this;(0,eM.isString)(t)?this.updateState(e,t,n):t.forEach(function(a){i.updateState(e,a,n)})},r.prototype.updateGraphStates=function(){var e=this.graph.get("states"),t=this.cachedStates;(0,eM.each)(t.disabled,function(n,i){e[i]&&(e[i]=e[i].filter(function(a){return n.indexOf(a)<0&&!n.destroyed}))}),(0,eM.each)(t.enabled,function(n,i){if(!e[i])e[i]=n;else{var a={};e[i].forEach(function(o){o.destroyed||(a[o.get("id")]=!0)}),n.forEach(function(o){if(!o.destroyed){var s=o.get("id");a[s]||(a[s]=!0,e[i].push(o))}})}}),this.graph.emit("graphstatechange",{states:e}),this.cachedStates={enabled:{},disabled:{}}},r.prototype.destroy=function(){this.graph=null,this.cachedStates=null,F0&&clearTimeout(F0),F0=null,this.destroyed=!0},r}(),$V=MJt;var Js=z(q());var t8={};Dn(t8,{getClosedSpline:()=>wk,getControlPoint:()=>rM,getSpline:()=>QV,paddedHull:()=>JV,pathToPoints:()=>Ck,pointsToPolygon:()=>IJt,roundedHull:()=>Ek});var TJt=function(e,t){return!e||!t?e:e.replace(/\\?\{([^{}]+)\}/g,function(n,i){if(n.charAt(0)==="\\")return n.slice(1);var a=t[i];return a===0&&(a="0"),a||""})},QV=function(e){var t=[];if(e.length<2)throw new Error("point length must largn than 2, now it's ".concat(e.length));for(var n=0,i=e;n0?o-1:t-1,l=oe.normalize([0,0],oe.add([0,0],a[s].v,oe.scale([0,0],a[o].v,-1)));a[o].p=oe.add([0,0],a[o].p,oe.scale([0,0],l,e))}return a.map(function(u){var f=u.p;return{x:f[0],y:f[1]}})}var Eht=function(e,t,n){return(e.y-n.y)*(t.x-n.x)-(e.x-n.x)*(t.y-n.y)},e8=function(e){var t=e.map(function(s){return{x:s.getModel().x,y:s.getModel().y}});if(t.sort(function(s,l){return s.x===l.x?s.y-l.y:s.x-l.x}),t.length===1)return t;for(var n=[],i=0;i=2&&Eht(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}for(var a=[],i=t.length-1;i>=0;i--){for(;a.length>=2&&Eht(a[a.length-2],a[a.length-1],t[i])<=0;)a.pop();a.push(t[i])}a.pop(),n.pop();var o=n.concat(a);return o};var LJt={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 OJt(r,e,t){var n=!1,i=function(l,u){return e.cells[l+u*e.width]},a=function(l,u){var f=0;return i(l-1,u-1)>=t&&(f+=1),i(l,u-1)>t&&(f+=2),i(l-1,u)>t&&(f+=4),i(l,u)>t&&(f+=8),f},o=function(l,u){for(var f=l,c=u,h,d,p=0;p-1){if(!(r[0].x!==f||r[0].y!==c))return!0}else r.push({x:f,y:c});var v=a(f,c);switch(v){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:f++;break;case 12:case 14:case 4:f--;break;case 6:h===0&&(d===-1?f-=1:f+=1);break;case 1:case 13:case 5:c--;break;case 9:h===1&&(d===0?c-=1:c+=1);break;case 10:case 8:case 11:c++;break;default:return console.warn("Marching squares invalid state: ".concat(v)),!0}}};this.march=function(){for(var s=0;st&&a(s,l)!==15&&(n=o(s,l));return n}}var DJt=function(e,t,n){var i=Math.ceil(e/n),a=Math.ceil(t/n),o=new Float32Array(Math.max(0,i*a)).fill(0);return{cells:o,width:i,height:a}},PJt=function(e,t,n){var i=null,a=Number.POSITIVE_INFINITY;return t.forEach(function(o){var s={x:e.getModel().x,y:e.getModel().y},l={x:o.getModel().x,y:o.getModel().y},u=XA(s,l),f=new cg(s.x,s.y,l.x,l.y),c=n.reduce(function(h,d){return fk(d,f)>0?h+1:h},0);u*Math.pow(c+1,2)=0&&o=1;)C/=1.5,w=Tht(p,C,m,S),A=u(w,o)||u(w,a),L=f(w,t);w&&!A&&(!S||!L)&&(o.push(new cg(d.x1,d.y1,w.x,w.y)),o.push(new cg(w.x,w.y,d.x2,d.y2)),s=!0)};x(!0),s||x(!1)}}s||a.push(d),l+=1};!s&&o.length;)c()}for(;o.length;)a.push(o.pop());return a};function RJt(r,e,t,n,i){var a=PJt(r,t,e);if(a===null)return[];var o=function(c){for(var h=[];c.length>0;){var d=c.pop();if(c.length===0){h.push(d);break}var p=c.pop(),v=new cg(d.x1,d.y1,p.x2,p.y2),m=Aht(e,v);m?(h.push(d),c.push(p)):c.push(v)}return h},s=new cg(r.getModel().x,r.getModel().y,a.getModel().x,a.getModel().y),l=kJt(s,e,n,i),u=o(l);return u}var Mht=function(e,t,n){var i=Object.assign(LJt,n),a=EV(e.map(function(x){return{x:x.getModel().x,y:x.getModel().y}}));e=e.sort(function(x,b){return XA({x:x.getModel().x,y:x.getModel().y},a)-XA({x:b.getModel().x,y:b.getModel().y},a)});var o=[],s=[];e.forEach(function(x){var b=RJt(x,t,o,i.maxRoutingIterations,i.morphBuffer);b.forEach(function(S){s.push(S)}),o.push(x)});for(var l=NJt(e,s,i.nodeR0),u=DJt(l.width,l.height,i.pixelGroupSize),f=[],c=[],h=0;h1)for(p=Math.floor(d.length/i.skip);p<3&&i.skip>1;)i.skip-=1,p=Math.floor(d.length/i.skip);for(var v=0,m=0;m0)i.nonMemberInfluenceFactor*=.8;else break}return c};function NJt(r,e,t){var n={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=[];r.forEach(function(l){i.push(l.getBBox())}),e.forEach(function(l){i.push(l.getBBox())});for(var a=0,o=i;an.maxX?s.maxX:n.maxX)+t,n.maxY=(s.maxY>n.maxY?s.maxY:n.maxY)+t}return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.x=n.minX,n.y=n.minY,n}function FJt(r,e,t,n,i,a){function o(d,p){var v=Math.floor((d-p)/a.pixelGroupSize);return v<0?0:v}function s(d,p){return d*a.pixelGroupSize+p}var l=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),u=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1),f=function(p,v){var m=Math.min(o(p.minX,v+n.minX),i.width),g=Math.min(o(p.minY,v+n.minY),i.height),x=Math.min(o(p.maxX,-v+n.minX),i.width),b=Math.min(o(p.maxY,-v+n.minY),i.height);return[m,g,x,b]},c=function(p,v){for(var m=p.getBBox(),g=f(m,a.nodeR1),x=g[0],b=g[1],S=g[2],C=g[3],w=b;wl.y?n?u.topLeft:u.bottomRight:n?u.topRight:u.bottomLeft:o.ys.x?n?u.topLeft:u.bottomRight:n?u.bottomLeft:u.topRight:a.x0?this.cfg.padding+e:10+e,this.cfg.bubbleCfg={nodeR0:this.padding-e,nodeR1:this.padding-e,morphBuffer:this.padding-e}},r.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),this.type!=="round-convex"&&this.type!=="smooth-convex"&&this.type!=="bubble"&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},r.prototype.calcPath=function(e,t){var n,i,a;switch(this.type){case"round-convex":n=e8(e),a=Ek(n.map(function(o){return[o.x,o.y]}),this.padding),i=Zf(a);break;case"smooth-convex":n=e8(e),n.length===2?(a=Ek(n.map(function(o){return[o.x,o.y]}),this.padding),i=Zf(a)):n.length>2&&(a=JV(n.map(function(o){return[o.x,o.y]}),this.padding),i=wk(a));break;case"bubble":n=Mht(e,t,this.cfg.bubbleCfg),i=n.length>=2&&wk(n);break;default:}return i},r.prototype.render=function(){this.group.addShape("path",{attrs:E({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},r.prototype.addMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e)),this.members.push(e);var t=this.nonMembers.indexOf(e);return t>-1&&this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},r.prototype.addNonMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e)),this.nonMembers.push(e);var t=this.members.indexOf(e);return t>-1&&this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},r.prototype.removeMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e));var t=this.members.indexOf(e);return t>-1?(this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},r.prototype.removeNonMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e));var t=this.nonMembers.indexOf(e);return t>-1?(this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},r.prototype.updateData=function(e,t){var n=this;this.group.findById(this.id).remove(),e&&(this.members=e.map(function(i){return(0,Js.isString)(i)?n.graph.findById(i):i})),t&&(this.nonMembers=t.map(function(i){return(0,Js.isString)(i)?n.graph.findById(i):i})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},r.prototype.updateStyle=function(e){var t=this.group.findById(this.id);t.attr(E({},e))},r.prototype.updateCfg=function(e){var t=this;this.cfg=(0,Js.deepMix)(this.cfg,e),this.id=this.cfg.id,this.group=this.cfg.group,e.members&&(this.members=this.cfg.members.map(function(n){return(0,Js.isString)(n)?t.graph.findById(n):n})),e.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(n){return(0,Js.isString)(n)?t.graph.findById(n):n})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},r.prototype.contain=function(e){var t=this,n;(0,Js.isString)(e)?n=this.graph.findById(e):n=e;var i,a=n.getKeyShape();if(n.get("type")==="path")i=Ck(a.attr("path"));else{var o=a.getCanvasBBox();i=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return i=i.map(function(s){var l=t.graph.getPointByCanvas(s[0],s[1]);return[l.x,l.y]}),SV(i,Ck(this.path))},r.prototype.destroy=function(){this.group.remove(),this.cfg=null},r}(),Ak=BJt;var nM=gr.transform,GJt="node",zJt=function(r){V(e,r);function e(t){var n=r.call(this)||this;return n.cfg=(0,Lr.deepMix)(n.getDefaultCfg(),t),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new E_(n.cfg.maxStep),n.redoStack=new E_(n.cfg.maxStep)),n}return e.prototype.init=function(){this.initCanvas();var t=new UV(this),n=new BV(this),i=new ZV(this),a=new $V(this);this.set({viewController:t,modeController:n,itemController:i,stateController:a}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(!!t){var n=t.get("el"),i=(n||{}).id,a=i===void 0?"g6":i,o=t.addGroup({id:"".concat(a,"-root"),className:qe.rootContainerClassName});if(this.get("groupByTypes")){var s=o.addGroup({id:"".concat(a,"-edge"),className:qe.edgeContainerClassName}),l=o.addGroup({id:"".concat(a,"-node"),className:qe.nodeContainerClassName}),u=o.addGroup({id:"".concat(a,"-combo"),className:qe.comboContainerClassName});u.toBack(),this.set({nodeGroup:l,edgeGroup:s,comboGroup:u})}var f=o.addGroup({id:"".concat(a,"-delegate"),className:qe.delegateContainerClassName});this.set({delegateGroup:f}),this.set("group",o)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.2,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:[]}},e.prototype.set=function(t,n){return(0,Lr.isPlainObject)(t)?this.cfg=E(E({},this.cfg),t):this.cfg[t]=n,this},e.prototype.get=function(t){var n;return(n=this.cfg)===null||n===void 0?void 0:n[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,n){(0,Lr.isString)(t)&&(t=this.findById(t));var i=this.get("itemController");n||(n=t.get("states")),i.clearItemStates(t,n);var a=this.get("stateController");a.updateStates(t,n,!1)},e.prototype.node=function(t){typeof t=="function"&&this.set("nodeMapper",t)},e.prototype.edge=function(t){typeof t=="function"&&this.set("edgeMapper",t)},e.prototype.combo=function(t){typeof t=="function"&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,n){var i,a=this.get("".concat(t,"s"));return(0,Lr.each)(a,function(o,s){if(n(o,s))return i=o,i}),i},e.prototype.findAll=function(t,n){var i=[];return(0,Lr.each)(this.get("".concat(t,"s")),function(a,o){n(a,o)&&i.push(a)}),i},e.prototype.findAllByState=function(t,n){return this.findAll(t,function(i){return i.hasState(n)})},e.prototype.getAnimateCfgWithCallback=function(t){var n=t.animateCfg,i=t.callback,a;if(!n)a={duration:500,callback:i};else if(a=(0,Lr.clone)(n),n.callback){var o=n.callback;a.callback=function(){i(),o()}}else a.callback=i;return a},e.prototype.translate=function(t,n,i,a){var o=this,s=this.get("group"),l=(0,Lr.clone)(s.getMatrix());if(l||(l=[1,0,0,0,1,0,0,0,1]),i){var u=this.getAnimateCfgWithCallback({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"translate",matrix:s.getMatrix()})}});uk(s,{x:s.getCanvasBBox().x+t,y:s.getCanvasBBox().y+n},i,u||{duration:500,easing:"easeCubic"})}else l=nM(l,[["t",t,n]]),s.setMatrix(l),this.emit("viewportchange",{action:"translate",matrix:l}),this.autoPaint()},e.prototype.moveTo=function(t,n,i,a){var o=this.get("group");uk(o,{x:t,y:n},i,a||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:o.getMatrix()})},e.prototype.fitView=function(t,n){t&&this.set("fitViewPadding",t);var i=this.get("viewController");n?i.fitViewByRules(n):i.fitView(),this.autoPaint()},e.prototype.fitCenter=function(){var t=this.get("viewController");t.fitCenter(),this.autoPaint()},e.prototype.addBehaviors=function(t,n){var i=this.get("modeController");return i.manipulateBehaviors(t,n,!0),this},e.prototype.removeBehaviors=function(t,n){var i=this.get("modeController");return i.manipulateBehaviors(t,n,!1),this},e.prototype.updateBehavior=function(t,n,i){var a=this.get("modeController");return a.updateBehavior(t,n,i),this},e.prototype.zoom=function(t,n,i,a){var o=this,s=this.get("group"),l=(0,Lr.clone)(s.getMatrix()),u=this.get("minZoom"),f=this.get("maxZoom");if(l||(l=[1,0,0,0,1,0,0,0,1]),n?l=nM(l,[["t",-n.x,-n.y],["s",t,t],["t",n.x,n.y]]):l=nM(l,[["s",t,t]]),u&&l[0]f)return!1;if(i){var c=(0,Lr.clone)(s.getMatrix());c||(c=[1,0,0,0,1,0,0,0,1]);var h=c[0],d=h*t,p=this.getAnimateCfgWithCallback({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"zoom",matrix:s.getMatrix()})}});s.animate(function(v){if(v===1)c=l;else{var m=TV(h,d,v)/c[0];n?c=nM(c,[["t",-n.x,-n.y],["s",m,m],["t",n.x,n.y]]):c=nM(c,[["s",m,m]])}return{matrix:c}},p)}else s.setMatrix(l),this.emit("viewportchange",{action:"zoom",matrix:l}),this.autoPaint();return!0},e.prototype.zoomTo=function(t,n,i,a){var o=t/this.getZoom();return this.zoom(o,n,i,a)},e.prototype.focusItem=function(t,n,i){var a=this.get("viewController"),o=!1;n?o=!0:n===void 0&&(o=this.get("animate"));var s={};i?s=i:i===void 0&&(s=this.get("animateCfg")),a.focus(t,o,s),this.autoPaint()},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,n){var i=this.get("viewController");return i.getPointByClient(t,n)},e.prototype.getClientByPoint=function(t,n){var i=this.get("viewController");return i.getClientByPoint(t,n)},e.prototype.getPointByCanvas=function(t,n){var i=this.get("viewController");return i.getPointByCanvas(t,n)},e.prototype.getCanvasByPoint=function(t,n){var i=this.get("viewController");return i.getCanvasByPoint(t,n)},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,n){n===void 0&&(n=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!0);if(n&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!1}],u.nodes=[{id:o,visible:!0}];break;case"edge":l.nodes=[{id:o,visible:!1}],u.edges=[{id:o,visible:!0}];break;case"combo":l.nodes=[{id:o,visible:!1}],u.combos=[{id:o,visible:!0}];break;default:break}this.pushStack("visible",{before:l,after:u})}},e.prototype.hideItem=function(t,n){n===void 0&&(n=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!1);if(n&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!0}],u.nodes=[{id:o,visible:!1}];break;case"edge":l.nodes=[{id:o,visible:!0}],u.edges=[{id:o,visible:!1}];break;case"combo":l.nodes=[{id:o,visible:!0}],u.combos=[{id:o,visible:!1}];break;default:break}this.pushStack("visible",{before:l,after:u})}},e.prototype.refreshItem=function(t){var n=this.get("itemController");n.refreshItem(t)},e.prototype.setAutoPaint=function(t){var n=this;n.set("autoPaint",t);var i=n.get("canvas");i.set("autoDraw",t)},e.prototype.remove=function(t,n){n===void 0&&(n=!0),this.removeItem(t,n)},e.prototype.removeItem=function(t,n){n===void 0&&(n=!0);var i=t;if((0,Lr.isString)(t)&&(i=this.findById(t)),!i&&(0,Lr.isString)(t))console.warn("The item to be removed does not exist!");else if(i){var a="";if(i.getType&&(a=i.getType()),n&&this.get("enabledStack")){var o=E(E({},i.getModel()),{itemType:a}),s={};switch(a){case"node":{s.nodes=[o],s.edges=[];for(var l=i.getEdges(),u=l.length-1;u>=0;u--)s.edges.push(E(E({},l[u].getModel()),{itemType:"edge"}));break}case"edge":s.edges=[o];break;case"combo":s.combos=[o];break;default:break}this.pushStack("delete",{before:s,after:{}})}if(a==="node"){var f=i.getModel();f.comboId&&this.updateComboTree(i,void 0,!1)}var c=this.get("itemController");if(c.removeItem(i),a==="combo"){var h=vk(this.get("comboTrees"));this.set("comboTrees",h)}}},e.prototype.addItem=function(t,n,i,a){i===void 0&&(i=!0),a===void 0&&(a=!0);var o=this.get("comboSorted");this.set("comboSorted",o&&!a);var s=this.get("itemController");if(!sht(t,n))return!1;if(n.id&&this.findById(n.id)){console.warn("This item exists already. Be sure the id %c".concat(n.id,"%c is unique."),"font-size: 20px; color: red;","");return}var l,u=this.get("comboTrees");if(u||(u=[]),t==="combo"){var f=this.get("itemMap"),c=!1;if(u.forEach(function(S){c||Hh(S,function(C){if(n.parentId===C.id){c=!0;var w=E({id:n.id,depth:C.depth+2},n);C.children?C.children.push(w):C.children=[w],n.depth=w.depth,l=s.addItem(t,n)}var A=f[C.id];return c&&A&&A.getType&&A.getType()==="combo"&&s.updateCombo(A,C.children),!0})}),!c){var h=E({id:n.id,depth:0},n);n.depth=h.depth,u.push(h),l=s.addItem(t,n)}this.set("comboTrees",u)}else if(t==="node"&&(0,Lr.isString)(n.comboId)&&u){var d=this.findById(n.comboId);d&&d.getType&&d.getType()!=="combo"&&console.warn("'".concat(n.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),l=s.addItem(t,n);var p=this.get("itemMap"),v=!1,m=!1;(u||[]).forEach(function(S){m||v||Hh(S,function(C){if(C.id===n.id)return m=!0,!1;if(n.comboId===C.id&&!m){v=!0;var w=(0,Lr.clone)(n);w.itemType="node",C.children?C.children.push(w):C.children=[w],w.depth=C.depth+1}return v&&p[C.id].getType&&p[C.id].getType()==="combo"&&s.updateCombo(p[C.id],C.children),!0})})}else l=s.addItem(t,n);if(t==="node"&&n.comboId||t==="combo"&&n.parentId){var d=this.findById(n.comboId||n.parentId);d&&d.getType&&d.getType()==="combo"&&d.addChild(l)}var g=this.get("combos");if(g&&g.length>0&&this.sortCombos(),this.autoPaint(),i&&this.get("enabledStack")){var x=E(E({},l.getModel()),{itemType:t}),b={};switch(t){case"node":b.nodes=[x];break;case"edge":b.edges=[x];break;case"combo":b.combos=[x];break;default:break}this.pushStack("add",{before:{},after:b})}return l},e.prototype.add=function(t,n,i,a){return i===void 0&&(i=!0),a===void 0&&(a=!0),this.addItem(t,n,i,a)},e.prototype.updateItem=function(t,n,i){var a=this;i===void 0&&(i=!0);var o=this.get("itemController"),s;(0,Lr.isString)(t)?s=this.findById(t):s=t;var l=(0,Lr.clone)(s.getModel()),u="";s.getType&&(u=s.getType());var f=mn([],s.getStates(),!0);if(u==="combo"&&(0,Lr.each)(f,function(p){return a.setItemState(s,p,!1)}),o.updateItem(s,n),u==="combo"&&(0,Lr.each)(f,function(p){return a.setItemState(s,p,!0)}),i&&this.get("enabledStack")){var c={nodes:[],edges:[],combos:[]},h={nodes:[],edges:[],combos:[]},d=E({id:l.id},n);switch(u){case"node":c.nodes.push(l),h.nodes.push(d);break;case"edge":c.edges.push(l),h.edges.push(d);break;case"combo":c.combos.push(l),h.combos.push(d);break;default:break}u==="node"&&c.nodes.push(l),this.pushStack("update",{before:c,after:h})}},e.prototype.update=function(t,n,i){i===void 0&&(i=!0),this.updateItem(t,n,i)},e.prototype.setItemState=function(t,n,i){(0,Lr.isString)(t)&&(t=this.findById(t));var a=this.get("itemController");a.setItemState(t,n,i);var o=this.get("stateController");(0,Lr.isString)(i)?o.updateState(t,"".concat(n,":").concat(i),!0):o.updateState(t,n,i)},e.prototype.priorityState=function(t,n){var i=this.get("itemController");i.priorityState(t,n)},e.prototype.data=function(t){FV(t),this.set("data",t)},e.prototype.render=function(){var t=this;this.set("comboSorted",!1);var n=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!n)throw new Error("data must be defined first");var i=n.nodes,a=i===void 0?[]:i,o=n.edges,s=o===void 0?[]:o,l=n.combos,u=l===void 0?[]:l;if(this.clear(!0),this.emit("beforerender"),(0,Lr.each)(a,function(m){t.add("node",m,!1,!1)}),u&&u.length!==0){var f=pk(u,a);this.set("comboTrees",f),t.addCombos(u)}(0,Lr.each)(s,function(m){t.add("edge",m,!1,!1)});var c=t.get("animate");(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1);var h=t.get("layoutController");if(h){if(h.layout(d),this.destroyed)return}else t.get("fitView")&&t.fitView(),t.get("fitCenter")&&t.fitCenter(),t.emit("afterrender"),t.set("animate",c);function d(){t.get("fitView")?t.fitView():t.get("fitCenter")&&t.fitCenter(),t.autoPaint(),t.emit("afterrender"),(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",c)}if(!this.get("groupByTypes"))if(u&&u.length!==0)this.sortCombos();else if(n.nodes&&n.edges&&n.nodes.length=0;d--)c[d].destroyed&&c.splice(d,1);u&&(i.addCombos(u),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",l,t.edges),(0,Lr.each)(s,function(v,m){v.getType&&(v.getType()==="node"||v.getType()==="combo")||l.edges.indexOf(v)<0&&(delete s[m],i.remove(v,!1))}),this.set({nodes:l.nodes,edges:l.edges});var p=this.get("layoutController");return p&&(p.changeData(),i.get("animate")&&!p.getLayoutType()?i.positionsAnimate():i.autoPaint()),setTimeout(function(){a.set("localRefresh",o)},16),this},e.prototype.addCombos=function(t){var n=this,i=n.get("comboTrees"),a=this.get("itemController");a.addCombos(i,t)},e.prototype.createCombo=function(t,n){var i=this;this.set("comboSorted",!1);var a="",o;if(!!t){if((0,Lr.isString)(t))a=t,o={id:t};else{if(a=t.id,!a){console.warn("Create combo failed. Please assign a unique string id for the adding combo.");return}o=t}var s=n.map(function(u){var f=i.findById(u),c=f.getModel(),h="";f.getType&&(h=f.getType());var d={id:f.getID(),itemType:h};return h==="combo"?(d.parentId=a,c.parentId=a):h==="node"&&(d.comboId=a,c.comboId=a),d});o.children=s,this.addItem("combo",o,!1),this.set("comboSorted",!1);var l=this.get("comboTrees");(l||[]).forEach(function(u){Hh(u,function(f){return f.id===a?(f.itemType="combo",f.children=s,!1):!0})}),l&&this.sortCombos()}},e.prototype.uncombo=function(t){var n=this,i,a=this,o=t;if((0,Lr.isString)(t)&&(o=this.findById(t)),!o||o.getType&&o.getType()!=="combo"){console.warn("The item is not a combo!");return}var s=o.getModel().parentId,l=a.get("comboTrees");l||(l=[]);var u=this.get("itemMap"),f=o.get("id"),c,h=[],d=this.get("combos"),p=this.findById(s);if(l.forEach(function(m){c||Hh(m,function(g){var x;if(g.id===f){c=g;var b=o.getEdges();b.forEach(function(C){n.removeItem(C,!1)});var S=d.indexOf(o);d.splice(S,1),delete u[f],o.destroy(),n.emit("afterremoveitem",{item:o,type:"combo"})}if(s&&c&&g.id===s){p.removeCombo(o),h=g.children;var S=h.indexOf(c);return S!==-1&&h.splice(S,1),(x=c.children)===null||x===void 0||x.forEach(function(w){var A=n.findById(w.id),L=A.getModel();A.getType&&A.getType()==="combo"?(w.parentId=s,delete w.comboId,L.parentId=s,delete L.comboId):A.getType&&A.getType()==="node"&&(w.comboId=s,L.comboId=s),p.addChild(A),h.push(w)}),!1}return!0})}),!s&&c){var v=l.indexOf(c);l.splice(v,1),(i=c.children)===null||i===void 0||i.forEach(function(m){m.parentId=void 0;var g=n.findById(m.id).getModel();delete g.parentId,delete g.comboId,m.itemType!=="node"&&l.push(m)})}},e.prototype.updateCombos=function(){var t=this,n=this,i=this.get("comboTrees"),a=n.get("itemController"),o=n.get("itemMap");(i||[]).forEach(function(s){Hh(s,function(l){if(!l)return!0;var u=o[l.id];if(u&&u.getType&&u.getType()==="combo"){var f=mn([],u.getStates(),!0);(0,Lr.each)(f,function(c){return t.setItemState(u,c,!1)}),a.updateCombo(u,l.children),(0,Lr.each)(f,function(c){return t.setItemState(u,c,!0)})}return!0})}),n.sortCombos()},e.prototype.updateCombo=function(t){var n=this,i=this,a=t,o;if((0,Lr.isString)(t)&&(a=this.findById(t)),!a||a.getType&&a.getType()!=="combo"){console.warn("The item to be updated is not a combo!");return}o=a.get("id");var s=this.get("comboTrees"),l=i.get("itemController"),u=i.get("itemMap");(s||[]).forEach(function(f){Hh(f,function(c){if(!c)return!0;var h=u[c.id];if(o===c.id&&h&&h.getType&&h.getType()==="combo"){var d=mn([],h.getStates(),!0);(0,Lr.each)(d,function(p){h.getStateStyle(p)&&n.setItemState(h,p,!1)}),l.updateCombo(h,c.children),(0,Lr.each)(d,function(p){h.getStateStyle(p)&&n.setItemState(h,p,!0)}),o&&(o=c.parentId)}return!0})})},e.prototype.updateComboTree=function(t,n,i){i===void 0&&(i=!0);var a=this;this.set("comboSorted",!1);var o;(0,Lr.isString)(t)?o=a.findById(t):o=t;var s=o.getModel(),l=s.comboId||s.parentId,u="";if(o.getType&&(u=o.getType()),n&&u==="combo"){var f=this.get("comboTrees"),c=!0,h;if((f||[]).forEach(function(x){h||Ps(x,function(b){if(!h)return b.id===o.getID()&&(h=b),!0})}),Ps(h,function(x){return x.id===n?(c=!1,!1):!0}),!c){console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!");return}}if(i&&this.get("enabledStack")){var d={},p={};u==="combo"?(d.combos=[{id:s.id,parentId:s.parentId}],p.combos=[{id:s.id,parentId:n}]):u==="node"&&(d.nodes=[{id:s.id,parentId:s.comboId}],p.nodes=[{id:s.id,parentId:n}]),this.pushStack("updateComboTree",{before:d,after:p})}if(s.parentId||s.comboId){var v=this.findById(s.parentId||s.comboId);v&&v.removeChild(o)}if(u==="combo"?s.parentId=n:u==="node"&&(s.comboId=n),n){var m=this.findById(n);m&&m.addChild(o)}if(l){var m=this.findById(l);m&&m.removeChild(o)}var g=vk(this.get("comboTrees"),s.id,n);this.set("comboTrees",g),this.updateCombos()},e.prototype.save=function(){var t=[],n=[],i=[];return(0,Lr.each)(this.get("nodes"),function(a){t.push(a.getModel())}),(0,Lr.each)(this.get("edges"),function(a){n.push(a.getModel())}),(0,Lr.each)(this.get("combos"),function(a){i.push(a.getModel())}),{nodes:t,edges:n,combos:i}},e.prototype.changeSize=function(t,n){var i=this.get("viewController");return i.changeSize(t,n),this},e.prototype.refresh=function(){var t=this;if(t.emit("beforegraphrefresh"),t.get("animate"))t.positionsAnimate();else{var n=t.get("nodes"),i=t.get("edges"),a=t.get("edges");(0,Lr.each)(n,function(o){o.refresh()}),(0,Lr.each)(i,function(o){o.refresh()}),(0,Lr.each)(a,function(o){o.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,Lr.isString)(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo does not exist!");return}return t.getChildren()},e.prototype.positionsAnimate=function(){var t=this;t.emit("beforeanimate");var n=t.get("animateCfg"),i=n.onFrame,a=t.getNodes(),o=a.map(function(l){var u=l.getModel();return{id:u.id,x:u.x,y:u.y}});t.isAnimating()&&t.stopAnimate();var s=t.get("canvas");s.animate(function(l){(0,Lr.each)(o,function(u){var f=t.findById(u.id);if(!(!f||f.destroyed)){var c=f.get("originAttrs"),h=f.get("model");if(!c){var d=f.getContainer().getMatrix();d||(d=[1,0,0,0,1,0,0,0,1]),c={x:d[6],y:d[7]},f.set("originAttrs",c)}if(i){var p=i(f,l,u,c);f.set("model",Object.assign(h,p))}else h.x=c.x+(u.x-c.x)*l,h.y=c.y+(u.y-c.y)*l}}),t.refreshPositions()},{duration:n.duration,easing:n.easing,callback:function(){(0,Lr.each)(a,function(u){u.set("originAttrs",null)}),n.callback&&n.callback(),t.emit("afteranimate"),t.animating=!1}})},e.prototype.refreshPositions=function(){var t=this;t.emit("beforegraphrefreshposition");var n=t.get("nodes"),i=t.get("edges"),a=t.get("vedges"),o=t.get("combos"),s,l={};(0,Lr.each)(n,function(u){s=u.getModel();var f=u.get("originAttrs");if(!(f&&s.x===f.x&&s.y===f.y)){var c=u.updatePosition({x:s.x,y:s.y});l[s.id]=c,s.comboId&&(l[s.comboId]=l[s.comboId]||c)}}),o&&o.length!==0&&t.updateCombos(),(0,Lr.each)(i,function(u){var f=u.getSource().getModel(),c=u.getTarget();if(!(0,Lr.isPlainObject)(c)){var h=c.getModel();(l[f.id]||l[h.id]||u.getModel().isComboEdge)&&u.refresh()}}),(0,Lr.each)(a,function(u){u.refresh()}),t.emit("aftergraphrefreshposition"),t.autoPaint()},e.prototype.stopAnimate=function(){this.get("canvas").stopAnimate()},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(){var t=this.get("modeController");return t.getMode()},e.prototype.setMode=function(t){var n=this.get("modeController");return n.setMode(t),this},e.prototype.clear=function(t){var n;return t===void 0&&(t=!1),(n=this.get("canvas"))===null||n===void 0||n.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,n,i){var a=this,o=this.get("layoutController");if((0,Lr.isString)(t)&&(t={type:t}),n){var s=i;s||(n==="begin"?s={x:0,y:0}:s={x:this.getWidth()/2,y:this.getHeight()/2}),s=this.getPointByCanvas(s.x,s.y);var l=["force","gForce","fruchterman"];l.includes(t.type)||!t.type&&l.includes(o==null?void 0:o.layoutType)?t.center=[s.x,s.y]:this.once("afterlayout",function(c){var h=a.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];s.x=s.x*h[0]+h[6],s.y=s.y*h[0]+h[7];var d=a.getGroup().getCanvasBBox(),p=d.minX,v=d.maxX,m=d.minY,g=d.maxY,x={x:(p+v)/2,y:(m+g)/2};n==="begin"&&(x.x=p,x.y=m),a.translate(s.x-x.x,s.y-x.y)})}var u=this.get("layout"),f={};Object.assign(f,u,t),this.set("layout",f),o.isLayoutTypeSame(f)&&f.gpuEnabled===u.gpuEnabled?o.updateLayoutCfg(f):o.changeLayout(f)},e.prototype.destroyLayout=function(){var t=this.get("layoutController");t.destroyLayout()},e.prototype.layout=function(){var t=this.get("layoutController"),n=this.get("layout");if(!(!n||!t)){if(n.workerEnabled){t.layout();return}t.layoutMethod?t.relayout(!0):t.layout()}},e.prototype.collapseCombo=function(t){var n=this;if((0,Lr.isString)(t)&&(t=this.findById(t)),!t){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var i=t.getModel(),a=this.get("itemController");a.collapseCombo(t),i.collapsed=!0;var o=this.getEdges().concat(this.get("vedges")),s=[],l=[],u=this.get("comboTrees"),f=!1;(u||[]).forEach(function(d){f||Ps(d,function(p){if(f&&p.depth<=i.depth)return!1;if(i.id===p.id&&(f=!0),f){var v=n.findById(p.id);v&&v.getType&&v.getType()==="combo"&&(s=s.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={},h=[];o.forEach(function(d){if(!(d.isVisible()&&!d.getModel().isVEdge)){var p=d.getSource(),v=d.getTarget();if((s.includes(p)||l.includes(p))&&!s.includes(v)&&!l.includes(v)||p.getModel().id===i.id){var m=d.getModel();if(m.isVEdge){n.removeItem(d,!1);return}for(var g=v.getModel();!v.isVisible();){if(v=n.findById(g.parentId||g.comboId),!v||!g.parentId&&!g.comboId)return;g=v.getModel()}var x=g.id;if(c["".concat(i.id,"-").concat(x)]){c["".concat(i.id,"-").concat(x)]+=m.size||1;return}var b=n.addItem("vedge",{source:i.id,target:x,isVEdge:!0},!1);c["".concat(i.id,"-").concat(x)]=m.size||1,h.push(b)}else if(!s.includes(p)&&!l.includes(p)&&(s.includes(v)||l.includes(v))||v.getModel().id===i.id){var m=d.getModel();if(m.isVEdge){n.removeItem(d,!1);return}for(var S=p.getModel();!p.isVisible();){if(p=n.findById(S.parentId||S.comboId),!p||!S.parentId&&!S.comboId)return;S=p.getModel()}var C=S.id;if(c["".concat(C,"-").concat(i.id)]){c["".concat(C,"-").concat(i.id)]+=m.size||1;return}var b=n.addItem("vedge",{target:i.id,source:C,isVEdge:!0},!1);c["".concat(C,"-").concat(i.id)]=m.size||1,h.push(b)}}}),h.forEach(function(d){var p=d.getModel();n.updateItem(d,{size:c["".concat(p.source,"-").concat(p.target)]},!1)}),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})},e.prototype.expandCombo=function(t){var n=this;if((0,Lr.isString)(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var i=t.getModel(),a=this.get("itemController");a.expandCombo(t),i.collapsed=!1;var o=this.getEdges().concat(this.get("vedges")),s=[],l=[],u=this.get("comboTrees"),f=!1;(u||[]).forEach(function(d){f||Ps(d,function(p){if(f&&p.depth<=i.depth)return!1;if(i.id===p.id&&(f=!0),f){var v=n.findById(p.id);v&&v.getType&&v.getType()==="combo"&&(s=s.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={},h={};o.forEach(function(d){if(!(d.isVisible()&&!d.getModel().isVEdge)){var p=d.getSource(),v=d.getTarget(),m=p.get("id"),g=v.get("id");if((s.includes(p)||l.includes(p))&&!s.includes(v)&&!l.includes(v)||m===i.id){if(d.getModel().isVEdge){n.removeItem(d,!1);return}for(var x=v.getModel();!v.isVisible();){if(v=n.findById(x.comboId||x.parentId),!v||!x.parentId&&!x.comboId)return;x=v.getModel()}g=x.id;for(var b=p.getModel();!p.isVisible();){if(p=n.findById(b.comboId||b.parentId),!p||!b.parentId&&!b.comboId)return;if(b.comboId===i.id||b.parentId===i.id)break;b=p.getModel()}if(m=b.id,g){var S="".concat(m,"-").concat(g);if(c[S]){c[S]+=d.getModel().size||1,n.updateItem(h[S],{size:c[S]},!1);return}var C=n.addItem("vedge",{source:m,target:g,isVEdge:!0},!1);c[S]=d.getModel().size||1,h[S]=C}}else if(!s.includes(p)&&!l.includes(p)&&(s.includes(v)||l.includes(v))||g===i.id){if(d.getModel().isVEdge){n.removeItem(d,!1);return}for(var b=p.getModel();!p.isVisible();){if(p=n.findById(b.comboId||b.parentId),!p||!b.parentId&&!b.comboId)return;b=p.getModel()}m=b.id;for(var x=v.getModel();!v.isVisible();){if(v=n.findById(x.comboId||x.parentId),!v||!x.parentId&&!x.comboId)return;if(x.comboId===i.id||x.parentId===i.id)break;x=v.getModel()}if(g=x.id,m){var S="".concat(m,"-").concat(g);if(c[S]){c[S]+=d.getModel().size||1,n.updateItem(h[S],{size:c[S]},!1);return}var C=n.addItem("vedge",{target:g,source:m,isVEdge:!0},!1);c[S]=d.getModel().size||1,h[S]=C}}else(s.includes(p)||l.includes(p))&&(s.includes(v)||l.includes(v))&&p.isVisible()&&v.isVisible()&&d.show()}}),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})},e.prototype.collapseExpandCombo=function(t){if((0,Lr.isString)(t)&&(t=this.findById(t)),!(!t||t.getType&&t.getType()!=="combo")){for(var n=t.getModel(),i=this.findById(n.parentId);i;){var a=i.getModel();if(a.collapsed){console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),i=void 0;return}i=this.findById(a.parentId)}var o=n.collapsed;o?this.expandCombo(t):this.collapseCombo(t),this.updateCombo(t)}},e.prototype.sortCombos=function(){var t=this,n=this.get("comboSorted");if(!n){this.set("comboSorted",!0);var i=[],a={},o=this.get("comboTrees");(o||[]).forEach(function(l){Ps(l,function(u){return i[u.depth]?i[u.depth].push(u.id):i[u.depth]=[u.id],a[u.id]=u.depth,!0})});var s=this.getEdges().concat(this.get("vedges"));(s||[]).forEach(function(l){var u=l.getModel(),f=a[u.source]||0,c=a[u.target]||0,h=Math.max(f,c);i[h]?i[h].push(u.id):i[h]=[u.id]}),i.forEach(function(l){if(!(!l||!l.length))for(var u=l.length-1;u>=0;u--){var f=t.findById(l[u]);f&&f.toFront()}})}},e.prototype.getNeighbors=function(t,n){var i=t;return(0,Lr.isString)(t)&&(i=this.findById(t)),i.getNeighbors(n)},e.prototype.getNodeDegree=function(t,n,i){n===void 0&&(n=void 0),i===void 0&&(i=!1);var a=t;(0,Lr.isString)(t)&&(a=this.findById(t));var o=this.get("degrees");(!o||i)&&(o=Fp(this.save()),this.set("degrees",o));var s=o[a.getID()],l=0;if(!s)return 0;switch(n){case"in":l=s.inDegree;break;case"out":l=s.outDegree;break;case"all":l=s;break;default:l=s.degree;break}return l},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())},e.prototype.pushStack=function(t,n,i){if(t===void 0&&(t="update"),i===void 0&&(i="undo"),!this.get("enabledStack")){console.warn("\u8BF7\u5148\u542F\u7528 undo & redo \u529F\u80FD\uFF0C\u5728\u5B9E\u4F8B\u5316 Graph \u65F6\u5019\u914D\u7F6E enabledStack: true !");return}var a=n?(0,Lr.clone)(n):{before:{},after:(0,Lr.clone)(this.save())};i==="redo"?this.redoStack.push({action:t,data:a}):this.undoStack.push({action:t,data:a}),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack})},e.prototype.getAdjMatrix=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=this.get("directed"));var i=this.get("adjMatrix");return(!i||!t)&&(i=hf(this.save(),n),this.set("adjMatrix",i)),i},e.prototype.getShortestPathMatrix=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=this.get("directed"));var i=this.get("adjMatrix"),a=this.get("shortestPathMatrix");return(!i||!t)&&(i=hf(this.save(),n),this.set("adjMatrix",i)),(!a||!t)&&(a=ug(this.save(),n),this.set("shortestPathMatrix",a)),a},e.prototype.on=function(t,n,i){return r.prototype.on.call(this,t,n,i)},e.prototype.destroy=function(){var t,n,i,a,o;this.clear(),this.clearStack(),(t=this.get("itemController"))===null||t===void 0||t.destroy(),(n=this.get("modeController"))===null||n===void 0||n.destroy(),(i=this.get("viewController"))===null||i===void 0||i.destroy(),(a=this.get("stateController"))===null||a===void 0||a.destroy(),(o=this.get("canvas"))===null||o===void 0||o.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null},e.prototype.createHull=function(t){if(!t.members||t.members.length<1){console.warn("Create hull failed! The members is empty.");return}var n=this.get("hullGroup"),i=this.get("hullMap");if(i||(i={},this.set("hullMap",i)),(!n||n.get("destroyed"))&&(n=this.get("group").addGroup({id:"hullGroup"}),n.toBack(),this.set("hullGroup",n)),i[t.id])return console.warn("Existed hull id."),i[t.id];var a=n.addGroup({id:"".concat(t.id,"-container")}),o=new Ak(this,E(E({},t),{group:a})),s=o.id;return i[s]=o,o},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var n,i;(0,Lr.isString)(t)?i=this.getHullById(t):i=t,(n=this.get("hullMap"))===null||n===void 0||delete n[i.id],i.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();!t||!Object.keys(t).length||(Object.keys(t).forEach(function(n){var i=t[n];i.destroy()}),this.set("hullMap",{}))},e}(Hv),Mk=zJt;var vg=z(q());var na=z(q());function r8(r){return r8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r8(r)}var P_=gr.transform,Iht="-shape",n8="-label",Tk=["startArrow","endArrow"],Lht={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},UJt={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},Ik={edge:UJt,node:Lht,combo:Lht},Lk="-label-bg",k_={options:{labelCfg:{style:{fontFamily:qe.windowFontFamily}},descriptionCfg:{style:{fontFamily:qe.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(e){return{}},getOptions:function(e,t){return t==="move"||(t==null?void 0:t.includes("bbox"))?{}:(0,na.deepMix)({},this.options,this.getCustomConfig(e)||{},e)},draw:function(e,t){t.shapeMap={},this.mergeStyle=this.getOptions(e);var n=this.drawShape(e,t);if(n.set("className",this.itemType+Iht),t.shapeMap[this.itemType+Iht]=n,e.label){var i=this.drawLabel(e,t);i.set("className",this.itemType+n8),t.shapeMap[this.itemType+n8]=i}return n},afterDraw:function(e,t,n){},drawShape:function(e,t){return null},drawLabel:function(e,t){var n=(this.mergeStyle||this.getOptions(e)||{}).labelCfg,i=n||{},a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""){var l=s.getBBox(),u=[1,0,0,0,1,0,0,0,1];if(a.rotateCenter)switch(a.rotateCenter){case"center":u=P_(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break;case"lefttop":u=P_(u,[["t",-a.x,-a.y],["r",o],["t",a.x,a.y]]);break;case"leftcenter":u=P_(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);break;default:u=P_(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break}else u=P_(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);s.setMatrix(u)}if(a.background){var f=this.drawLabelBg(e,t,s),c=this.itemType+Lk;f.set("classname",c),t.shapeMap[c]=f,s.toFront()}return s},drawLabelBg:function(e,t,n){var i=this.options.labelCfg,a=(0,na.mix)({},i,e.labelCfg),o=this.getLabelBgStyleByPosition(n,a),s=t.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return t.shapeMap["text-bg-shape"]=s,s},getLabelStyleByPosition:function(e,t,n){return{text:e.label}},getLabelBgStyleByPosition:function(e,t){return{}},getLabelStyle:function(e,t,n){var i=this.getLabelStyleByPosition(e,t,n),a="".concat(this.itemType,"Label"),o=qe[a]?qe[a].style:null;return E(E(E({},o),i),t.style)},getShapeStyle:function(e){return e.style},update:function(e,t,n){this.updateShapeStyle(e,t,n),this.updateLabel(e,t,n)},updateShapeStyle:function(e,t,n){var i,a=t.getContainer(),o=t.getKeyShape(),s=(0,na.mix)({},o.attr(),e.style),l=function(c){var h,d=s[c];if((0,na.isPlainObject)(d)){var p=((i=a.shapeMap)===null||i===void 0?void 0:i[c])||a.find(function(v){return v.get("name")===c});p==null||p.attr(d)}else o.attr((h={},h[c]=d,h))};for(var u in s)l(u)},updateLabel:function(e,t,n){var i,a;if(e.label||e.label===""){var o=t.getContainer(),s=(this.mergeStyle||this.getOptions({},n)||{}).labelCfg,l=s===void 0?{}:s,u=this.itemType+n8,f=o.shapeMap[u]||o.find(function(S){return S.get("className")===u}),c=this.itemType+Lk,h=o.shapeMap[c]||o.find(function(S){return S.get("className")===c});if(f){(!n||n==="bbox|label"||this.itemType==="edge"&&n!=="style")&&(l=(0,na.deepMix)(l,e.labelCfg));var p=this.getLabelStyleByPosition(e,l,o),v=(i=e.labelCfg)===null||i===void 0?void 0:i.style,m=E(E({},p),v),g=m.rotate;if(delete m.rotate,!isNaN(g)&&g!==""){var x=[1,0,0,0,1,0,0,0,1];x=P_(x,[["t",-m.x,-m.y],["r",g],["t",m.x,m.y]]),m.matrix=x,f.attr(m)}else((a=f.getMatrix())===null||a===void 0?void 0:a[4])!==1&&f.resetMatrix(),f.attr(m);if(!h)m.background&&(h=this.drawLabelBg(e,o,f),h.set("classname",c),o.shapeMap[c]=h,f.toFront());else if(m.background){var b=this.getLabelBgStyleByPosition(f,l);h.attr(b)}else o.removeChild(h)}else{var d=this.drawLabel(e,o);d.set("className",u),o.shapeMap[u]=d}}},afterUpdate:function(e,t){},setState:function(e,t,n){var i,a,o,s=n.get("keyShape");if(!(!s||s.destroyed)){var l=n.getType(),u=(0,na.isBoolean)(t)?e:"".concat(e,":").concat(t),f=this.getStateStyle(u,n),c=n.getStateStyle(u);if(!(!c&&!f)){var h=(0,na.mix)({},c||f),d=n.getContainer(),p={x:1,y:1,cx:1,cy:1,matrix:1};if(l==="combo"&&(p.r=1,p.width=1,p.height=1),t){var v=function(D){var G,U=h[D];if((0,na.isPlainObject)(U)&&!Tk.includes(D)){var j=((o=d.shapeMap)===null||o===void 0?void 0:o[D])||d.find(function(H){return H.get("name")===D});j==null||j.attr(U)}else s.attr((G={},G[D]=U,G))};for(var m in h)v(m)}else{var g=KA(n.getCurrentStatesStyle()),x=n.getModel(),b=(0,na.mix)({},x.style,KA(n.getOriginStyle())),S=s.get("name"),C=s.attr(),w={};Object.keys(C).forEach(function(F){if(F!=="img"){var D=C[F];D&&r8(D)==="object"?w[F]=(0,na.clone)(D):w[F]=D}});var A={},L=function(D){var G=h[D];if((0,na.isPlainObject)(G)&&!Tk.includes(D)){var U=d.shapeMap[D]||d.find(function(tt){return tt.get("name")===D});if(U){var j=KA(U.attr());(0,na.each)(G,function(tt,et){if(D===S&&w[et]&&!p[et]){delete w[et];var ut=b[D][et]||Ik[l][et];s.attr(et,ut)}else if(j[et]||j[et]===0){delete j[et];var $=b[D][et]||Ik[l][et];U.attr(et,$)}}),A[D]=j}}else if(w[D]&&!p[D]){delete w[D];var H=b[D]||(b[S]?b[S][D]:void 0)||Ik[l][D];s.attr(D,H)}};for(var k in h)L(k);S?A[S]=w:(0,na.mix)(A,w);for(var m in g)if(!p[m]){var O=g[m];(!(0,na.isPlainObject)(O)||Tk.includes(m))&&(S?((0,na.mix)(b[S],(a={},a[m]=O,a)),delete b[m]):(0,na.mix)(b,(i={},i[m]=O,i)),delete g[m])}var M={};(0,na.deepMix)(M,b,A,g);var I=!1,R=function(D){var G,U,j=M[D];if((0,na.isPlainObject)(j)&&!Tk.includes(D)){var H=d.shapeMap[D]||d.find(function(et){return et.get("name")===D});H&&((H.get("type")==="text"||H.get("labelRelated"))&&(delete j.x,delete j.y,delete j.matrix),D===S&&(l==="combo"&&(delete j.r,delete j.width,delete j.height),I=!0),H.attr(j))}else if(!I){var tt=j||Ik[l][D];l==="combo"?S||s.attr((G={},G[D]=tt,G)):s.attr((U={},U[D]=tt,U))}};for(var P in M)R(P)}}}},getStateStyle:function(e,t){var n=t.getModel(),i=t.getType(),a=this.getOptions(n),o=a.stateStyles,s=a.style,l=s===void 0?{}:s,u=n.stateStyles?n.stateStyles[e]:o&&o[e];return i==="combo"?(0,na.clone)(u):(0,na.mix)({},l,u)},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t,n,i=(e==null?void 0:e.anchorPoints)||((t=this.getCustomConfig(e))===null||t===void 0?void 0:t.anchorPoints)||((n=this.options)===null||n===void 0?void 0:n.anchorPoints);return i}};var jJt={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:qe.nodeLabel.offset,getSize:function(e){var t,n=((t=this.mergeStyle)===null||t===void 0?void 0:t.size)||e.size||this.getOptions({}).size||qe.defaultNode.size;return(0,vg.isArray)(n)&&n.length===1&&(n=[n[0],n[0]]),(0,vg.isArray)(n)||(n=[n,n]),n},getLabelStyleByPosition:function(e,t){var n=t.position||this.labelPosition;if(n==="center")return{x:0,y:0,text:e.label};var i=t.offset;(0,vg.isNil)(i)&&(i=this.offset);var a=this.getSize(e),o;switch(n){case"top":o={x:0,y:-a[1]/2-i,textBaseline:"bottom"};break;case"bottom":o={x:0,y:a[1]/2+i,textBaseline:"top"};break;case"left":o={x:-a[0]/2-i,y:0,textAlign:"right"};break;default:o={x:a[0]/2+i,y:0,textAlign:"left"};break}return o.text=e.label,o},getLabelBgStyleByPosition:function(e,t){var n;if(!e)return{};var i=(n=t.style)===null||n===void 0?void 0:n.background;if(!i)return{};var a=e.getBBox(),o=ZA(i.padding),s=a.width+o[1]+o[3],l=a.height+o[0]+o[2];return E(E({x:a.minX-o[3],y:a.minY-o[0]},i),{width:s,height:l})},drawShape:function(e,t){var n=this.shapeType,i=this.getShapeStyle(e),a=t.addShape(n,{attrs:i,draggable:!0,name:"node-shape"});return t.shapeMap["node-shape"]=a,a},updateLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(M){return M.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(M){return M.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(M){return M.get("className")==="link-point-top"}),s=t.shapeMap["link-point-bottom"]||t.find(function(M){return M.get("className")==="link-point-bottom"}),l;i&&(l=i.attr()),a&&!l&&(l=a.attr()),o&&!l&&(l=o.attr()),s&&!l&&(l=s.attr()),l||(l=n);var u=(0,vg.mix)({},l,e.linkPoints),f=u.fill,c=u.stroke,h=u.lineWidth,d=u.size/2;d||(d=u.r);var p=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},v=p.left,m=p.right,g=p.top,x=p.bottom,b=this.getSize(e),S=b[0],C=b[1],w={r:d,fill:f,stroke:c,lineWidth:h};if(i)!v&&v!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(E(E({},w),{x:-S/2,y:0}));else if(v){var A="link-point-left";t.shapeMap[A]=t.addShape("circle",{attrs:E(E({},w),{x:-S/2,y:0}),className:A,name:A,isAnchorPoint:!0})}if(a)!m&&m!==void 0&&(a.remove(),delete t.shapeMap["link-point-right"]),a.attr(E(E({},w),{x:S/2,y:0}));else if(m){var L="link-point-right";t.shapeMap[L]=t.addShape("circle",{attrs:E(E({},w),{x:S/2,y:0}),className:L,name:L,isAnchorPoint:!0})}if(o)!g&&g!==void 0&&(o.remove(),delete t.shapeMap["link-point-top"]),o.attr(E(E({},w),{x:0,y:-C/2}));else if(g){var k="link-point-top";t.shapeMap[k]=t.addShape("circle",{attrs:E(E({},w),{x:0,y:-C/2}),className:k,name:k,isAnchorPoint:!0})}if(s)!x&&x!==void 0?(s.remove(),delete t.shapeMap["link-point-bottom"]):s.attr(E(E({},w),{x:0,y:C/2}));else if(x){var O="link-point-bottom";t.shapeMap[O]=t.addShape("circle",{attrs:E(E({},w),{x:0,y:C/2}),className:O,name:O,isAnchorPoint:!0})}},updateShape:function(e,t,n,i,a){var o=t.get("keyShape");o.attr(E({},n)),this.updateLabel(e,t,a),i&&this.updateIcon(e,t)},updateIcon:function(e,t){var n=this,i=t.getContainer(),a=(this.mergeStyle||this.getOptions(e)).icon,o=e.icon?e.icon:{show:void 0,text:void 0},s=o.show,l=o.text,u=i.shapeMap["".concat(this.type,"-icon")]||i.find(function(g){return g.get("name")==="".concat(n.type,"-icon")});if(u)if(s||s===void 0){var f=(0,vg.mix)({},u.attr(),a),c=f.width,h=c===void 0?20:c,d=f.height,p=d===void 0?20:d;(f.fontFamily==="iconfont"||f.hasOwnProperty("text"))&&(h=0,p=0),u.attr(E(E({},f),{x:-h/2,y:-p/2}))}else u.remove();else if(s){var v="".concat(this.type,"-icon");if(l)i.shapeMap[v]=i.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:v,name:v});else{var h=a.width,p=a.height;i.shapeMap[v]=i.addShape("image",{attrs:E(E({},a),{x:-h/2,y:-p/2}),className:v,name:v})}var m=i.shapeMap["node-label"]||i.find(function(g){return g.get("name")==="node-label"});m&&m.toFront()}}},WJt=E(E({},k_),jJt);zi.registerNode("single-node",WJt);var ca=z(q());var Ok="edge-shape";function VJt(r){var e=r;return r==="start"?e="end":r==="end"&&(e="start"),e}var HJt={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:qe.defaultEdge.size,style:{x:0,y:0,stroke:qe.defaultEdge.style.stroke,lineAppendWidth:qe.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:qe.edgeLabel.style.fill,fontSize:qe.edgeLabel.style.fontSize,fontFamily:qe.windowFontFamily}},stateStyles:E({},qe.edgeStateStyles)},getPath:function(e){var t=[];return(0,ca.each)(e,function(n,i){i===0?t.push(["M",n.x,n.y]):t.push(["L",n.x,n.y])}),t},getShapeStyle:function(e){var t=this.options.style,n={stroke:e.color},i=(0,ca.mix)({},t,n,e.style),a=e.size||qe.defaultEdge.size;e=this.getPathPoints(e);var o=e.startPoint,s=e.endPoint,l=this.getControlPoints(e),u=[o];l&&(u=u.concat(l)),u.push(s);var f=this.getPath(u),c=(0,ca.mix)({},qe.defaultEdge.style,{stroke:qe.defaultEdge.color,lineWidth:a,path:f},i);return c},updateShapeStyle:function(e,t,n){var i,a=t.getContainer(),o=((i=t.getKeyShape)===null||i===void 0?void 0:i.call(t))||a.shapeMap["edge-shape"],s=e.size;e=this.getPathPoints(e);var l=e.startPoint,u=e.endPoint,f=this.getControlPoints(e),c=[l];f&&(c=c.concat(f)),c.push(u);var h=o.attr(),d=e.style||{};d.stroke===void 0&&(d.stroke=e.color);var p=e.sourceNode,v=e.targetNode,m={radius:d.radius};f||(m={source:p,target:v,offset:d.offset,radius:d.radius});var g=this.getPath(c,m),x={};n==="move"?x={path:g}:(h.endArrow&&d.endArrow===!1&&(e.style.endArrow={path:""}),h.startArrow&&d.startArrow===!1&&(e.style.startArrow={path:""}),x=E({},e.style),x.lineWidth===void 0&&(x.lineWdith=((0,ca.isNumber)(s)?s:s==null?void 0:s[0])||h.lineWidth),x.path===void 0&&(x.path=g),x.stroke===void 0&&(x.stroke=h.stroke||e.color)),o&&o.attr(x)},getLabelStyleByPosition:function(e,t,n){var i=t.position||this.labelPosition,a={},o=n==null?void 0:n.shapeMap[Ok],s;i==="start"?s=0:i==="end"?s=1:s=.5;var l=t.refX||this.refX,u=t.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return a.x=e.startPoint.x+l,a.y=e.startPoint.y+u,a.text=e.label,a;var f;(0,ca.isNil)(t.autoRotate)?f=this.labelAutoRotate:f=t.autoRotate;var c=kV(o,s,l,u,f);return a.x=c.x,a.y=c.y,a.rotate=c.rotate,a.textAlign=this._getTextAlign(i,c.angle),a.text=e.label,a},getLabelBgStyleByPosition:function(e,t){if(!e)return{};var n=e.getBBox(),i=t.style&&t.style.background;if(!i)return{};var a=i.padding,o=n.width+a[1]+a[3],s=n.height+a[0]+a[2],l=E(E({},i),{width:o,height:s,x:n.minX-a[3],y:n.minY-a[0],matrix:[1,0,0,0,1,0,0,0,1]}),u;return(0,ca.isNil)(t.autoRotate)?u=this.labelAutoRotate:u=t.autoRotate,u&&(l.matrix=e.attr("matrix")||[1,0,0,0,1,0,0,0,1]),l},_getTextAlign:function(e,t){var n="center";return t?(t=t%(Math.PI*2),e!=="center"&&(t>=0&&t<=Math.PI/2||t>=3/2*Math.PI&&t<2*Math.PI?n=e:n=VJt(e)),n):e},getControlPoints:function(e){return e.controlPoints},getPathPoints:function(e){return e},drawShape:function(e,t){var n=this.getShapeStyle(e),i=t.addShape("path",{className:Ok,name:Ok,attrs:n});return t.shapeMap[Ok]=i,i},drawLabel:function(e,t){var n=this.options.labelCfg,i=(0,ca.deepMix)({},n,e.labelCfg),a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,name:"text-shape",labelRelated:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""&&s.rotateAtStart(o),a.background){var l=this.drawLabelBg(e,t,s,a,o),u=this.itemType+Lk;l.set("classname",u),t.shapeMap[u]=l,s.toFront()}return s},drawLabelBg:function(e,t,n,i,a){var o=this.options.labelCfg,s=(0,ca.deepMix)({},o,e.labelCfg),l=this.getLabelBgStyleByPosition(n,s),u=t.addShape("rect",{name:"text-bg-shape",attrs:l,labelRelated:!0});return t.shapeMap["text-bg-shape"]=u,u}},YJt=E(E({},k_),HJt);zi.registerEdge("single-edge",YJt);zi.registerEdge("line",{getControlPoints:function(){}},"single-edge");zi.registerEdge("spline",{getPath:function(e){var t=QV(e);return t}},"single-edge");zi.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(e){var t=e.startPoint,n=e.endPoint,i={x:(t.x+n.x)/2,y:(t.y+n.y)/2},a,o;if(e.controlPoints!==void 0){if(o=e.controlPoints[0],a=lk(t,o,n),t.x<=n.x&&t.y>n.y?this.clockwise=a.x>o.x?0:1:t.x<=n.x&&t.yo.x?1:0:t.x>n.x&&t.y<=n.y?this.clockwise=a.yKJt});var KJt=["#5F95FF","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"];var ZJt=gr.transform,$Jt=E(E(E(E(E(E({},zV),NV),t8),IV),a8),{transform:ZJt,mat3:Ai}),ka=$Jt;var R_=z(q());var QJt=function(){function r(e){this.graph=e,this.layoutCfg=e.get("layout")||{},this.layoutType=this.getLayoutType(),this.layoutMethods=[],this.initLayout()}return r.prototype.initLayout=function(){},r.prototype.getLayoutType=function(){return this.getLayoutCfgType(this.layoutCfg)},r.prototype.getLayoutCfgType=function(e){var t=e.type;if(t)return t;var n=e.pipes;return Array.isArray(n)?n.map(function(i){return(i==null?void 0:i.type)||""}):null},r.prototype.isLayoutTypeSame=function(e){var t=this.getLayoutCfgType(e);return Array.isArray(this.layoutType)?this.layoutType.every(function(n,i){return n===t[i]}):(e==null?void 0:e.type)===this.layoutType},r.prototype.refreshLayout=function(){var e=this.graph;!e||(e.get("animate")?e.positionsAnimate():e.refreshPositions())},r.prototype.changeLayout=function(e){this.layoutCfg=e,this.destoryLayoutMethods(),this.layout()},r.prototype.changeData=function(){this.destoryLayoutMethods(),this.layout()},r.prototype.destoryLayoutMethods=function(){var e=this.layoutMethods;e==null||e.forEach(function(t){t.destroy()}),this.layoutMethods=[]},r.prototype.destroyLayout=function(){var e=this.graph;this.destoryLayoutMethods(),e.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0},r.prototype.setDataFromGraph=function(){for(var e=[],t=[],n=[],i=[],a=[],o=[],s=[],l=this.graph.getNodes(),u=this.graph.getEdges(),f=this.graph.getCombos(),c=l.length,h=0;hQre,getColorsWithSubjectColor:()=>mR,mixColor:()=>Io});var U_=z(fpt());var vM=z(cpt()),vR=2,hpt=.16,Yre=.05,Xre=.05,qre=.15,dpt=5,ppt=4,Kre=[{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 vpt(r,e,t){var n;return Math.round(r.h)>=60&&Math.round(r.h)<=240?n=t?Math.round(r.h)-vR*e:Math.round(r.h)+vR*e:n=t?Math.round(r.h)+vR*e:Math.round(r.h)-vR*e,n<0?n+=360:n>=360&&(n-=360),n}function mpt(r,e,t){if(r.h===0&&r.s===0)return r.s;var n;return t?n=r.s-hpt*e:e===ppt?n=r.s+hpt:n=r.s+Yre*e,n>1&&(n=1),t&&e===dpt&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function gpt(r,e,t){var n;return t?n=r.v+Xre*e:n=r.v-qre*e,n>1&&(n=1),Number(n.toFixed(2))}function mM(r){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=(0,vM.default)(r),i=dpt;i>0;i-=1){var a=n.toHsv(),o=(0,vM.default)({h:vpt(a,i,!0),s:mpt(a,i,!0),v:gpt(a,i,!0)}).toHexString();t.push(o)}t.push(n.toHexString());for(var s=1;s<=ppt;s+=1){var l=n.toHsv(),u=(0,vM.default)({h:vpt(l,s),s:mpt(l,s),v:gpt(l,s)}).toHexString();t.push(u)}return e.theme==="dark"?Kre.map(function(f){var c=f.index,h=f.opacity,d=vM.default.mix(e.backgroundColor||"#141414",t[c],h*100).toHexString();return d}):t}var I8={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"},Rs={},L8={};Object.keys(I8).forEach(function(r){Rs[r]=mM(I8[r]),Rs[r].primary=Rs[r][5],L8[r]=mM(I8[r],{theme:"dark",backgroundColor:"#141414"}),L8[r].primary=L8[r][5]});var DSr=Rs.red,PSr=Rs.volcano,kSr=Rs.gold,RSr=Rs.orange,NSr=Rs.yellow,FSr=Rs.lime,BSr=Rs.green,GSr=Rs.cyan,zSr=Rs.blue,USr=Rs.geekblue,jSr=Rs.purple,WSr=Rs.magenta,VSr=Rs.grey;var Io=function(e,t,n){var i=(0,U_.default)(e),a=(0,U_.default)(t);return(0,U_.default)([(1-n)*i.red()+n*a.red(),(1-n)*i.green()+n*a.green(),(1-n)*i.blue()+n*a.blue()]).rgb()},Zre=function(e,t,n){t===void 0&&(t="#fff"),n===void 0&&(n="rgb(150, 150, 150)");var i=Io(t,e,.05).rgb().toString(),a=Io(t,e,.1).rgb().toString(),o=Io(t,e,.2).rgb().toString(),s=Io(t,e,.4).rgb().toString(),l=Io(t,n,.02).rgb().toString(),u=Io(t,n,.05).rgb().toString(),f=Io(t,n,.1).rgb().toString(),c=Io(t,n,.2).rgb().toString(),h=Io(t,n,.3).rgb().toString(),d=mM(e,{theme:"default",backgroundColor:t}),p=(0,U_.default)(e).hex().toLowerCase(),v=d.indexOf(p),m=e;return v!==-1&&(m=d[v+1]),{mainStroke:e,mainFill:a,activeStroke:e,activeFill:i,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:t,highlightStroke:m,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:h,edgeActiveStroke:e,edgeInactiveStroke:c,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:f,comboMainStroke:h,comboMainFill:l,comboActiveStroke:e,comboActiveFill:i,comboInactiveStroke:h,comboInactiveFill:l,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:m,comboHighlightFill:l,comboDisableStroke:c,comboDisableFill:u}},$re=function(e,t,n){t===void 0&&(t="#fff"),n===void 0&&(n="#777");var i=Io(t,e,.2).rgb().toString(),a=Io(t,e,.3).rgb().toString(),o=Io(t,e,.6).rgb().toString(),s=Io(t,e,.8).rgb().toString(),l=Io(t,n,.2).rgb().toString(),u=Io(t,n,.25).rgb().toString(),f=Io(t,n,.3).rgb().toString(),c=Io(t,n,.4).rgb().toString(),h=Io(t,n,.5).rgb().toString(),d=mM(e,{theme:"dark",backgroundColor:t}),p=(0,U_.default)(e).hex().toLowerCase(),v=d.indexOf(p),m=e;return v!==-1&&(m=d[v+1]),{mainStroke:s,mainFill:i,activeStroke:e,activeFill:a,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:i,highlightStroke:e,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:n,edgeActiveStroke:e,edgeInactiveStroke:n,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:f,comboMainStroke:c,comboMainFill:u,comboActiveStroke:e,comboActiveFill:l,comboInactiveStroke:c,comboInactiveFill:u,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:m,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:l}},mR=function(e,t,n,i){return t===void 0&&(t="#fff"),n===void 0&&(n="default"),i===void 0&&(i="rgb(150, 150, 150)"),n==="default"?Zre(e,t,"rgb(150, 150, 150)"):$re(e,t,"#777")},Qre=function(e,t,n,i){t===void 0&&(t="#fff"),n===void 0&&(n="default"),i===void 0&&(i="rgb(150, 150, 150)");var a=[];return e.forEach(function(o){a.push(mR(o,t,n,i))}),a};var Jre="rgb(95, 149, 255)",tne="rgb(255, 255, 255)",ypt="rgb(0, 0, 0)",Rn=mR(Jre,tne),_c={version:"0.5.3",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:Rn.mainStroke,fill:Rn.mainFill},size:20,color:Rn.mainStroke,linkPoints:{size:8,lineWidth:1,fill:Rn.activeFill,stroke:Rn.activeStroke}},nodeStateStyles:{active:{fill:Rn.activeFill,stroke:Rn.activeStroke,lineWidth:2,shadowColor:Rn.mainStroke,shadowBlur:10},selected:{fill:Rn.selectedFill,stroke:Rn.selectedStroke,lineWidth:4,shadowColor:Rn.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:Rn.highlightFill,stroke:Rn.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:Rn.inactiveFill,stroke:Rn.inactiveStroke,lineWidth:1},disable:{fill:Rn.disableFill,stroke:Rn.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:ypt,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:Rn.edgeMainStroke,lineAppendWidth:2},color:Rn.edgeMainStroke},edgeStateStyles:{active:{stroke:Rn.edgeActiveStroke,lineWidth:1},selected:{stroke:Rn.edgeSelectedStroke,lineWidth:2,shadowColor:Rn.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Rn.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:Rn.edgeInactiveStroke,lineWidth:1},disable:{stroke:Rn.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:ypt,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Rn.comboMainFill,lineWidth:1,stroke:Rn.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:Rn.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:Rn.comboActiveStroke,lineWidth:1,fill:Rn.comboActiveFill},selected:{stroke:Rn.comboSelectedStroke,lineWidth:2,fill:Rn.comboSelectedFill,shadowColor:Rn.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Rn.comboHighlightStroke,lineWidth:2,fill:Rn.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:Rn.comboInactiveStroke,fill:Rn.comboInactiveFill,lineWidth:1},disable:{stroke:Rn.comboDisableStroke,fill:Rn.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"};var yg=z(q());var ene=ka.cloneEvent,rne=ka.isViewportChanged,nne=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.extendEvents=[],n.dragging=!1,n.preItem=null,n.graph=t,n.destroyed=!1,n.initEvents(),n}return e.prototype.initEvents=function(){var t=this,n=t.graph,i=t.extendEvents,a=i===void 0?[]:i,o=n.get("canvas"),s=o.get("el"),l=(0,yg.wrapBehavior)(this,"onCanvasEvents"),u=(0,yg.wrapBehavior)(this,"onExtendEvents"),f=(0,yg.wrapBehavior)(this,"onWheelEvent");o.off("*").on("*",l),this.canvasHandler=l,a.push(Ws(s,"DOMMouseScroll",f)),a.push(Ws(s,"mousewheel",f)),typeof window!="undefined"&&(a.push(Ws(window,"keydown",u)),a.push(Ws(window,"keyup",u)),a.push(Ws(window,"focus",u)))},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var n=this.graph,i=n.get("canvas"),a=t.target,o=t.type;t.canvasX=t.x,t.canvasY=t.y;var s={x:t.canvasX,y:t.canvasY},l=n.get("group"),u=l.getMatrix();if(u||(u=[1,0,0,0,1,0,0,0,1]),rne(u)&&(s=n.getPointByClient(t.clientX,t.clientY)),t.x=s.x,t.y=s.y,t.currentTarget=n,a===i){(o==="mousemove"||o==="mouseleave")&&this.handleMouseMove(t,"canvas"),t.target=i,t.item=null,n.emit(o,t),n.emit("canvas:".concat(o),t);return}var f=e.getItemRoot(a);if(!f){n.emit(o,t);return}var c=f.get("item");if(!c.destroyed){var h=c.getType();if(t.target=a,t.item=c,t.canvasX===t.x&&t.canvasY===t.y){var d=n.getCanvasByPoint(t.x,t.y);t.canvasX=d.x,t.canvasY=d.y}n.emit(o,t),t.name&&!t.name.includes(":")?n.emit("".concat(h,":").concat(o),t):n.emit(t.name,t),o==="dragstart"&&(this.dragging=!0),o==="dragend"&&(this.dragging=!1),o==="mousemove"&&this.handleMouseMove(t,h)}},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){(0,yg.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,n){var i=this,a=i.graph,o=i.preItem,s=a.get("canvas"),l=t.target===s?null:t.item;t=ene(t),o&&o!==l&&!o.destroyed&&(t.item=o,this.emitCustomEvent(o.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(o.getType(),"dragleave",t)),l&&o!==l&&(t.item=l,this.emitCustomEvent(n,"mouseenter",t),this.dragging&&this.emitCustomEvent(n,"dragenter",t)),this.preItem=l},e.prototype.emitCustomEvent=function(t,n,i){i.type=n,this.graph.emit("".concat(t,":").concat(n),i)},e.prototype.destroy=function(){var t=this,n=t.graph,i=t.canvasHandler,a=t.extendEvents,o=n.get("canvas");o.off("*",i),(0,yg.each)(a,function(s){s.remove()}),this.dragging=!1,this.preItem=null,this.extendEvents.length=0,this.canvasHandler=null,this.destroyed=!0},e}(kk),D8=nne;var li=class{constructor(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=()=>{}}layout(e){return this.init(e),this.execute(!0)}init(e){this.nodes=e.nodes||[],this.edges=e.edges||[],this.combos=e.combos||[]}execute(e){}executeWithWorker(){}getDefaultCfg(){return{}}updateCfg(e){e&&Object.assign(this,e)}getType(){return"base"}destroy(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0}};var xg=r=>typeof r=="string",ine=r=>{let e=Object.create(null);return t=>e[t]||(e[t]=r(t))},ane=/-(\w)/g,tCr=ine(r=>r.replace(ane,(e,t)=>t?t.toUpperCase():""));var da=Array.isArray;var je=r=>typeof r=="number",gM=r=>Number.isNaN(Number(r));var po=r=>r!==null&&typeof r=="object",U0=r=>{if(r===null)return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof Array){let e=[];return r.forEach(t=>{e.push(t)}),e.map(t=>U0(t))}if(typeof r=="object"&&r!=={}){let e=Object.assign({},r);return Object.keys(e).forEach(t=>{e[t]=U0(e[t])}),e}return r};var xn=(r,e)=>{let t=r[e];return po(t)?t.cell:t},Qh=(r,e,t)=>{let n=[];for(let i=0;i{let a=xn(i,"source"),o=xn(i,"target");a&&(n[e[a]]+=1),o&&(n[e[o]]+=1)}),n},gR=r=>{let e=[],t=r.length;for(let n=0;ne[i][n]+e[n][a]&&(e[i][a]=e[i][n]+e[n][a]);return e},yR=(r,e)=>{let{nodes:t,edges:n}=r,i=[],a={};if(!t)throw new Error("invalid nodes data!");return t&&t.forEach((o,s)=>{a[o.id]=s;let l=[];i.push(l)}),n&&n.forEach(o=>{let s=xn(o,"source"),l=xn(o,"target"),u=a[s],f=a[l];i[u][f]=1,e||(i[f][u]=1)}),i},xpt=(r,e)=>{let t=[];return r.forEach(n=>{let i=[];n.forEach(a=>{i.push(a*e)}),t.push(i)}),t},bpt=(r,e)=>{if(r&&r.children){for(let t=r.children.length-1;t>=0;t--)if(!bpt(r.children[t],e))return}return!!e(r)},yM=(r,e)=>{typeof e=="function"&&bpt(r,e)};var gf=r=>typeof r=="function";var xR=new Map,hs=(r,e)=>{if(xR.get(r)&&console.warn(`The layout with the name ${r} exists already, it will be overridden`),po(e)){class t extends li{constructor(i){super();let a=this,o={},s=a.getDefaultCfg();Object.assign(o,s,e,i),Object.keys(o).forEach(l=>{let u=o[l];a[l]=u})}}xR.set(r,t)}else xR.set(r,e);return xR.get(r)};var j_=class extends li{constructor(e){super();this.begin=[0,0],this.preventOverlap=!0,this.preventOverlapPadding=10,this.condense=!1,this.sortBy="degree",this.nodeSize=30,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.row=0,this.col=0,this.cellWidth=0,this.cellHeight=0,this.cellUsed={},this.id2manPos={},this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}}execute(){let e=this,t=e.nodes,n=e.edges,i=t.length,a=e.begin;if(i===0)return e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n};if(i===1)return t[0].x=a[0],t[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n};let o=[];t.forEach(f=>{o.push(f)});let s={};if(o.forEach((f,c)=>{s[f.id]=c}),(e.sortBy==="degree"||!xg(e.sortBy)||o[0][e.sortBy]===void 0)&&(e.sortBy="degree",gM(t[0].degree))){let f=Qh(o.length,s,n);o.forEach((c,h)=>{c.degree=f[h]})}o.sort((f,c)=>c[e.sortBy]-f[e.sortBy]),!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight);let l=e.rows,u=e.cols!=null?e.cols:e.columns;if(e.cells=i,l!=null&&u!=null?(e.rows=l,e.cols=u):l!=null&&u==null?(e.rows=l,e.cols=Math.ceil(e.cells/e.rows)):l==null&&u!=null?(e.cols=u,e.rows=Math.ceil(e.cells/e.cols)):(e.splits=Math.sqrt(e.cells*e.height/e.width),e.rows=Math.round(e.splits),e.cols=Math.round(e.width/e.height*e.splits)),e.cols*e.rows>e.cells){let f=e.small(),c=e.large();(f-1)*c>=e.cells?e.small(f-1):(c-1)*f>=e.cells&&e.large(c-1)}else for(;e.cols*e.rows=e.cells?e.large(c+1):e.small(f+1)}e.cellWidth=e.width/e.cols,e.cellHeight=e.height/e.rows,e.condense&&(e.cellWidth=0,e.cellHeight=0),e.preventOverlap&&o.forEach(f=>{(!f.x||!f.y)&&(f.x=0,f.y=0);let c,h;da(f.size)?(c=f.size[0],h=f.size[1]):je(f.size)?(c=f.size,h=f.size):po(f.size)&&(c=f.size.width,h=f.size.height),(c===void 0||h===void 0)&&(da(e.nodeSize)?(c=e.nodeSize[0],h=e.nodeSize[1]):je(e.nodeSize)?(c=e.nodeSize,h=e.nodeSize):(c=30,h=30));let d=e.preventOverlapPadding,p=c+d,v=h+d;e.cellWidth=Math.max(e.cellWidth,p),e.cellHeight=Math.max(e.cellHeight,v)}),e.cellUsed={},e.row=0,e.col=0,e.id2manPos={};for(let f=0;f=t&&(e.col=0,e.row++)}getPos(e){let t=this,n=t.begin,i=t.cellWidth,a=t.cellHeight,o,s,l=t.id2manPos[e.id];if(l)o=l.col*i+i/2+n[0],s=l.row*a+a/2+n[1];else{for(;t.used(t.row,t.col);)t.moveToNextCell();o=t.col*i+i/2+n[0],s=t.row*a+a/2+n[1],t.use(t.row,t.col),t.moveToNextCell()}e.x=o,e.y=s}getType(){return"grid"}};var W_=class extends li{constructor(e){super();this.center=[0,0],this.width=300,this.height=300,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{center:[0,0],width:300,height:300}}execute(){let e=this,t=e.nodes,n=.9,i=e.center;return!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),t&&t.forEach(a=>{a.x=(Math.random()-.5)*n*e.width+i[0],a.y=(Math.random()-.5)*n*e.height+i[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:this.edges}}getType(){return"random"}};var P8=(r,e)=>{let t;return r?je(r)?t=n=>r:t=r:t=n=>e||1,t},V_=class extends li{constructor(e){super();this.maxIteration=1e3,this.workerEnabled=!1,this.edgeStrength=200,this.nodeStrength=1e3,this.coulombDisScale=.005,this.damping=.9,this.maxSpeed=1e3,this.minMovement=.5,this.interval=.02,this.factor=1,this.linkDistance=1,this.gravity=10,this.preventOverlap=!0,this.tick=()=>{},this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:500,gravity:10,enableTick:!0}}execute(){var e,t;let n=this,i=n.nodes;if(n.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(n.timeInterval),!i||i.length===0){(e=n.onLayoutEnd)===null||e===void 0||e.call(n);return}!n.width&&typeof window!="undefined"&&(n.width=window.innerWidth),!n.height&&typeof window!="undefined"&&(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);let a=n.center;if(i.length===1){i[0].x=a[0],i[0].y=a[1],(t=n.onLayoutEnd)===null||t===void 0||t.call(n);return}let o={},s={};i.forEach((c,h)=>{je(c.x)||(c.x=Math.random()*n.width),je(c.y)||(c.y=Math.random()*n.height),o[c.id]=c,s[c.id]=h}),n.nodeMap=o,n.nodeIdxMap=s,n.linkDistance=P8(n.linkDistance,1),n.nodeStrength=P8(n.nodeStrength,1),n.edgeStrength=P8(n.edgeStrength,1);let l=n.nodeSize,u;if(n.preventOverlap){let c=n.nodeSpacing,h;je(c)?h=()=>c:gf(c)?h=c:h=()=>0,l?da(l)?u=d=>(l[0]>l[1]?l[0]:l[1])+h(d):u=d=>l+h(d):u=d=>d.size?da(d.size)?(d.size[0]>d.size[1]?d.size[0]:d.size[1])+h(d):po(d.size)?(d.size.width>d.size.height?d.size.width:d.size.height)+h(d):d.size+h(d):10+h(d)}n.nodeSize=u;let f=n.edges;n.degrees=Qh(i.length,n.nodeIdxMap,f),n.getMass||(n.getMass=c=>n.degrees[n.nodeIdxMap[c.id]]||1),n.run()}run(){var e;let t=this,{maxIteration:n,nodes:i,workerEnabled:a,minMovement:o}=t;if(!!i)if(a){for(let s=0;s{var l,u;if(!i)return;let f=t.runOneStep(s)||[];t.reachMoveThreshold(i,f,o)&&((l=t.onLayoutEnd)===null||l===void 0||l.call(t),window.clearInterval(t.timeInterval)),s++,s>=n&&((u=t.onLayoutEnd)===null||u===void 0||u.call(t),window.clearInterval(t.timeInterval))},0)}}reachMoveThreshold(e,t,n){let i=0;return e.forEach((a,o)=>{let s=a.x-t[o].x,l=a.y-t[o].y;i+=Math.sqrt(s*s+l*l)}),i/=e.length,i{o[2*c]=0,o[2*c+1]=0,s[2*c]=0,s[2*c+1]=0}),n.calRepulsive(o,i),a&&n.calAttractive(o,a),n.calGravity(o,i);let l=Math.max(.02,n.interval-e*.002);n.updateVelocity(o,s,l,i);let u=[];return i.forEach(f=>{u.push({x:f.x,y:f.y})}),n.updatePosition(s,l,i),(t=n.tick)===null||t===void 0||t.call(n),u}calRepulsive(e,t){let n=this,i=n.getMass,a=n.nodeStrength,o=n.factor,s=n.coulombDisScale,l=n.preventOverlap,u=n.nodeSize;t.forEach((f,c)=>{let h=i?i(f):1;t.forEach((d,p)=>{if(c>=p)return;let v=f.x-d.x,m=f.y-d.y,g=Math.sqrt(v*v+m*m)+.01,x=(g+.1)*s,b=v/g,S=m/g,C=(a(f)+a(d))/2*o/(x*x),w=i?i(d):1;if(e[2*c]+=b*C,e[2*c+1]+=S*C,e[2*p]-=b*C,e[2*p+1]-=S*C,l&&g<(u(f)+u(d))/2){let A=(a(f)+a(d))/2/(g*g);e[2*c]+=b*A/h,e[2*c+1]+=S*A/h,e[2*p]-=b*A/w,e[2*p+1]-=S*A/w}})})}calAttractive(e,t){let n=this,i=n.nodeMap,a=n.nodeIdxMap,o=n.linkDistance,s=n.edgeStrength,l=n.getMass;t.forEach((u,f)=>{let c=xn(u,"source"),h=xn(u,"target"),d=i[c],p=i[h],v=p.x-d.x,m=p.y-d.y,g=Math.sqrt(v*v+m*m)+.01,x=v/g,b=m/g,w=((o(u)||1)-g)*s(u),A=a[c],L=a[h],k=l?l(d):1,O=l?l(p):1;e[2*A]-=x*w/k,e[2*A+1]-=b*w/k,e[2*L]+=x*w/O,e[2*L+1]+=b*w/O})}calGravity(e,t){let n=this,i=n.center,a=n.gravity,o=n.degrees,s=t.length;for(let l=0;l{let u=e[2*l]*o||.01,f=e[2*l+1]*o||.01,c=Math.sqrt(u*u+f*f);if(c>a.maxSpeed){let h=a.maxSpeed/c;u=h*u,f=h*f}t[2*l]=u,t[2*l+1]=f})}updatePosition(e,t,n){n.forEach((i,a)=>{if(je(i.fx)&&je(i.fy)){i.x=i.fx,i.y=i.fy;return}let o=e[2*a]*t,s=e[2*a+1]*t;i.x+=o,i.y+=s})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)}destroy(){let e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0}getType(){return"gForce"}};function xM(r,e){var t,n=1;r==null&&(r=0),e==null&&(e=0);function i(){var a,o=t.length,s,l=0,u=0;for(a=0;a=(c=(s+u)/2))?s=c:u=c,(m=t>=(h=(l+f)/2))?l=h:f=h,i=a,!(a=a[g=m<<1|v]))return i[g]=o,r;if(d=+r._x.call(null,a.data),p=+r._y.call(null,a.data),e===d&&t===p)return o.next=a,i?i[g]=o:r._root=o,r;do i=i?i[g]=new Array(4):r._root=new Array(4),(v=e>=(c=(s+u)/2))?s=c:u=c,(m=t>=(h=(l+f)/2))?l=h:f=h;while((g=m<<1|v)==(x=(p>=h)<<1|d>=c));return i[x]=a,i[g]=o,r}function Cpt(r){var e,t,n=r.length,i,a,o=new Array(n),s=new Array(n),l=1/0,u=1/0,f=-1/0,c=-1/0;for(t=0;tf&&(f=i),ac&&(c=a));if(l>f||u>c)return this;for(this.cover(l,u).cover(f,c),t=0;tr||r>=i||n>e||e>=a;)switch(u=(ef||(s=p.y0)>c||(l=p.x1)=g)<<1|r>=m)&&(p=h[h.length-1],h[h.length-1]=h[h.length-1-v],h[h.length-1-v]=p)}else{var x=r-+this._x.call(null,d.data),b=e-+this._y.call(null,d.data),S=x*x+b*b;if(S=(h=(o+l)/2))?o=h:l=h,(v=c>=(d=(s+u)/2))?s=d:u=d,e=t,!(t=t[m=v<<1|p]))return this;if(!t.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(n=e,g=m)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,i?(a?i.next=a:delete i.next,this):e?(a?e[m]=a:delete e[m],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[g]=t:this._root=t),this):(this._root=a,this)}function Ipt(r){for(var e=0,t=r.length;eh.index){var M=d-L.x-L.vx,I=p-L.y-L.vy,R=M*M+I*I;Rd+O||wp+O||Au.r&&(u.r=u[f].r)}function l(){if(!!e){var u,f=e.length,c;for(t=new Array(f),u=0;u[e(C,w,o),C])),S;for(m=0,s=new Array(g);m{}};function zpt(){for(var r=0,e=arguments.length,t={},n;r=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}bR.prototype=zpt.prototype={constructor:bR,on:function(r,e){var t=this._,n=fne(r+"",t),i,a=-1,o=n.length;if(arguments.length<2){for(;++a0)for(var t=new Array(i),n=0,i,a;n(r=(hne*r+dne)%jpt)/jpt}function Vpt(r){return r.x}function Hpt(r){return r.y}var pne=10,vne=Math.PI*(3-Math.sqrt(5));function W0(r){var e,t=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=new Map,l=xb(c),u=R8("tick","end"),f=Wpt();r==null&&(r=[]);function c(){h(),u.call("tick",e),t1?(m==null?s.delete(v):s.set(v,p(m)),e):s.get(v)},find:function(v,m,g){var x=0,b=r.length,S,C,w,A,L;for(g==null?g=1/0:g*=g,x=0;x1?(u.on(v,m),e):u.on(v)}}}function V0(){var r,e,t,n,i=vo(-30),a,o=1,s=1/0,l=.81;function u(d){var p,v=r.length,m=j0(r,Vpt,Hpt).visitAfter(c);for(n=d,p=0;p=s)return;(d.data!==e||d.next)&&(g===0&&(g=Sc(t),S+=g*g),x===0&&(x=Sc(t),S+=x*x),S$}let e=$=>$.cluster,t=r(1),n=r(-1),i=r(100),a=r(.1),o=[0,0],s=[],l={},u=[],f=100,c=100,h={none:{x:0,y:0}},d=[],p,v="force",m=!0,g=.1;function x($){if(!m)return x;p.tick(),L();for(let st=0,_t=s.length,dt,gt=$*g;st<_t;++st)dt=s[st],dt.vx+=(h[e(dt)].x-dt.x)*gt,dt.vy+=(h[e(dt)].y-dt.y)*gt}function b(){!s||S()}function S(){if(!s||!s.length)return;if(e(s[0])===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");let $=C();p=W0($.nodes).force("x",_M(f).strength(.1)).force("y",SM(c).strength(.1)).force("collide",bM(st=>st.r).iterations(4)).force("charge",V0().strength(n)).force("links",bg($.nodes.length?$.links:[]).distance(i).strength(a)),d=p.nodes(),L()}function C(){let $=[],st=[],_t={},dt=[],gt={},Tt=[];return gt=w(s),Tt=A(u),dt=Object.keys(gt),dt.forEach((Ut,$t)=>{let Y=gt[Ut];$.push({id:Ut,size:Y.count,r:Math.sqrt(Y.sumforceNodeSize/Math.PI)}),_t[Ut]=$t}),Tt.forEach(Ut=>{let $t=xn(Ut,"source"),Y=xn(Ut,"target"),it=_t[$t],K=_t[Y];it!==void 0&&K!==void 0&&st.push({source:it,target:K,count:Ut.count})}),{nodes:$,links:st}}function w($){let st={};return $.forEach(_t=>{let dt=e(_t);st[dt]||(st[dt]={count:0,sumforceNodeSize:0})}),$.forEach(_t=>{let dt=e(_t),gt=t(_t),Tt=st[dt];Tt.count=Tt.count+1,Tt.sumforceNodeSize=Tt.sumforceNodeSize+Math.PI*(gt*gt)*1.3,st[dt]=Tt}),st}function A($){let st={},_t=[];return $.forEach(gt=>{let Tt=k(gt),Ut=0;st[Tt]!==void 0&&(Ut=st[Tt]),Ut+=1,st[Tt]=Ut}),Object.entries(st).forEach(([gt,Tt])=>{let Ut=gt.split("~")[0],$t=gt.split("~")[1];Ut!==void 0&&$t!==void 0&&_t.push({source:Ut,target:$t,count:Tt})}),_t}function L(){return h={none:{x:0,y:0}},d.forEach($=>{h[$.id]={x:$.x-o[0],y:$.y-o[1]}}),h}function k($){let st=xn($,"source"),_t=xn($,"target"),dt=e(l[st]),gt=e(l[_t]);return dt<=gt?`${dt}~${gt}`:`${gt}~${dt}`}function O($){l={},$.forEach(st=>{l[st.id]=st})}function M($){return arguments.length?(v=$,b(),x):v}function I($){return arguments.length?typeof $=="string"?(e=st=>st[$],x):(e=$,x):e}function R($){return arguments.length?(m=$,x):m}function P($){return arguments.length?(g=$,x):g}function F($){return arguments.length?(f=$,x):f}function D($){return arguments.length?(c=$,x):c}function G($){return arguments.length?(O($||[]),s=$||[],x):s}function U($){return arguments.length?(u=$||[],b(),x):u}function j($){return arguments.length?(typeof $=="function"?t=$:t=r(+$),b(),x):t}function H($){return arguments.length?(typeof $=="function"?n=$:n=r(+$),b(),x):n}function tt($){return arguments.length?(typeof $=="function"?i=$:i=r(+$),b(),x):i}function et($){return arguments.length?(typeof $=="function"?a=$:a=r(+$),b(),x):a}function ut($){return arguments.length?(o=$,x):o}return x.initialize=$=>{s=$,b()},x.template=M,x.groupBy=I,x.enableGrouping=R,x.strength=P,x.centerX=F,x.centerY=D,x.nodes=G,x.links=U,x.forceNodeSize=j,x.nodeSize=x.forceNodeSize,x.forceCharge=H,x.forceLinkDistance=tt,x.forceLinkStrength=et,x.offset=ut,x.getFocis=L,x}var H_={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};var Y_=class extends li{constructor(e){super();this.center=[0,0],this.nodeStrength=null,this.edgeStrength=null,this.preventOverlap=!1,this.clusterNodeStrength=null,this.clusterEdgeStrength=null,this.clusterEdgeDistance=null,this.clusterNodeSize=null,this.clusterFociStrength=null,this.linkDistance=50,this.alphaDecay=.028,this.alphaMin=.001,this.alpha=.3,this.collideStrength=1,this.workerEnabled=!1,this.tick=()=>{},this.onLayoutEnd=()=>{},this.ticking=void 0,e&&this.updateCfg(e)}getDefaultCfg(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick(){},onLayoutEnd(){},workerEnabled:!1}}init(e){let t=this;t.nodes=e.nodes||[];let n=e.edges||[];t.edges=n.map(i=>{let a={},o=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(i).forEach(s=>{o.indexOf(s)>-1||(a[s]=i[s])}),a}),t.ticking=!1}execute(e){let t=this,n=t.nodes,i=t.edges;if(t.ticking)return;let a=t.forceSimulation,o=t.alphaMin,s=t.alphaDecay,l=t.alpha;if(a){if(e){if(t.clustering&&t.clusterForce&&(t.clusterForce.nodes(n),t.clusterForce.links(i)),a.nodes(n),i&&t.edgeForce)t.edgeForce.links(i);else if(i&&!t.edgeForce){let u=bg().id(f=>f.id).links(i);t.edgeStrength&&u.strength(t.edgeStrength),t.linkDistance&&u.distance(t.linkDistance),t.edgeForce=u,a.force("link",u)}}t.preventOverlap&&t.overlapProcess(a),a.alpha(l).restart(),this.ticking=!0}else try{let u=V0();if(t.nodeStrength&&u.strength(t.nodeStrength),a=W0().nodes(n),t.clustering){let f=N8();f.centerX(t.center[0]).centerY(t.center[1]).template("force").strength(t.clusterFociStrength),i&&f.links(i),n&&f.nodes(n),f.forceLinkDistance(t.clusterEdgeDistance).forceLinkStrength(t.clusterEdgeStrength).forceCharge(t.clusterNodeStrength).forceNodeSize(t.clusterNodeSize),t.clusterForce=f,a.force("group",f)}if(a.force("center",xM(t.center[0],t.center[1])).force("charge",u).alpha(l).alphaDecay(s).alphaMin(o),t.preventOverlap&&t.overlapProcess(a),i){let f=bg().id(c=>c.id).links(i);t.edgeStrength&&f.strength(t.edgeStrength),t.linkDistance&&f.distance(t.linkDistance),t.edgeForce=f,a.force("link",f)}if(t.workerEnabled&&!gne()&&(t.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!t.workerEnabled)a.on("tick",()=>{t.tick()}).on("end",()=>{t.ticking=!1,t.onLayoutEnd&&t.onLayoutEnd()}),t.ticking=!0;else{a.stop();let f=mne(a);for(let c=1;c<=f;c++)a.tick(),postMessage({nodes:n,currentTick:c,totalTicks:f,type:H_.TICK},void 0);t.ticking=!1}t.forceSimulation=a,t.ticking=!0}catch(u){t.ticking=!1,console.warn(u)}}overlapProcess(e){let t=this,n=t.nodeSize,i=t.nodeSpacing,a,o,s=t.collideStrength;if(je(i)?o=()=>i:gf(i)?o=i:o=()=>0,!n)a=l=>l.size?da(l.size)?(l.size[0]>l.size[1]?l.size[0]:l.size[1])/2+o(l):po(l.size)?(l.size.width>l.size.height?l.size.width:l.size.height)/2+o(l):l.size/2+o(l):10+o(l);else if(gf(n))a=l=>n(l)+o(l);else if(da(n)){let u=(n[0]>n[1]?n[0]:n[1])/2;a=f=>u+o(f)}else if(je(n)){let l=n/2;a=u=>l+o(u)}else a=()=>10;e.force("collisionForce",bM(a).strength(s))}updateCfg(e){let t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.forceSimulation=null,Object.assign(t,e)}destroy(){let e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.nodes=null,e.edges=null,e.destroyed=!0}};function mne(r){let e=r.alphaMin(),t=r.alphaTarget(),n=r.alpha(),i=Math.log((e-t)/(n-t))/Math.log(1-r.alphaDecay());return Math.ceil(i)}function gne(){return typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope}function yne(r,e,t,n){r.forEach((i,a)=>{r[a].children=[],r[a].parent=[]}),n?e.forEach(i=>{let a=xn(i,"source"),o=xn(i,"target"),s=0;a&&(s=t[a]);let l=0;o&&(l=t[o]);let u=r[s].children,f=r[l].parent;u.push(r[l].id),f.push(r[s].id)}):e.forEach(i=>{let a=xn(i,"source"),o=xn(i,"target"),s=0;a&&(s=t[a]);let l=0;o&&(l=t[o]);let u=r[s].children,f=r[l].children;u.push(r[l].id),f.push(r[s].id)})}function xne(r,e,t){let n=t.length;for(let i=0;in?1:0}var X_=class extends li{constructor(e){super();this.radius=null,this.startRadius=null,this.endRadius=null,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.divisions=1,this.ordering=null,this.angleRatio=1,this.nodes=[],this.edges=[],this.nodeMap={},this.degrees=[],this.width=300,this.height=300,this.updateCfg(e)}getDefaultCfg(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}}execute(){let e=this,t=e.nodes,n=e.edges,i=t.length;if(i===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let a=e.center;if(i===1){t[0].x=a[0],t[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd();return}let o=e.radius,s=e.startRadius,l=e.endRadius,u=e.divisions,f=e.startAngle,c=e.endAngle,h=(c-f)/i,d={};t.forEach((C,w)=>{d[C.id]=w}),e.nodeMap=d;let p=Qh(t.length,d,n);e.degrees=p,!o&&!s&&!l?o=e.height>e.width?e.width/2:e.height/2:!s&&l?s=l:s&&!l&&(l=s);let v=e.angleRatio,m=h*v,g=e.ordering,x=[];g==="topology"?x=e.topologyOrdering():g==="topology-directed"?x=e.topologyOrdering(!0):g==="degree"?x=e.degreeOrdering():x=t;let b=e.clockwise,S=Math.ceil(i/u);for(let C=0;C{if(p!==0)if((p===c-1||n[p]!==n[p+1]||xne(l[h],d,i))&&!f[p])l.push(d),u.push(a[s[d.id]]),f[p]=!0,h++;else{let v=l[h].children,m=!1;for(let x=0;x{a.degree=i[o],n.push(a)}),n.sort(bne),n}getType(){return"circular"}};var Nvt=z(Rvt()),V8=Nvt.default;!V8&&typeof window!="undefined"&&(V8=window.graphlib);Array.prototype.flat||(Array.prototype.flat=function(r){let e=r||1;if(!isFinite(e))return;let t=this.length,n=[];if(this.length===0)return this;for(;e--;){let i=[],a=!1;if(n.length===0){a=!0;for(let o=0;o{r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev},tie=(r,e)=>{if(r!=="_next"&&r!=="_prev")return e},Bvt=class{constructor(){let e={};e._next=e._prev=e,this.isentinel=e}dequeue(){let e=this.isentinel,t=e._prev;if(t!==e)return Fvt(t),t}enqueue(){let e=this.isentinel,t=e._prev;if(t!==e)return Fvt(t),t}toString(){let e=[],t=this.isentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,tie)),n=n._prev;return`[${e.join(", ")}]`}},Gvt=Bvt;var eie=$o.Graph,rie=()=>1,nie=(r,e)=>{var t;if(r.nodeCount()<=1)return[];let n=aie(r,e||rie);return(t=iie(n.graph,n.buckets,n.zeroIdx).map(a=>r.outEdges(a.v,a.w)))===null||t===void 0?void 0:t.flat()},iie=(r,e,t)=>{let n=[],i=e[e.length-1],a=e[0],o;for(;r.nodeCount();){for(;o=a.dequeue();)H8(r,e,t,o);for(;o=i.dequeue();)H8(r,e,t,o);if(r.nodeCount()){for(let s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){n=n.concat(H8(r,e,t,o,!0));break}}}return n},H8=(r,e,t,n,i)=>{var a,o;let s=i?[]:void 0;return(a=r.inEdges(n.v))===null||a===void 0||a.forEach(l=>{let u=r.edge(l),f=r.node(l.v);i&&s.push({v:l.v,w:l.w}),f.out===void 0&&(f.out=0),f.out-=u,Y8(e,t,f)}),(o=r.outEdges(n.v))===null||o===void 0||o.forEach(l=>{let u=r.edge(l),f=l.w,c=r.node(f);c.in===void 0&&(c.in=0),c.in-=u,Y8(e,t,c)}),r.removeNode(n.v),s},aie=(r,e)=>{let t=new eie,n=0,i=0;r.nodes().forEach(l=>{t.setNode(l,{v:l,in:0,out:0})}),r.edges().forEach(l=>{let u=t.edge(l.v,l.w)||0,f=e==null?void 0:e(l),c=u+f;t.setEdge(l.v,l.w,c),i=Math.max(i,t.node(l.v).out+=f),n=Math.max(n,t.node(l.w).in+=f)});let a=[],o=i+n+3;for(let l=0;l{Y8(a,s,t.node(l))}),{buckets:a,zeroIdx:s,graph:t}},Y8=(r,e,t)=>{t.out?t.in?r[t.out-t.in+e].enqueue(t):r[r.length-1].enqueue(t):r[0].enqueue(t)},zvt=nie;var oie=r=>{let e=n=>i=>n.edge(i).weight,t=r.graph().acyclicer==="greedy"?zvt(r,e(r)):sie(r);t==null||t.forEach(n=>{let i=r.edge(n);r.removeEdge(n),i.forwardName=n.name,i.reversed=!0,r.setEdge(n.w,n.v,i,`rev-${Math.random()}`)})},sie=r=>{let e=[],t={},n={},i=a=>{var o;n.hasOwnProperty(a)||(n[a]=!0,t[a]=!0,(o=r.outEdges(a))===null||o===void 0||o.forEach(s=>{t.hasOwnProperty(s.w)?e.push(s):i(s.w)}),delete t[a])};return r.nodes().forEach(i),e},lie=r=>{r.edges().forEach(e=>{let t=r.edge(e);if(t.reversed){r.removeEdge(e);let n=t.forwardName;delete t.reversed,delete t.forwardName,r.setEdge(e.w,e.v,t,n)}})},X8={run:oie,undo:lie};var Uvt=$o.Graph,jvt=(r,e,t,n)=>{let i;do i=`${n}${Math.random()}`;while(r.hasNode(i));return t.dummy=e,r.setNode(i,t),i},q8=r=>{let e=new Uvt().setGraph(r.graph());return r.nodes().forEach(t=>{e.setNode(t,r.node(t))}),r.edges().forEach(t=>{let n=e.edge(t.v,t.w)||{weight:0,minlen:1},i=r.edge(t);e.setEdge(t.v,t.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e},uie=r=>{let e=new Uvt({multigraph:r.isMultigraph()}).setGraph(r.graph());return r.nodes().forEach(t=>{var n;((n=r.children(t))===null||n===void 0?void 0:n.length)||e.setNode(t,r.node(t))}),r.edges().forEach(t=>e.setEdge(t,r.edge(t))),e},AM=(r,e)=>{let t={};return r==null||r.forEach((n,i)=>{t[n]=e[i]}),t},fie=r=>{let e=r.nodes().map(t=>{var n;let i={};return(n=r.outEdges(t))===null||n===void 0||n.forEach(a=>{i[a.w]=(i[a.w]||0)+r.edge(a).weight}),i});return AM(r.nodes(),e)},cie=r=>{let e=r.nodes().map(t=>{var n;let i={};return(n=r.inEdges(t))===null||n===void 0||n.forEach(a=>{i[a.v]=(i[a.v]||0)+r.edge(a).weight}),i});return AM(r.nodes(),e)},hie=(r,e)=>{let t=r.x,n=r.y,i=e.x-t,a=e.y-n,o=r.width/2,s=r.height/2;if(!i&&!a)return{x:0,y:0};let l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:t+l,y:n+u}},die=r=>{let e=[],t=[],n=Wvt(r)+1;for(let i=0;i{let o=r.node(i).rank;o!==void 0&&e[o]&&t[o].push(i)}),t==null||t.forEach((i,a)=>{i==null||i.sort((o,s)=>{var l,u;return((l=r.node(o))===null||l===void 0?void 0:l.order)-((u=r.node(s))===null||u===void 0?void 0:u.order)}),i.forEach(o=>{e[a].push(o)})}),e},K8=r=>{let e=r.nodes().filter(n=>r.node(n).rank!==void 0).map(n=>r.node(n).rank),t=Math.min(...e);r.nodes().forEach(n=>{let i=r.node(n);i.hasOwnProperty("rank")&&(i.rank||(i.rank=0),i.rank-=t)})},Z8=r=>{let e=r.nodes().filter(o=>r.node(o).rank!==void 0).map(o=>r.node(o).rank),t=Math.min(...e),n=[];r.nodes().forEach(o=>{var s;let l=(((s=r.node(o))===null||s===void 0?void 0:s.rank)||0)-t;n[l]||(n[l]=[]),n[l].push(o)});let i=0,a=r.graph().nodeRankFactor||0;for(let o=0;o{r.node(l).rank||(r.node(l).rank=0),r.node(l).rank+=i}))}},pie=(r,e,t,n)=>{let i={width:0,height:0};return je(t)&&je(n)&&(i.rank=t,i.order=n),jvt(r,"border",i,e)},Wvt=r=>{let e=r.nodes().map(t=>{let n=r.node(t).rank;return n!==void 0?n:-1/0});return Math.max(...e)},vie=(r,e)=>{let t={lhs:[],rhs:[]};return r==null||r.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t},$8=(r,e)=>{let t=Date.now();try{return e()}finally{console.log(`${r} time: ${Date.now()-t}ms`)}},Q8=(r,e)=>e(),MM=(r,e)=>{let t=1/0,n;return r==null||r.forEach(i=>{let a=e(i);t>a&&(t=a,n=i)}),n};var Ni={addDummyNode:jvt,simplify:q8,asNonCompoundGraph:uie,successorWeights:fie,predecessorWeights:cie,intersectRect:hie,buildLayerMatrix:die,normalizeRanks:K8,removeEmptyRanks:Z8,addBorderNode:pie,maxRank:Wvt,partition:vie,time:$8,notime:Q8,zipObject:AM,minBy:MM};var mie=r=>{r.graph().dummyChains=[],r.edges().forEach(e=>gie(r,e))},gie=(r,e)=>{var t,n;let i=e.v,a=r.node(i).rank,o=e.w,s=r.node(o).rank,l=e.name,u=r.edge(e),f=u.labelRank;if(s===a+1)return;r.removeEdge(e);let c,h,d;for(d=0,++a;a{var e;(e=r.graph().dummyChains)===null||e===void 0||e.forEach(t=>{var n;let i=r.node(t),a=i.edgeLabel,o;i.edgeObj&&r.setEdge(i.edgeObj,a);let s=t;for(;i.dummy;)o=(n=r.successors(s))===null||n===void 0?void 0:n[0],r.removeNode(s),a.points.push({x:i.x,y:i.y}),i.dummy==="edge-label"&&(a.x=i.x,a.y=i.y,a.width=i.width,a.height=i.height),s=o,i=r.node(s)})},J8={run:mie,undo:yie};var ER=r=>{var e;let t={},n=i=>{var a;let o=r.node(i);if(t.hasOwnProperty(i))return o.rank;t[i]=!0;let s=(a=r.outEdges(i))===null||a===void 0?void 0:a.map(u=>n(u.w)-r.edge(u).minlen||1/0),l=Math.min(...s);return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),o.rank=l,l};(e=r.sources())===null||e===void 0||e.forEach(i=>n(i))},Vvt=r=>{var e;let t={},n=0,i=o=>{var s;let l=r.node(o);if(t.hasOwnProperty(o))return l.rank;t[o]=!0;let u=(s=r.outEdges(o))===null||s===void 0?void 0:s.map(c=>i(c.w)-r.edge(c).minlen||1/0),f=Math.min(...u);return(f===Number.POSITIVE_INFINITY||f===void 0||f===null)&&(f=0),l.rank=f,n=Math.min(l.rank,n),l.rank};(e=r.sources())===null||e===void 0||e.forEach(o=>i(o)),n+=1;let a=(o,s)=>{var l;let u=r.node(o),f=isNaN(u.layer)?s:u.layer;(u.rank===void 0||u.rank{a(c.w,f+r.edge(c).minlen)})};r.nodes().forEach(o=>{let s=r.node(o);isNaN(s.layer)?s.rank-=n:a(o,s.layer)})},td=(r,e)=>r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen;var Hvt=$o.Graph,Yvt=r=>{let e=new Hvt({directed:!1}),t=r.nodes()[0],n=r.nodeCount();e.setNode(t,{});let i,a;for(;xie(e,r){let t=n=>{e.nodeEdges(n).forEach(i=>{let a=i.v,o=n===a?i.w:a;!r.hasNode(o)&&!td(e,i)&&(r.setNode(o,{}),r.setEdge(n,o,{}),t(o))})};return r.nodes().forEach(t),r.nodeCount()},Xvt=r=>{let e=new Hvt({directed:!1}),t=r.nodes()[0],n=r.nodeCount();e.setNode(t,{});let i,a;for(;bie(e,r){let t=n=>{var i;(i=e.nodeEdges(n))===null||i===void 0||i.forEach(a=>{let o=a.v,s=n===o?a.w:o;!r.hasNode(s)&&(e.node(s).layer!==void 0||!td(e,a))&&(r.setNode(s,{}),r.setEdge(n,s,{}),t(s))})};return r.nodes().forEach(t),r.nodeCount()},qvt=(r,e)=>MM(e.edges(),t=>r.hasNode(t.v)!==r.hasNode(t.w)?td(e,t):1/0),Kvt=(r,e,t)=>{r.nodes().forEach(n=>{e.node(n).rank||(e.node(n).rank=0),e.node(n).rank+=t})};var _ie=$o.alg,{preorder:Sie,postorder:Cie}=_ie,Y0=r=>{r=q8(r),ER(r);let e=Yvt(r);eH(e),tH(e,r);let t,n;for(;t=Qvt(e);)n=Jvt(e,r,t),tmt(e,r,t,n)},tH=(r,e)=>{let t=Cie(r,r.nodes());t=t==null?void 0:t.slice(0,(t==null?void 0:t.length)-1),t==null||t.forEach(n=>{wie(r,e,n)})},wie=(r,e,t)=>{let i=r.node(t).parent;r.edge(t,i).cutvalue=Zvt(r,e,t)},Zvt=(r,e,t)=>{var n;let a=r.node(t).parent,o=!0,s=e.edge(t,a),l=0;return s||(o=!1,s=e.edge(a,t)),l=s.weight,(n=e.nodeEdges(t))===null||n===void 0||n.forEach(u=>{let f=u.v===t,c=f?u.w:u.v;if(c!==a){let h=f===o,d=e.edge(u).weight;if(l+=h?d:-d,Aie(r,t,c)){let p=r.edge(t,c).cutvalue;l+=h?-p:p}}}),l},eH=(r,e)=>{e!==void 0&&(e=r.nodes()[0]),$vt(r,{},1,e)},$vt=(r,e,t,n,i)=>{var a;let o=t,s=t,l=r.node(n);return e[n]=!0,(a=r.neighbors(n))===null||a===void 0||a.forEach(u=>{e.hasOwnProperty(u)||(s=$vt(r,e,s,u,n))}),l.low=o,l.lim=s++,i?l.parent=i:delete l.parent,s},Qvt=r=>r.edges().find(e=>r.edge(e).cutvalue<0),Jvt=(r,e,t)=>{let n=t.v,i=t.w;e.hasEdge(n,i)||(n=t.w,i=t.v);let a=r.node(n),o=r.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);let u=e.edges().filter(f=>l===emt(r,r.node(f.v),s)&&l!==emt(r,r.node(f.w),s));return MM(u,f=>td(e,f))},tmt=(r,e,t,n)=>{let i=t.v,a=t.w;r.removeEdge(i,a),r.setEdge(n.v,n.w,{}),eH(r),tH(r,e),Eie(r,e)},Eie=(r,e)=>{let t=r.nodes().find(i=>!e.node(i).parent),n=Sie(r,t);n=n==null?void 0:n.slice(1),n==null||n.forEach(i=>{let a=r.node(i).parent,o=e.edge(i,a),s=!1;o||(o=e.edge(a,i),s=!0),e.node(i).rank=e.node(a).rank+(s?o.minlen:-o.minlen)})},Aie=(r,e,t)=>r.hasEdge(e,t),emt=(r,e,t)=>t.low<=e.lim&&e.lim<=t.lim;Y0.initLowLimValues=eH;Y0.initCutValues=tH;Y0.calcCutValue=Zvt;Y0.leaveEdge=Qvt;Y0.enterEdge=Jvt;Y0.exchangeEdges=tmt;var rmt=Y0;var Mie=r=>{switch(r.graph().ranker){case"network-simplex":Iie(r);break;case"tight-tree":nmt(r);break;case"longest-path":Tie(r);break;default:nmt(r)}},Tie=ER,nmt=r=>{Vvt(r),Xvt(r)},Iie=r=>{rmt(r)},imt=Mie;var Lie=r=>{var e;let t=Die(r);(e=r.graph().dummyChains)===null||e===void 0||e.forEach(n=>{var i,a;let o=r.node(n),s=o.edgeObj;if(!s)return;let l=Oie(r,t,s.v,s.w),u=l.path,f=l.lca,c=0,h=u[c],d=!0;for(;n!==s.w;){if(o=r.node(n),d){for(;(h=u[c])!==f&&r.node(h).maxRank{let i=[],a=[],o=Math.min(e[t].low,e[n].low),s=Math.max(e[t].lim,e[n].lim),l,u;l=t;do l=r.parent(l),i.push(l);while(l&&(e[l].low>o||s>e[l].lim));for(u=l,l=n;(l=r.parent(l))!==u;)a.push(l);return{lca:u,path:i.concat(a.reverse())}},Die=r=>{var e;let t={},n=0,i=a=>{var o;let s=n;(o=r.children(a))===null||o===void 0||o.forEach(i),t[a]={low:s,lim:n++}};return(e=r.children())===null||e===void 0||e.forEach(i),t},amt=Lie;var Pie=r=>{var e;let t=Ni.addDummyNode(r,"root",{},"_root"),n=kie(r),i=Math.max(...Object.values(n))-1,a=2*i+1;r.graph().nestingRoot=t,r.edges().forEach(s=>{r.edge(s).minlen*=a});let o=Rie(r)+1;(e=r.children())===null||e===void 0||e.forEach(s=>{omt(r,t,a,o,i,n,s)}),r.graph().nodeRankFactor=a},omt=(r,e,t,n,i,a,o)=>{let s=r.children(o);if(!(s==null?void 0:s.length)){o!==e&&r.setEdge(e,o,{weight:0,minlen:t});return}let l=Ni.addBorderNode(r,"_bt"),u=Ni.addBorderNode(r,"_bb"),f=r.node(o);r.setParent(l,o),f.borderTop=l,r.setParent(u,o),f.borderBottom=u,s==null||s.forEach(c=>{omt(r,e,t,n,i,a,c);let h=r.node(c),d=h.borderTop?h.borderTop:c,p=h.borderBottom?h.borderBottom:c,v=h.borderTop?n:2*n,m=d!==p?1:i-a[o]+1;r.setEdge(l,d,{minlen:m,weight:v,nestingEdge:!0}),r.setEdge(p,u,{minlen:m,weight:v,nestingEdge:!0})}),r.parent(o)||r.setEdge(e,l,{weight:0,minlen:i+a[o]})},kie=r=>{var e;let t={},n=(i,a)=>{let o=r.children(i);o==null||o.forEach(s=>n(s,a+1)),t[i]=a};return(e=r.children())===null||e===void 0||e.forEach(i=>n(i,1)),t},Rie=r=>{let e=0;return r.edges().forEach(t=>{e+=r.edge(t).weight}),e},Nie=r=>{let e=r.graph();e.nestingRoot&&r.removeNode(e.nestingRoot),delete e.nestingRoot,r.edges().forEach(t=>{r.edge(t).nestingEdge&&r.removeEdge(t)})},rH={run:Pie,cleanup:Nie};var Fie=r=>{var e;let t=n=>{let i=r.children(n),a=r.node(n);if((i==null?void 0:i.length)&&i.forEach(o=>t(o)),a.hasOwnProperty("minRank")){a.borderLeft=[],a.borderRight=[];for(let o=a.minRank,s=a.maxRank+1;ot(n))},smt=(r,e,t,n,i,a)=>{let o={rank:a,width:0,height:0,borderType:e},s=i[e][a-1],l=Ni.addDummyNode(r,"border",o,t);i[e][a]=l,r.setParent(l,n),s&&r.setEdge(s,l,{weight:1})},lmt=Fie;var Bie=r=>{var e;let t=(e=r.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(t==="lr"||t==="rl")&&umt(r)},Gie=r=>{var e;let t=(e=r.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(t==="bt"||t==="rl")&&zie(r),(t==="lr"||t==="rl")&&(Uie(r),umt(r))},umt=r=>{r.nodes().forEach(e=>{fmt(r.node(e))}),r.edges().forEach(e=>{fmt(r.edge(e))})},fmt=r=>{let e=r.width;r.width=r.height,r.height=e},zie=r=>{r.nodes().forEach(e=>{nH(r.node(e))}),r.edges().forEach(e=>{var t;let n=r.edge(e);(t=n.points)===null||t===void 0||t.forEach(i=>nH(i)),n.hasOwnProperty("y")&&nH(n)})},nH=r=>{r.y=-r.y},Uie=r=>{r.nodes().forEach(e=>{iH(r.node(e))}),r.edges().forEach(e=>{var t;let n=r.edge(e);(t=n.points)===null||t===void 0||t.forEach(i=>iH(i)),n.hasOwnProperty("x")&&iH(n)})},iH=r=>{let e=r.x;r.x=r.y,r.y=e},aH={adjust:Bie,undo:Gie};var jie=r=>{let e={},t=r.nodes().filter(f=>{var c;return!((c=r.children(f))===null||c===void 0?void 0:c.length)}),n=t.map(f=>r.node(f).rank),i=Math.max(...n),a=[];for(let f=0;f{var c;if(e.hasOwnProperty(f))return;e[f]=!0;let h=r.node(f);isNaN(h.rank)||a[h.rank].push(f),(c=r.successors(f))===null||c===void 0||c.forEach(d=>o(d))},s=t.sort((f,c)=>r.node(f).rank-r.node(c).rank),u=s.filter(f=>r.node(f).fixorder!==void 0).sort((f,c)=>r.node(f).fixorder-r.node(c).fixorder);return u==null||u.forEach(f=>{isNaN(r.node(f).rank)||a[r.node(f).rank].push(f),e[f]=!0}),s==null||s.forEach(o),a},oH=jie;var Wie=(r,e,t)=>{let n=AM(t,t.map((f,c)=>c)),a=e.map(f=>{var c;let h=(c=r.outEdges(f))===null||c===void 0?void 0:c.map(d=>({pos:n[d.w]||0,weight:r.edge(d).weight}));return h==null?void 0:h.sort((d,p)=>d.pos-p.pos)}).flat().filter(f=>f!==void 0),o=1;for(;o{let c=f.pos+o;l[c]+=f.weight;let h=0;for(;c>0;)c%2&&(h+=l[c+1]),c=c-1>>1,l[c]+=f.weight;u+=f.weight*h}),u},Vie=(r,e)=>{let t=0;for(let n=1;n<(e==null?void 0:e.length);++n)t+=Wie(r,e[n-1],e[n]);return t},sH=Vie;var Hie=$o.Graph,Yie=(r,e,t)=>{let n=Xie(r),i=new Hie({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(a=>r.node(a));return r.nodes().forEach(a=>{let o=r.node(a),s=r.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),r[t](a).forEach(l=>{let u=l.v===a?l.w:l.v,f=i.edge(u,a),c=f!==void 0?f.weight:0;i.setEdge(u,a,{weight:r.edge(l).weight+c})}),o.hasOwnProperty("minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i},Xie=r=>{let e;for(;r.hasNode(e=`_root${Math.random()}`););return e},cmt=Yie;var qie=(r,e,t)=>{let n={},i;t==null||t.forEach(a=>{let o=r.parent(a),s,l;for(;o;){if(s=r.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})},hmt=qie;var Kie=(r,e)=>e.map(t=>{let n=r.inEdges(t);if(!(n==null?void 0:n.length))return{v:t};{let i={sum:0,weight:0};return n==null||n.forEach(a=>{let o=r.edge(a),s=r.node(a.v);i.sum+=o.weight*s.order,i.weight+=o.weight}),{v:t,barycenter:i.sum/i.weight,weight:i.weight}}}),dmt=Kie;var Zie=(r,e)=>{var t,n,i;let a={};r==null||r.forEach((s,l)=>{let u=a[s.v]={i:l,indegree:0,in:[],out:[],vs:[s.v]};s.barycenter!==void 0&&(u.barycenter=s.barycenter,u.weight=s.weight)}),(t=e.edges())===null||t===void 0||t.forEach(s=>{let l=a[s.v],u=a[s.w];l!==void 0&&u!==void 0&&(u.indegree++,l.out.push(a[s.w]))});let o=(i=(n=Object.values(a)).filter)===null||i===void 0?void 0:i.call(n,s=>!s.indegree);return $ie(o)},$ie=r=>{var e,t;let n=[],i=l=>u=>{u.merged||(u.barycenter===void 0||l.barycenter===void 0||u.barycenter>=l.barycenter)&&Qie(l,u)},a=l=>u=>{u.in.push(l),--u.indegree==0&&r.push(u)};for(;r==null?void 0:r.length;){let l=r.pop();n.push(l),(e=l.in.reverse())===null||e===void 0||e.forEach(u=>i(l)(u)),(t=l.out)===null||t===void 0||t.forEach(u=>a(l)(u))}let o=n.filter(l=>!l.merged),s=["vs","i","barycenter","weight"];return o.map(l=>{let u={};return s==null||s.forEach(f=>{l[f]!==void 0&&(u[f]=l[f])}),u})},Qie=(r,e)=>{var t;let n=0,i=0;r.weight&&(n+=r.barycenter*r.weight,i+=r.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),r.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(r.vs),r.barycenter=n/i,r.weight=i,r.i=Math.min(e.i,r.i),e.merged=!0},pmt=Zie;var Jie=(r,e,t)=>{let n=Ni.partition(r,c=>c.hasOwnProperty("fixorder")&&!isNaN(c.fixorder)||c.hasOwnProperty("barycenter")),i=n.lhs,a=n.rhs.sort((c,h)=>-c.i- -h.i),o=[],s=0,l=0,u=0;i==null||i.sort(tae(!!e,!!t)),u=vmt(o,a,u),i==null||i.forEach(c=>{var h;u+=(h=c.vs)===null||h===void 0?void 0:h.length,o.push(c.vs),s+=c.barycenter*c.weight,l+=c.weight,u=vmt(o,a,u)});let f={vs:o.flat()};return l&&(f.barycenter=s/l,f.weight=l),f},vmt=(r,e,t)=>{let n=t,i;for(;e.length&&(i=e[e.length-1]).i<=n;)e.pop(),r==null||r.push(i.vs),n++;return n},tae=(r,e)=>(t,n)=>{if(t.fixorder!==void 0&&n.fixorder!==void 0)return t.fixorder-n.fixorder;if(t.barycentern.barycenter)return 1;if(e&&t.order!==void 0&&n.order!==void 0){if(t.ordern.order)return 1}return r?n.i-t.i:t.i-n.i},mmt=Jie;var gmt=(r,e,t,n,i)=>{var a,o,s,l;let u=r.children(e),f=r.node(e),c=f?f.borderLeft:void 0,h=f?f.borderRight:void 0,d={};c&&(u=u==null?void 0:u.filter(g=>g!==c&&g!==h));let p=dmt(r,u||[]);p==null||p.forEach(g=>{var x;if((x=r.children(g.v))===null||x===void 0?void 0:x.length){let b=gmt(r,g.v,t,n);d[g.v]=b,b.hasOwnProperty("barycenter")&&rae(g,b)}});let v=pmt(p,t);eae(v,d),(a=v.filter(g=>{var x;return!!g.vs||((x=g.vs)===null||x===void 0?void 0:x.length)>0}))===null||a===void 0||a.forEach(g=>{let x=r.node(g.vs[0]);g.fixorder=x.fixorder,g.order=x.order});let m=mmt(v,n,i);if(c&&(m.vs=[c,m.vs,h].flat(),(o=r.predecessors(c))===null||o===void 0?void 0:o.length)){let g=r.node(((s=r.predecessors(c))===null||s===void 0?void 0:s[0])||{}),x=r.node(((l=r.predecessors(h))===null||l===void 0?void 0:l[0])||{});m.hasOwnProperty("barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+g.order+x.order)/(m.weight+2),m.weight+=2}return m},eae=(r,e)=>{r==null||r.forEach(t=>{var n;let i=(n=t.vs)===null||n===void 0?void 0:n.map(a=>e[a]?e[a].vs:a);t.vs=i.flat()})},rae=(r,e)=>{r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight):(r.barycenter=e.barycenter,r.weight=e.weight)},ymt=gmt;var nae=$o.Graph,iae=r=>{let e=Ni.maxRank(r),t=[],n=[];for(let u=1;u-1;u--)n.push(u);let i=xmt(r,t,"inEdges"),a=xmt(r,n,"outEdges"),o=oH(r);lH(r,o);let s=Number.POSITIVE_INFINITY,l;for(let u=0,f=0;f<4;++u,++f){bmt(u%2?i:a,u%4>=2),o=Ni.buildLayerMatrix(r);let c=sH(r,o);c=2,!0),o=Ni.buildLayerMatrix(r);let c=sH(r,o);ce.map(n=>cmt(r,n,t)),bmt=(r,e,t)=>{let n=new nae;r==null||r.forEach(i=>{var a;let o=i.graph().root,s=ymt(i,o,n,e,t);for(let l=0;l<((a=s.vs)===null||a===void 0?void 0:a.length);l++)i.node(s.vs[l]).order=l;hmt(i,n,s.vs)})},lH=(r,e)=>{e==null||e.forEach(t=>{t==null||t.forEach((n,i)=>{r.node(n).order=i})})},_mt=iae;var aae=$o.Graph,Smt=(r,e)=>{let t={},n=(i,a)=>{let o=0,s=0,l=i.length,u=a==null?void 0:a[(a==null?void 0:a.length)-1];return a==null||a.forEach((f,c)=>{var h;let d=oae(r,f),p=d?r.node(d).order:l;(d||f===u)&&((h=a.slice(s,c+1))===null||h===void 0||h.forEach(v=>{var m;(m=r.predecessors(v))===null||m===void 0||m.forEach(g=>{let x=r.node(g),b=x.order;(b{let t={},n=(a,o,s,l,u)=>{let f,c=[];for(let h=o;h{var d;f=a[h],r.node(f).dummy&&((d=r.predecessors(f))===null||d===void 0||d.forEach(p=>{let v=r.node(p);v.dummy&&(v.orderu)&&wmt(t,p,f)}))})},i=(a,o)=>{let s=-1,l,u=0;return o==null||o.forEach((f,c)=>{if(r.node(f).dummy==="border"){let h=r.predecessors(f)||[];h.length&&(l=r.node(h[0]).order,n(o,u,c,s,l),u=c,s=l)}n(o,u,o.length,l,a.length)}),o};return(e==null?void 0:e.length)&&e.reduce(i),t},oae=(r,e)=>{var t;if(r.node(e).dummy)return(t=r.predecessors(e))===null||t===void 0?void 0:t.find(n=>r.node(n).dummy)},wmt=(r,e,t)=>{let n=e,i=t;if(n>i){let o=n;n=i,i=o}let a=r[n];a||(r[n]=a={}),a[i]=!0},sae=(r,e,t)=>{let n=e,i=t;if(n>i){let a=e;n=i,i=a}return r[n]&&r[n].hasOwnProperty(i)},Emt=(r,e,t,n)=>{let i={},a={},o={};return e==null||e.forEach(s=>{s==null||s.forEach((l,u)=>{i[l]=l,a[l]=l,o[l]=u})}),e==null||e.forEach(s=>{let l=-1;s==null||s.forEach(u=>{let f=n(u);if(f.length){f=f.sort((h,d)=>o[h]-o[d]);let c=(f.length-1)/2;for(let h=Math.floor(c),d=Math.ceil(c);h<=d;++h){let p=f[h];a[u]===u&&l{var a;let o={},s=lae(r,e,t,i),l=i?"borderLeft":"borderRight",u=(h,d)=>{let p=s.nodes(),v=p.pop(),m={};for(;v;)m[v]?h(v):(m[v]=!0,p.push(v),p=p.concat(d(v))),v=p.pop()},f=h=>{o[h]=(s.inEdges(h)||[]).reduce((d,p)=>Math.max(d,(o[p.v]||0)+s.edge(p)),0)},c=h=>{let d=(s.outEdges(h)||[]).reduce((v,m)=>Math.min(v,(o[m.w]||0)-s.edge(m)),Number.POSITIVE_INFINITY),p=r.node(h);d!==Number.POSITIVE_INFINITY&&p.borderType!==l&&(o[h]=Math.max(o[h],d))};return u(f,s.predecessors.bind(s)),u(c,s.successors.bind(s)),(a=Object.values(n))===null||a===void 0||a.forEach(h=>{o[h]=o[t[h]]}),o},lae=(r,e,t,n)=>{let i=new aae,a=r.graph(),o=uae(a.nodesep,a.edgesep,n);return e==null||e.forEach(s=>{let l;s==null||s.forEach(u=>{let f=t[u];if(i.setNode(f),l){let c=t[l],h=i.edge(c,f);i.setEdge(c,f,Math.max(o(r,u,l),h||0))}l=u})}),i},Mmt=(r,e)=>Ni.minBy(Object.values(e),t=>{var n;let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return(n=Object.keys(t))===null||n===void 0||n.forEach(o=>{let s=t[o],l=fae(r,o)/2;i=Math.max(s+l,i),a=Math.min(s-l,a)}),i-a});function Tmt(r,e){let t=Object.values(e),n=Math.min(...t),i=Math.max(...t);["u","d"].forEach(a=>{["l","r"].forEach(o=>{let s=a+o,l=r[s],u;if(l===e)return;let f=Object.values(l);u=o==="l"?n-Math.min(...f):i-Math.max(...f),u&&(r[s]={},Object.keys(l).forEach(c=>{r[s][c]=l[c]+u}))})})}var Imt=(r,e)=>{let t={};return Object.keys(r.ul).forEach(n=>{if(e)t[n]=r[e.toLowerCase()][n];else{let a=Object.values(r).map(o=>o[n]).sort((o,s)=>o-s);t[n]=(a[1]+a[2])/2}}),t};var uae=(r,e,t)=>(n,i,a)=>{let o=n.node(i),s=n.node(a),l=0,u;if(l+=o.width/2,o.hasOwnProperty("labelpos"))switch((o.labelpos||"").toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=t?u:-u),u=0,l+=(o.dummy?e:r)/2,l+=(s.dummy?e:r)/2,l+=s.width/2,s.hasOwnProperty("labelpos"))switch((s.labelpos||"").toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(l+=t?u:-u),u=0,l},fae=(r,e)=>{var t;return((t=r.node(e))===null||t===void 0?void 0:t.width)||0};var cae=r=>{let e=Ni.buildLayerMatrix(r),t=r.graph().ranksep,n=0;e==null||e.forEach(i=>{let a=i.map(s=>r.node(s).height),o=Math.max(...a);i==null||i.forEach(s=>{r.node(s).y=n+o/2}),n+=o+t})},hae=r=>{let e=Ni.buildLayerMatrix(r),t=Object.assign(Smt(r,e),Cmt(r,e)),n={},i;["u","d"].forEach(o=>{i=o==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(i=i.map(c=>Object.values(c).reverse()));let l=(o==="u"?r.predecessors:r.successors).bind(r),u=Emt(r,i,t,l),f=Amt(r,i,u.root,u.align,s==="r");s==="r"&&Object.keys(f).forEach(c=>f[c]=-f[c]),n[o+s]=f})});let a=Mmt(r,n);return a&&Tmt(n,a),Imt(n,r.graph().align)},dae=r=>{var e;r=Ni.asNonCompoundGraph(r),cae(r);let t=hae(r);(e=Object.keys(t))===null||e===void 0||e.forEach(n=>{r.node(n).x=t[n]})},Lmt=dae;var pae=(r,e)=>{let n=r.nodes().filter(o=>{var s;return!((s=r.children(o))===null||s===void 0?void 0:s.length)}).map(o=>r.node(o).rank),i=Math.max(...n),a=[];for(let o=0;o{let s=r.node(o);!s||s.dummy||isNaN(s.rank)||(s.fixorder=a[s.rank].length,a[s.rank].push(o))})},Omt=pae;var vae=$o.Graph,mae=(r,e)=>{let t=e&&e.debugTiming?Ni.time:Ni.notime;t("layout",()=>{e&&!e.keepNodeOrder&&e.prevGraph&&t(" inheritOrder",()=>{yae(r,e.prevGraph)});let n=t(" buildLayoutGraph",()=>Eae(r));e&&e.edgeLabelSpace===!1||t(" makeSpaceForEdgeLabels",()=>{Aae(n)});try{t(" runLayout",()=>{gae(n,t,e)})}catch(i){if(i.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure: `,i);return}throw i}t(" updateInputGraph",()=>{xae(r,n)})})},gae=(r,e,t)=>{e(" removeSelfEdges",()=>{Rae(r)}),e(" acyclic",()=>{X8.run(r)}),e(" nestingGraph.run",()=>{rH.run(r)}),e(" rank",()=>{imt(Ni.asNonCompoundGraph(r))}),e(" injectEdgeLabelProxies",()=>{Mae(r)}),e(" removeEmptyRanks",()=>{Z8(r)}),e(" nestingGraph.cleanup",()=>{rH.cleanup(r)}),e(" normalizeRanks",()=>{K8(r)}),e(" assignRankMinMax",()=>{Tae(r)}),e(" removeEdgeLabelProxies",()=>{Iae(r)}),e(" normalize.run",()=>{J8.run(r)}),e(" parentDummyChains",()=>{amt(r)}),e(" addBorderSegments",()=>{lmt(r)}),t&&t.keepNodeOrder&&e(" initDataOrder",()=>{Omt(r,t.nodeOrder)}),e(" order",()=>{_mt(r)}),e(" insertSelfEdges",()=>{Nae(r)}),e(" adjustCoordinateSystem",()=>{aH.adjust(r)}),e(" position",()=>{Lmt(r)}),e(" positionSelfEdges",()=>{Fae(r)}),e(" removeBorderNodes",()=>{kae(r)}),e(" normalize.undo",()=>{J8.undo(r)}),e(" fixupEdgeLabelCoords",()=>{Dae(r)}),e(" undoCoordinateSystem",()=>{aH.undo(r)}),e(" translateGraph",()=>{Lae(r)}),e(" assignNodeIntersects",()=>{Oae(r)}),e(" reversePoints",()=>{Pae(r)}),e(" acyclic.undo",()=>{X8.undo(r)})},yae=(r,e)=>{let t=e._nodes||{};r.nodes().forEach(n=>{let i=r.node(n);t[n]!==void 0?(i.fixorder=t[n]._order,delete t[n]._order):delete i.fixorder})},xae=(r,e)=>{r.nodes().forEach(t=>{var n;let i=r.node(t),a=e.node(t);i&&(i.x=a.x,i.y=a.y,i._order=a.order,i._rank=a.rank,((n=e.children(t))===null||n===void 0?void 0:n.length)&&(i.width=a.width,i.height=a.height))}),r.edges().forEach(t=>{let n=r.edge(t),i=e.edge(t);n.points=i.points,i.hasOwnProperty("x")&&(n.x=i.x,n.y=i.y)}),r.graph().width=e.graph().width,r.graph().height=e.graph().height},bae=["nodesep","edgesep","ranksep","marginx","marginy"],_ae={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},uH=["acyclicer","ranker","rankdir","align"],Sae=["width","height","layer","fixorder"],Dmt={width:0,height:0},Cae=["minlen","weight","width","height","labeloffset"],wae={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fH=["labelpos"],Eae=r=>{let e=new vae({multigraph:!0,compound:!0}),t=hH(r.graph()),n={};return uH==null||uH.forEach(i=>{t[i]!==void 0&&(n[i]=t[i])}),e.setGraph(Object.assign({},_ae,cH(t,bae),n)),r.nodes().forEach(i=>{let a=hH(r.node(i)),o=cH(a,Sae);Object.keys(Dmt).forEach(s=>{o[s]===void 0&&(o[s]=Dmt[s])}),e.setNode(i,o),e.setParent(i,r.parent(i))}),r.edges().forEach(i=>{let a=hH(r.edge(i)),o={};fH==null||fH.forEach(s=>{a[s]!==void 0&&(o[s]=a[s])}),e.setEdge(i,Object.assign({},wae,cH(a,Cae),o))}),e},Aae=r=>{let e=r.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,r.nodes().forEach(t=>{let n=r.node(t);isNaN(n.layer)||(n.layer?n.layer*=2:n.layer=0)}),r.edges().forEach(t=>{var n;let i=r.edge(t);i.minlen*=2,((n=i.labelpos)===null||n===void 0?void 0:n.toLowerCase())!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})},Mae=r=>{r.edges().forEach(e=>{let t=r.edge(e);if(t.width&&t.height){let n=r.node(e.v),i=r.node(e.w),a={e,rank:(i.rank-n.rank)/2+n.rank};Ni.addDummyNode(r,"edge-proxy",a,"_ep")}})},Tae=r=>{let e=0;r.nodes().forEach(t=>{let n=r.node(t);n.borderTop&&(n.minRank=r.node(n.borderTop).rank,n.maxRank=r.node(n.borderBottom).rank,e=Math.max(e,n.maxRank||-1/0))}),r.graph().maxRank=e},Iae=r=>{r.nodes().forEach(e=>{let t=r.node(e);t.dummy==="edge-proxy"&&(r.edge(t.e).labelRank=t.rank,r.removeNode(e))})},Lae=r=>{let e=Number.POSITIVE_INFINITY,t=0,n=Number.POSITIVE_INFINITY,i=0,a=r.graph(),o=a.marginx||0,s=a.marginy||0,l=u=>{if(!u)return;let f=u.x,c=u.y,h=u.width,d=u.height;!isNaN(f)&&!isNaN(h)&&(e=Math.min(e,f-h/2),t=Math.max(t,f+h/2)),!isNaN(c)&&!isNaN(d)&&(n=Math.min(n,c-d/2),i=Math.max(i,c+d/2))};r.nodes().forEach(u=>{l(r.node(u))}),r.edges().forEach(u=>{let f=r.edge(u);f.hasOwnProperty("x")&&l(f)}),e-=o,n-=s,r.nodes().forEach(u=>{let f=r.node(u);f.x-=e,f.y-=n}),r.edges().forEach(u=>{var f;let c=r.edge(u);(f=c.points)===null||f===void 0||f.forEach(h=>{h.x-=e,h.y-=n}),c.hasOwnProperty("x")&&(c.x-=e),c.hasOwnProperty("y")&&(c.y-=n)}),a.width=t-e+o,a.height=i-n+s},Oae=r=>{r.edges().forEach(e=>{let t=r.edge(e),n=r.node(e.v),i=r.node(e.w),a,o;t.points?(a=t.points[0],o=t.points[t.points.length-1]):(t.points=[],a=i,o=n),t.points.unshift(Ni.intersectRect(n,a)),t.points.push(Ni.intersectRect(i,o))})},Dae=r=>{r.edges().forEach(e=>{let t=r.edge(e);if(t.hasOwnProperty("x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})},Pae=r=>{r.edges().forEach(e=>{let t=r.edge(e);t.reversed&&t.points.reverse()})},kae=r=>{r.nodes().forEach(e=>{var t,n,i;if((t=r.children(e))===null||t===void 0?void 0:t.length){let a=r.node(e),o=r.node(a.borderTop),s=r.node(a.borderBottom),l=r.node(a.borderLeft[((n=a.borderLeft)===null||n===void 0?void 0:n.length)-1]),u=r.node(a.borderRight[((i=a.borderRight)===null||i===void 0?void 0:i.length)-1]);a.width=Math.abs((u==null?void 0:u.x)-(l==null?void 0:l.x))||10,a.height=Math.abs((s==null?void 0:s.y)-(o==null?void 0:o.y))||10,a.x=((l==null?void 0:l.x)||0)+a.width/2,a.y=((o==null?void 0:o.y)||0)+a.height/2}}),r.nodes().forEach(e=>{r.node(e).dummy==="border"&&r.removeNode(e)})},Rae=r=>{r.edges().forEach(e=>{if(e.v===e.w){let t=r.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})},Nae=r=>{let e=Ni.buildLayerMatrix(r);e==null||e.forEach(t=>{let n=0;t==null||t.forEach((i,a)=>{var o;let s=r.node(i);s.order=a+n,(o=s.selfEdges)===null||o===void 0||o.forEach(l=>{Ni.addDummyNode(r,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})},Fae=r=>{r.nodes().forEach(e=>{let t=r.node(e);if(t.dummy==="selfedge"){let n=r.node(t.e.v),i=n.x+n.width/2,a=n.y,o=t.x-i,s=n.height/2;r.setEdge(t.e,t.label),r.removeNode(e),t.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{y:a,x:i+o},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],t.label.x=t.x,t.label.y=t.y}})},cH=(r,e)=>{let t={};return e==null||e.forEach(n=>{r[n]!==void 0&&(t[n]=+r[n])}),t},hH=r=>{let e={};return Object.keys(r).forEach(t=>{let n=r[t];e[t.toLowerCase()]=n}),e},Pmt=mae;var AR={graphlib:$o,layout:Pmt,util:{time:$8,notime:Q8}};var _g=class extends li{constructor(e){super();this.rankdir="TB",this.nodesep=50,this.ranksep=50,this.controlPoints=!1,this.sortByCombo=!1,this.edgeLabelSpace=!0,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.layoutNode=t=>{let n=this,{nodes:i}=n,a=i.find(o=>o.id===t);return a?a.layout!==!1:!0},this.updateCfg(e)}getDefaultCfg(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1}}execute(){let e=this,{nodes:t,nodeSize:n,rankdir:i,combos:a,begin:o}=e;if(!t)return;let s=e.edges||[],l=new AR.graphlib.Graph({multigraph:!0,compound:!0}),u;n?da(n)?u=()=>n:u=()=>[n,n]:u=v=>v.size?da(v.size)?v.size:po(v.size)?[v.size.width||40,v.size.height||40]:[v.size,v.size]:[40,40];let f=MR(e.nodesepFunc,e.nodesep,50),c=MR(e.ranksepFunc,e.ranksep,50);(i==="LR"||i==="RL")&&(f=MR(e.ranksepFunc,e.ranksep,50),c=MR(e.nodesepFunc,e.nodesep,50)),l.setDefaultEdgeLabel(()=>({})),l.setGraph(e);let h={};t.filter(v=>v.layout!==!1).forEach(v=>{let m=u(v),g=c(v),x=f(v),b=m[0]+2*x,S=m[1]+2*g,C=v.layer;je(C)?l.setNode(v.id,{width:b,height:S,layer:C}):l.setNode(v.id,{width:b,height:S}),this.sortByCombo&&v.comboId&&(h[v.comboId]||(h[v.comboId]=!0,l.setNode(v.comboId,{})),l.setParent(v.id,v.comboId))}),this.sortByCombo&&a&&a.forEach(v=>{!v.parentId||(h[v.parentId]||(h[v.parentId]=!0,l.setNode(v.parentId,{})),l.setParent(v.id,v.parentId))}),s.forEach(v=>{let m=xn(v,"source"),g=xn(v,"target");this.layoutNode(m)&&this.layoutNode(g)&&l.setEdge(m,g,{weight:v.weight||1})});let d;e.preset&&(d=new AR.graphlib.Graph({multigraph:!0,compound:!0}),e.preset.nodes.forEach(v=>{d==null||d.setNode(v.id,v)})),AR.layout(l,{prevGraph:d,edgeLabelSpace:e.edgeLabelSpace,keepNodeOrder:Boolean(!!e.nodeOrder),nodeOrder:e.nodeOrder});let p=[0,0];if(o){let v=1/0,m=1/0;l.nodes().forEach(g=>{let x=l.node(g);v>x.x&&(v=x.x),m>x.y&&(m=x.y)}),l.edges().forEach(g=>{l.edge(g).points.forEach(b=>{v>b.x&&(v=b.x),m>b.y&&(m=b.y)})}),p[0]=o[0]-v,p[1]=o[1]-m}return l.nodes().forEach(v=>{let m=l.node(v),g=t.findIndex(x=>x.id===v);!t[g]||(t[g].x=m.x+p[0],t[g].y=m.y+p[1],t[g]._order=m._order)}),l.edges().forEach(v=>{let m=l.edge(v),g=s.findIndex(x=>{let b=xn(x,"source"),S=xn(x,"target");return b===v.v&&S===v.w});e.edgeLabelSpace&&e.controlPoints&&s[g].type!=="loop"&&(s[g].controlPoints=m.points.slice(1,m.points.length-1),s[g].controlPoints.forEach(x=>{x.x+=p[0],x.y+=p[1]}))}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:s}}getType(){return"dagre"}};function MR(r,e,t){let n;return r?n=r:je(e)?n=()=>e:n=()=>t,n}var Bae=Object.prototype.toString;function Sg(r){return Bae.call(r).endsWith("Array]")}function Gae(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Sg(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,n=t===void 0?0:t,i=e.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;so&&(o=r[s]);return o}var kmt=Gae;function zae(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Sg(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,n=t===void 0?0:t,i=e.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;s1&&arguments[1]!==void 0?arguments[1]:{};if(Sg(r)){if(r.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!Sg(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(r.length);var n=Rmt(r),i=kmt(r);if(n===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=e.min,o=a===void 0?e.autoMinMax?n:0:a,s=e.max,l=s===void 0?e.autoMinMax?i:1:s;if(o>=l)throw new RangeError("min option must be smaller than max option");for(var u=(l-o)/(i-n),f=0;f>n);return this},r.prototype.signPropagatingRightShiftM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>n.get(i,a));return this},r.signPropagatingRightShift=function(n,i){return new e(n).signPropagatingRightShift(i)},r.prototype.rightShift=function(n){return typeof n=="number"?this.rightShiftS(n):this.rightShiftM(n)},r.prototype.rightShiftS=function(n){for(let i=0;i>>n);return this},r.prototype.rightShiftM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>>n.get(i,a));return this},r.rightShift=function(n,i){return new e(n).rightShift(i)},r.prototype.zeroFillRightShift=r.prototype.rightShift,r.prototype.zeroFillRightShiftS=r.prototype.rightShiftS,r.prototype.zeroFillRightShiftM=r.prototype.rightShiftM,r.zeroFillRightShift=r.rightShift,r.prototype.not=function(){for(let n=0;nn)throw new RangeError("Row index out of range")}function bf(r,e,t){let n=t?r.columns:r.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function X0(r,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==r.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function q0(r,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==r.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Gmt(r,e,t){return{row:Wae(r,e),column:Vae(r,t)}}function Wae(r,e){if(typeof e!="object")throw new TypeError("unexpected type for row indices");if(e.some(n=>n<0||n>=r.rows))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Vae(r,e){if(typeof e!="object")throw new TypeError("unexpected type for column indices");if(e.some(n=>n<0||n>=r.columns))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function vH(r,e,t,n,i){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(IR("startRow",e),IR("endRow",t),IR("startColumn",n),IR("endColumn",i),e>t||n>i||e<0||e>=r.rows||t<0||t>=r.rows||n<0||n>=r.columns||i<0||i>=r.columns)throw new RangeError("Submatrix indices are out of range")}function TM(r,e=0){let t=[];for(let n=0;n=a)throw new RangeError("min must be smaller than max");let s=a-i,l=new Or(e,t);for(let u=0;un?(a=!0,n=t):(i=!1,a=!0);e++}return i}isReducedEchelonForm(){let e=0,t=0,n=-1,i=!0,a=!1;for(;en?(a=!0,n=t):(i=!1,a=!0);for(let o=t+1;oe.get(i,n)&&(i=a);if(e.get(i,n)===0)n++;else{e.swapRows(t,i);let a=e.get(t,n);for(let o=n;o=0;)if(e.maxRow(i)===0)i--;else{let a=0,o=!1;for(;ae&&(e=this.get(t,n));return e}maxIndex(){K0(this);let e=this.get(0,0),t=[0,0];for(let n=0;ne&&(e=this.get(n,i),t[0]=n,t[1]=i);return t}min(){if(this.isEmpty())return NaN;let e=this.get(0,0);for(let t=0;tt&&(t=this.get(e,n));return t}maxRowIndex(e){xf(this,e),K0(this);let t=this.get(e,0),n=[e,0];for(let i=1;it&&(t=this.get(e,i),n[1]=i);return n}minRow(e){if(xf(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let n=1;nt&&(t=this.get(n,e));return t}maxColumnIndex(e){bf(this,e),K0(this);let t=this.get(0,e),n=[0,e];for(let i=1;it&&(t=this.get(i,e),n[0]=i);return n}minColumn(e){if(bf(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let n=1;n=n)throw new RangeError("min must be smaller than max");let i=new Or(this.rows,this.columns);for(let a=0;a0&&dH(o,{min:t,max:n,output:o}),i.setRow(a,o)}return i}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");let{min:t=0,max:n=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(t>=n)throw new RangeError("min must be smaller than max");let i=new Or(this.rows,this.columns);for(let a=0;an||t<0||t>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let i=new Or(e.length,n-t+1);for(let a=0;a=this.rows)throw new RangeError(`Row index out of range: ${e[a]}`);i.set(a,o-t,this.get(e[a],o))}return i}subMatrixColumn(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.rows-1),t>n||t<0||t>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let i=new Or(n-t+1,e.length);for(let a=0;a=this.columns)throw new RangeError(`Column index out of range: ${e[a]}`);i.set(o-t,a,this.get(o,e[a]))}return i}setSubMatrix(e,t,n){if(e=Or.checkMatrix(e),e.isEmpty())return this;let i=t+e.rows-1,a=n+e.columns-1;vH(this,t,i,n,a);for(let o=0;o=0)if(this.data=[],Number.isInteger(t)&&t>=0)for(let n=0;nMath.abs(e)?(t=e/r,Math.abs(r)*Math.sqrt(1+t*t)):e!==0?(t=r/e,Math.abs(e)*Math.sqrt(1+t*t)):0}var Cg=class{constructor(e,t={}){if(e=LR.checkMatrix(e),e.isEmpty())throw new Error("Matrix must be non-empty");let n=e.rows,i=e.columns,{computeLeftSingularVectors:a=!0,computeRightSingularVectors:o=!0,autoTranspose:s=!1}=t,l=Boolean(a),u=Boolean(o),f=!1,c;if(n=0;M--)if(p[M]!==0){for(let I=M+1;I=0;M--){if(M0;){let M,I;for(M=A-2;M>=-1&&M!==-1;M--){let R=Number.MIN_VALUE+O*Math.abs(p[M]+Math.abs(p[M+1]));if(Math.abs(g[M])<=R||Number.isNaN(g[M])){g[M]=0;break}}if(M===A-2)I=4;else{let R;for(R=A-1;R>=M&&R!==M;R--){let P=(R!==A?Math.abs(g[R]):0)+(R!==M+1?Math.abs(g[R-1]):0);if(Math.abs(p[R])<=O*P){p[R]=0;break}}R===M?I=3:R===A-1?I=1:(I=2,M=R)}switch(M++,I){case 1:{let R=g[A-2];g[A-2]=0;for(let P=A-2;P>=M;P--){let F=Z0(p[P],R),D=p[P]/F,G=R/F;if(p[P]=F,P!==M&&(R=-G*g[P-1],g[P-1]=D*g[P-1]),u)for(let U=0;U=p[M+1]);){let R=p[M];if(p[M]=p[M+1],p[M+1]=R,u&&Mt&&a.set(f,c,e.get(f,c)/this.s[c]);let o=this.U,s=o.rows,l=o.columns,u=new Or(n,s);for(let f=0;fe&&t++;return t}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 Or.diag(this.s)}};var OR=class{constructor(e){this.distances=e.distances,this.dimension=e.dimension||2,this.linkDistance=e.linkDistance}layout(){let e=this,{dimension:t,distances:n,linkDistance:i}=e;try{let a=Or.mul(Or.pow(n,2),-.5),o=a.mean("row"),s=a.mean("column"),l=a.mean();a.add(l).subRowVector(o).subColumnVector(s);let u=new Cg(a),f=Or.sqrt(u.diagonalMatrix).diagonal();return u.leftSingularVectors.toJSON().map(c=>Or.mul([c],[f]).toJSON()[0].splice(0,t))}catch(a){let o=[];for(let s=0;s{n[l]={x:0,y:0}}),e.getRepulsion(),e.updatePositions();return t}getRepulsion(){let e=this,t=e.positions,n=e.nodes,i=e.disp,a=e.k,o=e.radii||[];t.forEach((s,l)=>{i[l]={x:0,y:0},t.forEach((u,f)=>{if(l===f||o[l]!==o[f])return;let c=s[0]-u[0],h=s[1]-u[1],d=Math.sqrt(c*c+h*h);if(d===0){d=1;let p=l>f?1:-1;c=.01*p,h=.01*p}if(d{let c=t[f][0]-t[o][0],h=t[f][1]-t[o][1],d=Math.sqrt(c*c+h*h),p=h/d,v=-c/d,m=Math.sqrt(u.x*u.x+u.y*u.y),g=Math.acos((p*u.x+v*u.y)/m);g>Math.PI/2&&(g-=Math.PI/2,p*=-1,v*=-1);let x=Math.cos(g)*m;u.x=p*x,u.y=v*x});let l=e.radii;t.forEach((u,f)=>{if(f===o)return;let c=Math.sqrt(n[f].x*n[f].x+n[f].y*n[f].y);if(c>0&&f!==o){let h=Math.min(s*(i/Hae),c);if(u[0]+=n[f].x/c*h,u[1]+=n[f].y/c*h,a){let d=u[0]-t[o][0],p=u[1]-t[o][1],v=Math.sqrt(d*d+p*p);d=d/v*l[f],p=p/v*l[f],u[0]=t[o][0]+d,u[1]=t[o][1]+p}}})}};function Yae(r){let e=r.length,t=r[0].length,n=[];for(let i=0;i{n.id===e&&(t=i)}),t}function agt(r,e){return Math.sqrt((r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1]))}var K_=class extends li{constructor(e){super();this.maxIteration=1e3,this.focusNode=null,this.unitRadius=null,this.linkDistance=50,this.preventOverlap=!1,this.strictRadial=!0,this.maxPreventOverlapIteration=200,this.sortStrength=10,this.nodes=[],this.edges=[],this.updateCfg(e)}getDefaultCfg(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}}execute(){let e=this,t=e.nodes,n=e.edges||[];if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let i=e.center;if(t.length===1){t[0].x=i[0],t[0].y=i[1],e.onLayoutEnd&&e.onLayoutEnd();return}let a=e.linkDistance,o=null;if(xg(e.focusNode)){let M=!1;for(let I=0;Ii[0]?i[0]:h-i[0],v=d-i[1]>i[1]?i[1]:d-i[1];p===0&&(p=h/2),v===0&&(v=d/2);let m=v>p?p:v,g=Math.max(...c),x=[];c.forEach((M,I)=>{e.unitRadius||(e.unitRadius=m/g),x[I]=M*e.unitRadius}),e.radii=x;let b=e.eIdealDisMatrix();e.eIdealDistances=b;let S=Yae(b);e.weights=S;let w=new OR({linkDistance:a,distances:b}).layout();w.forEach(M=>{gM(M[0])&&(M[0]=Math.random()*a),gM(M[1])&&(M[1]=Math.random()*a)}),e.positions=w,w.forEach((M,I)=>{t[I].x=M[0]+i[0],t[I].y=M[1]+i[1]}),w.forEach(M=>{M[0]-=w[s][0],M[1]-=w[s][1]}),e.run();let A=e.preventOverlap,L=e.nodeSize,k,O=e.strictRadial;if(A){let M=e.nodeSpacing,I;je(M)?I=()=>M:gf(M)?I=M:I=()=>0,L?da(L)?k=F=>(L[0]>L[1]?L[0]:L[1])+I(F):k=F=>L+I(F):k=F=>F.size?da(F.size)?(F.size[0]>F.size[1]?F.size[0]:F.size[1])+I(F):po(F.size)?(F.size.width>F.size.height?F.size.width:F.size.height)+I(F):F.size+I(F):10+I(F);let R={nodes:t,nodeSizeFunc:k,adjMatrix:l,positions:w,radii:x,height:d,width:h,strictRadial:O,focusID:s,iterations:e.maxPreventOverlapIteration||200,k:w.length/4.5};w=new DR(R).layout()}return w.forEach((M,I)=>{t[I].x=M[0]+i[0],t[I].y=M[1]+i[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n}}run(){let e=this,t=e.maxIteration,n=e.positions||[],i=e.weights||[],a=e.eIdealDistances||[],o=e.radii||[];for(let s=0;s<=t;s++){let l=s/t;e.oneIteration(l,n,o,a,i)}}oneIteration(e,t,n,i,a){let o=this,s=1-e,l=o.focusIndex;t.forEach((u,f)=>{let c=agt(u,[0,0]),h=c===0?0:1/c;if(f===l)return;let d=0,p=0,v=0;t.forEach((g,x)=>{if(f===x)return;let b=agt(u,g),S=b===0?0:1/b,C=i[x][f];v+=a[f][x],d+=a[f][x]*(g[0]+C*(u[0]-g[0])*S),p+=a[f][x]*(g[1]+C*(u[1]-g[1])*S)});let m=n[f]===0?0:1/n[f];v*=s,v+=e*m*m,d*=s,d+=e*m*u[0]*h,u[0]=d/v,p*=s,p+=e*m*u[1]*h,u[1]=p/v})}eIdealDisMatrix(){let e=this,t=e.nodes;if(!t)return[];let n=e.distances,i=e.linkDistance,a=e.radii||[],o=e.unitRadius||50,s=[];return n&&n.forEach((l,u)=>{let f=[];l.forEach((c,h)=>{if(u===h)f.push(0);else if(a[u]===a[h])if(e.sortBy==="data")f.push(c*(Math.abs(u-h)*e.sortStrength)/(a[u]/o));else if(e.sortBy){let d=t[u][e.sortBy]||0,p=t[h][e.sortBy]||0;xg(d)&&(d=d.charCodeAt(0)),xg(p)&&(p=p.charCodeAt(0)),f.push(c*(Math.abs(d-p)*e.sortStrength)/(a[u]/o))}else f.push(c*i/(a[u]/o));else{let d=(i+o)/2;f.push(c*d)}}),s.push(f)}),s}handleInfinity(e,t,n){let i=e.length;for(let a=0;an?e[t][i]:n);return n}getType(){return"radial"}};var Z_=class extends li{constructor(e){super();this.nodeSize=30,this.minNodeSpacing=10,this.preventOverlap=!1,this.equidistant=!1,this.startAngle=3/2*Math.PI,this.clockwise=!0,this.sortBy="degree",this.nodes=[],this.edges=[],this.width=300,this.height=300,this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{nodeSize:30,minNodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}}execute(){let e=this,t=e.nodes,n=e.edges,i=t.length;if(i===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let a=e.center;if(i===1){t[0].x=a[0],t[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd();return}let o=[],s;da(e.nodeSize)?s=Math.max(e.nodeSize[0],e.nodeSize[1]):s=e.nodeSize,t.forEach(p=>{o.push(p);let v=s;da(p.size)?v=Math.max(p.size[0],p.size[1]):je(p.size)?v=p.size:po(p.size)&&(v=Math.max(p.size.width,p.size.height)),s=Math.max(s,v)}),e.clockwise=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise;let l={},u={};if(o.forEach((p,v)=>{l[p.id]=p,u[p.id]=v}),(e.sortBy==="degree"||!xg(e.sortBy)||o[0][e.sortBy]===void 0)&&(e.sortBy="degree",!je(t[0].degree))){let p=Qh(t.length,u,n);o.forEach((v,m)=>{v.degree=p[m]})}o.sort((p,v)=>v[e.sortBy]-p[e.sortBy]),e.maxValueNode=o[0],e.maxLevelDiff=e.maxLevelDiff||e.maxValueNode[e.sortBy]/4;let f=[[]],c=f[0];o.forEach(p=>{if(c.length>0){let v=Math.abs(c[0][e.sortBy]-p[e.sortBy]);e.maxLevelDiff&&v>=e.maxLevelDiff&&(c=[],f.push(c))}c.push(p)});let h=s+e.minNodeSpacing;if(!e.preventOverlap){let p=f.length>0&&f[0].length>1,m=(Math.min(e.width,e.height)/2-h)/(f.length+(p?1:0));h=Math.min(h,m)}let d=0;if(f.forEach(p=>{let v=e.sweep;v===void 0&&(v=2*Math.PI-2*Math.PI/p.length);let m=p.dTheta=v/Math.max(1,p.length-1);if(p.length>1&&e.preventOverlap){let g=Math.cos(m)-Math.cos(0),x=Math.sin(m)-Math.sin(0),b=Math.sqrt(h*h/(g*g+x*x));d=Math.max(b,d)}p.r=d,d+=h}),e.equidistant){let p=0,v=0;for(let m=0;m{g===0&&(v=m.r),m.r=v,v+=p})}return f.forEach(p=>{let v=p.dTheta,m=p.r;p.forEach((g,x)=>{let b=e.startAngle+(e.clockwise?1:-1)*v*x;g.x=a[0]+m*Math.cos(b),g.y=a[1]+m*Math.sin(b)})}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n}}getType(){return"concentric"}};var $_=class extends li{constructor(e){super();this.center=[0,0],this.linkDistance=50,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{center:[0,0],linkDistance:50}}execute(){let e=this,{nodes:t,edges:n=[]}=e,i=e.center;if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}if(t.length===1){t[0].x=i[0],t[0].y=i[1],e.onLayoutEnd&&e.onLayoutEnd();return}let a=e.linkDistance,o=yR({nodes:t,edges:n},!1),s=gR(o);e.handleInfinity(s);let l=xpt(s,a);e.scaledDistances=l;let u=e.runMDS();return e.positions=u,u.forEach((f,c)=>{t[c].x=f[0]+i[0],t[c].y=f[1]+i[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n}}runMDS(){let e=this,t=2,n=e.scaledDistances,i=Or.mul(Or.pow(n,2),-.5),a=i.mean("row"),o=i.mean("column"),s=i.mean();i.add(s).subRowVector(a).subColumnVector(o);let l=new Cg(i),u=Or.sqrt(l.diagonalMatrix).diagonal();return l.leftSingularVectors.toJSON().map(f=>Or.mul([f],[u]).toJSON()[0].splice(0,t))}handleInfinity(e){let t=-999999;e.forEach(n=>{n.forEach(i=>{i!==1/0&&t{n.forEach((a,o)=>{a===1/0&&(e[i][o]=t)})})}getType(){return"mds"}};var qae=800,Q_=class extends li{constructor(e){super();this.maxIteration=1e3,this.workerEnabled=!1,this.gravity=10,this.speed=5,this.clustering=!1,this.clusterGravity=10,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.onLayoutEnd=()=>{},this.tick=()=>{},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}}execute(){var e,t;let n=this,i=n.nodes;if(n.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(n.timeInterval),!i||i.length===0){(e=n.onLayoutEnd)===null||e===void 0||e.call(n);return}!n.width&&typeof window!="undefined"&&(n.width=window.innerWidth),!n.height&&typeof window!="undefined"&&(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);let a=n.center;if(i.length===1){i[0].x=a[0],i[0].y=a[1],(t=n.onLayoutEnd)===null||t===void 0||t.call(n);return}let o={},s={};return i.forEach((l,u)=>{je(l.x)||(l.x=Math.random()*this.width),je(l.y)||(l.y=Math.random()*this.height),o[l.id]=l,s[l.id]=u}),n.nodeMap=o,n.nodeIdxMap=s,n.run()}run(){var e;let t=this,n=t.nodes;if(!n)return;let{edges:i,maxIteration:a,workerEnabled:o,clustering:s}=t,l={};if(s&&n.forEach(u=>{l[u.cluster]===void 0&&(l[u.cluster]={name:u.cluster,cx:0,cy:0,count:0})}),o){for(let u=0;u{var f;t.runOneStep(l),u++,u>=a&&((f=t.onLayoutEnd)===null||f===void 0||f.call(t),window.clearInterval(t.timeInterval))},0)}return{nodes:n,edges:i}}runOneStep(e){var t;let n=this,i=n.nodes;if(!i)return;let{edges:a,center:o,gravity:s,speed:l,clustering:u}=n,f=n.height*n.width,c=Math.sqrt(f)/10,h=f/(i.length+1),d=Math.sqrt(h),p=[];if(i.forEach((v,m)=>{p[m]={x:0,y:0}}),n.applyCalculate(i,a,p,d,h),u){for(let m in e)e[m].cx=0,e[m].cy=0,e[m].count=0;i.forEach(m=>{let g=e[m.cluster];je(m.x)&&(g.cx+=m.x),je(m.y)&&(g.cy+=m.y),g.count++});for(let m in e)e[m].cx/=e[m].count,e[m].cy/=e[m].count;let v=n.clusterGravity||s;i.forEach((m,g)=>{if(!je(m.x)||!je(m.y))return;let x=e[m.cluster],b=Math.sqrt((m.x-x.cx)*(m.x-x.cx)+(m.y-x.cy)*(m.y-x.cy)),S=d*v;p[g].x-=S*(m.x-x.cx)/b,p[g].y-=S*(m.y-x.cy)/b})}i.forEach((v,m)=>{if(!je(v.x)||!je(v.y))return;let g=.01*d*s;p[m].x-=g*(v.x-o[0]),p[m].y-=g*(v.y-o[1])}),i.forEach((v,m)=>{if(je(v.fx)&&je(v.fy)){v.x=v.fx,v.y=v.fy;return}if(!je(v.x)||!je(v.y))return;let g=Math.sqrt(p[m].x*p[m].x+p[m].y*p[m].y);if(g>0){let x=Math.min(c*(l/qae),g);v.x+=p[m].x/g*x,v.y+=p[m].y/g*x}}),(t=n.tick)===null||t===void 0||t.call(n)}applyCalculate(e,t,n,i,a){let o=this;o.calRepulsive(e,n,a),t&&o.calAttractive(t,n,i)}calRepulsive(e,t,n){e.forEach((i,a)=>{t[a]={x:0,y:0},e.forEach((o,s)=>{if(a===s||!je(i.x)||!je(o.x)||!je(i.y)||!je(o.y))return;let l=i.x-o.x,u=i.y-o.y,f=l*l+u*u;if(f===0){f=1;let h=a>s?1:-1;l=.01*h,u=.01*h}let c=n/f;t[a].x+=l*c,t[a].y+=u*c})})}calAttractive(e,t,n){e.forEach(i=>{let a=xn(i,"source"),o=xn(i,"target");if(!a||!o)return;let s=this.nodeIdxMap[a],l=this.nodeIdxMap[o];if(s===l)return;let u=this.nodeMap[a],f=this.nodeMap[o];if(!je(f.x)||!je(u.x)||!je(f.y)||!je(u.y))return;let c=f.x-u.x,h=f.y-u.y,d=Math.sqrt(c*c+h*h),p=d*d/n;t[l].x-=c/d*p,t[l].y-=h/d*p,t[s].x+=c/d*p,t[s].y+=h/d*p})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)}destroy(){let e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0}getType(){return"fruchterman"}};function Ke(r,e,t,n){!t||Object.defineProperty(r,e,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(n):void 0})}function se(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(r){return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Va(r)}function mH(r,e){if(Va(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Va(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function IM(r){var e=mH(r,"string");return Va(e)==="symbol"?e:String(e)}function ogt(r,e){for(var t=0;t0)return!0;var ee=v.get(Et);return ee.delete(St),ee.size>0||v.delete(Et),!0}e("deleteMetadata",k);function O(pt,Et){for(var St=pt.length-1;St>=0;--St){var Wt=pt[St],ee=Wt(Et);if(!tt(ee)&&!et(ee)){if(!Y(ee))throw new TypeError;Et=ee}}return Et}function M(pt,Et,St,Wt){for(var ee=pt.length-1;ee>=0;--ee){var Ue=pt[ee],Ht=Ue(Et,St,Wt);if(!tt(Ht)&&!et(Ht)){if(!$(Ht))throw new TypeError;Wt=Ht}}return Wt}function I(pt,Et,St){var Wt=v.get(pt);if(tt(Wt)){if(!St)return;Wt=new h,v.set(pt,Wt)}var ee=Wt.get(Et);if(tt(ee)){if(!St)return;ee=new h,Wt.set(Et,ee)}return ee}function R(pt,Et,St){var Wt=P(pt,Et,St);if(Wt)return!0;var ee=We(Et);return et(ee)?!1:R(pt,ee,St)}function P(pt,Et,St){var Wt=I(Et,St,!1);return tt(Wt)?!1:dt(Wt.has(pt))}function F(pt,Et,St){var Wt=P(pt,Et,St);if(Wt)return D(pt,Et,St);var ee=We(Et);if(!et(ee))return F(pt,ee,St)}function D(pt,Et,St){var Wt=I(Et,St,!1);if(!tt(Wt))return Wt.get(pt)}function G(pt,Et,St,Wt){var ee=I(St,Wt,!0);ee.set(pt,Et)}function U(pt,Et){var St=j(pt,Et),Wt=We(pt);if(Wt===null)return St;var ee=U(Wt,Et);if(ee.length<=0)return St;if(St.length<=0)return ee;for(var Ue=new d,Ht=[],ae=0,ge=St;ae=0&&ae=this._keys.length?(this._index=-1,this._keys=Et,this._values=Et):this._index++,{value:ge,done:!1}}return{value:void 0,done:!0}},Ht.prototype.throw=function(ae){throw this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),ae},Ht.prototype.return=function(ae){return this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),{value:ae,done:!0}},Ht}();return function(){function Ht(){this._keys=[],this._values=[],this._cacheKey=pt,this._cacheIndex=-2}return Object.defineProperty(Ht.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ht.prototype.has=function(ae){return this._find(ae,!1)>=0},Ht.prototype.get=function(ae){var ge=this._find(ae,!1);return ge>=0?this._values[ge]:void 0},Ht.prototype.set=function(ae,ge){var Ye=this._find(ae,!0);return this._values[Ye]=ge,this},Ht.prototype.delete=function(ae){var ge=this._find(ae,!1);if(ge>=0){for(var Ye=this._keys.length,Ve=ge+1;Ve-1}},{key:"create",value:function(t,n){this.lookup[t]=this.components.length;var i=new this.clazz(n||{});return this.components.push(i),this.entities.push(t),i}},{key:"remove",value:function(t){var n=this.lookup[t];n>-1&&n-1){var i=this.entities[n];if(n-1?this.components[n]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var n=0,i=Object.keys(this.lookup);nr.length)&&(e=r.length);for(var t=0,n=new Array(e);t"),Renderable:Symbol("Factory"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),Geometry:Symbol("Geometry"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),Material:Symbol("Material"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter"),Light:Symbol("Light")};var Ayt=function r(){se(this,r),this.index=void 0};var Myt=function r(){se(this,r),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0};var Tyt=function(){function r(){se(this,r),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return be(r,[{key:"read",value:function(t){return this.reads.find(function(n){return n.index===t.index})||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,n){var i=this.writes.find(function(l){return l.index===n.index});if(i)return n;var a=t.getResourceNode(n);a.resource.version++,a.resource.imported&&(this.hasSideEffect=!0);var o=t.createResourceNode(a.resource),s=t.getResourceNode(o);return s.writer=this,this.writes.push(o),o}}]),r}();function kM(r,e){return kM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},kM(r,e)}function ui(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&kM(r,e)}function ri(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function fi(r,e){if(e&&(Va(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ri(r)}function Zr(r){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zr(r)}var Iyt=function r(){se(this,r),this.first=void 0,this.last=void 0};function ble(r){var e=_le();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function _le(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var jH=function(r){ui(t,r);var e=ble(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;o=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Sle(r,e){if(!!r){if(typeof r=="string")return Nyt(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Nyt(r,e)}}function Nyt(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t-1&&r%1==0&&r<=Cle}function Qle(r){return!!r&&Va(r)==="object"}var HH=Zle;function Fyt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Byt(r){for(var e=1;e0&&arguments[0]!==void 0?arguments[0]:{vertexCount:3},n=t.vertexCount,i=ds();return this.geometry.create(i,{vertexCount:n})}},{key:"createInstancedBufferGeometry",value:function(t){var n=t.maxInstancedCount,i=t.vertexCount,a=ds();return this.geometry.create(a,{maxInstancedCount:n,vertexCount:i})}}]),r}(),Hyt),Wyt=Ze(mN.prototype,"geometry",[zyt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vyt=Ze(mN.prototype,"engine",[Uyt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mN))||jyt);function Yyt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Xyt(r){for(var e=1;eh&&(h=O),Mp&&(p=I),Rm&&(m=P),n[0]=(c+h)*.5,n[1]=(d+p)*.5,n[2]=(v+m)*.5,s[0]=(h-c)*.5,s[1]=(p-d)*.5,s[2]=(m-v)*.5,this.min[0]=c,this.min[1]=d,this.min[2]=v,this.max[0]=h,this.max[1]=p,this.max[2]=m}},{key:"intersects",value:function(t){var n=this.getMax(),i=this.getMin(),a=t.getMax(),o=t.getMin();return i[0]<=a[0]&&n[0]>=o[0]&&i[1]<=a[1]&&n[1]>=o[1]&&i[2]<=a[2]&&n[2]>=o[2]}},{key:"containsPoint",value:function(t){var n=this.getMin(),i=this.getMax();return!(t[0]i[0]||t[1]i[1]||t[2]i[2])}},{key:"getNegativeFarPoint",value:function(t){return t.pnVertexFlag===273?Ft.copy(Ft.create(),this.min):t.pnVertexFlag===272?Ft.fromValues(this.min[0],this.min[1],this.max[2]):t.pnVertexFlag===257?Ft.fromValues(this.min[0],this.max[1],this.min[2]):t.pnVertexFlag===256?Ft.fromValues(this.min[0],this.max[1],this.max[2]):t.pnVertexFlag===17?Ft.fromValues(this.max[0],this.min[1],this.min[2]):t.pnVertexFlag===16?Ft.fromValues(this.max[0],this.min[1],this.max[2]):t.pnVertexFlag===1?Ft.fromValues(this.max[0],this.max[1],this.min[2]):Ft.fromValues(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return t.pnVertexFlag===273?Ft.copy(Ft.create(),this.max):t.pnVertexFlag===272?Ft.fromValues(this.max[0],this.max[1],this.min[2]):t.pnVertexFlag===257?Ft.fromValues(this.max[0],this.min[1],this.max[2]):t.pnVertexFlag===256?Ft.fromValues(this.max[0],this.min[1],this.min[2]):t.pnVertexFlag===17?Ft.fromValues(this.min[0],this.max[1],this.max[2]):t.pnVertexFlag===16?Ft.fromValues(this.min[0],this.max[1],this.min[2]):t.pnVertexFlag===1?Ft.fromValues(this.min[0],this.min[1],this.max[2]):Ft.fromValues(this.min[0],this.min[1],this.min[2])}}]),r}();function aue(r){var e=oue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function oue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var tY=function(r){ui(t,r);var e=aue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.material=void 0,i.geometry=void 0,i.aabb=new oS,i.aabbDirty=!0,i.model=void 0,i.visible=!0,i.children=[],Object.assign(ri(i),n),i}return t}(rl);var eY=z($a());var Tg=z(Zn());var a0t=function(){function r(e,t){se(this,r),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=t||Ft.fromValues(0,1,0),this.updatePNVertexFlag()}return be(r,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return Ft.dot(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Ft.len(this.normal);Ft.scale(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,n,i){var a=this.distanceToPoint(t),o=this.distanceToPoint(n),s=a/(a-o),l=s>=0&&s<=1;return l&&i&&Ft.lerp(i,t,n,s),l}}]),r}();var qp;(function(r){r[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE"})(qp||(qp={}));var o0t=function(){function r(e){if(se(this,r),this.planes=[],e)this.planes=e;else for(var t=0;t<6;t++)this.planes.push(new a0t)}return be(r,[{key:"extractFromVPMatrix",value:function(t){var n=Wp(t,16),i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],u=n[5],f=n[6],c=n[7],h=n[8],d=n[9],p=n[10],v=n[11],m=n[12],g=n[13],x=n[14],b=n[15];Ft.set(this.planes[0].normal,s-i,c-l,v-h),this.planes[0].distance=-(b-m),Ft.set(this.planes[1].normal,s+i,c+l,v+h),this.planes[1].distance=-(b+m),Ft.set(this.planes[2].normal,s+a,c+u,v+d),this.planes[2].distance=-(b+g),Ft.set(this.planes[3].normal,s-a,c-u,v-d),this.planes[3].distance=-(b-g),Ft.set(this.planes[4].normal,s-o,c-f,v-p),this.planes[4].distance=-(b-x),Ft.set(this.planes[5].normal,s+o,c+f,v+p),this.planes[5].distance=-(b+x),this.planes.forEach(function(S){S.normalize(),S.updatePNVertexFlag()})}}]),r}();function s0t(r,e){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e}function l0t(r){var e=Wp(r,3),t=e[0],n=e[1],i=e[2],a=t+n*256+i*65536-1;return a}var u0t,f0t,c0t,h0t,d0t,p0t,v0t,tx,m0t,g0t,y0t,x0t,b0t,_0t;function S0t(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=sue(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function sue(r,e){if(!!r){if(typeof r=="string")return C0t(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return C0t(r,e)}}function C0t(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t0)return qp.OUTSIDE;Ft.dot(f,t.getPositiveFarPoint(i[o]))+c>0&&(a|=l)}}return a}}]),r}(),_0t),m0t=Ze(tx.prototype,"mesh",[f0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g0t=Ze(tx.prototype,"cullable",[c0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),y0t=Ze(tx.prototype,"geometry",[h0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),x0t=Ze(tx.prototype,"hierarchy",[d0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),b0t=Ze(tx.prototype,"transform",[p0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tx))||v0t);var nY=z($a());var rx=z(Zn());var ex=z($a());var $l=z(Zn());var w0t,E0t,A0t,M0t,T0t,I0t,L0t,O0t,D0t,P0t,k0t,R0t,Cc,N0t,F0t,B0t,G0t,z0t,U0t,j0t,W0t,V0t,H0t,Y0t;function gN(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=lue(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lue(r,e){if(!!r){if(typeof r=="string")return X0t(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return X0t(r,e)}}function X0t(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function uue(r,e){if(!!r){if(typeof r=="string")return oxt(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oxt(r,e)}}function oxt(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);tf||h<0||d>c||d<0)){var p,v;return l(e.pickingFBO,function(){p=s({x:Math.round(h),y:Math.round(c-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:e.pickingFBO}),(p[0]!==0||p[1]!==0||p[2]!==0)&&(v=l0t(p),e.highlightEnabled&&e.highlightPickedFeature(p,n))}),v}}}return be(r,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,n){if(t){var i=iY(n.getScene().getEntities()),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=this.mesh.getComponentByEntity(o),l=s.material;l.setUniform("u_PickingStage",aY.HIGHLIGHT),l.setUniform("u_PickingColor",[t[0],t[1],t[2]]),l.setUniform("u_HighlightColor",this.highlightColor)}}catch(u){i.e(u)}finally{i.f()}}}}]),r}(),ixt.IDENTIFIER="PixelPicking Pass",axt),txt=Ze(sS.prototype,"engine",[K0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ext=Ze(sS.prototype,"resourcePool",[Z0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rxt=Ze(sS.prototype,"renderPassFactory",[$0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nxt=Ze(sS.prototype,"mesh",[Q0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sS))||J0t);var sY=z($a());var Kp=z(Zn());var oY=z($a());var FM=z(Zn());var sxt,lxt,uxt,fxt,yN,cxt,hxt,dxt,pxt,fue=`varying vec2 v_UV; uniform sampler2D u_Texture; void main() { gl_FragColor = vec4(texture2D(u_Texture, v_UV)); }`,cue=`attribute vec2 a_Position; varying vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`,hue=`layout(set = 0, binding = 0) uniform sampler u_TextureSampler; layout(set = 0, binding = 1) uniform texture2D u_Texture; layout(location = 0) in vec2 v_UV; layout(location = 0) out vec4 outColor; void main() { outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV); }`,due=`layout(location = 0) in vec2 a_Position; layout(location = 0) out vec2 v_UV; void main() { v_UV = 0.5 * (a_Position + 1.0); gl_Position = vec4(a_Position, 0., 1.); }`,uS=(sxt=(0,FM.injectable)(),lxt=(0,FM.inject)(Qt.RenderEngine),uxt=(0,FM.inject)(Qt.ResourcePool),sxt(fxt=(yN=(pxt=dxt=function r(){var e=this;se(this,r),Ke(this,"engine",cxt,this),Ke(this,"resourcePool",hxt,this),this.model=void 0,this.setup=function(t,n,i){var a=t.getPass(ad.IDENTIFIER);if(a){var o=t.createRenderTarget(n,"render to screen",{width:1,height:1});i.data={input:n.read(a.data.output),output:n.write(t,o)}}},this.execute=function(){var t=Fr(oY.default.mark(function n(i,a){var o,s,l,u,f,c,h;return oY.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(o=e.engine,s=o.createModel,l=o.createAttribute,u=o.createBuffer,e.model){p.next=6;break}return p.next=4,s({vs:e.engine.supportWebGPU?due:cue,fs:e.engine.supportWebGPU?hue:fue,attributes:{a_Position:l({buffer:u({data:[-4,-4,4,-4,0,4],type:Mt.FLOAT}),size:2,arrayStride:2*4,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:f=p.sent,e.model=f;case 6:c=i.getResourceNode(a.data.input),h=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:h}})});case 9:case"end":return p.stop()}},n)}));return function(n,i){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},dxt.IDENTIFIER="Copy Pass",pxt),cxt=Ze(yN.prototype,"engine",[lxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hxt=Ze(yN.prototype,"resourcePool",[uxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yN))||fxt);var vxt,mxt,gxt,yxt,xxt,bxt,_xt,fS,Sxt,Cxt,wxt,Ext,Axt,lY=(vxt=(0,Kp.injectable)(),mxt=(0,Kp.inject)(Qt.Systems),gxt=(0,Kp.named)(Qt.FrameGraphSystem),yxt=(0,Kp.inject)(Qt.RenderPassFactory),xxt=(0,Kp.inject)(Qt.ConfigService),bxt=(0,Kp.inject)(Qt.ResourcePool),vxt(_xt=(fS=(Axt=function(){function r(){se(this,r),Ke(this,"frameGraphSystem",Sxt,this),Ke(this,"renderPassFactory",Cxt,this),Ke(this,"configService",wxt,this),Ke(this,"resourcePool",Ext,this)}return be(r,[{key:"execute",value:function(){var e=Fr(sY.default.mark(function n(i){var a,o,s,l,u,f,c,h,d;return sY.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:a=this.renderPassFactory(ad.IDENTIFIER),o=a.setup,s=a.execute,l=this.frameGraphSystem.addPass(ad.IDENTIFIER,o,s),u=this.renderPassFactory(uS.IDENTIFIER),f=u.setup,c=u.execute,h=u.tearDown,d=this.frameGraphSystem.addPass(uS.IDENTIFIER,f,c,h),this.frameGraphSystem.present(d.data.output);case 5:case"end":return v.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,n){var i=this.renderPassFactory(lS.IDENTIFIER);return i.pick(t,n)}}]),r}(),Axt),Sxt=Ze(fS.prototype,"frameGraphSystem",[mxt,gxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cxt=Ze(fS.prototype,"renderPassFactory",[yxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wxt=Ze(fS.prototype,"configService",[xxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ext=Ze(fS.prototype,"resourcePool",[bxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fS))||_xt);function pue(r){var e=vue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function vue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var uY=function(r){ui(t,r);var e=pue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.parentID=void 0,Object.assign(ri(i),n),i}return t}(rl);var fY=z($a());var cS=z(Zn());var Mxt,Txt,Ixt,Lxt,Oxt,BM,Dxt,Pxt,kxt,Rxt,cY=(Mxt=(0,cS.injectable)(),Txt=(0,cS.inject)(Qt.HierarchyComponentManager),Ixt=(0,cS.inject)(Qt.TransformComponentManager),Lxt=(0,cS.inject)(Qt.MeshComponentManager),Mxt(Oxt=(BM=(Rxt=function(){function r(){se(this,r),Ke(this,"hierarchy",Dxt,this),Ke(this,"transform",Pxt,this),Ke(this,"mesh",kxt,this)}return be(r,[{key:"execute",value:function(){var e=Fr(fY.default.mark(function n(){return fY.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return a.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach(function(n,i){(i.isDirty()||i.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(n)),i.updateTransform())})}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach(function(n,i){var a=t.transform.getComponentByEntity(n),o=t.transform.getComponentByEntity(i.parentID);a!==null&&o!==null&&a.updateTransformWithParent(o)})}},{key:"attach",value:function(t,n,i){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:n});var a=this.mesh.getComponentByEntity(n);if(this.setMeshAABBDirty(a),a&&a.children.indexOf(t)===-1&&a.children.push(t),this.hierarchy.getCount()>1)for(var o=this.hierarchy.getCount()-1;o>0;--o)for(var s=this.hierarchy.getEntity(o),l=0;l0&&arguments[0]!==void 0?arguments[0]:!0;i?this.dirtyFlag|=t.DIRTY:this.dirtyFlag&=~t.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;i?(this.localDirtyFlag|=t.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~t.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&this.parent===null&&(_r.copy(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(i){_r.multiply(this.worldTransform,i.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),_r.getScaling(this.localScale,this.worldTransform),_r.getTranslation(this.localPosition,this.worldTransform),_r.getRotation(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=Ft.fromValues(0,0,0),this.localRotation=Nr.fromValues(0,0,0,1),this.localScale=Ft.fromValues(1,1,1)}},{key:"scaleLocal",value:function(i){return this.setLocalDirty(),Ft.multiply(this.localScale,this.localScale,i),this}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(_r.fromRotationTranslationScale(this.localTransform,this.localRotation,this.localPosition,this.localScale),this.setLocalDirty(!1)),this.localTransform}},{key:"getWorldTransform",value:function(){return!this.isLocalDirty()&&!this.isDirty()?this.worldTransform:(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform)}},{key:"getPosition",value:function(){return _r.getTranslation(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return _r.getRotation(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return _r.getScaling(this.scaling,this.worldTransform),this.scaling}}]),t}(rl);xN.DIRTY=1<<0;var vY=z(Zn()),lbt=z(Fxt());var SN=z(Zn());var Bxt,Gxt,zxt,dY,Uxt,jxt,Wxt=(Bxt=(0,SN.injectable)(),Gxt=(0,SN.inject)(Qt.RenderEngine),Bxt(zxt=(dY=(jxt=function(){function r(){se(this,r),Ke(this,"engine",Uxt,this),this.resourcePool={}}return be(r,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var n=t.descriptor,i=n.width,a=n.height,o=n.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:i,height:a,wrapS:Mt.CLAMP_TO_EDGE,wrapT:Mt.CLAMP_TO_EDGE,usage:o})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),r}(),jxt),Uxt=Ze(dY.prototype,"engine",[Gxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dY))||zxt);function Cue(r){var e=wue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function wue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var Vxt=function(r){ui(t,r);var e=Cue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.name=void 0,i.name=n.name||"",i}return t}(rl);var qxt=z(Zn()),Hxt,Yxt,Xxt,Kxt=(Hxt=(0,qxt.injectable)(),Hxt(Yxt=(Xxt=function(){function r(){se(this,r),this.config=void 0}return be(r,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),r}(),Xxt))||Yxt);var Qxt=z(Zn()),Zxt,$xt,Jxt;(function(r){r.PANSTART="PANSTART",r.PANEND="PANEND",r.PANMOVE="PANMOVE",r.PINCH="PINCH",r.KEYDOWN="KEYDOWN",r.KEYUP="KEYUP",r.HOVER="HOVER"})(Jxt||(Jxt={}));var tbt=(Zxt=(0,Qxt.injectable)(),Zxt($xt=function(){function r(){se(this,r)}return be(r,[{key:"listen",value:function(t){}},{key:"on",value:function(t,n){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),r}())||$xt);var obt=z(Zn());function Eue(r){var e=0;switch(r){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16;break;default:}return e}var Aue=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function pY(r){var e={};return r=r.replace(Aue,function(t,n,i){var a=i.split(":"),o=a[0].trim(),s="";switch(a.length>1&&(s=a[1].trim()),n){case"bool":s=s==="true";break;case"float":case"int":s=Number(s);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":s?s=s.replace("[","").replace("]","").split(",").reduce(function(l,u){return l.push(Number(u.trim())),l},[]):s=new Array(Eue(n)).fill(0);break;default:}return e[o]=s,"uniform ".concat(n," ").concat(o,`; `)}),{content:r,uniforms:e}}function ebt(r){return r.filter(function(e,t,n){return n.indexOf(e)===t})}var rbt,nbt,ibt;function abt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function zM(r){for(var e=1;e 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0; p.x -= clamp( p.x, -2.0, 0.0 ); return -length(p)*sign(p.y); } float sdBox(vec2 p, vec2 b) { vec2 d = abs(p)-b; return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0); } float sdPentagon(vec2 p, float r) { vec3 k = vec3(0.809016994,0.587785252,0.726542528); p.x = abs(p.x); p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y); p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y); p -= vec2(clamp(p.x,-r*k.z,r*k.z),r); return length(p)*sign(p.y); } float sdHexagon(vec2 p, float r) { vec3 k = vec3(-0.866025404,0.5,0.577350269); p = abs(p); p -= 2.0*min(dot(k.xy,p),0.0)*k.xy; p -= vec2(clamp(p.x, -k.z*r, k.z*r), r); return length(p)*sign(p.y); } float sdOctogon(vec2 p, float r) { vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 ); p = abs(p); p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y); p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y); p -= vec2(clamp(p.x, -k.z*r, k.z*r), r); return length(p)*sign(p.y); } float sdHexagram(vec2 p, float r) { vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076); p = abs(p); p -= 2.0*min(dot(k.xy,p),0.0)*k.xy; p -= 2.0*min(dot(k.yx,p),0.0)*k.yx; p -= vec2(clamp(p.x,r*k.z,r*k.w),r); return length(p)*sign(p.y); } float sdRhombus(vec2 p, vec2 b) { vec2 q = abs(p); float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0); float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) ); return d * sign( q.x*b.y + q.y*b.x - b.x*b.y ); } float sdVesica(vec2 p, float r, float d) { p = abs(p); float b = sqrt(r*r-d*d); // can delay this sqrt return ((p.y-b)*d>p.x*b) ? length(p-vec2(0.0,b)) : length(p-vec2(-d,0.0))-r; }`,Lue=/precision\s+(high|low|medium)p\s+float/,Oue=`#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif `,Due=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,sbt=(rbt=(0,obt.injectable)(),rbt(nbt=(ibt=function(){function r(){se(this,r),this.moduleCache={},this.rawContentCache={}}return be(r,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:Tue,fs:Mue}),this.registerModule("sdf2d",{vs:"",fs:Iue})}},{key:"registerModule",value:function(t,n){if(!this.rawContentCache[t]){var i=n.vs,a=i===void 0?"":i,o=n.fs,s=o===void 0?"":o,l=n.uniforms,u=pY(a),f=u.content,c=u.uniforms,h=pY(s),d=h.content,p=h.uniforms;this.rawContentCache[t]={fs:d,uniforms:zM(zM(zM({},c),p),l),vs:f}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var n=this;if(this.moduleCache[t])return this.moduleCache[t];var i=this.rawContentCache[t].vs||"",a=this.rawContentCache[t].fs||"",o=this.processModule(i,[],"vs"),s=o.content,l=o.includeList,u=this.processModule(a,[],"fs"),f=u.content,c=u.includeList,h=f,d=ebt(l.concat(c).concat(t)).reduce(function(p,v){return zM(zM({},p),n.rawContentCache[v].uniforms)},{});return Lue.test(f)||(h=Oue+f),this.moduleCache[t]={fs:h.trim(),uniforms:d,vs:s.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,n,i){var a=this,o=t.replace(Due,function(s,l){var u=l.split(" "),f=u[0].replace(/"/g,"");if(n.indexOf(f)>-1)return"";var c=a.rawContentCache[f][i];n.push(f);var h=a.processModule(c||"",n,i),d=h.content;return d});return{content:o,includeList:n}}}]),r}(),ibt))||nbt);var wc=new vY.Container,nPr=(0,lbt.default)(wc,!1);wc.bind(Qt.ShaderModuleService).to(sbt).inSingletonScope();wc.bind(Qt.NameComponentManager).toConstantValue(new jp(Vxt));wc.bind(Qt.HierarchyComponentManager).toConstantValue(new jp(uY));wc.bind(Qt.TransformComponentManager).toConstantValue(new jp(xN));wc.bind(Qt.MeshComponentManager).toConstantValue(new jp(tY));wc.bind(Qt.CullableComponentManager).toConstantValue(new jp(JH));wc.bind(Qt.GeometryComponentManager).toConstantValue(new jp(YH));wc.bind(Qt.MaterialComponentManager).toConstantValue(new jp(KH));function mY(){var r=new vY.Container;return r.parent=wc,r.bind(Qt.Systems).to(cY).inSingletonScope().whenTargetNamed(Qt.SceneGraphSystem),r.bind(Qt.Systems).to(VH).inSingletonScope().whenTargetNamed(Qt.FrameGraphSystem),r.bind(Qt.Systems).to(rY).inSingletonScope().whenTargetNamed(Qt.MeshSystem),r.bind(Qt.Systems).to(qH).inSingletonScope().whenTargetNamed(Qt.GeometrySystem),r.bind(Qt.Systems).to($H).inSingletonScope().whenTargetNamed(Qt.MaterialSystem),r.bind(Qt.Systems).to(lY).inSingletonScope().whenTargetNamed(Qt.RendererSystem),r.bind(Qt.ResourcePool).to(Wxt).inSingletonScope(),r.bind(Qt.ConfigService).to(Kxt).inSingletonScope(),r.bind(Qt.InteractorService).to(tbt).inSingletonScope(),r.bind(Qt.RenderPass).to(ad).inSingletonScope().whenTargetNamed(ad.IDENTIFIER),r.bind(Qt.RenderPass).to(uS).inSingletonScope().whenTargetNamed(uS.IDENTIFIER),r.bind(Qt.RenderPass).to(lS).inSingletonScope().whenTargetNamed(lS.IDENTIFIER),r.bind(Qt.RenderPassFactory).toFactory(function(e){return function(t){return e.container.getNamed(Qt.RenderPass,t)}}),r}function nx(r){for(var e=new oS,t=Ft.fromValues(r[0],r[1],r[2]),n=Ft.fromValues(r[0],r[1],r[2]),i=3;in[0]&&(n[0]=a),o>n[1]&&(n[1]=o),s>n[2]&&(n[2]=s)}return e.setMinMax(t,n),e}var Do=typeof navigator!="undefined"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);var SPr=Ft.create();var MPr=Ft.create(),TPr=Ft.create(),IPr=Ft.create(),LPr=Ft.create(),OPr=Ft.create();var ubt;(function(r){r.Normal="normal",r.PostProcessing="post-processing"})(ubt||(ubt={}));var od;(function(r){r.Void="Void",r.Boolean="Boolean",r.Float="Float",r.Uint32="Uint32",r.Int32="Int32",r.Vector="Vector",r.Vector2Float="vec2",r.Vector3Float="vec3",r.Vector4Float="vec4",r.Vector2Boolean="vec2",r.Vector3Boolean="vec3",r.Vector4Boolean="vec4",r.Vector2Uint="vec2",r.Vector3Uint="vec3",r.Vector4Uint="vec4",r.Vector2Int="vec2",r.Vector3Int="vec3",r.Vector4Int="vec4",r.Matrix="Matrix",r.Matrix3x3Float="mat3x3",r.Matrix4x4Float="mat4x4",r.Struct="Struct",r.FloatArray="Float[]",r.Vector4FloatArray="vec4[]"})(od||(od={}));var fbt;(function(r){r.Program="Program",r.Identifier="Identifier",r.VariableDeclaration="VariableDeclaration",r.BlockStatement="BlockStatement",r.ReturnStatement="ReturnStatement",r.FunctionDeclaration="FunctionDeclaration",r.VariableDeclarator="VariableDeclarator",r.AssignmentExpression="AssignmentExpression",r.LogicalExpression="LogicalExpression",r.BinaryExpression="BinaryExpression",r.ArrayExpression="ArrayExpression",r.UnaryExpression="UnaryExpression",r.UpdateExpression="UpdateExpression",r.FunctionExpression="FunctionExpression",r.MemberExpression="MemberExpression",r.ConditionalExpression="ConditionalExpression",r.ExpressionStatement="ExpressionStatement",r.CallExpression="CallExpression",r.NumThreadStatement="NumThreadStatement",r.StorageStatement="StorageStatement",r.DoWhileStatement="DoWhileStatement",r.WhileStatement="WhileStatement",r.ForStatement="ForStatement",r.BreakStatement="BreakStatement",r.ContinueStatement="ContinueStatement",r.IfStatement="IfStatement",r.ImportedFunctionStatement="ImportedFunctionStatement"})(fbt||(fbt={}));var Ec;(function(r){r.Input="Input",r.Output="Output",r.Uniform="Uniform",r.Workgroup="Workgroup",r.UniformConstant="UniformConstant",r.Image="Image",r.StorageBuffer="StorageBuffer",r.Private="Private",r.Function="Function"})(Ec||(Ec={}));var dS;(function(r){r.GLSL100="GLSL100",r.GLSL450="GLSL450",r.WGSL="WGSL"})(dS||(dS={}));var cbt="__DefineValuePlaceholder__";var CN=z(Zn());function pS(r){return typeof r=="number"}function sd(r){return r===void 0?0:r>360||r<-360?r%360:r}function Ig(r,e,t){return pS(r)?Ft.fromValues(r,e,t):r.length===3?Ft.clone(r):Ft.fromValues(r[0],r[1],r[2])}var gY=function(){function r(e,t){se(this,r),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=_r.clone(t.matrix),this.right=Ft.clone(t.right),this.up=Ft.clone(t.up),this.forward=Ft.clone(t.forward),this.position=Ft.clone(t.position),this.focalPoint=Ft.clone(t.focalPoint),this.distanceVector=Ft.clone(t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance}return be(r,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=_r.copy(t.matrix,this.matrix),t.right=Ft.copy(t.right,this.right),t.up=Ft.copy(t.up,this.up),t.forward=Ft.copy(t.forward,this.forward),t.position=Ft.copy(t.position,this.position),t.focalPoint=Ft.copy(t.focalPoint,this.focalPoint),t.distanceVector=Ft.copy(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),r}();var hbt,dbt,pbt,yY,vbt,mbt,gbt,Ti;(function(r){r.ORBITING="ORBITING",r.EXPLORING="EXPLORING",r.TRACKING="TRACKING"})(Ti||(Ti={}));var wN;(function(r){r.DEFAULT="DEFAULT",r.ROTATIONAL="ROTATIONAL",r.TRANSLATIONAL="TRANSLATIONAL",r.CINEMATIC="CINEMATIC"})(wN||(wN={}));var ix;(function(r){r.ORTHOGRAPHIC="ORTHOGRAPHIC",r.PERSPECTIVE="PERSPECTIVE"})(ix||(ix={}));var Zp=Math.PI/180,Lg=180/Math.PI,EN=(hbt=(0,CN.injectable)(),dbt=(0,CN.inject)(Qt.InteractorService),hbt(pbt=(yY=(gbt=mbt=function(){function r(){se(this,r),this.matrix=_r.create(),this.right=Ft.fromValues(1,0,0),this.up=Ft.fromValues(0,1,0),this.forward=Ft.fromValues(0,0,1),this.position=Ft.fromValues(0,0,1),this.focalPoint=Ft.fromValues(0,0,0),this.distanceVector=Ft.fromValues(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.rotateWorld=!1,Ke(this,"interactor",vbt,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=_r.create(),this.view=void 0,this.following=void 0,this.type=Ti.EXPLORING,this.trackingMode=wN.DEFAULT,this.projectionMode=ix.PERSPECTIVE,this.frustum=new o0t,this.landmarks=[],this.landmarkAnimationID=void 0}return be(r,[{key:"clone",value:function(){var t=new r;return t.setType(this.type,void 0),t.interactor=this.interactor,t}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,n){return this.type=t,this.type===Ti.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ti.TRACKING&&n!==void 0&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Ti.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return _r.invert(_r.create(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,n,i,a,o,s){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=o,this.view.height=s,this.projectionMode===ix.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===ix.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,n,i,a){return this.projectionMode=ix.PERSPECTIVE,this.fov=i,this.near=t,this.far=n,this.aspect=a,_r.perspective(this.perspective,this.fov*Zp,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,n,i,a,o,s){this.projectionMode=ix.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=i,this.bottom=a,this.near=o,this.far=s;var l=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),f=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=f-l,d=f+l,p=c+u,v=c-u;if(this.view!==void 0&&this.view.enabled){var m=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h+=m*this.view.offsetX,d=h+m*this.view.width,p-=g*this.view.offsetY,v=p-g*this.view.height}return _r.ortho(this.perspective,h,d,p,v,o,s),this}},{key:"setPosition",value:function(t,n,i){return this._setPosition(t,n,i),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,n,i){var a=Ft.fromValues(0,1,0);if(this.focalPoint=Ig(t,n,i),this.trackingMode===wN.CINEMATIC){var o=Ft.subtract(Ft.create(),this.focalPoint,this.position);t=o[0],n=o[1],i=o[2];var s=Ft.length(o),l=Math.asin(n/s)*Lg,u=90+Math.atan2(i,t)*Lg,f=_r.create();_r.rotateY(f,f,u*Zp),_r.rotateX(f,f,l*Zp),a=Ft.transformMat4(Ft.create(),[0,1,0],f)}return _r.invert(this.matrix,_r.lookAt(_r.create(),this.position,this.focalPoint,a)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var n=Ft.create();t=this.distance;var i=this.forward,a=this.focalPoint;return n[0]=t*i[0]+a[0],n[1]=t*i[1]+a[1],n[2]=t*i[2]+a[2],this._setPosition(n),this}}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=sd(t),this.computeMatrix(),this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=sd(t),this.computeMatrix(),this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=sd(t),this.computeMatrix(),this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,n,i){if(this.type===Ti.EXPLORING){t=sd(t),n=sd(n),i=sd(i);var a=Nr.setAxisAngle(Nr.create(),[1,0,0],(this.rotateWorld?1:-1)*n*Zp),o=Nr.setAxisAngle(Nr.create(),[0,1,0],(this.rotateWorld?1:-1)*t*Zp),s=Nr.setAxisAngle(Nr.create(),[0,0,1],i*Zp),l=Nr.multiply(Nr.create(),o,a);l=Nr.multiply(Nr.create(),l,s);var u=_r.fromQuat(_r.create(),l);_r.translate(this.matrix,this.matrix,[0,0,-this.distance]),_r.multiply(this.matrix,this.matrix,u),_r.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+n)>90)return;this.relElevation=sd(n),this.relAzimuth=sd(t),this.relRoll=sd(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,n){var i=Ig(t,n,0),a=Ft.clone(this.position);return Ft.add(a,a,Ft.scale(Ft.create(),this.right,i[0])),Ft.add(a,a,Ft.scale(Ft.create(),this.up,i[1])),this._setPosition(a),this}},{key:"dolly",value:function(t){var n=this.forward,i=Ft.clone(this.position),a=t*this.dollyingStep,o=this.distance+t*this.dollyingStep;return a=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,i[0]+=a*n[0],i[1]+=a*n[1],i[2]+=a*n[2],this._setPosition(i),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getDistance():this.type===Ti.TRACKING&&Ft.add(this.focalPoint,i,this.distanceVector),this}},{key:"createLandmark",value:function(t,n){var i=this.clone();i.setPosition(n.position),i.setFocalPoint(n.focalPoint),n.roll!==void 0&&i.setRoll(n.roll);var a=new gY(t,i);return this.landmarks.push(a),a}},{key:"setLandmark",value:function(t){var n=new gY(t,this);return this.landmarks.push(n),this}},{key:"gotoLandmark",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3,a=this.landmarks.find(function(c){return c.name===t});if(a){if(i===0){a.retrieve(this);return}this.landmarkAnimationID!==void 0&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var o=a.getPosition(),s=a.getFocalPoint(),l=a.getRoll(),u,f=function c(h){u===void 0&&(u=h);var d=h-u,p=(1-Math.cos(d/i*Math.PI))/2,v=Ft.create(),m=Ft.create(),g=0;Ft.lerp(v,n.focalPoint,s,p),Ft.lerp(m,n.position,o,p),g=n.roll*(1-p)+l*p,n.setFocalPoint(v),n.setPosition(m),n.setRoll(g),n.computeMatrix();var x=Ft.dist(v,s)+Ft.dist(m,o);if(!(x>.01)){n.setFocalPoint(v),n.setPosition(m),n.setRoll(g),n.computeMatrix(),n.interactor.connect();return}d-1&&r%1==0&&r<=ufe}function Bfe(r){return!!r&&Va(r)==="object"}var TN=Nfe;var Ebt,Abt,Mbt,Tbt,IN,Ibt,Lbt,Obt;function Dbt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Pbt(r){for(var e=1;e0&&s[0]!==void 0?s[0]:1,!this.dirty){u.next=6;break}return this.compiledBundle.context&&(a>1?this.compiledBundle.context.maxIteration=a:this.compiledBundle.context.maxIteration++),u.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(f){var c=f.isReferer;return c}).forEach(function(f){var c=f.data,h=f.name;i.model.confirmInput(c.model,h)}),o=0;o-1&&r%1==0&&r<=Gfe}function pce(r){return!!r&&Va(r)==="object"}var qM=hce;function u1t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function f1t(r){for(var e=1;e16)throw new Error("invalid data type ".concat(c));i[f]=function(){return u.data}}});var a=this.getOuputDataTexture(),o=a.textureWidth,s=a.texelCount;i.u_OutputTextureSize=[o,o],i.u_OutputTexelCount=s,this.context.output.textureSize=[o,o];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 precision highp float; #else precision mediump float; #endif `.concat(this.context.shader),uniforms:i,vert:vce,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return be(r,[{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()}),NN&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var e=Fr(IY.default.mark(function n(){var i=this,a,o,s,l,u,f,c,h;return IY.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){a=i.reGl.read()}),!a){p.next=6;break}if(o=this.getOuputDataTexture(),s=o.originalDataLength,l=o.elementsPerTexel,u=o.typedArrayConstructor,f=u===void 0?Float32Array:u,c=[],l!==4)for(h=0;h2&&arguments[2]!==void 0?arguments[2]:0,a=this.context.uniforms.find(function(u){var f=u.name;return f===t});if(a){var o=this.calcDataTexture(t,a.type,n),s=o.texture,l=o.data;this.textureCache[t].data=l,this.textureCache[t].texture=s}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var n=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=n,NN&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var n=t.data,i=t.textureWidth;return f1t(f1t({},t),{},{id:c1t++,texture:this.reGl.texture({width:i,height:i,data:n,type:"float"})})}},{key:"calcDataTexture",value:function(t,n,i){var a=1;n===od.Vector4FloatArray&&(a=4);for(var o=[],s=0;s0){var x=4-g;if(m>1&&m<=x)m===2&&(x===3&&(f+=4,c.push(0)),c.push.apply(c,Ui(p.data)),i.uniformGPUBufferLayout.push({name:p.name,offset:f}));else{for(var b=0;b2&&arguments[2]!==void 0?arguments[2]:0,a=this.vertexBuffers[t];a&&a.subData({data:n,offset:i})}},{key:"updateUniform",value:function(t,n){var i=this.uniformGPUBufferLayout.find(function(a){return a.name===t});i&&this.uniformBuffer.subData({data:Number.isFinite(n)?new Float32Array([n]):new Float32Array(n),offset:i.offset})}},{key:"confirmInput",value:function(t,n){var i=this.vertexBuffers[n],a=t.outputBuffer;if(i&&a&&i!==a){var o=this.engine.device.createCommandEncoder(),s=t.context.output,l=s.length,u=s.typedArrayConstructor,f=l*u.BYTES_PER_ELEMENT;o.copyBufferToBuffer(a.get(),0,i.get(),0,f);var c=Do?this.engine.device.getQueue():this.engine.device.defaultQueue;c.submit([o.finish()])}}},{key:"compileShaderToSpirV",value:function(t,n,i){return this.compileRawShaderToSpirV(i+t,n)}},{key:"compileRawShaderToSpirV",value:function(t,n){return this.engine.glslang.compileGLSL(t,n)}},{key:"compileComputePipelineStageDescriptor",value:function(){var e=Fr(ux.default.mark(function n(i){var a,o;return ux.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(a=i,o=`#version 450 `,this.engine.options.useWGSL){l.next=6;break}return l.next=5,this.compileShaderToSpirV(i,"compute",o);case 5:a=l.sent;case 6:return l.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:a,isWHLSL:Do}),entryPoint:"main"}});case 7:case"end":return l.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()}]),r}();var RY=z(Ac());var I1t=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.indexCount=void 0,this.buffer=void 0;var n=t,i=n.data,a=n.usage,o=n.type,s=n.count;this.indexCount=s||0,this.buffer=new cd(e,{data:i instanceof Array?new Uint16Array(i):i,usage:RY.BufferUsage.Index|RY.BufferUsage.CopyDst})}return be(r,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),r}();var L1t=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var n=t,i=n.width,a=n.height,o=n.color,s=n.colors,l=n.depth,u=n.stencil;o&&(this.colorTexture=o),l&&(this.depthTexture=l)}return be(r,[{key:"get",value:function(){var t,n;return{color:(t=this.colorTexture)===null||t===void 0?void 0:t.get(),depth:(n=this.depthTexture)===null||n===void 0?void 0:n.get()}}},{key:"destroy",value:function(){var t,n;(t=this.colorTexture)===null||t===void 0||t.destroy(),(n=this.depthTexture)===null||n===void 0||n.destroy()}},{key:"resize",value:function(t){var n=t.width,i=t.height;if(n!==this.width||i!==this.height){var a,o;(a=this.colorTexture)===null||a===void 0||a.resize({width:n,height:i}),(o=this.depthTexture)===null||o===void 0||o.resize({width:n,height:i})}this.width=n,this.height=i}}]),r}();var ZM=z($a());var Qo=z(Ac());var tn=z(Ac()),ev,hd,fx,il,yS,BN,KM,O1t=(ev={},qt(ev,Mt.POINTS,tn.PrimitiveTopology.PointList),qt(ev,Mt.LINES,tn.PrimitiveTopology.LineList),qt(ev,Mt.LINE_LOOP,tn.PrimitiveTopology.LineList),qt(ev,Mt.LINE_STRIP,tn.PrimitiveTopology.LineStrip),qt(ev,Mt.TRIANGLES,tn.PrimitiveTopology.TriangleList),qt(ev,Mt.TRIANGLE_FAN,tn.PrimitiveTopology.TriangleList),qt(ev,Mt.TRIANGLE_STRIP,tn.PrimitiveTopology.TriangleStrip),ev),yce=(hd={},qt(hd,Mt.NEVER,tn.CompareFunction.Never),qt(hd,Mt.ALWAYS,tn.CompareFunction.Always),qt(hd,Mt.LESS,tn.CompareFunction.Less),qt(hd,Mt.LEQUAL,tn.CompareFunction.LessEqual),qt(hd,Mt.GREATER,tn.CompareFunction.Greater),qt(hd,Mt.GEQUAL,tn.CompareFunction.GreaterEqual),qt(hd,Mt.EQUAL,tn.CompareFunction.Equal),qt(hd,Mt.NOTEQUAL,tn.CompareFunction.NotEqual),hd),D1t=(fx={},qt(fx,Mt.FUNC_ADD,tn.BlendOperation.Add),qt(fx,Mt.MIN_EXT,tn.BlendOperation.Min),qt(fx,Mt.MAX_EXT,tn.BlendOperation.Max),qt(fx,Mt.FUNC_SUBTRACT,tn.BlendOperation.Subtract),qt(fx,Mt.FUNC_REVERSE_SUBTRACT,tn.BlendOperation.ReverseSubtract),fx),GN=(il={},qt(il,Mt.ZERO,tn.BlendFactor.Zero),qt(il,Mt.ONE,tn.BlendFactor.One),qt(il,Mt.SRC_COLOR,tn.BlendFactor.SrcColor),qt(il,Mt.ONE_MINUS_SRC_COLOR,tn.BlendFactor.OneMinusSrcColor),qt(il,Mt.SRC_ALPHA,tn.BlendFactor.SrcAlpha),qt(il,Mt.ONE_MINUS_SRC_ALPHA,tn.BlendFactor.OneMinusSrcAlpha),qt(il,Mt.DST_COLOR,tn.BlendFactor.DstColor),qt(il,Mt.ONE_MINUS_DST_COLOR,tn.BlendFactor.OneMinusDstColor),qt(il,Mt.DST_ALPHA,tn.BlendFactor.DstAlpha),qt(il,Mt.ONE_MINUS_DST_ALPHA,tn.BlendFactor.OneMinusDstAlpha),qt(il,Mt.CONSTANT_COLOR,tn.BlendFactor.BlendColor),qt(il,Mt.ONE_MINUS_CONSTANT_COLOR,tn.BlendFactor.OneMinusBlendColor),qt(il,Mt.SRC_ALPHA_SATURATE,tn.BlendFactor.SrcAlphaSaturated),il),P1t=(yS={},qt(yS,Mt.ALPHA,"r8unorm"),qt(yS,Mt.RGBA,"rgba8unorm"),qt(yS,Mt.DEPTH_COMPONENT,"depth32float"),qt(yS,Mt.DEPTH_STENCIL,"depth24plus-stencil8"),yS),NY=(BN={},qt(BN,Mt.NEAREST,"nearest"),qt(BN,Mt.LINEAR,"linear"),BN),zN=(KM={},qt(KM,Mt.REPEAT,"repeat"),qt(KM,Mt.CLAMP_TO_EDGE,"clamp-to-edge"),qt(KM,Mt.MIRRORED_REPEAT,"mirror-repeat"),KM);function k1t(r){var e=r.cull;if(!e||!e.enable)return tn.CullMode.None;if(e.face)return e.face===Mt.FRONT?tn.CullMode.Front:tn.CullMode.Back}function R1t(r){var e=r.depth,t=r.stencil,n={compare:tn.CompareFunction.Always,depthFailOp:tn.StencilOperation.Keep,failOp:tn.StencilOperation.Keep,passOp:tn.StencilOperation.Keep};return{depthWriteEnabled:e&&e.enable,depthCompare:yce[(e==null?void 0:e.func)||Mt.ALWAYS],format:tn.TextureFormat.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function N1t(r,e){var t=r.blend;return[{format:e,alphaBlend:{srcFactor:GN[t&&t.func&&t.func.srcAlpha||Mt.ONE],dstFactor:GN[t&&t.func&&t.func.dstAlpha||Mt.ZERO],operation:D1t[t&&t.equation&&t.equation.alpha||Mt.FUNC_ADD]},colorBlend:{srcFactor:GN[t&&t.func&&t.func.srcRGB||Mt.ONE],dstFactor:GN[t&&t.func&&t.func.dstRGB||Mt.ZERO],operation:D1t[t&&t.equation&&t.equation.rgb||Mt.FUNC_ADD]},writeMask:tn.ColorWrite.All}]}function F1t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function xS(r){for(var e=1;e1?t-1:0),i=1;i3&&arguments[3]!==void 0?arguments[3]:!1,l=(a=t.get().color)===null||a===void 0?void 0:a.texture,u;l&&(u=l.createView(this.currentRenderTargetViewDescriptor));var f=(o=t.get().depth)===null||o===void 0?void 0:o.texture,c;f&&(c=f.createView());var h=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:u,loadValue:n!==null?n:Ii.LoadOp.Load,storeOp:Ii.StoreOp.Store}],depthStencilAttachment:f&&c?{attachment:c,depthLoadValue:i?this.clearDepthValue:Ii.LoadOp.Load,depthStoreOp:Ii.StoreOp.Store,stencilLoadValue:s?this.clearStencilValue:Ii.LoadOp.Load,stencilStoreOp:Ii.StoreOp.Store}:void 0});this.currentRenderPass=h,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&this.currentRenderPass!==null&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),r}(),j1t))||U1t);var vwt=z(Ac()),XN=z(Zn());var Y1t=z(Zn());var V1t,H1t;function bce(r){var e=_ce();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function _ce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var BY=4/64,X1t=1-BY*2,q1t=(V1t=(0,Y1t.injectable)(),V1t(H1t=function(r){ui(t,r);var e=bce(t);function t(){return se(this,t),e.apply(this,arguments)}return be(t,[{key:"onEntityCreated",value:function(){var i=this.config,a=i.widthSegments,o=a===void 0?1:a,s=i.heightSegments,l=s===void 0?1:s,u=i.depthSegments,f=u===void 0?1:u,c=i.halfExtents,h=c===void 0?Ft.fromValues(.5,.5,.5):c,d=o,p=l,v=f,m=Wp(h,3),g=m[0],x=m[1],b=m[2],S=[Ft.fromValues(-g,-x,b),Ft.fromValues(g,-x,b),Ft.fromValues(g,x,b),Ft.fromValues(-g,x,b),Ft.fromValues(g,-x,-b),Ft.fromValues(-g,-x,-b),Ft.fromValues(-g,x,-b),Ft.fromValues(g,x,-b)],C=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],w=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],A={FRONT:0,BACK:1,TOP:2,BOTTOM:3,RIGHT:4,LEFT:5},L=[],k=[],O=[],M=[],I=[],R=0,P=function(U,j,H){var tt,et,ut,$;for(ut=0;ut<=j;ut++)for($=0;$<=H;$++){var st=Ft.create(),_t=Ft.create(),dt=Ft.create(),gt=Ft.create();Ft.lerp(st,S[C[U][0]],S[C[U][1]],ut/j),Ft.lerp(_t,S[C[U][0]],S[C[U][2]],$/H),Ft.sub(dt,_t,S[C[U][0]]),Ft.add(gt,st,dt),tt=ut/j,et=$/H,L.push(gt[0],gt[1],gt[2]),k.push(w[U][0],w[U][1],w[U][2]),O.push(tt,et),tt/=3,et/=3,tt=tt*X1t+BY,et=et*X1t+BY,tt+=U%3/3,et+=Math.floor(U/3)/3,M.push(tt,et),ut 0.1) { // gl_FragColor = mix(gl_FragColor, u_GridColor, v0); // } // else { gl_FragColor = mix(gl_FragColor, u_GridColor2, v1); // } } // float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n); // vec3 diffuseColor = u_LightColor * NdotL * shadowFactor; // gl_FragColor.rgb *= diffuseColor; }`,Fce=`attribute vec3 a_Position; varying vec3 v_Position; uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix; void main() { v_Position = a_Position; gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.); }`,M_t=(m_t=(0,nv.injectable)(),g_t=(0,nv.inject)(Qt.Systems),y_t=(0,nv.named)(Qt.MaterialSystem),x_t=(0,nv.inject)(Qt.Systems),b_t=(0,nv.named)(Qt.GeometrySystem),__t=(0,nv.inject)(Qt.ShaderModuleService),m_t(S_t=(QM=(A_t=function(r){ui(t,r);var e=kce(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;oh;if(!isFinite(A)){(0,dd.normal)(u,n),VN(p,d,C,u,1),v.push(s===1?[b,b+2,b+3]:[b+2,b+1,b+3]),c+=2,s=L;continue}k?(A=h,m.push(x/g),JM(d,u,-L),p.push(C),JM(d,o,A*L),p.push(C),v.push(s!==-L?[b,b+2,b+3]:[b+2,b+1,b+3]),v.push([b+2,b+3,b+4]),(0,dd.normal)(f,i),(0,cx.copy)(u,f),JM(d,u,-L),p.push(C),c+=3):(VN(p,d,C,o,A),v.push(s===1?[b,b+2,b+3]:[b+2,b+1,b+3]),L=-1,(0,cx.copy)(u,o),c+=2),s=L}}return{normals:d,attrIndex:v,attrPos:p,attrCounters:m}}var rCt,nCt,iCt,aCt,oCt,sCt,lCt,tT,uCt,fCt,cCt,hCt;function Che(r){var e=whe();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function whe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var Ehe=`uniform float u_dash_array : 0.02; uniform float u_dash_offset : 0; uniform float u_dash_ratio : 0; uniform float u_thickness : 0.02; varying vec4 v_color; varying vec2 v_normal; varying float v_counters; void main() { float blur = 1. - smoothstep(0.98, 1., length(v_normal)); gl_FragColor = v_color; gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio)); }`,Ahe=`attribute vec2 a_pos; attribute vec4 a_color; attribute float a_line_miter; attribute vec2 a_line_normal; attribute float a_counters; uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix; uniform float u_thickness : 0.02; uniform vec2 u_viewport; varying vec4 v_color; varying vec2 v_normal; varying float v_counters; void main() { v_color = a_color; v_counters = a_counters; vec3 normal = normalize(vec3(a_line_normal, 0.0)); vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0); v_normal = vec2(normal * sign(a_line_miter)); gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset; } `,dCt=(rCt=(0,iv.injectable)(),nCt=(0,iv.inject)(Qt.Systems),iCt=(0,iv.named)(Qt.MaterialSystem),aCt=(0,iv.inject)(Qt.Systems),oCt=(0,iv.named)(Qt.GeometrySystem),sCt=(0,iv.inject)(Qt.ShaderModuleService),rCt(lCt=(tT=(hCt=function(r){ui(t,r);var e=Che(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;o>8&255,r+1>>8>>8&255]}var vCt,mCt,gCt,yCt,xCt,bCt,_Ct,eT,SCt,CCt,wCt,ECt;function ACt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Mhe(r){for(var e=1;e=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Phe(r,e){if(!!r){if(typeof r=="string")return BCt(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return BCt(r,e)}}function BCt(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t0&&arguments[0]!==void 0?arguments[0]:{},n=mY(),i=navigator.gpu?FY:OY;n.isBound(Qt.RenderEngine)||n.bind(Qt.RenderEngine).to(i).inSingletonScope(),n.bind(QY).toSelf(),n.bind(LN).toSelf(),n.bind(Iu).toSelf(),n.bind(nX).toSelf(),n.bind(EN).toSelf(),n.bind(JY).toSelf(),n.bind(r).toSelf(),n.bind(HN).toSelf(),n.bind(eX).toSelf(),n.bind(Qt.Geometry).to(q1t).whenTargetNamed(Ql.BOX),n.bind(Qt.Geometry).to(s_t).whenTargetNamed(Ql.SPHERE),n.bind(Qt.Geometry).to(n_t).whenTargetNamed(Ql.PLANE),n.bind(Qt.Geometry).to(J1t).whenTargetNamed(Ql.MERGED),n.bind(Qt.Material).to(v_t).whenTargetNamed(WM.BASIC),n.bind(Qt.Renderable).to(MCt).whenTargetNamed(Iu.POINT),n.bind(Qt.Renderable).to(dCt).whenTargetNamed(Iu.LINE),n.bind(Qt.Renderable).to(M_t).whenTargetNamed(Iu.GRID);var a=n.get(r);return a.setContainer(n),a.setConfig(t),a}}]),r}(),dwt),hwt=Ze(aX.prototype,"configService",[fwt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),aX))||cwt);var dx=(r,e)=>{let t;return r?je(r)?t=()=>r:t=r:t=()=>e||1,t},mwt=(r,e)=>{let t=[],n=[],i={},a=0;for(a=0;a{let i=[],a=[],o={},s=0;for(s=0;s{let t=[],n=r.length,i={};return e.forEach(a=>{r.forEach((o,s)=>{if(i[a[o]]===void 0&&(i[a[o]]=Object.keys(i).length),t.push(i[a[o]]),s===n-1)for(;t.length%4!=0;)t.push(0)})}),{array:new Float32Array(t),count:Object.keys(i).length}},oX=r=>{let e=[],t=r.length,n=r[0].length;for(let i=0;i{if(e.push(a[i]),o===t-1)for(;e.length%4!=0;)e.push(0)});return new Float32Array(e)};var xwt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array>;\\n};\\n[[binding 3, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4) -> vec2 {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4 = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\ndx = dx + param * std::sign;\\ndy = dy + param * std::sign;}}}}\\nreturn vec2(dx, dy);}\\nfn calcGravity(currentNode : vec4, nodeAttributes : vec4) -> vec2 {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4 = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4) -> vec2 {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4 = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\ndx = dx - std::sign * attractiveF;\\ndy = dy - std::sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4 = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes : vec4 = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvar repulsive : vec2 = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2 = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2 = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.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) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_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 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float 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 = gWebGPUBuffer0.u_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 = gWebGPUBuffer0.u_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 / gWebGPUUniformParams.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() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = 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 *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","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}}';var bwt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 0, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4 = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4 = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4 = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","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}}';var qN=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},wS=class extends li{constructor(e){super();this.maxIteration=1e3,this.gravity=10,this.speed=1,this.clustering=!1,this.clusterField="cluster",this.clusterGravity=10,this.workerEnabled=!1,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}}execute(){return qN(this,void 0,void 0,function*(){let e=this,t=e.nodes;if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let n=e.center;if(t.length===1){t[0].x=n[0],t[0].y=n[1],e.onLayoutEnd&&e.onLayoutEnd();return}let i={},a={};t.forEach((o,s)=>{je(o.x)||(o.x=Math.random()*this.width),je(o.y)||(o.y=Math.random()*this.height),i[o.id]=o,a[o.id]=s}),e.nodeMap=i,e.nodeIdxMap=a,yield e.run()})}executeWithWorker(e,t){return qN(this,void 0,void 0,function*(){let n=this,i=n.nodes,a=n.center;if(!i||i.length===0)return;if(i.length===1){i[0].x=a[0],i[0].y=a[1];return}let o={},s={};i.forEach((l,u)=>{je(l.x)||(l.x=Math.random()*this.width),je(l.y)||(l.y=Math.random()*this.height),o[l.id]=l,s[l.id]=u}),n.nodeMap=o,n.nodeIdxMap=s,yield n.run(e,t)})}run(e,t){return qN(this,void 0,void 0,function*(){let n=this,i=n.nodes,a=n.edges,o=n.maxIteration,s=n.center,l=n.height*n.width,u=Math.sqrt(l)/10,f=l/(i.length+1),c=Math.sqrt(f),h=n.speed,d=n.clustering,{array:p,count:v}=ywt([n.clusterField],i);i.forEach((O,M)=>{let I=0,R=0;je(O.fx)&&je(O.fy)&&(I=O.fx||.001,R=O.fy||.001),p[4*M+1]=I,p[4*M+2]=R});let m=i.length,{maxEdgePerVetex:g,array:x}=mwt(i,a),b=n.workerEnabled,S;b?S=hx.create({canvas:e,engineOptions:{supportCompute:!0}}):S=hx.create({engineOptions:{supportCompute:!0}});let C=n.onLayoutEnd,w=[];for(let O=0;OqN(this,void 0,void 0,function*(){for(let M=0;M{let R=O[4*I],P=O[4*I+1];M.x=R,M.y=P}),C&&C()}))()})}getType(){return"fruchterman-gpu"}};var _wt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array>;\\n};\\n[[binding 3, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array>;\\n};\\n[[binding 4, set 0]] var gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2 {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4) -> vec2 {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4 = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4 = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4, attributes2 : vec4) -> vec2 {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.z;\\nvar ay : f32 = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4, attributes1 : vec4) -> vec2 {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2 = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4 = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4 = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4 = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2 = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2 = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2 = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\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\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_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) * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float 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) {float 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 = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_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() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_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 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\n","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;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_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}}';var Swt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\n\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\n# [[builtin work_group_id]] var workGroupID : vec3;\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array>;\\n};\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array>;\\n};\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4 = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","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}}';var sX=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},ES=class extends li{constructor(e){super();this.maxIteration=1e3,this.edgeStrength=200,this.nodeStrength=1e3,this.coulombDisScale=.005,this.damping=.9,this.maxSpeed=1e3,this.minMovement=.5,this.interval=.02,this.factor=1,this.linkDistance=1,this.gravity=10,this.workerEnabled=!1,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}}execute(){return sX(this,void 0,void 0,function*(){let e=this,t=e.nodes;if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let n=e.center;if(t.length===1){t[0].x=n[0],t[0].y=n[1],e.onLayoutEnd&&e.onLayoutEnd();return}let i={},a={};t.forEach((o,s)=>{je(o.x)||(o.x=Math.random()*e.width),je(o.y)||(o.y=Math.random()*e.height),i[o.id]=o,a[o.id]=s}),e.nodeMap=i,e.nodeIdxMap=a,e.nodeStrength=dx(e.nodeStrength,1),e.edgeStrength=dx(e.edgeStrength,1),yield e.run()})}executeWithWorker(e,t){let n=this,i=n.nodes,a=n.center;if(!i||i.length===0)return;if(i.length===1){i[0].x=a[0],i[0].y=a[1];return}let o={},s={};i.forEach((l,u)=>{je(l.x)||(l.x=Math.random()*n.width),je(l.y)||(l.y=Math.random()*n.height),o[l.id]=l,s[l.id]=u}),n.nodeMap=o,n.nodeIdxMap=s,n.nodeStrength=dx(n.nodeStrength,1),n.edgeStrength=dx(n.edgeStrength,1),n.run(e,t)}run(e,t){return sX(this,void 0,void 0,function*(){let n=this,i=n.nodes,a=n.edges,o=n.maxIteration;!n.width&&typeof window!="undefined"&&(n.width=window.innerWidth),!n.height&&typeof window!="undefined"&&(n.height=window.innerHeight);let s=i.length;n.linkDistance=dx(n.linkDistance),n.edgeStrength=dx(n.edgeStrength);let{maxEdgePerVetex:l,array:u}=gwt(i,a,n.linkDistance,n.edgeStrength);n.degrees=Qh(i.length,n.nodeIdxMap,a);let f=[],c=[],h=[],d=[],p=[],v=[],m=[];n.getMass||(n.getMass=I=>n.degrees[n.nodeIdxMap[I.id]]||1);let g=n.gravity,x=n.center;i.forEach((I,R)=>{f.push(n.getMass(I)),c.push(n.nodeStrength(I)),n.degrees[R]||(n.degrees[R]=0);let P=[x[0],x[1],g];if(n.getCenter){let F=n.getCenter(I,n.degrees[R]);F&&je(F[0])&&je(F[1])&&je(F[2])&&(P=F)}h.push(P[0]),d.push(P[1]),p.push(P[2]),je(I.fx)&&je(I.fy)?(v.push(I.fx||.001),m.push(I.fy||.001)):(v.push(0),m.push(0))});let b=oX([f,n.degrees,c,v]),S=oX([h,d,p,m]),C=n.workerEnabled,w;C?w=hx.create({canvas:e,engineOptions:{supportCompute:!0}}):w=hx.create({engineOptions:{supportCompute:!0}});let A=n.onLayoutEnd,L=[];u.forEach(I=>{L.push(I)});for(let I=0;I<4;I++)L.push(0);let k=w.createKernel(_wt).setDispatch([s,1,1]).setBinding({u_Data:u,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:b,u_NodeAttributeArray2:S,MAX_EDGE_PER_VERTEX:l,VERTEX_COUNT:s,u_AveMovement:L,u_interval:n.interval}),O=w.createKernel(Swt).setDispatch([1,1,1]).setBinding({u_Data:u,VERTEX_COUNT:s,u_AveMovement:[0,0,0,0]});yield(()=>sX(this,void 0,void 0,function*(){for(let R=0;R{let F=I[4*P],D=I[4*P+1];R.x=F,R.y=D}),A&&A()}))()})}getType(){return"gForce-gpu"}};var AS=class extends li{constructor(e){super();this.center=[0,0],this.maxIteration=100,this.gravity=10,this.comboGravity=10,this.linkDistance=10,this.alpha=1,this.alphaMin=.001,this.alphaDecay=1-Math.pow(this.alphaMin,1/300),this.alphaTarget=0,this.velocityDecay=.6,this.edgeStrength=.6,this.nodeStrength=30,this.preventOverlap=!1,this.preventNodeOverlap=!1,this.preventComboOverlap=!1,this.collideStrength=void 0,this.nodeCollideStrength=.5,this.comboCollideStrength=.5,this.comboSpacing=20,this.comboPadding=10,this.optimizeRangeFactor=1,this.onTick=()=>{},this.onLayoutEnd=()=>{},this.depthAttractiveForceScale=1,this.depthRepulsiveForceScale=2,this.nodes=[],this.edges=[],this.combos=[],this.comboTrees=[],this.width=300,this.height=300,this.bias=[],this.nodeMap={},this.oriComboMap={},this.indexMap={},this.comboMap={},this.previousLayouted=!1,this.updateCfg(e)}getDefaultCfg(){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}}execute(){let e=this,t=e.nodes,n=e.center;if(e.comboTree={id:"comboTreeRoot",depth:-1,children:e.comboTrees},!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}if(t.length===1){t[0].x=n[0],t[0].y=n[1],e.onLayoutEnd&&e.onLayoutEnd();return}e.initVals(),e.run(),e.onLayoutEnd&&e.onLayoutEnd()}run(){let e=this,t=e.nodes,n=e.previousLayouted?e.maxIteration/5:e.maxIteration;!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight);let i=e.center,a=e.velocityDecay,o=e.comboMap;e.previousLayouted||e.initPos(o);for(let u=0;u{f[h]={x:0,y:0}}),e.applyCalculate(f),e.applyComboCenterForce(f),t.forEach((c,h)=>{!je(c.x)||!je(c.y)||(c.x+=f[h].x*a,c.y+=f[h].y*a)}),e.alpha+=(e.alphaTarget-e.alpha)*e.alphaDecay,e.onTick()}let s=[0,0];t.forEach(u=>{!je(u.x)||!je(u.y)||(s[0]+=u.x,s[1]+=u.y)}),s[0]/=t.length,s[1]/=t.length;let l=[i[0]-s[0],i[1]-s[1]];t.forEach((u,f)=>{!je(u.x)||!je(u.y)||(u.x+=l[0],u.y+=l[1])}),e.combos.forEach(u=>{let f=o[u.id];f&&f.empty&&(u.x=f.cx||u.x,u.y=f.cy||u.y)}),e.previousLayouted=!0}initVals(){let e=this,t=e.edges,n=e.nodes,i=e.combos,a={},o={},s={};n.forEach((O,M)=>{o[O.id]=O,s[O.id]=M}),e.nodeMap=o,e.indexMap=s;let l={};i.forEach(O=>{l[O.id]=O}),e.oriComboMap=l,e.comboMap=e.getComboMap();let u=e.preventOverlap;e.preventComboOverlap=e.preventComboOverlap||u,e.preventNodeOverlap=e.preventNodeOverlap||u;let f=e.collideStrength;f&&(e.comboCollideStrength=f,e.nodeCollideStrength=f),e.comboCollideStrength=e.comboCollideStrength?e.comboCollideStrength:0,e.nodeCollideStrength=e.nodeCollideStrength?e.nodeCollideStrength:0;for(let O=0;Od:gf(d)?v=d:v=()=>0,this.nodeSpacing=v,!h)p=O=>O.size?da(O.size)?(O.size[0]>O.size[1]?O.size[0]:O.size[1])/2:po(O.size)?(O.size.width>O.size.height?O.size.width:O.size.height)/2:O.size/2:10;else if(gf(h))p=O=>h(O);else if(da(h)){let M=(h[0]>h[1]?h[0]:h[1])/2;p=I=>M}else{let O=h/2;p=M=>O}this.nodeSize=p;let m=e.comboSpacing,g;je(m)?g=()=>m:gf(m)?g=m:g=()=>0,this.comboSpacing=g;let x=e.comboPadding,b;je(x)?b=()=>x:da(x)?b=()=>Math.max.apply(null,x):gf(x)?b=x:b=()=>0,this.comboPadding=b;let S=this.linkDistance,C;S||(S=10),je(S)?C=O=>S:C=S,this.linkDistance=C;let w=this.edgeStrength,A;w||(w=1),je(w)?A=O=>w:A=w,this.edgeStrength=A;let L=this.nodeStrength,k;L||(L=30),je(L)?k=O=>L:k=L,this.nodeStrength=k}initPos(e){this.nodes.forEach((i,a)=>{let o=i.comboId,s=e[o];o&&s?(i.x=s.cx+100/(a+1),i.y=s.cy+100/(a+1)):(i.x=100/(a+1),i.y=100/(a+1))})}getComboMap(){let e=this,t=e.nodeMap,n=e.comboTrees,i=e.oriComboMap,a={};return(n||[]).forEach(o=>{let s=[];yM(o,l=>{if(l.itemType==="node"||!i[l.id])return!0;if(a[l.id]===void 0){let c={id:l.id,name:l.id,cx:0,cy:0,count:0,depth:e.oriComboMap[l.id].depth||0,children:[]};a[l.id]=c}let u=l.children;u&&u.forEach(c=>{if(!a[c.id]&&!t[c.id])return!0;s.push(c)});let f=a[l.id];if(f.cx=0,f.cy=0,s.length===0){f.empty=!0;let c=i[l.id];f.cx=c.x,f.cy=c.y}return s.forEach(c=>{if(f.count++,c.itemType!=="node"){let d=a[c.id];je(d.cx)&&(f.cx+=d.cx),je(d.cy)&&(f.cy+=d.cy);return}let h=t[c.id];!h||(je(h.x)&&(f.cx+=h.x),je(h.y)&&(f.cy+=h.y))}),f.cx/=f.count||1,f.cy/=f.count||1,f.children=s,!0})}),a}applyComboCenterForce(e){let t=this,n=t.gravity,i=t.comboGravity||n,a=this.alpha,o=t.comboTrees,s=t.indexMap,l=t.nodeMap,u=t.comboMap;(o||[]).forEach(f=>{yM(f,c=>{if(c.itemType==="node"||!u[c.id])return!0;let d=u[c.id],p=(d.depth+1)/10*.5,v=d.cx,m=d.cy;return d.cx=0,d.cy=0,d.children.forEach(g=>{if(g.itemType!=="node"){let L=u[g.id];L&&je(L.cx)&&(d.cx+=L.cx),L&&je(L.cy)&&(d.cy+=L.cy);return}let x=l[g.id],b=x.x-v||.005,S=x.y-m||.005,C=Math.sqrt(b*b+S*S),w=s[x.id],A=i*a/C*p;e[w].x-=b*A,e[w].y-=S*A,je(x.x)&&(d.cx+=x.x),je(x.y)&&(d.cy+=x.y)}),d.cx/=d.count||1,d.cy/=d.count||1,!0})})}applyCalculate(e){let t=this,n=t.comboMap,i=t.nodes,a={};i.forEach((s,l)=>{i.forEach((u,f)=>{if(l{let u=[];yM(l,f=>{if(f.itemType==="node")return!0;let c=e[f.id];if(!c)return!1;let h=f.children;h&&h.forEach(v=>{!e[v.id]&&!i[v.id]||u.push(v)}),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,u.forEach(v=>{if(v.itemType!=="node")return!0;let m=i[v.id];if(!m)return!0;let g=a(m),x=m.x-g,b=m.y-g,S=m.x+g,C=m.y+g;c.minX>x&&(c.minX=x),c.minY>b&&(c.minY=b),c.maxX{if(!t[l.id]&&!s[l.id]&&l.id!=="comboTreeRoot")return!1;let u=l.children;return u&&u.length>1&&u.forEach((f,c)=>{if(f.itemType==="node")return!1;let h=t[f.id];!h||u.forEach((d,p)=>{if(c<=p||d.itemType==="node")return!1;let v=t[d.id];if(!v)return!1;let m=h.cx-v.cx||.005,g=h.cy-v.cy||.005,x=m*m+g*g,b=h.r||1,S=v.r||1,C=b+S,w=S*S,A=b*b;if(x{if(D.itemType!=="node")return!1;if(!s[D.id])return;let G=o[D.id];k.forEach(U=>{if(U.itemType!=="node"||!s[U.id])return!1;let j=o[U.id];e[G].x+=I*P,e[G].y+=R*P,e[j].x-=I*F,e[j].y-=R*F})})}})}),!0})}calRepulsive(e,t){let n=this,i=n.nodes,a=n.width*n.optimizeRangeFactor,o=n.nodeStrength,s=n.alpha,l=n.nodeCollideStrength,u=n.preventNodeOverlap,f=n.nodeSize,c=n.nodeSpacing,h=n.depthRepulsiveForceScale,d=n.center;i.forEach((p,v)=>{if(!(!p.x||!p.y)){if(d){let m=n.gravity,g=p.x-d[0]||.005,x=p.y-d[1]||.005,b=Math.sqrt(g*g+x*x);e[v].x-=g*m*s/b,e[v].y-=x*m*s/b}i.forEach((m,g)=>{if(v===g||!m.x||!m.y)return;let{vl2:x,vl:b}=t[`${p.id}-${m.id}`];if(b>a)return;let{vx:S,vy:C}=t[`${p.id}-${m.id}`],w=Math.log(Math.abs(m.depth-p.depth)/10)+1||1;w=w<1?1:w,m.comboId!==p.comboId&&(w+=1);let A=w?Math.pow(h,w):1,L=o(m)*s/x*A;if(e[v].x+=S*L,e[v].y+=C*L,v{let h=xn(f,"source"),d=xn(f,"target");if(!h||!d||h===d)return;let p=n.indexMap[h],v=n.indexMap[d],m=n.nodeMap[h],g=n.nodeMap[d];if(!m||!g)return;let x=m.depth===g.depth?0:Math.log(Math.abs(m.depth-g.depth)/10);m.comboId===g.comboId&&(x=x/2);let b=x?Math.pow(u,x):1;if(m.comboId!==g.comboId&&b===1?b=u/2:m.comboId===g.comboId&&(b=2),!je(g.x)||!je(m.x)||!je(g.y)||!je(m.y))return;let{vl:S,vx:C,vy:w}=t[`${d}-${h}`],A=(S-a(f))/S*o*s(f)*b,L=C*A,k=w*A,O=l[c];e[v].x-=L*O,e[v].y-=k*O,e[p].x+=L*(1-O),e[p].y+=k*(1-O)})}getType(){return"comboForce"}};var MS=class{constructor(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}distanceTo(e){let t=this.rx-e.rx,n=this.ry-e.ry;return Math.hypot(t,n)}setPos(e,t){this.rx=e,this.ry=t}resetForce(){this.fx=0,this.fy=0}addForce(e){let t=e.rx-this.rx,n=e.ry-this.ry,i=Math.hypot(t,n);i=i<1e-4?1e-4:i;let a=this.g*(this.degree+1)*(e.degree+1)/i;this.fx+=a*t/i,this.fy+=a*n/i}in(e){return e.contains(this.rx,this.ry)}add(e){let t=this.mass+e.mass,n=(this.rx*this.mass+e.rx*e.mass)/t,i=(this.ry*this.mass+e.ry*e.mass)/t,a=this.degree+e.degree,o={rx:n,ry:i,mass:t,degree:a};return new MS(o)}};var ov=class{constructor(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}getLength(){return this.length}contains(e,t){let n=this.length/2;return e<=this.xmid+n&&e>=this.xmid-n&&t<=this.ymid+n&&t>=this.ymid-n}NW(){let e=this.xmid-this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}NE(){let e=this.xmid+this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}SW(){let e=this.xmid-this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}SE(){let e=this.xmid+this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}};var sv=class{constructor(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}insert(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new sv(this.quad.NW()),this.NE=new sv(this.quad.NE()),this.SW=new sv(this.quad.SW()),this.SE=new sv(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))}_putBody(e){!this.quad||(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{let t=this.quad?this.quad.getLength():0,n=this.body.distanceTo(e);t/n{},this.prune=void 0,this.updateCfg(e)}getDefaultCfg(){return{}}execute(){let e=this,{nodes:t,onLayoutEnd:n,prune:i}=e,a=e.maxIteration;!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight);let o=[],s=t.length;for(let l=0;l250&&(e.barnesHut=!0),e.prune===void 0&&s>100&&(e.prune=!0),this.maxIteration===0&&!e.prune?(a=250,s<=200&&s>100?a=1e3:s>200&&(a=1200),this.maxIteration=a):this.maxIteration===0&&i&&(a=100,s<=200&&s>100?a=500:s>200&&(a=950),this.maxIteration=a),e.kr||(e.kr=50,s>100&&s<=500?e.kr=20:s>500&&(e.kr=1)),e.kg||(e.kg=20,s>100&&s<=500?e.kg=10:s>500&&(e.kg=1)),this.nodes=e.updateNodesByForces(o),n()}updateNodesByForces(e){let t=this,{edges:n,maxIteration:i}=t,a=t.nodes,o=n.filter(p=>{let v=xn(p,"source"),m=xn(p,"target");return v!==m}),s=a.length,l=o.length,u=[],f={},c={},h=[];for(let p=0;p0;){for(let C=0;Cm||!f)?g=this.getOptRepGraForces(g,b,a):g=this.getRepGraForces(v,m,g,p,o,a);let S=this.updatePos(g,x,d,a);l=S.nodes,d=S.sg,v--,s.tick&&s.tick()}return l}getAttrForces(e,t,n,i,a,o,s,l){let u=this,{nodes:f,preventOverlap:c,dissuadeHubs:h,mode:d,prune:p}=u;for(let v=0;v0&&(w=C,A=C),l[2*i[m.id]]+=w*S[0],l[2*i[x.id]]-=A*S[0],l[2*i[m.id]+1]+=w*S[1],l[2*i[x.id]+1]-=A*S[1]}return l}getRepGraForces(e,t,n,i,a,o){let s=this,{nodes:l,preventOverlap:u,kr:f,kg:c,center:h,prune:d}=s,p=l.length;for(let v=0;v0&&(w=f*(o[v]+1)*(o[b]+1)/C),n[2*v]-=w*S[0],n[2*b]+=w*S[0],n[2*v+1]-=w*S[1],n[2*b+1]+=w*S[1]}let m=[l[v].x-h[0],l[v].y-h[1]],g=Math.hypot(m[0],m[1]);m[0]=m[0]/g,m[1]=m[1]/g;let x=c*(o[v]+1);n[2*v]-=x*m[0],n[2*v+1]-=x*m[1]}return n}getOptRepGraForces(e,t,n){let i=this,{nodes:a,kg:o,center:s,prune:l}=i,u=a.length,f=9e10,c=-9e10,h=9e10,d=-9e10;for(let x=0;x=c&&(c=a[x].x),a[x].x<=f&&(f=a[x].x),a[x].y>=d&&(d=a[x].y),a[x].y<=h&&(h=a[x].y));let p=Math.max(c-f,d-h),v={xmid:(c+f)/2,ymid:(d+h)/2,length:p,massCenter:s,mass:u},m=new ov(v),g=new sv(m);for(let x=0;x1.5*m?1.5*m:n);for(let g=0;gS?S:x;let C=x*e[2*g],w=x*e[2*g+1];o[g].x+=C,o[g].y+=w}return{nodes:o,sg:n}}};var Ef=class{constructor(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}init(e,t,n){this.cells=[],this.CELL_W=n.CELL_W||Ef.DEFAULT_CELL_W,this.CELL_H=n.CELL_H||Ef.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(t/this.CELL_H),Ef.MIN_DIST=Math.pow(e,2)+Math.pow(t,2);for(let i=0;ie;n--)for(let i=0;i=e&&(this.additionColumn[n]+=t);for(let n=0;ne;i--)this.cells[n][i+t]=Object.assign(Object.assign({},this.cells[n][i]),{dx:n,dy:i+t,x:n*this.CELL_W,y:(i+t)*this.CELL_H}),this.cells[n][i]={dx:n,dy:i,x:n*this.CELL_W,y:i*this.CELL_H,occupied:!1,node:null};for(let n=0;n=e&&(this.additionRow[n]+=t);for(let n=0;n{let u=l.size[0]||50,f=l.size[1]||50;a=Math.min(u,a),o=Math.min(f,o)});let s=new Ef;s.init(t,n,{CELL_H:o,CELL_W:a}),r.nodes.forEach(l=>{let u=s.occupyNearest(l);u&&(u.node={id:l.id,size:l.size},l.x=u.x,l.y=u.y,l.dx=u.dx,l.dy=u.dy)});for(let l=0;la){let d=Math.ceil((u.size[0]+i)/a)-1,p=d;for(let v=0;v-1&&!s.cells[c+v+1][h].node);v++)p--;s.insertColumn(c,p)}if(u.size[1]+i>o){let d=Math.ceil((u.size[1]+i)/o)-1,p=d;for(let v=0;v-1&&!s.cells[c][h+v+1].node);v++)p--;s.insertRow(h,p)}}for(let l=0;l{var d;return h.id===((d=f==null?void 0:f.node)===null||d===void 0?void 0:d.id)});c&&(c.x=f.x+c.size[0]/2,c.y=f.y+c.size[1]/2)}}}var Cwt=1200,wwt=800,KN=1e7,aT=10,Ewt=3.141592653589793,uX=1.5707963267948966,zhe=Ewt*.375,Uhe=Ewt*.625,ZN=new Map,jhe=10,Whe=10,fX=.8,Awt=.1,Vhe=.5;function Hhe(r,e,t){let n=r.x-r.size[0]/2,i=r.y-r.size[1]/2,a=r.x+r.size[0]/2,o=r.y+r.size[1]/2,s=e.x-e.size[0]/2,l=e.y-e.size[1]/2,u=e.x+e.size[0]/2,f=e.y+e.size[1]/2,c=r.x,h=r.y,d=e.x,p=e.y,v=d-c,m=Math.atan2(v,p-h),g=0,x=0,b=0,S=0;m>uX?(x=i-f,g=s-a,b=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)),S=parseFloat(g?(g/Math.sin(m)).toFixed(2):x.toFixed(2))):0g?b=S=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)):b=S=parseFloat(g?(g/Math.sin(m)).toFixed(2):x.toFixed(2))):m<-uX?(x=i-f,g=-(u-n),x>g?b=S=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)):b=S=parseFloat(g?(g/Math.sin(m)).toFixed(2):x.toFixed(2))):(x=l-o,Math.abs(v)>(a-n)/2?g=n-u:g=v,x>g?b=S=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)):b=S=parseFloat(g&&m!==0?(g/Math.sin(m)).toFixed(2):x.toFixed(2)));let C=parseFloat(m.toFixed(2)),w=t;return t&&(w=zheA.source===e.id||A.target===e.id),i=r.size[0]*r.size[1],a=e.size[0]*e.size[1],o=i>a?e:r,s=i>a?r:e,l=o.x-o.size[0]/2,u=o.y-o.size[1]/2,f=o.x+o.size[0]/2,c=o.y+o.size[1]/2,h=s.x-s.size[0]/2,d=s.y-s.size[1]/2,p=s.x+s.size[0]/2,v=s.y+s.size[1]/2,m=o.x,g=o.y,x=s.x,b=s.y,S=f>=h&&p>=l&&c>=d&&v>=u,C=0,w=0;if(S){w=Math.sqrt(Math.pow(x-m,2)+Math.pow(b-g,2));let A=l>h?l:h,L=u>d?u:d,k=fCwt||n.y>wwt)&&(e+=1e12);for(let i=t+1;i{i.set(l.id,l)});let a=n.filter(l=>l.source===r.id||l.target===r.id)||[],o=[];a.forEach(l=>{let u=l.source===r.id?l.target:l.source,f=i.get(u);f&&o.push(f)});let s=!0;for(let l=0;l150,d=c<30||c>150,p=f>70&&f<110,v=c>70&&c<110;if(h&&!d||f*c<0){s=!1;break}else if(p&&!v||f*c<0){s=!1;break}else if((u.x-r.x)*(u.x-e.x)<0){s=!1;break}else if((u.y-r.y)*(u.y-e.y)<0){s=!1;break}}return s}function Xhe(r,e){let t=!1,n=1,i=jhe*n,a=Whe*n,o=[i,-i,0,0],s=[0,0,a,-a];for(let l=0;lAwt?(f=d,t=!0):(u.x-=o[c],u.y-=s[c])}}return fX>Awt&&(fX*=Vhe),t?Twt(r):0}function Iwt(r,e){let t=0;(r.x<0||r.y<0||r.x+r.size[0]+20>Cwt||r.y+r.size[1]+20>wwt)&&(t+=1e12);for(let n=0;n{let u=e.filter(f=>f.source===l.id||f.target===l.id);ZN.set(l,u)}),r.sort((l,u)=>{var f,c;return((f=ZN.get(l.id))===null||f===void 0?void 0:f.length)-((c=ZN.get(u.id))===null||c===void 0?void 0:c.length)});let t=Twt(r),n=20,i=1,a=0,o=50,s=0;for(;n>0&&(s++,!(s>=o));){let l=Xhe(r,e);l!==0&&(a=l),i=a-t,t=a,i===0?--n:n=20}return r.forEach(l=>{l.x=l.x-l.size[0]/2,l.y=l.y-l.size[1]/2}),{nodes:r,edges:e}}var Lwt=qhe;function cX(r,e){let{nodes:t,edges:n}=r,i=e.width,a=e.height;if(!(t==null?void 0:t.length))return Promise.resolve();let o=[];t.forEach(p=>{if(n.filter(m=>m.source===p.id||m.target===p.id).length>1){let m=Object.assign({},p);delete m.size,o.push(m)}});let s=[];n.forEach(p=>{let v=o.find(g=>g.id===p.source),m=o.find(g=>g.id===p.target);v&&m&&s.push(p)});let l=new _g({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}),{nodes:u}=l.layout({nodes:o,edges:s});t.forEach(p=>{let v=(u||[]).find(m=>m.id===p.id);p.x=(v==null?void 0:v.x)||i/2,p.y=(v==null?void 0:v.y)||a/2});let f=JSON.parse(JSON.stringify(t)),c=JSON.parse(JSON.stringify(n)),h=W0().nodes(f).force("link",bg(c).id(p=>p.id).distance(p=>s.find(m=>m.source===p.source&&m.target===p.target)?30:20)).force("charge",V0()).force("center",xM(i/2,a/2)).force("x",_M(i/2)).force("y",SM(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise(p=>{h.on("end",()=>{t.forEach(C=>{let w=f.find(A=>A.id===C.id);w&&(C.x=w.x,C.y=w.y)});let v=Math.min(...t.map(C=>C.x)),m=Math.max(...t.map(C=>C.x)),g=Math.min(...t.map(C=>C.y)),x=Math.max(...t.map(C=>C.y)),b=i/(m-v),S=a/(x-g);t.forEach(C=>{C.x!==void 0&&b<1&&(C.x=(C.x-v)*b),C.y!==void 0&&S<1&&(C.y=(C.y-g)*S)}),t.forEach(C=>{C.sizeTemp=C.size,C.size=[10,10]}),Lwt(t,n),t.forEach(C=>{C.size=C.sizeTemp||[],delete C.sizeTemp}),lX({nodes:t,edges:n},e),p()})})}var $N=class extends li{constructor(e){super();this.width=300,this.height=300,this.nodeMinGap=50,this.onLayoutEnd=()=>{},e&&this.updateCfg(e)}getDefaultCfg(){return{width:300,height:300,nodeMinGap:50}}execute(){let e=this,t=e.nodes,n=e.edges;return t==null||t.forEach(i=>{i.size||(i.size=[50,50])}),cX({nodes:t,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then(()=>{e.onLayoutEnd&&e.onLayoutEnd()})}getType(){return"er"}};var Dg={force:Y_,fruchterman:Q_,forceAtlas2:TS,gForce:V_,dagre:_g,circular:X_,radial:K_,concentric:Z_,grid:j_,mds:$_,comboForce:AS,random:W_,"gForce-gpu":ES,"fruchterman-gpu":wS,er:$N};var gX=z(dX());var pX={};Dn(pX,{arrayToTextureData:()=>ede,attributesToTextureData:()=>tde,buildTextureData:()=>$he,buildTextureDataWithOneEdgeAttr:()=>Qhe,buildTextureDataWithTwoEdgeAttr:()=>Jhe,proccessToFunc:()=>Zhe,radialLayout:()=>rde});var Owt=z(q()),Dwt=ka.traverseTree,Zhe=function(e,t){var n;return e?(0,Owt.isNumber)(e)?n=function(a){return e}:n=e:n=function(a){return t||1},n},$he=function(e,t){var n=[],i=[],a={},o=0;for(o=0;o=0&&(s="x",o="y");var l=0;Dwt(e,function(c){return l++,c.x>a.x&&(a.x=c.x),c.xa.y&&(a.y=c.y),c.yvX});var vX=function r(){return typeof window=="undefined"||typeof document=="undefined"?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch(t){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support WebGL.
    ','Find out how to get it here.'].join(` `):['Your browser does not seem to support WebGL.
    ','Find out how to get it here.'].join(` `)),t},addGetWebGLMessage:function(t){t=t||{};var n=t.parent!==void 0?t.parent:document.body,i=t.id!==void 0?t.id:"oldie",a=r().getWebGLErrorMessage();a.id=i,n.appendChild(a)}}};var nde=E(E(E(E({},ka),O8),pX),mX),al=nde;var ide=al.radialLayout,ade=function(){function r(e){this.type=e.type,this.radial=e.radial,this.config=e}return r.prototype.init=function(e){var t=this;if(this.data=e,this.radial){this.layoutMethod=function(n){var i=gX.default[t.type](n,t.config);return ide(i),i};return}this.layoutMethod=function(n){return gX.default[t.type](n,t.config)}},r.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},r.prototype.layout=function(e){return this.init(e),this.execute()},r}(),yX=ade;hs("grid",j_);hs("random",W_);hs("force",Y_);hs("circular",X_);hs("dagre",_g);hs("radial",K_);hs("concentric",Z_);hs("mds",$_);hs("fruchterman",Q_);hs("fruchterman-gpu",wS);hs("gForce",V_);hs("gForce-gpu",ES);hs("comboForce",AS);hs("forceAtlas2",TS);var Pwt=function(e,t){t.isCustomLayout=!0,Dg[e]=hs(e,t)};var ode=function(){function r(e,t){var n=e.toString(),i=new Blob(["importScripts('".concat(t,"');(").concat(n,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(i))}return r}(),kwt=ode;var Rwt=function(e){e===void 0&&(e="https://unpkg.com/@antv/layout@latest/dist/layout.min.js");function t(){var i={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),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("forceAtlas2",layout.ForceAtlas2Layout);function a(s){var l=s.data.type;return l===i.RUN||l===i.GPURUN}function o(s){var l=this,u=s.data.type;switch(u){case i.RUN:{var f=s.data,c=f.nodes,h=f.edges,d=f.layoutCfg,p=d===void 0?{}:d,v=p.type,m=layout.getLayoutByName(v);if(!m){this.postMessage({type:i.ERROR,message:"layout ".concat(v," not found")});break}var g;p.onLayoutEnd=function(){l.postMessage({type:i.END,nodes:c}),g==null||g.destroy()},g=new m(p),g.init({nodes:c,edges:h}),g.execute();break}case i.GPURUN:{var x=s.data,b=x.nodes,h=x.edges,S=x.layoutCfg,p=S===void 0?{}:S,C=x.canvas,v=p.type,m=layout.getLayoutByName(v);if(!m){this.postMessage({type:i.ERROR,message:"layout ".concat(v," not found")});break}if(v.split("-")[1]!=="gpu"){this.postMessage({type:i.ERROR,message:"layout ".concat(v," does not support GPU")});break}var w=new m(p);w.init({nodes:b,edges:h}),w.executeWithWorker(C,this);break}default:break}}onmessage=function(l){a(l)&&o(l)}}var n=new kwt(t,e);return n};var px={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};var QN=z(q());function xX(r){return xX=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xX(r)}var Nwt=function(e){return setTimeout(e,16)},Fwt=function(e){return clearTimeout(e)},JN={requestAnimationFrame:function(e){var t=typeof window!="undefined"&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||Nwt;return t(e)},cancelAnimationFrame:function(e){var t=typeof window!="undefined"&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||Fwt;return t(e)}},sde=["fruchterman","gForce"],lde=["force","grid","circular"],ude=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.graph=t,n.layoutCfg=t.get("layout")||{},n.layoutType=n.getLayoutType(),n.worker=null,n.workerData={},n.initLayout(),n}return e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker?this.worker:(typeof Worker=="undefined"?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=Rwt(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;!this.worker||(this.worker.terminate(),this.worker=null,t.requestId&&(JN.cancelAnimationFrame(t.requestId),t.requestId=null),t.requestId2&&(JN.cancelAnimationFrame(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,n){var i=this;return new Promise(function(a,o){return Xf(i,void 0,void 0,function(){var s,l,u,f,c,h,d,p,c,v;return qf(this,function(m){switch(m.label){case 0:if(s=this.graph,!s||s.get("destroyed"))return[2];l=t.type,t.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},l&&this.isGPU&&(this.hasGPUVersion(l)?l="".concat(l,"-gpu"):console.warn("The '".concat(l,"' layout does not support GPU calculation for now, it will run in CPU."))),u=l==="force"||l==="g6force"||l==="gForce",u?(f=t.onTick,c=function(){f&&f(),s.refreshPositions()},t.tick=c):t.type==="comboForce"&&(t.comboTrees=s.get("comboTrees")),h=!1;try{d=new Dg[l](t)}catch(g){console.warn("The layout method: '".concat(l,"' does not exist! Please specify it first.")),o()}return h=d.enableTick,h&&(p=t.onTick,c=function(){p&&p(),s.refreshPositions()},d.tick=c),v=this.filterLayoutData(this.data,t),hde(v,n),d.init(v),s.emit("beforesublayout",{type:l}),[4,d.execute()];case 1:return m.sent(),d.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),this.layoutMethods[n]=d,[2]}})})})},e.prototype.updateLayoutMethod=function(t,n){var i=this;return new Promise(function(a,o){return Xf(i,void 0,void 0,function(){var s,l,u;return qf(this,function(f){switch(f.label){case 0:return s=this.graph,l=n==null?void 0:n.type,n.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},u=this.filterLayoutData(this.data,n),t.init(u),t.updateCfg(n),s.emit("beforesublayout",{type:l}),[4,t.execute()];case 1:return f.sent(),t.isCustomLayout&&n.onLayoutEnd&&n.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var n=this,i=this.graph;this.data=this.setDataFromGraph();var a=this.data,o=a.nodes,s=a.hiddenNodes;if(!o)return!1;var l=i.get("width"),u=i.get("height"),f={};Object.assign(f,{width:l,height:u,center:[l/2,u/2]},this.layoutCfg),this.layoutCfg=f,this.destoryLayoutMethods(),i.emit("beforelayout"),this.initPositions(f.center,o),this.initPositions(f.center,s);var c=f.type;c&&c.split("-")[1]==="gpu"&&(c=c.split("-")[0],f.gpuEnabled=!0);var h=!1;f.gpuEnabled&&(h=!0,vX().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),h=!1)),this.isGPU=h;var d=f.onLayoutEnd,p=f.layoutEndFormatted,v=f.adjust;if(p||(f.layoutEndFormatted=!0,f.onAllLayoutEnd=function(){return Xf(n,void 0,void 0,function(){return qf(this,function(g){switch(g.label){case 0:return d&&d(),this.refreshLayout(),v&&f.pipes?[4,this.adjustPipesBox(this.data,v)]:[3,2];case 1:g.sent(),this.refreshLayout(),g.label=2;case 2:return i.emit("afterlayout"),[2]}})})}),this.stopWorker(),f.workerEnabled&&this.layoutWithWorker(this.data))return!0;var m=Promise.resolve();return f.type?m=m.then(function(){return Xf(n,void 0,void 0,function(){return qf(this,function(g){switch(g.label){case 0:return[4,this.execLayoutMethod(f,0)];case 1:return[2,g.sent()]}})})}):f.pipes&&f.pipes.forEach(function(g,x){m=m.then(function(){return Xf(n,void 0,void 0,function(){return qf(this,function(b){switch(b.label){case 0:return[4,this.execLayoutMethod(g,x)];case 1:return[2,b.sent()]}})})})}),m.then(function(){f.onAllLayoutEnd&&f.onAllLayoutEnd(),t&&t()}).catch(function(g){console.warn("graph layout failed,",g)}),!1},e.prototype.layoutWithWorker=function(t){var n=this,i=this,a=i.layoutCfg,o=i.graph,s=this.getWorker(),l=this.workerData;if(!s)return!1;l.requestId=null,l.requestId2=null,l.currentTick=null,l.currentTickData=null,o.emit("beforelayout");var u=Promise.resolve();if(a.type)u=u.then(function(){return n.runWebworker(s,t,a)});else if(a.pipes)for(var f=function(v){u=u.then(function(){return n.runWebworker(s,t,v)})},c=0,h=a.pipes;c'),f=i?i.backgroundColor:void 0,c=i?i.padding:void 0;c?(0,ol.isNumber)(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var h=o+c[0]+c[2],d=s+c[1]+c[3],p={container:u,height:h,width:d,quickHit:!0},v=l==="svg"?new Mh(p):new Gl(p),m=this.get("group"),g=m.clone(),x=(0,ol.clone)(g.getMatrix());x||(x=[1,0,0,0,1,0,0,0,1]);var b=(a.maxX+a.minX)/2,S=(a.maxY+a.minY)/2;x=Bwt(x,[["t",-b,-S],["t",s/2+c[3],o/2+c[0]]]),g.resetMatrix(),g.setMatrix(x),v.add(g);var C=v.get("el"),w="";n||(n="image/png"),setTimeout(function(){if(l==="svg"){var A=C.cloneNode(!0),L=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),k=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",L);k.replaceChild(A,k.documentElement);var O=new XMLSerializer().serializeToString(k);w="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(O))}else{var M=void 0,I=C.getContext("2d"),R=void 0;if(f){var P=typeof window!="undefined"?window.devicePixelRatio:1;try{M=I.getImageData(0,0,d*P,h*P),R=I.globalCompositeOperation,I.globalCompositeOperation="destination-over",I.fillStyle=f,I.fillRect(0,0,d,h)}catch(F){console.error("Download image failed. Out of memory at ImageData creation")}}w=C.toDataURL(n),f&&(I.clearRect(0,0,d,h),I.putImageData(M,0,0),I.globalCompositeOperation=R)}t&&t(w)},16)},e.prototype.downloadFullImage=function(t,n,i){var a=this,o=this.get("group").getCanvasBBox(),s=o.height,l=o.width,u=this.get("renderer"),f=en(''),c=document.querySelector(".g6-graph-watermarker"),h=i?i.backgroundColor:void 0,d=i?i.padding:void 0;d?(0,ol.isNumber)(d)&&(d=[d,d,d,d]):d=[0,0,0,0];var p=s+d[0]+d[2],v=l+d[1]+d[3];if(c){var m=this.get("graphWaterMarker").cfg||{},g=m.width,x=m.height;p=Math.ceil(p/x)*x,v=Math.ceil(v/g)*g}var b={container:f,height:p,width:v},S=u==="svg"?new Mh(b):new Gl(b),C=this.get("group"),w=C.clone(),A=(0,ol.clone)(w.getMatrix());A||(A=[1,0,0,0,1,0,0,0,1]);var L=(o.maxX+o.minX)/2,k=(o.maxY+o.minY)/2;A=Bwt(A,[["t",-L,-k],["t",l/2+d[3],s/2+d[0]]]),w.resetMatrix(),w.setMatrix(A),S.add(w);var O=S.get("el");n||(n="image/png"),this.asyncToDataUrl(n,h,function(M){var I=document.createElement("a"),R=(t||"graph")+(u==="svg"?".svg":".".concat(n.split("/")[1]));a.dataURLToImage(M,u,I,R);var P=document.createEvent("MouseEvents");P.initEvent("click",!1,!1),I.dispatchEvent(P)},v,p,O)},e.prototype.downloadImage=function(t,n,i){var a=this,o=this;o.isAnimating()&&o.stopAnimate();var s=o.get("canvas"),l=s.getRenderer();n||(n="image/png");var u=(t||"graph")+(l==="svg"?".svg":n.split("/")[1]),f=document.createElement("a");o.asyncToDataUrl(n,i,function(c){a.dataURLToImage(c,l,f,u);var h=document.createEvent("MouseEvents");h.initEvent("click",!1,!1),f.dispatchEvent(h)})},e.prototype.dataURLToImage=function(t,n,i,a){if(!t||t==="data:"){console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items");return}if(typeof window!="undefined")if(window.Blob&&window.URL&&n!=="svg"){var o=t.split(","),s="";if(o&&o.length>0){var l=o[0].match(/:(.*?);/);l&&l.length>=2&&(s=l[1])}for(var u=atob(o[1]),f=u.length,c=new Uint8Array(f);f--;)c[f]=u.charCodeAt(f);var h=new Blob([c],{type:s});window.navigator.msSaveBlob?window.navigator.msSaveBlob(h,a):i.addEventListener("click",function(){i.download=a,i.href=window.URL.createObjectURL(h)})}else i.addEventListener("click",function(){i.download=a,i.href=t})},e.prototype.addPlugin=function(t){var n=this;t.destroyed||(n.get("plugins").push(t),t.initPlugin(n))},e.prototype.removePlugin=function(t){var n=this.get("plugins"),i=n.indexOf(t);i>=0&&(t.destroyPlugin(),n.splice(i,1))},e.prototype.setImageWaterMarker=function(t,n){t===void 0&&(t=_c.waterMarkerImage);var i=this.get("container");(0,ol.isString)(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=(0,ol.deepMix)({},_c.imageWaterMarkerConfig,n),s=o.width,l=o.height,u=o.compatible,f=o.image;if(!a){var c={container:i,width:s,height:l,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h),a=new Gl(c),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var d=a.get("context"),p=f.rotate,v=f.x,m=f.y;d.rotate(-p*Math.PI/180);var g=new Image;g.crossOrigin="anonymous",g.src=t,g.onload=function(){if(d.drawImage(g,v,m,f.width,f.height),d.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var x=document.querySelector(".g6-graph-watermarker");x||(x=document.createElement("div"),x.className="g6-graph-watermarker"),x.className="g6-graph-watermarker",a.destroyed||(x.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),i.appendChild(x))}}},e.prototype.setTextWaterMarker=function(t,n){var i=this.get("container");(0,ol.isString)(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=(0,ol.deepMix)({},_c.textWaterMarkerConfig,n),s=o.width,l=o.height,u=o.compatible,f=o.text;if(!a){var c={container:i,width:s,height:l,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h),a=new Gl(c),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var d=a.get("context"),p=f.rotate,v=f.fill,m=f.fontFamily,g=f.fontSize,x=f.baseline,b=f.x,S=f.y,C=f.lineHeight;d.rotate(-p*Math.PI/180),d.font="".concat(g,"px ").concat(m),d.fillStyle=v,d.textBaseline=x;for(var w=t.length-1;w>=0;w--)d.fillText(t[w],b,S+w*C);if(d.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var A=document.querySelector(".g6-graph-watermarker");A||(A=document.createElement("div"),A.className="g6-graph-watermarker"),A.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),i.appendChild(A)}},e.prototype.destroy=function(){var t,n,i,a;(0,ol.each)(this.get("plugins"),function(f){f.destroyPlugin()});var o=this.get("tooltips");if(o)for(var s=0;s0)for(var u=s.length-1;u>=0;u--){var f=s[u].getModel();e.indexOfChild(t.children||[],f.id)===-1&&(a.innerRemoveChild(f.id,{x:t.x,y:t.y},i),s.splice(u,1))}}var c,h;o.get("originAttrs")&&(c=o.get("originAttrs").x,h=o.get("originAttrs").y);var d=o.getModel();i&&o.set("originAttrs",{x:d.x,y:d.y}),o.set("model",t.data),(c!==t.x||h!==t.y)&&o.updatePosition({x:t.x,y:t.y})},e.prototype.innerRemoveChild=function(t,n,i){var a=this,o=a.findById(t);if(!!o)if((0,Lu.each)(o.get("children"),function(l){a.innerRemoveChild(l.getModel().id,n,i)}),i){var s=o.getModel();o.set("to",n),o.set("originAttrs",{x:s.x,y:s.y}),a.get("removeList").push(o)}else a.removeItem(o,!1)},e.prototype.changeData=function(t){var n=this;this.getNodes().map(function(i){return n.clearItemStates(i)}),this.getEdges().map(function(i){return n.clearItemStates(i)}),t?(n.data(t),n.render()):n.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");var n=this;n.updateLayout(t)},e.prototype.updateLayout=function(t){var n=this;if(!t){console.warn("layout cannot be null");return}n.set("layout",t),n.set("layoutMethod",n.getLayout()),n.layout()},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");var n=this;n.layout(t)},e.prototype.layout=function(t){var n=this,i=n.get("data"),a=n.get("layoutMethod"),o=a?a(i,n.get("layout")):i,s=n.get("animate");if(n.emit("beforerefreshlayout",{data:i,layoutData:o}),n.emit("beforelayout"),n.innerUpdateChild(o,void 0,s),t){var l=n.get("viewController");l.fitView()}s?n.layoutAnimate(o):(n.refresh(),n.paint()),n.emit("afterrefreshlayout",{data:i,layoutData:o}),n.emit("afterlayout")},e.prototype.addChild=function(t,n){var i=this;i.emit("beforeaddchild",{model:t,parent:n}),(0,Lu.isString)(n)||(n=n.get("id"));var a=i.findDataById(n);a&&(a.children||(a.children=[]),a.children.push(t),i.changeData())},e.prototype.updateChildren=function(t,n){var i=this;if(!n||!i.findById(n)){console.warn("Update children failed! There is no node with id '".concat(n,"'"));return}var a=i.findDataById(n);a.children=t,i.changeData()},e.prototype.updateChild=function(t,n){var i=this;if(!n||!i.findById(n)){i.changeData(t);return}var a=i.findDataById(n),o=i.findById(t.id);if(a.children||(a.children=[]),!o)a.children.push(t);else{var s=e.indexOfChild(a.children,t.id);a.children[s]=t}i.changeData()},e.prototype.removeChild=function(t){var n=this,i=n.findById(t);if(!!i){var a=i.get("parent");if(a&&!a.destroyed){var o=n.findDataById(a.get("id")),s=o&&o.children||[],l=i.getModel(),u=e.indexOfChild(s,l.id);s.splice(u,1)}n.changeData()}},e.prototype.findDataById=function(t,n){var i=this;if(n||(n=i.get("data")),t===n.id)return n;var a=null;return(0,Lu.each)(n.children||[],function(o){if(o.id===t)return a=o,!1;if(a=i.findDataById(t,o),a)return!1}),a},e.prototype.layoutAnimate=function(t,n){var i=this,a=this.get("animateCfg");i.emit("beforeanimate",{data:t}),i.getEdges().forEach(function(o){var s=o.get("model");s.sourceAnchor||(s.sourceAnchor=o.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(o){mde(t,function(s){var l=i.findById(s.id);if(l){var u=l.get("originAttrs"),f=l.get("model");if(u||(u={x:f.x,y:f.y},l.set("originAttrs",u)),n){var c=n(l,o,u,t);l.set("model",Object.assign(f,c))}else f.x=u.x+(s.x-u.x)*o,f.y=u.y+(s.y-u.y)*o}return!0}),(0,Lu.each)(i.get("removeList"),function(s){var l=s.getModel(),u=s.get("originAttrs"),f=s.get("to");l.x=u.x+(f.x-u.x)*o,l.y=u.y+(f.y-u.y)*o}),i.refreshPositions()},{duration:a.duration,easing:a.ease,callback:function(){(0,Lu.each)(i.getNodes(),function(s){s.set("originAttrs",null)}),(0,Lu.each)(i.get("removeList"),function(s){i.removeItem(s)}),i.set("removeList",[]),a.callback&&a.callback(),i.emit("afteranimate",{data:t})},delay:a.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(){var t=this,n=t.get("data");if(!n||!(0,Lu.isObject)(n)||!Object.keys(n).length)throw new Error("data must be defined first");t.clear(),t.emit("beforerender"),t.layout(this.get("fitView")),t.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e}(IS),Gwt=gde;var vx=z(q()),yde=function(){function r(e){this._cfgs=(0,vx.deepMix)(this.getDefaultCfgs(),e),this._events={},this.destroyed=!1}return r.prototype.getDefaultCfgs=function(){return{}},r.prototype.initPlugin=function(e){var t=this;t.set("graph",e);var n=t.getEvents(),i={};(0,vx.each)(n,function(a,o){var s=(0,vx.wrapBehavior)(t,a);i[o]=s,e.on(o,s)}),this._events=i,this.init()},r.prototype.getEvents=function(){return{}},r.prototype.get=function(e){var t;return(t=this._cfgs)===null||t===void 0?void 0:t[e]},r.prototype.set=function(e,t){this._cfgs[e]=t},r.prototype.destroy=function(){},r.prototype.destroyPlugin=function(){this.destroy();var e=this.get("graph"),t=this._events;(0,vx.each)(t,function(n,i){e.off(i,n)}),this._events=null,this._cfgs=null,this.destroyed=!0},r}(),ia=yde;var xde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),zwt="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",bde=function(r){xde(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{img:zwt,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),n=t.get("container"),i=t.get("canvas").get("el"),a=this.get("img")||zwt,o=en(`
    `),s=en(`
    `));this.set("container",o),this.set("gridContainer",s),this.positionInit(),o.appendChild(s),n.insertBefore(o,i)},e.prototype.positionInit=function(){var t=this.get("graph"),n=t.get("minZoom"),i=t.get("width"),a=t.get("height");yr(this.get("container"),{width:"".concat(i,"px"),height:"".concat(a,"px")});var o=i*80/n,s=a*80/n;yr(this.get("gridContainer"),{width:"".concat(o,"px"),height:"".concat(s,"px"),left:"-".concat(o/2,"px"),top:"-".concat(s/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var n=this.get("gridContainer"),i=t.matrix;i||(i=[1,0,0,0,1,0,0,0,1]);var a=this.get("follow"),o="matrix(".concat(i[0],", ").concat(i[1],", ").concat(i[3],", ").concat(i[4],", ").concat(a?i[6]:"0",", ").concat(a?i[7]:"0",")");yr(n,{transform:o})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph"),n=t.get("container"),i=this.get("container");n.removeChild(i)},e}(ia),Uwt=bde;var eF=z(q()),Vwt=z(tF());var Cde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();typeof document!="undefined"&&(0,Vwt.default)(` .g6-component-contextmenu { border: 1px solid #e2e2e2; border-radius: 4px; font-size: 12px; color: #545454; background-color: rgba(255, 255, 255, 0.9); padding: 10px 8px; box-shadow: rgb(174, 174, 174) 0px 0px 10px; } .g6-contextmenu-ul { padding: 0; margin: 0; list-style: none; } `);var wde=function(r){Cde(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(n){return`
    • \u83DC\u5355\u98791
    • \u83DC\u5355\u98792
    `},shouldBegin:function(n){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),n=en("
    "));yr(n,{top:"0px",position:"absolute",visibility:"hidden"});var i=this.get("container");i||(i=this.get("graph").get("container")),(0,eF.isString)(i)&&(i=document.getElementById(i)),i.appendChild(n),this.set("menu",n)},e.prototype.onMenuShow=function(t){var n=this;t.preventDefault();var i=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&i.indexOf(t.item.getType())===-1){n.onMenuHide();return}}else if(i.indexOf("canvas")===-1){n.onMenuHide();return}var a=this.get("shouldBegin");if(!!a(t)){var o=this.get("menu"),s=this.get("getContent"),l=this.get("graph"),u=s(t,l);(0,eF.isString)(u)?o.innerHTML=u:o.innerHTML=u.outerHTML,this.removeMenuEventListener();var f=this.get("handleMenuClick");if(f){var c=function(L){f(L.target,t.item,l)};this.set("handleMenuClickWrapper",c),o.addEventListener("click",c)}var h=l.get("width"),d=l.get("height"),p=o.getBoundingClientRect(),v=this.get("offsetX")||0,m=this.get("offsetY")||0,g=l.getContainer().offsetTop,x=l.getContainer().offsetLeft,b=t.canvasX+x+v,S=t.canvasY+g+m;b+p.width>h&&(b=t.canvasX-p.width-v+x),S+p.height>d&&(S=t.canvasY-p.height-m+g),yr(o,{top:"".concat(S,"px"),left:"".concat(b,"px"),visibility:"visible"});var C=this.get("trigger")==="click",w=function(L){if(C){C=!1;return}n.onMenuHide()};document.body.addEventListener("click",w),this.set("handler",w)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),n=this.get("handler");if(t){var i=this.get("menu");i.removeEventListener("click",t),this.set("handleMenuClickWrapper",null)}n&&document.body.removeEventListener("click",n)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&yr(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var n=this.get("container");n||(n=this.get("graph").get("container")),(0,eF.isString)(n)&&(n=document.getElementById(n)),n.removeChild(t)}},e}(ia),Hwt=wde;var Jl=z(q());var Ede=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),wX=function(){return wX=Object.assign||function(r){for(var e,t=1,n=arguments.length;t `)),u=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,f=0,c=0,h=!1,d=0,p=0,v=0,m=0,g=0,x=0;l.addEventListener("dragstart",function(b){var S,C;if(b.dataTransfer){var w=new Image;w.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",(C=(S=b.dataTransfer).setDragImage)===null||C===void 0||C.call(S,w,0,0);try{b.dataTransfer.setData("text/html","view-port-minimap")}catch(L){b.dataTransfer.setData("text","view-port-minimap")}}if(n.refresh=!1,b.target===l){var A=l.style;d=parseInt(A.left,10),p=parseInt(A.top,10),v=parseInt(A.width,10),m=parseInt(A.height,10),!(v>i[0]||m>i[1])&&(x=a.getZoom(),g=t.get("ratio"),h=!0,f=b.clientX,c=b.clientY)}},!1),l.addEventListener(u?"dragover":"drag",function(b){if(!(!h||(0,Jl.isNil)(b.clientX)||(0,Jl.isNil)(b.clientY))){var S=f-b.clientX,C=c-b.clientY;(d-S<0||d-S+v>=i[0])&&(S=0),(p-C<0||p-C+m>=i[1])&&(C=0),d-=S,p-=C,yr(l,{left:"".concat(d,"px"),top:"".concat(p,"px")}),a.translate(S*x/g,C*x/g),f=b.clientX,c=b.clientY}},!1),l.addEventListener("dragend",function(){h=!1,n.refresh=!0},!1),this.set("viewport",l),s.appendChild(l)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),n=this.get("dx"),i=this.get("dy"),a=this.get("totaldx"),o=this.get("totaldy"),s=this.get("graph"),l=this.get("size"),u=s.get("width"),f=s.get("height"),c=s.getPointByCanvas(0,0),h=s.getPointByCanvas(u,f),d=this.get("viewport");d||this.initViewport();var p=(h.x-c.x)*t,v=(h.y-c.y)*t,m=c.x*t+a,g=c.y*t+o,x=m+p,b=g+v;m<0&&(p+=m,m=0),x>l[0]&&(p=p-(x-l[0])),g<0&&(v+=g,g=0),b>l[1]&&(v=v-(b-l[1])),this.set("ratio",t);var S="".concat(m,"px"),C="".concat(g,"px");yr(d,{left:S,top:C,width:"".concat(p,"px"),height:"".concat(v,"px")})}},e.prototype.updateGraphShapes=function(){var t=this._cfgs.graph,n=this.get("canvas"),i=t.get("group");if(!i.destroyed){var a=i.clone();a.resetMatrix(),n.clear(),n.add(a);var o=t.get("renderer");o===Xwt&&this.updateVisible(a)}},e.prototype.updateVisible=function(t){var n=this;if(!t.isGroup()&&!t.get("visible"))t.hide();else{var i=t.get("children");if(!i||!i.length)return;i.forEach(function(a){a.get("visible")||a.hide(),n.updateVisible(a)})}},e.prototype.updateKeyShapes=function(){var t=this,n=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();(0,Jl.each)(n.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),(0,Jl.each)(n.getNodes(),function(l){t.updateOneNodeKeyShape(l,a)});var o=n.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Jl.each)(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,n){if(!this.destroyed){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?u=Object.assign(l,u):(a=s,n.add(a));var f=a.get("type");(f==="rect"||f==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)}},e.prototype.updateOneNodeKeyShape=function(t,n){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?u=Object.assign(l,u):(a=s,n.add(a));var f=a.get("type");(f==="rect"||f==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateDelegateShapes=function(){var t=this,n=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();(0,Jl.each)(n.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),(0,Jl.each)(n.getNodes(),function(l){t.updateOneNodeDelegateShape(l,a)});var o=n.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Jl.each)(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},n=Object.keys(t);if(!(!n||n.length===0))for(var i=n.length-1;i>=0;i--){var a=t[n[i]],o=a.exist;a.exist=!1,o||(a.remove(),delete t[n[i]])}},e.prototype.updateOneEdgeKeyShape=function(t,n){var i=this.get("itemMap")||{},a=i[t.get("id")];if(a){var o=t.get("keyShape").attr("path");a.attr("path",o)}else a=t.get("keyShape").clone(),n.add(a);t.isVisible()?a.show():a.hide(),a.exist=!0,i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateOneNodeDelegateShape=function(t,n){var i=this.get("delegateStyle"),a=this.get("itemMap")||{},o=a[t.get("id")],s=t.getBBox();if(o){var l={x:s.minX,y:s.minY,width:s.width,height:s.height};o.attr(l)}else o=n.addShape("rect",{attrs:wX({x:s.minX,y:s.minY,width:s.width,height:s.height},i),name:"minimap-node-shape"});t.isVisible()?o.show():o.hide(),o.exist=!0,a[t.get("id")]=o,this.set("itemMap",a)},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,n=t.get("graph"),i=t.get("size"),a=t.get("className"),o=t.get("container"),s=en("
    "));(0,Jl.isString)(o)&&(o=document.getElementById(o)),o?o.appendChild(s):n.get("container").appendChild(s),t.set("container",s);var l=en('
    ');s.appendChild(l),l.addEventListener("dragenter",function(c){c.preventDefault()}),l.addEventListener("dragover",function(c){c.preventDefault()});var u,f=n.get("renderer");f===Xwt?u=new Mh({container:l,width:i[0],height:i[1]}):u=new Gl({container:l,width:i[0],height:i[1]}),t.set("canvas",u),t.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed){var t=this.get("refresh");if(!!t){var n=this.get("graph");if(!n.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("size"),a=this.get("canvas"),o=this.get("type"),s=this.get("padding");if(!a.destroyed){switch(o){case Mde:this.updateGraphShapes();break;case Tde:this.updateKeyShapes();break;case Ide:this.updateDelegateShapes();break;default:break}var l=a.get("children")[0];if(!!l){l.resetMatrix();var u=l.getCanvasBBox(),f=n.get("canvas").getCanvasBBox(),c=n.getZoom()||1,h=f.width/c,d=f.height/c;Number.isFinite(u.width)&&(h=Ywt(u.width,h),d=Ywt(u.height,d)),h+=2*s,d+=2*s;var p=Math.min(i[0]/h,i[1]/d),v=[1,0,0,0,1,0,0,0,1],m=0,g=0;Number.isFinite(u.minX)&&(m=-u.minX),Number.isFinite(u.minY)&&(g=-u.minY);var x=(i[0]-(h-2*s)*p)/2,b=(i[1]-(d-2*s)*p)/2;v=Ade(v,[["t",m,g],["s",p,p],["t",x,b]]),l.setMatrix(v),this.set("ratio",p),this.set("totaldx",x+m*p),this.set("totaldy",b+g*p),this.set("dx",x),this.set("dy",b),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(){this.get("canvas").destroy();var t=this.get("container");t.parentNode.removeChild(t)},e}(ia),qwt=Lde;var Ode=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();function pd(r,e,t){var n=r.x-e.x,i=r.y-e.y;return!t||Math.abs(n)>t||Math.abs(i)>t?Math.sqrt(n*n+i*i):t}function Dde(r,e){return r.x*e.x+r.y*e.y}function Kwt(r,e){var t=(e.source.y-e.target.y)/(e.source.x-e.target.x),n=(t*t*e.source.x+t*(r.y-e.source.y)+r.x)/(t*t+1),i=t*(n-e.source.x)+e.source.y;return{x:n,y:i}}var Pde=function(r){Ode(e,r);function e(t){return r.call(this,t)||this}return 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"),n=this.get("onTick"),i=function(){n&&n(),t.refreshPositions()};this.set("tick",i)},e.prototype.bundling=function(t){var n=this;if(n.set("data",t),!n.isTicking()){var i=t.edges||[],a=t.nodes||[],o={},s=!1;if(a.forEach(function(S){(S.x===null||!S.y===null||S.x===void 0||!S.y===void 0)&&(s=!0),o[S.id]=S}),s)throw new Error("please layout the graph or assign x and y for nodes first");n.set("nodeIdMap",o);var l=n.get("divisions"),u=n.get("divRate"),f=n.divideEdges(l);n.set("edgePoints",f);var c=n.getEdgeBundles();n.set("edgeBundles",c);for(var h=n.get("cycles"),d=n.get("iterations"),p=n.get("iterRate"),v=n.get("lambda"),m=0;md;){var x=d/g,b={x:o[l][m-1].x,y:o[l][m-1].y};b.x+=x*(v.x-o[l][m-1].x),b.y+=x*(v.y-o[l][m-1].y),p.push(b),g-=d,d=h}d-=g}}),p.push({x:f.x,y:f.y}),o[l]=p}}),o},e.prototype.getEdgeLength=function(t){var n=0;return t.forEach(function(i,a){a!==0&&(n+=pd(i,t[a-1]))}),n},e.prototype.getEdgeBundles=function(){var t=this,n=t.get("data"),i=n.edges||[],a=t.get("bundleThreshold"),o=t.get("nodeIdMap"),s=t.get("edgeBundles");return s||(s=[]),i.forEach(function(l,u){(!s[u]||s[u]===void 0)&&(s[u]=[])}),i.forEach(function(l,u){var f=o[l.source],c=o[l.target];i.forEach(function(h,d){if(!(d<=u)){var p=o[h.source],v=o[h.target],m=t.getBundleScore({source:f,target:c},{source:p,target:v});m>=a&&(s[u].push(d),s[d].push(u))}})}),s},e.prototype.getBundleScore=function(t,n){var i=this;t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,n.vx=n.target.x-n.source.x,n.vy=n.target.y-n.source.y,t.length=pd({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),n.length=pd({x:n.source.x,y:n.source.y},{x:n.target.x,y:n.target.y});var a=i.getAngleScore(t,n),o=i.getScaleScore(t,n),s=i.getPositionScore(t,n),l=i.getVisibilityScore(t,n);return a*o*s*l},e.prototype.getAngleScore=function(t,n){var i=Dde({x:t.vx,y:t.vy},{x:n.vx,y:n.vy});return i/(t.length*n.length)},e.prototype.getScaleScore=function(t,n){var i=(t.length+n.length)/2,a=2/(i/Math.min(t.length,n.length)+Math.max(t.length,n.length)/i);return a},e.prototype.getPositionScore=function(t,n){var i=(t.length+n.length)/2,a={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},o={x:(n.source.x+n.target.x)/2,y:(n.source.y+n.target.y)/2},s=pd(a,o);return i/(i+s)},e.prototype.getVisibilityScore=function(t,n){var i=this.getEdgeVisibility(t,n),a=this.getEdgeVisibility(n,t);return ia||Math.abs(c.y)>a){var h=pd(s[f][t],s[n][t]),d=1/h;u.x+=c.x*d,u.y+=c.y*d}}),u},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(),r.prototype.destroy.call(this)},e}(ia),Zwt=Pde;var $wt=z(q());var kde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),EX=function(){return EX=Object.assign||function(r){for(var e,t=1,n=arguments.length;t(u||i.get("height"))&&a>1||c<(f||i.get("height")*.05)&&a<1)&&(a=1),c*=a,n.set("r",c),n.set("r2",c*c);var h=n.get("d");n.set("molecularParam",(h+1)*c),n.set("delegateCenterDiff",void 0),n.magnify(t,l)}},e.prototype.scaleRByDrag=function(t){var n=this;if(!!t){var i=n.get("dragPrePos"),a=n.get("graph"),o,s=a.getPointByClient(t.clientX,t.clientY);t.x-i.x<0?o=1-rF:o=1/(1-rF);var l=n.get("maxR"),u=n.get("minR"),f=n.get("r");(f>(l||a.get("height"))&&o>1||f<(u||a.get("height")*.05)&&o<1)&&(o=1),f*=o,n.set("r",f),n.set("r2",f*f);var c=n.get("d");n.set("molecularParam",(c+1)*f),n.magnify(t,s),n.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){var n=this;if(!(!t&&!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=0;t.originalEvent.wheelDelta<0?i=-.1:i=.1;var a=n.get("d"),o=a+i,s=n.get("maxD"),l=n.get("minD");if(ol){n.set("d",o);var u=n.get("r");n.set("molecularParam",(o+1)*u);var f=n.get("delegate"),c=f?{x:f.attr("x"),y:f.attr("y")}:void 0;n.set("delegateCenterDiff",void 0),n.magnify(t,c)}}},e.prototype.scaleDByDrag=function(t){var n=this,i=n.get("dragPrePos"),a=t.x-i.x>0?.1:-.1,o=n.get("d"),s=o+a,l=n.get("maxD"),u=n.get("minD");if(su){n.set("d",s);var f=n.get("r");n.set("molecularParam",(s+1)*f),n.magnify(t)}n.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,n){var i=this;i.restoreCache();var a=i.get("graph"),o=i.get("cachedMagnifiedModels"),s=i.get("cachedOriginPositions"),l=i.get("showLabel"),u=i.get("r"),f=i.get("r2"),c=i.get("d"),h=i.get("molecularParam"),d=a.getNodes(),p=d.length,v=n?{x:n.x,y:n.y}:{x:t.x,y:t.y};i.get("dragging")&&(i.get("trigger")==="mousemove"||i.get("trigger")==="click")&&(v=i.get("cacheCenter"));var m=i.get("delegateCenterDiff");m&&(v.x+=m.x,v.y+=m.y),i.updateDelegate(v,u);for(var g=0;g
  • `},zoomSensitivity:2}},e.prototype.init=function(){var t=this,n=this.get("graph"),i=this.get("getContent"),a=i(n),o=a;(0,mx.isString)(a)&&(o=en(a));var s=this.get("className");o.setAttribute("class",s||"g6-component-toolbar");var l=this.get("container");l||(l=this.get("graph").get("container")),(0,mx.isString)(l)&&(l=document.getElementById(l)),l.appendChild(o),this.set("toolBar",o);var u=this.get("handleClick");o.addEventListener("click",function(c){var h=Fde(c).filter(function(p){return p.nodeName==="LI"});if(h.length!==0){var d=h[0].getAttribute("code");!d||(u?u(d,n):t.handleDefaultOperator(d,n))}});var f=this.get("position");f&&yr(o,{top:"".concat(f.y,"px"),left:"".concat(f.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),n=document.querySelector('.g6-component-toolbar li[code="undo"]'),i=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),a=document.querySelector('.g6-component-toolbar li[code="redo"]'),o=document.querySelector('.g6-component-toolbar li[code="redo"] svg');!n||!i||!a||!o||t.on("stackchange",function(s){var l=s.undoStack,u=s.redoStack,f=l.length,c=u.length;f===1?(n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(n.removeAttribute("style"),i.removeAttribute("style")),c===0?(a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4")):(a.removeAttribute("style"),o.removeAttribute("style"))})},e.prototype.undo=function(){var t=this.get("graph"),n=t.getUndoStack();if(!(!n||n.length===1)){var i=n.pop();if(i){var a=i.action;t.pushStack(a,(0,mx.clone)(i.data),"redo");var o=i.data.before;if(a==="add"&&(o=i.data.after),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=t.findById(u.id);u.visible?t.showItem(f,!1):t.hideItem(f,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateItem(u.id,u,!1)})});break;case"changedata":t.changeData(o,!1);break;case"delete":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=u.itemType;delete u.itemType,t.addItem(f,u,!1)})});break}case"add":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.removeItem(u.id,!1)})});break;case"updateComboTree":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateComboTree(u.id,u.parentId,!1)})});break;default:}}}},e.prototype.redo=function(){var t=this.get("graph"),n=t.getRedoStack();if(!(!n||n.length===0)){var i=n.pop();if(i){var a=i.action,o=i.data.after;if(t.pushStack(a,(0,mx.clone)(i.data)),a==="delete"&&(o=i.data.before),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=t.findById(u.id);u.visible?t.showItem(f,!1):t.hideItem(f,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateItem(u.id,u,!1)})});break;case"changedata":t.changeData(o,!1);break;case"delete":o.edges&&o.edges.forEach(function(s){t.removeItem(s.id,!1)}),o.nodes&&o.nodes.forEach(function(s){t.removeItem(s.id,!1)}),o.combos&&o.combos.forEach(function(s){t.removeItem(s.id,!1)});break;case"add":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=u.itemType;delete u.itemType,t.addItem(f,u,!1)})});break}case"updateComboTree":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateComboTree(u.id,u.parentId,!1)})});break;default:}}}},e.prototype.handleDefaultOperator=function(t,n){var i=n.getZoom();switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":{var a=1/(1-eEt*this.get("zoomSensitivity")),o=this.get("maxZoom")||n.get("maxZoom");if(a*i>o)return;n.zoomTo(i*a);break}case"zoomIn":{var s=1-eEt*this.get("zoomSensitivity"),l=this.get("minZoom")||n.get("minZoom");if(s*i\u7C7B\u578B\uFF1A`.concat(n.item.getType(),` ID\uFF1A`).concat(n.item.getID(),` `)},shouldBegin:function(n){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{"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,n=t.get("className")||"g6-component-tooltip",i=en("
    ")),a=t.get("container");a||(a=t.get("graph").get("container")),(0,LS.isString)(a)&&(a=document.getElementById(a)),yr(i,{position:"absolute",visibility:"hidden",display:"none"}),a.appendChild(i),t.get("trigger")!=="click"&&(i.addEventListener("mouseenter",function(o){yr(i,{visibility:"visible",display:"unset"})}),i.addEventListener("mouseleave",function(o){t.hideTooltip()})),t.set("tooltip",i)},e.prototype.onClick=function(t){var n=this.get("itemTypes");if(!(t.item&&t.item.getType&&n.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget===i?(this.currentTarget=null,this.hideTooltip(),a.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var n=this.get("itemTypes");if(!(t.item&&t.item.getType&&n.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var n=this.get("itemTypes");t.item&&t.item.getType&&n.indexOf(t.item.getType())===-1||!this.currentTarget||t.item!==this.currentTarget||this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip();var t=this.get("graph");t.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.showTooltip=function(t){if(!!t.item){var n=this.get("itemTypes");if(!(t.item.getType&&n.indexOf(t.item.getType())===-1)){var i=this.get("tooltip"),a=this.get("getContent"),o=a(t);(0,LS.isString)(o)?i.innerHTML=o:i.innerHTML=o.outerHTML,this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&yr(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var n=this.get("shouldBegin"),i=this.get("tooltip");if(!n(t)){yr(i,{visibility:"hidden",display:"none"});return}var a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=this.get("offsetX")||0,u=this.get("offsetY")||0,f=a.getPointByClient(t.clientX,t.clientY),c=this.get("fixToNode"),h=t.item;if(h.getType&&h.getType()==="node"&&c&&(0,LS.isArray)(c)&&c.length>=2){var d=h.getBBox();f={x:d.minX+d.width*c[0],y:d.minY+d.height*c[1]}}var p=a.getCanvasByPoint(f.x,f.y),v=p.x,m=p.y,g=a.getContainer(),x={x:v+g.offsetLeft+l,y:m+g.offsetTop+u};yr(i,{visibility:"visible",display:"unset"});var b=i.getBoundingClientRect();v+b.width+l>o&&(x.x-=b.width+l),m+b.height+u>s&&(x.y-=b.height+u),yr(i,{left:"".concat(x.x,"px"),top:"".concat(x.y,"px")})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var n=this.get("container");n||(n=this.get("graph").get("container")),(0,LS.isString)(n)&&(n=document.getElementById(n)),n.removeChild(t)}},e}(ia),iEt=zde;var vs=z(q());var sl=z(q()),Ude=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;nf&&(o=f,a=u)})}t.originalEvent.deltaY>0?a=Math.max(0,a-1):a=Math.min(e.speedAxisY.length-1,a+1);var s=e.speedAxisY[a]-i;n=uT(n,[["t",0,s]]),e.speedPoint.setMatrix(n),e.currentSpeed=e.speedAxisY.length-a,e.speedText.attr("text","".concat(e.currentSpeed,".0X")),e.group.emit(vd,{speed:e.currentSpeed,type:e.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(t){var n,i,a=t.target.get("isChecked");a?(e.checkedIcon.hide(),e.checkedText.attr("text",((i=e.controllerCfg)===null||i===void 0?void 0:i.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4"),e.currentType="range"):(e.checkedIcon.show(),e.checkedText.attr("text",((n=e.controllerCfg)===null||n===void 0?void 0:n.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4"),e.currentType="single"),t.target.set("isChecked",!a),e.group.emit(vd,{type:e.currentType,speed:e.currentSpeed})})},r.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},r}(),aF=ope;var qi=function(){return qi=Object.assign||function(r){for(var e,t=1,n=arguments.length;tv?(w.show(),L.show(),v=k.minX+k.width+10):(w.hide(),L.hide()),w}),this.controllerBtnGroup=new aF(qi({group:this.group,x:this.x,y:this.y+i+25,width:n,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),s.move(this.x,this.y),this.bindEvents()},r.prototype.bindEvents=function(){var e=this,t=this.group.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),t.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var n=this.group.find(function(i){return i.get("name")==="maxHandlerShape"});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(Tc,":click"),function(){e.isPlay=!e.isPlay,e.currentHandler=e.maxHandlerShape,e.changePlayStatus()}),this.group.on("".concat(Pg,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(.01),e.updateUI()}),this.group.on("".concat(kg,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(-.01),e.updateUI()}),this.group.on(vd,function(i){var a=i.type,o=i.speed;e.currentSpeed=o,e.currentMode=a,a==="single"?(e.minHandlerShape.hide(),e.foregroundShape.hide(),e.minTextShape.hide()):a==="range"&&(e.minHandlerShape.show(),e.foregroundShape.show(),e.minTextShape.show())})},r.prototype.adjustTickIndex=function(e){for(var t=0;t1&&(this.end=1);var t=this.x+this.start*this.width,n=this.x+this.end*this.width;this.foregroundShape.attr("x",t),this.foregroundShape.attr("width",n-t);var i=(0,vs.get)(this.handlerStyle,"width",OX);this.setText(this.minText,this.maxText);var a=this.dodgeText([t,n]),o=a[0],s=a[1];this.minHandlerShape.setX(t-i/2),(0,vs.each)(o,function(l,u){return e.minTextShape.attr(u,l)}),this.maxHandlerShape.setX(n-i/2),(0,vs.each)(s,function(l,u){return e.maxTextShape.attr(u,l)}),this.currentMode==="range"?this.graph.emit(Ou,{value:[this.start,this.end].sort()}):this.currentMode==="single"&&this.graph.emit(Ou,{value:[this.end,this.end]})},r.prototype.dodgeText=function(e){var t,n,i=2,a=(0,vs.get)(this.handlerStyle,"width",OX),o=this.minTextShape,s=this.maxTextShape,l=e[0],u=e[1],f=!1;l>u&&(t=[u,l],l=t[0],u=t[1],n=[s,o],o=n[0],s=n[1],f=!0);var c=o.getBBox(),h=s.getBBox(),d=null,p=null;return this.timeBarType==="trend"?(d=l-c.widththis.x+this.width?{x:u-a/2-i,textAlign:"right"}:{x:u+a/2+i,textAlign:"left"}):this.timeBarType==="simple"&&(d=o.attr("x")>c.width?{x:l,textAlign:"center"}:{x:l,textAlign:"left"},p=s.attr("x")>this.width-h.width?{x:u,textAlign:"right"}:{x:u,textAlign:"center"}),f?[p,d]:[d,p]},r.prototype.startPlay=function(){var e=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var t=e,n=t.ticks,i=t.width,a=e.currentSpeed,o=i/n.length,s=o/((10-a)*1e3/60),l=e.adjustOffsetRange(s/e.width);e.updateStartEnd(l),e.updateUI(),e.isPlay&&(e.playHandler=e.startPlay())}):void 0},r.prototype.changePlayStatus=function(e){e===void 0&&(e=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(nF,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),e&&this.graph.emit(iF,null))},r.prototype.destory=function(){this.graph.off(Ou);var e=this.group,t=e.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.off("minHandlerShape-handler:mousedown"),t.off("minHandlerShape-handler:touchstart"),t.destroy());var n=e.find(function(i){return i.get("name")==="maxHandlerShape"});n&&(n.off("maxHandlerShape-handler:mousedown"),n.off("maxHandlerShape-handler:touchstart"),n.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),e.off("".concat(Tc,":click")),e.off("".concat(Pg,":click")),e.off("".concat(kg,":click")),e.off(vd),e.destroy(),this.trendComponent&&this.trendComponent.destory()},r}(),vEt=vpe;var sF=z(q());var mEt=z(q());var mpe=function(){function r(e){var t=e.x,n=t===void 0?0:t,i=e.y,a=i===void 0?0:i,o=e.container,s=e.text,l=e.padding,u=l===void 0?[4,4,4,4]:l,f=e.className,c=f===void 0?"g6-component-timebar-tooltip":f,h=e.backgroundColor,d=h===void 0?"#000":h,p=e.textColor,v=p===void 0?"#fff":p,m=e.opacity,g=m===void 0?.8:m,x=e.fontSize,b=x===void 0?12:x;this.container=o,this.className=c,this.backgroundColor=d,this.textColor=v,this.x=n,this.y=a,this.text=s,this.padding=u,this.opacity=g,this.fontSize=b,this.render()}return r.prototype.render=function(){var e=this,t=e.className,n=e.x,i=e.y,a=e.backgroundColor,o=e.textColor,s=e.text,l=e.padding,u=e.opacity,f=e.fontSize,c=e.container,h=en("
    '));(0,mEt.isString)(c)&&(c=document.getElementById(c)),c.appendChild(h),e.parentHeight=c.offsetHeight,e.parentWidth=c.offsetWidth,yr(h,{visibility:"hidden",top:0,left:0});var d=en(`
    "));d.innerHTML=s,h.appendChild(d),e.backgroundDOM=d;var p=en("
    "));h.appendChild(p),e.arrowDOM=p,e.container=h},r.prototype.show=function(e){var t=this,n=e.text,i=e.x,a=e.y,o=e.clientX,s=e.clientY;t.backgroundDOM.innerHTML=n;var l=t.backgroundDOM.offsetWidth,u=t.backgroundDOM.offsetHeight,f=t.arrowDOM.offsetWidth,c=t.arrowDOM.offsetHeight;yr(t.container,{top:"".concat(-u-c,"px"),left:"".concat(i,"px"),visibility:"visible"}),yr(t.backgroundDOM,{marginLeft:"".concat(-l/2,"px")}),yr(t.arrowDOM,{marginLeft:"".concat(-f/2,"px"),top:"".concat(u,"px")});var h=i-l/2,d=i+l/2;h<0?yr(t.backgroundDOM,{marginLeft:"".concat(-l/2-h,"px")}):d>t.parentWidth&&yr(t.backgroundDOM,{marginLeft:"".concat(-l/2-d+t.parentWidth+12,"px")})},r.prototype.hide=function(){yr(this.container,{top:0,left:0,visibility:"hidden"})},r}(),gEt=mpe;var oF=function(){return oF=Object.assign||function(r){for(var e,t=1,n=arguments.length;t=L&&R<=k,F=P?f:c,D=C.addShape("rect",{attrs:oF({x:a+R*(S+x),y:a,width:S,height:g},F),draggable:!0,name:"tick-rect-".concat(R)}),G=C.addShape("rect",{attrs:{x:a+R*S+x*(2*R-1)/2,y:a,width:R===0||R===b-1?S+x/2:S+x,height:g,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(R)});G.toFront();var U=D.getBBox(),j=(U.minX+U.maxX)/2;w.push({rect:D,pickRect:G,value:I.date,x:j,y:U.minY});var H;if(u?(H=u(I),!(0,sF.isString)(H)&&H&&(H=I.date)):R%Math.round(b/10)==0&&(H=I.date),H){A.push(H);var tt=U.maxY+a*2;C.addShape("line",{attrs:{stroke:"#BFBFBF",x1:j,y1:tt,x2:j,y2:tt+v},name:"tick-line"});var et=tt+v+a,ut=C.addShape("text",{attrs:oF({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:j,y:et,textAlign:"center",text:H,textBaseline:"top",fontSize:10,fontFamily:e.fontFamily||"Arial, sans-serif"},h),capture:!1,name:"tick-label"}),$=ut.getBBox();if($.maxX>n?ut.attr("textAlign","right"):$.minX<0&&ut.attr("textAlign","left"),(0,sF.isNumber)(O)&&A.length!==10){var st=gpe([1,0,0,0,1,0,0,0,1],[["t",-j,-et],["r",O],["t",j-5,et+2]]);ut.attr({textAlign:"left",matrix:st})}A.length===1?ut.attr({textAlign:"left"}):A.length===10&&ut.attr({textAlign:"right"})}}),this.tickRects=w;var M=this.group;this.currentSpeed=1,this.controllerBtnGroup=new aF({group:M,x:this.x,y:this.y+i+5,width:n,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"})},r.prototype.initEvent=function(){var e=this,t=this.sliceGroup;t.on("click",function(f){var c=f.target;if(!(c.get("type")!=="rect"||!c.get("name"))){var h=parseInt(c.get("name").split("-")[2],10);if(!isNaN(h)){var d=e.tickRects,p=e.unselectedTickStyle;d.forEach(function(x){x.rect.attr(p)});var v=e.selectedTickStyle;d[h].rect.attr(v),e.startTickRectId=h,e.endTickRectId=h;var m=d.length,g=h/m;e.graph.emit(Ou,{value:[g,g]})}}}),t.on("dragstart",function(f){var c=e.tickRects,h=e.unselectedTickStyle;c.forEach(function(x){x.rect.attr(h)});var d=f.target,p=parseInt(d.get("name").split("-")[2],10),v=e.selectedTickStyle;c[p].rect.attr(v),e.startTickRectId=p;var m=c.length,g=p/m;e.graph.emit(Ou,{value:[g,g]}),e.dragging=!0}),t.on("dragover",function(f){if(!!e.dragging&&f.target.get("type")==="rect"){for(var c=parseInt(f.target.get("name").split("-")[2],10),h=e.startTickRectId,d=e.tickRects,p=e.selectedTickStyle,v=e.unselectedTickStyle,m=0;m=h&&m<=c?p:v;d[m].rect.attr(g)}var x=d.length;e.endTickRectId=c;var b=h/x,S=c/x;e.graph.emit(Ou,{value:[b,S]})}}),t.on("drop",function(f){if(!!e.dragging&&(e.dragging=!1,f.target.get("type")==="rect")){var c=e.startTickRectId,h=parseInt(f.target.get("name").split("-")[2],10);if(!(h0?t.endTickRectId++:(n[t.endTickRectId].rect.attr(a),t.endTickRectId--),s!==t.startTickRectId)t.endTickRectId")),yr(u,{position:"relative"})),l.appendChild(u),this.set("timeBarContainer",u);var f,c=t.get("renderer");c==="SVG"?f=new Mh({container:u,width:i,height:a}):f=new Gl({container:u,width:i,height:a}),this.get("containerCSS")&&yr(u,this.get("containerCSS")),this.set("canvas",f)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas"),n=t.addGroup({name:"timebar-group"});this.set("timeBarGroup",n),this.renderTrend(),this.initEvent();var i=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",i)},e.prototype.renderTrend=function(){var t=this,n=this._cfgs,i=n.width,a=n.x,o=n.y,s=n.padding,l=n.type,u=n.trend,f=n.slider,c=n.controllerCfg,h=n.textStyle,d=n.tick,p=n.backgroundStyle,v=n.foregroundStyle,m=u.data,g=Spe(u,["data"]),x=i-2*s,b=l==="trend"?wpe:Cpe,S=this.get("graph"),C=this.get("timeBarGroup"),w=this.get("canvas"),A=null;if(l==="trend"||l==="simple"){var L=this.get("getValue");A=new vEt(lv(lv({graph:S,canvas:w,group:C,type:l,x:a+s,y:l==="trend"?o+s:o+s+15,width:x,height:b,padding:s,backgroundStyle:p,foregroundStyle:v,trendCfg:lv(lv({},g),{data:m.map(function(O){return(L==null?void 0:L(O))||O.value})})},f),{tick:{ticks:m,tickLabelFormatter:d.tickLabelFormatter,tickLabelStyle:d.tickLabelStyle,tickLineStyle:d.tickLineStyle},handlerStyle:lv(lv({},f.handlerStyle),{height:f.height||b}),controllerCfg:c,textStyle:h}))}else l==="tick"&&(A=new yEt(lv({graph:S,canvas:w,group:C,x:a+s,y:o+s,width:i,height:42,padding:2},d)));var k=function O(){var M=t.get("timebar");M.draggingHandler=!1,M.isPlay&&(M.isPlay=!1,M.currentHandler=M.maxHandlerShape,M.changePlayStatus()),document.removeEventListener("mouseup",O)};w.on("mousedown",function(O){(O.target.get("name")==="maxHandlerShape-handler"||O.target.get("name")==="minHandlerShape-handler"||O.target===A.foregroundShape)&&document.addEventListener("mouseup",k)}),this.set("timebar",A)},e.prototype.filterData=function(t){var n,i=t.value,a=null,o=this._cfgs.type;if(o==="trend"||o==="simple"?a=this._cfgs.trend.data:o==="tick"&&(a=this._cfgs.tick.data),!a||a.length===0){console.warn("\u8BF7\u914D\u7F6E TimeBar \u7EC4\u4EF6\u7684\u6570\u636E");return}var s=this.get("rangeChange"),l=this.get("graph"),u=Math.round(a.length*i[0]),f=Math.round(a.length*i[1]);f=f>=a.length?a.length-1:f,u=u>=a.length?a.length-1:u;var c=(n=this._cfgs.tick)===null||n===void 0?void 0:n.tickLabelFormatter,h=c?c(a[u]):a[u].date,d=c?c(a[f]):a[f].date;if(o!=="tick"){var p=this.get("timebar");p.setText(h,d)}if(s)s(l,h,d);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&this.cacheGraphData.nodes.length===0)&&(this.cacheGraphData=l.get("data"));var v=this.get("filterItemTypes"),m=this.get("changeData"),g=this.get("getDate"),x=this.get("shouldIgnore"),b=a[u].date,S=a[f].date;if(m||m===void 0){var C=this.cacheGraphData.nodes,w=this.cacheGraphData.edges;if(v.includes("node")){C=C.filter(function(L){var k=+((g==null?void 0:g(L))||L.date);return k>=b&&k<=S||(x==null?void 0:x("node",L,{min:b,max:S}))});var A=C.map(function(L){return L.id});w&&(w=w.filter(function(L){return A.includes(L.source)&&A.includes(L.target)||(x==null?void 0:x("edge",L,{min:b,max:S}))}))}(this.get("filterEdge")||v.includes("edge"))&&(w=w.filter(function(L){var k=+((g==null?void 0:g(L))||L.date);return k>=b&&k<=S||(x==null?void 0:x("edge",L,{min:b,max:S}))})),l.changeData({nodes:C,edges:w})}else v.includes("node")&&l.getNodes().forEach(function(L){var k=L.getModel();if(!(x==null?void 0:x("node",k,{min:b,max:S}))){var O=+((g==null?void 0:g(k))||k.date);OS?l.hideItem(L):l.showItem(L)}}),(this.get("filterEdge")||v.includes("edge"))&&l.getEdges().forEach(function(L){var k=L.getModel();if(!(x==null?void 0:x("edge",k,{min:a[u].date,max:a[f].date}))){var O=+((g==null?void 0:g(k))||k.date);Oa[f].date?l.hideItem(L):l.showItem(L)}})}},e.prototype.initEvent=function(){var t=this,n=0,i=0,a=this._cfgs.type;!a||a==="trend"||a==="simple"?(n=this._cfgs.slider.start,i=this._cfgs.slider.end):a==="tick"&&(n=this._cfgs.tick.start,i=this._cfgs.tick.end);var o=this.get("graph");o.on("afterrender",function(s){t.filterData({value:[n,i]})}),o.on(Ou,(0,fT.throttle)(function(s){t.filterData(s)},200,{trailing:!0,leading:!0}))},e.prototype.destroy=function(){var t=this.get("timebar");t&&t.destory&&t.destory(),r.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var i=this.get("container");i||(i=this.get("graph").get("container")),(0,fT.isString)(i)&&(i=document.getElementById(i)),i.removeChild(n)}},e}(ia),xEt=Epe;var DS=z(q());var Ape=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Mpe=ka.applyMatrix;function Tpe(r,e){var t,n;if(r.naturalWidth)t=r.naturalWidth,n=r.naturalHeight;else{var i=new Image;i.src=r.src,i.onload=function(){e&&e(i.width,i.height)}}return[t,n]}var Ipe=function(r){Ape(e,r);function e(t){return r.call(this,t)||this}return 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,n=this._cfgs,i=n.graph;if(!this.destroyed){var a=this.get("container");(0,DS.isString)(a)&&(a=document.getElementById(a));var o=en("
    x||d>b||(v=i.getZoom(),p=t.get("ratio"),u=!0,s=m.clientX,l=m.clientY)}},!1),a.addEventListener("mousemove",function(m){if(!(!u||(0,DS.isNil)(m.clientX)||(0,DS.isNil)(m.clientY))){var g=t.get("width"),x=t.get("height"),b=o.style;f=parseInt(b.left,10),c=parseInt(b.top,10),h=parseInt(b.width,10),d=parseInt(b.height,10);var S=s-m.clientX,C=l-m.clientY;f-S<0?S=f:f-S+h>=g&&(S=0),c-C<0?C=c:c-C+d>=x&&(C=0),f-=S,c-=C,yr(o,{left:"".concat(f,"px"),top:"".concat(c,"px")}),i.translate(S*v/p,C*v/p),s=m.clientX,l=m.clientY}},!1),a.addEventListener("mouseleave",function(){u=!1,n.refresh=!0},!1),a.addEventListener("mouseup",function(){u=!1,n.refresh=!0},!1),this.set("viewport",o),a.appendChild(o)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),n=this.get("width"),i=this.get("height"),a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=o/s,u=a.getGroup(),f=u.getCanvasBBox(),c=[(f.minX+f.maxX)/2,(f.minY+f.maxY)/2],h=[f.maxX-f.minX,f.maxY-f.minY],d={centerX:c[0],centerY:c[1],width:0,height:0,minX:0,minY:0};f[0]/f[1]>l?(d.width=h[0],d.height=d.width/l):(d.height=h[1],d.width=d.height*l),d.minX=c[0]-d.width/2,d.minY=c[1]-d.height/2;var p=u.getMatrix();p||(p=[1,0,0,0,1,0,0,0,1]);var v=Ai.invert([1,0,0,0,1,0,0,0,1],p),m=Mpe({x:d.minX,y:d.minY},v),g=a.getCanvasByPoint(m.x,m.y),x=this.get("viewport");x||this.initViewport();var b=o/d.width,S=b*n,C=b*i,w=n*-g.x/d.width,A=i*-g.y/d.height,L=w+S,k=A+C;w<0&&(S+=w,w=0),L>n&&(S=S-(L-n)),A<0&&(C+=A,A=0),k>i&&(C=C-(k-i)),this.set("ratio",t);var O="".concat(w,"px"),M="".concat(A,"px");yr(x,{left:O,top:M,width:"".concat(S,"px"),height:"".concat(C,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this,n=t.get("graph"),i=n.get("width"),a=n.get("height"),o=a/i,s=t.get("className"),l=t.get("container"),u=t.get("width"),f=t.get("height");!u&&!f&&(u=200),u?(f=o*u,t.set("height",f)):(u=1/o*f,t.set("width",u));var c=en("
    "));(0,DS.isString)(l)&&(l=document.getElementById(l)),l?l.appendChild(c):n.get("container").appendChild(c),t.set("container",c);var h=en('
    ');c.appendChild(h);var d=en('');h.appendChild(d),t.set("containerDOM",h),t.set("containerSpan",d);var p=en(''));t.set("imgDOM",p),t.updateImgSize(),d.appendChild(p),t.updateCanvas()},e.prototype.updateImgSize=function(){var t=this,n=t.get("imgDOM"),i=t.get("width"),a=t.get("height");n.onload=function(){var o=Tpe(n);o[0]>o[1]?n.width=i:n.height=a}},e.prototype.updateCanvas=function(){var t=this.get("refresh");if(!!t){var n=this.get("graph");if(!n.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("width"),a=n.get("canvas").getCanvasBBox(),o=a.width,s=i/o;this.set("ratio",s),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){var n=this,i=n.get("imgDOM");i.remove(),n.set("graphImg",t);var a=en(''));n.set("imgDOM",a),a.src=t,n.updateImgSize();var o=n.get("containerSpan");o.appendChild(a),n.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(ia),bEt=Ipe;var _Et=z(q());var Lpe=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),DX=function(){return DX=Object.assign||function(r){for(var e,t=1,n=arguments.length;t(u||i.get("height"))&&a>1||c<(f||i.get("height")*.05)&&a<1)&&(a=1),c*=a,n.set("r",c),n.filter(t)}},e.prototype.filter=function(t){var n=this,i=n.get("graph"),a=i.getNodes(),o={},s=n.get("r"),l=n.get("type"),u={x:t.x,y:t.y};n.updateDelegate(u,s);var f=n.get("shouldShow"),c=n.get("vShapes");c&&c.forEach(function(g){g.remove(),g.destroy()}),c=[],a.forEach(function(g){var x=g.getModel(),b=x.x,S=x.y;Ope({x:b,y:S},u)
    `);s.appendChild(l),this.set("container",l);var u=this.render();yr(l,this.getContainerPos(u)),this.bindEvents()},e.prototype.getContainerPos=function(t){t===void 0&&(t=[0,0]);var n=this,i=n.get("graph"),a=this.get("offsetX"),o=this.get("offsetY"),s=this.get("margin"),l=this.get("position").split("-"),u={top:0,right:1,bottom:2,left:3},f=0,c=0,h={left:(i.getWidth()-t[0])/2+f,top:(i.getHeight()-t[1])/2+c};return l.forEach(function(d){var p=s[u[d]],v=d;switch(d){case"top":p+=c;break;case"left":p+=f;break;case"bottom":p=i.getHeight()-t[1]-p+c,v="top";break;default:p=i.getWidth()-t[0]-p+f,v="left";break}h[v]=p}),h.top+=o+i.getContainer().offsetTop,h.left+=a+i.getContainer().offsetLeft,Object.keys(h).forEach(function(d){h[d]="".concat(h[d],"px")}),h},e.prototype.bindEvents=function(){var t=this,n=t.get("filter");if(!(!n||!n.enable)){var i=n.trigger||"click";Bpe.includes(i)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),i="click");var a=t.get("legendCanvas");i==="mouseenter"?(a.on("node-container:mouseenter",function(o){return t.filterData(o)}),a.on("node-container:mouseleave",function(o){t.clearFilter(),t.clearActiveLegend()})):(a.on("node-container:click",function(o){return t.filterData(o)}),a.on("click",function(o){o.target&&o.target.isCanvas&&o.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var n=this.render();yr(this.get("container"),this.getContainerPos(n))},e.prototype.activateLegend=function(t){var n=this.get("filter"),i=n==null?void 0:n.multiple;i||this.clearActiveLegend();var a=t.get("parent");a.get("active")?(a.set("active",!1),this.findLegendItemsByState("active").length&&a.set("inactive",!0)):(a.set("inactive",!1),a.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(c){c.set("inactive",!0)}):this.clearActiveLegend();var o=(n==null?void 0:n.lengedStateStyles)||{},s=(o==null?void 0:o.inactive)||{opacity:.5,"text-shape":{opacity:.5}},l=s["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(c){var h=c.get("children"),d=h[0],p=h[1];d.attr(Aa(Aa({},d.get("oriAttrs")),s)),p.attr(Aa(Aa({},p.get("oriAttrs")),l))});var u=(o==null?void 0:o.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},f=u["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(c){var h=c.get("children"),d=h[0],p=h[1];d.attr(Aa(Aa({},d.get("oriAttrs")),u)),p.attr(Aa(Aa({},p.get("oriAttrs")),f))})},e.prototype.findLegendItemsByState=function(t,n,i){n===void 0&&(n="all"),i===void 0&&(i=!0);var a=this.get("legendCanvas").find(function(l){return l.get("name")==="root"}),o=a.find(function(l){return l.get("name")==="node-group"}),s=a.find(function(l){return l.get("name")==="edge-group"});return n==="node"?o.get("children").filter(function(l){return!!l.get(t)===i}):n==="edge"?s.get("children").filter(function(l){return!!l.get(t)===i}):o.get("children").filter(function(l){return!!l.get(t)===i}).concat(s.get("children").filter(function(l){return!!l.get(t)===i}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas"),n=t.find(function(a){return a.get("name")==="root"}),i=[n.find(function(a){return a.get("name")==="node-group"}),n.find(function(a){return a.get("name")==="edge-group"})];i.forEach(function(a){a.get("children").forEach(function(o){o.set("active",!1),o.set("inactive",!1);var s=o.get("children"),l=s[0],u=s[1];l.attr(l.get("oriAttrs")),u.attr(u.get("oriAttrs"))})})},e.prototype.filterData=function(t){var n=this.get("filter"),i=n==null?void 0:n.filterFunctions;if(!(!n||!i)){var a=this.get("legendCanvas"),o=this.get("graph"),s=n.graphActiveState||"active",l=n.graphInactiveState||"inactive",u=n.multiple;this.clearFilter(),u||this.clearActiveLegend(),this.activateLegend(t.target);var f=a.find(function(g){return g.get("name")==="root"}),c=f.find(function(g){return g.get("name")==="node-group"}),h=f.find(function(g){return g.get("name")==="edge-group"}),d=c.get("children").filter(function(g){return g.get("active")}),p=h.get("children").filter(function(g){return g.get("active")}),v=0,m=["getNodes","getEdges"];m.forEach(function(g){o[g]().forEach(function(x){var b=!1,S=g==="getNodes"?d:p;S.forEach(function(C){var w=i[C.get("id")];b=b||w(x.getModel())}),b?(o.setItemState(x,l,!1),o.setItemState(x,s,!0),v++):(o.setItemState(x,s,!1),o.setItemState(x,l,!0))})}),v||m.forEach(function(g){o[g]().forEach(function(x){o.clearItemStates(x,[l])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),n=this.get("filter");if(!!n){var i=n.graphActiveState||"active",a=n.graphInactiveState||"inactive";t.getNodes().forEach(function(o){t.clearItemStates(o,[i,a])}),t.getEdges().forEach(function(o){t.clearItemStates(o,[i,a])})}},e.prototype.render=function(){var t=this;this.processData();var n=this.get("legendCanvas");if(!n){n=new Gl({container:this.get("container"),width:200,height:200});var i=n.addGroup({name:"root"});i.addGroup({name:"node-group"}),i.addGroup({name:"edge-group"}),this.set("legendCanvas",n)}var a=n.find(function(G){return G.get("name")==="root"}),o=a.find(function(G){return G.get("name")==="node-group"}),s=a.find(function(G){return G.get("name")==="edge-group"}),l=this.get("itemsData"),u=["nodes","edges"],f=[o,s];u.forEach(function(G,U){l[G].forEach(function(j){var H,tt=f[U].addGroup({id:j.id,name:"node-container"}),et,ut=j.type,$=t.getShapeSize(j),st=$.width,_t=$.height,dt=$.r,gt=t.getStyle(G.substr(0,4),j);switch(j.type){case"circle":et={r:dt,x:0,y:0};break;case"rect":et={width:st,height:_t,x:-st/2,y:-_t/2};break;case"ellipse":et={r1:st,r2:_t,x:0,y:0};break;case"line":et={x1:-st/2,y1:0,x2:st/2,y2:0},ut="line";break;case"quadratic":et={path:[["M",-st/2,0],["Q",0,st/2,st/2,0]]},ut="path";break;case"cubic":et={path:[["M",-st/2,0],["C",-st/6,st/2,st/6,-st/2,st/2,0]]},ut="path";break;default:et={r:dt,x:0,y:0};break}var Tt=tt.addShape(ut,{attrs:Aa(Aa({},et),gt),name:"".concat(j.type,"-node-keyShape"),oriAttrs:Aa({opacity:1},gt)});if(j.label){var Ut=Tt.getBBox(),$t=((H=j.labelCfg)===null||H===void 0?void 0:H.style)||{},Y=Aa({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},$t);tt.addShape("text",{attrs:Aa({x:Ut.maxX+4,y:0,text:j.label},Y),className:"legend-label",name:"".concat(j.type,"-node-text"),oriAttrs:Y})}})});var c=this.get("padding"),h,d=a.find(function(G){return G.get("name")==="title-container"}),p={height:0,maxY:0,width:0};if(this.get("title")){d||(d=a.addGroup({name:"title-container"}));var v={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:c[0]},m=this.get("titleConfig")||{},g=Object.assign(v,m.style||{});h=d.addShape("text",{attrs:Aa({text:this.get("title")},g)}),p=d.getCanvasBBox(),d.setMatrix([1,0,0,0,1,0,m.offsetX,m.offsetY,1])}this.layoutItems();var x=a.getCanvasBBox(),b=o.getCanvasBBox(),S=b.minX<0?Math.abs(b.minX)+c[3]:c[3],C=p.maxYc.max&&(c.max=s[0]),M>h&&(h=M),S.setMatrix([1,0,0,0,1,0,I,R,1])});var d=c.max-c.min,p={min:0,max:-1/0},v=u.getCanvasBBox();s[0]=0,s[1]=a==="vertical"?v.maxX+n:v.maxY+i,f.get("children").forEach(function(S,C){C===0&&(p.min=s[0]);var w=S.get("children")[0],A=S.getCanvasBBox(),L=w.getBBox(),k=L.width,O=L.height,M=0,I=0;a==="vertical"?(M=s[1],I=s[0],s[0]=I+A.height+i,S.setMatrix([1,0,0,0,1,0,0,I+O/2,1])):(M=s[0],I=s[1],s[0]=M+A.width+n,S.setMatrix([1,0,0,0,1,0,M+k/2,0,1])),s[0]>p.max&&(p.max=s[0])});var m=p.max-p.min;if(o&&o!==""&&o!=="left"){var g=d-m,x=o==="center"?Math.abs(g)/2:Math.abs(g),b=g<0?u:f;b.get("children").forEach(function(S){var C=S.getMatrix()||[1,0,0,0,1,0,0,0,1];a==="vertical"?C[7]+=x:C[6]+=x,S.setMatrix(C)})}},e.prototype.processData=function(){var t=this.get("data"),n={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(i,a){return i.order-a.order}),t.nodes.forEach(function(i){var a,o,s,l,u,f=i.size||[((a=i.style)===null||a===void 0?void 0:a.width)||((o=i.style)===null||o===void 0?void 0:o.r)||8,((s=i.style)===null||s===void 0?void 0:s.height)||((l=i.style)===null||l===void 0?void 0:l.r)||8],c=((u=i.labelCfg)===null||u===void 0?void 0:u.style)||{};n.nodes.push({id:i.id||(0,gd.uniqueId)(),type:i.type||"circle",style:Aa({},i.style),order:i.order,label:i.label,itemType:"node",size:f,labelCfg:{position:"right",style:Aa({fontFamily:"Arial"},c)}})})),t.edges&&(t.edges.sort(function(i,a){return i.order-a.order}),t.edges.forEach(function(i){var a,o,s=i.type||"line";i.type==="cubic-horizontal"&&(s="cubic");var l=((a=i.labelCfg)===null||a===void 0?void 0:a.style)||{},u=i.size||[((o=i.style)===null||o===void 0?void 0:o.width)||8,1];n.edges.push({id:i.id||(0,gd.uniqueId)(),type:s,size:u,style:Aa({lineWidth:(0,gd.isArray)(u)?u[1]:1},i.style),order:i.order,label:i.label,itemType:"edge",labelCfg:{position:"right",style:Aa({fontFamily:"Arial"},l)}})})),this.set("itemsData",n)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var n=this.get(t);if((0,gd.isNumber)(n))this.set(t,[n,n,n,n]);else if((0,gd.isArray)(n))switch(n.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[n[0],n[0],n[0],n[0]]);break;case 2:this.set(t,[n[0],n[1],n[0],n[1]]);break;case 3:this.set(t,[n[0],n[1],n[2],n[1]]);break;default:break}return this.get(t)},e.prototype.getShapeSize=function(t){var n,i,a;return t.size&&((0,gd.isArray)(t.size)?(n=t.size[0],i=t.size[1]||t.size[0],a=t.size[0]/2):(0,gd.isNumber)(t.size)&&(n=t.size,i=t.size,a=t.size/2)),t.style&&(t.style.width&&(n=t.style.width),t.style.height&&(i=t.style.height),t.style.r&&(a=t.style.r)),a||(a=5),n||(n=a),i||(i=a),{width:n,height:i,r:a}},e.prototype.getStyle=function(t,n){var i=t==="node"?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1};return Aa(Aa({},i),n.style||{})},e.prototype.destroy=function(){var t=this.get("graph"),n=t.get("container"),i=this.get("container");n.removeChild(i)},e}(ia),AEt=Gpe;var zpe={PluginBase:ia,Menu:Hwt,Grid:Uwt,Minimap:qwt,Bundling:Zwt,ToolBar:rEt,Tooltip:iEt,Fisheye:Jwt,TimeBar:xEt,ImageMinimap:bEt,EdgeFilterLens:wEt,SnapLine:EEt,Legend:AEt},MEt=zpe;var mo=MEt;var PX=z(q());Ko("circle",{options:{size:ze.defaultNode.size,style:{x:0,y:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.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:E({},ze.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=(0,PX.deepMix)({},i,e.icon),s="".concat(this.type,"-keyShape"),l=t.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});t.shapeMap[s]=l;var u=o.width,f=o.height,c=o.show,h=o.text;if(c){var d="".concat(this.type,"-icon");h?t.shapeMap[d]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):t.shapeMap[d]=t.addShape("image",{attrs:E({x:-u/2,y:-f/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(e,t),l},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints;if(!!n){var i=n||{},a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0]/2;if(o){var p="link-point-left";t.shapeMap[p]=t.addShape("circle",{attrs:E(E({},c),{x:-d,y:0,r:u/2||f||5}),className:p,name:p,isAnchorPoint:!0})}if(s){var v="link-point-right";t.shapeMap[v]=t.addShape("circle",{attrs:E(E({},c),{x:d,y:0,r:u/2||f||5}),className:v,name:v,isAnchorPoint:!0})}if(a){var m="link-point-top";t.shapeMap[m]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-d,r:u/2||f||5}),className:m,name:m,isAnchorPoint:!0})}if(l){var g="link-point-bottom";t.shapeMap[g]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:d,r:u/2||f||5}),className:g,name:g,isAnchorPoint:!0})}}},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,PX.deepMix)({},t,n),a=this.getSize(e),o=a[0]/2,s=E({x:0,y:0,r:o},i);return s},update:function(e,t,n){var i=t.getContainer(),a=this.getSize(e),o=E({},e.style);e.style.stroke===void 0&&e.color&&(o.stroke=e.color),e.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(e,t,o,!0,n),this.updateLinkPoints(e,i)}},"single-node");var lF=z(q());Ko("rect",{options:{size:[100,30],style:{radius:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.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:E({},ze.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(e,t){var n=this.getShapeStyle(e),i=t.addShape("rect",{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return t.shapeMap["".concat(this.type,"-keyShape")]=i,this.drawLinkPoints(e,t),i},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],p=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d/2,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d/2,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p/2,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p/2,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,lF.mix)({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=E({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s=t.get("keyShape");e.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var l={stroke:e.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=(0,lF.mix)({},a,s.attr(),l);u=(0,lF.mix)(u,e.style),this.updateShape(e,t,u,!1,n),this.updateLinkPoints(e,i)}},"single-node");var uF=z(q());Ko("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.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:E({},ze.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});t.shapeMap["ellipse-keyShape"]=o;var s=i.width,l=i.height,u=i.show,f=i.text;return u&&(f?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({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}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0]/2,p=h[1]/2;o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,uF.mix)({},t,n),a=this.getSize(e),o=a[0]/2,s=a[1]/2,l=E({x:0,y:0,rx:o,ry:s},i);return l},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s={stroke:e.color,rx:o[0]/2,ry:o[1]/2},l=t.get("keyShape"),u=(0,uF.mix)({},a,l.attr(),s);u=(0,uF.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)}},"single-node");var fF=z(q());Ko("diamond",{options:{size:[80,80],style:{stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.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:E({},ze.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,f=i.text;return u&&(f?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({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}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],p=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d/2,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d/2,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p/2,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p/2,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(e){var t=this.getSize(e),n=t[0],i=t[1],a=[["M",0,-i/2],["L",n/2,0],["L",0,i/2],["L",-n/2,0],["Z"]];return a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,fF.mix)({},t,n),a=this.getPath(e),o=E({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=(0,fF.mix)({},a,l.attr(),s);u=(0,fF.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)}},"single-node");var cT=z(q());Ko("triangle",{options:{size:40,direction:"up",style:{stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.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:E({},ze.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.icon,a=i===void 0?{}:i,o=n.direction,s=this.getShapeStyle(e),l=e.direction||o,u=t.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var f=a.width,c=a.height,h=a.show,d=a.offset,p=a.text;if(h)if(p)t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var v=-f/2,m=-c/2;(l==="up"||l==="down")&&(m+=d),(l==="left"||l==="right")&&(v+=d),t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:v,y:m},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(e,t),u},drawLinkPoints:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.linkPoints,a=i===void 0?{}:i,o=n.direction,s=e.direction||o,l=a.top,u=a.left,f=a.right,c=a.bottom,h=a.size,d=a.r,p=rr(a,["top","left","right","bottom","size","r"]),v=this.getSize(e),m=v[0];if(u){var g=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="up"?g=[-b,x]:s==="down"?g=[-b,-x]:s==="left"&&(g=[-b,b-x]),g&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},p),{x:g[0],y:g[1],r:h/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(f){var S=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="up"?S=[b,x]:s==="down"?S=[b,-x]:s==="right"&&(S=[b,b-x]),S&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},p),{x:S[0],y:S[1],r:h/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(l){var C=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="up"?C=[b-x,-x]:s==="left"?C=[b,-x]:s==="right"&&(C=[-b,-x]),C&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},p),{x:C[0],y:C[1],r:h/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var w=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="down"?w=[-b+x,x]:s==="left"?w=[b,x]:s==="right"&&(w=[-b,x]),w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},p),{x:w[0],y:w[1],r:h/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(e){var t=(this.mergeStyle||this.getOptions(e)).direction,n=e.direction||t,i=this.getSize(e),a=i[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),l=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return n==="down"?l=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:n==="left"?l=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:n==="right"&&(l=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),l},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,cT.mix)({},t,n),a=this.getPath(e),o=E({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=(0,cT.mix)({},a,l.attr(),s);u=(0,cT.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var n=this.getOptions({}),i=n.linkPoints,a=n.direction,o=e.direction||a,s=t.shapeMap["link-point-left"]||t.find(function(D){return D.get("className")==="link-point-left"}),l=t.shapeMap["link-point-right"]||t.find(function(D){return D.get("className")==="link-point-right"}),u=t.shapeMap["link-point-top"]||t.find(function(D){return D.get("className")==="link-point-top"}),f=t.shapeMap["link-point-bottom"]||t.find(function(D){return D.get("className")==="link-point-bottom"}),c=i,h=s||l||u||f;h&&(c=h.attr());var d=(0,cT.mix)({},c,e.linkPoints),p=d.fill,v=d.stroke,m=d.lineWidth,g=d.size/2;g||(g=d.r);var x=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},b=x.left,S=x.right,C=x.top,w=x.bottom,A=this.getSize(e),L=A[0],k={r:g,fill:p,stroke:v,lineWidth:m},O=null,M=L*Math.sin(1/3*Math.PI),I=L*Math.sin(1/3*Math.PI);o==="up"?O=[-I,M]:o==="down"?O=[-I,-M]:o==="left"&&(O=[-I,I-M]),O&&(s?!b&&b!==void 0?(s.remove(),delete t.shapeMap["link-point-left"]):s.attr(E(E({},k),{x:O[0],y:O[1]})):b&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},k),{x:O[0],y:O[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var R=null;o==="up"?R=[I,M]:o==="down"?R=[I,-M]:o==="right"&&(R=[I,I-M]),R&&(l?!S&&S!==void 0?(l.remove(),delete t.shapeMap["link-point-right"]):l.attr(E(E({},k),{x:R[0],y:R[1]})):S&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},k),{x:R[0],y:R[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var P=null;o==="up"?P=[I-M,-M]:o==="left"?P=[I,-M]:o==="right"&&(P=[-I,-M]),P&&(u?!C&&C!==void 0?(u.remove(),delete t.shapeMap["link-point-top"]):u.attr(E(E({},k),{x:P[0],y:P[1]})):C&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},k),{x:P[0],y:P[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var F=null;o==="down"?F=[-I+M,M]:o==="left"?F=[I,M]:o==="right"&&(F=[-I,M]),F&&(f?!w&&w!==void 0?(f.remove(),delete t.shapeMap["link-point-bottom"]):f.attr(E(E({},k),{x:F[0],y:F[1]})):w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},k),{x:F[0],y:F[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");var Af=z(q());Ko("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:ze.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:ze.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:ze.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(e,t){var n=(this.mergeStyle||this.getOptions(e)).preRect,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=this.getSize(e),s=o[0],l=o[1],u=t.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var f=i.show,c=rr(i,["show"]);return f&&(t.shapeMap["pre-rect"]=t.addShape("rect",{attrs:E({x:-s/2,y:-l/2,height:l},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(e,t),this.drawStateIcon(e,t),this.drawLinkPoints(e,t),u},drawLogoIcon:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).logoIcon,i=n===void 0?{}:n,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,f=i.y,c=i.offset,h=i.text,d=rr(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-logo-icon"]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):t.shapeMap["rect-logo-icon"]=t.addShape("image",{attrs:E(E({},d),{x:u||-o/2+s+c,y:f||-l/2,width:s,height:l}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).stateIcon,i=n===void 0?{}:n,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,f=i.y,c=i.offset,h=i.text,d=rr(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-state-icon"]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):t.shapeMap["rect-state-icon"]=t.addShape("image",{attrs:E(E({},d),{x:u||o/2-s+c,y:f||-l/2,width:s,height:l}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],p=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d/2,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d/2,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p/2,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p/2,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(e,t){var n=this.getOptions(e),i=n.labelCfg,a=i===void 0?{}:i,o=n.logoIcon,s=o===void 0?{}:o,l=n.descriptionCfg,u=l===void 0?{}:l,f=this.getSize(e),c=f[0],h=null,d=s.show,p=s.width,v=-c/2+a.offset;d&&(v=-c/2+p+a.offset);var m=a.style,g=u.style,x=u.paddingTop;return(0,Af.isString)(e.description)?(h=t.addShape("text",{attrs:E(E({},m),{x:v,y:-5,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=h,t.shapeMap["rect-description"]=t.addShape("text",{attrs:E(E({},g),{x:v,y:17+(x||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(h=t.addShape("text",{attrs:E(E({},m),{x:v,y:7,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=h),h},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,Af.mix)({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=E({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.style,a=i===void 0?{}:i,o=n.labelCfg,s=o===void 0?{}:o,l=n.descriptionCfg,u=l===void 0?{}:l,f=this.getSize(e),c=f[0],h=f[1],d=t.get("keyShape");d.attr(E(E({},a),{x:-c/2,y:-h/2,width:c,height:h}));var p=t.getContainer(),v=p.shapeMap["rect-logo-icon"]||p.find(function(_t){return _t.get("className")==="rect-logo-icon"}),m=v?v.attr():{},g=(0,Af.mix)({},m,e.logoIcon),x=g.width;x===void 0&&(x=this.options.logoIcon.width);var b=e.logoIcon?e.logoIcon.show:void 0,S=s.offset,C=-c/2+x+S;!b&&b!==void 0&&(C=-c/2+S);var w=p.shapeMap["node-label"]||p.find(function(_t){return _t.get("className")==="node-label"}),A=p.shapeMap["rect-description"]||p.find(function(_t){return _t.get("className")==="rect-description"});if(e.label)if(!w)p.shapeMap["node-label"]=p.addShape("text",{attrs:E(E({},s.style),{x:C,y:e.description?-5:7,text:e.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var L=e.labelCfg?e.labelCfg.style:{},k=(0,Af.mix)({},w.attr(),L);e.label&&(k.text=e.label),k.x=C,(0,Af.isString)(e.description)&&(k.y=-5),A&&(A.resetMatrix(),A.attr({x:C})),w.resetMatrix(),w.attr(k)}if((0,Af.isString)(e.description)){var O=u.paddingTop;if(!A)p.shapeMap["rect-description"]=p.addShape("text",{attrs:E(E({},u.style),{x:C,y:17+(O||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var L=e.descriptionCfg?e.descriptionCfg.style:{},M=(0,Af.mix)({},A.attr(),L);(0,Af.isString)(e.description)&&(M.text=e.description),M.x=C,A.resetMatrix(),A.attr(E(E({},M),{y:17+(O||0)}))}}var I=p.shapeMap["pre-rect"]||p.find(function(_t){return _t.get("className")==="pre-rect"});if(I&&!I.destroyed){var R=(0,Af.mix)({},I.attr(),e.preRect);I.attr(E(E({},R),{x:-c/2,y:-h/2,height:h}))}if(v&&!v.destroyed)if(!b&&b!==void 0)v.remove(),delete p.shapeMap["pre-rect"];else{var P=g.width,F=g.height,D=g.x,G=g.y,U=g.offset,j=rr(g,["width","height","x","y","offset"]);v.attr(E(E({},j),{x:D||-c/2+P+U,y:G||-F/2,width:P,height:F}))}else b&&this.drawLogoIcon(e,p);var H=p.shapeMap["rect-state-icon"]||p.find(function(_t){return _t.get("className")==="rect-state-icon"}),tt=H?H.attr():{},et=(0,Af.mix)({},tt,e.stateIcon);if(H){!et.show&&et.show!==void 0&&(H.remove(),delete p.shapeMap["rect-state-icon"]);var ut=et.width,F=et.height,D=et.x,G=et.y,$=et.offset,st=rr(et,["width","height","x","y","offset"]);H.attr(E(E({},st),{x:D||c/2-ut+$,y:G||-F/2,width:ut,height:F}))}else et.show&&this.drawStateIcon(e,p);this.updateLinkPoints(e,p)}},"single-node");var hT=z(q());Ko("star",{options:{size:60,style:{stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.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:E({},ze.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,f=i.text;return u&&(f?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({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}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.leftBottom,u=i.rightBottom,f=i.size,c=i.r,h=rr(i,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(e),p=d[0];if(s){var v=Math.cos((18+72*0)/180*Math.PI)*p,m=Math.sin((18+72*0)/180*Math.PI)*p;t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(a){var v=Math.cos((18+72*1)/180*Math.PI)*p,m=Math.sin((18+72*1)/180*Math.PI)*p;t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){var v=Math.cos((18+72*2)/180*Math.PI)*p,m=Math.sin((18+72*2)/180*Math.PI)*p;t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(l){var v=Math.cos((18+72*3)/180*Math.PI)*p,m=Math.sin((18+72*3)/180*Math.PI)*p;t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){var v=Math.cos((18+72*4)/180*Math.PI)*p,m=Math.sin((18+72*4)/180*Math.PI)*p;t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(e){for(var t=this.getSize(e),n=t[0],i=n*3/8,a=e.innerR||i,o=[],s=0;s<5;s++){var l=Math.cos((18+72*s)/180*Math.PI)*n,u=Math.sin((18+72*s)/180*Math.PI)*n,f=Math.cos((54+72*s)/180*Math.PI)*a,c=Math.sin((54+72*s)/180*Math.PI)*a;s===0?o.push(["M",l,-u]):o.push(["L",l,-u]),o.push(["L",f,-c])}return o.push(["Z"]),o},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,hT.mix)({},t,n),a=this.getPath(e),o=E({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=(0,hT.mix)({},a,l.attr(),s);u=(0,hT.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var n=this.getOptions({}).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(M){return M.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(M){return M.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(M){return M.get("className")==="link-point-top"}),s=t.shapeMap["link-point-left-bottom"]||t.find(function(M){return M.get("className")==="link-point-left-bottom"}),l=t.shapeMap["link-point-left-bottom"]||t.find(function(M){return M.get("className")==="link-point-right-bottom"}),u=n,f=i||a||o||s||l;f&&(u=f.attr());var c=(0,hT.mix)({},u,e.linkPoints),h=c.fill,d=c.stroke,p=c.lineWidth,v=c.size/2;v||(v=c.r);var m=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},g=m.left,x=m.right,b=m.top,S=m.leftBottom,C=m.rightBottom,w=this.getSize(e),A=w[0],L={r:v,fill:h,stroke:d,lineWidth:p},k=Math.cos((18+72*0)/180*Math.PI)*A,O=Math.sin((18+72*0)/180*Math.PI)*A;a?!x&&x!==void 0?(a.remove(),delete t.shapeMap["link-point-right"]):a.attr(E(E({},L),{x:k,y:-O})):x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),k=Math.cos((18+72*1)/180*Math.PI)*A,O=Math.sin((18+72*1)/180*Math.PI)*A,o?!b&&b!==void 0?(o.remove(),delete t.shapeMap["link-point-top"]):o.attr(E(E({},L),{x:k,y:-O})):b&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),k=Math.cos((18+72*2)/180*Math.PI)*A,O=Math.sin((18+72*2)/180*Math.PI)*A,i?!g&&g!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(E(E({},L),{x:k,y:-O})):g&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),k=Math.cos((18+72*3)/180*Math.PI)*A,O=Math.sin((18+72*3)/180*Math.PI)*A,s?!S&&S!==void 0?(s.remove(),delete t.shapeMap["link-point-left-bottom"]):s.attr(E(E({},L),{x:k,y:-O})):S&&(t.shapeMap["link-point-left-bottom"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),k=Math.cos((18+72*4)/180*Math.PI)*A,O=Math.sin((18+72*4)/180*Math.PI)*A,l?!C&&C!==void 0?(s.remove(),delete t.shapeMap["link-point-right-bottom"]):l.attr(E(E({},L),{x:k,y:-O})):C&&(t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var cF=z(q()),dT=ka.defaultSubjectColors;Ko("donut",{options:{size:ze.defaultNode.size,style:{x:0,y:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.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:E({},ze.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=(0,cF.deepMix)({},i,e.icon),s=t.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});t.shapeMap["".concat(this.type,"-keyShape")]=s;var l=o.width,u=o.height,f=o.show,c=o.text;f&&(c?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({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}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-l/2,y:-u/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}));var h=s.attr("r"),d=.6*h,p=(h+d)/2,v=e,m=v.donutAttrs,g=m===void 0?{}:m,x=v.donutColorMap,b=x===void 0?{}:x,S=Object.keys(g).length;if(g&&S>1){var C=[],w=0;if(Object.keys(g).forEach(function(O){var M=g[O]||0;!(0,cF.isNumber)(M)||(C.push({key:O,value:M,color:b[O]}),w+=M)}),w){var A=h-d;if(S===1){t.shapeMap["fan-shape-0"]=t.addShape("circle",{attrs:{r:p,x:0,y:0,stroke:C[0].color||dT[0],lineWidth:A},name:"fan-shape-0"});return}var L=[p,0],k=0;C.forEach(function(O,M){var I=O.value/w;if(!(I<.001)){if(I>.999&&(I=1),I===1){t.shapeMap["fan-shape-".concat(M)]=t.addShape("circle",{attrs:{r:p,x:0,y:0,stroke:O.color||dT[M%dT.length],lineWidth:A},name:"fan-shape-".concat(M)});return}O.percent=I,O.angle=I*Math.PI*2,O.beginAgnle=k,k+=O.angle,O.endAngle=k,O.arcBegin=L,O.arcEnd=[p*Math.cos(O.endAngle),-p*Math.sin(O.endAngle)];var R=O.angle>Math.PI?1:0,P=[["M",O.arcBegin[0],O.arcBegin[1]],["A",p,p,0,R,0,O.arcEnd[0],O.arcEnd[1]],["L",O.arcEnd[0],O.arcEnd[1]]];t.shapeMap["fan-shape-".concat(M)]=t.addShape("path",{attrs:{path:P,lineWidth:A,stroke:O.color||dT[M%dT.length]},name:"fan-shape-".concat(M)}),L=O.arcEnd}})}}return this.drawLinkPoints(e,t),s},update:void 0},"circle");var ll=z(q());var hF=function(e){var t=e.x,n=e.y;return{x:t,y:n,centerX:t,centerY:n,minX:t,minY:n,maxX:t,maxY:n,height:0,width:0}},Upe=function(e){e===void 0&&(e=[]);var t=[],n=[];e.forEach(function(l){t.push(l.x),n.push(l.y)});var i=Math.min.apply(Math,t),a=Math.max.apply(Math,t),o=Math.min.apply(Math,n),s=Math.max.apply(Math,n);return{centerX:(i+a)/2,centerY:(o+s)/2,maxX:a,maxY:s,minX:i,minY:o,height:s-o,width:a-i}};var kX=function(e){for(var t=[],n={},i=e.length,a=i-1;a>=0;a--){var o=e[a];o.id="".concat(o.x,"|||").concat(o.y),n[o.id]=o,t.push(o)}return t},RX=function(e){return kX(e)};var pT=function(e,t){return e.width||e.height?{centerX:e.centerX,centerY:e.centerY,minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t,height:e.height+2*t,width:e.width+2*t}:e},jpe=function(e,t){var n=Math.abs(e.x-t.centerX),i=Math.abs(e.y-t.centerY);return n===0&&i===0?0:n/t.width>i/t.height},dF=function(e,t,n){var i=jpe(t,e);if(i===0){var a=e.centerX,o=e.centerY;return n.yt.x?a=e.maxX:n.xe.centerX?e.maxX:e.minX,y:t.y}:{x:t.x,y:t.y>e.centerY?e.maxY:e.minY}},TEt=function(e,t){var n=Math.min(e.minX,t.minX),i=Math.min(e.minY,t.minY),a=Math.max(e.maxX,t.maxX),o=Math.max(e.maxY,t.maxY);return{centerX:(n+a)/2,centerY:(i+o)/2,minX:n,minY:i,maxX:a,maxY:o,height:o-i,width:a-n}},NX=function(e){return[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}]},pF=function(e,t){var n=e.x,i=e.y;return nt.maxX||it.maxY},Wpe=function(e,t){return te.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},Vpe=function(e,t){return te.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},Hpe=function(e,t){return Wpe(e,t.x).concat(Vpe(e,t.y))},vT=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Ype=function(e,t){var n=-2,i=0;return t.forEach(function(a){a&&(e.x===a.x&&(i+=n),e.y===a.y&&(i+=n))}),i},IEt=function(e,t,n,i,a){return vT(e,t)+vT(e,n)+Ype(e,[t,n,i,a])},Xpe=function r(e,t,n,i,a){a===void 0&&(a=0),e.unshift(t[i]),n[i]&&n[i]!==i&&a<=100&&r(e,t,n,n[i],a+1)},qpe=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)},vF=function(e,t,n,i){var a=n.x-e.x,o=n.y-e.y,s=i.x-e.x,l=i.y-e.y,u=n.x-t.x,f=n.y-t.y,c=i.x-t.x,h=i.y-t.y,d=a*l-o*s,p=u*h-f*c,v=a*f-o*u,m=s*h-l*c;return d*p<=0&&v*m<=0},mF=function(e,t,n){if(n.width||n.height){var i=NX(n),a=i[0],o=i[1],s=i[2],l=i[3];return vF(e,t,a,o)||vF(e,t,a,l)||vF(e,t,o,s)||vF(e,t,s,l)}return!1},Kpe=function(e,t,n,i){var a=[];return e.forEach(function(o){if(o!==t&&(o.x===t.x||o.y===t.y)){if(mF(o,t,n)||mF(o,t,i))return;a.push(o)}}),kX(a)},Zpe=function(e,t,n,i,a,o,s){var l=[],u=[t],f={},c={},h={};c[t.id]=0,h[t.id]=IEt(t,n,t);var d={};e.forEach(function(g){d[g.id]=g});for(var p,v;u.length;){if(p=void 0,v=1/0,u.forEach(function(g){h[g.id]<=v&&(v=h[g.id],p=g)}),p===n){var m=[];return Xpe(m,d,f,n.id),m}qpe(u,p),l.push(p),Kpe(e,p,i,a).forEach(function(g){if(l.indexOf(g)===-1){u.indexOf(g)===-1&&u.push(g);var x=h[p.id]+vT(p,g);c[g.id]&&x>=c[g.id]||(f[g.id]=p.id,c[g.id]=x,h[g.id]=c[g.id]+IEt(g,n,t,o,s))}})}return[t,n]},$pe=function(e,t,n){return!(e.x===t.x&&t.x===n.x||e.y===t.y&&t.y===n.y)},Qpe=function(e,t,n,i){var a=vT(e,t),o=vT(n,t);aMath.PI?2*Math.PI-n:n},DEt=function(e,t,n){for(var i=1/0,a=0,o=t.length;au.minX&&t.xu.minY&&t.y0&&S>0&&(w=void 0,A=1/0,Object.keys(d).forEach(function(R){var P=d[R].id;g[P]<=A&&(A=g[P],w=d[P])}),!!w);){if(h.findIndex(function(R){return R.x===w.x&&R.y===w.y})>-1)return ave(w,v,u,t,e,f,s);delete d[w.id],p[w.id]=!0;for(var x=0;xo.maxAllowedDirectionChange)&&(l[k.id]||(d[k.id]||(d[k.id]=k),O=o.distFunc(w,k)+(isNaN(C[I])?s:C[I]),M=m[w.id]+O,!(m[k.id]&&M>=m[k.id])&&(v[k.id]=w,m[k.id]=M,g[k.id]=M+DEt(k,h,o.distFunc)))));S-=1}return o.fallbackRoute(e,t,n,i,o)};Rk("polyline",{options:{color:ze.defaultEdge.color,size:ze.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:ze.defaultEdge.style.stroke,lineAppendWidth:ze.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:ze.edgeLabel.style.fill,fontSize:ze.edgeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:E({},ze.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(e,t){var n=this.getShapeStyle(e);n.radius===0&&delete n.radius;var i=t.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return t.shapeMap["edge-shape"]=i,i},getShapeStyle:function(e){var t=this.options.style,n={stroke:e.color},i=(0,ll.mix)({},t,n,e.style);e=this.getPathPoints(e),this.radius=i.radius,this.offset=i.offset;var a=e.startPoint,o=e.endPoint,s=this.getControlPoints(e),l=[a];s&&(l=l.concat(s)),l.push(o);var u=e.sourceNode,f=e.targetNode,c=i.radius,h=this.options.routeCfg,d=(0,ll.mix)({},h,e.routeCfg);d.offset=i.offset;var p=this.getPath(l,u,f,c,d);((0,ll.isArray)(p)&&p.length<=1||(0,ll.isString)(p)&&p.indexOf("L")===-1)&&(p="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(p="M0 0, L0 0");var v=(0,ll.mix)({},ze.defaultEdge.style,i,{lineWidth:e.size,path:p});return v},updateShapeStyle:function(e,t){var n=t.getContainer();if(!!t.isVisible()){var i={stroke:e.color},a=n.shapeMap["edge-shape"]||n.find(function(S){return S.get("className")==="edge-shape"})||t.getKeyShape(),o=e.size;e=this.getPathPoints(e);var s=e.startPoint,l=e.endPoint,u=this.getControlPoints(e),f=[s];u&&(f=f.concat(u)),f.push(l);var c=a.attr(),h=(0,ll.mix)({},i,c,e.style),d=e.sourceNode,p=e.targetNode,v=h.radius,m=this.options.routeCfg,g=(0,ll.mix)({},m,e.routeCfg);g.offset=h.offset;var x=this.getPath(f,d,p,v,g);((0,ll.isArray)(x)&&x.length<=1||(0,ll.isString)(x)&&x.indexOf("L")===-1)&&(x="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(l.x)||isNaN(l.y))&&(x="M0 0, L0 0"),c.endArrow&&h.endArrow===!1&&(e.style.endArrow={path:""}),c.startArrow&&h.startArrow===!1&&(e.style.startArrow={path:""});var b=(0,ll.mix)(i,a.attr(),{lineWidth:o,path:x},e.style);a&&a.attr(b)}},getPath:function(e,t,n,i,a){var o=a.offset,s=a.simple;if(!o||e.length>2){if(i)return FX(e,i);var l=[];return(0,ll.each)(e,function(h,d){d===0?l.push(["M",h.x,h.y]):l.push(["L",h.x,h.y])}),l}var u=s?gF(e[e.length-1],e[0],n,t,o):kEt(e[0],e[e.length-1],t,n,a);if(!u||!u.length)return"M0 0, L0 0";if(i){var f=FX(u,i);return f}var c=ka.pointsToPolygon(u);return c}},"single-edge");var cAt=z(q());var REt=al.cloneEvent,NEt=al.isNaN,FEt=Math.abs,ove=10,sve=["shift","ctrl","alt","control"],BEt={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(e){var t=this.origin,n=+e.clientX,i=+e.clientY;if(!(NEt(n)||NEt(i))){var a=n-t.x,o=i-t.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:n,y:i};var s=this.graph.get("width"),l=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),f=this.scalableRange,c=this.scalableRange;f<1&&f>-1&&(f=s*f,c=l*c),(u.minX<=s+f&&u.minX+a>s+f||u.maxX+f>=0&&u.maxX+f+a<0)&&(a=0),(u.minY<=l+c&&u.minY+o>l+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(e){var t=this,n=e.originalEvent.touches,i=n[0],a=n[1];i&&a||(e.preventDefault(),t.onMouseDown(e))},onMouseDown:function(e){var t=this,n=e.originalEvent;if(!(n&&e.name!==oM.TOUCHSTART&&n.button!==0)&&!(e.name!==oM.TOUCHSTART&&typeof window!="undefined"&&window.event&&!window.event.buttons&&!window.event.button)&&!!this.shouldBegin.call(this,e)&&!t.keydown){var i=e.target,a=i&&i.isCanvas&&i.isCanvas();if(!(!this.allowDragOnItem&&!a)&&(t.origin={x:e.clientX,y:e.clientY},t.dragging=!1,this.enableOptimize)){for(var o=this.graph,s=o.getEdges(),l=0,u=s.length;ll)for(var d=i.getNodes(),p=0,v=d.length;p-1?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1}};var gx=z(q());var GEt={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd"}},validationCombo:function(e){if(!this.origin||!e||e.destroyed)return!1;var t=e.getType();return t==="combo"},onTouchStart:function(e){if(!!e.item){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.onDragStart(e)}},onTouchMove:function(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a){t.onDragEnd(e);return}e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.onDrag(e)},onDragStart:function(e){var t=this;if(this.currentShouldEnd=!0,!!this.shouldBegin.call(this,e)){var n=e.item;if(!(!n||n.destroyed||n.hasLocked())){var i=n.getContainer();i.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n);var a=e.target;if(a){var o=a.get("isAnchorPoint");if(o)return}var s=this.graph;this.targets=[],this.targetCombo=null;var l=s.findAllByState("node",this.selectedState),u=n.get("id"),f=l.filter(function(h){var d=h.get("id");return u===d});f.length===0?this.targets.push(n):l.length>1?l.forEach(function(h){var d=h.hasLocked();d||t.targets.push(h)}):this.targets.push(n);var c=[];this.targets.forEach(function(h){c.push((0,gx.clone)(h.getModel()))}),this.set("beforeDragNodes",c),this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(h){var d=h.getEdges();d.forEach(function(p){!p.isVisible()||(t.hidenEdge[p.getID()]=!0,p.hide())})}),this.origin={x:e.x,y:e.y},this.point={},this.originPoint={}}}},onDrag:function(e){var t=this;!this.origin||!this.shouldUpdate.call(this,e)||(this.get("enableDelegate")?this.updateDelegate(e):this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge")}):this.targets.map(function(n){t.update(n,e)}))},onDragEnd:function(e){var t=this,n;if(!!this.origin){(n=this.cachedCaptureItems)===null||n===void 0||n.forEach(function(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(l){t.hidenEdge[l.getID()]&&l.show(),l.refresh()})}),this.hidenEdge={};var i=this.graph;if(i.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(o){a.before.nodes.push({id:o.id,x:o.x,y:o.y})}),this.targets.forEach(function(o){var s=o.getModel();a.after.nodes.push({id:s.id,x:s.x,y:s.y})}),i.pushStack("update",(0,gx.clone)(a))}i.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(e){var t=e.item;if(this.currentShouldEnd=this.shouldEnd.call(this,e,t),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(t))){var n=this.graph;if(this.comboActiveState&&n.setItemState(t,this.comboActiveState,!1),this.targetCombo=t,this.onlyChangeComboSize)n.updateCombos();else{var i=t.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==i.id&&n.updateComboTree(a,i.id)}),n.updateCombo(t)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(e){var t=this.graph;this.currentShouldEnd=this.shouldEnd.call(this,e,void 0),this.updatePositions(e,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?t.updateCombos():this.targets.map(function(n){var i=n.getModel();i.comboId&&t.updateComboTree(n)}))},onDropNode:function(e){if(!(!this.targets||this.targets.length===0)){var t=this,n=e.item,i=t.graph,a=n.getModel().comboId,o=a?i.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd.call(this,e,o),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)i.updateCombos();else if(a){var s=i.findById(a);t.comboActiveState&&i.setItemState(s,t.comboActiveState,!1),this.targets.map(function(l){var u=l.getModel();a!==u.comboId&&i.updateComboTree(l,a)}),i.updateCombo(s)}else this.targets.map(function(l){var u=l.getModel();u.comboId&&i.updateComboTree(l)});i.emit("dragnodeend",{items:this.targets,targetItem:n})}}},onDragEnter:function(e){var t=e.item;if(!!this.validationCombo(t)){var n=this.graph;this.comboActiveState&&n.setItemState(t,this.comboActiveState,!0)}},onDragLeave:function(e){var t=e.item;if(!!this.validationCombo(t)){var n=this.graph;this.comboActiveState&&n.setItemState(t,this.comboActiveState,!1)}},updatePositions:function(e,t){var n=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),updateFunc:this.update}):t||this.targets.map(function(i){return n.update(i,e)}):this.targets.map(function(i){return n.update(i,e,t)}))},update:function(e,t,n){var i=this.origin,a=e.get("model"),o=e.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=t.x-i.x+this.point[o].x,l=t.y-i.y+this.point[o].y;n&&(s+=i.x-t.x,l+=i.y-t.y);var u={x:s,y:l};this.get("updateEdge")?this.graph.updateItem(e,u,!1):e.updatePosition(u)},debounceUpdate:(0,gx.debounce)(function(r){var e=r.targets,t=r.graph,n=r.point,i=r.origin,a=r.evt,o=r.updateEdge,s=r.updateFunc;e.map(function(l){var u=l.get("model"),f=l.get("id");n[f]||(n[f]={x:u.x||0,y:u.y||0});var c=a.x-i.x+n[f].x,h=a.y-i.y+n[f].y,d={x:c,y:h};o?t.updateItem(l,d,!1):l.updatePosition(d)})},50,!0),updateDelegate:function(e){var t=this.graph;if(this.delegateRect){var h=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:h,y:d})}else{var n=t.get("group"),i=(0,gx.deepMix)({},_c.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(e),o=a.x,s=a.y,l=a.width,u=a.height,f=a.minX,c=a.minY;this.originPoint={x:o,y:s,width:l,height:u,minX:f,minY:c},this.delegateRect=n.addShape("rect",{attrs:E({width:l,height:u,x:o,y:s},i),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(e){var t=this.targets;t.length===0&&t.push(e.item);for(var n=1/0,i=-1/0,a=1/0,o=-1/0,s=0;si&&(i=h),d>o&&(o=d)}var p=Math.floor(n),v=Math.floor(a),m=Math.ceil(i)-Math.floor(n),g=Math.ceil(o)-Math.floor(a);return{x:p,y:v,width:m,height:g,minX:n,minY:a}}};var zEt={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"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(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.setAllItemStates(e)},clearOnTouchStart:function(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.clearActiveState(e)},setAllItemStates:function(e){var t=e.item,n=this.graph;if(this.item=t,!!this.shouldUpdate(e.item,{event:e,action:"activate"})){for(var i=this,a=this.activeState,o=this.inactiveState,s=n.getNodes(),l=n.getCombos(),u=n.getEdges(),f=n.get("vedges"),c=s.length,h=l.length,d=u.length,p=f.length,v=0;v-1||(this.trigger=WEt,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(e){var t=e.item,n=this.brush;t||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:e.canvasX,y:e.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||this.updateBrush(e)},onMouseUp:function(e){var t=this.graph;!this.brush&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(e),this.dragging=!1)},clearStates:function(){var e=this,t=e.graph,n=e.selectedState,i=t.findAllByState("node",n),a=t.findAllByState("edge",n);i.forEach(function(o){return t.setItemState(o,n,!1)}),a.forEach(function(o){return t.setItemState(o,n,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedNodes:function(e){var t=this,n=this,i=n.graph,a=n.originPoint,o=n.shouldUpdate,s=this.selectedState,l={x:e.x,y:e.y},u=i.getPointByCanvas(a.x,a.y),f=yF(l.x,u.x),c=UEt(l.x,u.x),h=yF(l.y,u.y),d=UEt(l.y,u.y),p=[],v=[];i.getNodes().forEach(function(g){if(!!g.isVisible()){var x=g.getBBox();if(x.centerX>=f&&x.centerX<=c&&x.centerY>=h&&x.centerY<=d&&o(g,"select")){p.push(g);var b=g.getModel();v.push(b.id),i.setItemState(g,s,!0)}}});var m=[];this.includeEdges&&p.forEach(function(g){var x=g.getOutEdges();x.forEach(function(b){if(!!b.isVisible()){var S=b.getModel(),C=S.source,w=S.target;v.includes(C)&&v.includes(w)&&o(b,"select")&&(m.push(b),i.setItemState(b,t.selectedState,!0))}})}),this.selectedEdges=m,this.selectedNodes=p,this.onSelect&&this.onSelect(p,m),i.emit("nodeselectchange",{selectedItems:{nodes:p,edges:m},select:!0})},createBrush:function(){var e=this,t=e.graph.get("canvas").addShape("rect",{attrs:e.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(e){var t=this.originPoint;this.brush.attr({width:jEt(e.canvasX-t.x),height:jEt(e.canvasY-t.y),x:yF(e.canvasX,t.x),y:yF(e.canvasY,t.y)})},onKeyDown:function(e){var t=e.key;if(!!t){var n=this.trigger.toLowerCase(),i=t.toLowerCase();i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var xF=z(q()),HEt="shift",uve=["shift","ctrl","alt","control"],YEt={getDefaultCfg:function(){return{multiple:!0,trigger:HEt,selectedState:"selected"}},getEvents:function(){var e=this;return uve.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=HEt,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),e.multiple?{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(e){var t=this,n=e.item;if(!(!n||n.destroyed)){var i=n.getType(),a=t.graph,o=t.keydown,s=t.multiple,l=t.shouldUpdate,u=t.shouldBegin;if(!!u.call(t,e)){if(!o||!s){var f=a.findAllByState("node",t.selectedState).concat(a.findAllByState("combo",t.selectedState));(0,xF.each)(f,function(d){d!==n&&a.setItemState(d,t.selectedState,!1)})}if(n.hasState(t.selectedState)){l.call(t,e)&&a.setItemState(n,t.selectedState,!1);var c=a.findAllByState("node",t.selectedState),h=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!1})}else{l.call(t,e)&&a.setItemState(n,t.selectedState,!0);var c=a.findAllByState("node",t.selectedState),h=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!0})}}}},onCanvasClick:function(){var e=this,t=this.graph,n=t.findAllByState("node",this.selectedState);(0,xF.each)(n,function(a){t.setItemState(a,e.selectedState,!1)});var i=t.findAllByState("combo",this.selectedState);(0,xF.each)(i,function(a){t.setItemState(a,e.selectedState,!1)}),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},onKeyDown:function(e){var t=this,n=e.key;!n||(n.toLowerCase()===this.trigger.toLowerCase()||n.toLowerCase()==="control"?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.keydown=!1}};var XEt=z(q()),fve=gr.transform,qEt=.05,KEt={getDefaultCfg:function(){return{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 e=this.fixSelectedItems;return e.fixState||(e.fixState="selected"),e.fixAll&&(e.fixLineWidth=!0,e.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(e){var t=e.originalEvent.touches,n=t[0],i=t[1];e.preventDefault(),!!i&&(this.shouldBegin&&!this.shouldBegin.call(this,e)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,i&&(this.endPoint={pageX:i.pageX,pageY:i.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(e){if(!!this.moveable){e.preventDefault();var t=e.originalEvent.touches,n=t[0],i=t[1];if(!!i){this.endPoint||(this.endPoint={pageX:i.pageX,pageY:i.pageY});var a=function(v,m){return Math.hypot(m.x-v.x,m.y-v.y)},o=a({x:n.pageX,y:n.pageY},{x:i.pageX,y:i.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),s=this.originScale*o;this.currentScale=s;var l=this.get("minZoom")||this.graph.get("minZoom"),u=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>u||sd||ci/2?f-=h.width:f+=this.offset,c>a/2?c-=h.height:c+=this.offset;var d="".concat(f,"px"),p="".concat(c,"px");yr(this.container,{left:d,top:p,visibility:"visible"})},createTooltip:function(e){var t=e.get("el");t.style.position="relative";var n=en('
    '));return t.parentNode.appendChild(n),yr(n,{position:"absolute",visibility:"visible"}),this.width=e.get("width"),this.height=e.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}};var ZEt=E({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"}}},bF);var $Et=E({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"}}},bF);var QEt="click",cve=["click","dblclick"],JEt={getDefaultCfg:function(){return{trigger:QEt,onChange:function(){}}},getEvents:function(){var e,t;return cve.includes(this.trigger)?t=this.trigger:(t=QEt,console.warn("Behavior collapse-expand \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["node:".concat(t)]="onNodeClick",e.touchstart="onNodeClick",e},onNodeClick:function(e){var t=e.item;if(!!t){var n=this.graph.findDataById(t.get("id"));if(!!n){var i=n.children;if(!(!i||i.length===0)){var a=!n.collapsed;!this.shouldBegin(e,a)||(n.collapsed=a,t.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:e.item,collapsed:a}),!!this.shouldUpdate(e,a)&&(this.onChange(t,a),this.graph.layout()))}}}}};var PS=z(q());var hve=al.calculationItemsBBox,dve=function r(e,t){if(t(e)!==!1&&e){var n=e.get("combos");if(n.length===0)return!1;(0,PS.each)(n,function(i){r(i,t)})}},tAt={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected"}},getEvents:function(){return{"combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(e){var t=e.item;if(!t||t.destroyed||!this.shouldUpdate.call(this,e))return!1;var n=t.getType();return n==="combo"},onDragStart:function(e){var t=this,n=this.graph,i=e.item;if(this.currentShouldEnd=!0,!!this.validationCombo(e)){this.targets=[];var a=n.findAllByState("combo",this.selectedState),o=i.get("id"),s=a.filter(function(l){var u=l.get("id");return o===u});s.length===0?this.targets.push(i):this.targets=a,this.activeState&&this.targets.map(function(l){var u=l.getModel();if(u.parentId){var f=n.findById(u.parentId);f&&n.setItemState(f,t.activeState,!0)}}),this.point={},this.originPoint={},this.origin={x:e.x,y:e.y},this.currentItemChildCombos=[],dve(i,function(l){if(l.destroyed)return!1;var u=l.getModel();return t.currentItemChildCombos.push(u.id),!0})}},onDrag:function(e){var t=this;if(!!this.origin&&!!this.validationCombo(e))if(this.enableDelegate)this.updateDelegate(e);else{if(this.activeState){var n=this.graph,i=e.item,a=i.getModel(),o=n.getCombos(),s=i.getBBox(),l=s.centerX,u=s.centerY,f=s.width,c=o.filter(function(h){var d=h.getModel();return a.parentId,d.id!==a.id&&!t.currentItemChildCombos.includes(d.id)});c.map(function(h){var d=h.getBBox(),p=d.centerX,v=d.centerY,m=d.width,g=l-p,x=u-v,b=2*Math.sqrt(g*g+x*x);f+m-b>.8*f?n.setItemState(h,t.activeState,!0):n.setItemState(h,t.activeState,!1)})}(0,PS.each)(this.targets,function(h){t.updateCombo(h,e)})}},updatePositions:function(e,t){var n=this;(this.enableDelegate||t)&&(0,PS.each)(this.targets,function(i){n.updateCombo(i,e,t)})},onDrop:function(e){var t=this,n=e.item;if(this.currentShouldEnd=this.shouldEnd.call(this,e,n),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!n||!this.targets||n.destroyed)){var i=this.graph,a=n.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(t.activeState&&i.setItemState(n,t.activeState,!1),t.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o,a.id)):i.updateCombo(n)}),this.end(n,e),this.endComparison=!0}},onNodeDrop:function(e){var t=this;if(!(!this.targets||this.targets.length===0)){var n=this.graph,i=e.item,a=i.getModel().comboId,o=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd.call(this,e,o),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var l=n.findById(a);n.setItemState(l,this.activeState,!1)}this.targets.map(function(u){t.onlyChangeComboSize?n.updateCombo(u):a!==u.getID()&&(s=n.findById(a),a!==u.getModel().parentId&&n.updateComboTree(u,a))})}else this.targets.map(function(u){if(t.onlyChangeComboSize)n.updateCombo(u);else{var f=u.getModel();f.comboId&&n.updateComboTree(u)}});this.endComparison=!0,this.end(s,e)}}},onDragEnter:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,n=this.graph;this.activeState&&n.setItemState(t,this.activeState,!0)}},onDragLeave:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,n=this.graph;this.activeState&&n.setItemState(t,this.activeState,!1)}},onDragEnd:function(e){if(!(!this.targets||this.targets.length===0)){var t=e.item;this.currentShouldEnd&&this.updatePositions(e);var n=this.getParentCombo(t.getModel().parentId),i=this.graph;n&&this.activeState&&i.setItemState(n,this.activeState,!1),this.end(void 0,e)}},end:function(e,t){var n=this;if(!!this.origin){var i=this.graph;if(this.delegateShape){var a=i.get("delegateGroup");a.clear(),this.delegateShape=null}e&&this.activeState&&i.setItemState(e,this.activeState,!1),e||this.targets.map(function(o){n.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o)}),this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(e,t){var n=this;if(t(e)!==!1&&e){var i=e.get("combos");(0,PS.each)(i,function(o){n.traverse(o,t)});var a=e.get("nodes");(0,PS.each)(a,function(o){n.traverse(o,t)})}},updateCombo:function(e,t,n){var i=this;this.traverse(e,function(a){return a.destroyed?!1:(i.updateSignleItem(a,t,n),!0)})},updateSignleItem:function(e,t,n){var i=this.origin,a=this.graph,o=e.getModel(),s=e.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var l=t.x-i.x+this.point[s].x,u=t.y-i.y+this.point[s].y;n&&(l+=i.x-t.x,u+=i.y-t.y),a.updateItem(e,{x:l,y:u})},getParentCombo:function(e){var t=this.graph;if(!!e){var n=t.findById(e);if(!!n)return n}},updateDelegate:function(e){var t=this.graph;if(this.delegateShape){var h=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:h,y:d})}else{var n=t.get("delegateGroup"),i=null;this.targets.length>1?i=hve(this.targets):i=this.targets[0].getBBox();var a=i.x,o=i.y,s=i.width,l=i.height,u=i.minX,f=i.minY;this.originPoint={x:a,y:o,width:s,height:l,minX:u,minY:f};var c=E(E({},_c.delegateStyle),this.delegateStyle);this.delegateShape=n.addShape("rect",{attrs:E({width:i.width,height:i.height,x:i.x,y:i.y},c),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}}};var eAt="dblclick",pve=["click","dblclick"],rAt={getDefaultCfg:function(){return{trigger:eAt,relayout:!0}},getEvents:function(){var e,t;return pve.includes(this.trigger)?t=this.trigger:(t=eAt,console.warn("Behavior collapse-expand-group \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["combo:".concat(t)]="onComboClick",e},onComboClick:function(e){var t=e.item,n=this,i=n.graph,a=n.relayout;if(!(!t||t.destroyed||t.getType()!=="combo")){var o=t.getModel(),s=o.id;!s||(i.collapseExpandCombo(s),a&&i.get("layout")?i.layout():i.refreshPositions())}}};var vve=al.isPolygonsIntersect,mve=al.pathToPoints,nAt="shift",gve=["drag","shift","ctrl","alt","control"],yve=function(e,t){var n,i=e.getKeyShape();if(e.get("type")==="path")n=mve(i.attr("path"));else{var a=i.getCanvasBBox();n=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return vve(t,n)},iAt={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:nAt,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return gve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=nAt,console.warn("Behavior lasso-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(e){var t=this.lasso,n=e.item;n||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),t||(t=this.createLasso()),this.dragging=!0,this.originPoint={x:e.x,y:e.y},this.points.push(this.originPoint),t.show())},onDragMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push({x:e.x,y:e.y}),this.updateLasso(e))},onDragEnd:function(e){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var e=this.points,t=[];return e.length&&(e.forEach(function(n,i){i===0?t.push(["M",n.x,n.y]):t.push(["L",n.x,n.y])}),t.push(["L",e[0].x,e[0].y])),t},clearStates:function(){var e=this,t=e.graph,n=e.selectedState,i=t.findAllByState("node",n),a=t.findAllByState("edge",n);i.forEach(function(o){return t.setItemState(o,n,!1)}),a.forEach(function(o){return t.setItemState(o,n,!1)}),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var e=this,t=this,n=t.graph,i=t.shouldUpdate,a=this.points.map(function(f){return[n.getCanvasByPoint(f.x,f.y).x,n.getCanvasByPoint(f.x,f.y).y]}),o=this.selectedState,s=[],l=[];n.getNodes().forEach(function(f){if(!!f.isVisible()&&yve(f,a)&&i(f,"select")){s.push(f);var c=f.getModel();l.push(c.id),n.setItemState(f,o,!0)}});var u=[];this.includeEdges&&s.forEach(function(f){var c=f.getOutEdges();c.forEach(function(h){if(!!h.isVisible()){var d=h.getModel(),p=d.source,v=d.target;l.includes(p)&&l.includes(v)&&i(h,"select")&&(u.push(h),n.setItemState(h,e.selectedState,!0))}})}),this.selectedEdges=u,this.selectedNodes=s,this.onSelect&&this.onSelect(s,u),n.emit("nodeselectchange",{selectedItems:{nodes:s,edges:u},select:!0})},createLasso:function(){var e=this,t=e.graph.get("delegateGroup").addShape("path",{attrs:E({path:[]},e.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(e){var t=this;this.lasso.attr({path:t.getLassoPath()})},onKeyDown:function(e){var t=e.key;!t||(t.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 zX=z(q()),aAt="click",xve=["click","drag"],oAt=void 0,bve=["shift","ctrl","control","alt","meta",void 0],sAt={getDefaultCfg:function(){return{trigger:aAt,key:oAt,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var e=this;xve.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=aAt,console.warn("Behavior create-edge \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click'\uFF0C'drag'")),e.key&&bve.indexOf(e.key.toLowerCase())===-1&&(e.trigger=oAt,console.warn("Behavior create-edge \u7684 key \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'shift'\uFF0C'ctrl'\uFF0C'alt'\uFF0C'control'\uFF0C\u6216 undefined"));var t;return e.trigger==="drag"?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:e.trigger==="click"&&(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(e){var t=this;if(!(t.key&&!t.keydown)){var n=e.item;(!n||n.getID()===t.source||n.getType()!=="node")&&t.cancelCreating({item:t.edge,x:e.x,y:e.y})}},onClick:function(e){var t=this;if(!(t.key&&!t.keydown)){var n=e.item,i=t.graph,a=n.getModel(),o=t.getEdgeConfig;if(t.addingEdge&&t.edge){if(!t.shouldEnd.call(t,e))return;var s=void 0;o&&(0,zX.isFunction)(o)?s=o({source:t.source,target:a.id}):s=t.edgeConfig;var l=E({target:a.id},s);if(t.source===a.id&&(l.type="loop"),i.emit("beforecreateedge",{}),i.updateItem(t.edge,l,!1),i.get("enabledStack")){var u=E(E({},t.edge.getModel()),{itemType:"edge"}),f={};f.edges=[u],i.pushStack("add",{before:{},after:f})}i.emit("aftercreateedge",{edge:t.edge}),t.edge.getKeyShape().set("capture",!0),t.edge=null,t.addingEdge=!1}else{if(!t.shouldBegin.call(t,e))return;var s=void 0;o&&(0,zX.isFunction)(o)?s=o({source:a.id,target:a.id}):s=t.edgeConfig,t.edge=i.addItem("edge",E({source:a.id,target:a.id},s),!1),t.source=a.id,t.addingEdge=!0,t.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(e){var t=this;if(!(t.key&&!t.keydown)){t.edge&&t.edge.destroyed&&t.cancelCreating({item:t.edge});var n={x:e.x,y:e.y};if(!t.graph.findById(t.source)){t.addingEdge=!1;return}t.addingEdge&&t.edge&&t.graph.updateItem(t.edge,{target:n},!1)}},cancelCreating:function(e){var t,n,i=this;if(!(i.key&&!i.keydown)){var a=i.graph,o=e.item;if(i.addingEdge&&(i.edge===o||((n=(t=e.target)===null||t===void 0?void 0:t.isCanvas)===null||n===void 0?void 0:n.call(t)))){i.edge&&!i.edge.destroyed&&a.removeItem(i.edge,!1),i.edge=null,i.addingEdge=!1;return}}},onKeyDown:function(e){var t=this,n=e.key;!n||(n.toLowerCase()===t.key.toLowerCase()?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.addingEdge&&e.edge&&(e.graph.removeItem(e.edge,!1),e.addingEdge=!1,e.edge=null),this.keydown=!1}};var lAt="ctrl",_ve=["shift","ctrl","alt","control"],Sve="1",uAt={getDefaultCfg:function(){return{trigger:lAt,combinedKey:Sve,functionName:"fitView",functionParams:[]}},getEvents:function(){return _ve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=lAt,console.warn("Behavior shortcuts-fit-view \u7684 trigger \u53C2\u6570 '".concat(this.trigger,"' \u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(e){var t=e.key;if(!!t){var n=this.trigger.toLowerCase(),i=t.toLowerCase();this.triggerKeydown||(i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view \u7684 functionName \u53C2\u6570 '".concat(this.functionName,"' \u4E0D\u5408\u6CD5\uFF0C\u5B83\u4E0D\u662F Graph \u7684\u4E00\u4E2A\u51FD\u6570\u540D")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(i===o||i==="control"&&o==="ctrl"||i==="ctrl"&&o==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var Cve=["shift","ctrl","alt","control"],fAt={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0}},getEvents:function(){return(!this.zoomKey||Cve.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(e){var t=this,n=this.graph,i=e["".concat(this.zoomKey,"Key")];if(this.zoomKey==="control"&&(i=e.ctrlKey),i){var a=n.get("canvas"),o=a.getPointByClient(e.clientX,e.clientY),s=n.getZoom();e.wheelDelta>0?s=s+s*.05:s=s-s*.05,n.zoomTo(s,{x:o.x,y:o.y})}else{var l=e.deltaX||e.movementX,u=e.deltaY||e.movementY;!u&&navigator.userAgent.indexOf("Firefox")>-1&&(u=-e.wheelDelta*125/3);var f=this.graph.get("width"),c=this.graph.get("height"),h=this.graph.get("canvas").getCanvasBBox(),d=this.scalableRange,p=this.scalableRange;d<1&&d>-1&&(d=f*d,p=c*p);var v=h.minX,m=h.maxX,g=h.minY,x=h.maxY;l>0?m<-d?l=0:m-l<-d&&(l=m+d):l<0&&(v>f+d?l=0:v-l>f+d&&(l=v-(f+d))),u>0?x<-p?u=0:x-u<-p&&(u=x+p):u<0&&(g>c+p?u=0:g-u>c+p&&(u=g-(c+p))),this.get("direction")==="x"?u=0:this.get("direction")==="y"&&(l=0),n.translate(-l,-u)}e.preventDefault();var b=this.get("enableOptimize");if(b){var S=this.get("optimizeZoom"),C=this.get("optimized"),w=n.getNodes(),A=n.getEdges(),L=w.length,k=A.length;if(!C){for(var O=0;O0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]0?(m=jve(r.get("data"),l,p),r.changeData(m),r.get("fitCenter")&&(r.fitCenter(),r.stopAnimate())):(r.updateItem(a,{collapsed:!s}),r.layout()),x.label=3;case 3:return[2]}})})};r.on("node:click",function(i){n(i)}),r.on("node:touchstart",function(i){n(i)})},vAt=function(r,e,t){var n=cl(e),i=n;t&&(i=FS(e),n=BS(i,t)),r.data(n),r.set("eventData",new Bve(i)),r.render(),r.get("canvas").set("localRefresh",!1)},gT={},yT=function(r,e){r===void 0&&(r={});var t=e==null?void 0:e.get("id");if(!e||e.destroyed){gT[t]=null;return}if((!r||!r.show)&&gT[t]){var n=e.get("plugins")[0];n&&e.removePlugin(n),gT[t]=null}if(r.show&&!gT[t]){var i=Object.assign(hAt,r),a=new Ur.Minimap(fl(fl({},i),{id:t}));return e.addPlugin(a),gT[t]=a,a}return null},Gve=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=Math.random()*16|0,t=r=="x"?e:e&3|8;return t.toString(16)})},mAt=function(r){return r.current||(r.current="graph-".concat(Gve())),r.current},xT=function(r,e){r===void 0&&(r="right");var t=e[0],n=e[1],i=0,a=0;switch(r){case"top":i=t/2,a=0;break;case"right":i=t,a=n/2;break;case"bottom":i=t/2,a=n;break;case"left":i=0,a=n/2;break}return{x:i,y:a}},gAt=function(r){var e=function(t){var n,i=r.get("eventData").getData();if(t.target.get("name")==="collapse-icon"){var a=t.item,o=a.getModel().collapsed;Fve(o,"Boolean")||(o=(n=a._cfg.group.getChildren().find(function(v){return v.get("name")==="main-box"}))===null||n===void 0?void 0:n.attr("defaultCollapsed"));var s=t.item._cfg.group.getChildren().find(function(v){return v.cfg.type==="marker"}),l=(i!=null?i:{}).edges,u=l===void 0?[]:l,f=a.getModel().id,c=[],h=[],d=[],p=function(v){u.forEach(function(m){var g=m.source,x=m.target;g===v&&(c.push(x),p(x))})};p(f),o?(r.findAll("node",function(v){var m=i.nodes.find(function(g){return g.id===v.get("id")}).collapsedLevel;return c.includes(v.get("id"))&&(!m||m<2)}).forEach(function(v){return r.showItem(v)}),i.nodes.forEach(function(v){var m=v.collapsedLevel,g=m===void 0?0:m,x=v.id;c.includes(x)&&(v.collapsedLevel=g-1)})):(r.findAll("node",function(v){return c.includes(v.get("id"))}).forEach(function(v){return r.hideItem(v)}),i.nodes.forEach(function(v){var m=v.collapsedLevel,g=m===void 0?0:m,x=v.id;c.includes(x)&&(v.collapsedLevel=g+1)})),u.forEach(function(v){var m=v.source,g=v.target;c.includes(g)&&d.push(m)}),d=Array.from(new Set(d)),d.forEach(function(v){h.push(r.find("node",function(m){return m.get("id")===v}))}),h.forEach(function(v){r.updateItem(v,{collapsed:!v.getModel().collapsed}),r.refreshItem(v)})}};r.on("node:click",function(t){e(t)}),r.on("node:touchstart",function(t){e(t)})},yx=function(r){if(typeof r=="number")return[r,r,r,r];var e=[];switch(r.length){case 1:e=[r[0],r[0],r[0],r[0]];break;case 2:e=[r[0],r[1],r[0],r[1]];break;case 3:e=[r[0],r[1],r[2],r[1]];break;case 4:e=r;break;default:break}return e},Du=function(r,e){if(!!r&&!(typeof r=="object"&&(r==null?void 0:r.show)===!1)){var t=typeof r=="function"?r(e):r,n=t.type,i=n===void 0?"vee":n,a=t.d,o=a===void 0?0:a,s=t.size,l=s===void 0?10:s;return fl({path:Ur.Arrow[i](l,l,o),fill:"#ccc",d:o},t)}},yAt=function(r,e){var t=e!=null?e:{},n=t.nodeCfg,i=n===void 0?{}:n,a=t.edgeCfg,o=a===void 0?{}:a,s=i.nodeStateStyles,l=o.edgeStateStyles,u={},f=function(d,p,v){r.updateItem(d,{style:{endArrow:!!p&&{fill:p},startArrow:!!v&&{fill:v}}})},c=function(d,p,v){var m,g,x;v?d.toFront():d.toBack();var b=(m=d.getModel().style)!==null&&m!==void 0?m:{},S=b.endArrow,C=b.startArrow;if(S||C){if(!u[d.getID()]){var w=(S!=null?S:{}).fill,A=(C!=null?C:{}).fill,L=(x=(g=d.getModel().style)===null||g===void 0?void 0:g[p])===null||x===void 0?void 0:x.stroke;u[d.getID()]=[[L!=null?L:w,w],[L!=null?L:A,A]]}var k=u[d.getID()];f(d,S&&k[0][v?0:1],C&&k[1][v?0:1])}r.setItemState(d,p,v)},h=function(d,p,v,m){var g=m==="node"?r.findAll("edge",function(b){return b.getSource()===d||b.getTarget()===d}):r.findAll("node",function(b){return d.getSource().get("id")===b.get("id")||d.getTarget().get("id")===b.get("id")}),x=[d].concat(g);x.forEach(function(b){c(b,p,v)})};s&&(r.on("node:mouseenter",function(d){var p=d.item;h(p,"hover",!0,"node")}),r.on("node:mouseleave",function(d){var p=d.item;h(p,"hover",!1,"node")})),l&&(r.on("edge:mouseenter",function(d){var p=d.item;h(p,"hover",!0,"edge")}),r.on("edge:mouseleave",function(d){var p=d.item;h(p,"hover",!1,"edge")}))},Ns=function(r,e,t,n){return typeof r=="function"?r(e,t,n)||{}:r||{}},cv=function(r,e,t){return typeof r=="function"?r(e,t):r},_F=function(r){return Array.isArray(r)?r:r?[r,r]:Ng},yd=4,xAt=function(r){if(!r)return[0,0,0,0];var e=r.size,t=e===void 0?[]:e,n=r.position,i=n===void 0?"left":n,a=_F(t),o=a[0],s=a[1],l=[];switch(i){case"top":l.push(s!=null?s:yd,0,0,0);break;case"right":l.push(0,o!=null?o:yd,0,0);break;case"bottom":l.push(0,0,s!=null?s:yd,0);break;case"left":l.push(0,0,0,o!=null?o:yd);break}return l},bAt=function(r,e){var t=r!=null?r:{},n=t.size,i=n===void 0?[]:n,a=t.position,o=a===void 0?"left":a,s=_F(i),l=s[0],u=s[1],f=e[0],c=e[1],h=0,d=0,p=0,v=0;switch(o){case"top":h=0,d=0,p=l!=null?l:f,v=u!=null?u:yd;break;case"left":h=0,d=0,p=l!=null?l:yd,v=u!=null?u:c;break;case"right":h=f-((0,Ic.isNumber)(l)?l:yd),d=0,p=l!=null?l:yd,v=u!=null?u:c;break;case"bottom":h=0,d=c-((0,Ic.isNumber)(u)?u:yd),p=l!=null?l:f,v=u!=null?u:yd;break}return{x:h,y:d,width:p,height:v}},NS=function(r,e,t){var n=r.show,i=r.position,a=r.collapsed,o=r.style;n&&e.addShape("marker",{attrs:fl(fl(fl({},xT(i,t)),{r:6,cursor:"pointer",symbol:a?Ur.Marker.expand:Ur.Marker.collapse,stroke:kS.stroke,lineWidth:1,fill:"#fff"}),o),defaultCollapsed:!1,name:"collapse-icon"})},jX=function(r){var e={};return Object.keys(r).forEach(function(t){var n=r[t];if((0,Ic.isObject)(n)){var i={};Object.keys(n).forEach(function(a){var o=n[a];a==="img"&&!(0,Ic.isString)(o)||(i[a]=(0,Ic.clone)(o))}),e[t]=i}else e[t]=(0,Ic.clone)(n)}),e},SF=function(r,e){e===void 0&&(e={});var t=Object.keys(e);t.forEach(function(n){r.style[n]=e[n]})},FS=function(r,e,t,n){var i;e===void 0&&(e=0),t===void 0&&(t=""),n===void 0&&(n="");var a=r.id,o=r.children,s=o===void 0?[]:o;return fl(fl((i={},i["".concat(fv,"_level")]=e,i["".concat(fv,"_parentId")]=t,i["".concat(fv,"_currentPath")]=n,i),r),{children:s==null?void 0:s.map(function(l,u){return FS(l,e+1,t?"".concat(t,"-").concat(a):a,"".concat(n,"-").concat(u))})})},BS=function(r,e){var t=r.children,n=t===void 0?[]:t,i=r.g_level,a=i===void 0?0:i;return e<=0?r:fl(fl({},r),{children:a+1 renderIcon({zoomIn, xx})"),h({zoomIn:b,zoomOut:S,toggleFullscreen:C,fullscreen:p})):ht.createElement(ws,null,p?ht.createElement("span",{style:{cursor:"pointer"},onClick:C},"\u2684"):ht.createElement("span",{style:{cursor:"pointer"},onClick:C},"\u2610"),ht.createElement("span",{style:{cursor:"pointer"},onClick:b},"+"),ht.createElement("span",{style:{cursor:"pointer"},onClick:S},"-"))},CAt=function(r){var e,t=r.graph,n=r.container,i=r.toolbarCfg,a=i.style,o=i.show,s=i.className,l="".concat(t.get("id"),"-toolbar"),u=document.querySelector("#".concat(l));if(u&&((e=u.parentNode)===null||e===void 0||e.removeChild(u)),!!o){var f={position:"absolute",right:"12px",top:"12px",display:"flex",flexDirection:"column",padding:"6px",borderRadius:"2px",fontSize:"24px",textAlign:"center",lineHeight:"24px",color:"rgba(0,0,0,.65)",backgroundColor:"#fff",boxShadow:"0 0 3px #ccc"},c=document.createElement("div");c.id=l,c.className=s!=null?s:"charts-toolbar",SF(c,f),SF(c,a),ht.render(ht.createElement(Yve,{graph:t,container:n,toolbarCfg:i}),c),n.appendChild(c)}};var xd=function(){return xd=Object.assign||function(r){for(var e,t=1,n=arguments.length;t15?0:16,c=l<0?f:-f,h={x:i+u,y:s+c},d={x:h.x+f,y:s},p={x:(h.x-i)*(s-a)/(h.y-a)+i,y:s},v=[["M",i,a],["L",h.x,h.y],["Q",p.x,p.y,d.x,d.y],["L",o,s]];Math.abs(l)<=5&&(v=[["M",i,a],["L",o,s]]);var m=e,g=m.startArrow,x=m.endArrow,b=Du(g,r),S=Du(x,r);return{startArrow:b,endArrow:S,path:v,line2StartPoint:d,endY:s}},LAt=function(r){var e,t;return r instanceof Object?(e=r.text,t=r.subText):e=r,{text:e,subText:t}},OAt=function(){Ur.registerNode("fund-card",{draw:function(r,e){var t,n;r===void 0&&(r={});var i=r.value,a=i===void 0?{}:i,o=r.nodeCfg,s=r.markerCfg,l=o,u=l.label,f=u===void 0?{}:u,c=l.style,h=l.padding,d=h===void 0?0:h,p=l.customContent,v=f.style,m=yx(d),g=_F(r.size),x=0,b=g[0],S=b-m[1]-m[3],C=g[1]-m[0]-m[2],w=Ns(c,r,e),A=e.addShape("rect",{attrs:Mf({x:0,y:0,width:g[0],height:g[1],radius:g[1]/2,fill:"#fff",stroke:"#40a9ff"},w),name:"main-box",draggable:!0});if(a){x+=m[0];var L=function(H,tt,et){var ut,$,st=H.text,_t=H.icon,dt,gt;return _t&&(gt=e.addShape("image",{attrs:Mf({x:et,y:x,img:_t,width:C,height:C},Ns(v,r,e,"icon")),name:"fund-icon"})),dt=e==null?void 0:e.addShape("text",{attrs:Mf(Mf({textBaseline:"middle",textAlign:gt?"start":"center",x:et+(gt?(gt==null?void 0:gt.getBBox().width)+RS:tt/2),y:m[0]+C/2,text:st},Gg),Ns(v,r,e,"text")),name:"fund-text"}),[(ut=dt==null?void 0:dt.getBBox().height)!==null&&ut!==void 0?ut:0,($=gt==null?void 0:gt.getBBox().height)!==null&&$!==void 0?$:0]},k=function(H){var tt,et=[];p?et.push((tt=p(H,e,{startX:m[3],startY:x,width:S}))!==null&&tt!==void 0?tt:0):et.push.apply(et,L(H,S,m[3])),x+=Math.max.apply(Math,et)};k(a)}if(A==null||A.attr("height",Math.max(g[1],x+m[2])),s){var O=((n=(t=e==null?void 0:e.get("item"))===null||t===void 0?void 0:t.getModel())!==null&&n!==void 0?n:{}).collapsed,M=A.getBBox(),I=M.width,R=M.height,P=typeof s=="function"?s(r,e):s,F=P.show,D=P.position,G=D===void 0?"right":D,U=P.collapsed,j=P.style;NS({show:F,position:G,collapsed:O!=null?O:U,style:j},e,[I,R]),A.attr("defaultCollapsed",U)}return A},update:void 0},"single-node"),Ur.registerEdge("fund-line",{draw:function(e,t){e===void 0&&(e={});var n=e.edgeCfg,i=e.value,a=LAt(i),o=a.text,s=a.subText,l=n,u=l.style,f=l.label,c=IAt(e),h=c.startArrow,d=c.endArrow,p=c.path,v=c.line2StartPoint,m=c.endY,g=(f!=null?f:{}).style,x=t.addShape("path",{attrs:Mf({path:p,stroke:"#ccc",startArrow:h,endArrow:d},typeof u=="function"?u(e,t):u),name:"path-shape"}),b=function(S,C){t.addShape("text",{attrs:Mf(Mf({text:S,x:v.x,y:C==="text"?m-4:m+16},Gg),Ns(g,e,t,C)),name:"line-text-".concat(C)})};return o&&b(o,"text"),s&&b(s,"subText"),x},update:function(r,e){var t=r.edgeCfg,n=r.value,i=LAt(n),a=i.text,o=i.subText,s=e.getContainer(),l=function(C){return s.get("children").find(function(w){return w.get("name")===C})},u=IAt(r),f=u.startArrow,c=u.endArrow,h=u.path,d=u.line2StartPoint,p=u.endY,v=t,m=v.style,g=v.label,x=(g!=null?g:{}).style,b=l("path-shape");b==null||b.attr(Mf({path:h,stroke:"#ccc",startArrow:f,endArrow:c},typeof m=="function"?m(r,s):m));var S=["text","subText"];S.forEach(function(C){var w=l("line-text-".concat(C));w==null||w.attr(Mf(Mf({x:d.x,y:C==="text"?p-4:p+16,text:C==="text"?a:o},Gg),Ns(x,r,s,C)))})}},"single-edge")};var dme=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);ix.width+16?n[0]:x.width+16;s.attr({width:S,height:b}),d==null||d.attr("width",S),p==null||p.attr({x:S,y:b/2})}return s},update:void 0},"single-node"),Ur.registerNode("round-rect",{drawShape:function(r,e){r===void 0&&(r={});var t=r.size||[100,30];typeof t=="number"&&(t=[t,t]);var n=r.style||{},i=n.stroke||r.color||"#5B8FF9",a=n.fill||"#fff";n=ms({width:t[0],height:t[1],radius:t[1]/2,fill:a,lineWidth:1.2,stroke:i},n);var o=e.addShape("rect",{attrs:ms({x:-t[0]/2,y:-t[1]/2},n),name:"rect-shape"});return e.addShape("circle",{attrs:{x:-t[0]/2,y:0,r:3,fill:n.stroke},name:"circle-shape"}),e.addShape("circle",{attrs:{x:t[0]/2,y:0,r:3,fill:n.stroke},name:"circle-shape2"}),o},getAnchorPoints:function(){return[[0,.5],[1,.5]]},update:function(e,t){var n;e===void 0&&(e={});var i=t.getContainer(),a=i.get("children"),o=a[0],s=a[1],l=a[2],u=((n=e.style)===null||n===void 0?void 0:n.stroke)||"#5B8FF9";u&&(o.attr("stroke",u),s.attr("fill",u),l.attr("fill",u))}},"single-node"),Ur.registerEdge("fund-polyline",{draw:function(e,t){var n;e===void 0&&(e={});var i=e.startPoint,a=e.endPoint,o=a.y-i.y,s=o!==0?Math.min(500/Math.abs(o),20):0,l=s>15?0:16,u=o<0?l:-l,f={x:i.x+s,y:a.y+u},c={x:f.x+l,y:a.y},h={x:(f.x-i.x)*(a.y-i.y)/(f.y-i.y)+i.x,y:a.y},d=[["M",i.x,i.y],["L",f.x,f.y],["Q",h.x,h.y,c.x,c.y],["L",a.x,a.y]];Math.abs(o)<=5&&(d=[["M",i.x,i.y],["L",a.x,a.y]]);var p=e.style,v=p.stroke||(e==null?void 0:e.colorMap)&&e.colorMap[e.dataType]?(e==null?void 0:e.colorMap)[e==null?void 0:e.dataType]:"#5B8FF9",m=((n=e.style)===null||n===void 0?void 0:n.endArrow)||!1;(0,PAt.isObject)(m)&&(m.fill=v);var g=t.addShape("path",{attrs:{path:d,stroke:v,lineWidth:p.lineWidth||1.2,endArrow:m},name:"path-shape"}),x=0,b=8,S,C=c.x+x;if((e==null?void 0:e.label)&&(S=t.addShape("text",{attrs:{text:e.label,x:C,y:a.y-b-2,fontSize:14,textAlign:"left",textBaseline:"middle",fill:"#000"},name:"text-shape-label"})),e==null?void 0:e.dataType){var w=S?S.getBBox():{height:0};t.addShape("text",{attrs:{text:e.dataType,x:C,y:a.y-b-w.height-2,fontSize:10,textAlign:"left",textBaseline:"middle",fill:"#000"},name:"text-shape-type"})}return(e==null?void 0:e.subLabel)&&t.addShape("text",{attrs:{text:e.subLabel,x:C,y:a.y+b+4,fontSize:12,fontWeight:300,textAlign:"left",textBaseline:"middle",fill:"#000"},name:"text-shape-sub-label"}),g},update:void 0},"single-edge"),Ur.registerEdge("flow-line",{draw:function(r,e){r===void 0&&(r={});var t=r.startPoint,n=r.endPoint,i=r.style,a=i===void 0?{}:i,o=e.addShape("path",{attrs:{stroke:a.stroke,endArrow:a.endArrow,path:[["M",t.x,t.y],["L",t.x,(t.y+n.y)/2],["L",n.x,(t.y+n.y)/2],["L",n.x,n.y]]}});return o}})},kAt=function(r){Ur.registerNode("icon-node",{options:{size:[60,20],stroke:"#91d5ff",fill:"#91d5ff"},draw:function(e,t){e===void 0&&(e={});var n=this.getShapeStyle(e),i=e.labelCfg,a=i===void 0?{}:i,o=t.addShape("rect",{attrs:ms(ms({},n),{x:0,y:0})}),s={fill:"#e6fffb"},l="https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png";return e.leftIcon&&(s=ms(ms({},s),e.leftIcon.style),l=e.leftIcon.img),t.addShape("rect",{attrs:ms({x:1,y:1,width:38,height:n.height-2},s)}),t.addShape("image",{attrs:{x:8,y:8,width:24,height:24,img:l},name:"image-shape"}),r.enableEdit&&(t.addShape("marker",{attrs:{x:n.width/3,y:n.height+6,r:6,stroke:"#73d13d",cursor:"pointer",symbol:Ur.Marker.expand},name:"add-item"}),t.addShape("marker",{attrs:{x:n.width*2/3,y:n.height+6,r:6,stroke:"#ff4d4f",cursor:"pointer",symbol:Ur.Marker.collapse},name:"remove-item"})),e.label&&t.addShape("text",{attrs:ms(ms({},a.style),{text:e.label,x:n.width/2,y:n.height/1.5})}),o}},"rect")};var Pu={style:{fill:"#000",fontSize:12}},zS={stroke:"#91d5ff",endArrow:{path:Ur.Arrow.vee(10,10)}},US=[[.5,0],[.5,1]],go={hover:{stroke:"#1890ff",lineWidth:2}},jS=[120,40];var zg=function(){return zg=Object.assign||function(r){for(var e,t=1,n=arguments.length;tdt.width+16?u[0]:dt.width+16;p.attr({width:U,height:f+16}),C==null||C.attr("width",U),w==null||w.attr(Fi({},VX(l,[U,f+S+2*AF])))}return p},update:void 0},"single-node")},jAt=function(){Ur.registerNode("icon-node",{options:{size:[60,20],stroke:"#91d5ff",fill:"#91d5ff"},draw:function(r,e){r===void 0&&(r={});var t=this.getShapeStyle(r),n=r.labelCfg,i=n===void 0?{}:n,a=r.labelStyle,o=r.label,s=r.markerStyle,l=r.showMarker,u=r.title,f=r.titleStyle,c=e.addShape("rect",{attrs:Fi(Fi({},t),{x:0,y:0})}),h=c.getBBox().height,d;if(r.leftIcon){var p=r.leftIcon,v=p.x,m=v===void 0?8:v,g=p.y,x=p.width,b=x===void 0?24:x,S=p.height,C=S===void 0?24:S,w=p.style;w&&e.addShape("rect",{attrs:Fi({x:1,y:1,width:38,height:t.height-2},w)}),d=e.addShape("image",{attrs:{x:m,y:g||h/2-C/2,width:b,height:C,img:r.leftIcon.img},name:"image-shape"})}if(l&&(e.addShape("marker",{attrs:Fi({x:t.width/3,y:t.height+6,r:6,stroke:"#73d13d",cursor:"pointer",symbol:Ur.Marker.expand},bd(s,e,Fi(Fi({},r),{name:"add-item"}))),name:"add-item"}),e.addShape("marker",{attrs:Fi({x:t.width*2/3,y:t.height+6,r:6,stroke:"#ff4d4f",cursor:"pointer",symbol:Ur.Marker.collapse},bd(s,e,Fi(Fi({},r),{name:"remove-item"}))),name:"remove-item"})),o){var A=a?bd(a,e,r):i.style,g=u?t.height/2-(A.fontSize*1||12)-Pc/2:t.height/2;e.addShape("text",{attrs:Fi({text:o,x:t.width/2,y:g,textAlign:d?"start":"center",textBaseline:u?"top":"middle"},A)})}if(u){var L=f?bd(f,e,r):i.style;e.addShape("text",{attrs:Fi({text:u,x:t.width/2,y:t.height/2+Pc/2,textAlign:d?"start":"center",textBaseline:"top"},L)})}return c}},"rect")};GS();MF();var WAt={stroke:"#40a9ff"},VAt={type:"dagre",rankdir:"TB",nodesepFunc:function(){return 0},ranksepFunc:function(){return 0},controlPoints:!0},Sme={nodeType:"modelRect",edgeType:"polyline",behaviors:["zoom-canvas","drag-canvas"],nodeSize:jS,nodeLabelCfg:Pu,edgeLabelCfg:Pu,nodeAnchorPoints:US,layout:VAt,nodeStyle:WAt,edgeStyle:zS,nodeStateStyles:go,edgeStateStyles:go,autoFit:!0},JS={},Cme=function(r){var e=Hg(r,Sme),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"modelRect":s,u=e.edgeType,f=u===void 0?"polyline":u,c=e.behaviors,h=c===void 0?["zoom-canvas","drag-canvas"]:c,d=e.nodeSize,p=d===void 0?jS:d,v=e.nodeLabelCfg,m=v===void 0?Pu:v,g=e.edgeLabelCfg,x=g===void 0?Pu:g,b=e.nodeAnchorPoints,S=b===void 0?US:b,C=e.layout,w=C===void 0?VAt:C,A=e.minimapCfg,L=e.nodeStyle,k=L===void 0?WAt:L,O=e.edgeStyle,M=O===void 0?zS:O,I=e.nodeStateStyles,R=I===void 0?go:I,P=e.edgeStateStyles,F=P===void 0?go:P,D=e.autoFit,G=D===void 0?!0:D,U=e.graphRef,j=e.onReady,H=e.loading,tt=e.loadingTemplate,et=e.errorTemplate,ut=ht.useRef(null),$=ht.useRef(null),st=Wg($);return dl(JS[st],e,ut),De(function(){var _t=Ug(a,o,ut),dt=JS[st];return dt||(dt=new Ur.Graph({container:ut.current,width:_t[0],height:_t[1],modes:{default:h},defaultNode:{type:l,size:p,style:k,anchorPoints:S,labelCfg:m},defaultEdge:{type:f,style:M,labelCfg:x},nodeStateStyles:R,edgeStateStyles:F,layout:w,fitView:G}),JS[st]=dt),U&&(U.current=dt),jg(A,dt),WS(dt,t),j&&j(dt),Vg(dt,r),function(){JS[st]&&(JS[st].destroy(),delete JS[st])}},[]),ht.createElement(Ta,{errorTemplate:et},H&&ht.createElement(Ma,{loadingTemplate:tt}),ht.createElement("div",{className:n,style:i,ref:ut}))},HX=Cme;GS();var HAt=[150,30],YAt={stroke:"#72CC4A",fill:"#f00"},XAt={type:"dagre",rankdir:"LR",nodesep:30,ranksep:50},TF={style:{fill:"#000000A6",fontSize:10}},wme={nodeType:"round-rect",edgeType:"fund-polyline",behaviors:["zoom-canvas","drag-canvas"],nodeSize:HAt,nodeLabelCfg:TF,edgeLabelCfg:TF,nodeAnchorPoints:US,layout:XAt,nodeStyle:YAt,edgeStyle:zS,nodeStateStyles:go,edgeStateStyles:go,colorMap:{},autoFit:!0},tC={},Eme=function(r){var e=Hg(r,wme),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"round-rect":s,u=e.edgeType,f=u===void 0?"fund-polyline":u,c=e.behaviors,h=c===void 0?["zoom-canvas","drag-canvas"]:c,d=e.nodeSize,p=d===void 0?HAt:d,v=e.nodeLabelCfg,m=v===void 0?TF:v,g=e.edgeLabelCfg,x=g===void 0?TF:g,b=e.nodeAnchorPoints,S=b===void 0?US:b,C=e.layout,w=C===void 0?XAt:C,A=e.minimapCfg,L=e.nodeStyle,k=L===void 0?YAt:L,O=e.edgeStyle,M=O===void 0?zS:O,I=e.nodeStateStyles,R=I===void 0?go:I,P=e.edgeStateStyles,F=P===void 0?go:P,D=e.colorMap,G=D===void 0?{}:D,U=e.autoFit,j=U===void 0?!0:U,H=e.graphRef,tt=e.onReady,et=e.loading,ut=e.loadingTemplate,$=e.errorTemplate,st=ht.useRef(null),_t=ht.useRef(null),dt=Wg(_t);return dl(tC[dt],e,st),De(function(){var gt=Ug(a,o,st),Tt=tC[dt];Tt||(Tt=new Ur.Graph({container:st.current,width:gt[0],height:gt[1],modes:{default:h},defaultNode:{type:l,size:p,style:k,anchorPoints:S,labelCfg:m},defaultEdge:{type:f,style:M,colorMap:G,labelCfg:x},nodeStateStyles:R,edgeStateStyles:F,layout:w,fitView:j}),tC[dt]=Tt),H&&(H.current=Tt),jg(A,Tt);var Ut=cl(t);Tt.data(Ut),Tt.render(),tt&&tt(Tt);var $t=Tt.getEdges();return $t.forEach(function(Y){var it=Y.getKeyShape(),K=it.attr("stroke"),Rt=Y.getTarget();Rt.update({style:{stroke:K}})}),Vg(Tt,r),function(){tC[dt]&&(tC[dt].destroy(),delete tC[dt])}},[]),ht.createElement(Ta,{errorTemplate:$},et&&ht.createElement(Ma,{loadingTemplate:ut}),ht.createElement("div",{className:n,style:i,ref:st}))},YX=Eme;GS();var qAt={stroke:"#40a9ff"},KAt=[[0,.5],[1,.5]],ZAt={stroke:"#ccc",endArrow:{path:Ur.Arrow.vee(10,10),fill:"#ccc"}},$At={type:"indented",direction:"LR",dropCap:!1,indent:250,getHeight:function(){return 60},getWidth:function(){return 100}},Ame={nodeType:"card-node",edgeType:"cubic-horizontal",behaviors:["zoom-canvas","drag-canvas"],nodeSize:jS,nodeLabelCfg:Pu,nodeAnchorPoints:KAt,layout:$At,nodeStyle:qAt,edgeStyle:ZAt,nodeStateStyles:go,edgeStateStyles:go,collapseExpand:!0,autoFit:!0},eC={},Mme=function(r){var e=Hg(r,Ame),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"card-node":s,u=e.edgeType,f=u===void 0?"cubic-horizontal":u,c=e.behaviors,h=c===void 0?["zoom-canvas","drag-canvas"]:c,d=e.nodeSize,p=d===void 0?jS:d,v=e.nodeLabelCfg,m=v===void 0?Pu:v,g=e.nodeAnchorPoints,x=g===void 0?KAt:g,b=e.layout,S=b===void 0?$At:b,C=e.minimapCfg,w=e.nodeStyle,A=w===void 0?qAt:w,L=e.edgeStyle,k=L===void 0?ZAt:L,O=e.nodeStateStyles,M=O===void 0?go:O,I=e.edgeStateStyles,R=I===void 0?go:I,P=e.collapseExpand,F=P===void 0?!0:P,D=e.autoFit,G=D===void 0?!0:D,U=e.handleNodeClick,j=e.graphRef,H=e.onReady,tt=e.loading,et=e.loadingTemplate,ut=e.errorTemplate,$=ht.useRef(null),st=Wg($),_t=ht.useRef(null);return dl(eC[st],e,_t),De(function(){var dt=Ug(a,o,_t),gt=eC[st];if(gt||(gt=new Ur.TreeGraph({container:_t.current,width:dt[0],height:dt[1],modes:{default:h},defaultNode:{type:l,size:p,style:A,anchorPoints:x,labelCfg:m},defaultEdge:{type:f,style:k},nodeStateStyles:M,edgeStateStyles:R,layout:S,fitView:G}),eC[st]=gt),j&&(j.current=gt),jg(C,gt),WS(gt,t),H&&H(gt),F){var Tt=function(Ut){var $t=Ut.item;Ut.target.get("name")==="collapse-icon"?(gt.updateItem($t,{collapsed:!$t.getModel().collapsed}),gt.layout()):U&&U($t,gt)};gt.on("node:click",function(Ut){Tt(Ut)}),gt.on("node:touchstart",function(Ut){Tt(Ut)})}return Vg(gt,r),function(){eC[st]&&(eC[st].destroy(),delete eC[st])}},[]),ht.createElement(Ta,{errorTemplate:ut},tt&&ht.createElement(Ma,{loadingTemplate:et}),ht.createElement("div",{className:n,style:i,ref:_t}))},XX=Mme;var rC=function(){return rC=Object.assign||function(r){for(var e,t=1,n=arguments.length;tencodeURIComponent(r),dv=r=>`(${encodeURIComponent(r)})`,Bme=r=>`"${encodeURIComponent(r)}"`,JAt=r=>`("${encodeURIComponent(r)}")`,tMt=class extends Ir{search(e,t,n){let i=this.context.event.data,{shape:a,data:o}=i,s;a==="word-cloud"?s=o.text:s=e?o[e.field]:"",n&&(s=n(s)),this.openScheme(`obsidian://search?vault=${encodeURIComponent(e.vault)}&query=${t}${s}`)}openNote(e){let t=this.context.event.data,{shape:n,data:i}=t,a;n==="word-cloud"?a=i.datum[e.pathField]:a=i[e.pathField],this.openScheme(`obsidian://vault/${encodeURIComponent(e.vault)}/${a}`)}openScheme(e){let t=window.document.body.createEl("a",{href:e});t.click(),t.remove()}tag(e){this.search(e,"tag%3A",Fme)}file(e){this.search(e,"file%3A",JAt)}fileopen(e){this.openNote(e)}path(e){this.search(e,"path%3A",JAt)}content(e){this.search(e,"content%3A",dv)}task(e){this.search(e,"task%3A",dv)}matchCase(e){this.search(e,"match-case%3A",dv)}ignoreCase(e){this.search(e,"ignore-case%3A",dv)}line(e){this.search(e,"line%3A",dv)}block(e){this.search(e,"block%3A",dv)}taskTodo(e){this.search(e,"task-todo%3A",dv)}taskDone(e){this.search(e,"task-done%3A",dv)}section(e){this.search(e,"section%3A",dv)}default(e){this.search(e,"",Bme)}};nr("obsidian-search",tMt);xr("obsidian-search",{start:[{trigger:"element:click",action:"obsidian-search:default"}]});s0("theme1",{colors10:["#FF6B3B","#626681","#FFC100","#9FB40F","#76523B","#DAD5B5","#0E8E89","#E19348","#F383A2","#247FEA"],colors20:["#FF6B3B","#626681","#FFC100","#9FB40F","#76523B","#DAD5B5","#0E8E89","#E19348","#F383A2","#247FEA","#2BCB95","#B1ABF4","#1D42C2","#1D9ED1","#D64BC0","#255634","#8C8C47","#8CDAE5","#8E283B","#791DC9"]});s0("theme2",{colors10:["#025DF4","#DB6BCF","#2498D1","#BBBDE6","#4045B2","#21A97A","#FF745A","#007E99","#FFA8A8","#2391FF"],colors20:["#025DF4","#DB6BCF","#2498D1","#BBBDE6","#4045B2","#21A97A","#FF745A","#007E99","#FFA8A8","#2391FF","#FFC328","#A0DC2C","#946DFF","#626681","#EB4185","#CD8150","#36BCCB","#327039","#803488","#83BC99"]});var IF=({type:r,config:e,showExportBtn:t=!1})=>{let n=WA[r]||ST[r],i=Fa();return ht.createElement(fr,null,t&&ht.createElement("div",{className:"chartsview-export-button","aria-label":"Export to PNG",onClick:()=>{var a;(a=i.current)==null||a.downloadImage(`${r}.png`)}},ht.createElement("svg",{className:"code-glyph",viewBox:"0 0 1024 1024",width:"16",height:"16"},ht.createElement("path",{fill:"currentColor",stroke:"currentColor",d:"M896 166.4H128c-25.6 0-42.666667 17.066667-42.666667 42.666667v597.333333c0 25.6 17.066667 42.666667 42.666667 42.666667h768c25.6 0 42.666667-17.066667 42.666667-42.666667v-597.333333c0-25.6-21.333333-42.666667-42.666667-42.666667z m-42.666667 85.333333v418.133334l-136.533333-136.533334c-21.333333-12.8-51.2-12.8-64 4.266667L554.666667 635.733333l-183.466667-179.2c-17.066667-17.066667-46.933333-17.066667-59.733333 0L170.666667 597.333333V251.733333h682.666666z m-243.2 443.733334l76.8-76.8 136.533334 140.8h-145.066667l-68.266667-64zM170.666667 716.8l170.666666-170.666667 217.6 217.6H170.666667v-46.933333z"}),ht.createElement("path",{fill:"currentColor",stroke:"currentColor",d:"M716.8 396.8m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z"}))),ht.createElement(n,F9(wl({},e),{onReady:a=>{i.current=a}})))};var DF=z(require("obsidian"));var rMt=z(eMt()),LF=z(require("obsidian"));function oC(r,e){r.somethingSelected?r.replaceSelection(e):r.setLine(r.getCursor().line,e)}function nMt(r){let e={};return LF.Vault.recurseChildren(r.vault.getRoot(),t=>{t instanceof LF.TFolder&&(e[t.path]=t.path)}),e}function OF(r){return rMt.default.parse(r,{header:!0,skipEmptyLines:!0,comments:!1,dynamicTyping:!0}).data}function Gme(){let r=/A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,e=/\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5/.source,t=/[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5]{1}/.source;return new RegExp([`(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-${r}])+`,e,t].join("|"),"g")}function iMt(r,e){let t={},n=r.match(Gme());n&&n.forEach(o=>{o=o.toLowerCase(),t[o]=t[o]?t[o]+1:1});let i=[],a=new RegExp(e.split(` `).map(o=>["^",o.trim(),"$"].join("")).join("|"),"i");for(let o in t)a.test(o)||i.push({word:o,count:t[o]});return i}var zme=/^\s*function\s*.*\(.*\)\s*\{[\w\W]*\}\s*/i;function aMt(r,e,t){return xa(this,null,function*(){var f,c,h,d,p;let n=(0,DF.parseYaml)(r),{type:i,data:a}=n;if((WA[i]||ST[i])===void 0)throw new Error(`Unsupported chart type ${i}.`);let s=PF(n.options||{}),l=i==="MultiView"||i==="Mix"?yield Ume(n,a,s,e,t):wl({data:yield sMt(a,e,t)},oMt(s,e)),u=((f=l.theme)==null?void 0:f.background)===void 0&&((h=(c=l.theme)==null?void 0:c.styleSheet)==null?void 0:h.backgroundColor)===void 0;return l.theme=(d=l.theme)!=null?d:Qu(e.settings.theme),u&&(l.theme.background=e.settings.backgroundColor),l.appendPadding=(p=l.appendPadding)!=null?p:[e.settings.paddingTop,e.settings.paddingRight,e.settings.paddingBottom,e.settings.paddingLeft],{type:i,showExportBtn:e.settings.showExportBtn,config:l}})}function PF(r){for(let e in r){let t=r[e];t&&(typeof t=="string"&&zme.test(t)?r[e]=(0,eval)(`(${t})`):Array.isArray(t)?r[e]=t.map(PF):typeof t=="object"&&(r[e]=PF(t)))}return r}function oMt(r,e){var o,s,l;let{enableSearchInteraction:t,interactions:n}=r;if(t!==!0&&typeof t!="object")return r;let i=n!=null?n:[];if(!Array.isArray(i))return r;let a={type:"obsidian-search",cfg:{start:[{trigger:"element:click",action:"obsidian-search:default",arg:{field:"text",pathField:"path",vault:e.app.vault.getName()}}]}};return typeof t=="object"&&(a.cfg.start[0].action=`obsidian-search:${(o=t.operator)!=null?o:"default"}`,a.cfg.start[0].arg.field=(s=t.field)!=null?s:"text",a.cfg.start[0].arg.pathField=(l=t.pathField)!=null?l:"path"),i.push(a),delete r.enableSearchInteraction,r.interactions=i,r}function Ume(r,e,t,n,i){return xa(this,null,function*(){let a=new Map,o=[];for(let s in r){let l=s.split(".");if(l.length!==2||l[0]!=="options"&&l[0]!=="data")continue;let u=l[1],f=a.get(u)||{};f[l[0]]=r[s],a.set(u,f)}for(let s of a.values())o.push(wl({data:(yield sMt(s.data,n,i))||e},oMt(PF(s.options||{}),n)));return wl({views:o},t)})}function sMt(r,e,t){return xa(this,null,function*(){if(typeof r=="string")if(r.startsWith("wordcount:")){let n=r.replace("wordcount:","");return Vme(n.length>0?n:e.app.vault.getAbstractFileByPath(t).basename,e)}else return r.startsWith("dataviewjs:")?Wme(r.replace("dataviewjs:",""),e,t):Hme(r,e);else return r})}var jme=function(r,e){return{pagePaths:function(t){return r.pagePaths(t,e)},page:function(t){return r.page(t,e)},pages:function(t){return r.pages(t,e)},current:function(){return r.page(e,e)},array:function(t){return r.array(t)},isArray:function(t){return r.isArray(t)},fileLink:function(t,n,i){return r.fileLink(t,n,i)},date:function(t){return r.date(t)}}};function Wme(r,e,t){return xa(this,null,function*(){var n;if(e.app.plugins.enabledPlugins.has("dataview")){let i=(n=e.app.plugins.plugins.dataview)==null?void 0:n.api;if(i)return new Function("dv",r).call(void 0,jme(i,t));throw new Error("Obsidian Dataview is not ready.")}else throw new Error("Obsidian Dataview is required.")})}function Vme(r,e){return xa(this,null,function*(){let t=r.split(","),n=[];for(let i of e.app.vault.getMarkdownFiles())if(i.basename==r||t.contains(i.basename)||lMt(i.parent,t)){let a=yield e.app.vault.cachedRead(i);n.push(a)}if(n.length==0)throw new Error("No words found.");return iMt(n.join(` `),e.settings.wordCountFilter)})}function lMt(r,e){let t=e.contains(`${r.name}/`);return t||r.parent==null?t:lMt(r.parent,e)}function Hme(r,e){return xa(this,null,function*(){let t=r.split(","),n=[];for(let i of t.values()){let a=e.settings.dataPath==="/"?"":`${e.settings.dataPath}/`,o=e.app.vault.getAbstractFileByPath(`${a}${i.trim()}`);o instanceof DF.TFile?n.push(OF(yield e.app.vault.read(o))):n.push({})}return n.length==0?{}:n.length==1?n[0]:n})}var kc=z(require("obsidian"));var uMt={theme:"default",dataPath:"",backgroundColor:"transparent",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,showExportBtn:!1,wordCountFilter:`[A-z]{1,2} [0-9]+ (?=[MDCLXVI])M*(C[MD]|D?C*)(X[CL]|L?X*)(I[XV]|V?I*) and are but did for get got had has her him his its not our she the was you been from have into mine ours that them they this went were with these those`},JX=class extends kc.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}display(){let{containerEl:e}=this;if(e.empty(),e.createEl("h2",{text:"Charts View Settings"}),new kc.Setting(e).setName("Theme").setDesc("Choose default color scheme.").addDropdown(t=>t.addOption("default","default").addOption("dark","dark").addOption("theme1","Theme #1").addOption("theme2","Theme #2").setValue(this.plugin.settings.theme).onChange(n=>xa(this,null,function*(){this.plugin.settings.theme=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Background Color").setDesc("Change the background color of chart. e.g., #FFFFFF").addText(t=>t.setPlaceholder("transparent").setValue(this.plugin.settings.backgroundColor).onChange(n=>xa(this,null,function*(){this.plugin.settings.backgroundColor=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Chart Padding").setDesc("Change the padding of chart. (Top, Right, Bottom, Left)").addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingTop)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingTop=Number(n),yield this.plugin.saveSettings()}))}).addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingRight)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingRight=Number(n),yield this.plugin.saveSettings()}))}).addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingBottom)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingBottom=Number(n),yield this.plugin.saveSettings()}))}).addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingLeft)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingLeft=Number(n),yield this.plugin.saveSettings()}))}),new kc.Setting(e).setName("Data Folder").setDesc("Choose default folder for loading chart datas.").addDropdown(t=>t.addOptions(nMt(this.app)).setValue(this.plugin.settings.dataPath).onChange(n=>xa(this,null,function*(){this.plugin.settings.dataPath=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Show Export Button").addToggle(t=>t.setValue(this.plugin.settings.showExportBtn).onChange(n=>xa(this,null,function*(){this.plugin.settings.showExportBtn=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Word Filter").setDesc("For word count, any words in the list will be ignored.").addTextArea(t=>{t.inputEl.rows=6,t.setValue(this.plugin.settings.wordCountFilter).onChange(n=>xa(this,null,function*(){this.plugin.settings.wordCountFilter=n,yield this.plugin.saveSettings()}))}),kc.Platform.isDesktopApp){let t=e.createDiv({cls:"chartsview-donation"});t.createEl("p",{text:"Make a donation to support Charts View plugin development."});let i=t.createEl("a",{href:"https://paypal.me/caronchenhz",cls:"paypal"}).createEl("img");i.src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTI0cHgiIGhlaWdodD0iMzNweCIgdmlld0JveD0iMCAwIDEyNCAzMyIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTI0IDMzIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiMyNTNCODAiIGQ9Ik00Ni4yMTEsNi43NDloLTYuODM5Yy0wLjQ2OCwwLTAuODY2LDAuMzQtMC45MzksMC44MDJsLTIuNzY2LDE3LjUzN2MtMC4wNTUsMC4zNDYsMC4yMTMsMC42NTgsMC41NjQsMC42NTgNCgloMy4yNjVjMC40NjgsMCwwLjg2Ni0wLjM0LDAuOTM5LTAuODAzbDAuNzQ2LTQuNzNjMC4wNzItMC40NjMsMC40NzEtMC44MDMsMC45MzgtMC44MDNoMi4xNjVjNC41MDUsMCw3LjEwNS0yLjE4LDcuNzg0LTYuNQ0KCWMwLjMwNi0xLjg5LDAuMDEzLTMuMzc1LTAuODcyLTQuNDE1QzUwLjIyNCw3LjM1Myw0OC41LDYuNzQ5LDQ2LjIxMSw2Ljc0OXogTTQ3LDEzLjE1NGMtMC4zNzQsMi40NTQtMi4yNDksMi40NTQtNC4wNjIsMi40NTQNCgloLTEuMDMybDAuNzI0LTQuNTgzYzAuMDQzLTAuMjc3LDAuMjgzLTAuNDgxLDAuNTYzLTAuNDgxaDAuNDczYzEuMjM1LDAsMi40LDAsMy4wMDIsMC43MDRDNDcuMDI3LDExLjY2OCw0Ny4xMzcsMTIuMjkyLDQ3LDEzLjE1NHoiDQoJLz4NCjxwYXRoIGZpbGw9IiMyNTNCODAiIGQ9Ik02Ni42NTQsMTMuMDc1aC0zLjI3NWMtMC4yNzksMC0wLjUyLDAuMjA0LTAuNTYzLDAuNDgxbC0wLjE0NSwwLjkxNmwtMC4yMjktMC4zMzINCgljLTAuNzA5LTEuMDI5LTIuMjktMS4zNzMtMy44NjgtMS4zNzNjLTMuNjE5LDAtNi43MSwyLjc0MS03LjMxMiw2LjU4NmMtMC4zMTMsMS45MTgsMC4xMzIsMy43NTIsMS4yMiw1LjAzMQ0KCWMwLjk5OCwxLjE3NiwyLjQyNiwxLjY2Niw0LjEyNSwxLjY2NmMyLjkxNiwwLDQuNTMzLTEuODc1LDQuNTMzLTEuODc1bC0wLjE0NiwwLjkxYy0wLjA1NSwwLjM0OCwwLjIxMywwLjY2LDAuNTYyLDAuNjZoMi45NQ0KCWMwLjQ2OSwwLDAuODY1LTAuMzQsMC45MzktMC44MDNsMS43Ny0xMS4yMDlDNjcuMjcxLDEzLjM4OCw2Ny4wMDQsMTMuMDc1LDY2LjY1NCwxMy4wNzV6IE02Mi4wODksMTkuNDQ5DQoJYy0wLjMxNiwxLjg3MS0xLjgwMSwzLjEyNy0zLjY5NSwzLjEyN2MtMC45NTEsMC0xLjcxMS0wLjMwNS0yLjE5OS0wLjg4M2MtMC40ODQtMC41NzQtMC42NjgtMS4zOTEtMC41MTQtMi4zMDENCgljMC4yOTUtMS44NTUsMS44MDUtMy4xNTIsMy42Ny0zLjE1MmMwLjkzLDAsMS42ODYsMC4zMDksMi4xODQsMC44OTJDNjIuMDM0LDE3LjcyMSw2Mi4yMzIsMTguNTQzLDYyLjA4OSwxOS40NDl6Ii8+DQo8cGF0aCBmaWxsPSIjMjUzQjgwIiBkPSJNODQuMDk2LDEzLjA3NWgtMy4yOTFjLTAuMzE0LDAtMC42MDksMC4xNTYtMC43ODcsMC40MTdsLTQuNTM5LDYuNjg2bC0xLjkyNC02LjQyNQ0KCWMtMC4xMjEtMC40MDItMC40OTItMC42NzgtMC45MTItMC42NzhoLTMuMjM0Yy0wLjM5MywwLTAuNjY2LDAuMzg0LTAuNTQxLDAuNzU0bDMuNjI1LDEwLjYzOGwtMy40MDgsNC44MTENCgljLTAuMjY4LDAuMzc5LDAuMDAyLDAuOSwwLjQ2NSwwLjloMy4yODdjMC4zMTIsMCwwLjYwNC0wLjE1MiwwLjc4MS0wLjQwOEw4NC41NjQsMTMuOTdDODQuODI2LDEzLjU5Miw4NC41NTcsMTMuMDc1LDg0LjA5NiwxMy4wNzV6DQoJIi8+DQo8cGF0aCBmaWxsPSIjMTc5QkQ3IiBkPSJNOTQuOTkyLDYuNzQ5aC02Ljg0Yy0wLjQ2NywwLTAuODY1LDAuMzQtMC45MzgsMC44MDJsLTIuNzY2LDE3LjUzN2MtMC4wNTUsMC4zNDYsMC4yMTMsMC42NTgsMC41NjIsMC42NTgNCgloMy41MWMwLjMyNiwwLDAuNjA1LTAuMjM4LDAuNjU2LTAuNTYybDAuNzg1LTQuOTcxYzAuMDcyLTAuNDYzLDAuNDcxLTAuODAzLDAuOTM4LTAuODAzaDIuMTY0YzQuNTA2LDAsNy4xMDUtMi4xOCw3Ljc4NS02LjUNCgljMC4zMDctMS44OSwwLjAxMi0zLjM3NS0wLjg3My00LjQxNUM5OS4wMDQsNy4zNTMsOTcuMjgxLDYuNzQ5LDk0Ljk5Miw2Ljc0OXogTTk1Ljc4MSwxMy4xNTRjLTAuMzczLDIuNDU0LTIuMjQ4LDIuNDU0LTQuMDYyLDIuNDU0DQoJaC0xLjAzMWwwLjcyNS00LjU4M2MwLjA0My0wLjI3NywwLjI4MS0wLjQ4MSwwLjU2Mi0wLjQ4MWgwLjQ3M2MxLjIzNCwwLDIuNCwwLDMuMDAyLDAuNzA0DQoJQzk1LjgwOSwxMS42NjgsOTUuOTE4LDEyLjI5Miw5NS43ODEsMTMuMTU0eiIvPg0KPHBhdGggZmlsbD0iIzE3OUJENyIgZD0iTTExNS40MzQsMTMuMDc1aC0zLjI3M2MtMC4yODEsMC0wLjUyLDAuMjA0LTAuNTYyLDAuNDgxbC0wLjE0NSwwLjkxNmwtMC4yMy0wLjMzMg0KCWMtMC43MDktMS4wMjktMi4yODktMS4zNzMtMy44NjctMS4zNzNjLTMuNjE5LDAtNi43MDksMi43NDEtNy4zMTEsNi41ODZjLTAuMzEyLDEuOTE4LDAuMTMxLDMuNzUyLDEuMjE5LDUuMDMxDQoJYzEsMS4xNzYsMi40MjYsMS42NjYsNC4xMjUsMS42NjZjMi45MTYsMCw0LjUzMy0xLjg3NSw0LjUzMy0xLjg3NWwtMC4xNDYsMC45MWMtMC4wNTUsMC4zNDgsMC4yMTMsMC42NiwwLjU2NCwwLjY2aDIuOTQ5DQoJYzAuNDY3LDAsMC44NjUtMC4zNCwwLjkzOC0wLjgwM2wxLjc3MS0xMS4yMDlDMTE2LjA1MywxMy4zODgsMTE1Ljc4NSwxMy4wNzUsMTE1LjQzNCwxMy4wNzV6IE0xMTAuODY5LDE5LjQ0OQ0KCWMtMC4zMTQsMS44NzEtMS44MDEsMy4xMjctMy42OTUsMy4xMjdjLTAuOTQ5LDAtMS43MTEtMC4zMDUtMi4xOTktMC44ODNjLTAuNDg0LTAuNTc0LTAuNjY2LTEuMzkxLTAuNTE0LTIuMzAxDQoJYzAuMjk3LTEuODU1LDEuODA1LTMuMTUyLDMuNjctMy4xNTJjMC45MywwLDEuNjg2LDAuMzA5LDIuMTg0LDAuODkyQzExMC44MTYsMTcuNzIxLDExMS4wMTQsMTguNTQzLDExMC44NjksMTkuNDQ5eiIvPg0KPHBhdGggZmlsbD0iIzE3OUJENyIgZD0iTTExOS4yOTUsNy4yM2wtMi44MDcsMTcuODU4Yy0wLjA1NSwwLjM0NiwwLjIxMywwLjY1OCwwLjU2MiwwLjY1OGgyLjgyMmMwLjQ2OSwwLDAuODY3LTAuMzQsMC45MzktMC44MDMNCglsMi43NjgtMTcuNTM2YzAuMDU1LTAuMzQ2LTAuMjEzLTAuNjU5LTAuNTYyLTAuNjU5aC0zLjE2QzExOS41NzgsNi43NDksMTE5LjMzOCw2Ljk1MywxMTkuMjk1LDcuMjN6Ii8+DQo8cGF0aCBmaWxsPSIjMjUzQjgwIiBkPSJNNy4yNjYsMjkuMTU0bDAuNTIzLTMuMzIybC0xLjE2NS0wLjAyN0gxLjA2MUw0LjkyNywxLjI5MkM0LjkzOSwxLjIxOCw0Ljk3OCwxLjE0OSw1LjAzNSwxLjENCgljMC4wNTctMC4wNDksMC4xMy0wLjA3NiwwLjIwNi0wLjA3Nmg5LjM4YzMuMTE0LDAsNS4yNjMsMC42NDgsNi4zODUsMS45MjdjMC41MjYsMC42LDAuODYxLDEuMjI3LDEuMDIzLDEuOTE3DQoJYzAuMTcsMC43MjQsMC4xNzMsMS41ODksMC4wMDcsMi42NDRsLTAuMDEyLDAuMDc3djAuNjc2bDAuNTI2LDAuMjk4YzAuNDQzLDAuMjM1LDAuNzk1LDAuNTA0LDEuMDY1LDAuODEyDQoJYzAuNDUsMC41MTMsMC43NDEsMS4xNjUsMC44NjQsMS45MzhjMC4xMjcsMC43OTUsMC4wODUsMS43NDEtMC4xMjMsMi44MTJjLTAuMjQsMS4yMzItMC42MjgsMi4zMDUtMS4xNTIsMy4xODMNCgljLTAuNDgyLDAuODA5LTEuMDk2LDEuNDgtMS44MjUsMmMtMC42OTYsMC40OTQtMS41MjMsMC44NjktMi40NTgsMS4xMDljLTAuOTA2LDAuMjM2LTEuOTM5LDAuMzU1LTMuMDcyLDAuMzU1aC0wLjczDQoJYy0wLjUyMiwwLTEuMDI5LDAuMTg4LTEuNDI3LDAuNTI1Yy0wLjM5OSwwLjM0NC0wLjY2MywwLjgxNC0wLjc0NCwxLjMyOGwtMC4wNTUsMC4yOTlsLTAuOTI0LDUuODU1bC0wLjA0MiwwLjIxNQ0KCWMtMC4wMTEsMC4wNjgtMC4wMywwLjEwMi0wLjA1OCwwLjEyNWMtMC4wMjUsMC4wMjEtMC4wNjEsMC4wMzUtMC4wOTYsMC4wMzVINy4yNjZ6Ii8+DQo8cGF0aCBmaWxsPSIjMTc5QkQ3IiBkPSJNMjMuMDQ4LDcuNjY3TDIzLjA0OCw3LjY2N0wyMy4wNDgsNy42NjdjLTAuMDI4LDAuMTc5LTAuMDYsMC4zNjItMC4wOTYsMC41NQ0KCWMtMS4yMzcsNi4zNTEtNS40NjksOC41NDUtMTAuODc0LDguNTQ1SDkuMzI2Yy0wLjY2MSwwLTEuMjE4LDAuNDgtMS4zMjEsMS4xMzJsMCwwbDAsMEw2LjU5NiwyNi44M2wtMC4zOTksMi41MzMNCgljLTAuMDY3LDAuNDI4LDAuMjYzLDAuODE0LDAuNjk1LDAuODE0aDQuODgxYzAuNTc4LDAsMS4wNjktMC40MiwxLjE2LTAuOTlsMC4wNDgtMC4yNDhsMC45MTktNS44MzJsMC4wNTktMC4zMg0KCWMwLjA5LTAuNTcyLDAuNTgyLTAuOTkyLDEuMTYtMC45OTJoMC43M2M0LjcyOSwwLDguNDMxLTEuOTIsOS41MTMtNy40NzZjMC40NTItMi4zMjEsMC4yMTgtNC4yNTktMC45NzgtNS42MjINCglDMjQuMDIyLDguMjg2LDIzLjU3Myw3Ljk0NSwyMy4wNDgsNy42Njd6Ii8+DQo8cGF0aCBmaWxsPSIjMjIyRDY1IiBkPSJNMjEuNzU0LDcuMTUxYy0wLjE4OS0wLjA1NS0wLjM4NC0wLjEwNS0wLjU4NC0wLjE1Yy0wLjIwMS0wLjA0NC0wLjQwNy0wLjA4My0wLjYxOS0wLjExNw0KCWMtMC43NDItMC4xMi0xLjU1NS0wLjE3Ny0yLjQyNi0wLjE3N2gtNy4zNTJjLTAuMTgxLDAtMC4zNTMsMC4wNDEtMC41MDcsMC4xMTVDOS45MjcsNi45ODUsOS42NzUsNy4zMDYsOS42MTQsNy42OTlMOC4wNSwxNy42MDUNCglsLTAuMDQ1LDAuMjg5YzAuMTAzLTAuNjUyLDAuNjYtMS4xMzIsMS4zMjEtMS4xMzJoMi43NTJjNS40MDUsMCw5LjYzNy0yLjE5NSwxMC44NzQtOC41NDVjMC4wMzctMC4xODgsMC4wNjgtMC4zNzEsMC4wOTYtMC41NQ0KCWMtMC4zMTMtMC4xNjYtMC42NTItMC4zMDgtMS4wMTctMC40MjlDMjEuOTQxLDcuMjA4LDIxLjg0OCw3LjE3OSwyMS43NTQsNy4xNTF6Ii8+DQo8cGF0aCBmaWxsPSIjMjUzQjgwIiBkPSJNOS42MTQsNy42OTljMC4wNjEtMC4zOTMsMC4zMTMtMC43MTQsMC42NTItMC44NzZjMC4xNTUtMC4wNzQsMC4zMjYtMC4xMTUsMC41MDctMC4xMTVoNy4zNTINCgljMC44NzEsMCwxLjY4NCwwLjA1NywyLjQyNiwwLjE3N2MwLjIxMiwwLjAzNCwwLjQxOCwwLjA3MywwLjYxOSwwLjExN2MwLjIsMC4wNDUsMC4zOTUsMC4wOTUsMC41ODQsMC4xNQ0KCWMwLjA5NCwwLjAyOCwwLjE4NywwLjA1NywwLjI3OCwwLjA4NmMwLjM2NSwwLjEyMSwwLjcwNCwwLjI2NCwxLjAxNywwLjQyOWMwLjM2OC0yLjM0Ny0wLjAwMy0zLjk0NS0xLjI3Mi01LjM5Mg0KCUMyMC4zNzgsMC42ODIsMTcuODUzLDAsMTQuNjIyLDBoLTkuMzhjLTAuNjYsMC0xLjIyMywwLjQ4LTEuMzI1LDEuMTMzTDAuMDEsMjUuODk4Yy0wLjA3NywwLjQ5LDAuMzAxLDAuOTMyLDAuNzk1LDAuOTMyaDUuNzkxDQoJbDEuNDU0LTkuMjI1TDkuNjE0LDcuNjk5eiIvPg0KPC9zdmc+DQo=",i.alt="PayPal"}}};var cMt=z(require("obsidian"));var gs;(function(c){c.Bar="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBCYXIKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgLSBhY3Rpb246ICJCcm93c2UgdGhlIHdlYnNpdGUiCiAgICBwdjogNTAwMDAKICAtIGFjdGlvbjogIkFkZCB0byBjYXJ0IgogICAgcHY6IDM1MDAwCiAgLSBhY3Rpb246ICJHZW5lcmF0ZSBvcmRlcnMiCiAgICBwdjogMjUwMDAKICAtIGFjdGlvbjogIlBheSBvcmRlciIKICAgIHB2OiAxNTAwMAogIC0gYWN0aW9uOiAiU2VhbCB0aGUgZGVhbCIKICAgIHB2OiA4NTAwCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHhGaWVsZDogInB2IgogIHlGaWVsZDogImFjdGlvbiIKICBjb252ZXJzaW9uVGFnOiB7fQpgYGA=",c.Pie="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBQaWUKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgLSB0eXBlOiAiV2FnZSBpbmNvbWUgcGVyIGNhcGl0YSAowqUpIgogICAgdmFsdWU6IDE3OTE3CiAgLSB0eXBlOiAiT3BlcmF0aW5nIG5ldCBpbmNvbWUgcGVyIGNhcGl0YSAowqUpIgogICAgdmFsdWU6IDUzMDcKICAtIHR5cGU6ICJQcm9wZXJ0eSBQZXIgQ2FwaXRhIE5ldCBJbmNvbWUgKMKlKSIKICAgIHZhbHVlOiAyNzkxCiAgLSB0eXBlOiAiVHJhbnNmZXIgb2YgbmV0IGluY29tZSBwZXIgY2FwaXRhICjCpSkiCiAgICB2YWx1ZTogNjE3MwoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoKICBhbmdsZUZpZWxkOiAidmFsdWUiCiAgY29sb3JGaWVsZDogInR5cGUiCiAgcmFkaXVzOiAwLjUKICBsYWJlbDoKICAgIHR5cGU6ICJzcGlkZXIiCiAgICBjb250ZW50OiAie3BlcmNlbnRhZ2V9XG57bmFtZX0iCiAgbGVnZW5kOgogICAgbGF5b3V0OiAiaG9yaXpvbnRhbCIKICAgIHBvc2l0aW9uOiAiYm90dG9tIgpgYGA=",c.WordCloud="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBXb3JkQ2xvdWQKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgLSB4OiAiQ2hpbmEiCiAgICB2YWx1ZTogMjM4MzIyMDAwMAogICAgY2F0ZWdvcnk6ICJhc2lhIgogIC0geDogIkluZG9uZXNpYSIKICAgIHZhbHVlOiAyNjM1MTAwMDAKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJQYWtpc3RhbiIKICAgIHZhbHVlOiAzOTY0NTkwMDAKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJSdXNzaWEiCiAgICB2YWx1ZTogNTQ2ODA0MzcyCiAgICBjYXRlZ29yeTogImV1cm9wZSIKICAtIHg6ICJKYXBhbiIKICAgIHZhbHVlOiAxMjY3OTAwMDAKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJWaWV0bmFtIgogICAgdmFsdWU6IDkyNzAwMDAwCiAgICBjYXRlZ29yeTogImFzaWEiCiAgLSB4OiAiR2VybWFueSIKICAgIHZhbHVlOiA4MjgwMDAwMAogICAgY2F0ZWdvcnk6ICJldXJvcGUiCiAgLSB4OiAiSXJhbiIKICAgIHZhbHVlOiA4MDEzNTQwMAogICAgY2F0ZWdvcnk6ICJhc2lhIgogIC0geDogIlRoYWlsYW5kIgogICAgdmFsdWU6IDY4Mjk4MDAwCiAgICBjYXRlZ29yeTogImFzaWEiCiAgLSB4OiAiRnJhbmNlIgogICAgdmFsdWU6IDY3MDEzMDAwCiAgICBjYXRlZ29yeTogImV1cm9wZSIKICAtIHg6ICJJdGFseSIKICAgIHZhbHVlOiA2MDU5OTkzNgogICAgY2F0ZWdvcnk6ICJldXJvcGUiCiAgLSB4OiAiU291dGggS29yZWEiCiAgICB2YWx1ZTogNTE0NDYyMDEKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJLZW55YSIKICAgIHZhbHVlOiA0ODQ2NzAwMAogICAgY2F0ZWdvcnk6ICJhZnJpY2EiCiAgLSB4OiAiU3BhaW4iCiAgICB2YWx1ZTogNDY4MTIwMDAKICAgIGNhdGVnb3J5OiAiZXVyb3BlIgogIC0geDogIlN1ZGFuIgogICAgdmFsdWU6IDQyMTc2MDAwCiAgICBjYXRlZ29yeTogImFmcmljYSIKICAtIHg6ICJJcmFxIgogICAgdmFsdWU6IDQ3ODgzNTQzCiAgICBjYXRlZ29yeTogImFzaWEiCiAgLSB4OiAiTmVwYWwiCiAgICB2YWx1ZTogMjg4MjU3MDkKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJOb3J0aCBLb3JlYSIKICAgIHZhbHVlOiAyNDIxMzUxMAogICAgY2F0ZWdvcnk6ICJhc2lhIgogIC0geDogIkNoaWxlIgogICAgdmFsdWU6IDI4MTkxOTAwCiAgICBjYXRlZ29yeTogImFtZXJpY2EiCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHdvcmRGaWVsZDogIngiCiAgd2VpZ2h0RmllbGQ6ICJ2YWx1ZSIKICBjb2xvcjogIiMxMjJjNmEiCiAgd29yZFN0eWxlOgogICAgZm9udEZhbWlseTogIlZlcmRhbmEiCiAgICBmb250U2l6ZTogWzI0LCA4MF0KICBpbnRlcmFjdGlvbnM6CiAgICB0eXBlOiAiZWxlbWVudC1hY3RpdmUiCiAgc3R5bGU6CiAgICBiYWNrZ3JvdW5kQ29sb3I6ICJ3aGl0ZSIKICBzdGF0ZToKICAgIGFjdGl2ZToKICAgICAgc3R5bGU6CiAgICAgICAgbGluZVdpZHRoOiAzCmBgYA==",c.WordCount="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBXb3JkQ2xvdWQKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6ICJ3b3JkY291bnQ6bm90ZS1uYW1lLWhlcmUtd2l0aG91dC1mb2xkLXBhdGgiCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHdvcmRGaWVsZDogIndvcmQiCiAgd2VpZ2h0RmllbGQ6ICJjb3VudCIKICBjb2xvckZpZWxkOiAiY291bnQiCiAgd29yZFN0eWxlOgogICAgcm90YXRpb246IDMwCmBgYA==",c.Treemap="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBUcmVlbWFwCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IGRhdGEgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpkYXRhOgogIG5hbWU6ICdyb290JwogIGNoaWxkcmVuOgogICAgLSBuYW1lOiAnRm9sZGVyIDEnCiAgICAgIHZhbHVlOiA1NjAKICAgIC0gbmFtZTogJ0ZvbGRlciAyJwogICAgICB2YWx1ZTogNTAwCiAgICAtIG5hbWU6ICdGb2xkZXIgMycKICAgICAgdmFsdWU6IDE1MAogICAgLSBuYW1lOiAnRm9sZGVyIDQnCiAgICAgIHZhbHVlOiAxNDAKICAgIC0gbmFtZTogJ0ZvbGRlciA1JwogICAgICB2YWx1ZTogMTE1CiAgICAtIG5hbWU6ICdGb2xkZXIgNicKICAgICAgdmFsdWU6IDk1CiAgICAtIG5hbWU6ICdGb2xkZXIgNycKICAgICAgdmFsdWU6IDkwCiAgICAtIG5hbWU6ICdGb2xkZXIgOCcKICAgICAgdmFsdWU6IDc1CiAgICAtIG5hbWU6ICdGb2xkZXIgOScKICAgICAgdmFsdWU6IDk4CiAgICAtIG5hbWU6ICdGb2xkZXIgMTAnCiAgICAgIHZhbHVlOiA2MAogICAgLSBuYW1lOiAnRm9sZGVyIDExJwogICAgICB2YWx1ZTogNDUKICAgIC0gbmFtZTogJ0ZvbGRlciAxMicKICAgICAgdmFsdWU6IDQwCiAgICAtIG5hbWU6ICdGb2xkZXIgMTMnCiAgICAgIHZhbHVlOiA0MAogICAgLSBuYW1lOiAnRm9sZGVyIDE0JwogICAgICB2YWx1ZTogMzUKICAgIC0gbmFtZTogJ0ZvbGRlciAxNScKICAgICAgdmFsdWU6IDQwCiAgICAtIG5hbWU6ICdGb2xkZXIgMTYnCiAgICAgIHZhbHVlOiA0MAogICAgLSBuYW1lOiAnRm9sZGVyIDE3JwogICAgICB2YWx1ZTogNDAKICAgIC0gbmFtZTogJ0ZvbGRlciAxOCcKICAgICAgdmFsdWU6IDMwCiAgICAtIG5hbWU6ICdGb2xkZXIgMTknCiAgICAgIHZhbHVlOiAyOAogICAgLSBuYW1lOiAnRm9sZGVyIDIwJwogICAgICB2YWx1ZTogMTYKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgb3B0aW9ucyAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCm9wdGlvbnM6CiAgY29sb3JGaWVsZDogIm5hbWUiCmBgYAo=",c.DualAxes="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBEdWFsQXhlcwoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBkYXRhICAgIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKZGF0YToKICAtCiAgICAtIHRpbWU6ICIyMDE5LTAzIgogICAgICB2YWx1ZTogMzUwCiAgICAgIGNvdW50OiA4MDAKICAgIC0gdGltZTogIjIwMTktMDQiCiAgICAgIHZhbHVlOiA5MDAKICAgICAgY291bnQ6IDYwMAogICAgLSB0aW1lOiAiMjAxOS0wNSIKICAgICAgdmFsdWU6IDMwMAogICAgICBjb3VudDogNDAwCiAgICAtIHRpbWU6ICIyMDE5LTA2IgogICAgICB2YWx1ZTogNDUwCiAgICAgIGNvdW50OiAzODAKICAgIC0gdGltZTogIjIwMTktMDciCiAgICAgIHZhbHVlOiA0NzAKICAgICAgY291bnQ6IDIyCiAgLQogICAgLSB0aW1lOiAiMjAxOS0wMyIKICAgICAgdmFsdWU6IDM1MAogICAgICBjb3VudDogODAwCiAgICAtIHRpbWU6ICIyMDE5LTA0IgogICAgICB2YWx1ZTogOTAwCiAgICAgIGNvdW50OiA2MDAKICAgIC0gdGltZTogIjIwMTktMDUiCiAgICAgIHZhbHVlOiAzMDAKICAgICAgY291bnQ6IDQwMAogICAgLSB0aW1lOiAiMjAxOS0wNiIKICAgICAgdmFsdWU6IDQ1MAogICAgICBjb3VudDogMzgwCiAgICAtIHRpbWU6ICIyMDE5LTA3IgogICAgICB2YWx1ZTogNDcwCiAgICAgIGNvdW50OiAyMgoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoKICB4RmllbGQ6ICd0aW1lJwogIHlGaWVsZDogWyd2YWx1ZScsICdjb3VudCddCiAgeUF4aXM6CiAgICB2YWx1ZToKICAgICAgbWluOiAwCiAgICAgIGxhYmVsOgogICAgICAgIGZvcm1hdHRlcjoKICAgICAgICAgIGZ1bmN0aW9uIGZvcm1hdHRlcih2YWwpIHsKICAgICAgICAgICAgcmV0dXJuICcnLmNvbmNhdCh2YWwsICfkuKonKTsKICAgICAgICAgIH0KICBnZW9tZXRyeU9wdGlvbnM6CiAgICAtIGdlb21ldHJ5OiAnY29sdW1uJwogICAgLSBnZW9tZXRyeTogJ2xpbmUnCiAgICAgIGxpbmVTdHlsZToKICAgICAgICBsaW5lV2lkdGg6IDIKYGBg",c.Mix="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBNaXgKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGEuYXJlYToKICAtIHRpbWU6IDEyNDY0MDY0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTQuMywgMjcuN10KICAtIHRpbWU6IDEyNDY0OTI4MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTQuNSwgMjcuOF0KICAtIHRpbWU6IDEyNDY1NzkyMDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTUuNSwgMjkuNl0KICAtIHRpbWU6IDEyNDY2NjU2MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTYuNywgMzAuN10KICAtIHRpbWU6IDEyNDY3NTIwMDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTYuNSwgMjUuMF0KICAtIHRpbWU6IDEyNDY4Mzg0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTcuOCwgMjUuN10KCmRhdGEubGluZToKICAtIHRpbWU6IDEyNDY0MDY0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiAyMS41CiAgLSB0aW1lOiAxMjQ2NDkyODAwMDAwCiAgICB0ZW1wZXJhdHVyZTogMjIuMQogIC0gdGltZTogMTI0NjU3OTIwMDAwMAogICAgdGVtcGVyYXR1cmU6IDIzCiAgLSB0aW1lOiAxMjQ2NjY1NjAwMDAwCiAgICB0ZW1wZXJhdHVyZTogMjMuOAogIC0gdGltZTogMTI0Njc1MjAwMDAwMAogICAgdGVtcGVyYXR1cmU6IDIxLjQKICAtIHRpbWU6IDEyNDY4Mzg0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiAyMS4zCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIGFwcGVuZFBhZGRpbmc6IDgKICBzeW5jVmlld1BhZGRpbmc6IHRydWUKICB0b29sdGlwOgogICAgc2hhcmVkOiB0cnVlCiAgICBzaG93TWFya2VyczogZmFsc2UKICAgIHNob3dDcm9zc2hhaXJzOiB0cnVlCiAgICBvZmZzZXRZOiAtNTAKCm9wdGlvbnMuYXJlYToKICBheGVzOiB7fQogIG1ldGE6CiAgICB0aW1lOgogICAgICB0eXBlOiAndGltZScKICAgICAgbWFzazogJ01NLUREJwogICAgICBuaWNlOiB0cnVlCiAgICAgIHRpY2tJbnRlcnZhbDogMTcyODAwMDAwCiAgICAgIHJhbmdlOiBbMCwgMV0KICAgIHRlbXBlcmF0dXJlOgogICAgICBuaWNlOiB0cnVlCiAgICAgIHN5bmM6IHRydWUKICAgICAgYWxpYXM6ICfmuKnluqbojIPlm7QnCiAgZ2VvbWV0cmllczoKICAgIC0gdHlwZTogJ2FyZWEnCiAgICAgIHhGaWVsZDogJ3RpbWUnCiAgICAgIHlGaWVsZDogJ3RlbXBlcmF0dXJlJwogICAgICBtYXBwaW5nOiB7fQoKb3B0aW9ucy5saW5lOgogIGF4ZXM6IGZhbHNlCiAgbWV0YToKICAgIHRpbWU6CiAgICAgIHR5cGU6ICd0aW1lJwogICAgICBtYXNrOiAnTU0tREQnCiAgICAgIG5pY2U6IHRydWUKICAgICAgdGlja0ludGVydmFsOiAxNzI4MDAwMDAKICAgICAgcmFuZ2U6IFswLCAxXQogICAgdGVtcGVyYXR1cmU6CiAgICAgIHN5bmM6ICd0ZW1wZXJhdHVyZScKICAgICAgYWxpYXM6ICfmuKnluqYnCiAgZ2VvbWV0cmllczoKICAgIC0gdHlwZTogJ2xpbmUnCiAgICAgIHhGaWVsZDogJ3RpbWUnCiAgICAgIHlGaWVsZDogJ3RlbXBlcmF0dXJlJwogICAgICBtYXBwaW5nOiB7fQogICAgLSB0eXBlOiAncG9pbnQnCiAgICAgIHhGaWVsZDogJ3RpbWUnCiAgICAgIHlGaWVsZDogJ3RlbXBlcmF0dXJlJwogICAgICBtYXBwaW5nOgogICAgICAgIHNoYXBlOiAnY2lyY2xlJwogICAgICAgIHN0eWxlOgogICAgICAgICAgZmlsbE9wYWNpdHk6IDEKYGBg",c.OrganizationTreeGraph="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBPcmdhbml6YXRpb25UcmVlR3JhcGgKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgaWQ6ICJyb290IgogIGxhYmVsOiAiUm9vdCIKICBjaGlsZHJlbjoKICAgIC0gaWQ6ICJjMSIKICAgICAgbGFiZWw6ICJDMSIKICAgICAgY2hpbGRyZW46CiAgICAgICAgLSBpZDogImMxLTEiCiAgICAgICAgICBsYWJlbDogIkMxLTEiCiAgICAgICAgICBjaGlsZHJlbjoKICAgICAgICAgICAgLSBpZDogImMxLTEtMSIKICAgICAgICAgICAgICBsYWJlbDogIkMxLTEtMSIKICAgICAgICAgICAgLSBpZDogImMxLTEtMiIKICAgICAgICAgICAgICBsYWJlbDogIkMxLTEtMiIKICAgICAgICAtIGlkOiAiYzEtMiIKICAgICAgICAgIGxhYmVsOiAiQzEtMiIKICAgICAgICAgIGNoaWxkcmVuOgogICAgICAgICAgICAtIGlkOiAiYzEtMi0xIgogICAgICAgICAgICAgIGxhYmVsOiAiQzEtMi0xIgogICAgICAgICAgICAtIGlkOiAiYzEtMi0yIgogICAgICAgICAgICAgIGxhYmVsOiAiQzEtMi0yIgogICAgLSBpZDogImMyIgogICAgICBsYWJlbDogIkMyIgogICAgICBjaGlsZHJlbjoKICAgICAgICAtIGlkOiAiYzItMSIKICAgICAgICAgIGxhYmVsOiAiQzItMSIKICAgICAgICAgIGNoaWxkcmVuOgogICAgICAgICAgICAtIGlkOiAiYzItMS0xIgogICAgICAgICAgICAgIGxhYmVsOiAiQzItMS0xIgoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoge30KYGBg",c.Radar="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBSYWRhcgoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBkYXRhICAgIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKZGF0YToKICAtIGl0ZW06ICJEZXNpZ24iCiAgICB1c2VyOiAiYSIKICAgIHNjb3JlOiA3MAogIC0gaXRlbTogIkRlc2lnbiIKICAgIHVzZXI6ICJiIgogICAgc2NvcmU6IDMwCiAgLSBpdGVtOiAiTWFya2V0aW5nIgogICAgdXNlcjogImEiCiAgICBzY29yZTogNTAKICAtIGl0ZW06ICJNYXJrZXRpbmciCiAgICB1c2VyOiAiYiIKICAgIHNjb3JlOiA2MAogIC0gaXRlbTogIlRlY2hub2xvZ3kiCiAgICB1c2VyOiAiYSIKICAgIHNjb3JlOiA1MAogIC0gaXRlbTogIlRlY2hub2xvZ3kiCiAgICB1c2VyOiAiYiIKICAgIHNjb3JlOiA0MAogIC0gaXRlbTogIlN1cHBvcnQiCiAgICB1c2VyOiAiYSIKICAgIHNjb3JlOiAzMAogIC0gaXRlbTogIlN1cHBvcnQiCiAgICB1c2VyOiAiYiIKICAgIHNjb3JlOiA0MAogIC0gaXRlbTogIlNhbGVzIgogICAgdXNlcjogImEiCiAgICBzY29yZTogNjAKICAtIGl0ZW06ICJTYWxlcyIKICAgIHVzZXI6ICJiIgogICAgc2NvcmU6IDQwCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHhGaWVsZDogIml0ZW0iCiAgeUZpZWxkOiAic2NvcmUiCiAgc2VyaWVzRmllbGQ6ICJ1c2VyIgogIG1ldGE6CiAgICBzY29yZToKICAgICAgYWxpYXM6ICJTY29yZSIKICAgICAgbWluOiAwCiAgICAgIG5pY2U6IHRydWUKICB4QXhpczoKICAgIGxpbmU6IG51bGwKICAgIHRpY2tMaW5lOiBudWxsCiAgeUF4aXM6CiAgICBsYWJlbDogZmFsc2UKICAgIGdyaWQ6CiAgICAgIGFsdGVybmF0ZUNvbG9yOiAicmdiYSgwLCAwLCAwLCAwLjA0KSIKICBwb2ludDoge30KICBhcmVhOiB7fQpgYGA=",c.TinyLine="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBUaW55TGluZQoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBkYXRhICAgIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKZGF0YTogWzI2NCwgNDE3LCA0MzgsIDg4NywgMzA5LCAzOTcsIDU1MCwgNTc1LCA1NjMsIDQzMCwgNTI1LCA1OTIsIDQ5MiwgNDY3LCA1MTMsIDU0NiwgOTgzLCAzNDAsIDUzOSwgMjQzLCAyMjYsIDE5Ml0KCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgb3B0aW9ucyAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCm9wdGlvbnM6CiAgaGVpZ2h0OiA2MAogIGF1dG9GaXQ6IGZhbHNlCiAgc21vb3RoOiB0cnVlCiAgdG9vbHRpcDogZmFsc2UKICBhbm5vdGF0aW9uczoKICAgIC0gdHlwZTogImxpbmUiCiAgICAgIHN0YXJ0OiBbIm1pbiIsICJtZWFuIl0KICAgICAgZW5kOiBbIm1heCIsICJtZWFuIl0KICAgICAgc3R5bGU6CiAgICAgICAgc3Ryb2tlOiAicmdiYSgwLCAwLCAwLCAwLjQ1KSIKICAgICAgdGV4dDoKICAgICAgICBjb250ZW50OiAiQXZlcmFnZSIKICAgICAgICBvZmZzZXRZOiAtMgogICAgICAgIHN0eWxlOgogICAgICAgICAgdGV4dEFsaWduOiAibGVmdCIKICAgICAgICAgIGZvbnRTaXplOiAxMAogICAgICAgICAgZmlsbDogInJnYmEoNDQsIDUzLCA2NiwgMC40NSkiCiAgICAgICAgICB0ZXh0QmFzZWxpbmU6ICJib3R0b20iCiAgICAtIHR5cGU6ICJsaW5lIgogICAgICBzdGFydDogWyJtaW4iLCA4MDBdCiAgICAgIGVuZDogWyJtYXgiLCA4MDBdCiAgICAgIHN0eWxlOgogICAgICAgIHN0cm9rZTogInJnYmEoMjAwLCAwLCAwLCAwLjU1KSIKICAgICAgdGV4dDoKICAgICAgICBjb250ZW50OiAiVGFyZ2V0IgogICAgICAgIG9mZnNldFk6IC0yCiAgICAgICAgc3R5bGU6CiAgICAgICAgICB0ZXh0QWxpZ246ICJsZWZ0IgogICAgICAgICAgZm9udFNpemU6IDEwCiAgICAgICAgICBmaWxsOiAicmdiYSg0NCwgNTMsIDY2LCAwLjQ1KSIKICAgICAgICAgIHRleHRCYXNlbGluZTogImJvdHRvbSIKYGBg",c.Scatter="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBTY2F0dGVyCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IGRhdGEgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpkYXRhOgogIC0gbGFiZWw6ICIxOTUxIgogICAgdmFsdWU6IDM4CiAgLSBsYWJlbDogIjE5NTIiCiAgICB2YWx1ZTogNTIKICAtIGxhYmVsOiAiMTk1NiIKICAgIHZhbHVlOiA2MQogIC0gbGFiZWw6ICIxOTU3IgogICAgdmFsdWU6IDE0NQogIC0gbGFiZWw6ICIxOTU4IgogICAgdmFsdWU6IDQ4CgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHhGaWVsZDogbGFiZWwKICB5RmllbGQ6IHZhbHVlCiAgY29sb3JGaWVsZDogbGFiZWwKICBzaGFwZTogY2lyY2xlCmBgYA==",c["Dataviewjs Example (Column)"]="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBDb2x1bW4KCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6IHwKICBkYXRhdmlld2pzOgogIHJldHVybiBkdi5wYWdlcygpCiAgICAgICAgICAgLmdyb3VwQnkocCA9PiBwLmZpbGUuZm9sZGVyKQogICAgICAgICAgIC5tYXAocCA9PiAoe2ZvbGRlcjogcC5rZXkgfHwgIlJPT1QiLCBjb3VudDogcC5yb3dzLmxlbmd0aH0pKQogICAgICAgICAgIC5hcnJheSgpOwoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoKICB4RmllbGQ6ICJmb2xkZXIiCiAgeUZpZWxkOiAiY291bnQiCiAgcGFkZGluZzogYXV0bwogIGxhYmVsOgogICAgcG9zaXRpb246ICJtaWRkbGUiCiAgICBzdHlsZToKICAgICAgb3BhY2l0eTogMC42CiAgICAgIGZvbnRTaXplOiAxMgogIGNvbHVtblN0eWxlOgogICAgZmlsbE9wYWNpdHk6IDAuNQogICAgbGluZVdpZHRoOiAxCiAgICBzdHJva2VPcGFjaXR5OiAwLjcKICAgIHNoYWRvd0NvbG9yOiAiZ3JleSIKICAgIHNoYWRvd0JsdXI6IDEwCiAgICBzaGFkb3dPZmZzZXRYOiA1CiAgICBzaGFkb3dPZmZzZXRZOiA1CiAgeEF4aXM6CiAgICBsYWJlbDoKICAgICAgYXV0b0hpZGU6IGZhbHNlCiAgICAgIGF1dG9Sb3RhdGU6IHRydWUKICBtZXRhOgogICAgY291bnQ6CiAgICAgIGFsaWFzOiAiQ291bnQiCmBgYA=="})(gs||(gs={}));var fMt={[gs.Bar]:"https://user-images.githubusercontent.com/150803/123117024-fa43b180-d473-11eb-84eb-8e1806ce5dec.png",[gs.Pie]:"https://user-images.githubusercontent.com/150803/119069882-87c95700-ba19-11eb-8cef-02d1e021d1a2.png",[gs.WordCloud]:"https://user-images.githubusercontent.com/150803/119069991-bba47c80-ba19-11eb-873f-847563daea39.png",[gs.WordCount]:"https://user-images.githubusercontent.com/150803/136478725-be28a56b-0075-4f0a-a719-f61b30e83b6a.png",[gs.Treemap]:"https://user-images.githubusercontent.com/150803/119070047-decf2c00-ba19-11eb-9d59-21c051da593c.png",[gs.DualAxes]:"https://user-images.githubusercontent.com/150803/119969638-618b5480-bfe1-11eb-8a36-0a5d60408b00.png",[gs.Mix]:"https://user-images.githubusercontent.com/150803/120421841-a1638a80-c399-11eb-9464-d773931fdd6f.png",[gs.OrganizationTreeGraph]:"https://user-images.githubusercontent.com/150803/123117254-2b23e680-d474-11eb-845f-0d663a458fa7.png",[gs.Radar]:"https://user-images.githubusercontent.com/150803/123117394-4a227880-d474-11eb-8a11-23f3cd482251.png",[gs.TinyLine]:"https://user-images.githubusercontent.com/150803/123117476-5a3a5800-d474-11eb-9db8-4b3785bb010c.png",[gs.Scatter]:"https://user-images.githubusercontent.com/150803/237452588-8ce11128-b911-4fa4-b9e0-3f5e07543d67.png",[gs["Dataviewjs Example (Column)"]]:"https://user-images.githubusercontent.com/150803/140684190-fa6a08ea-3394-44fe-ae92-265810f6b9a9.png"};var hMt=z(require("buffer")),t9=class extends cMt.FuzzySuggestModal{constructor(e,t){super(e);this.editor=t}getItems(){return Object.entries(gs)}getItemText(e){return e[0]}renderSuggestion(e,t){let n=createDiv({cls:"chartsview-thumbnail"}),i=gs[e.item[0]],a=createEl("img",{attr:{src:fMt[i]}});n.appendChild(a),t.appendChild(n),t.addClass("chartsview-thumbnail-container"),super.renderSuggestion(e,t)}onChooseItem(e){oC(this.editor,hMt.Buffer.from(e[1],"base64").toString("utf8"))}};var If=z(require("obsidian"));var sC={labelsFieldKey:"xField",valuesFieldKey:"yField",seriesFieldKey:"seriesField",labels:{field:"label",value:["1951","1952","1956","1957","1958"]},values:[{field:"value",value:["38","52","61","145","48"]}],series:{field:"serie"}},e9=80,r9=14,Yme="Area",Xme={"1":"1","2":"2","3":"3","4":"4","5":"5","6":"6"},qme={Area:"Area",Bar:"Bar",Box:"Box",Chord:"Chord",Column:"Column",Funnel:"Funnel",Heatmap:"Heatmap",Histogram:"Histogram",Line:"Line",Pie:"Pie",Radar:"Radar",RadialBar:"RadialBar",Rose:"Rose",Sankey:"Sankey",Stock:"Stock",Violin:"Violin",Waterfall:"Waterfall",WordCloud:"WordCloud",Scatter:"Scatter"},lC={Bar:{labelsFieldKey:"yField",valuesFieldKey:"xField",seriesFieldKey:"seriesField"},Chord:{labelsFieldKey:"sourceField",valuesFieldKey:"weightField",seriesFieldKey:"targetField"},Sankey:{labelsFieldKey:"sourceField",valuesFieldKey:"weightField",seriesFieldKey:"targetField"},Heatmap:{labelsFieldKey:"xField",valuesFieldKey:"colorField",seriesFieldKey:""},Histogram:{labelsFieldKey:"xField",valuesFieldKey:"binField",seriesFieldKey:""},WordCloud:{labelsFieldKey:"wordField",valuesFieldKey:"weightField",seriesFieldKey:""},Pie:{labelsFieldKey:"colorField",valuesFieldKey:"angleField",seriesFieldKey:""}},n9=class extends If.Modal{constructor(e,t,n){super(e);this.editor=t;this.settings=n}onOpen(){var e,t,n;this.modalEl.style.width="860px",this.titleEl.createEl("h2",{text:"Chart Wizard"}),this.chartSetting={type:Yme,config:{}},this.dataLabels=((e=lC[this.chartSetting.type])!=null?e:sC).labels,this.dataValues=((t=lC[this.chartSetting.type])!=null?t:sC).values,this.dataSeries=((n=lC[this.chartSetting.type])!=null?n:sC).series,this.valueNumber=1,this.displayContent(),this.addConfirmButton()}displayContent(){this.contentEl.empty(),this.createSetting(),this.chartEl=this.contentEl.createDiv(),this.renderChart()}createSetting(){new If.Setting(this.contentEl).setName("Chart Type").addDropdown(e=>e.addOptions(qme).setValue(this.chartSetting.type).onChange(t=>{this.chartSetting.type=t,this.renderChart()})),new If.Setting(this.contentEl).setName("Value Number").addDropdown(e=>e.addOptions(Xme).setValue(`${this.valueNumber}`).onChange(t=>{this.valueNumber=+t,this.displayContent()}));for(let e=0;e{var n,i;t.inputEl.size=r9,t.setPlaceholder("Input field name").setValue((i=(n=this.dataValues[e])==null?void 0:n.field)!=null?i:void 0).onChange(a=>{this.dataValues[e]===void 0&&(this.dataValues[e]={}),this.dataValues[e].field=a,this.renderChart()})}).addText(t=>{var n,i;t.inputEl.size=e9,t.setPlaceholder("value1, value2, value3, ...").setValue(((n=this.dataValues[e])==null?void 0:n.value)&&((i=this.dataValues[e])==null?void 0:i.value.join(","))).onChange(a=>{this.dataValues[e]===void 0&&(this.dataValues[e]={}),this.dataValues[e].value=a.length===0?void 0:a.split(","),this.renderChart()})});new If.Setting(this.contentEl).setName("Labels").addText(e=>{e.inputEl.size=r9,e.setPlaceholder("Input field name").setValue(this.dataLabels.field).onChange(t=>{this.dataLabels.field=t,this.renderChart()})}).addText(e=>{e.inputEl.size=e9,e.setPlaceholder("value1, value2, value3, ...").setValue(this.dataLabels.value&&this.dataLabels.value.join(",")).onChange(t=>{this.dataLabels.value=t.length===0?void 0:t.split(","),this.renderChart()})}),new If.Setting(this.contentEl).setName("Series").addText(e=>{e.inputEl.size=r9,e.setPlaceholder("Input field name").setValue(this.dataSeries.field).onChange(t=>{this.dataSeries.field=t,this.renderChart()})}).addText(e=>{e.inputEl.size=e9,e.setPlaceholder("value1, value2, value3, ...").setValue(this.dataSeries.value&&this.dataSeries.value.join(",")).onChange(t=>{this.dataSeries.value=t.length===0?void 0:t.split(","),this.renderChart()})})}renderChart(){var e,t,n,i,a,o,s;this.dataSeries.field=(e=this.dataSeries.field)!=null?e:"serie",this.dataLabels.field=(t=this.dataLabels.field)!=null?t:"label",this.dataValues[0].field=(n=this.dataValues[0].field)!=null?n:"value",this.chartSetting.config={},this.isNotEmpty(this.dataSeries.value)&&(this.chartSetting.config[((i=lC[this.chartSetting.type])!=null?i:sC).seriesFieldKey]=this.dataSeries.field),this.isNotEmpty(this.dataLabels.value)&&(this.chartSetting.config[((a=lC[this.chartSetting.type])!=null?a:sC).labelsFieldKey]=this.dataLabels.field),this.isNotEmpty(this.dataValues)&&(this.chartSetting.config[((o=lC[this.chartSetting.type])!=null?o:sC).valuesFieldKey]=this.valueNumber===1?this.dataValues[0].field:this.dataValues.map(l=>l.field)),this.chartSetting.config.data=((s=this.dataLabels.value)!=null?s:[]).map((l,u)=>{var h,d;let f={};f[this.dataLabels.field]=l;for(let p=0;pe.setClass("mod-cta").setButtonText("Insert Yaml!").onClick(t=>{oC(this.editor,this.genYaml()),this.close()}))}genYaml(){let e=this.chartSetting.type,t={data:this.chartSetting.config.data},n={options:wl({},this.chartSetting.config)};return delete n.options.data,`\`\`\`chartsview #-----------------# #- chart type -# #-----------------# type: ${e} #-----------------# #- chart data -# #-----------------# ${(0,If.stringifyYaml)(t)} #-----------------# #- chart options -# #-----------------# ${(0,If.stringifyYaml)(n)}\`\`\` `}isNotEmpty(e){return e!==void 0&&e.length>0}onClose(){P3(this.chartEl),this.contentEl.empty()}};var dMt="csv",Kme="csv",i9=class extends kF.Plugin{ChartsViewProcessor(e,t,n){return xa(this,null,function*(){ht.unmountComponentAtNode(t);try{let i=yield aMt(e,this,n.sourcePath);ht.render(ht.createElement(IF,wl({},i)),t)}catch(i){ht.render(ht.createElement("div",{style:{color:"var(--text-title-h1)"}},i.toString()),t)}})}onload(){return xa(this,null,function*(){try{yield this.loadSettings(),this.addSettingTab(new JX(this.app,this)),this.registerMarkdownCodeBlockProcessor("chartsview",this.ChartsViewProcessor.bind(this)),this.addCommand({id:"insert-chartsview-template",name:"Insert Template",editorCallback:e=>{new t9(this.app,e).open()}}),this.addCommand({id:"chartsview-wizard",name:"Wizard",editorCallback:e=>xa(this,null,function*(){new n9(this.app,e,this.settings).open()})}),kF.Platform.isDesktopApp&&this.addCommand({id:"import-chartsview-data-csv",name:"Import data from external CSV file",editorCallback:e=>xa(this,null,function*(){let n=yield(yield U9({accept:".csv",strict:!0})).text(),i=OF(n);oC(e,V7.dump(i,{quotingType:'"',noRefs:!0}).replace(/\n/g,` `+" ".repeat(e.getCursor().ch)))})})}catch(e){console.log(`Load error. ${e}`)}try{this.registerExtensions([dMt],Kme)}catch(e){console.log(`Existing file extension ${dMt}`)}console.log("Loaded Charts View plugin")})}onunload(){console.log("Unloading Charts View plugin")}loadSettings(){return xa(this,null,function*(){this.settings=Object.assign(uMt,yield this.loadData())})}saveSettings(){return xa(this,null,function*(){yield this.saveData(this.settings)})}}; /* @license Papa Parse v5.3.1 https://github.com/mholt/PapaParse License: MIT */ /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */