18 lines
147 KiB
JavaScript
18 lines
147 KiB
JavaScript
import{v as Gi}from"./MainStructChart-3a320821.js";import"./QTooltip-5ceb1b84.js";import"./index-3a2b6cd5.js";import"./position-engine-4e9b318c.js";import"./selection-8094913b.js";import"./QBreadcrumbs-8582ad34.js";import"./app.config-a8647d06.js";import"./index-932e35b0.js";import"./mixin-183f301b.js";import"./QSpinnerCube-b3e27bc1.js";var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xe=function(i){return i&&i.Math==Math&&i},U=Xe(typeof globalThis=="object"&&globalThis)||Xe(typeof window=="object"&&window)||Xe(typeof self=="object"&&self)||Xe(typeof pr=="object"&&pr)||function(){return this}()||Function("return this")(),ue={},D=function(i){try{return!!i()}catch{return!0}},Nh=D,ft=!Nh(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Mh=D,Sr=!Mh(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),Vh=Sr,Ye=Function.prototype.call,G=Vh?Ye.bind(Ye):function(){return Ye.apply(Ye,arguments)},Do={},jo={}.propertyIsEnumerable,Fo=Object.getOwnPropertyDescriptor,Rh=Fo&&!jo.call({1:2},1);Do.f=Rh?function(i){var t=Fo(this,i);return!!t&&t.enumerable}:jo;var Tr=function(i,t){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:t}},zo=Sr,Bo=Function.prototype,qi=Bo.call,kh=zo&&Bo.bind.bind(qi,qi),j=zo?kh:function(i){return function(){return qi.apply(i,arguments)}},Ho=j,Ih=Ho({}.toString),_h=Ho("".slice),Bt=function(i){return _h(Ih(i),8,-1)},Lh=j,Dh=D,jh=Bt,ti=Object,Fh=Lh("".split),Uo=Dh(function(){return!ti("z").propertyIsEnumerable(0)})?function(i){return jh(i)=="String"?Fh(i,""):ti(i)}:ti,Ht=function(i){return i==null},zh=Ht,Bh=TypeError,pt=function(i){if(zh(i))throw Bh("Can't call method on "+i);return i},Hh=Uo,Uh=pt,Ee=function(i){return Hh(Uh(i))},Wi=typeof document=="object"&&document.all,Xh=typeof Wi>"u"&&Wi!==void 0,Xo={all:Wi,IS_HTMLDDA:Xh},Yo=Xo,Yh=Yo.all,_=Yo.IS_HTMLDDA?function(i){return typeof i=="function"||i===Yh}:function(i){return typeof i=="function"},xa=_,Go=Xo,Gh=Go.all,wt=Go.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:xa(i)||i===Gh}:function(i){return typeof i=="object"?i!==null:xa(i)},ei=U,qh=_,Wh=function(i){return qh(i)?i:void 0},Ut=function(i,t){return arguments.length<2?Wh(ei[i]):ei[i]&&ei[i][t]},Qh=j,Or=Qh({}.isPrototypeOf),Ar=typeof navigator<"u"&&String(navigator.userAgent)||"",qo=U,ri=Ar,ba=qo.process,wa=qo.Deno,Sa=ba&&ba.versions||wa&&wa.version,Ta=Sa&&Sa.v8,ut,dr;Ta&&(ut=Ta.split("."),dr=ut[0]>0&&ut[0]<4?1:+(ut[0]+ut[1]));!dr&&ri&&(ut=ri.match(/Edge\/(\d+)/),(!ut||ut[1]>=74)&&(ut=ri.match(/Chrome\/(\d+)/),ut&&(dr=+ut[1])));var Cn=dr,Oa=Cn,$h=D,Wo=!!Object.getOwnPropertySymbols&&!$h(function(){var i=Symbol();return!String(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Oa&&Oa<41}),Zh=Wo,Qo=Zh&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Kh=Ut,Jh=_,tl=Or,el=Qo,rl=Object,$o=el?function(i){return typeof i=="symbol"}:function(i){var t=Kh("Symbol");return Jh(t)&&tl(t.prototype,rl(i))},il=String,Cr=function(i){try{return il(i)}catch{return"Object"}},nl=_,al=Cr,sl=TypeError,St=function(i){if(nl(i))return i;throw sl(al(i)+" is not a function")},ol=St,ul=Ht,he=function(i,t){var e=i[t];return ul(e)?void 0:ol(e)},ii=G,ni=_,ai=wt,hl=TypeError,ll=function(i,t){var e,r;if(t==="string"&&ni(e=i.toString)&&!ai(r=ii(e,i))||ni(e=i.valueOf)&&!ai(r=ii(e,i))||t!=="string"&&ni(e=i.toString)&&!ai(r=ii(e,i)))return r;throw hl("Can't convert object to primitive value")},Te={},cl={get exports(){return Te},set exports(i){Te=i}},Aa=U,gl=Object.defineProperty,En=function(i,t){try{gl(Aa,i,{value:t,configurable:!0,writable:!0})}catch{Aa[i]=t}return t},fl=U,pl=En,Ca="__core-js_shared__",dl=fl[Ca]||pl(Ca,{}),Pn=dl,Ea=Pn;(cl.exports=function(i,t){return Ea[i]||(Ea[i]=t!==void 0?t:{})})("versions",[]).push({version:"3.30.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ml=pt,yl=Object,Er=function(i){return yl(ml(i))},vl=j,xl=Er,bl=vl({}.hasOwnProperty),ht=Object.hasOwn||function(i,t){return bl(xl(i),t)},wl=j,Sl=0,Tl=Math.random(),Ol=wl(1 .toString),Zo=function(i){return"Symbol("+(i===void 0?"":i)+")_"+Ol(++Sl+Tl,36)},Al=U,Cl=Te,Pa=ht,El=Zo,Pl=Wo,Nl=Qo,te=Al.Symbol,si=Cl("wks"),Ml=Nl?te.for||te:te&&te.withoutSetter||El,X=function(i){return Pa(si,i)||(si[i]=Pl&&Pa(te,i)?te[i]:Ml("Symbol."+i)),si[i]},Vl=G,Na=wt,Ma=$o,Rl=he,kl=ll,Il=X,_l=TypeError,Ll=Il("toPrimitive"),Dl=function(i,t){if(!Na(i)||Ma(i))return i;var e=Rl(i,Ll),r;if(e){if(t===void 0&&(t="default"),r=Vl(e,i,t),!Na(r)||Ma(r))return r;throw _l("Can't convert object to primitive value")}return t===void 0&&(t="number"),kl(i,t)},jl=Dl,Fl=$o,Nn=function(i){var t=jl(i,"string");return Fl(t)?t:t+""},zl=U,Va=wt,Qi=zl.document,Bl=Va(Qi)&&Va(Qi.createElement),Pr=function(i){return Bl?Qi.createElement(i):{}},Hl=ft,Ul=D,Xl=Pr,Ko=!Hl&&!Ul(function(){return Object.defineProperty(Xl("div"),"a",{get:function(){return 7}}).a!=7}),Yl=ft,Gl=G,ql=Do,Wl=Tr,Ql=Ee,$l=Nn,Zl=ht,Kl=Ko,Ra=Object.getOwnPropertyDescriptor;ue.f=Yl?Ra:function(i,t){if(i=Ql(i),t=$l(t),Kl)try{return Ra(i,t)}catch{}if(Zl(i,t))return Wl(!Gl(ql.f,i,t),i[t])};var dt={},Jl=ft,tc=D,Jo=Jl&&tc(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ec=wt,rc=String,ic=TypeError,Z=function(i){if(ec(i))return i;throw ic(rc(i)+" is not an object")},nc=ft,ac=Ko,sc=Jo,Ge=Z,ka=Nn,oc=TypeError,oi=Object.defineProperty,uc=Object.getOwnPropertyDescriptor,ui="enumerable",hi="configurable",li="writable";dt.f=nc?sc?function(i,t,e){if(Ge(i),t=ka(t),Ge(e),typeof i=="function"&&t==="prototype"&&"value"in e&&li in e&&!e[li]){var r=uc(i,t);r&&r[li]&&(i[t]=e.value,e={configurable:hi in e?e[hi]:r[hi],enumerable:ui in e?e[ui]:r[ui],writable:!1})}return oi(i,t,e)}:oi:function(i,t,e){if(Ge(i),t=ka(t),Ge(e),ac)try{return oi(i,t,e)}catch{}if("get"in e||"set"in e)throw oc("Accessors not supported");return"value"in e&&(i[t]=e.value),i};var hc=ft,lc=dt,cc=Tr,Pe=hc?function(i,t,e){return lc.f(i,t,cc(1,e))}:function(i,t,e){return i[t]=e,i},mr={},gc={get exports(){return mr},set exports(i){mr=i}},$i=ft,fc=ht,tu=Function.prototype,pc=$i&&Object.getOwnPropertyDescriptor,Mn=fc(tu,"name"),dc=Mn&&function(){}.name==="something",mc=Mn&&(!$i||$i&&pc(tu,"name").configurable),Nr={EXISTS:Mn,PROPER:dc,CONFIGURABLE:mc},yc=j,vc=_,Zi=Pn,xc=yc(Function.toString);vc(Zi.inspectSource)||(Zi.inspectSource=function(i){return xc(i)});var Vn=Zi.inspectSource,bc=U,wc=_,Ia=bc.WeakMap,Sc=wc(Ia)&&/native code/.test(String(Ia)),Tc=Te,Oc=Zo,_a=Tc("keys"),Rn=function(i){return _a[i]||(_a[i]=Oc(i))},kn={},Ac=Sc,eu=U,Cc=wt,Ec=Pe,ci=ht,gi=Pn,Pc=Rn,Nc=kn,La="Object already initialized",Ki=eu.TypeError,Mc=eu.WeakMap,yr,Oe,vr,Vc=function(i){return vr(i)?Oe(i):yr(i,{})},Rc=function(i){return function(t){var e;if(!Cc(t)||(e=Oe(t)).type!==i)throw Ki("Incompatible receiver, "+i+" required");return e}};if(Ac||gi.state){var gt=gi.state||(gi.state=new Mc);gt.get=gt.get,gt.has=gt.has,gt.set=gt.set,yr=function(i,t){if(gt.has(i))throw Ki(La);return t.facade=i,gt.set(i,t),t},Oe=function(i){return gt.get(i)||{}},vr=function(i){return gt.has(i)}}else{var Wt=Pc("state");Nc[Wt]=!0,yr=function(i,t){if(ci(i,Wt))throw Ki(La);return t.facade=i,Ec(i,Wt,t),t},Oe=function(i){return ci(i,Wt)?i[Wt]:{}},vr=function(i){return ci(i,Wt)}}var Mr={set:yr,get:Oe,has:vr,enforce:Vc,getterFor:Rc},In=j,kc=D,Ic=_,qe=ht,Ji=ft,_c=Nr.CONFIGURABLE,Lc=Vn,ru=Mr,Dc=ru.enforce,jc=ru.get,Da=String,ur=Object.defineProperty,Fc=In("".slice),zc=In("".replace),Bc=In([].join),Hc=Ji&&!kc(function(){return ur(function(){},"length",{value:8}).length!==8}),Uc=String(String).split("String"),Xc=gc.exports=function(i,t,e){Fc(Da(t),0,7)==="Symbol("&&(t="["+zc(Da(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!qe(i,"name")||_c&&i.name!==t)&&(Ji?ur(i,"name",{value:t,configurable:!0}):i.name=t),Hc&&e&&qe(e,"arity")&&i.length!==e.arity&&ur(i,"length",{value:e.arity});try{e&&qe(e,"constructor")&&e.constructor?Ji&&ur(i,"prototype",{writable:!1}):i.prototype&&(i.prototype=void 0)}catch{}var r=Dc(i);return qe(r,"source")||(r.source=Bc(Uc,typeof t=="string"?t:"")),i};Function.prototype.toString=Xc(function(){return Ic(this)&&jc(this).source||Lc(this)},"toString");var Yc=_,Gc=dt,qc=mr,Wc=En,Xt=function(i,t,e,r){r||(r={});var n=r.enumerable,a=r.name!==void 0?r.name:t;if(Yc(e)&&qc(e,a,r),r.global)n?i[t]=e:Wc(t,e);else{try{r.unsafe?i[t]&&(n=!0):delete i[t]}catch{}n?i[t]=e:Gc.f(i,t,{value:e,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return i},iu={},Qc=Math.ceil,$c=Math.floor,Zc=Math.trunc||function(i){var t=+i;return(t>0?$c:Qc)(t)},Kc=Zc,Vr=function(i){var t=+i;return t!==t||t===0?0:Kc(t)},Jc=Vr,tg=Math.max,eg=Math.min,nu=function(i,t){var e=Jc(i);return e<0?tg(e+t,0):eg(e,t)},rg=Vr,ig=Math.min,le=function(i){return i>0?ig(rg(i),9007199254740991):0},ng=le,Rr=function(i){return ng(i.length)},ag=Ee,sg=nu,og=Rr,ja=function(i){return function(t,e,r){var n=ag(t),a=og(n),o=sg(r,a),s;if(i&&e!=e){for(;a>o;)if(s=n[o++],s!=s)return!0}else for(;a>o;o++)if((i||o in n)&&n[o]===e)return i||o||0;return!i&&-1}},au={includes:ja(!0),indexOf:ja(!1)},ug=j,fi=ht,hg=Ee,lg=au.indexOf,cg=kn,Fa=ug([].push),su=function(i,t){var e=hg(i),r=0,n=[],a;for(a in e)!fi(cg,a)&&fi(e,a)&&Fa(n,a);for(;t.length>r;)fi(e,a=t[r++])&&(~lg(n,a)||Fa(n,a));return n},_n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gg=su,fg=_n,pg=fg.concat("length","prototype");iu.f=Object.getOwnPropertyNames||function(i){return gg(i,pg)};var ou={};ou.f=Object.getOwnPropertySymbols;var dg=Ut,mg=j,yg=iu,vg=ou,xg=Z,bg=mg([].concat),wg=dg("Reflect","ownKeys")||function(i){var t=yg.f(xg(i)),e=vg.f;return e?bg(t,e(i)):t},za=ht,Sg=wg,Tg=ue,Og=dt,Ag=function(i,t,e){for(var r=Sg(t),n=Og.f,a=Tg.f,o=0;o<r.length;o++){var s=r[o];!za(i,s)&&!(e&&za(e,s))&&n(i,s,a(t,s))}},Cg=D,Eg=_,Pg=/#|\.prototype\./,Ne=function(i,t){var e=Mg[Ng(i)];return e==Rg?!0:e==Vg?!1:Eg(t)?Cg(t):!!t},Ng=Ne.normalize=function(i){return String(i).replace(Pg,".").toLowerCase()},Mg=Ne.data={},Vg=Ne.NATIVE="N",Rg=Ne.POLYFILL="P",uu=Ne,pi=U,kg=ue.f,Ig=Pe,_g=Xt,Lg=En,Dg=Ag,jg=uu,tt=function(i,t){var e=i.target,r=i.global,n=i.stat,a,o,s,u,h,l;if(r?o=pi:n?o=pi[e]||Lg(e,{}):o=(pi[e]||{}).prototype,o)for(s in t){if(h=t[s],i.dontCallGetSet?(l=kg(o,s),u=l&&l.value):u=o[s],a=jg(r?s:e+(n?".":"#")+s,i.forced),!a&&u!==void 0){if(typeof h==typeof u)continue;Dg(h,u)}(i.sham||u&&u.sham)&&Ig(h,"sham",!0),_g(o,s,h,i)}},Fg=Bt,Me=typeof process<"u"&&Fg(process)=="process",zg=j,Bg=St,Hg=function(i,t,e){try{return zg(Bg(Object.getOwnPropertyDescriptor(i,t)[e]))}catch{}},Ug=_,Xg=String,Yg=TypeError,Gg=function(i){if(typeof i=="object"||Ug(i))return i;throw Yg("Can't set "+Xg(i)+" as a prototype")},qg=Hg,Wg=Z,Qg=Gg,hu=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,t={},e;try{e=qg(Object.prototype,"__proto__","set"),e(t,[]),i=t instanceof Array}catch{}return function(r,n){return Wg(r),Qg(n),i?e(r,n):r.__proto__=n,r}}():void 0),$g=dt.f,Zg=ht,Kg=X,Ba=Kg("toStringTag"),Ln=function(i,t,e){i&&!e&&(i=i.prototype),i&&!Zg(i,Ba)&&$g(i,Ba,{configurable:!0,value:t})},Ha=mr,Jg=dt,tf=function(i,t,e){return e.get&&Ha(e.get,t,{getter:!0}),e.set&&Ha(e.set,t,{setter:!0}),Jg.f(i,t,e)},ef=Ut,rf=tf,nf=X,af=ft,Ua=nf("species"),sf=function(i){var t=ef(i);af&&t&&!t[Ua]&&rf(t,Ua,{configurable:!0,get:function(){return this}})},of=Or,uf=TypeError,hf=function(i,t){if(of(t,i))return i;throw uf("Incorrect invocation")},lf=X,cf=lf("toStringTag"),lu={};lu[cf]="z";var gf=String(lu)==="[object z]",ff=gf,pf=_,hr=Bt,df=X,mf=df("toStringTag"),yf=Object,vf=hr(function(){return arguments}())=="Arguments",xf=function(i,t){try{return i[t]}catch{}},Dn=ff?hr:function(i){var t,e,r;return i===void 0?"Undefined":i===null?"Null":typeof(e=xf(t=yf(i),mf))=="string"?e:vf?hr(t):(r=hr(t))=="Object"&&pf(t.callee)?"Arguments":r},bf=j,wf=D,cu=_,Sf=Dn,Tf=Ut,Of=Vn,gu=function(){},Af=[],fu=Tf("Reflect","construct"),jn=/^\s*(?:class|function)\b/,Cf=bf(jn.exec),Ef=!jn.exec(gu),fe=function(i){if(!cu(i))return!1;try{return fu(gu,Af,i),!0}catch{return!1}},pu=function(i){if(!cu(i))return!1;switch(Sf(i)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ef||!!Cf(jn,Of(i))}catch{return!0}};pu.sham=!0;var Pf=!fu||wf(function(){var i;return fe(fe.call)||!fe(Object)||!fe(function(){i=!0})||i})?pu:fe,Nf=Pf,Mf=Cr,Vf=TypeError,Rf=function(i){if(Nf(i))return i;throw Vf(Mf(i)+" is not a constructor")},Xa=Z,kf=Rf,If=Ht,_f=X,Lf=_f("species"),du=function(i,t){var e=Xa(i).constructor,r;return e===void 0||If(r=Xa(e)[Lf])?t:kf(r)},Df=Sr,mu=Function.prototype,Ya=mu.apply,Ga=mu.call,Fn=typeof Reflect=="object"&&Reflect.apply||(Df?Ga.bind(Ya):function(){return Ga.apply(Ya,arguments)}),jf=Bt,Ff=j,Ve=function(i){if(jf(i)==="Function")return Ff(i)},qa=Ve,zf=St,Bf=Sr,Hf=qa(qa.bind),zn=function(i,t){return zf(i),t===void 0?i:Bf?Hf(i,t):function(){return i.apply(t,arguments)}},Uf=Ut,yu=Uf("document","documentElement"),Xf=j,Yf=Xf([].slice),Gf=TypeError,qf=function(i,t){if(i<t)throw Gf("Not enough arguments");return i},Wf=Ar,vu=/(?:ipad|iphone|ipod).*applewebkit/i.test(Wf),it=U,Qf=Fn,$f=zn,Wa=_,Zf=ht,xu=D,Qa=yu,Kf=Yf,$a=Pr,Jf=qf,tp=vu,ep=Me,tn=it.setImmediate,en=it.clearImmediate,rp=it.process,di=it.Dispatch,ip=it.Function,Za=it.MessageChannel,np=it.String,mi=0,we={},Ka="onreadystatechange",Ae,Rt,yi,vi;xu(function(){Ae=it.location});var Bn=function(i){if(Zf(we,i)){var t=we[i];delete we[i],t()}},xi=function(i){return function(){Bn(i)}},Ja=function(i){Bn(i.data)},ts=function(i){it.postMessage(np(i),Ae.protocol+"//"+Ae.host)};(!tn||!en)&&(tn=function(i){Jf(arguments.length,1);var t=Wa(i)?i:ip(i),e=Kf(arguments,1);return we[++mi]=function(){Qf(t,void 0,e)},Rt(mi),mi},en=function(i){delete we[i]},ep?Rt=function(i){rp.nextTick(xi(i))}:di&&di.now?Rt=function(i){di.now(xi(i))}:Za&&!tp?(yi=new Za,vi=yi.port2,yi.port1.onmessage=Ja,Rt=$f(vi.postMessage,vi)):it.addEventListener&&Wa(it.postMessage)&&!it.importScripts&&Ae&&Ae.protocol!=="file:"&&!xu(ts)?(Rt=ts,it.addEventListener("message",Ja,!1)):Ka in $a("script")?Rt=function(i){Qa.appendChild($a("script"))[Ka]=function(){Qa.removeChild(this),Bn(i)}}:Rt=function(i){setTimeout(xi(i),0)});var bu={set:tn,clear:en},wu=function(){this.head=null,this.tail=null};wu.prototype={add:function(i){var t={item:i,next:null},e=this.tail;e?e.next=t:this.head=t,this.tail=t},get:function(){var i=this.head;if(i){var t=this.head=i.next;return t===null&&(this.tail=null),i.item}}};var Su=wu,ap=Ar,sp=/ipad|iphone|ipod/i.test(ap)&&typeof Pebble<"u",op=Ar,up=/web0s(?!.*chrome)/i.test(op),jt=U,es=zn,hp=ue.f,bi=bu.set,lp=Su,cp=vu,gp=sp,fp=up,wi=Me,rs=jt.MutationObserver||jt.WebKitMutationObserver,is=jt.document,ns=jt.process,We=jt.Promise,as=hp(jt,"queueMicrotask"),rn=as&&as.value,Qt,Si,Ti,Qe,ss;if(!rn){var $e=new lp,Ze=function(){var i,t;for(wi&&(i=ns.domain)&&i.exit();t=$e.get();)try{t()}catch(e){throw $e.head&&Qt(),e}i&&i.enter()};!cp&&!wi&&!fp&&rs&&is?(Si=!0,Ti=is.createTextNode(""),new rs(Ze).observe(Ti,{characterData:!0}),Qt=function(){Ti.data=Si=!Si}):!gp&&We&&We.resolve?(Qe=We.resolve(void 0),Qe.constructor=We,ss=es(Qe.then,Qe),Qt=function(){ss(Ze)}):wi?Qt=function(){ns.nextTick(Ze)}:(bi=es(bi,jt),Qt=function(){bi(Ze)}),rn=function(i){$e.head||Qt(),$e.add(i)}}var pp=rn,dp=function(i,t){try{arguments.length==1?console.error(i):console.error(i,t)}catch{}},Hn=function(i){try{return{error:!1,value:i()}}catch(t){return{error:!0,value:t}}},mp=U,kr=mp.Promise,Tu=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",yp=Tu,vp=Me,xp=!yp&&!vp&&typeof window=="object"&&typeof document=="object",bp=U,Se=kr,wp=_,Sp=uu,Tp=Vn,Op=X,Ap=xp,Cp=Tu,Oi=Cn;Se&&Se.prototype;var Ep=Op("species"),nn=!1,Ou=wp(bp.PromiseRejectionEvent),Pp=Sp("Promise",function(){var i=Tp(Se),t=i!==String(Se);if(!t&&Oi===66)return!0;if(!Oi||Oi<51||!/native code/.test(i)){var e=new Se(function(a){a(1)}),r=function(a){a(function(){},function(){})},n=e.constructor={};if(n[Ep]=r,nn=e.then(function(){})instanceof r,!nn)return!0}return!t&&(Ap||Cp)&&!Ou}),Re={CONSTRUCTOR:Pp,REJECTION_EVENT:Ou,SUBCLASSING:nn},ce={},os=St,Np=TypeError,Mp=function(i){var t,e;this.promise=new i(function(r,n){if(t!==void 0||e!==void 0)throw Np("Bad Promise constructor");t=r,e=n}),this.resolve=os(t),this.reject=os(e)};ce.f=function(i){return new Mp(i)};var Vp=tt,xr=Me,Ct=U,se=G,us=Xt,hs=hu,Rp=Ln,kp=sf,Ip=St,lr=_,_p=wt,Lp=hf,Dp=du,Au=bu.set,Un=pp,jp=dp,Fp=Hn,zp=Su,Cu=Mr,br=kr,Xn=Re,Eu=ce,Ir="Promise",Pu=Xn.CONSTRUCTOR,Bp=Xn.REJECTION_EVENT,Hp=Xn.SUBCLASSING,Ai=Cu.getterFor(Ir),Up=Cu.set,Jt=br&&br.prototype,Lt=br,Ke=Jt,Nu=Ct.TypeError,an=Ct.document,Yn=Ct.process,sn=Eu.f,Xp=sn,Yp=!!(an&&an.createEvent&&Ct.dispatchEvent),Mu="unhandledrejection",Gp="rejectionhandled",ls=0,Vu=1,qp=2,Gn=1,Ru=2,Je,cs,Wp,gs,ku=function(i){var t;return _p(i)&&lr(t=i.then)?t:!1},Iu=function(i,t){var e=t.value,r=t.state==Vu,n=r?i.ok:i.fail,a=i.resolve,o=i.reject,s=i.domain,u,h,l;try{n?(r||(t.rejection===Ru&&$p(t),t.rejection=Gn),n===!0?u=e:(s&&s.enter(),u=n(e),s&&(s.exit(),l=!0)),u===i.promise?o(Nu("Promise-chain cycle")):(h=ku(u))?se(h,u,a,o):a(u)):o(e)}catch(g){s&&!l&&s.exit(),o(g)}},_u=function(i,t){i.notified||(i.notified=!0,Un(function(){for(var e=i.reactions,r;r=e.get();)Iu(r,i);i.notified=!1,t&&!i.rejection&&Qp(i)}))},Lu=function(i,t,e){var r,n;Yp?(r=an.createEvent("Event"),r.promise=t,r.reason=e,r.initEvent(i,!1,!0),Ct.dispatchEvent(r)):r={promise:t,reason:e},!Bp&&(n=Ct["on"+i])?n(r):i===Mu&&jp("Unhandled promise rejection",e)},Qp=function(i){se(Au,Ct,function(){var t=i.facade,e=i.value,r=fs(i),n;if(r&&(n=Fp(function(){xr?Yn.emit("unhandledRejection",e,t):Lu(Mu,t,e)}),i.rejection=xr||fs(i)?Ru:Gn,n.error))throw n.value})},fs=function(i){return i.rejection!==Gn&&!i.parent},$p=function(i){se(Au,Ct,function(){var t=i.facade;xr?Yn.emit("rejectionHandled",t):Lu(Gp,t,i.value)})},ee=function(i,t,e){return function(r){i(t,r,e)}},ie=function(i,t,e){i.done||(i.done=!0,e&&(i=e),i.value=t,i.state=qp,_u(i,!0))},on=function(i,t,e){if(!i.done){i.done=!0,e&&(i=e);try{if(i.facade===t)throw Nu("Promise can't be resolved itself");var r=ku(t);r?Un(function(){var n={done:!1};try{se(r,t,ee(on,n,i),ee(ie,n,i))}catch(a){ie(n,a,i)}}):(i.value=t,i.state=Vu,_u(i,!1))}catch(n){ie({done:!1},n,i)}}};if(Pu&&(Lt=function(i){Lp(this,Ke),Ip(i),se(Je,this);var t=Ai(this);try{i(ee(on,t),ee(ie,t))}catch(e){ie(t,e)}},Ke=Lt.prototype,Je=function(i){Up(this,{type:Ir,done:!1,notified:!1,parent:!1,reactions:new zp,rejection:!1,state:ls,value:void 0})},Je.prototype=us(Ke,"then",function(i,t){var e=Ai(this),r=sn(Dp(this,Lt));return e.parent=!0,r.ok=lr(i)?i:!0,r.fail=lr(t)&&t,r.domain=xr?Yn.domain:void 0,e.state==ls?e.reactions.add(r):Un(function(){Iu(r,e)}),r.promise}),cs=function(){var i=new Je,t=Ai(i);this.promise=i,this.resolve=ee(on,t),this.reject=ee(ie,t)},Eu.f=sn=function(i){return i===Lt||i===Wp?new cs(i):Xp(i)},lr(br)&&Jt!==Object.prototype)){gs=Jt.then,Hp||us(Jt,"then",function(i,t){var e=this;return new Lt(function(r,n){se(gs,e,r,n)}).then(i,t)},{unsafe:!0});try{delete Jt.constructor}catch{}hs&&hs(Jt,Ke)}Vp({global:!0,constructor:!0,wrap:!0,forced:Pu},{Promise:Lt});Rp(Lt,Ir,!1);kp(Ir);var ke={},Zp=X,Kp=ke,Jp=Zp("iterator"),td=Array.prototype,ed=function(i){return i!==void 0&&(Kp.Array===i||td[Jp]===i)},rd=Dn,ps=he,id=Ht,nd=ke,ad=X,sd=ad("iterator"),Du=function(i){if(!id(i))return ps(i,sd)||ps(i,"@@iterator")||nd[rd(i)]},od=G,ud=St,hd=Z,ld=Cr,cd=Du,gd=TypeError,fd=function(i,t){var e=arguments.length<2?cd(i):t;if(ud(e))return hd(od(e,i));throw gd(ld(i)+" is not iterable")},pd=G,ds=Z,dd=he,md=function(i,t,e){var r,n;ds(i);try{if(r=dd(i,"return"),!r){if(t==="throw")throw e;return e}r=pd(r,i)}catch(a){n=!0,r=a}if(t==="throw")throw e;if(n)throw r;return ds(r),e},yd=zn,vd=G,xd=Z,bd=Cr,wd=ed,Sd=Rr,ms=Or,Td=fd,Od=Du,ys=md,Ad=TypeError,cr=function(i,t){this.stopped=i,this.result=t},vs=cr.prototype,ju=function(i,t,e){var r=e&&e.that,n=!!(e&&e.AS_ENTRIES),a=!!(e&&e.IS_RECORD),o=!!(e&&e.IS_ITERATOR),s=!!(e&&e.INTERRUPTED),u=yd(t,r),h,l,g,f,c,d,p,m=function(b){return h&&ys(h,"normal",b),new cr(!0,b)},y=function(b){return n?(xd(b),s?u(b[0],b[1],m):u(b[0],b[1])):s?u(b,m):u(b)};if(a)h=i.iterator;else if(o)h=i;else{if(l=Od(i),!l)throw Ad(bd(i)+" is not iterable");if(wd(l)){for(g=0,f=Sd(i);f>g;g++)if(c=y(i[g]),c&&ms(vs,c))return c;return new cr(!1)}h=Td(i,l)}for(d=a?i.next:h.next;!(p=vd(d,h)).done;){try{c=y(p.value)}catch(b){ys(h,"throw",b)}if(typeof c=="object"&&c&&ms(vs,c))return c}return new cr(!1)},Cd=X,Fu=Cd("iterator"),zu=!1;try{var Ed=0,xs={next:function(){return{done:!!Ed++}},return:function(){zu=!0}};xs[Fu]=function(){return this},Array.from(xs,function(){throw 2})}catch{}var Pd=function(i,t){if(!t&&!zu)return!1;var e=!1;try{var r={};r[Fu]=function(){return{next:function(){return{done:e=!0}}}},i(r)}catch{}return e},Nd=kr,Md=Pd,Vd=Re.CONSTRUCTOR,Bu=Vd||!Md(function(i){Nd.all(i).then(void 0,function(){})}),Rd=tt,kd=G,Id=St,_d=ce,Ld=Hn,Dd=ju,jd=Bu;Rd({target:"Promise",stat:!0,forced:jd},{all:function(i){var t=this,e=_d.f(t),r=e.resolve,n=e.reject,a=Ld(function(){var o=Id(t.resolve),s=[],u=0,h=1;Dd(i,function(l){var g=u++,f=!1;h++,kd(o,t,l).then(function(c){f||(f=!0,s[g]=c,--h||r(s))},n)}),--h||r(s)});return a.error&&n(a.value),e.promise}});var Fd=tt,zd=Re.CONSTRUCTOR,un=kr,Bd=Ut,Hd=_,Ud=Xt,bs=un&&un.prototype;Fd({target:"Promise",proto:!0,forced:zd,real:!0},{catch:function(i){return this.then(void 0,i)}});if(Hd(un)){var ws=Bd("Promise").prototype.catch;bs.catch!==ws&&Ud(bs,"catch",ws,{unsafe:!0})}var Xd=tt,Yd=G,Gd=St,qd=ce,Wd=Hn,Qd=ju,$d=Bu;Xd({target:"Promise",stat:!0,forced:$d},{race:function(i){var t=this,e=qd.f(t),r=e.reject,n=Wd(function(){var a=Gd(t.resolve);Qd(i,function(o){Yd(a,t,o).then(e.resolve,r)})});return n.error&&r(n.value),e.promise}});var Zd=tt,Kd=G,Jd=ce,tm=Re.CONSTRUCTOR;Zd({target:"Promise",stat:!0,forced:tm},{reject:function(i){var t=Jd.f(this);return Kd(t.reject,void 0,i),t.promise}});var em=Z,rm=wt,im=ce,nm=function(i,t){if(em(i),rm(t)&&t.constructor===i)return t;var e=im.f(i),r=e.resolve;return r(t),e.promise},am=tt,sm=Ut,om=Re.CONSTRUCTOR,um=nm;sm("Promise");am({target:"Promise",stat:!0,forced:om},{resolve:function(i){return um(this,i)}});function Ss(i,t,e,r,n,a,o){try{var s=i[a](o),u=s.value}catch(h){e(h);return}s.done?t(u):Promise.resolve(u).then(r,n)}function bt(i){return function(){var t=this,e=arguments;return new Promise(function(r,n){var a=i.apply(t,e);function o(u){Ss(a,r,n,o,s,"next",u)}function s(u){Ss(a,r,n,o,s,"throw",u)}o(void 0)})}}var hm=Dn,lm=String,mt=function(i){if(hm(i)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return lm(i)},cm=Z,Hu=function(){var i=cm(this),t="";return i.hasIndices&&(t+="d"),i.global&&(t+="g"),i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.dotAll&&(t+="s"),i.unicode&&(t+="u"),i.unicodeSets&&(t+="v"),i.sticky&&(t+="y"),t},qn=D,gm=U,Wn=gm.RegExp,Qn=qn(function(){var i=Wn("a","y");return i.lastIndex=2,i.exec("abcd")!=null}),fm=Qn||qn(function(){return!Wn("a","y").sticky}),pm=Qn||qn(function(){var i=Wn("^r","gy");return i.lastIndex=2,i.exec("str")!=null}),Uu={BROKEN_CARET:pm,MISSED_STICKY:fm,UNSUPPORTED_Y:Qn},Xu={},dm=su,mm=_n,ym=Object.keys||function(i){return dm(i,mm)},vm=ft,xm=Jo,bm=dt,wm=Z,Sm=Ee,Tm=ym;Xu.f=vm&&!xm?Object.defineProperties:function(i,t){wm(i);for(var e=Sm(t),r=Tm(t),n=r.length,a=0,o;n>a;)bm.f(i,o=r[a++],e[o]);return i};var Om=Z,Am=Xu,Ts=_n,Cm=kn,Em=yu,Pm=Pr,Nm=Rn,Os=">",As="<",hn="prototype",ln="script",Yu=Nm("IE_PROTO"),Ci=function(){},Gu=function(i){return As+ln+Os+i+As+"/"+ln+Os},Cs=function(i){i.write(Gu("")),i.close();var t=i.parentWindow.Object;return i=null,t},Mm=function(){var i=Pm("iframe"),t="java"+ln+":",e;return i.style.display="none",Em.appendChild(i),i.src=String(t),e=i.contentWindow.document,e.open(),e.write(Gu("document.F=Object")),e.close(),e.F},tr,gr=function(){try{tr=new ActiveXObject("htmlfile")}catch{}gr=typeof document<"u"?document.domain&&tr?Cs(tr):Mm():Cs(tr);for(var i=Ts.length;i--;)delete gr[hn][Ts[i]];return gr()};Cm[Yu]=!0;var $n=Object.create||function(i,t){var e;return i!==null?(Ci[hn]=Om(i),e=new Ci,Ci[hn]=null,e[Yu]=i):e=gr(),t===void 0?e:Am.f(e,t)},Vm=D,Rm=U,km=Rm.RegExp,Im=Vm(function(){var i=km(".","s");return!(i.dotAll&&i.exec(`
|
||
`)&&i.flags==="s")}),_m=D,Lm=U,Dm=Lm.RegExp,jm=_m(function(){var i=Dm("(?<a>b)","g");return i.exec("b").groups.a!=="b"||"b".replace(i,"$<a>c")!=="bc"}),re=G,_r=j,Fm=mt,zm=Hu,Bm=Uu,Hm=Te,Um=$n,Xm=Mr.get,Ym=Im,Gm=jm,qm=Hm("native-string-replace",String.prototype.replace),wr=RegExp.prototype.exec,cn=wr,Wm=_r("".charAt),Qm=_r("".indexOf),$m=_r("".replace),Ei=_r("".slice),gn=function(){var i=/a/,t=/b*/g;return re(wr,i,"a"),re(wr,t,"a"),i.lastIndex!==0||t.lastIndex!==0}(),qu=Bm.BROKEN_CARET,fn=/()??/.exec("")[1]!==void 0,Zm=gn||fn||qu||Ym||Gm;Zm&&(cn=function(i){var t=this,e=Xm(t),r=Fm(i),n=e.raw,a,o,s,u,h,l,g;if(n)return n.lastIndex=t.lastIndex,a=re(cn,n,r),t.lastIndex=n.lastIndex,a;var f=e.groups,c=qu&&t.sticky,d=re(zm,t),p=t.source,m=0,y=r;if(c&&(d=$m(d,"y",""),Qm(d,"g")===-1&&(d+="g"),y=Ei(r,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&Wm(r,t.lastIndex-1)!==`
|
||
`)&&(p="(?: "+p+")",y=" "+y,m++),o=new RegExp("^(?:"+p+")",d)),fn&&(o=new RegExp("^"+p+"$(?!\\s)",d)),gn&&(s=t.lastIndex),u=re(wr,c?o:t,y),c?u?(u.input=Ei(u.input,m),u[0]=Ei(u[0],m),u.index=t.lastIndex,t.lastIndex+=u[0].length):t.lastIndex=0:gn&&u&&(t.lastIndex=t.global?u.index+u[0].length:s),fn&&u&&u.length>1&&re(qm,u[0],o,function(){for(h=1;h<arguments.length-2;h++)arguments[h]===void 0&&(u[h]=void 0)}),u&&f)for(u.groups=l=Um(null),h=0;h<f.length;h++)g=f[h],l[g[0]]=u[g[1]];return u});var Lr=cn,Km=tt,Es=Lr;Km({target:"RegExp",proto:!0,forced:/./.exec!==Es},{exec:Es});var Ps=Ve,Ns=Xt,Jm=Lr,Ms=D,Wu=X,t0=Pe,e0=Wu("species"),Pi=RegExp.prototype,Zn=function(i,t,e,r){var n=Wu(i),a=!Ms(function(){var h={};return h[n]=function(){return 7},""[i](h)!=7}),o=a&&!Ms(function(){var h=!1,l=/a/;return i==="split"&&(l={},l.constructor={},l.constructor[e0]=function(){return l},l.flags="",l[n]=/./[n]),l.exec=function(){return h=!0,null},l[n](""),!h});if(!a||!o||e){var s=Ps(/./[n]),u=t(n,""[i],function(h,l,g,f,c){var d=Ps(h),p=l.exec;return p===Jm||p===Pi.exec?a&&!c?{done:!0,value:s(l,g,f)}:{done:!0,value:d(g,l,f)}:{done:!1}});Ns(String.prototype,i,u[0]),Ns(Pi,n,u[1])}r&&t0(Pi[n],"sham",!0)},Kn=j,r0=Vr,i0=mt,n0=pt,a0=Kn("".charAt),Vs=Kn("".charCodeAt),s0=Kn("".slice),Rs=function(i){return function(t,e){var r=i0(n0(t)),n=r0(e),a=r.length,o,s;return n<0||n>=a?i?"":void 0:(o=Vs(r,n),o<55296||o>56319||n+1===a||(s=Vs(r,n+1))<56320||s>57343?i?a0(r,n):o:i?s0(r,n,n+2):(o-55296<<10)+(s-56320)+65536)}},o0={codeAt:Rs(!1),charAt:Rs(!0)},u0=o0.charAt,Jn=function(i,t,e){return t+(e?u0(i,t).length:1)},ks=G,h0=Z,l0=_,c0=Bt,g0=Lr,f0=TypeError,ta=function(i,t){var e=i.exec;if(l0(e)){var r=ks(e,i,t);return r!==null&&h0(r),r}if(c0(i)==="RegExp")return ks(g0,i,t);throw f0("RegExp#exec called on incompatible receiver")},p0=G,d0=Zn,m0=Z,y0=Ht,v0=le,Ni=mt,x0=pt,b0=he,w0=Jn,Is=ta;d0("match",function(i,t,e){return[function(r){var n=x0(this),a=y0(r)?void 0:b0(r,i);return a?p0(a,r,n):new RegExp(r)[i](Ni(n))},function(r){var n=m0(this),a=Ni(r),o=e(t,n,a);if(o.done)return o.value;if(!n.global)return Is(n,a);var s=n.unicode;n.lastIndex=0;for(var u=[],h=0,l;(l=Is(n,a))!==null;){var g=Ni(l[0]);u[h]=g,g===""&&(n.lastIndex=w0(a,v0(n.lastIndex),s)),h++}return h===0?null:u}]});var ea=j,S0=Er,T0=Math.floor,Mi=ea("".charAt),O0=ea("".replace),Vi=ea("".slice),A0=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,C0=/\$([$&'`]|\d{1,2})/g,E0=function(i,t,e,r,n,a){var o=e+i.length,s=r.length,u=C0;return n!==void 0&&(n=S0(n),u=A0),O0(a,u,function(h,l){var g;switch(Mi(l,0)){case"$":return"$";case"&":return i;case"`":return Vi(t,0,e);case"'":return Vi(t,o);case"<":g=n[Vi(l,1,-1)];break;default:var f=+l;if(f===0)return h;if(f>s){var c=T0(f/10);return c===0?h:c<=s?r[c-1]===void 0?Mi(l,1):r[c-1]+Mi(l,1):h}g=r[f-1]}return g===void 0?"":g})},P0=Fn,_s=G,Dr=j,N0=Zn,M0=D,V0=Z,R0=_,k0=Ht,I0=Vr,_0=le,$t=mt,L0=pt,D0=Jn,j0=he,F0=E0,z0=ta,B0=X,pn=B0("replace"),H0=Math.max,U0=Math.min,X0=Dr([].concat),Ri=Dr([].push),Ls=Dr("".indexOf),Ds=Dr("".slice),Y0=function(i){return i===void 0?i:String(i)},G0=function(){return"a".replace(/./,"$0")==="$0"}(),js=function(){return/./[pn]?/./[pn]("a","$0")==="":!1}(),q0=!M0(function(){var i=/./;return i.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(i,"$<a>")!=="7"});N0("replace",function(i,t,e){var r=js?"$":"$0";return[function(n,a){var o=L0(this),s=k0(n)?void 0:j0(n,pn);return s?_s(s,n,o,a):_s(t,$t(o),n,a)},function(n,a){var o=V0(this),s=$t(n);if(typeof a=="string"&&Ls(a,r)===-1&&Ls(a,"$<")===-1){var u=e(t,o,s,a);if(u.done)return u.value}var h=R0(a);h||(a=$t(a));var l=o.global;if(l){var g=o.unicode;o.lastIndex=0}for(var f=[];;){var c=z0(o,s);if(c===null||(Ri(f,c),!l))break;var d=$t(c[0]);d===""&&(o.lastIndex=D0(s,_0(o.lastIndex),g))}for(var p="",m=0,y=0;y<f.length;y++){c=f[y];for(var b=$t(c[0]),x=H0(U0(I0(c.index),s.length),0),w=[],A=1;A<c.length;A++)Ri(w,Y0(c[A]));var O=c.groups;if(h){var S=X0([b],w,x,s);O!==void 0&&Ri(S,O);var E=$t(P0(a,void 0,S))}else E=F0(b,s,x,w,O,a);x>=m&&(p+=Ds(s,m,x)+E,m=x+b.length)}return p+Ds(s,m)}]},!q0||!G0||js);var W0=wt,Q0=Bt,$0=X,Z0=$0("match"),Qu=function(i){var t;return W0(i)&&((t=i[Z0])!==void 0?!!t:Q0(i)=="RegExp")},K0=Qu,J0=TypeError,ra=function(i){if(K0(i))throw J0("The method doesn't accept regular expressions");return i},ty=X,ey=ty("match"),ia=function(i){var t=/./;try{"/./"[i](t)}catch{try{return t[ey]=!1,"/./"[i](t)}catch{}}return!1},ry=tt,$u=Ve,iy=ue.f,ny=le,Fs=mt,ay=ra,sy=pt,oy=ia,zs=$u("".startsWith),uy=$u("".slice),hy=Math.min,Zu=oy("startsWith"),ly=!Zu&&!!function(){var i=iy(String.prototype,"startsWith");return i&&!i.writable}();ry({target:"String",proto:!0,forced:!ly&&!Zu},{startsWith:function(i){var t=Fs(sy(this));ay(i);var e=ny(hy(arguments.length>1?arguments[1]:void 0,t.length)),r=Fs(i);return zs?zs(t,r,e):uy(t,e,e+r.length)===r}});var cy=X,gy=$n,fy=dt.f,dn=cy("unscopables"),mn=Array.prototype;mn[dn]==null&&fy(mn,dn,{configurable:!0,value:gy(null)});var py=function(i){mn[dn][i]=!0},dy=D,my=!dy(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),yy=ht,vy=_,xy=Er,by=Rn,wy=my,Bs=by("IE_PROTO"),yn=Object,Sy=yn.prototype,Ku=wy?yn.getPrototypeOf:function(i){var t=xy(i);if(yy(t,Bs))return t[Bs];var e=t.constructor;return vy(e)&&t instanceof e?e.prototype:t instanceof yn?Sy:null},Ty=D,Oy=_,Ay=wt,Hs=Ku,Cy=Xt,Ey=X,vn=Ey("iterator"),Ju=!1,Ft,ki,Ii;[].keys&&(Ii=[].keys(),"next"in Ii?(ki=Hs(Hs(Ii)),ki!==Object.prototype&&(Ft=ki)):Ju=!0);var Py=!Ay(Ft)||Ty(function(){var i={};return Ft[vn].call(i)!==i});Py&&(Ft={});Oy(Ft[vn])||Cy(Ft,vn,function(){return this});var th={IteratorPrototype:Ft,BUGGY_SAFARI_ITERATORS:Ju},Ny=th.IteratorPrototype,My=$n,Vy=Tr,Ry=Ln,ky=ke,Iy=function(){return this},_y=function(i,t,e,r){var n=t+" Iterator";return i.prototype=My(Ny,{next:Vy(+!r,e)}),Ry(i,n,!1),ky[n]=Iy,i},Ly=tt,Dy=G,eh=Nr,jy=_,Fy=_y,Us=Ku,Xs=hu,zy=Ln,By=Pe,_i=Xt,Hy=X,Uy=ke,rh=th,Xy=eh.PROPER,Yy=eh.CONFIGURABLE,Ys=rh.IteratorPrototype,er=rh.BUGGY_SAFARI_ITERATORS,pe=Hy("iterator"),Gs="keys",de="values",qs="entries",Gy=function(){return this},qy=function(i,t,e,r,n,a,o){Fy(e,t,r);var s=function(y){if(y===n&&f)return f;if(!er&&y in l)return l[y];switch(y){case Gs:return function(){return new e(this,y)};case de:return function(){return new e(this,y)};case qs:return function(){return new e(this,y)}}return function(){return new e(this)}},u=t+" Iterator",h=!1,l=i.prototype,g=l[pe]||l["@@iterator"]||n&&l[n],f=!er&&g||s(n),c=t=="Array"&&l.entries||g,d,p,m;if(c&&(d=Us(c.call(new i)),d!==Object.prototype&&d.next&&(Us(d)!==Ys&&(Xs?Xs(d,Ys):jy(d[pe])||_i(d,pe,Gy)),zy(d,u,!0))),Xy&&n==de&&g&&g.name!==de&&(Yy?By(l,"name",de):(h=!0,f=function(){return Dy(g,this)})),n)if(p={values:s(de),keys:a?f:s(Gs),entries:s(qs)},o)for(m in p)(er||h||!(m in l))&&_i(l,m,p[m]);else Ly({target:t,proto:!0,forced:er||h},p);return l[pe]!==f&&_i(l,pe,f,{name:n}),Uy[t]=f,p},Wy=function(i,t){return{value:i,done:t}},Qy=Ee,na=py,Ws=ke,ih=Mr,$y=dt.f,Zy=qy,rr=Wy,Ky=ft,nh="Array Iterator",Jy=ih.set,tv=ih.getterFor(nh),ev=Zy(Array,"Array",function(i,t){Jy(this,{type:nh,target:Qy(i),index:0,kind:t})},function(){var i=tv(this),t=i.target,e=i.kind,r=i.index++;return!t||r>=t.length?(i.target=void 0,rr(void 0,!0)):e=="keys"?rr(r,!1):e=="values"?rr(t[r],!1):rr([r,t[r]],!1)},"values"),Qs=Ws.Arguments=Ws.Array;na("keys");na("values");na("entries");if(Ky&&Qs.name!=="values")try{$y(Qs,"name",{value:"values"})}catch{}var rv={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},iv=Pr,Li=iv("span").classList,$s=Li&&Li.constructor&&Li.constructor.prototype,nv=$s===Object.prototype?void 0:$s,Zs=U,ah=rv,av=nv,xe=ev,Di=Pe,sh=X,ji=sh("iterator"),Ks=sh("toStringTag"),Fi=xe.values,oh=function(i,t){if(i){if(i[ji]!==Fi)try{Di(i,ji,Fi)}catch{i[ji]=Fi}if(i[Ks]||Di(i,Ks,t),ah[t]){for(var e in xe)if(i[e]!==xe[e])try{Di(i,e,xe[e])}catch{i[e]=xe[e]}}}};for(var zi in ah)oh(Zs[zi]&&Zs[zi].prototype,zi);oh(av,"DOMTokenList");function sv(i,t){if(Gi(i)!=="object"||i===null)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var r=e.call(i,t||"default");if(Gi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function ov(i){var t=sv(i,"string");return Gi(t)==="symbol"?t:String(t)}function aa(i,t,e){return t=ov(t),t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var uv=St,hv=Er,lv=Uo,cv=Rr,gv=TypeError,Js=function(i){return function(t,e,r,n){uv(e);var a=hv(t),o=lv(a),s=cv(a),u=i?s-1:0,h=i?-1:1;if(r<2)for(;;){if(u in o){n=o[u],u+=h;break}if(u+=h,i?u<0:s<=u)throw gv("Reduce of empty array with no initial value")}for(;i?u>=0:s>u;u+=h)u in o&&(n=e(n,o[u],u,a));return n}},fv={left:Js(!1),right:Js(!0)},pv=D,uh=function(i,t){var e=[][i];return!!e&&pv(function(){e.call(null,t||function(){return 1},1)})},dv=tt,mv=fv.left,yv=uh,to=Cn,vv=Me,xv=!vv&&to>79&&to<83,bv=xv||!yv("reduce");dv({target:"Array",proto:!0,forced:bv},{reduce:function(i){var t=arguments.length;return mv(this,i,t,t>1?arguments[1]:void 0)}});var wv=tt,hh=Ve,Sv=ue.f,Tv=le,eo=mt,Ov=ra,Av=pt,Cv=ia,ro=hh("".endsWith),Ev=hh("".slice),Pv=Math.min,lh=Cv("endsWith"),Nv=!lh&&!!function(){var i=Sv(String.prototype,"endsWith");return i&&!i.writable}();wv({target:"String",proto:!0,forced:!Nv&&!lh},{endsWith:function(i){var t=eo(Av(this));Ov(i);var e=arguments.length>1?arguments[1]:void 0,r=t.length,n=e===void 0?r:Pv(Tv(e),r),a=eo(i);return ro?ro(t,a,n):Ev(t,n-a.length,n)===a}});var Mv=Nn,Vv=dt,Rv=Tr,kv=function(i,t,e){var r=Mv(t);r in i?Vv.f(i,r,Rv(0,e)):i[r]=e},io=nu,Iv=Rr,_v=kv,Lv=Array,Dv=Math.max,jv=function(i,t,e){for(var r=Iv(i),n=io(t,r),a=io(e===void 0?r:e,r),o=Lv(Dv(a-n,0)),s=0;n<a;n++,s++)_v(o,s,i[n]);return o.length=s,o},Fv=Fn,me=G,sa=j,zv=Zn,Bv=Z,Hv=Ht,Uv=Qu,no=pt,Xv=du,Yv=Jn,Gv=le,Bi=mt,qv=he,ao=jv,so=ta,Wv=Lr,Qv=Uu,$v=D,Zt=Qv.UNSUPPORTED_Y,oo=4294967295,Zv=Math.min,ch=[].push,Kv=sa(/./.exec),Kt=sa(ch),ye=sa("".slice),Jv=!$v(function(){var i=/(?:)/,t=i.exec;i.exec=function(){return t.apply(this,arguments)};var e="ab".split(i);return e.length!==2||e[0]!=="a"||e[1]!=="b"});zv("split",function(i,t,e){var r;return"abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?r=function(n,a){var o=Bi(no(this)),s=a===void 0?oo:a>>>0;if(s===0)return[];if(n===void 0)return[o];if(!Uv(n))return me(t,o,n,s);for(var u=[],h=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(n.sticky?"y":""),l=0,g=new RegExp(n.source,h+"g"),f,c,d;(f=me(Wv,g,o))&&(c=g.lastIndex,!(c>l&&(Kt(u,ye(o,l,f.index)),f.length>1&&f.index<o.length&&Fv(ch,u,ao(f,1)),d=f[0].length,l=c,u.length>=s)));)g.lastIndex===f.index&&g.lastIndex++;return l===o.length?(d||!Kv(g,""))&&Kt(u,""):Kt(u,ye(o,l)),u.length>s?ao(u,0,s):u}:"0".split(void 0,0).length?r=function(n,a){return n===void 0&&a===0?[]:me(t,this,n,a)}:r=t,[function(n,a){var o=no(this),s=Hv(n)?void 0:qv(n,i);return s?me(s,n,o,a):me(r,Bi(o),n,a)},function(n,a){var o=Bv(this),s=Bi(n),u=e(r,o,s,a,r!==t);if(u.done)return u.value;var h=Xv(o,RegExp),l=o.unicode,g=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Zt?"g":"y"),f=new h(Zt?"^(?:"+o.source+")":o,g),c=a===void 0?oo:a>>>0;if(c===0)return[];if(s.length===0)return so(f,s)===null?[s]:[];for(var d=0,p=0,m=[];p<s.length;){f.lastIndex=Zt?0:p;var y=so(f,Zt?ye(s,p):s),b;if(y===null||(b=Zv(Gv(f.lastIndex+(Zt?p:0)),s.length))===d)p=Yv(s,p,l);else{if(Kt(m,ye(s,d,p)),m.length===c)return m;for(var x=1;x<=y.length-1;x++)if(Kt(m,y[x]),m.length===c)return m;p=d=b}}return Kt(m,ye(s,d)),m}]},!Jv,Zt);var Dt={},tx={get exports(){return Dt},set exports(i){Dt=i}},xn={},ir={get exports(){return xn},set exports(i){xn=i}};(function(){var i,t,e,r,n,a;typeof performance<"u"&&performance!==null&&performance.now?ir.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ir.exports=function(){return(i()-n)/1e6},t=process.hrtime,i=function(){var o;return o=t(),o[0]*1e9+o[1]},r=i(),a=process.uptime()*1e9,n=r-a):Date.now?(ir.exports=function(){return Date.now()-e},e=Date.now()):(ir.exports=function(){return new Date().getTime()-e},e=new Date().getTime())}).call(pr);var ex=xn,xt=typeof window>"u"?pr:window,nr=["moz","webkit"],ne="AnimationFrame",oe=xt["request"+ne],Ce=xt["cancel"+ne]||xt["cancelRequest"+ne];for(var ve=0;!oe&&ve<nr.length;ve++)oe=xt[nr[ve]+"Request"+ne],Ce=xt[nr[ve]+"Cancel"+ne]||xt[nr[ve]+"CancelRequest"+ne];if(!oe||!Ce){var Hi=0,uo=0,kt=[],rx=1e3/60;oe=function(i){if(kt.length===0){var t=ex(),e=Math.max(0,rx-(t-Hi));Hi=e+t,setTimeout(function(){var r=kt.slice(0);kt.length=0;for(var n=0;n<r.length;n++)if(!r[n].cancelled)try{r[n].callback(Hi)}catch(a){setTimeout(function(){throw a},0)}},Math.round(e))}return kt.push({handle:++uo,callback:i,cancelled:!1}),uo},Ce=function(i){for(var t=0;t<kt.length;t++)kt[t].handle===i&&(kt[t].cancelled=!0)}}tx.exports=function(i){return oe.call(xt,i)};Dt.cancel=function(){Ce.apply(xt,arguments)};Dt.polyfill=function(i){i||(i=xt),i.requestAnimationFrame=oe,i.cancelAnimationFrame=Ce};var gh=`
|
||
\v\f\r \u2028\u2029\uFEFF`,ix=j,nx=pt,ax=mt,bn=gh,ho=ix("".replace),sx=RegExp("^["+bn+"]+"),ox=RegExp("(^|[^"+bn+"])["+bn+"]+$"),Ui=function(i){return function(t){var e=ax(nx(t));return i&1&&(e=ho(e,sx,"")),i&2&&(e=ho(e,ox,"$1")),e}},ux={start:Ui(1),end:Ui(2),trim:Ui(3)},hx=Nr.PROPER,lx=D,lo=gh,co="
",cx=function(i){return lx(function(){return!!lo[i]()||co[i]()!==co||hx&&lo[i].name!==i})},gx=tt,fx=ux.trim,px=cx;gx({target:"String",proto:!0,forced:px("trim")},{trim:function(){return fx(this)}});var wn=function(i){this.ok=!1,this.alpha=1,i.charAt(0)=="#"&&(i=i.substr(1,6)),i=i.replace(/ /g,""),i=i.toLowerCase();var t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};i=t[i]||i;for(var e=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3]),parseFloat(u[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(u){return[parseInt(u[1],16),parseInt(u[2],16),parseInt(u[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(u){return[parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16),parseInt(u[3]+u[3],16)]}}],r=0;r<e.length;r++){var n=e[r].re,a=e[r].process,o=n.exec(i);if(o){var s=a(o);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var u=this.r.toString(16),h=this.g.toString(16),l=this.b.toString(16);return u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),l.length==1&&(l="0"+l),"#"+u+h+l},this.getHelpXML=function(){for(var u=new Array,h=0;h<e.length;h++)for(var l=e[h].example,g=0;g<l.length;g++)u[u.length]=l[g];for(var f in t)u[u.length]=f;var c=document.createElement("ul");c.setAttribute("id","rgbcolor-examples");for(var h=0;h<u.length;h++)try{var d=document.createElement("li"),p=new RGBColor(u[h]),m=document.createElement("div");m.style.cssText="margin: 3px; border: 1px solid black; background:"+p.toHex()+"; color:"+p.toHex(),m.appendChild(document.createTextNode("test"));var y=document.createTextNode(" "+u[h]+" -> "+p.toRGB()+" -> "+p.toHex());d.appendChild(m),d.appendChild(y),c.appendChild(d)}catch{}return c}},dx=tt,mx=Ve,yx=au.indexOf,vx=uh,Sn=mx([].indexOf),fh=!!Sn&&1/Sn([1],1,-0)<0,xx=fh||!vx("indexOf");dx({target:"Array",proto:!0,forced:xx},{indexOf:function(i){var t=arguments.length>1?arguments[1]:void 0;return fh?Sn(this,i,t)||0:yx(this,i,t)}});var bx=tt,wx=j,Sx=ra,Tx=pt,go=mt,Ox=ia,Ax=wx("".indexOf);bx({target:"String",proto:!0,forced:!Ox("includes")},{includes:function(i){return!!~Ax(go(Tx(this)),go(Sx(i)),arguments.length>1?arguments[1]:void 0)}});var Cx=Bt,Ex=Array.isArray||function(i){return Cx(i)=="Array"},Px=tt,Nx=j,Mx=Ex,Vx=Nx([].reverse),fo=[1,2];Px({target:"Array",proto:!0,forced:String(fo)===String(fo.reverse())},{reverse:function(){return Mx(this)&&(this.length=this.length),Vx(this)}});/*! *****************************************************************************
|
||
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.
|
||
***************************************************************************** */var ph=function(i,t){return(ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])})(i,t)};function dh(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=i}ph(i,t),i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Rx(i){var t="";Array.isArray(i)||(i=[i]);for(var e=0;e<i.length;e++){var r=i[e];if(r.type===v.CLOSE_PATH)t+="z";else if(r.type===v.HORIZ_LINE_TO)t+=(r.relative?"h":"H")+r.x;else if(r.type===v.VERT_LINE_TO)t+=(r.relative?"v":"V")+r.y;else if(r.type===v.MOVE_TO)t+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===v.LINE_TO)t+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===v.CURVE_TO)t+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===v.SMOOTH_CURVE_TO)t+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===v.QUAD_TO)t+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===v.SMOOTH_QUAD_TO)t+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==v.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+e+".");t+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return t}function Tn(i,t){var e=i[0],r=i[1];return[e*Math.cos(t)-r*Math.sin(t),e*Math.sin(t)+r*Math.cos(t)]}function ot(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];for(var e=0;e<i.length;e++)if(typeof i[e]!="number")throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof i[e]+" == typeof "+i[e]);return!0}var Ot=Math.PI;function Xi(i,t,e){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;var r=i.rX,n=i.rY,a=i.x,o=i.y;r=Math.abs(i.rX),n=Math.abs(i.rY);var s=Tn([(t-a)/2,(e-o)/2],-i.xRot/180*Ot),u=s[0],h=s[1],l=Math.pow(u,2)/Math.pow(r,2)+Math.pow(h,2)/Math.pow(n,2);1<l&&(r*=Math.sqrt(l),n*=Math.sqrt(l)),i.rX=r,i.rY=n;var g=Math.pow(r,2)*Math.pow(h,2)+Math.pow(n,2)*Math.pow(u,2),f=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(n,2)-g)/g)),c=r*h/n*f,d=-n*u/r*f,p=Tn([c,d],i.xRot/180*Ot);i.cX=p[0]+(t+a)/2,i.cY=p[1]+(e+o)/2,i.phi1=Math.atan2((h-d)/n,(u-c)/r),i.phi2=Math.atan2((-h-d)/n,(-u-c)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*Ot),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*Ot),i.phi1*=180/Ot,i.phi2*=180/Ot}function po(i,t,e){ot(i,t,e);var r=i*i+t*t-e*e;if(0>r)return[];if(r===0)return[[i*e/(i*i+t*t),t*e/(i*i+t*t)]];var n=Math.sqrt(r);return[[(i*e+t*n)/(i*i+t*t),(t*e-i*n)/(i*i+t*t)],[(i*e-t*n)/(i*i+t*t),(t*e+i*n)/(i*i+t*t)]]}var B,yt=Math.PI/180;function mo(i,t,e){return(1-e)*i+e*t}function yo(i,t,e,r){return i+Math.cos(r/180*Ot)*t+Math.sin(r/180*Ot)*e}function vo(i,t,e,r){var n=1e-6,a=t-i,o=e-t,s=3*a+3*(r-e)-6*o,u=6*(o-a),h=3*a;return Math.abs(s)<n?[-h/u]:function(l,g,f){f===void 0&&(f=1e-6);var c=l*l/4-g;if(c<-f)return[];if(c<=f)return[-l/2];var d=Math.sqrt(c);return[-l/2-d,-l/2+d]}(u/s,h/s,n)}function xo(i,t,e,r,n){var a=1-n;return i*(a*a*a)+t*(3*a*a*n)+e*(3*a*n*n)+r*(n*n*n)}(function(i){function t(){return n(function(s,u,h){return s.relative&&(s.x1!==void 0&&(s.x1+=u),s.y1!==void 0&&(s.y1+=h),s.x2!==void 0&&(s.x2+=u),s.y2!==void 0&&(s.y2+=h),s.x!==void 0&&(s.x+=u),s.y!==void 0&&(s.y+=h),s.relative=!1),s})}function e(){var s=NaN,u=NaN,h=NaN,l=NaN;return n(function(g,f,c){return g.type&v.SMOOTH_CURVE_TO&&(g.type=v.CURVE_TO,s=isNaN(s)?f:s,u=isNaN(u)?c:u,g.x1=g.relative?f-s:2*f-s,g.y1=g.relative?c-u:2*c-u),g.type&v.CURVE_TO?(s=g.relative?f+g.x2:g.x2,u=g.relative?c+g.y2:g.y2):(s=NaN,u=NaN),g.type&v.SMOOTH_QUAD_TO&&(g.type=v.QUAD_TO,h=isNaN(h)?f:h,l=isNaN(l)?c:l,g.x1=g.relative?f-h:2*f-h,g.y1=g.relative?c-l:2*c-l),g.type&v.QUAD_TO?(h=g.relative?f+g.x1:g.x1,l=g.relative?c+g.y1:g.y1):(h=NaN,l=NaN),g})}function r(){var s=NaN,u=NaN;return n(function(h,l,g){if(h.type&v.SMOOTH_QUAD_TO&&(h.type=v.QUAD_TO,s=isNaN(s)?l:s,u=isNaN(u)?g:u,h.x1=h.relative?l-s:2*l-s,h.y1=h.relative?g-u:2*g-u),h.type&v.QUAD_TO){s=h.relative?l+h.x1:h.x1,u=h.relative?g+h.y1:h.y1;var f=h.x1,c=h.y1;h.type=v.CURVE_TO,h.x1=((h.relative?0:l)+2*f)/3,h.y1=((h.relative?0:g)+2*c)/3,h.x2=(h.x+2*f)/3,h.y2=(h.y+2*c)/3}else s=NaN,u=NaN;return h})}function n(s){var u=0,h=0,l=NaN,g=NaN;return function(f){if(isNaN(l)&&!(f.type&v.MOVE_TO))throw new Error("path must start with moveto");var c=s(f,u,h,l,g);return f.type&v.CLOSE_PATH&&(u=l,h=g),f.x!==void 0&&(u=f.relative?u+f.x:f.x),f.y!==void 0&&(h=f.relative?h+f.y:f.y),f.type&v.MOVE_TO&&(l=u,g=h),c}}function a(s,u,h,l,g,f){return ot(s,u,h,l,g,f),n(function(c,d,p,m){var y=c.x1,b=c.x2,x=c.relative&&!isNaN(m),w=c.x!==void 0?c.x:x?0:d,A=c.y!==void 0?c.y:x?0:p;function O(at){return at*at}c.type&v.HORIZ_LINE_TO&&u!==0&&(c.type=v.LINE_TO,c.y=c.relative?0:p),c.type&v.VERT_LINE_TO&&h!==0&&(c.type=v.LINE_TO,c.x=c.relative?0:d),c.x!==void 0&&(c.x=c.x*s+A*h+(x?0:g)),c.y!==void 0&&(c.y=w*u+c.y*l+(x?0:f)),c.x1!==void 0&&(c.x1=c.x1*s+c.y1*h+(x?0:g)),c.y1!==void 0&&(c.y1=y*u+c.y1*l+(x?0:f)),c.x2!==void 0&&(c.x2=c.x2*s+c.y2*h+(x?0:g)),c.y2!==void 0&&(c.y2=b*u+c.y2*l+(x?0:f));var S=s*l-u*h;if(c.xRot!==void 0&&(s!==1||u!==0||h!==0||l!==1))if(S===0)delete c.rX,delete c.rY,delete c.xRot,delete c.lArcFlag,delete c.sweepFlag,c.type=v.LINE_TO;else{var E=c.xRot*Math.PI/180,R=Math.sin(E),I=Math.cos(E),F=1/O(c.rX),N=1/O(c.rY),q=O(I)*F+O(R)*N,W=2*R*I*(F-N),H=O(R)*F+O(I)*N,Q=q*l*l-W*u*l+H*u*u,Y=W*(s*l+u*h)-2*(q*h*l+H*s*u),$=q*h*h-W*s*h+H*s*s,M=(Math.atan2(Y,Q-$)+Math.PI)%Math.PI/2,k=Math.sin(M),K=Math.cos(M);c.rX=Math.abs(S)/Math.sqrt(Q*O(K)+Y*k*K+$*O(k)),c.rY=Math.abs(S)/Math.sqrt(Q*O(k)-Y*k*K+$*O(K)),c.xRot=180*M/Math.PI}return c.sweepFlag!==void 0&&0>S&&(c.sweepFlag=+!c.sweepFlag),c})}function o(){return function(s){var u={};for(var h in s)u[h]=s[h];return u}}i.ROUND=function(s){function u(h){return Math.round(h*s)/s}return s===void 0&&(s=1e13),ot(s),function(h){return h.x1!==void 0&&(h.x1=u(h.x1)),h.y1!==void 0&&(h.y1=u(h.y1)),h.x2!==void 0&&(h.x2=u(h.x2)),h.y2!==void 0&&(h.y2=u(h.y2)),h.x!==void 0&&(h.x=u(h.x)),h.y!==void 0&&(h.y=u(h.y)),h.rX!==void 0&&(h.rX=u(h.rX)),h.rY!==void 0&&(h.rY=u(h.rY)),h}},i.TO_ABS=t,i.TO_REL=function(){return n(function(s,u,h){return s.relative||(s.x1!==void 0&&(s.x1-=u),s.y1!==void 0&&(s.y1-=h),s.x2!==void 0&&(s.x2-=u),s.y2!==void 0&&(s.y2-=h),s.x!==void 0&&(s.x-=u),s.y!==void 0&&(s.y-=h),s.relative=!0),s})},i.NORMALIZE_HVZ=function(s,u,h){return s===void 0&&(s=!0),u===void 0&&(u=!0),h===void 0&&(h=!0),n(function(l,g,f,c,d){if(isNaN(c)&&!(l.type&v.MOVE_TO))throw new Error("path must start with moveto");return u&&l.type&v.HORIZ_LINE_TO&&(l.type=v.LINE_TO,l.y=l.relative?0:f),h&&l.type&v.VERT_LINE_TO&&(l.type=v.LINE_TO,l.x=l.relative?0:g),s&&l.type&v.CLOSE_PATH&&(l.type=v.LINE_TO,l.x=l.relative?c-g:c,l.y=l.relative?d-f:d),l.type&v.ARC&&(l.rX===0||l.rY===0)&&(l.type=v.LINE_TO,delete l.rX,delete l.rY,delete l.xRot,delete l.lArcFlag,delete l.sweepFlag),l})},i.NORMALIZE_ST=e,i.QT_TO_C=r,i.INFO=n,i.SANITIZE=function(s){s===void 0&&(s=0),ot(s);var u=NaN,h=NaN,l=NaN,g=NaN;return n(function(f,c,d,p,m){var y=Math.abs,b=!1,x=0,w=0;if(f.type&v.SMOOTH_CURVE_TO&&(x=isNaN(u)?0:c-u,w=isNaN(h)?0:d-h),f.type&(v.CURVE_TO|v.SMOOTH_CURVE_TO)?(u=f.relative?c+f.x2:f.x2,h=f.relative?d+f.y2:f.y2):(u=NaN,h=NaN),f.type&v.SMOOTH_QUAD_TO?(l=isNaN(l)?c:2*c-l,g=isNaN(g)?d:2*d-g):f.type&v.QUAD_TO?(l=f.relative?c+f.x1:f.x1,g=f.relative?d+f.y1:f.y2):(l=NaN,g=NaN),f.type&v.LINE_COMMANDS||f.type&v.ARC&&(f.rX===0||f.rY===0||!f.lArcFlag)||f.type&v.CURVE_TO||f.type&v.SMOOTH_CURVE_TO||f.type&v.QUAD_TO||f.type&v.SMOOTH_QUAD_TO){var A=f.x===void 0?0:f.relative?f.x:f.x-c,O=f.y===void 0?0:f.relative?f.y:f.y-d;x=isNaN(l)?f.x1===void 0?x:f.relative?f.x:f.x1-c:l-c,w=isNaN(g)?f.y1===void 0?w:f.relative?f.y:f.y1-d:g-d;var S=f.x2===void 0?0:f.relative?f.x:f.x2-c,E=f.y2===void 0?0:f.relative?f.y:f.y2-d;y(A)<=s&&y(O)<=s&&y(x)<=s&&y(w)<=s&&y(S)<=s&&y(E)<=s&&(b=!0)}return f.type&v.CLOSE_PATH&&y(c-p)<=s&&y(d-m)<=s&&(b=!0),b?[]:f})},i.MATRIX=a,i.ROTATE=function(s,u,h){u===void 0&&(u=0),h===void 0&&(h=0),ot(s,u,h);var l=Math.sin(s),g=Math.cos(s);return a(g,l,-l,g,u-u*g+h*l,h-u*l-h*g)},i.TRANSLATE=function(s,u){return u===void 0&&(u=0),ot(s,u),a(1,0,0,1,s,u)},i.SCALE=function(s,u){return u===void 0&&(u=s),ot(s,u),a(s,0,0,u,0,0)},i.SKEW_X=function(s){return ot(s),a(1,0,Math.atan(s),1,0,0)},i.SKEW_Y=function(s){return ot(s),a(1,Math.atan(s),0,1,0,0)},i.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ot(s),a(-1,0,0,1,s,0)},i.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ot(s),a(1,0,0,-1,0,s)},i.A_TO_C=function(){return n(function(s,u,h){return v.ARC===s.type?function(l,g,f){var c,d,p,m;l.cX||Xi(l,g,f);for(var y=Math.min(l.phi1,l.phi2),b=Math.max(l.phi1,l.phi2)-y,x=Math.ceil(b/90),w=new Array(x),A=g,O=f,S=0;S<x;S++){var E=mo(l.phi1,l.phi2,S/x),R=mo(l.phi1,l.phi2,(S+1)/x),I=R-E,F=4/3*Math.tan(I*yt/4),N=[Math.cos(E*yt)-F*Math.sin(E*yt),Math.sin(E*yt)+F*Math.cos(E*yt)],q=N[0],W=N[1],H=[Math.cos(R*yt),Math.sin(R*yt)],Q=H[0],Y=H[1],$=[Q+F*Math.sin(R*yt),Y-F*Math.cos(R*yt)],M=$[0],k=$[1];w[S]={relative:l.relative,type:v.CURVE_TO};var K=function(at,ct){var Tt=Tn([at*l.rX,ct*l.rY],l.xRot),Gt=Tt[0],_e=Tt[1];return[l.cX+Gt,l.cY+_e]};c=K(q,W),w[S].x1=c[0],w[S].y1=c[1],d=K(M,k),w[S].x2=d[0],w[S].y2=d[1],p=K(Q,Y),w[S].x=p[0],w[S].y=p[1],l.relative&&(w[S].x1-=A,w[S].y1-=O,w[S].x2-=A,w[S].y2-=O,w[S].x-=A,w[S].y-=O),A=(m=[w[S].x,w[S].y])[0],O=m[1]}return w}(s,s.relative?0:u,s.relative?0:h):s})},i.ANNOTATE_ARCS=function(){return n(function(s,u,h){return s.relative&&(u=0,h=0),v.ARC===s.type&&Xi(s,u,h),s})},i.CLONE=o,i.CALCULATE_BOUNDS=function(){var s=function(f){var c={};for(var d in f)c[d]=f[d];return c},u=t(),h=r(),l=e(),g=n(function(f,c,d){var p=l(h(u(s(f))));function m(k){k>g.maxX&&(g.maxX=k),k<g.minX&&(g.minX=k)}function y(k){k>g.maxY&&(g.maxY=k),k<g.minY&&(g.minY=k)}if(p.type&v.DRAWING_COMMANDS&&(m(c),y(d)),p.type&v.HORIZ_LINE_TO&&m(p.x),p.type&v.VERT_LINE_TO&&y(p.y),p.type&v.LINE_TO&&(m(p.x),y(p.y)),p.type&v.CURVE_TO){m(p.x),y(p.y);for(var b=0,x=vo(c,p.x1,p.x2,p.x);b<x.length;b++)0<(M=x[b])&&1>M&&m(xo(c,p.x1,p.x2,p.x,M));for(var w=0,A=vo(d,p.y1,p.y2,p.y);w<A.length;w++)0<(M=A[w])&&1>M&&y(xo(d,p.y1,p.y2,p.y,M))}if(p.type&v.ARC){m(p.x),y(p.y),Xi(p,c,d);for(var O=p.xRot/180*Math.PI,S=Math.cos(O)*p.rX,E=Math.sin(O)*p.rX,R=-Math.sin(O)*p.rY,I=Math.cos(O)*p.rY,F=p.phi1<p.phi2?[p.phi1,p.phi2]:-180>p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],N=F[0],q=F[1],W=function(k){var K=k[0],at=k[1],ct=180*Math.atan2(at,K)/Math.PI;return ct<N?ct+360:ct},H=0,Q=po(R,-S,0).map(W);H<Q.length;H++)(M=Q[H])>N&&M<q&&m(yo(p.cX,S,R,M));for(var Y=0,$=po(I,-E,0).map(W);Y<$.length;Y++){var M;(M=$[Y])>N&&M<q&&y(yo(p.cY,E,I,M))}}return f});return g.minX=1/0,g.maxX=-1/0,g.minY=1/0,g.maxY=-1/0,g}})(B||(B={}));var st,mh=function(){function i(){}return i.prototype.round=function(t){return this.transform(B.ROUND(t))},i.prototype.toAbs=function(){return this.transform(B.TO_ABS())},i.prototype.toRel=function(){return this.transform(B.TO_REL())},i.prototype.normalizeHVZ=function(t,e,r){return this.transform(B.NORMALIZE_HVZ(t,e,r))},i.prototype.normalizeST=function(){return this.transform(B.NORMALIZE_ST())},i.prototype.qtToC=function(){return this.transform(B.QT_TO_C())},i.prototype.aToC=function(){return this.transform(B.A_TO_C())},i.prototype.sanitize=function(t){return this.transform(B.SANITIZE(t))},i.prototype.translate=function(t,e){return this.transform(B.TRANSLATE(t,e))},i.prototype.scale=function(t,e){return this.transform(B.SCALE(t,e))},i.prototype.rotate=function(t,e,r){return this.transform(B.ROTATE(t,e,r))},i.prototype.matrix=function(t,e,r,n,a,o){return this.transform(B.MATRIX(t,e,r,n,a,o))},i.prototype.skewX=function(t){return this.transform(B.SKEW_X(t))},i.prototype.skewY=function(t){return this.transform(B.SKEW_Y(t))},i.prototype.xSymmetry=function(t){return this.transform(B.X_AXIS_SYMMETRY(t))},i.prototype.ySymmetry=function(t){return this.transform(B.Y_AXIS_SYMMETRY(t))},i.prototype.annotateArcs=function(){return this.transform(B.ANNOTATE_ARCS())},i}(),kx=function(i){return i===" "||i===" "||i==="\r"||i===`
|
||
`},bo=function(i){return"0".charCodeAt(0)<=i.charCodeAt(0)&&i.charCodeAt(0)<="9".charCodeAt(0)},Ix=function(i){function t(){var e=i.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return dh(t,i),t.prototype.finish=function(e){if(e===void 0&&(e=[]),this.parse(" ",e),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e},t.prototype.parse=function(e,r){var n=this;r===void 0&&(r=[]);for(var a=function(g){r.push(g),n.curArgs.length=0,n.canParseCommandOrComma=!0},o=0;o<e.length;o++){var s=e[o],u=!(this.curCommandType!==v.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),h=bo(s)&&(this.curNumber==="0"&&s==="0"||u);if(!bo(s)||h)if(s!=="e"&&s!=="E")if(s!=="-"&&s!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(s!=="."||this.curNumberHasExp||this.curNumberHasDecimal||u){if(this.curNumber&&this.curCommandType!==-1){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===v.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>l)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(l),this.curArgs.length===_x[this.curCommandType]&&(v.HORIZ_LINE_TO===this.curCommandType?a({type:v.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):v.VERT_LINE_TO===this.curCommandType?a({type:v.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===v.MOVE_TO||this.curCommandType===v.LINE_TO||this.curCommandType===v.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),v.MOVE_TO===this.curCommandType&&(this.curCommandType=v.LINE_TO)):this.curCommandType===v.CURVE_TO?a({type:v.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===v.SMOOTH_CURVE_TO?a({type:v.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===v.QUAD_TO?a({type:v.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===v.ARC&&a({type:v.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!kx(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(h)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=v.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=v.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=v.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=v.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=v.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=v.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=v.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=v.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=v.ARC,this.curCommandRelative=s==="a"}else r.push({type:v.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(r,n){n===void 0&&(n=[]);for(var a=0,o=Object.getPrototypeOf(this).parse.call(this,r);a<o.length;a++){var s=o[a],u=e(s);Array.isArray(u)?n.push.apply(n,u):n.push(u)}return n}}})},t}(mh),v=function(i){function t(e){var r=i.call(this)||this;return r.commands=typeof e=="string"?t.parse(e):e,r}return dh(t,i),t.prototype.encode=function(){return t.encode(this.commands)},t.prototype.getBounds=function(){var e=B.CALCULATE_BOUNDS();return this.transform(e),e},t.prototype.transform=function(e){for(var r=[],n=0,a=this.commands;n<a.length;n++){var o=e(a[n]);Array.isArray(o)?r.push.apply(r,o):r.push(o)}return this.commands=r,this},t.encode=function(e){return Rx(e)},t.parse=function(e){var r=new Ix,n=[];return r.parse(e,n),r.finish(n),n},t.CLOSE_PATH=1,t.MOVE_TO=2,t.HORIZ_LINE_TO=4,t.VERT_LINE_TO=8,t.LINE_TO=16,t.CURVE_TO=32,t.SMOOTH_CURVE_TO=64,t.QUAD_TO=128,t.SMOOTH_QUAD_TO=256,t.ARC=512,t.LINE_COMMANDS=t.LINE_TO|t.HORIZ_LINE_TO|t.VERT_LINE_TO,t.DRAWING_COMMANDS=t.HORIZ_LINE_TO|t.VERT_LINE_TO|t.LINE_TO|t.CURVE_TO|t.SMOOTH_CURVE_TO|t.QUAD_TO|t.SMOOTH_QUAD_TO|t.ARC,t}(mh),_x=((st={})[v.MOVE_TO]=2,st[v.LINE_TO]=2,st[v.HORIZ_LINE_TO]=1,st[v.VERT_LINE_TO]=1,st[v.CLOSE_PATH]=0,st[v.QUAD_TO]=4,st[v.SMOOTH_QUAD_TO]=2,st[v.CURVE_TO]=6,st[v.SMOOTH_CURVE_TO]=4,st[v.ARC]=7,st),Lx=G,Dx=ht,jx=Or,Fx=Hu,wo=RegExp.prototype,zx=function(i){var t=i.flags;return t===void 0&&!("flags"in wo)&&!Dx(i,"flags")&&jx(wo,i)?Lx(Fx,i):t},Bx=Nr.PROPER,Hx=Xt,Ux=Z,So=mt,Xx=D,Yx=zx,oa="toString",Gx=RegExp.prototype,yh=Gx[oa],qx=Xx(function(){return yh.call({source:"a",flags:"b"})!="/a/b"}),Wx=Bx&&yh.name!=oa;(qx||Wx)&&Hx(RegExp.prototype,oa,function(){var i=Ux(this),t=So(i.source),e=So(Yx(i));return"/"+t+"/"+e},{unsafe:!0});function fr(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fr=function(t){return typeof t}:fr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(i)}function Qx(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var $x=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Zx=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Kx(i,t,e,r,n){if(typeof i=="string"&&(i=document.getElementById(i)),!i||fr(i)!=="object"||!("getContext"in i))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=i.getContext("2d");try{return a.getImageData(t,e,r,n)}catch(o){throw new Error("unable to access image data: "+o)}}function Jx(i,t,e,r,n,a){if(!(isNaN(a)||a<1)){a|=0;var o=Kx(i,t,e,r,n);o=t1(o,t,e,r,n,a),i.getContext("2d").putImageData(o,t,e)}}function t1(i,t,e,r,n,a){for(var o=i.data,s=2*a+1,u=r-1,h=n-1,l=a+1,g=l*(l+1)/2,f=new To,c=f,d,p=1;p<s;p++)c=c.next=new To,p===l&&(d=c);c.next=f;for(var m=null,y=null,b=0,x=0,w=$x[a],A=Zx[a],O=0;O<n;O++){c=f;for(var S=o[x],E=o[x+1],R=o[x+2],I=o[x+3],F=0;F<l;F++)c.r=S,c.g=E,c.b=R,c.a=I,c=c.next;for(var N=0,q=0,W=0,H=0,Q=l*S,Y=l*E,$=l*R,M=l*I,k=g*S,K=g*E,at=g*R,ct=g*I,Tt=1;Tt<l;Tt++){var Gt=x+((u<Tt?u:Tt)<<2),_e=o[Gt],la=o[Gt+1],ca=o[Gt+2],ga=o[Gt+3],Le=l-Tt;k+=(c.r=_e)*Le,K+=(c.g=la)*Le,at+=(c.b=ca)*Le,ct+=(c.a=ga)*Le,N+=_e,q+=la,W+=ca,H+=ga,c=c.next}m=f,y=d;for(var Hr=0;Hr<r;Hr++){var Ur=ct*w>>A;if(o[x+3]=Ur,Ur!==0){var Xr=255/Ur;o[x]=(k*w>>A)*Xr,o[x+1]=(K*w>>A)*Xr,o[x+2]=(at*w>>A)*Xr}else o[x]=o[x+1]=o[x+2]=0;k-=Q,K-=Y,at-=$,ct-=M,Q-=m.r,Y-=m.g,$-=m.b,M-=m.a;var Pt=Hr+a+1;Pt=b+(Pt<u?Pt:u)<<2,N+=m.r=o[Pt],q+=m.g=o[Pt+1],W+=m.b=o[Pt+2],H+=m.a=o[Pt+3],k+=N,K+=q,at+=W,ct+=H,m=m.next;var De=y,fa=De.r,pa=De.g,da=De.b,ma=De.a;Q+=fa,Y+=pa,$+=da,M+=ma,N-=fa,q-=pa,W-=da,H-=ma,y=y.next,x+=4}b+=r}for(var qt=0;qt<r;qt++){x=qt<<2;var Nt=o[x],Mt=o[x+1],Vt=o[x+2],et=o[x+3],Yr=l*Nt,Gr=l*Mt,qr=l*Vt,Wr=l*et,je=g*Nt,Fe=g*Mt,ze=g*Vt,Be=g*et;c=f;for(var ya=0;ya<l;ya++)c.r=Nt,c.g=Mt,c.b=Vt,c.a=et,c=c.next;for(var va=r,Qr=0,$r=0,Zr=0,Kr=0,He=1;He<=a;He++){x=va+qt<<2;var Ue=l-He;je+=(c.r=Nt=o[x])*Ue,Fe+=(c.g=Mt=o[x+1])*Ue,ze+=(c.b=Vt=o[x+2])*Ue,Be+=(c.a=et=o[x+3])*Ue,Kr+=Nt,Qr+=Mt,$r+=Vt,Zr+=et,c=c.next,He<h&&(va+=r)}x=qt,m=f,y=d;for(var Jr=0;Jr<n;Jr++){var rt=x<<2;o[rt+3]=et=Be*w>>A,et>0?(et=255/et,o[rt]=(je*w>>A)*et,o[rt+1]=(Fe*w>>A)*et,o[rt+2]=(ze*w>>A)*et):o[rt]=o[rt+1]=o[rt+2]=0,je-=Yr,Fe-=Gr,ze-=qr,Be-=Wr,Yr-=m.r,Gr-=m.g,qr-=m.b,Wr-=m.a,rt=qt+((rt=Jr+l)<h?rt:h)*r<<2,je+=Kr+=m.r=o[rt],Fe+=Qr+=m.g=o[rt+1],ze+=$r+=m.b=o[rt+2],Be+=Zr+=m.a=o[rt+3],m=m.next,Yr+=Nt=y.r,Gr+=Mt=y.g,qr+=Vt=y.b,Wr+=et=y.a,Kr-=Nt,Qr-=Mt,$r-=Vt,Zr-=et,y=y.next,x+=r}}return i}var To=function i(){Qx(this,i),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function e1(){var{DOMParser:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:i,createCanvas(e,r){return new OffscreenCanvas(e,r)},createImage(e){return bt(function*(){var r=yield fetch(e),n=yield r.blob(),a=yield createImageBitmap(n);return a})()}};return(typeof DOMParser<"u"||typeof i>"u")&&Reflect.deleteProperty(t,"DOMParser"),t}function r1(i){var{DOMParser:t,canvas:e,fetch:r}=i;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:r,createCanvas:e.createCanvas,createImage:e.loadImage}}var Tb=Object.freeze({__proto__:null,offscreen:e1,node:r1});function ge(i){return i.replace(/(?!\u3000)\s+/gm," ")}function i1(i){return i.replace(/^[\n \t]+/,"")}function n1(i){return i.replace(/[\n \t]+$/,"")}function nt(i){var t=(i||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return t.map(parseFloat)}var a1=/^[A-Z-]+$/;function s1(i){return a1.test(i)?i.toLowerCase():i}function vh(i){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(i)||[];return t[2]||t[3]||t[4]}function o1(i){if(!i.startsWith("rgb"))return i;var t=3,e=i.replace(/\d+(\.\d+)?/g,(r,n)=>t--&&n?String(Math.round(parseFloat(r))):r);return e}var u1=/(\[[^\]]+\])/g,h1=/(#[^\s+>~.[:]+)/g,l1=/(\.[^\s+>~.[:]+)/g,c1=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,g1=/(:[\w-]+\([^)]*\))/gi,f1=/(:[^\s+>~.[:]+)/g,p1=/([^\s+>~.[:]+)/g;function It(i,t){var e=t.exec(i);return e?[i.replace(t," "),e.length]:[i,0]}function d1(i){var t=[0,0,0],e=i.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[e,r]=It(e,u1),t[1]+=r,[e,r]=It(e,h1),t[0]+=r,[e,r]=It(e,l1),t[1]+=r,[e,r]=It(e,c1),t[2]+=r,[e,r]=It(e,g1),t[1]+=r,[e,r]=It(e,f1),t[1]+=r,e=e.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[e,r]=It(e,p1),t[2]+=r,t.join("")}var ae=1e-8;function Oo(i){return Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2))}function On(i,t){return(i[0]*t[0]+i[1]*t[1])/(Oo(i)*Oo(t))}function Ao(i,t){return(i[0]*t[1]<i[1]*t[0]?-1:1)*Math.acos(On(i,t))}function Co(i){return i*i*i}function Eo(i){return 3*i*i*(1-i)}function Po(i){return 3*i*(1-i)*(1-i)}function No(i){return(1-i)*(1-i)*(1-i)}function Mo(i){return i*i}function Vo(i){return 2*i*(1-i)}function Ro(i){return(1-i)*(1-i)}class T{constructor(t,e,r){this.document=t,this.name=e,this.value=r,this.isNormalizedColor=!1}static empty(t){return new T(t,"EMPTY","")}split(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ",{document:e,name:r}=this;return ge(this.getString()).trim().split(t).map(n=>new T(e,r,n))}hasValue(t){var{value:e}=this;return e!==null&&e!==""&&(t||e!==0)&&typeof e<"u"}isString(t){var{value:e}=this,r=typeof e=="string";return!r||!t?r:t.test(e)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}setValue(t){return this.value=t,this}getValue(t){return typeof t>"u"||this.hasValue()?this.value:t}getNumber(t){if(!this.hasValue())return typeof t>"u"?0:parseFloat(t);var{value:e}=this,r=parseFloat(e);return this.isString(/%$/)&&(r/=100),r}getString(t){return typeof t>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(t)}getColor(t){var e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=o1(e),this.value=e),e}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,n]=typeof t=="boolean"?[void 0,t]:[t],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&n):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(r);default:{var o=this.getNumber();return e&&o<1?o*a.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var t=this.getString(),e=/#([^)'"]+)/.exec(t);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}getFillStyleDefinition(t,e){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,t,e);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var n=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),n.hasValue()&&r.getAttribute("patternTransform",!0).setValue(n.value)}return r.createPattern(this.document.ctx,t,e)}return null}getTextBaseline(){return this.hasValue()?T.textBaselineMapping[this.getString()]:null}addOpacity(t){for(var e=this.getColor(),r=e.length,n=0,a=0;a<r&&(e[a]===","&&n++,n!==3);a++);if(t.hasValue()&&this.isString()&&n!==3){var o=new wn(e);o.ok&&(o.alpha=t.getNumber(),e=o.toRGBA())}return new T(this.document,this.name,e)}}T.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class m1{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(t,e){this.viewPorts.push({width:t,height:e})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:t}=this;return t[t.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(t){return typeof t=="number"?t:t==="x"?this.width:t==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class L{constructor(t,e){this.x=t,this.y=e}static parse(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,[r=e,n=e]=nt(t);return new L(r,n)}static parseScale(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=e,n=r]=nt(t);return new L(r,n)}static parsePath(t){for(var e=nt(t),r=e.length,n=[],a=0;a<r;a+=2)n.push(new L(e[a],e[a+1]));return n}angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}applyTransform(t){var{x:e,y:r}=this,n=e*t[0]+r*t[2]+t[4],a=e*t[1]+r*t[3]+t[5];this.x=n,this.y=a}}class y1{constructor(t){this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:t,onClick:e,onMouseMove:r}=this,n=t.ctx.canvas;n.onclick=e,n.onmousemove=r,this.working=!0}}stop(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:t,events:e,eventElements:r}=this,{style:n}=t.ctx.canvas;n&&(n.cursor=""),e.forEach((a,o)=>{for(var{run:s}=a,u=r[o];u;)s(u),u=u.parent}),this.events=[],this.eventElements=[]}}checkPath(t,e){if(!(!this.working||!e)){var{events:r,eventElements:n}=this;r.forEach((a,o)=>{var{x:s,y:u}=a;!n[o]&&e.isPointInPath&&e.isPointInPath(s,u)&&(n[o]=t)})}}checkBoundingBox(t,e){if(!(!this.working||!e)){var{events:r,eventElements:n}=this;r.forEach((a,o)=>{var{x:s,y:u}=a;!n[o]&&e.isPointInBox(s,u)&&(n[o]=t)})}}mapXY(t,e){for(var{window:r,ctx:n}=this.screen,a=new L(t,e),o=n.canvas;o;)a.x-=o.offsetLeft,a.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(a.x+=r.scrollX),r.scrollY&&(a.y+=r.scrollY),a}onClick(t){var{x:e,y:r}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onclick",x:e,y:r,run(n){n.onClick&&n.onClick()}})}onMouseMove(t){var{x:e,y:r}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onmousemove",x:e,y:r,run(n){n.onMouseMove&&n.onMouseMove()}})}}var xh=typeof window<"u"?window:null,bh=typeof fetch<"u"?fetch.bind(void 0):null;class jr{constructor(t){var{fetch:e=bh,window:r=xh}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new m1,this.mouse=new y1(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=e}wait(t){this.waits.push(t)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var t=this.waits.every(e=>e());return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}setViewBox(t){var{document:e,ctx:r,aspectRatio:n,width:a,desiredWidth:o,height:s,desiredHeight:u,minX:h=0,minY:l=0,refX:g,refY:f,clip:c=!1,clipX:d=0,clipY:p=0}=t,m=ge(n).replace(/^defer\s/,""),[y,b]=m.split(" "),x=y||"xMidYMid",w=b||"meet",A=a/o,O=s/u,S=Math.min(A,O),E=Math.max(A,O),R=o,I=u;w==="meet"&&(R*=S,I*=S),w==="slice"&&(R*=E,I*=E);var F=new T(e,"refX",g),N=new T(e,"refY",f),q=F.hasValue()&&N.hasValue();if(q&&r.translate(-S*F.getPixels("x"),-S*N.getPixels("y")),c){var W=S*d,H=S*p;r.beginPath(),r.moveTo(W,H),r.lineTo(a,H),r.lineTo(a,s),r.lineTo(W,s),r.closePath(),r.clip()}if(!q){var Q=w==="meet"&&S===O,Y=w==="slice"&&E===O,$=w==="meet"&&S===A,M=w==="slice"&&E===A;x.startsWith("xMid")&&(Q||Y)&&r.translate(a/2-R/2,0),x.endsWith("YMid")&&($||M)&&r.translate(0,s/2-I/2),x.startsWith("xMax")&&(Q||Y)&&r.translate(a-R,0),x.endsWith("YMax")&&($||M)&&r.translate(0,s-I)}switch(!0){case x==="none":r.scale(A,O);break;case w==="meet":r.scale(S,S);break;case w==="slice":r.scale(E,E);break}r.translate(-h,-l)}start(t){var{enableRedraw:e=!1,ignoreMouse:r=!1,ignoreAnimation:n=!1,ignoreDimensions:a=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:u,scaleHeight:h,offsetX:l,offsetY:g}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:f,mouse:c}=this,d=1e3/f;if(this.frameDuration=d,this.readyPromise=new Promise(x=>{this.resolveReady=x}),this.isReady()&&this.render(t,a,o,u,h,l,g),!!e){var p=Date.now(),m=p,y=0,b=()=>{p=Date.now(),y=p-m,y>=d&&(m=p-y%d,this.shouldUpdate(n,s)&&(this.render(t,a,o,u,h,l,g),c.runEvents())),this.intervalId=Dt(b)};r||c.start(),this.intervalId=Dt(b)}}stop(){this.intervalId&&(Dt.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(t,e){if(!t){var{frameDuration:r}=this,n=this.animations.reduce((a,o)=>o.update(r)||a,!1);if(n)return!0}return!!(typeof e=="function"&&e()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(t,e,r,n,a,o,s){var{CLIENT_WIDTH:u,CLIENT_HEIGHT:h,viewPort:l,ctx:g,isFirstRender:f}=this,c=g.canvas;l.clear(),c.width&&c.height?l.setCurrent(c.width,c.height):l.setCurrent(u,h);var d=t.getStyle("width"),p=t.getStyle("height");!e&&(f||typeof n!="number"&&typeof a!="number")&&(d.hasValue()&&(c.width=d.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),p.hasValue()&&(c.height=p.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var m=c.clientWidth||c.width,y=c.clientHeight||c.height;if(e&&d.hasValue()&&p.hasValue()&&(m=d.getPixels("x"),y=p.getPixels("y")),l.setCurrent(m,y),typeof o=="number"&&t.getAttribute("x",!0).setValue(o),typeof s=="number"&&t.getAttribute("y",!0).setValue(s),typeof n=="number"||typeof a=="number"){var b=nt(t.getAttribute("viewBox").getString()),x=0,w=0;if(typeof n=="number"){var A=t.getStyle("width");A.hasValue()?x=A.getPixels("x")/n:isNaN(b[2])||(x=b[2]/n)}if(typeof a=="number"){var O=t.getStyle("height");O.hasValue()?w=O.getPixels("y")/a:isNaN(b[3])||(w=b[3]/a)}x||(x=w),w||(w=x),t.getAttribute("width",!0).setValue(n),t.getAttribute("height",!0).setValue(a);var S=t.getStyle("transform",!0,!0);S.setValue("".concat(S.getString()," scale(").concat(1/x,", ").concat(1/w,")"))}r||g.clearRect(0,0,m,y),t.render(g),f&&(this.isFirstRender=!1)}}jr.defaultWindow=xh;jr.defaultFetch=bh;var{defaultFetch:v1}=jr,x1=typeof DOMParser<"u"?DOMParser:null;class Yi{constructor(){var{fetch:t=v1,DOMParser:e=x1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=t,this.DOMParser=e}parse(t){var e=this;return bt(function*(){return t.startsWith("<")?e.parseFromString(t):e.load(t)})()}parseFromString(t){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch{return this.checkDocument(e.parseFromString(t,"text/xml"))}}checkDocument(t){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent);return t}load(t){var e=this;return bt(function*(){var r=yield e.fetch(t),n=yield r.text();return e.parseFromString(n)})()}}class b1{constructor(t,e){this.type="translate",this.point=null,this.point=L.parse(e)}apply(t){var{x:e,y:r}=this.point;t.translate(e||0,r||0)}unapply(t){var{x:e,y:r}=this.point;t.translate(-1*e||0,-1*r||0)}applyToPoint(t){var{x:e,y:r}=this.point;t.applyTransform([1,0,0,1,e||0,r||0])}}class w1{constructor(t,e,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var n=nt(e);this.angle=new T(t,"angle",n[0]),this.originX=r[0],this.originY=r[1],this.cx=n[1]||0,this.cy=n[2]||0}apply(t){var{cx:e,cy:r,originX:n,originY:a,angle:o}=this,s=e+n.getPixels("x"),u=r+a.getPixels("y");t.translate(s,u),t.rotate(o.getRadians()),t.translate(-s,-u)}unapply(t){var{cx:e,cy:r,originX:n,originY:a,angle:o}=this,s=e+n.getPixels("x"),u=r+a.getPixels("y");t.translate(s,u),t.rotate(-1*o.getRadians()),t.translate(-s,-u)}applyToPoint(t){var{cx:e,cy:r,angle:n}=this,a=n.getRadians();t.applyTransform([1,0,0,1,e||0,r||0]),t.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),t.applyTransform([1,0,0,1,-e||0,-r||0])}}class S1{constructor(t,e,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var n=L.parseScale(e);(n.x===0||n.y===0)&&(n.x=ae,n.y=ae),this.scale=n,this.originX=r[0],this.originY=r[1]}apply(t){var{scale:{x:e,y:r},originX:n,originY:a}=this,o=n.getPixels("x"),s=a.getPixels("y");t.translate(o,s),t.scale(e,r||e),t.translate(-o,-s)}unapply(t){var{scale:{x:e,y:r},originX:n,originY:a}=this,o=n.getPixels("x"),s=a.getPixels("y");t.translate(o,s),t.scale(1/e,1/r||e),t.translate(-o,-s)}applyToPoint(t){var{x:e,y:r}=this.scale;t.applyTransform([e||0,0,0,r||0,0,0])}}class wh{constructor(t,e,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=nt(e),this.originX=r[0],this.originY=r[1]}apply(t){var{originX:e,originY:r,matrix:n}=this,a=e.getPixels("x"),o=r.getPixels("y");t.translate(a,o),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),t.translate(-a,-o)}unapply(t){var{originX:e,originY:r,matrix:n}=this,a=n[0],o=n[2],s=n[4],u=n[1],h=n[3],l=n[5],g=0,f=0,c=1,d=1/(a*(h*c-l*f)-o*(u*c-l*g)+s*(u*f-h*g)),p=e.getPixels("x"),m=r.getPixels("y");t.translate(p,m),t.transform(d*(h*c-l*f),d*(l*g-u*c),d*(s*f-o*c),d*(a*c-s*g),d*(o*l-s*h),d*(s*u-a*l)),t.translate(-p,-m)}applyToPoint(t){t.applyTransform(this.matrix)}}class Sh extends wh{constructor(t,e,r){super(t,e,r),this.type="skew",this.angle=null,this.angle=new T(t,"angle",e)}}class T1 extends Sh{constructor(t,e,r){super(t,e,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class O1 extends Sh{constructor(t,e,r){super(t,e,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function A1(i){return ge(i).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function C1(i){var[t,e]=i.split("(");return[t.trim(),e.trim().replace(")","")]}class zt{constructor(t,e,r){this.document=t,this.transforms=[];var n=A1(e);n.forEach(a=>{if(a!=="none"){var[o,s]=C1(a),u=zt.transformTypes[o];typeof u<"u"&&this.transforms.push(new u(this.document,s,r))}})}static fromElement(t,e){var r=e.getStyle("transform",!1,!0),[n,a=n]=e.getStyle("transform-origin",!1,!0).split(),o=[n,a];return r.hasValue()?new zt(t,r.getString(),o):null}apply(t){for(var{transforms:e}=this,r=e.length,n=0;n<r;n++)e[n].apply(t)}unapply(t){for(var{transforms:e}=this,r=e.length,n=r-1;n>=0;n--)e[n].unapply(t)}applyToPoint(t){for(var{transforms:e}=this,r=e.length,n=0;n<r;n++)e[n].applyToPoint(t)}}zt.transformTypes={translate:b1,rotate:w1,scale:S1,matrix:wh,skewX:T1,skewY:O1};class V{constructor(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=t,this.node=e,this.captureTextNodes=r,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!e||e.nodeType!==1)){if(Array.from(e.attributes).forEach(s=>{var u=s1(s.nodeName);this.attributes[u]=new T(t,u,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var n=this.getAttribute("style").getString().split(";").map(s=>s.trim());n.forEach(s=>{if(s){var[u,h]=s.split(":").map(l=>l.trim());this.styles[u]=new T(t,u,h)}})}var{definitions:a}=t,o=this.getAttribute("id");o.hasValue()&&(a[o.getString()]||(a[o.getString()]=this)),Array.from(e.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var u=t.createTextNode(s);u.getText().length>0&&this.addChild(u)}})}}getAttribute(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[t];if(!r&&e){var n=new T(this.document,t,"");return this.attributes[t]=n,n}return r||T.empty(this.document)}getHrefAttribute(){for(var t in this.attributes)if(t==="href"||t.endsWith(":href"))return this.attributes[t];return T.empty(this.document)}getStyle(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.styles[t];if(n)return n;var a=this.getAttribute(t);if(a!=null&&a.hasValue())return this.styles[t]=a,a;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(t);if(s!=null&&s.hasValue())return s}}if(e){var u=new T(this.document,t,"");return this.styles[t]=u,u}return n||T.empty(this.document)}render(t){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}setContext(t){}applyEffects(t){var e=zt.fromElement(this.document,this);e&&e.apply(t);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var n=r.getDefinition();n&&n.apply(t)}}clearContext(t){}renderChildren(t){this.children.forEach(e=>{e.render(t)})}addChild(t){var e=t instanceof V?t:this.document.createElement(t);e.parent=this,V.ignoreChildTypes.includes(e.type)||this.children.push(e)}matchesSelector(t){var e,{node:r}=this;if(typeof r.matches=="function")return r.matches(t);var n=(e=r.getAttribute)===null||e===void 0?void 0:e.call(r,"class");return!n||n===""?!1:n.split(" ").some(a=>".".concat(a)===t)}addStylesFromStyleDefinition(){var{styles:t,stylesSpecificity:e}=this.document;for(var r in t)if(!r.startsWith("@")&&this.matchesSelector(r)){var n=t[r],a=e[r];if(n)for(var o in n){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),a>=s&&(this.styles[o]=n[o],this.stylesSpecificity[o]=a)}}}removeStyles(t,e){var r=e.reduce((n,a)=>{var o=t.getStyle(a);if(!o.hasValue())return n;var s=o.getString();return o.setValue(""),[...n,[a,s]]},[]);return r}restoreStyles(t,e){e.forEach(r=>{var[n,a]=r;t.getStyle(n,!0).setValue(a)})}isFirstChild(){var t;return((t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))===0}}V.ignoreChildTypes=["title"];class E1 extends V{constructor(t,e,r){super(t,e,r)}}function P1(i){var t=i.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function N1(i){return typeof process>"u"?i:i.trim().split(",").map(P1).join(",")}function M1(i){if(!i)return"";var t=i.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function V1(i){if(!i)return"";var t=i.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}class J{constructor(t,e,r,n,a,o){var s=o?typeof o=="string"?J.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=n||s.fontSize,this.fontStyle=t||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=e||s.fontVariant}static parse(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r="",n="",a="",o="",s="",u=ge(t).trim().split(" "),h={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach(l=>{switch(!0){case(!h.fontStyle&&J.styles.includes(l)):l!=="inherit"&&(r=l),h.fontStyle=!0;break;case(!h.fontVariant&&J.variants.includes(l)):l!=="inherit"&&(n=l),h.fontStyle=!0,h.fontVariant=!0;break;case(!h.fontWeight&&J.weights.includes(l)):l!=="inherit"&&(a=l),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0;break;case!h.fontSize:l!=="inherit"&&([o]=l.split("/")),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0,h.fontSize=!0;break;default:l!=="inherit"&&(s+=l)}}),new J(r,n,a,o,s,e)}toString(){return[M1(this.fontStyle),this.fontVariant,V1(this.fontWeight),this.fontSize,N1(this.fontFamily)].join(" ").trim()}}J.styles="normal|italic|oblique|inherit";J.variants="normal|small-caps|inherit";J.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class lt{constructor(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=t,this.y1=e,this.x2=r,this.y2=n,this.addPoint(t,e),this.addPoint(r,n)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(t,e){typeof t<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),typeof e<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addBoundingBox(t){if(t){var{x1:e,y1:r,x2:n,y2:a}=t;this.addPoint(e,r),this.addPoint(n,a)}}sumCubic(t,e,r,n,a){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*r+3*(1-t)*Math.pow(t,2)*n+Math.pow(t,3)*a}bezierCurveAdd(t,e,r,n,a){var o=6*e-12*r+6*n,s=-3*e+9*r-9*n+3*a,u=3*r-3*e;if(s===0){if(o===0)return;var h=-u/o;0<h&&h<1&&(t?this.addX(this.sumCubic(h,e,r,n,a)):this.addY(this.sumCubic(h,e,r,n,a)));return}var l=Math.pow(o,2)-4*u*s;if(!(l<0)){var g=(-o+Math.sqrt(l))/(2*s);0<g&&g<1&&(t?this.addX(this.sumCubic(g,e,r,n,a)):this.addY(this.sumCubic(g,e,r,n,a)));var f=(-o-Math.sqrt(l))/(2*s);0<f&&f<1&&(t?this.addX(this.sumCubic(f,e,r,n,a)):this.addY(this.sumCubic(f,e,r,n,a)))}}addBezierCurve(t,e,r,n,a,o,s,u){this.addPoint(t,e),this.addPoint(s,u),this.bezierCurveAdd(!0,t,r,a,s),this.bezierCurveAdd(!1,e,n,o,u)}addQuadraticCurve(t,e,r,n,a,o){var s=t+.6666666666666666*(r-t),u=e+2/3*(n-e),h=s+1/3*(a-t),l=u+1/3*(o-e);this.addBezierCurve(t,e,s,h,u,l,a,o)}isPointInBox(t,e){var{x1:r,y1:n,x2:a,y2:o}=this;return r<=t&&t<=a&&n<=e&&e<=o}}class C extends v{constructor(t){super(t.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new L(0,0),this.control=new L(0,0),this.current=new L(0,0),this.points=[],this.angles=[]}isEnd(){var{i:t,commands:e}=this;return t>=e.length-1}next(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}getPoint(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new L(this.command[t],this.command[e]);return this.makeAbsolute(r)}getAsControlPoint(t,e){var r=this.getPoint(t,e);return this.control=r,r}getAsCurrentPoint(t,e){var r=this.getPoint(t,e);return this.current=r,r}getReflectedControlPoint(){var t=this.previousCommand.type;if(t!==v.CURVE_TO&&t!==v.SMOOTH_CURVE_TO&&t!==v.QUAD_TO&&t!==v.SMOOTH_QUAD_TO)return this.current;var{current:{x:e,y:r},control:{x:n,y:a}}=this,o=new L(2*e-n,2*r-a);return o}makeAbsolute(t){if(this.command.relative){var{x:e,y:r}=this.current;t.x+=e,t.y+=r}return t}addMarker(t,e,r){var{points:n,angles:a}=this;r&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=n[n.length-1].angleTo(r)),this.addMarkerAngle(t,e?e.angleTo(t):null)}addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:t}=this,e=t.length,r=0;r<e;r++)if(!t[r]){for(var n=r+1;n<e;n++)if(t[n]){t[r]=t[n];break}}return t}}class Yt extends V{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var t=1,e=this;e;){var r=e.getStyle("opacity",!1,!0);r.hasValue(!0)&&(t*=r.getNumber()),e=e.parent}return t}setContext(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e){var r=this.getStyle("fill"),n=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,n);s&&(t.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var u=r.getColor();u!=="inherit"&&(t.fillStyle=u==="none"?"rgba(0,0,0,0)":u)}if(n.hasValue()){var h=new T(this.document,"fill",t.fillStyle).addOpacity(n).getColor();t.fillStyle=h}if(a.isUrlDefinition()){var l=a.getFillStyleDefinition(this,o);l&&(t.strokeStyle=l)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());var g=a.getString();g!=="inherit"&&(t.strokeStyle=g==="none"?"rgba(0,0,0,0)":g)}if(o.hasValue()){var f=new T(this.document,"stroke",t.strokeStyle).addOpacity(o).getString();t.strokeStyle=f}var c=this.getStyle("stroke-width");if(c.hasValue()){var d=c.getPixels();t.lineWidth=d||ae}var p=this.getStyle("stroke-linecap"),m=this.getStyle("stroke-linejoin"),y=this.getStyle("stroke-miterlimit"),b=this.getStyle("stroke-dasharray"),x=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(t.lineCap=p.getString()),m.hasValue()&&(t.lineJoin=m.getString()),y.hasValue()&&(t.miterLimit=y.getNumber()),b.hasValue()&&b.getString()!=="none"){var w=nt(b.getString());typeof t.setLineDash<"u"?t.setLineDash(w):typeof t.webkitLineDash<"u"?t.webkitLineDash=w:typeof t.mozDash<"u"&&!(w.length===1&&w[0]===0)&&(t.mozDash=w);var A=x.getPixels();typeof t.lineDashOffset<"u"?t.lineDashOffset=A:typeof t.webkitLineDashOffset<"u"?t.webkitLineDashOffset=A:typeof t.mozDashOffset<"u"&&(t.mozDashOffset=A)}}if(this.modifiedEmSizeStack=!1,typeof t.font<"u"){var O=this.getStyle("font"),S=this.getStyle("font-style"),E=this.getStyle("font-variant"),R=this.getStyle("font-weight"),I=this.getStyle("font-size"),F=this.getStyle("font-family"),N=new J(S.getString(),E.getString(),R.getString(),I.hasValue()?"".concat(I.getPixels(!0),"px"):"",F.getString(),J.parse(O.getString(),t.font));S.setValue(N.fontStyle),E.setValue(N.fontVariant),R.setValue(N.fontWeight),I.setValue(N.fontSize),F.setValue(N.fontFamily),t.font=N.toString(),I.isPixels()&&(this.document.emSize=I.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}clearContext(t){super.clearContext(t),this.modifiedEmSizeStack&&this.document.popEmSize()}}class P extends Yt{constructor(t,e,r){super(t,e,r),this.type="path",this.pathParser=null,this.pathParser=new C(this.getAttribute("d").getString())}path(t){var{pathParser:e}=this,r=new lt;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case C.MOVE_TO:this.pathM(t,r);break;case C.LINE_TO:this.pathL(t,r);break;case C.HORIZ_LINE_TO:this.pathH(t,r);break;case C.VERT_LINE_TO:this.pathV(t,r);break;case C.CURVE_TO:this.pathC(t,r);break;case C.SMOOTH_CURVE_TO:this.pathS(t,r);break;case C.QUAD_TO:this.pathQ(t,r);break;case C.SMOOTH_QUAD_TO:this.pathT(t,r);break;case C.ARC:this.pathA(t,r);break;case C.CLOSE_PATH:this.pathZ(t,r);break}return r}getBoundingBox(t){return this.path()}getMarkers(){var{pathParser:t}=this,e=t.getMarkerPoints(),r=t.getMarkerAngles(),n=e.map((a,o)=>[a,r[o]]);return n}renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var e=this.getStyle("fill-rule");t.fillStyle!==""&&(e.getString("inherit")!=="inherit"?t.fill(e.getString()):t.fill()),t.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore()):t.stroke());var r=this.getMarkers();if(r){var n=r.length-1,a=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(a.isUrlDefinition()){var u=a.getDefinition(),[h,l]=r[0];u.render(t,h,l)}if(o.isUrlDefinition())for(var g=o.getDefinition(),f=1;f<n;f++){var[c,d]=r[f];g.render(t,c,d)}if(s.isUrlDefinition()){var p=s.getDefinition(),[m,y]=r[n];p.render(t,m,y)}}}static pathM(t){var e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}pathM(t,e){var{pathParser:r}=this,{point:n}=P.pathM(r),{x:a,y:o}=n;r.addMarker(n),e.addPoint(a,o),t&&t.moveTo(a,o)}static pathL(t){var{current:e}=t,r=t.getAsCurrentPoint();return{current:e,point:r}}pathL(t,e){var{pathParser:r}=this,{current:n,point:a}=P.pathL(r),{x:o,y:s}=a;r.addMarker(a,n),e.addPoint(o,s),t&&t.lineTo(o,s)}static pathH(t){var{current:e,command:r}=t,n=new L((r.relative?e.x:0)+r.x,e.y);return t.current=n,{current:e,point:n}}pathH(t,e){var{pathParser:r}=this,{current:n,point:a}=P.pathH(r),{x:o,y:s}=a;r.addMarker(a,n),e.addPoint(o,s),t&&t.lineTo(o,s)}static pathV(t){var{current:e,command:r}=t,n=new L(e.x,(r.relative?e.y:0)+r.y);return t.current=n,{current:e,point:n}}pathV(t,e){var{pathParser:r}=this,{current:n,point:a}=P.pathV(r),{x:o,y:s}=a;r.addMarker(a,n),e.addPoint(o,s),t&&t.lineTo(o,s)}static pathC(t){var{current:e}=t,r=t.getPoint("x1","y1"),n=t.getAsControlPoint("x2","y2"),a=t.getAsCurrentPoint();return{current:e,point:r,controlPoint:n,currentPoint:a}}pathC(t,e){var{pathParser:r}=this,{current:n,point:a,controlPoint:o,currentPoint:s}=P.pathC(r);r.addMarker(s,o,a),e.addBezierCurve(n.x,n.y,a.x,a.y,o.x,o.y,s.x,s.y),t&&t.bezierCurveTo(a.x,a.y,o.x,o.y,s.x,s.y)}static pathS(t){var{current:e}=t,r=t.getReflectedControlPoint(),n=t.getAsControlPoint("x2","y2"),a=t.getAsCurrentPoint();return{current:e,point:r,controlPoint:n,currentPoint:a}}pathS(t,e){var{pathParser:r}=this,{current:n,point:a,controlPoint:o,currentPoint:s}=P.pathS(r);r.addMarker(s,o,a),e.addBezierCurve(n.x,n.y,a.x,a.y,o.x,o.y,s.x,s.y),t&&t.bezierCurveTo(a.x,a.y,o.x,o.y,s.x,s.y)}static pathQ(t){var{current:e}=t,r=t.getAsControlPoint("x1","y1"),n=t.getAsCurrentPoint();return{current:e,controlPoint:r,currentPoint:n}}pathQ(t,e){var{pathParser:r}=this,{current:n,controlPoint:a,currentPoint:o}=P.pathQ(r);r.addMarker(o,a,a),e.addQuadraticCurve(n.x,n.y,a.x,a.y,o.x,o.y),t&&t.quadraticCurveTo(a.x,a.y,o.x,o.y)}static pathT(t){var{current:e}=t,r=t.getReflectedControlPoint();t.control=r;var n=t.getAsCurrentPoint();return{current:e,controlPoint:r,currentPoint:n}}pathT(t,e){var{pathParser:r}=this,{current:n,controlPoint:a,currentPoint:o}=P.pathT(r);r.addMarker(o,a,a),e.addQuadraticCurve(n.x,n.y,a.x,a.y,o.x,o.y),t&&t.quadraticCurveTo(a.x,a.y,o.x,o.y)}static pathA(t){var{current:e,command:r}=t,{rX:n,rY:a,xRot:o,lArcFlag:s,sweepFlag:u}=r,h=o*(Math.PI/180),l=t.getAsCurrentPoint(),g=new L(Math.cos(h)*(e.x-l.x)/2+Math.sin(h)*(e.y-l.y)/2,-Math.sin(h)*(e.x-l.x)/2+Math.cos(h)*(e.y-l.y)/2),f=Math.pow(g.x,2)/Math.pow(n,2)+Math.pow(g.y,2)/Math.pow(a,2);f>1&&(n*=Math.sqrt(f),a*=Math.sqrt(f));var c=(s===u?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(a,2)-Math.pow(n,2)*Math.pow(g.y,2)-Math.pow(a,2)*Math.pow(g.x,2))/(Math.pow(n,2)*Math.pow(g.y,2)+Math.pow(a,2)*Math.pow(g.x,2)));isNaN(c)&&(c=0);var d=new L(c*n*g.y/a,c*-a*g.x/n),p=new L((e.x+l.x)/2+Math.cos(h)*d.x-Math.sin(h)*d.y,(e.y+l.y)/2+Math.sin(h)*d.x+Math.cos(h)*d.y),m=Ao([1,0],[(g.x-d.x)/n,(g.y-d.y)/a]),y=[(g.x-d.x)/n,(g.y-d.y)/a],b=[(-g.x-d.x)/n,(-g.y-d.y)/a],x=Ao(y,b);return On(y,b)<=-1&&(x=Math.PI),On(y,b)>=1&&(x=0),{currentPoint:l,rX:n,rY:a,sweepFlag:u,xAxisRotation:h,centp:p,a1:m,ad:x}}pathA(t,e){var{pathParser:r}=this,{currentPoint:n,rX:a,rY:o,sweepFlag:s,xAxisRotation:u,centp:h,a1:l,ad:g}=P.pathA(r),f=1-s?1:-1,c=l+f*(g/2),d=new L(h.x+a*Math.cos(c),h.y+o*Math.sin(c));if(r.addMarkerAngle(d,c-f*Math.PI/2),r.addMarkerAngle(n,c-f*Math.PI),e.addPoint(n.x,n.y),t&&!isNaN(l)&&!isNaN(g)){var p=a>o?a:o,m=a>o?1:a/o,y=a>o?o/a:1;t.translate(h.x,h.y),t.rotate(u),t.scale(m,y),t.arc(0,0,p,l,l+g,!!(1-s)),t.scale(1/m,1/y),t.rotate(-u),t.translate(-h.x,-h.y)}}static pathZ(t){t.current=t.start}pathZ(t,e){P.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}}class Th extends P{constructor(t,e,r){super(t,e,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class Et extends Yt{constructor(t,e,r){super(t,e,new.target===Et?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(t,e);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(t.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(t){if(this.type!=="text")return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var e=null;return this.children.forEach((r,n)=>{var a=this.getChildBoundingBox(t,this,this,n);e?e.addBoundingBox(a):e=a}),e}getFontSize(){var{document:t,parent:e}=this,r=J.parse(t.ctx.font).fontSize,n=e.getStyle("font-size").getNumber(r);return n}getTElementBoundingBox(t){var e=this.getFontSize();return new lt(this.x,this.y-e,this.x+this.measureText(t),this.y)}getGlyph(t,e,r){var n=e[r],a=null;if(t.isArabic){var o=e.length,s=e[r-1],u=e[r+1],h="isolated";if((r===0||s===" ")&&r<o-1&&u!==" "&&(h="terminal"),r>0&&s!==" "&&r<o-1&&u!==" "&&(h="medial"),r>0&&s!==" "&&(r===o-1||u===" ")&&(h="initial"),typeof t.glyphs[n]<"u"){var l=t.glyphs[n];a=l instanceof Th?l:l[h]}}else a=t.glyphs[n];return a||(a=t.missingGlyph),a}getText(){return""}getTextFromNode(t){var e=t||this.node,r=Array.from(e.parentNode.childNodes),n=r.indexOf(e),a=r.length-1,o=ge(e.textContent||"");return n===0&&(o=i1(o)),n===a&&(o=n1(o)),o}renderChildren(t){if(this.type!=="text"){this.renderTElementChildren(t);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((r,n)=>{this.renderChild(t,this,this,n)});var{mouse:e}=this.document.screen;e.isWorking()&&e.checkBoundingBox(this,this.getBoundingBox(t))}renderTElementChildren(t){var{document:e,parent:r}=this,n=this.getText(),a=r.getStyle("font-family").getDefinition();if(a){for(var{unitsPerEm:o}=a.fontFace,s=J.parse(e.ctx.font),u=r.getStyle("font-size").getNumber(s.fontSize),h=r.getStyle("font-style").getString(s.fontStyle),l=u/o,g=a.isRTL?n.split("").reverse().join(""):n,f=nt(r.getAttribute("dx").getString()),c=g.length,d=0;d<c;d++){var p=this.getGlyph(a,g,d);t.translate(this.x,this.y),t.scale(l,-l);var m=t.lineWidth;t.lineWidth=t.lineWidth*o/u,h==="italic"&&t.transform(1,0,.4,1,0,0),p.render(t),h==="italic"&&t.transform(1,0,-.4,1,0,0),t.lineWidth=m,t.scale(1/l,-1/l),t.translate(-this.x,-this.y),this.x+=u*(p.horizAdvX||a.horizAdvX)/o,typeof f[d]<"u"&&!isNaN(f[d])&&(this.x+=f[d])}return}var{x:y,y:b}=this;t.fillStyle&&t.fillText(n,y,b),t.strokeStyle&&t.strokeText(n,y,b)}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),r=!1,n=0;e==="start"&&!r||e==="end"&&r?n=t.x-this.minX:e==="end"&&!r||e==="start"&&r?n=t.x-this.maxX:n=t.x-(this.minX+this.maxX)/2;for(var a=this.textChunkStart;a<this.leafTexts.length;a++)this.leafTexts[a].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(t){this.children.forEach((e,r)=>{this.adjustChildCoordinatesRecursiveCore(t,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(t,e,r,n){var a=r.children[n];a.children.length>0?a.children.forEach((o,s)=>{e.adjustChildCoordinatesRecursiveCore(t,e,a,s)}):this.adjustChildCoordinates(t,e,r,n)}adjustChildCoordinates(t,e,r,n){var a=r.children[n];if(typeof a.measureText!="function")return a;t.save(),a.setContext(t,!0);var o=a.getAttribute("x"),s=a.getAttribute("y"),u=a.getAttribute("dx"),h=a.getAttribute("dy"),l=a.getStyle("font-family").getDefinition(),g=!!l&&l.isRTL;n===0&&(o.hasValue()||o.setValue(a.getInheritedAttribute("x")),s.hasValue()||s.setValue(a.getInheritedAttribute("y")),u.hasValue()||u.setValue(a.getInheritedAttribute("dx")),h.hasValue()||h.setValue(a.getInheritedAttribute("dy")));var f=a.measureText(t);return g&&(e.x-=f),o.hasValue()?(e.applyAnchoring(),a.x=o.getPixels("x"),u.hasValue()&&(a.x+=u.getPixels("x"))):(u.hasValue()&&(e.x+=u.getPixels("x")),a.x=e.x),e.x=a.x,g||(e.x+=f),s.hasValue()?(a.y=s.getPixels("y"),h.hasValue()&&(a.y+=h.getPixels("y"))):(h.hasValue()&&(e.y+=h.getPixels("y")),a.y=e.y),e.y=a.y,e.leafTexts.push(a),e.minX=Math.min(e.minX,a.x,a.x+f),e.maxX=Math.max(e.maxX,a.x,a.x+f),a.clearContext(t),t.restore(),a}getChildBoundingBox(t,e,r,n){var a=r.children[n];if(typeof a.getBoundingBox!="function")return null;var o=a.getBoundingBox(t);return o?(a.children.forEach((s,u)=>{var h=e.getChildBoundingBox(t,e,a,u);o.addBoundingBox(h)}),o):null}renderChild(t,e,r,n){var a=r.children[n];a.render(t),a.children.forEach((o,s)=>{e.renderChild(t,e,a,s)})}measureText(t){var{measureCache:e}=this;if(~e)return e;var r=this.getText(),n=this.measureTargetText(t,r);return this.measureCache=n,n}measureTargetText(t,e){if(!e.length)return 0;var{parent:r}=this,n=r.getStyle("font-family").getDefinition();if(n){for(var a=this.getFontSize(),o=n.isRTL?e.split("").reverse().join(""):e,s=nt(r.getAttribute("dx").getString()),u=o.length,h=0,l=0;l<u;l++){var g=this.getGlyph(n,o,l);h+=(g.horizAdvX||n.horizAdvX)*a/n.fontFace.unitsPerEm,typeof s[l]<"u"&&!isNaN(s[l])&&(h+=s[l])}return h}if(!t.measureText)return e.length*10;t.save(),this.setContext(t,!0);var{width:f}=t.measureText(e);return this.clearContext(t),t.restore(),f}getInheritedAttribute(t){for(var e=this;e instanceof Et&&e.isFirstChild();){var r=e.parent.getAttribute(t);if(r.hasValue(!0))return r.getValue("0");e=e.parent}return null}}class Fr extends Et{constructor(t,e,r){super(t,e,new.target===Fr?!0:r),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class R1 extends Fr{constructor(){super(...arguments),this.type="textNode"}}class Ie extends Yt{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(t){var e,{document:r}=this,{screen:n,window:a}=r,o=t.canvas;if(n.setDefaults(t),o.style&&typeof t.font<"u"&&a&&typeof a.getComputedStyle<"u"){t.font=a.getComputedStyle(o).getPropertyValue("font");var s=new T(r,"fontSize",J.parse(t.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:u,height:h}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),g=this.getAttribute("refY"),f=this.getAttribute("viewBox"),c=f.hasValue()?nt(f.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",p=0,m=0,y=0,b=0;c&&(p=c[0],m=c[1]),this.root||(u=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=p,b=m,p=0,m=0)),n.viewPort.setCurrent(u,h),this.node&&(!this.parent||((e=this.node.parentNode)===null||e===void 0?void 0:e.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),c&&(u=c[2],h=c[3]),r.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:u,height:n.viewPort.height,desiredHeight:h,minX:p,minY:m,refX:l.getValue(),refY:g.getValue(),clip:d,clipX:y,clipY:b}),c&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(u,h))}clearContext(t){super.clearContext(t),this.document.screen.viewPort.removeCurrent()}resize(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.getAttribute("width",!0),a=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),u=n.getNumber(0),h=a.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(t),a.setValue(e),o.hasValue()||o.setValue("0 0 ".concat(u||t," ").concat(h||e)),s.hasValue()){var g=this.getStyle("width"),f=this.getStyle("height");g.hasValue()&&g.setValue("".concat(t,"px")),f.hasValue()&&f.setValue("".concat(e,"px"))}}}class Oh extends P{constructor(){super(...arguments),this.type="rect"}path(t){var e=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),u=o.getPixels("x"),h=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(h=u),s.hasValue()&&!o.hasValue()&&(u=h),u=Math.min(u,n/2),h=Math.min(h,a/2),t){var l=4*((Math.sqrt(2)-1)/3);t.beginPath(),a>0&&n>0&&(t.moveTo(e+u,r),t.lineTo(e+n-u,r),t.bezierCurveTo(e+n-u+l*u,r,e+n,r+h-l*h,e+n,r+h),t.lineTo(e+n,r+a-h),t.bezierCurveTo(e+n,r+a-h+l*h,e+n-u+l*u,r+a,e+n-u,r+a),t.lineTo(e+u,r+a),t.bezierCurveTo(e+u-l*u,r+a,e,r+a-h+l*h,e,r+a-h),t.lineTo(e,r+h),t.bezierCurveTo(e,r+h-l*h,e+u-l*u,r,e+u,r),t.closePath())}return new lt(e,r,e+n,r+a)}getMarkers(){return null}}class k1 extends P{constructor(){super(...arguments),this.type="circle"}path(t){var e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return t&&n>0&&(t.beginPath(),t.arc(e,r,n,0,Math.PI*2,!1),t.closePath()),new lt(e-n,r-n,e+n,r+n)}getMarkers(){return null}}class I1 extends P{constructor(){super(...arguments),this.type="ellipse"}path(t){var e=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return t&&r>0&&n>0&&(t.beginPath(),t.moveTo(a+r,o),t.bezierCurveTo(a+r,o+e*n,a+e*r,o+n,a,o+n),t.bezierCurveTo(a-e*r,o+n,a-r,o+e*n,a-r,o),t.bezierCurveTo(a-r,o-e*n,a-e*r,o-n,a,o-n),t.bezierCurveTo(a+e*r,o-n,a+r,o-e*n,a+r,o),t.closePath()),new lt(a-r,o-n,a+r,o+n)}getMarkers(){return null}}class _1 extends P{constructor(){super(...arguments),this.type="line"}getPoints(){return[new L(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new L(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(t){var[{x:e,y:r},{x:n,y:a}]=this.getPoints();return t&&(t.beginPath(),t.moveTo(e,r),t.lineTo(n,a)),new lt(e,r,n,a)}getMarkers(){var[t,e]=this.getPoints(),r=t.angleTo(e);return[[t,r],[e,r]]}}class Ah extends P{constructor(t,e,r){super(t,e,r),this.type="polyline",this.points=[],this.points=L.parsePath(this.getAttribute("points").getString())}path(t){var{points:e}=this,[{x:r,y:n}]=e,a=new lt(r,n);return t&&(t.beginPath(),t.moveTo(r,n)),e.forEach(o=>{var{x:s,y:u}=o;a.addPoint(s,u),t&&t.lineTo(s,u)}),a}getMarkers(){var{points:t}=this,e=t.length-1,r=[];return t.forEach((n,a)=>{a!==e&&r.push([n,n.angleTo(t[a+1])])}),r.length>0&&r.push([t[t.length-1],r[r.length-1][1]]),r}}class L1 extends Ah{constructor(){super(...arguments),this.type="polygon"}path(t){var e=super.path(t),[{x:r,y:n}]=this.points;return t&&(t.lineTo(r,n),t.closePath()),e}}class D1 extends V{constructor(){super(...arguments),this.type="pattern"}createPattern(t,e,r){var n=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),o=new Ie(this.document,null);o.attributes.viewBox=new T(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new T(this.document,"width","".concat(n,"px")),o.attributes.height=new T(this.document,"height","".concat(a,"px")),o.attributes.transform=new T(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(n,a),u=s.getContext("2d"),h=this.getAttribute("x"),l=this.getAttribute("y");h.hasValue()&&l.hasValue()&&u.translate(h.getPixels("x",!0),l.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var g=-1;g<=1;g++)for(var f=-1;f<=1;f++)u.save(),o.attributes.x=new T(this.document,"x",g*s.width),o.attributes.y=new T(this.document,"y",f*s.height),o.render(u),u.restore();var c=t.createPattern(s,"repeat");return c}}class j1 extends V{constructor(){super(...arguments),this.type="marker"}render(t,e,r){if(e){var{x:n,y:a}=e,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(n,a),o==="auto"&&t.rotate(r),s==="strokeWidth"&&t.scale(t.lineWidth,t.lineWidth),t.save();var u=new Ie(this.document,null);u.type=this.type,u.attributes.viewBox=new T(this.document,"viewBox",this.getAttribute("viewBox").getValue()),u.attributes.refX=new T(this.document,"refX",this.getAttribute("refX").getValue()),u.attributes.refY=new T(this.document,"refY",this.getAttribute("refY").getValue()),u.attributes.width=new T(this.document,"width",this.getAttribute("markerWidth").getValue()),u.attributes.height=new T(this.document,"height",this.getAttribute("markerHeight").getValue()),u.attributes.overflow=new T(this.document,"overflow",this.getAttribute("overflow").getValue()),u.attributes.fill=new T(this.document,"fill",this.getAttribute("fill").getColor("black")),u.attributes.stroke=new T(this.document,"stroke",this.getAttribute("stroke").getValue("none")),u.children=this.children,u.render(t),t.restore(),s==="strokeWidth"&&t.scale(1/t.lineWidth,1/t.lineWidth),o==="auto"&&t.rotate(-r),t.translate(-n,-a)}}}class F1 extends V{constructor(){super(...arguments),this.type="defs"}render(){}}class ua extends Yt{constructor(){super(...arguments),this.type="g"}getBoundingBox(t){var e=new lt;return this.children.forEach(r=>{e.addBoundingBox(r.getBoundingBox(t))}),e}}class Ch extends V{constructor(t,e,r){super(t,e,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:n,children:a}=this;a.forEach(o=>{o.type==="stop"&&n.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(t,e,r){var n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));var{stops:a}=n,o=this.getGradient(t,e);if(!o)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach(m=>{o.addColorStop(m.offset,this.addParentOpacity(r,m.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:u,viewPort:h}=s.screen,[l]=h.viewPorts,g=new Oh(s,null);g.attributes.x=new T(s,"x",-u/3),g.attributes.y=new T(s,"y",-u/3),g.attributes.width=new T(s,"width",u),g.attributes.height=new T(s,"height",u);var f=new ua(s,null);f.attributes.transform=new T(s,"transform",this.getAttribute("gradientTransform").getValue()),f.children=[g];var c=new Ie(s,null);c.attributes.x=new T(s,"x",0),c.attributes.y=new T(s,"y",0),c.attributes.width=new T(s,"width",l.width),c.attributes.height=new T(s,"height",l.height),c.children=[f];var d=s.createCanvas(l.width,l.height),p=d.getContext("2d");return p.fillStyle=o,c.render(p),p.createPattern(d,"no-repeat")}return o}inheritStopContainer(t){this.attributesToInherit.forEach(e=>{!this.getAttribute(e).hasValue()&&t.getAttribute(e).hasValue()&&this.getAttribute(e,!0).setValue(t.getAttribute(e).getValue())})}addParentOpacity(t,e){if(t.hasValue()){var r=new T(this.document,"color",e);return r.addOpacity(t).getColor()}return e}}class z1 extends Ch{constructor(t,e,r){super(t,e,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(t,e){var r=this.getGradientUnits()==="objectBoundingBox",n=r?e.getBoundingBox(t):null;if(r&&!n)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var a=r?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),u=r?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===s&&o===u?null:t.createLinearGradient(a,o,s,u)}}class B1 extends Ch{constructor(t,e,r){super(t,e,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(t,e){var r=this.getGradientUnits()==="objectBoundingBox",n=e.getBoundingBox(t);if(r&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var a=r?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=a,u=o;this.getAttribute("fx").hasValue()&&(s=r?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(u=r?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var h=r?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return t.createRadialGradient(s,u,l,a,o,h)}}class H1 extends V{constructor(t,e,r){super(t,e,r),this.type="stop";var n=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),a.hasValue()&&(o=o.addOpacity(a)),this.offset=n,this.color=o.getColor()}}class ha extends V{constructor(t,e,r){super(t,e,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,t.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new T(t,"values",null);var n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}getProperty(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return t==="CSS"?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}calcValue(){var{initialUnits:t}=this,{progress:e,from:r,to:n}=this.getProgress(),a=r.getNumber()+(n.getNumber()-r.getNumber())*e;return t==="%"&&(a*=100),"".concat(a).concat(t)}update(t){var{parent:e}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(n==="freeze"&&!this.frozen)this.frozen=!0,e.animationFrozen=!0,e.animationFrozenValue=r.getString();else if(n==="remove"&&!this.removed)return this.removed=!0,r.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=t;var a=!1;if(this.begin<this.duration){var o=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var u=s.getString();o="".concat(u,"(").concat(o,")")}r.setValue(o),a=!0}return a}getProgress(){var{document:t,values:e}=this,r={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(e.hasValue()){var n=r.progress*(e.getValue().length-1),a=Math.floor(n),o=Math.ceil(n);r.from=new T(t,"from",parseFloat(e.getValue()[a])),r.to=new T(t,"to",parseFloat(e.getValue()[o])),r.progress=(n-a)/(o-a)}else r.from=this.from,r.to=this.to;return r}}class U1 extends ha{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:t,from:e,to:r}=this.getProgress(),n=new wn(e.getColor()),a=new wn(r.getColor());if(n.ok&&a.ok){var o=n.r+(a.r-n.r)*t,s=n.g+(a.g-n.g)*t,u=n.b+(a.b-n.b)*t;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(s),", ").concat(Math.floor(u),")")}return this.getAttribute("from").getColor()}}class X1 extends ha{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:t,from:e,to:r}=this.getProgress(),n=nt(e.getString()),a=nt(r.getString()),o=n.map((s,u)=>{var h=a[u];return s+(h-s)*t}).join(" ");return o}}class Y1 extends V{constructor(t,e,r){super(t,e,r),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:n}=t,{children:a}=this;for(var o of a)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(n[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var u=o;u.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[u.unicode]>"u"&&(this.glyphs[u.unicode]={}),this.glyphs[u.unicode][u.arabicForm]=u):this.glyphs[u.unicode]=u;break}}}render(){}}class G1 extends V{constructor(t,e,r){super(t,e,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class q1 extends P{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class W1 extends Et{constructor(){super(...arguments),this.type="tref"}getText(){var t=this.getHrefAttribute().getDefinition();if(t){var e=t.children[0];if(e)return e.getText()}return""}}class Q1 extends Et{constructor(t,e,r){super(t,e,r),this.type="a";var{childNodes:n}=e,a=n[0],o=n.length>0&&Array.from(n).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(t){if(this.hasText){super.renderChildren(t);var{document:e,x:r,y:n}=this,{mouse:a}=e.screen,o=new T(e,"fontSize",J.parse(e.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new lt(r,n-o.getPixels("y"),r+this.measureText(t),n))}else if(this.children.length>0){var s=new ua(this.document,null);s.children=this.children,s.parent=this,s.render(t)}}onClick(){var{window:t}=this.document;t&&t.open(this.getHrefAttribute().getString())}onMouseMove(){var t=this.document.ctx;t.canvas.style.cursor="pointer"}}function ko(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function ar(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ko(Object(e),!0).forEach(function(r){aa(i,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):ko(Object(e)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(e,r))})}return i}class $1 extends Et{constructor(t,e,r){super(t,e,r),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var n=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(n)}getText(){return this.text}path(t){var{dataArray:e}=this;t&&t.beginPath(),e.forEach(r=>{var{type:n,points:a}=r;switch(n){case C.LINE_TO:t&&t.lineTo(a[0],a[1]);break;case C.MOVE_TO:t&&t.moveTo(a[0],a[1]);break;case C.CURVE_TO:t&&t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case C.QUAD_TO:t&&t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case C.ARC:{var[o,s,u,h,l,g,f,c]=a,d=u>h?u:h,p=u>h?1:u/h,m=u>h?h/u:1;t&&(t.translate(o,s),t.rotate(f),t.scale(p,m),t.arc(0,0,d,l,l+g,!!(1-c)),t.scale(1/p,1/m),t.rotate(-f),t.translate(-o,-s));break}case C.CLOSE_PATH:t&&t.closePath();break}})}renderChildren(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:n}=this,a=t.fillStyle;e==="underline"&&t.beginPath(),n.forEach((o,s)=>{var{p0:u,p1:h,rotation:l,text:g}=o;t.save(),t.translate(u.x,u.y),t.rotate(l),t.fillStyle&&t.fillText(g,0,0),t.strokeStyle&&t.strokeText(g,0,0),t.restore(),e==="underline"&&(s===0&&t.moveTo(u.x,u.y+r/8),t.lineTo(h.x,h.y+r/5))}),e==="underline"&&(t.lineWidth=r/20,t.strokeStyle=a,t.stroke(),t.closePath()),t.restore()}getLetterSpacingAt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[t]||0}findSegmentToFitChar(t,e,r,n,a,o,s,u,h){var l=o,g=this.measureText(t,u);u===" "&&e==="justify"&&r<n&&(g+=(n-r)/a),h>-1&&(l+=this.getLetterSpacingAt(h));var f=this.textHeight/20,c=this.getEquidistantPointOnPath(l,f,0),d=this.getEquidistantPointOnPath(l+g,f,0),p={p0:c,p1:d},m=c&&d?Math.atan2(d.y-c.y,d.x-c.x):0;if(s){var y=Math.cos(Math.PI/2+m)*s,b=Math.cos(-m)*s;p.p0=ar(ar({},c),{},{x:c.x+y,y:c.y+b}),p.p1=ar(ar({},d),{},{x:d.x+y,y:d.y+b})}return l+=g,{offset:l,segment:p,rotation:m}}measureText(t,e){var{measuresCache:r}=this,n=e||this.getText();if(r.has(n))return r.get(n);var a=this.measureTargetText(t,n);return r.set(n,a),a}setTextData(t){if(!this.glyphInfo){var e=this.getText(),r=e.split(""),n=e.split(" ").length-1,a=this.parent.getAttribute("dx").split().map(w=>w.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),h=this.parent.getStyle("letter-spacing"),l=0;!u.hasValue()||u.getValue()==="inherit"?l=h.getPixels():u.hasValue()&&u.getValue()!=="initial"&&u.getValue()!=="unset"&&(l=u.getPixels());var g=[],f=e.length;this.letterSpacingCache=g;for(var c=0;c<f;c++)g.push(typeof a[c]<"u"?a[c]:l);var d=g.reduce((w,A,O)=>O===0?0:w+A||0,0),p=this.measureText(t),m=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var y=this.getPathLength(),b=this.getStyle("startOffset").getNumber(0)*y,x=0;(s==="middle"||s==="center")&&(x=-m/2),(s==="end"||s==="right")&&(x=-m),x+=b,r.forEach((w,A)=>{var{offset:O,segment:S,rotation:E}=this.findSegmentToFitChar(t,s,m,y,n,x,o,w,A);x=O,!(!S.p0||!S.p1)&&this.glyphInfo.push({text:r[A],p0:S.p0,p1:S.p1,rotation:E})})}}parsePathData(t){if(this.pathLength=-1,!t)return[];var e=[],{pathParser:r}=t;for(r.reset();!r.isEnd();){var{current:n}=r,a=n?n.x:0,o=n?n.y:0,s=r.next(),u=s.type,h=[];switch(s.type){case C.MOVE_TO:this.pathM(r,h);break;case C.LINE_TO:u=this.pathL(r,h);break;case C.HORIZ_LINE_TO:u=this.pathH(r,h);break;case C.VERT_LINE_TO:u=this.pathV(r,h);break;case C.CURVE_TO:this.pathC(r,h);break;case C.SMOOTH_CURVE_TO:u=this.pathS(r,h);break;case C.QUAD_TO:this.pathQ(r,h);break;case C.SMOOTH_QUAD_TO:u=this.pathT(r,h);break;case C.ARC:h=this.pathA(r);break;case C.CLOSE_PATH:P.pathZ(r);break}s.type!==C.CLOSE_PATH?e.push({type:u,points:h,start:{x:a,y:o},pathLength:this.calcLength(a,o,u,h)}):e.push({type:C.CLOSE_PATH,points:[],pathLength:0})}return e}pathM(t,e){var{x:r,y:n}=P.pathM(t).point;e.push(r,n)}pathL(t,e){var{x:r,y:n}=P.pathL(t).point;return e.push(r,n),C.LINE_TO}pathH(t,e){var{x:r,y:n}=P.pathH(t).point;return e.push(r,n),C.LINE_TO}pathV(t,e){var{x:r,y:n}=P.pathV(t).point;return e.push(r,n),C.LINE_TO}pathC(t,e){var{point:r,controlPoint:n,currentPoint:a}=P.pathC(t);e.push(r.x,r.y,n.x,n.y,a.x,a.y)}pathS(t,e){var{point:r,controlPoint:n,currentPoint:a}=P.pathS(t);return e.push(r.x,r.y,n.x,n.y,a.x,a.y),C.CURVE_TO}pathQ(t,e){var{controlPoint:r,currentPoint:n}=P.pathQ(t);e.push(r.x,r.y,n.x,n.y)}pathT(t,e){var{controlPoint:r,currentPoint:n}=P.pathT(t);return e.push(r.x,r.y,n.x,n.y),C.QUAD_TO}pathA(t){var{rX:e,rY:r,sweepFlag:n,xAxisRotation:a,centp:o,a1:s,ad:u}=P.pathA(t);return n===0&&u>0&&(u-=2*Math.PI),n===1&&u<0&&(u+=2*Math.PI),[o.x,o.y,e,r,s,u,a,n]}calcLength(t,e,r,n){var a=0,o=null,s=null,u=0;switch(r){case C.LINE_TO:return this.getLineLength(t,e,n[0],n[1]);case C.CURVE_TO:for(a=0,o=this.getPointOnCubicBezier(0,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),u=.01;u<=1;u+=.01)s=this.getPointOnCubicBezier(u,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case C.QUAD_TO:for(a=0,o=this.getPointOnQuadraticBezier(0,t,e,n[0],n[1],n[2],n[3]),u=.01;u<=1;u+=.01)s=this.getPointOnQuadraticBezier(u,t,e,n[0],n[1],n[2],n[3]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case C.ARC:{a=0;var h=n[4],l=n[5],g=n[4]+l,f=Math.PI/180;if(Math.abs(h-g)<f&&(f=Math.abs(h-g)),o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],h,0),l<0)for(u=h-f;u>g;u-=f)s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],u,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=h+f;u<g;u+=f)s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],u,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],g,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),a}}return 0}getPointOnLine(t,e,r,n,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:e,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,u=(a-r)/(n-e+ae),h=Math.sqrt(t*t/(1+u*u));n<e&&(h*=-1);var l=u*h,g=null;if(n===e)g={x:o,y:s+l};else if((s-r)/(o-e+ae)===u)g={x:o+h,y:s+l};else{var f=0,c=0,d=this.getLineLength(e,r,n,a);if(d<ae)return null;var p=(o-e)*(n-e)+(s-r)*(a-r);p/=d*d,f=e+p*(n-e),c=r+p*(a-r);var m=this.getLineLength(o,s,f,c),y=Math.sqrt(t*t-m*m);h=Math.sqrt(y*y/(1+u*u)),n<e&&(h*=-1),l=u*h,g={x:f+h,y:c+l}}return g}getPointOnPath(t){var e=this.getPathLength(),r=0,n=null;if(t<-5e-5||t-5e-5>e)return null;var{dataArray:a}=this;for(var o of a){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5<t)){r+=o.pathLength;continue}var s=t-r,u=0;switch(o.type){case C.LINE_TO:n=this.getPointOnLine(s,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case C.ARC:{var h=o.points[4],l=o.points[5],g=o.points[4]+l;if(u=h+s/o.pathLength*l,l<0&&u<g||l>=0&&u>g)break;n=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],u,o.points[6]);break}case C.CURVE_TO:u=s/o.pathLength,u>1&&(u=1),n=this.getPointOnCubicBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case C.QUAD_TO:u=s/o.pathLength,u>1&&(u=1),n=this.getPointOnQuadraticBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(n)return n;break}return null}getLineLength(t,e,r,n){return Math.sqrt((r-t)*(r-t)+(n-e)*(n-e))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((t,e)=>e.pathLength>0?t+e.pathLength:t,0)),this.pathLength}getPointOnCubicBezier(t,e,r,n,a,o,s,u,h){var l=u*Co(t)+o*Eo(t)+n*Po(t)+e*No(t),g=h*Co(t)+s*Eo(t)+a*Po(t)+r*No(t);return{x:l,y:g}}getPointOnQuadraticBezier(t,e,r,n,a,o,s){var u=o*Mo(t)+n*Vo(t)+e*Ro(t),h=s*Mo(t)+a*Vo(t)+r*Ro(t);return{x:u,y:h}}getPointOnEllipticalArc(t,e,r,n,a,o){var s=Math.cos(o),u=Math.sin(o),h={x:r*Math.cos(a),y:n*Math.sin(a)};return{x:t+(h.x*s-h.y*u),y:e+(h.x*u+h.y*s)}}buildEquidistantCache(t,e){var r=this.getPathLength(),n=e||.25,a=t||r/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==n){this.equidistantCache={step:a,precision:n,points:[]};for(var o=0,s=0;s<=r;s+=n){var u=this.getPointOnPath(s),h=this.getPointOnPath(s+n);!u||!h||(o+=this.getLineLength(u.x,u.y,h.x,h.y),o>=a&&(this.equidistantCache.points.push({x:u.x,y:u.y,distance:s}),o-=a))}}}getEquidistantPointOnPath(t,e,r){if(this.buildEquidistantCache(e,r),t<0||t-this.getPathLength()>5e-5)return null;var n=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}}var Z1=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class K1 extends Yt{constructor(t,e,r){super(t,e,r),this.type="image",this.loaded=!1;var n=this.getHrefAttribute().getString();if(n){var a=n.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(n);t.images.push(this),a?this.loadSvg(n):this.loadImage(n),this.isSvg=a}}loadImage(t){var e=this;return bt(function*(){try{var r=yield e.document.createImage(t);e.image=r}catch(n){console.error('Error while loading image "'.concat(t,'":'),n)}e.loaded=!0})()}loadSvg(t){var e=this;return bt(function*(){var r=Z1.exec(t);if(r){var n=r[5];r[4]==="base64"?e.image=atob(n):e.image=decodeURIComponent(n)}else try{var a=yield e.document.fetch(t),o=yield a.text();e.image=o}catch(s){console.error('Error while loading image "'.concat(t,'":'),s)}e.loaded=!0})()}renderChildren(t){var{document:e,image:r,loaded:n}=this,a=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y");if(!(!n||!r||!s||!u)){if(t.save(),t.translate(a,o),this.isSvg){var h=e.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:u});h.document.documentElement.parent=this,h.render()}else{var l=this.image;e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:l.width,height:u,desiredHeight:l.height}),this.loaded&&(typeof l.complete>"u"||l.complete)&&t.drawImage(l,0,0)}t.restore()}}getBoundingBox(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new lt(t,e,t+r,e+n)}}class J1 extends Yt{constructor(){super(...arguments),this.type="symbol"}render(t){}}class tb{constructor(t){this.document=t,this.loaded=!1,t.fonts.push(this)}load(t,e){var r=this;return bt(function*(){try{var{document:n}=r,a=yield n.canvg.parser.load(e),o=a.getElementsByTagName("font");Array.from(o).forEach(s=>{var u=n.createElement(s);n.definitions[t]=u})}catch(s){console.error('Error while loading font "'.concat(e,'":'),s)}r.loaded=!0})()}}class Eh extends V{constructor(t,e,r){super(t,e,r),this.type="style";var n=ge(Array.from(e.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),a=n.split("}");a.forEach(o=>{var s=o.trim();if(s){var u=s.split("{"),h=u[0].split(","),l=u[1].split(";");h.forEach(g=>{var f=g.trim();if(f){var c=t.styles[f]||{};if(l.forEach(m=>{var y=m.indexOf(":"),b=m.substr(0,y).trim(),x=m.substr(y+1,m.length-y).trim();b&&x&&(c[b]=new T(t,b,x))}),t.styles[f]=c,t.stylesSpecificity[f]=d1(f),f==="@font-face"){var d=c["font-family"].getString().replace(/"|'/g,""),p=c.src.getString().split(",");p.forEach(m=>{if(m.indexOf('format("svg")')>0){var y=vh(m);y&&new tb(t).load(d,y)}})}}})}})}}Eh.parseExternalUrl=vh;class eb extends Yt{constructor(){super(...arguments),this.type="use"}setContext(t){super.setContext(t);var e=this.getAttribute("x"),r=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),r.hasValue()&&t.translate(0,r.getPixels("y"))}path(t){var{element:e}=this;e&&e.path(t)}renderChildren(t){var{document:e,element:r}=this;if(r){var n=r;if(r.type==="symbol"&&(n=new Ie(e,null),n.attributes.viewBox=new T(e,"viewBox",r.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new T(e,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new T(e,"overflow",r.getAttribute("overflow").getString()),n.children=r.children,r.styles.opacity=new T(e,"opacity",this.calculateOpacity())),n.type==="svg"){var a=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);a.hasValue()&&(n.attributes.width=new T(e,"width",a.getString())),o.hasValue()&&(n.attributes.height=new T(e,"height",o.getString()))}var s=n.parent;n.parent=this,n.render(t),n.parent=s}}getBoundingBox(t){var{element:e}=this;return e?e.getBoundingBox(t):null}elementTransform(){var{document:t,element:e}=this;return zt.fromElement(t,e)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function sr(i,t,e,r,n,a){return i[e*r*4+t*4+a]}function or(i,t,e,r,n,a,o){i[e*r*4+t*4+a]=o}function z(i,t,e){var r=i[t];return r*e}function vt(i,t,e,r){return t+Math.cos(i)*e+Math.sin(i)*r}class Ph extends V{constructor(t,e,r){super(t,e,r),this.type="feColorMatrix";var n=nt(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var a=n[0];n=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=n[0]*Math.PI/180;n=[vt(o,.213,.787,-.213),vt(o,.715,-.715,-.715),vt(o,.072,-.072,.928),0,0,vt(o,.213,-.213,.143),vt(o,.715,.285,.14),vt(o,.072,-.072,-.283),0,0,vt(o,.213,-.213,-.787),vt(o,.715,-.715,.715),vt(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=n,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(t,e,r,n,a){for(var{includeOpacity:o,matrix:s}=this,u=t.getImageData(0,0,n,a),h=0;h<a;h++)for(var l=0;l<n;l++){var g=sr(u.data,l,h,n,a,0),f=sr(u.data,l,h,n,a,1),c=sr(u.data,l,h,n,a,2),d=sr(u.data,l,h,n,a,3),p=z(s,0,g)+z(s,1,f)+z(s,2,c)+z(s,3,d)+z(s,4,1),m=z(s,5,g)+z(s,6,f)+z(s,7,c)+z(s,8,d)+z(s,9,1),y=z(s,10,g)+z(s,11,f)+z(s,12,c)+z(s,13,d)+z(s,14,1),b=z(s,15,g)+z(s,16,f)+z(s,17,c)+z(s,18,d)+z(s,19,1);o&&(p=0,m=0,y=0,b*=d/255),or(u.data,l,h,n,a,0,p),or(u.data,l,h,n,a,1,m),or(u.data,l,h,n,a,2,y),or(u.data,l,h,n,a,3,b)}t.clearRect(0,0,n,a),t.putImageData(u,0,0)}}class zr extends V{constructor(){super(...arguments),this.type="mask"}apply(t,e){var{document:r}=this,n=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!o&&!s){var u=new lt;this.children.forEach(d=>{u.addBoundingBox(d.getBoundingBox(t))}),n=Math.floor(u.x1),a=Math.floor(u.y1),o=Math.floor(u.width),s=Math.floor(u.height)}var h=this.removeStyles(e,zr.ignoreStyles),l=r.createCanvas(n+o,a+s),g=l.getContext("2d");r.screen.setDefaults(g),this.renderChildren(g),new Ph(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(g,0,0,n+o,a+s);var f=r.createCanvas(n+o,a+s),c=f.getContext("2d");r.screen.setDefaults(c),e.render(c),c.globalCompositeOperation="destination-in",c.fillStyle=g.createPattern(l,"no-repeat"),c.fillRect(0,0,n+o,a+s),t.fillStyle=c.createPattern(f,"no-repeat"),t.fillRect(0,0,n+o,a+s),this.restoreStyles(e,h)}render(t){}}zr.ignoreStyles=["mask","transform","clip-path"];var Io=()=>{};class rb extends V{constructor(){super(...arguments),this.type="clipPath"}apply(t){var{document:e}=this,r=Reflect.getPrototypeOf(t),{beginPath:n,closePath:a}=t;r&&(r.beginPath=Io,r.closePath=Io),Reflect.apply(n,t,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=zt.fromElement(e,o)),s&&s.apply(t),o.path(t),r&&(r.closePath=a),s&&s.unapply(t)}}),Reflect.apply(a,t,[]),t.clip(),r&&(r.beginPath=n,r.closePath=a)}render(t){}}class Br extends V{constructor(){super(...arguments),this.type="filter"}apply(t,e){var{document:r,children:n}=this,a=e.getBoundingBox(t);if(a){var o=0,s=0;n.forEach(y=>{var b=y.extraFilterDistance||0;o=Math.max(o,b),s=Math.max(s,b)});var u=Math.floor(a.width),h=Math.floor(a.height),l=u+2*o,g=h+2*s;if(!(l<1||g<1)){var f=Math.floor(a.x),c=Math.floor(a.y),d=this.removeStyles(e,Br.ignoreStyles),p=r.createCanvas(l,g),m=p.getContext("2d");r.screen.setDefaults(m),m.translate(-f+o,-c+s),e.render(m),n.forEach(y=>{typeof y.apply=="function"&&y.apply(m,0,0,l,g)}),t.drawImage(p,0,0,l,g,f-o,c-s,l,g),this.restoreStyles(e,d)}}}render(t){}}Br.ignoreStyles=["filter","transform","clip-path"];class ib extends V{constructor(t,e,r){super(t,e,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(t,e,r,n,a){}}class nb extends V{constructor(){super(...arguments),this.type="feMorphology"}apply(t,e,r,n,a){}}class ab extends V{constructor(){super(...arguments),this.type="feComposite"}apply(t,e,r,n,a){}}class sb extends V{constructor(t,e,r){super(t,e,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(t,e,r,n,a){var{document:o,blurRadius:s}=this,u=o.window?o.window.document.body:null,h=t.canvas;h.id=o.getUniqueId(),u&&(h.style.display="none",u.appendChild(h)),Jx(h,e,r,n,a,s),u&&u.removeChild(h)}}class ob extends V{constructor(){super(...arguments),this.type="title"}}class ub extends V{constructor(){super(...arguments),this.type="desc"}}var hb={svg:Ie,rect:Oh,circle:k1,ellipse:I1,line:_1,polyline:Ah,polygon:L1,path:P,pattern:D1,marker:j1,defs:F1,linearGradient:z1,radialGradient:B1,stop:H1,animate:ha,animateColor:U1,animateTransform:X1,font:Y1,"font-face":G1,"missing-glyph":q1,glyph:Th,text:Et,tspan:Fr,tref:W1,a:Q1,textPath:$1,image:K1,g:ua,symbol:J1,style:Eh,use:eb,mask:zr,clipPath:rb,filter:Br,feDropShadow:ib,feMorphology:nb,feComposite:ab,feColorMatrix:Ph,feGaussianBlur:sb,title:ob,desc:ub};function _o(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function lb(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?_o(Object(e),!0).forEach(function(r){aa(i,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):_o(Object(e)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(e,r))})}return i}function cb(i,t){var e=document.createElement("canvas");return e.width=i,e.height=t,e}function gb(i){return An.apply(this,arguments)}function An(){return An=bt(function*(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,e=document.createElement("img");return t&&(e.crossOrigin="Anonymous"),new Promise((r,n)=>{e.onload=()=>{r(e)},e.onerror=(a,o,s,u,h)=>{n(h)},e.src=i})}),An.apply(this,arguments)}class At{constructor(t){var{rootEmSize:e=12,emSize:r=12,createCanvas:n=At.createCanvas,createImage:a=At.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=t,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=e,this.emSize=r,this.createCanvas=n,this.createImage=this.bindCreateImage(a,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(t,e){return typeof e=="boolean"?(r,n)=>t(r,typeof n=="boolean"?n:e):t}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:t}=this;return t[t.length-1]}set emSize(t){var{emSizeStack:e}=this;e.push(t)}popEmSize(){var{emSizeStack:t}=this;t.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(t=>t.loaded)}isFontsLoaded(){return this.fonts.every(t=>t.loaded)}createDocumentElement(t){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}createElement(t){var e=t.nodeName.replace(/^[^:]+:/,""),r=At.elementTypes[e];return typeof r<"u"?new r(this,t):new E1(this,t)}createTextNode(t){return new R1(this,t)}setViewBox(t){this.screen.setViewBox(lb({document:this},t))}}At.createCanvas=cb;At.createImage=gb;At.elementTypes=hb;function Lo(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function _t(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Lo(Object(e),!0).forEach(function(r){aa(i,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Lo(Object(e)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(e,r))})}return i}class be{constructor(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Yi(r),this.screen=new jr(t,r),this.options=r;var n=new At(this,r),a=n.createDocumentElement(e);this.document=n,this.documentElement=a}static from(t,e){var r=arguments;return bt(function*(){var n=r.length>2&&r[2]!==void 0?r[2]:{},a=new Yi(n),o=yield a.parse(e);return new be(t,o,n)})()}static fromString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new Yi(r),a=n.parseFromString(e);return new be(t,a,r)}fork(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return be.from(t,e,_t(_t({},this.options),r))}forkString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return be.fromString(t,e,_t(_t({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var t=arguments,e=this;return bt(function*(){var r=t.length>0&&t[0]!==void 0?t[0]:{};e.start(_t({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield e.ready(),e.stop()})()}start(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:e,screen:r,options:n}=this;r.start(e,_t(_t({enableRedraw:!0},n),t))}stop(){this.screen.stop()}resize(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(t,e,r)}}export{Q1 as AElement,U1 as AnimateColorElement,ha as AnimateElement,X1 as AnimateTransformElement,lt as BoundingBox,Co as CB1,Eo as CB2,Po as CB3,No as CB4,be as Canvg,k1 as CircleElement,rb as ClipPathElement,F1 as DefsElement,ub as DescElement,At as Document,V as Element,I1 as EllipseElement,Ph as FeColorMatrixElement,ab as FeCompositeElement,ib as FeDropShadowElement,sb as FeGaussianBlurElement,nb as FeMorphologyElement,Br as FilterElement,J as Font,Y1 as FontElement,G1 as FontFaceElement,ua as GElement,Th as GlyphElement,Ch as GradientElement,K1 as ImageElement,_1 as LineElement,z1 as LinearGradientElement,j1 as MarkerElement,zr as MaskElement,wh as Matrix,q1 as MissingGlyphElement,y1 as Mouse,ae as PSEUDO_ZERO,Yi as Parser,P as PathElement,C as PathParser,D1 as PatternElement,L as Point,L1 as PolygonElement,Ah as PolylineElement,T as Property,Mo as QB1,Vo as QB2,Ro as QB3,B1 as RadialGradientElement,Oh as RectElement,Yt as RenderedElement,w1 as Rotate,Ie as SVGElement,tb as SVGFontLoader,S1 as Scale,jr as Screen,Sh as Skew,T1 as SkewX,O1 as SkewY,H1 as StopElement,Eh as StyleElement,J1 as SymbolElement,W1 as TRefElement,Fr as TSpanElement,Et as TextElement,$1 as TextPathElement,ob as TitleElement,zt as Transform,b1 as Translate,E1 as UnknownElement,eb as UseElement,m1 as ViewPort,ge as compressSpaces,be as default,d1 as getSelectorSpecificity,s1 as normalizeAttributeName,o1 as normalizeColor,vh as parseExternalUrl,Tb as presets,nt as toNumbers,i1 as trimLeft,n1 as trimRight,Oo as vectorMagnitude,Ao as vectorsAngle,On as vectorsRatio};
|