index.es.js 204 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625
  1. import { c8 as Ke, c9 as Vo, ei as Oi } from "./index2.js";
  2. var vt = function(a) {
  3. return a && a.Math === Math && a;
  4. }, _ = (
  5. // eslint-disable-next-line es/no-global-this -- safe
  6. vt(typeof globalThis == "object" && globalThis) || vt(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
  7. vt(typeof self == "object" && self) || vt(typeof Ke == "object" && Ke) || vt(typeof Ke == "object" && Ke) || // eslint-disable-next-line no-new-func -- fallback
  8. /* @__PURE__ */ function() {
  9. return this;
  10. }() || Function("return this")()
  11. ), $t = {}, D = function(a) {
  12. try {
  13. return !!a();
  14. } catch (e) {
  15. return !0;
  16. }
  17. }, Al = D, he = !Al(function() {
  18. return Object.defineProperty({}, 1, { get: function() {
  19. return 7;
  20. } })[1] !== 7;
  21. }), Pl = D, br = !Pl(function() {
  22. var a = function() {
  23. }.bind();
  24. return typeof a != "function" || a.hasOwnProperty("prototype");
  25. }), Rl = br, Ft = Function.prototype.call, Y = Rl ? Ft.bind(Ft) : function() {
  26. return Ft.apply(Ft, arguments);
  27. }, Do = {}, Lo = {}.propertyIsEnumerable, ko = Object.getOwnPropertyDescriptor, Nl = ko && !Lo.call({ 1: 2 }, 1);
  28. Do.f = Nl ? function(e) {
  29. var t = ko(this, e);
  30. return !!t && t.enumerable;
  31. } : Lo;
  32. var Si = function(a, e) {
  33. return {
  34. enumerable: !(a & 1),
  35. configurable: !(a & 2),
  36. writable: !(a & 4),
  37. value: e
  38. };
  39. }, Bo = br, jo = Function.prototype, Xa = jo.call, Il = Bo && jo.bind.bind(Xa, Xa), L = Bo ? Il : function(a) {
  40. return function() {
  41. return Xa.apply(a, arguments);
  42. };
  43. }, Fo = L, Ml = Fo({}.toString), _l = Fo("".slice), Ce = function(a) {
  44. return _l(Ml(a), 8, -1);
  45. }, Vl = L, Dl = D, Ll = Ce, ea = Object, kl = Vl("".split), Uo = Dl(function() {
  46. return !ea("z").propertyIsEnumerable(0);
  47. }) ? function(a) {
  48. return Ll(a) === "String" ? kl(a, "") : ea(a);
  49. } : ea, xr = function(a) {
  50. return a == null;
  51. }, Bl = xr, jl = TypeError, ve = function(a) {
  52. if (Bl(a)) throw new jl("Can't call method on " + a);
  53. return a;
  54. }, Fl = Uo, Ul = ve, wt = function(a) {
  55. return Fl(Ul(a));
  56. }, ta = typeof document == "object" && document.all, k = typeof ta == "undefined" && ta !== void 0 ? function(a) {
  57. return typeof a == "function" || a === ta;
  58. } : function(a) {
  59. return typeof a == "function";
  60. }, Gl = k, ae = function(a) {
  61. return typeof a == "object" ? a !== null : Gl(a);
  62. }, ra = _, zl = k, Hl = function(a) {
  63. return zl(a) ? a : void 0;
  64. }, Fe = function(a, e) {
  65. return arguments.length < 2 ? Hl(ra[a]) : ra[a] && ra[a][e];
  66. }, Yl = L, Tr = Yl({}.isPrototypeOf), Xl = _, dn = Xl.navigator, pn = dn && dn.userAgent, Ct = pn ? String(pn) : "", Go = _, aa = Ct, yn = Go.process, mn = Go.Deno, bn = yn && yn.versions || mn && mn.version, xn = bn && bn.v8, le, cr;
  67. xn && (le = xn.split("."), cr = le[0] > 0 && le[0] < 4 ? 1 : +(le[0] + le[1]));
  68. !cr && aa && (le = aa.match(/Edge\/(\d+)/), (!le || le[1] >= 74) && (le = aa.match(/Chrome\/(\d+)/), le && (cr = +le[1])));
  69. var Ei = cr, Tn = Ei, Wl = D, ql = _, Ql = ql.String, zo = !!Object.getOwnPropertySymbols && !Wl(function() {
  70. var a = Symbol("symbol detection");
  71. return !Ql(a) || !(Object(a) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  72. !Symbol.sham && Tn && Tn < 41;
  73. }), Kl = zo, Ho = Kl && !Symbol.sham && typeof Symbol.iterator == "symbol", Zl = Fe, Jl = k, eh = Tr, th = Ho, rh = Object, Yo = th ? function(a) {
  74. return typeof a == "symbol";
  75. } : function(a) {
  76. var e = Zl("Symbol");
  77. return Jl(e) && eh(e.prototype, rh(a));
  78. }, ah = String, Or = function(a) {
  79. try {
  80. return ah(a);
  81. } catch (e) {
  82. return "Object";
  83. }
  84. }, ih = k, nh = Or, sh = TypeError, Ae = function(a) {
  85. if (ih(a)) return a;
  86. throw new sh(nh(a) + " is not a function");
  87. }, oh = Ae, uh = xr, ot = function(a, e) {
  88. var t = a[e];
  89. return uh(t) ? void 0 : oh(t);
  90. }, ia = Y, na = k, sa = ae, lh = TypeError, hh = function(a, e) {
  91. var t, r;
  92. if (e === "string" && na(t = a.toString) && !sa(r = ia(t, a)) || na(t = a.valueOf) && !sa(r = ia(t, a)) || e !== "string" && na(t = a.toString) && !sa(r = ia(t, a))) return r;
  93. throw new lh("Can't convert object to primitive value");
  94. }, Xo = { exports: {} }, On = _, vh = Object.defineProperty, $i = function(a, e) {
  95. try {
  96. vh(On, a, { value: e, configurable: !0, writable: !0 });
  97. } catch (t) {
  98. On[a] = e;
  99. }
  100. return e;
  101. }, fh = _, ch = $i, Sn = "__core-js_shared__", En = Xo.exports = fh[Sn] || ch(Sn, {});
  102. (En.versions || (En.versions = [])).push({
  103. version: "3.50.0",
  104. mode: "global",
  105. copyright: "© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",
  106. license: "https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",
  107. source: "https://github.com/zloirock/core-js"
  108. });
  109. var wi = Xo.exports, $n = wi, gh = Object.create || Object, Ci = function(a, e) {
  110. return $n[a] || ($n[a] = e || gh(null));
  111. }, dh = ve, ph = Object, Sr = function(a) {
  112. return ph(dh(a));
  113. }, yh = L, mh = Sr, bh = yh({}.hasOwnProperty), fe = Object.hasOwn || function(e, t) {
  114. return bh(mh(e), t);
  115. }, xh = L, Th = 0, Oh = Math.random(), Sh = xh(1.1.toString), Wo = function(a) {
  116. return "Symbol(" + (a === void 0 ? "" : a) + ")_" + Sh(++Th + Oh, 36);
  117. }, Eh = _, $h = Ci, wn = fe, wh = Wo, Ch = zo, Ah = Ho, Ze = Eh.Symbol, oa = $h("wks"), Ph = Ah ? Ze.for || Ze : Ze && Ze.withoutSetter || wh, z = function(a) {
  118. return wn(oa, a) || (oa[a] = Ch && wn(Ze, a) ? Ze[a] : Ph("Symbol." + a)), oa[a];
  119. }, Rh = Y, Cn = ae, An = Yo, Nh = ot, Ih = hh, Mh = z, _h = TypeError, Vh = Mh("toPrimitive"), Dh = function(a, e) {
  120. if (!Cn(a) || An(a)) return a;
  121. var t = Nh(a, Vh), r;
  122. if (t) {
  123. if (e === void 0 && (e = "default"), r = Rh(t, a, e), !Cn(r) || An(r)) return r;
  124. throw new _h("Can't convert object to primitive value");
  125. }
  126. return e === void 0 && (e = "number"), Ih(a, e);
  127. }, Lh = Dh, kh = Yo, qo = function(a) {
  128. var e = Lh(a, "string");
  129. return kh(e) ? e : e + "";
  130. }, Bh = _, Pn = ae, Wa = Bh.document, jh = Pn(Wa) && Pn(Wa.createElement), Er = function(a) {
  131. return jh ? Wa.createElement(a) : {};
  132. }, Fh = he, Uh = D, Gh = Er, Qo = !Fh && !Uh(function() {
  133. return Object.defineProperty(Gh("div"), "a", {
  134. get: function() {
  135. return 7;
  136. }
  137. }).a !== 7;
  138. }), zh = he, Hh = Y, Yh = Do, Xh = Si, Wh = wt, qh = qo, Qh = fe, Kh = Qo, Rn = Object.getOwnPropertyDescriptor;
  139. $t.f = zh ? Rn : function(e, t) {
  140. if (e = Wh(e), t = qh(t), Kh) try {
  141. return Rn(e, t);
  142. } catch (r) {
  143. }
  144. if (Qh(e, t)) return Xh(!Hh(Yh.f, e, t), e[t]);
  145. };
  146. var Te = {}, Zh = he, Jh = D, Ko = Zh && Jh(function() {
  147. return Object.defineProperty(function() {
  148. }, "prototype", {
  149. value: 42,
  150. writable: !1
  151. }).prototype !== 42;
  152. }), ev = ae, tv = String, rv = TypeError, J = function(a) {
  153. if (ev(a)) return a;
  154. throw new rv(tv(a) + " is not an object");
  155. }, av = he, iv = Qo, nv = Ko, Ut = J, Nn = qo, sv = TypeError, ua = Object.defineProperty, ov = Object.getOwnPropertyDescriptor, la = "enumerable", ha = "configurable", va = "writable";
  156. Te.f = av ? nv ? function(e, t, r) {
  157. if (Ut(e), t = Nn(t), Ut(r), typeof e == "function" && t === "prototype" && "value" in r && va in r && !r[va]) {
  158. var i = ov(e, t);
  159. i && i[va] && (e[t] = r.value, r = {
  160. configurable: ha in r ? r[ha] : i[ha],
  161. enumerable: la in r ? r[la] : i[la],
  162. writable: !1
  163. });
  164. }
  165. return ua(e, t, r);
  166. } : ua : function(e, t, r) {
  167. if (Ut(e), t = Nn(t), Ut(r), iv) try {
  168. return ua(e, t, r);
  169. } catch (i) {
  170. }
  171. if ("get" in r || "set" in r) throw new sv("Accessors not supported");
  172. return "value" in r && (e[t] = r.value), e;
  173. };
  174. var uv = he, lv = Te, hv = Si, At = uv ? function(a, e, t) {
  175. return lv.f(a, e, hv(1, t));
  176. } : function(a, e, t) {
  177. return a[e] = t, a;
  178. }, Zo = { exports: {} }, qa = he, vv = fe, Jo = Function.prototype, fv = qa && Object.getOwnPropertyDescriptor, eu = vv(Jo, "name"), cv = eu && function() {
  179. }.name === "something", gv = eu && (!qa || qa && fv(Jo, "name").configurable), $r = {
  180. PROPER: cv,
  181. CONFIGURABLE: gv
  182. }, dv = L, pv = k, Qa = wi, yv = dv(Function.toString);
  183. pv(Qa.inspectSource) || (Qa.inspectSource = function(a) {
  184. return yv(a);
  185. });
  186. var Ai = Qa.inspectSource, mv = _, bv = k, In = mv.WeakMap, xv = bv(In) && /native code/.test(String(In)), Tv = Ci, Ov = Wo, Mn = Tv("keys"), Pi = function(a) {
  187. return Mn[a] || (Mn[a] = Ov(a));
  188. }, Ri = {}, Sv = xv, tu = _, Ev = ae, $v = At, fa = fe, ca = wi, wv = Pi, Cv = Ri, _n = "Object already initialized", Ka = tu.TypeError, Av = tu.WeakMap, gr, Ot, dr, Pv = function(a) {
  189. return dr(a) ? Ot(a) : gr(a, {});
  190. }, Rv = function(a) {
  191. return function(e) {
  192. var t;
  193. if (!Ev(e) || (t = Ot(e)).type !== a)
  194. throw new Ka("Incompatible receiver, " + a + " required");
  195. return t;
  196. };
  197. };
  198. if (Sv || ca.state) {
  199. var de = ca.state || (ca.state = new Av());
  200. de.get = de.get, de.has = de.has, de.set = de.set, gr = function(a, e) {
  201. if (de.has(a)) throw new Ka(_n);
  202. return e.facade = a, de.set(a, e), e;
  203. }, Ot = function(a) {
  204. return de.get(a) || {};
  205. }, dr = function(a) {
  206. return de.has(a);
  207. };
  208. } else {
  209. var Ye = wv("state");
  210. Cv[Ye] = !0, gr = function(a, e) {
  211. if (fa(a, Ye)) throw new Ka(_n);
  212. return e.facade = a, $v(a, Ye, e), e;
  213. }, Ot = function(a) {
  214. return fa(a, Ye) ? a[Ye] : {};
  215. }, dr = function(a) {
  216. return fa(a, Ye);
  217. };
  218. }
  219. var wr = {
  220. set: gr,
  221. get: Ot,
  222. has: dr,
  223. enforce: Pv,
  224. getterFor: Rv
  225. }, Ni = L, Nv = D, Iv = k, Gt = fe, Za = he, Mv = $r.CONFIGURABLE, _v = Ai, ru = wr, Vv = ru.enforce, Dv = ru.get, Vn = String, or = Object.defineProperty, Lv = Ni("".slice), kv = Ni("".replace), Bv = Ni([].join), jv = Za && !Nv(function() {
  226. return or(function() {
  227. }, "length", { value: 8 }).length !== 8;
  228. }), Fv = String(String).split("String"), Uv = Zo.exports = function(a, e, t) {
  229. Lv(Vn(e), 0, 7) === "Symbol(" && (e = "[" + kv(Vn(e), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), t && t.getter && (e = "get " + e), t && t.setter && (e = "set " + e), (!Gt(a, "name") || Mv && a.name !== e) && (Za ? or(a, "name", { value: e, configurable: !0 }) : a.name = e), jv && t && Gt(t, "arity") && a.length !== t.arity && or(a, "length", { value: t.arity });
  230. try {
  231. t && Gt(t, "constructor") && t.constructor ? Za && or(a, "prototype", { writable: !1 }) : a.prototype && (a.prototype = void 0);
  232. } catch (i) {
  233. }
  234. var r = Vv(a);
  235. return Gt(r, "source") || (r.source = Bv(Fv, typeof e == "string" ? e : "")), a;
  236. };
  237. Function.prototype.toString = Uv(function() {
  238. return Iv(this) && Dv(this).source || _v(this);
  239. }, "toString");
  240. var au = Zo.exports, Gv = k, zv = Te, Hv = au, Yv = $i, Ue = function(a, e, t, r) {
  241. r || (r = {});
  242. var i = r.enumerable, n = r.name !== void 0 ? r.name : e;
  243. if (Gv(t) && Hv(t, n, r), r.global)
  244. i ? a[e] = t : Yv(e, t);
  245. else {
  246. try {
  247. r.unsafe ? a[e] && (i = !0) : delete a[e];
  248. } catch (o) {
  249. }
  250. i ? a[e] = t : zv.f(a, e, {
  251. value: t,
  252. enumerable: !1,
  253. configurable: !r.nonConfigurable,
  254. writable: !r.nonWritable
  255. });
  256. }
  257. return a;
  258. }, iu = {}, Xv = Math.ceil, Wv = Math.floor, qv = Math.trunc || function(e) {
  259. var t = +e;
  260. return (t > 0 ? Wv : Xv)(t);
  261. }, Qv = qv, Cr = function(a) {
  262. var e = +a;
  263. return e !== e || e === 0 ? 0 : Qv(e);
  264. }, Kv = Cr, Zv = Math.max, Jv = Math.min, ef = function(a, e) {
  265. var t = Kv(a);
  266. return t < 0 ? Zv(t + e, 0) : Jv(t, e);
  267. }, tf = Cr, rf = Math.min, ut = function(a) {
  268. var e = tf(a);
  269. return e > 0 ? rf(e, 9007199254740991) : 0;
  270. }, af = ut, Ii = function(a) {
  271. return af(a.length);
  272. }, nf = wt, sf = ef, of = Ii, uf = function(a) {
  273. return function(e, t, r) {
  274. var i = nf(e), n = of(i);
  275. if (n === 0) return !a && -1;
  276. var o = sf(r, n), s;
  277. if (a && t !== t) {
  278. for (; n > o; )
  279. if (s = i[o++], s !== s) return !0;
  280. } else for (; n > o; o++)
  281. if ((a || o in i) && i[o] === t) return a || o || 0;
  282. return !a && -1;
  283. };
  284. }, nu = {
  285. // `Array.prototype.indexOf` method
  286. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  287. indexOf: uf(!1)
  288. }, lf = L, ga = fe, hf = wt, vf = nu.indexOf, ff = Ri, Dn = lf([].push), su = function(a, e) {
  289. var t = hf(a), r = 0, i = [], n;
  290. for (n in t) !ga(ff, n) && ga(t, n) && Dn(i, n);
  291. for (; e.length > r; ) ga(t, n = e[r++]) && (~vf(i, n) || Dn(i, n));
  292. return i;
  293. }, Mi = [
  294. "constructor",
  295. "hasOwnProperty",
  296. "isPrototypeOf",
  297. "propertyIsEnumerable",
  298. "toLocaleString",
  299. "toString",
  300. "valueOf"
  301. ], cf = su, gf = Mi, df = gf.concat("length", "prototype");
  302. iu.f = Object.getOwnPropertyNames || function(e) {
  303. return cf(e, df);
  304. };
  305. var ou = {};
  306. ou.f = Object.getOwnPropertySymbols;
  307. var pf = Fe, yf = L, mf = iu, bf = ou, xf = J, Tf = yf([].concat), Of = pf("Reflect", "ownKeys") || function(e) {
  308. var t = mf.f(xf(e)), r = bf.f;
  309. return r ? Tf(t, r(e)) : t;
  310. }, Ln = fe, Sf = Of, Ef = $t, $f = Te, wf = function(a, e, t) {
  311. for (var r = Sf(e), i = $f.f, n = Ef.f, o = 0; o < r.length; o++) {
  312. var s = r[o];
  313. !Ln(a, s) && !(t && Ln(t, s)) && i(a, s, n(e, s));
  314. }
  315. }, Cf = D, Af = k, Pf = /#|\.prototype\./, Pt = function(a, e) {
  316. var t = Nf[Rf(a)];
  317. return t === Mf ? !0 : t === If ? !1 : Af(e) ? Cf(e) : !!e;
  318. }, Rf = Pt.normalize = function(a) {
  319. return String(a).replace(Pf, ".").toLowerCase();
  320. }, Nf = Pt.data = {}, If = Pt.NATIVE = "N", Mf = Pt.POLYFILL = "P", uu = Pt, zt = _, _f = $t.f, Vf = At, Df = Ue, Lf = $i, kf = wf, Bf = uu, ee = function(a, e) {
  321. var t = a.target, r = a.global, i = a.stat, n, o, s, u, l, h;
  322. if (r ? o = zt : i ? o = zt[t] || Lf(t, {}) : o = zt[t] && zt[t].prototype, o) for (s in e) {
  323. if (l = e[s], a.dontCallGetSet ? (h = _f(o, s), u = h && h.value) : u = o[s], n = Bf(r ? s : t + (i ? "." : "#") + s, a.forced), !n && u !== void 0) {
  324. if (typeof l == typeof u) continue;
  325. kf(l, u);
  326. }
  327. (a.sham || u && u.sham) && Vf(l, "sham", !0), Df(o, s, l, a);
  328. }
  329. }, ft = _, jf = Ct, Ff = Ce, Ht = function(a) {
  330. return jf.slice(0, a.length) === a;
  331. }, lu = function() {
  332. return Ht("Bun/") ? "BUN" : Ht("Cloudflare-Workers") ? "CLOUDFLARE" : Ht("Deno/") ? "DENO" : Ht("Node.js/") ? "NODE" : ft.Bun && typeof Bun.version == "string" ? "BUN" : ft.Deno && typeof Deno.version == "object" ? "DENO" : Ff(ft.process) === "process" ? "NODE" : ft.window && ft.document ? "BROWSER" : "REST";
  333. }(), Uf = lu, Ar = Uf === "NODE", Gf = _, zf = Gf, Hf = L, Yf = Ae, Xf = function(a, e, t) {
  334. try {
  335. return Hf(Yf(Object.getOwnPropertyDescriptor(a, e)[t]));
  336. } catch (r) {
  337. }
  338. }, Wf = ae, qf = function(a) {
  339. return Wf(a) || a === null;
  340. }, Qf = qf, Kf = String, Zf = TypeError, Jf = function(a) {
  341. if (Qf(a)) return a;
  342. throw new Zf("Can't set " + Kf(a) + " as a prototype");
  343. }, ec = Xf, tc = ae, rc = ve, ac = Jf, hu = Object.setPrototypeOf || ("__proto__" in {} ? function() {
  344. var a = !1, e = {}, t;
  345. try {
  346. t = ec(Object.prototype, "__proto__", "set"), t(e, []), a = e instanceof Array;
  347. } catch (r) {
  348. }
  349. return function(i, n) {
  350. return rc(i), ac(n), tc(i) && (a ? t(i, n) : i.__proto__ = n), i;
  351. };
  352. }() : void 0), ic = Te.f, nc = fe, sc = z, kn = sc("toStringTag"), Pr = function(a, e, t) {
  353. a && !t && (a = a.prototype), a && !nc(a, kn) && ic(a, kn, { configurable: !0, value: e });
  354. }, Bn = au, oc = Te, uc = function(a, e, t) {
  355. return t.get && Bn(t.get, e, { getter: !0 }), t.set && Bn(t.set, e, { setter: !0 }), oc.f(a, e, t);
  356. }, lc = Fe, hc = uc, vc = z, fc = he, jn = vc("species"), cc = function(a) {
  357. var e = lc(a);
  358. fc && e && !e[jn] && hc(e, jn, {
  359. configurable: !0,
  360. get: function() {
  361. return this;
  362. }
  363. });
  364. }, gc = Tr, dc = TypeError, pc = function(a, e) {
  365. if (gc(e, a)) return a;
  366. throw new dc("Incorrect invocation");
  367. }, yc = z, mc = yc("toStringTag"), vu = {};
  368. vu[mc] = "z";
  369. var bc = String(vu) === "[object z]", xc = bc, Tc = k, ur = Ce, Oc = z, Sc = Oc("toStringTag"), Ec = Object, $c = ur(/* @__PURE__ */ function() {
  370. return arguments;
  371. }()) === "Arguments", wc = function(a, e) {
  372. try {
  373. return a[e];
  374. } catch (t) {
  375. }
  376. }, fu = xc ? ur : function(a) {
  377. var e, t, r;
  378. return a === void 0 ? "Undefined" : a === null ? "Null" : typeof (t = wc(e = Ec(a), Sc)) == "string" ? t : $c ? ur(e) : (r = ur(e)) === "Object" && Tc(e.callee) ? "Arguments" : r;
  379. }, Cc = L, Ac = D, cu = k, Pc = fu, Rc = Fe, Nc = Ai, gu = function() {
  380. }, du = Rc("Reflect", "construct"), _i = /^\s*(?:class|function)\b/, Ic = Cc(_i.exec), Mc = !_i.test(gu), ct = function(e) {
  381. if (!cu(e)) return !1;
  382. try {
  383. return du(gu, [], e), !0;
  384. } catch (t) {
  385. return !1;
  386. }
  387. }, pu = function(e) {
  388. if (!cu(e)) return !1;
  389. switch (Pc(e)) {
  390. case "AsyncFunction":
  391. case "GeneratorFunction":
  392. case "AsyncGeneratorFunction":
  393. return !1;
  394. }
  395. try {
  396. return Mc || !!Ic(_i, Nc(e));
  397. } catch (t) {
  398. return !0;
  399. }
  400. };
  401. pu.sham = !0;
  402. var _c = !du || Ac(function() {
  403. var a;
  404. return ct(ct.call) || !ct(Object) || !ct(function() {
  405. a = !0;
  406. }) || a;
  407. }) ? pu : ct, Vc = _c, Dc = Or, Lc = TypeError, kc = function(a) {
  408. if (Vc(a)) return a;
  409. throw new Lc(Dc(a) + " is not a constructor");
  410. }, Fn = J, Bc = kc, jc = xr, Fc = z, Uc = Fc("species"), yu = function(a, e) {
  411. var t = Fn(a).constructor, r;
  412. return t === void 0 || jc(r = Fn(t)[Uc]) ? e : Bc(r);
  413. }, Gc = br, mu = Function.prototype, Un = mu.apply, Gn = mu.call, bu = typeof Reflect == "object" && Reflect.apply || (Gc ? Gn.bind(Un) : function() {
  414. return Gn.apply(Un, arguments);
  415. }), zc = Ce, Hc = L, Rr = function(a) {
  416. if (zc(a) === "Function") return Hc(a);
  417. }, zn = Rr, Yc = Ae, Xc = br, Wc = zn(zn.bind), Vi = function(a, e) {
  418. return Yc(a), e === void 0 ? a : Xc ? Wc(a, e) : function() {
  419. return a.apply(e, arguments);
  420. };
  421. }, qc = Fe, xu = qc("document", "documentElement"), Qc = L, Kc = Qc([].slice), Zc = TypeError, Jc = function(a, e) {
  422. if (a < e) throw new Zc("Not enough arguments");
  423. return a;
  424. }, Hn = Ct, Tu = /ipad|iphone|ipod/i.test(Hn) && /applewebkit/i.test(Hn), ie = _, eg = bu, tg = Vi, Yn = k, rg = fe, Ou = D, Xn = xu, ag = Kc, Wn = Er, ig = Jc, ng = Tu, sg = Ar, Ja = ie.setImmediate, qn = ie.clearImmediate, og = ie.process, da = ie.Dispatch, ug = ie.Function, Qn = ie.MessageChannel, lg = ie.String, pa = 0, xt = {}, Kn = "onreadystatechange", St, Me, ya, ma;
  425. Ou(function() {
  426. St = ie.location;
  427. });
  428. var Di = function(a) {
  429. if (rg(xt, a)) {
  430. var e = xt[a];
  431. delete xt[a], e();
  432. }
  433. }, ba = function(a) {
  434. return function() {
  435. Di(a);
  436. };
  437. }, Zn = function(a) {
  438. Di(a.data);
  439. }, Jn = function(a) {
  440. ie.postMessage(lg(a), St.protocol + "//" + St.host);
  441. };
  442. (!Ja || !qn) && (Ja = function(e) {
  443. ig(arguments.length, 1);
  444. var t = Yn(e) ? e : ug(e), r = ag(arguments, 1);
  445. return xt[++pa] = function() {
  446. eg(t, void 0, r);
  447. }, Me(pa), pa;
  448. }, qn = function(e) {
  449. delete xt[e];
  450. }, sg ? Me = function(a) {
  451. og.nextTick(ba(a));
  452. } : da && da.now ? Me = function(a) {
  453. da.now(ba(a));
  454. } : Qn && !ng ? (ya = new Qn(), ma = ya.port2, ya.port1.onmessage = Zn, Me = tg(ma.postMessage, ma)) : ie.addEventListener && Yn(ie.postMessage) && !ie.importScripts && St && St.protocol !== "file:" && !Ou(Jn) ? (Me = Jn, ie.addEventListener("message", Zn, !1)) : Kn in Wn("script") ? Me = function(a) {
  455. Xn.appendChild(Wn("script"))[Kn] = function() {
  456. Xn.removeChild(this), Di(a);
  457. };
  458. } : Me = function(a) {
  459. setTimeout(ba(a), 0);
  460. });
  461. var Su = {
  462. set: Ja
  463. }, es = _, hg = he, vg = Object.getOwnPropertyDescriptor, fg = function(a) {
  464. if (!hg) return es[a];
  465. var e = vg(es, a);
  466. return e && e.value;
  467. }, Eu = function() {
  468. this.head = null, this.tail = null;
  469. };
  470. Eu.prototype = {
  471. add: function(a) {
  472. var e = { item: a, next: null }, t = this.tail;
  473. t ? t.next = e : this.head = e, this.tail = e;
  474. },
  475. get: function() {
  476. var a = this.head;
  477. if (a) {
  478. var e = this.head = a.next;
  479. return e === null && (this.tail = null), a.item;
  480. }
  481. }
  482. };
  483. var $u = Eu, cg = Ct, gg = /ipad|iphone|ipod/i.test(cg) && typeof Pebble != "undefined", dg = Ct, pg = /web0s(?!.*chrome)/i.test(dg), it = _, yg = fg, ts = Vi, xa = Su.set, mg = $u, bg = Tu, xg = gg, Tg = pg, Ta = Ar, rs = it.MutationObserver || it.WebKitMutationObserver, as = it.document, is = it.process, Yt = it.Promise, ei = yg("queueMicrotask"), Xe, Oa, Sa, Xt, ns;
  484. if (!ei) {
  485. var Wt = new mg(), qt = function() {
  486. var a, e;
  487. for (Ta && (a = is.domain) && a.exit(); e = Wt.get(); ) try {
  488. e();
  489. } catch (t) {
  490. throw Wt.head && Xe(), t;
  491. }
  492. a && a.enter();
  493. };
  494. !bg && !Ta && !Tg && rs && as ? (Oa = !0, Sa = as.createTextNode(""), new rs(qt).observe(Sa, { characterData: !0 }), Xe = function() {
  495. Sa.data = Oa = !Oa;
  496. }) : !xg && Yt && Yt.resolve ? (Xt = Yt.resolve(void 0), Xt.constructor = Yt, ns = ts(Xt.then, Xt), Xe = function() {
  497. ns(qt);
  498. }) : Ta ? Xe = function() {
  499. is.nextTick(qt);
  500. } : (xa = ts(xa, it), Xe = function() {
  501. xa(qt);
  502. }), ei = function(a) {
  503. Wt.head || Xe(), Wt.add(a);
  504. };
  505. }
  506. var Og = ei, Sg = function(a, e) {
  507. try {
  508. arguments.length === 1 ? console.error(a) : console.error(a, e);
  509. } catch (t) {
  510. }
  511. }, Li = function(a) {
  512. try {
  513. return { error: !1, value: a() };
  514. } catch (e) {
  515. return { error: !0, value: e };
  516. }
  517. }, Eg = _, Nr = Eg.Promise, $g = _, Tt = Nr, wg = k, Cg = uu, Ag = Ai, Pg = z, ss = lu, Ea = Ei;
  518. Tt && Tt.prototype;
  519. var Rg = Pg("species"), ti = !1, wu = wg($g.PromiseRejectionEvent), Ng = Cg("Promise", function() {
  520. var a = Ag(Tt), e = a !== String(Tt);
  521. if (!e && Ea === 66) return !0;
  522. if (!Ea || Ea < 51 || !/native code/.test(a)) {
  523. var t = new Tt(function(n) {
  524. n(1);
  525. }), r = function(n) {
  526. n(function() {
  527. }, function() {
  528. });
  529. }, i = t.constructor = {};
  530. if (i[Rg] = r, ti = t.then(function() {
  531. }) instanceof r, !ti) return !0;
  532. }
  533. return !e && (ss === "BROWSER" || ss === "DENO") && !wu;
  534. }), Rt = {
  535. CONSTRUCTOR: Ng,
  536. REJECTION_EVENT: wu,
  537. SUBCLASSING: ti
  538. }, lt = {}, os = Ae, Ig = TypeError, Mg = function(a) {
  539. var e, t;
  540. this.promise = new a(function(r, i) {
  541. if (e !== void 0 || t !== void 0) throw new Ig("Bad Promise constructor");
  542. e = r, t = i;
  543. }), this.resolve = os(e), this.reject = os(t);
  544. };
  545. lt.f = function(a) {
  546. return new Mg(a);
  547. };
  548. var _g = ee, pr = Ar, $e = _, Vg = zf, nt = Y, us = Ue, ls = hu, Dg = Pr, Lg = cc, kg = Ae, lr = k, Bg = ae, jg = pc, Fg = yu, Cu = Su.set, ki = Og, Ug = Sg, Gg = Li, zg = $u, Au = wr, yr = Nr, Bi = Rt, Pu = lt, Ir = "Promise", Ru = Bi.CONSTRUCTOR, Hg = Bi.REJECTION_EVENT, Yg = Bi.SUBCLASSING, $a = Au.getterFor(Ir), Xg = Au.set, Qe = yr && yr.prototype, ke = yr, Qt = Qe, Nu = $e.TypeError, ri = $e.document, ji = $e.process, ai = Pu.f, Wg = ai, qg = !!(ri && ri.createEvent && $e.dispatchEvent), Iu = "unhandledrejection", Qg = "rejectionhandled", hs = 0, Mu = 1, Kg = 2, Fi = 1, _u = 2, Kt, vs, Vu, fs, Du = function(a) {
  549. var e;
  550. return Bg(a) && lr(e = a.then) ? e : !1;
  551. }, Lu = function(a, e) {
  552. var t = e.value, r = e.state === Mu, i = r ? a.ok : a.fail, n = a.resolve, o = a.reject, s = a.domain, u, l, h;
  553. try {
  554. i ? (r || (e.rejection === _u && Jg(e), e.rejection = Fi), i === !0 ? u = t : (s && s.enter(), u = i(t), s && (s.exit(), h = !0)), u === a.promise ? o(new Nu("Promise-chain cycle")) : (l = Du(u)) ? nt(l, u, n, o) : n(u)) : o(t);
  555. } catch (f) {
  556. s && !h && s.exit(), o(f);
  557. }
  558. }, ku = function(a, e) {
  559. a.notified || (a.notified = !0, ki(function() {
  560. for (var t = a.reactions, r; r = t.get(); )
  561. Lu(r, a);
  562. a.notified = !1, e && !a.rejection && Zg(a);
  563. }));
  564. }, Bu = function(a, e, t) {
  565. var r, i;
  566. qg ? (r = ri.createEvent("Event"), r.promise = e, r.reason = t, r.initEvent(a, !1, !0), $e.dispatchEvent(r)) : r = { promise: e, reason: t }, !Hg && (i = $e["on" + a]) ? i(r) : a === Iu && Ug("Unhandled promise rejection", t);
  567. }, Zg = function(a) {
  568. nt(Cu, $e, function() {
  569. var e = a.facade, t = a.value, r = cs(a), i;
  570. if (r && (i = Gg(function() {
  571. pr ? ji.emit("unhandledRejection", t, e) : Bu(Iu, e, t);
  572. }), a.rejection = pr || cs(a) ? _u : Fi, i.error))
  573. throw i.value;
  574. });
  575. }, cs = function(a) {
  576. return a.rejection !== Fi && !a.parent;
  577. }, Jg = function(a) {
  578. nt(Cu, $e, function() {
  579. var e = a.facade;
  580. pr ? ji.emit("rejectionHandled", e) : Bu(Qg, e, a.value);
  581. });
  582. }, Je = function(a, e, t) {
  583. return function(r) {
  584. a(e, r, t);
  585. };
  586. }, tt = function(a, e, t) {
  587. a.done || (a.done = !0, t && (a = t), a.value = e, a.state = Kg, ku(a, !0));
  588. }, ii = function(a, e, t) {
  589. if (!a.done) {
  590. a.done = !0, t && (a = t);
  591. try {
  592. if (a.facade === e) throw new Nu("Promise can't be resolved itself");
  593. var r = Du(e);
  594. r ? ki(function() {
  595. var i = { done: !1 };
  596. try {
  597. nt(
  598. r,
  599. e,
  600. Je(ii, i, a),
  601. Je(tt, i, a)
  602. );
  603. } catch (n) {
  604. tt(i, n, a);
  605. }
  606. }) : (a.value = e, a.state = Mu, ku(a, !1));
  607. } catch (i) {
  608. tt({ done: !1 }, i, a);
  609. }
  610. }
  611. };
  612. if (Ru && (ke = function(e) {
  613. jg(this, Qt), kg(e), nt(Kt, this);
  614. var t = $a(this);
  615. try {
  616. e(Je(ii, t), Je(tt, t));
  617. } catch (r) {
  618. tt(t, r);
  619. }
  620. }, Qt = ke.prototype, Kt = function(e) {
  621. Xg(this, {
  622. type: Ir,
  623. done: !1,
  624. notified: !1,
  625. parent: !1,
  626. reactions: new zg(),
  627. rejection: !1,
  628. state: hs,
  629. value: null
  630. });
  631. }, Kt.prototype = us(Qt, "then", function(e, t) {
  632. var r = $a(this), i = ai(Fg(this, ke));
  633. return r.parent = !0, i.ok = lr(e) ? e : !0, i.fail = lr(t) && t, i.domain = pr ? ji.domain : void 0, r.state === hs ? r.reactions.add(i) : ki(function() {
  634. Lu(i, r);
  635. }), i.promise;
  636. }), vs = function() {
  637. var a = new Kt(), e = $a(a);
  638. this.promise = a, this.resolve = Je(ii, e), this.reject = Je(tt, e);
  639. }, Pu.f = ai = function(a) {
  640. return a === ke || a === Vu ? new vs(a) : Wg(a);
  641. }, lr(yr) && Qe !== Object.prototype)) {
  642. fs = Qe.then, Yg || us(Qe, "then", function(e, t) {
  643. var r = this;
  644. return new ke(function(i, n) {
  645. nt(fs, r, i, n);
  646. }).then(e, t);
  647. }, { unsafe: !0 });
  648. try {
  649. delete Qe.constructor;
  650. } catch (a) {
  651. }
  652. ls && ls(Qe, Qt);
  653. }
  654. _g({ global: !0, constructor: !0, wrap: !0, forced: Ru }, {
  655. Promise: ke
  656. });
  657. Vu = Vg.Promise;
  658. Dg(ke, Ir, !1);
  659. Lg(Ir);
  660. var Mr = Object.create ? /* @__PURE__ */ Object.create(null) : {}, ed = z, td = Mr, rd = ed("iterator"), ad = Array.prototype, id = function(a) {
  661. return a !== void 0 && (td.Array === a || ad[rd] === a);
  662. }, nd = Ce, sd = xr, gs = ot, od = z, ds = od("iterator"), ud = Array.prototype, ju = function(a) {
  663. if (!sd(a)) return gs(a, ds) || gs(a, "@@iterator") || (nd(a) === "Arguments" ? ud[ds] : void 0);
  664. }, ld = Y, hd = k, vd = J, fd = Or, cd = ju, gd = TypeError, dd = function(a, e) {
  665. var t = arguments.length < 2 ? cd(a) : e;
  666. if (hd(t)) return vd(ld(t, a));
  667. throw new gd(fd(a) + " is not iterable");
  668. }, pd = Y, ps = J, yd = ot, md = function(a, e, t) {
  669. var r, i;
  670. ps(a);
  671. try {
  672. if (r = yd(a, "return"), !r) {
  673. if (e === "throw") throw t;
  674. return t;
  675. }
  676. r = pd(r, a);
  677. } catch (n) {
  678. i = !0, r = n;
  679. }
  680. if (e === "throw") throw t;
  681. if (i) throw r;
  682. return ps(r), t;
  683. }, bd = Vi, xd = Y, Td = J, Od = Or, Sd = id, Ed = Ii, ys = Tr, $d = dd, wd = ju, ms = md, Cd = TypeError, hr = function(a, e) {
  684. this.stopped = a, this.result = e;
  685. }, bs = hr.prototype, Fu = function(a, e, t) {
  686. var r = t && t.that, i = !!(t && t.AS_ENTRIES), n = !!(t && t.IS_RECORD), o = !!(t && t.IS_ITERATOR), s = !!(t && t.INTERRUPTED), u = bd(e, r), l, h, f, c, v, g, d, p = function(b) {
  687. var x = l;
  688. return l = void 0, x && ms(x, "normal"), new hr(!0, b);
  689. }, y = function(b) {
  690. return i ? (Td(b), s ? u(b[0], b[1], p) : u(b[0], b[1])) : s ? u(b, p) : u(b);
  691. };
  692. if (n)
  693. l = a.iterator;
  694. else if (o)
  695. l = a;
  696. else {
  697. if (h = wd(a), !h) throw new Cd(Od(a) + " is not iterable");
  698. if (Sd(h)) {
  699. for (f = 0, c = Ed(a); c > f; f++)
  700. if (v = y(a[f]), v && ys(bs, v)) return v;
  701. return new hr(!1);
  702. }
  703. l = $d(a, h);
  704. }
  705. for (g = n ? a.next : l.next; !(d = xd(g, l)).done; ) {
  706. var T = d.value;
  707. try {
  708. v = y(T);
  709. } catch (b) {
  710. if (l) ms(l, "throw", b);
  711. else throw b;
  712. }
  713. if (typeof v == "object" && v && ys(bs, v)) return v;
  714. }
  715. return new hr(!1);
  716. }, Ad = z, Uu = Ad("iterator"), Gu = !1;
  717. try {
  718. var Pd = 0, xs = {
  719. next: function() {
  720. return { done: !!Pd++ };
  721. },
  722. return: function() {
  723. Gu = !0;
  724. }
  725. };
  726. xs[Uu] = function() {
  727. return this;
  728. }, Array.from(xs, function() {
  729. throw 2;
  730. });
  731. } catch (a) {
  732. }
  733. var Rd = function(a, e) {
  734. try {
  735. if (!e && !Gu) return !1;
  736. } catch (i) {
  737. return !1;
  738. }
  739. var t = !1;
  740. try {
  741. var r = {};
  742. r[Uu] = function() {
  743. return {
  744. next: function() {
  745. return { done: t = !0 };
  746. }
  747. };
  748. }, a(r);
  749. } catch (i) {
  750. }
  751. return t;
  752. }, Nd = Nr, Id = Rd, Md = Rt.CONSTRUCTOR, zu = Md || !Id(function(a) {
  753. Nd.all(a).then(void 0, function() {
  754. });
  755. }), _d = ee, Vd = Y, Dd = Ae, Ld = lt, kd = Li, Bd = Fu, jd = zu;
  756. _d({ target: "Promise", stat: !0, forced: jd }, {
  757. all: function(e) {
  758. var t = this, r = Ld.f(t), i = r.resolve, n = r.reject, o = kd(function() {
  759. var s = Dd(t.resolve), u = [], l = 0, h = 1;
  760. Bd(e, function(f) {
  761. var c = l++, v = !1;
  762. h++, Vd(s, t, f).then(function(g) {
  763. v || (v = !0, u[c] = g, --h || i(u));
  764. }, n);
  765. }), --h || i(u);
  766. });
  767. return o.error && n(o.value), r.promise;
  768. }
  769. });
  770. var Fd = ee, Ud = Rt.CONSTRUCTOR, ni = Nr, Gd = Fe, zd = k, Hd = Ue, Ts = ni && ni.prototype;
  771. Fd({ target: "Promise", proto: !0, forced: Ud, real: !0 }, {
  772. catch: function(a) {
  773. return this.then(void 0, a);
  774. }
  775. });
  776. if (zd(ni)) {
  777. var Os = Gd("Promise").prototype.catch;
  778. Ts.catch !== Os && Hd(Ts, "catch", Os, { unsafe: !0 });
  779. }
  780. var Yd = ee, Xd = Y, Wd = Ae, qd = lt, Qd = Li, Kd = Fu, Zd = zu;
  781. Yd({ target: "Promise", stat: !0, forced: Zd }, {
  782. race: function(e) {
  783. var t = this, r = qd.f(t), i = r.reject, n = Qd(function() {
  784. var o = Wd(t.resolve);
  785. Kd(e, function(s) {
  786. Xd(o, t, s).then(r.resolve, i);
  787. });
  788. });
  789. return n.error && i(n.value), r.promise;
  790. }
  791. });
  792. var Jd = ee, ep = lt, tp = Rt.CONSTRUCTOR;
  793. Jd({ target: "Promise", stat: !0, forced: tp }, {
  794. reject: function(e) {
  795. var t = ep.f(this), r = t.reject;
  796. return r(e), t.promise;
  797. }
  798. });
  799. var rp = J, ap = ae, ip = lt, np = function(a, e) {
  800. if (rp(a), ap(e) && e.constructor === a) return e;
  801. var t = ip.f(a), r = t.resolve;
  802. return r(e), t.promise;
  803. }, sp = ee, op = Fe, up = Rt.CONSTRUCTOR, lp = np;
  804. op("Promise");
  805. sp({ target: "Promise", stat: !0, forced: up }, {
  806. resolve: function(e) {
  807. return lp(this, e);
  808. }
  809. });
  810. function Ss(a, e, t, r, i, n, o) {
  811. try {
  812. var s = a[n](o), u = s.value;
  813. } catch (l) {
  814. return void t(l);
  815. }
  816. s.done ? e(u) : Promise.resolve(u).then(r, i);
  817. }
  818. function xe(a) {
  819. return function() {
  820. var e = this, t = arguments;
  821. return new Promise(function(r, i) {
  822. var n = a.apply(e, t);
  823. function o(u) {
  824. Ss(n, r, i, o, s, "next", u);
  825. }
  826. function s(u) {
  827. Ss(n, r, i, o, s, "throw", u);
  828. }
  829. o(void 0);
  830. });
  831. };
  832. }
  833. var hp = fu, vp = String, pe = function(a) {
  834. if (hp(a) === "Symbol") throw new TypeError("Cannot convert a Symbol value to a string");
  835. return vp(a);
  836. }, fp = J, Hu = function() {
  837. var a = fp(this), e = "";
  838. return a.hasIndices && (e += "d"), a.global && (e += "g"), a.ignoreCase && (e += "i"), a.multiline && (e += "m"), a.dotAll && (e += "s"), a.unicode && (e += "u"), a.unicodeSets && (e += "v"), a.sticky && (e += "y"), e;
  839. }, Ui = D, cp = _, Gi = cp.RegExp, zi = Ui(function() {
  840. var a = Gi("a", "y");
  841. return a.lastIndex = 2, a.exec("abcd") !== null;
  842. });
  843. zi || Ui(function() {
  844. return !Gi("a", "y").sticky;
  845. });
  846. var gp = zi || Ui(function() {
  847. var a = Gi("^r", "gy");
  848. return a.lastIndex = 2, a.exec("str") !== null;
  849. }), Yu = {
  850. BROKEN_CARET: gp,
  851. UNSUPPORTED_Y: zi
  852. }, Xu = {}, dp = su, pp = Mi, yp = Object.keys || function(e) {
  853. return dp(e, pp);
  854. }, mp = he, bp = Ko, xp = Te, Tp = J, Op = wt, Sp = yp;
  855. Xu.f = mp && !bp ? Object.defineProperties : function(e, t) {
  856. Tp(e);
  857. for (var r = Op(t), i = Sp(t), n = i.length, o = 0, s; n > o; ) xp.f(e, s = i[o++], r[s]);
  858. return e;
  859. };
  860. var Ep = J, $p = Xu, Es = Mi, wp = Ri, Cp = xu, Ap = Er, Pp = Pi, $s = ">", ws = "<", si = "prototype", oi = "script", Wu = Pp("IE_PROTO"), wa = function() {
  861. }, qu = function(a) {
  862. return ws + oi + $s + a + ws + "/" + oi + $s;
  863. }, Cs = function(a) {
  864. a.write(qu("")), a.close();
  865. var e = a.parentWindow.Object;
  866. return a = null, e;
  867. }, Rp = function() {
  868. var a = Ap("iframe"), e = "java" + oi + ":", t;
  869. return a.style.display = "none", Cp.appendChild(a), a.src = String(e), t = a.contentWindow.document, t.open(), t.write(qu("document.F=Object")), t.close(), t.F;
  870. }, Zt, vr = function() {
  871. try {
  872. Zt = new ActiveXObject("htmlfile");
  873. } catch (e) {
  874. }
  875. vr = typeof document != "undefined" ? document.domain && Zt ? Cs(Zt) : Rp() : Cs(Zt);
  876. for (var a = Es.length; a--; ) delete vr[si][Es[a]];
  877. return vr();
  878. };
  879. wp[Wu] = !0;
  880. var Hi = Object.create || function(e, t) {
  881. var r;
  882. return e !== null ? (wa[si] = Ep(e), r = new wa(), wa[si] = null, r[Wu] = e) : r = vr(), t === void 0 ? r : $p.f(r, t);
  883. }, Np = D, Ip = _, Mp = Ip.RegExp, _p = Np(function() {
  884. var a = Mp(".", "s");
  885. return !(a.dotAll && a.test(`
  886. `) && a.flags === "s");
  887. }), Vp = D, Dp = _, Lp = Dp.RegExp, kp = Vp(function() {
  888. var a = Lp("(?<a>b)", "g");
  889. return a.exec("b").groups.a !== "b" || "b".replace(a, "$<a>c") !== "bc";
  890. }), et = Y, _r = L, Bp = pe, jp = Hu, Fp = Yu, Up = Ci, Gp = Hi, zp = wr.get, Hp = _p, Yp = kp, Xp = Up("native-string-replace", String.prototype.replace), mr = RegExp.prototype.exec, ui = mr, Wp = _r("".charAt), qp = _r("".indexOf), Qp = _r("".replace), As = _r("".slice), li = function() {
  891. var a = /a/, e = /b*/g;
  892. return et(mr, a, "a"), et(mr, e, "a"), a.lastIndex !== 0 || e.lastIndex !== 0;
  893. }(), Qu = Fp.BROKEN_CARET, hi = /()??/.exec("")[1] !== void 0, Kp = li || hi || Qu || Hp || Yp, Ps = function(a, e) {
  894. for (var t = a.groups = Gp(null), r = 0; r < e.length; r++) {
  895. var i = e[r];
  896. t[i[0]] = a[i[1]];
  897. }
  898. };
  899. Kp && (ui = function(e) {
  900. var t = this, r = zp(t), i = Bp(e), n = r.raw, o, s, u;
  901. if (n)
  902. return n.lastIndex = t.lastIndex, o = et(ui, n, i), t.lastIndex = n.lastIndex, o && r.groups && Ps(o, r.groups), o;
  903. var l = r.groups, h = Qu && t.sticky, f = et(jp, t), c = t.source, v = 0, g = i;
  904. if (h) {
  905. f = Qp(f, "y", ""), qp(f, "g") === -1 && (f += "g"), g = As(i, t.lastIndex);
  906. var d = t.lastIndex > 0 && Wp(i, t.lastIndex - 1);
  907. t.lastIndex > 0 && (!t.multiline || t.multiline && d !== `
  908. ` && d !== "\r" && d !== "\u2028" && d !== "\u2029") && (c = "(?: (?:" + c + "))", g = " " + g, v++), s = new RegExp("^(?:" + c + ")", f);
  909. }
  910. hi && (s = new RegExp("^" + c + "$(?!\\s)", f)), li && (u = t.lastIndex);
  911. var p = et(mr, h ? s : t, g);
  912. return h ? p ? (p.input = i, p[0] = As(p[0], v), p.index = t.lastIndex, t.lastIndex += p[0].length) : t.lastIndex = 0 : li && p && (t.lastIndex = t.global ? p.index + p[0].length : u), hi && p && p.length > 1 && et(Xp, p[0], s, function() {
  913. for (var y = 1; y < arguments.length - 2; y++)
  914. arguments[y] === void 0 && (p[y] = void 0);
  915. }), p && l && Ps(p, l), p;
  916. });
  917. var Yi = ui, Zp = ee, Rs = Yi;
  918. Zp({ target: "RegExp", proto: !0, forced: /./.exec !== Rs }, {
  919. exec: Rs
  920. });
  921. var Ns = Y, Is = Ue, Jp = Yi, Ms = D, Ku = z, ey = At, ty = Ku("species"), Ca = RegExp.prototype, Xi = function(a, e, t, r) {
  922. var i = Ku(a), n = !Ms(function() {
  923. var l = {};
  924. return l[i] = function() {
  925. return 7;
  926. }, ""[a](l) !== 7;
  927. }), o = n && !Ms(function() {
  928. var l = !1, h = /a/;
  929. if (a === "split") {
  930. var f = {};
  931. f[ty] = function() {
  932. return h;
  933. }, h = { constructor: f, flags: "" }, h[i] = /./[i];
  934. }
  935. return h.exec = function() {
  936. return l = !0, null;
  937. }, h[i](""), !l;
  938. });
  939. if (!n || !o || t) {
  940. var s = /./[i], u = e(i, ""[a], function(l, h, f, c, v) {
  941. var g = h.exec;
  942. return g === Jp || g === Ca.exec ? n && !v ? { done: !0, value: Ns(s, h, f, c) } : { done: !0, value: Ns(l, f, h, c) } : { done: !1 };
  943. });
  944. Is(String.prototype, a, u[0]), Is(Ca, i, u[1]);
  945. }
  946. r && ey(Ca[i], "sham", !0);
  947. }, Wi = L, ry = Cr, ay = pe, iy = ve, ny = Wi("".charAt), _s = Wi("".charCodeAt), sy = Wi("".slice), oy = function(a) {
  948. return function(e, t) {
  949. var r = ay(iy(e)), i = ry(t), n = r.length, o, s;
  950. return i < 0 || i >= n ? a ? "" : void 0 : (o = _s(r, i), o < 55296 || o > 56319 || i + 1 === n || (s = _s(r, i + 1)) < 56320 || s > 57343 ? a ? ny(r, i) : o : a ? sy(r, i, i + 2) : (o - 55296 << 10) + (s - 56320) + 65536);
  951. };
  952. }, uy = {
  953. // `String.prototype.at` method
  954. // https://github.com/mathiasbynens/String.prototype.at
  955. charAt: oy(!0)
  956. }, ly = uy.charAt, qi = function(a, e, t) {
  957. return e + (t && ly(a, e).length || 1);
  958. }, hy = _, vy = D, Vs = hy.RegExp, fy = !vy(function() {
  959. var a = !0;
  960. try {
  961. Vs(".", "d");
  962. } catch (u) {
  963. a = !1;
  964. }
  965. var e = {}, t = "", r = a ? "dgimsy" : "gimsy", i = function(u, l) {
  966. Object.defineProperty(e, u, { get: function() {
  967. return t += l, !0;
  968. } });
  969. }, n = {
  970. dotAll: "s",
  971. global: "g",
  972. ignoreCase: "i",
  973. multiline: "m",
  974. sticky: "y"
  975. };
  976. a && (n.hasIndices = "d");
  977. for (var o in n) i(o, n[o]);
  978. var s = Object.getOwnPropertyDescriptor(Vs.prototype, "flags").get.call(e);
  979. return s !== r || t !== r;
  980. }), cy = { correct: fy }, gy = Y, dy = fe, py = Tr, Ds = cy, yy = Hu, my = RegExp.prototype, Vr = Ds.correct ? function(a) {
  981. return a.flags;
  982. } : function(a) {
  983. return !Ds.correct && py(my, a) && !dy(a, "flags") ? gy(yy, a) : a.flags;
  984. }, Ls = Y, by = J, xy = k, Ty = Ce, Oy = Yi, Sy = TypeError, Qi = function(a, e) {
  985. var t = a.exec;
  986. if (xy(t)) {
  987. var r = Ls(t, a, e);
  988. return r !== null && by(r), r;
  989. }
  990. if (Ty(a) === "RegExp") return Ls(Oy, a, e);
  991. throw new Sy("RegExp#exec called on incompatible receiver");
  992. }, Ey = Y, $y = L, wy = Xi, Cy = J, Ay = ae, Py = ut, Jt = pe, Ry = ve, Ny = ot, Iy = qi, My = Vr, ks = Qi, Aa = $y("".indexOf);
  993. wy("match", function(a, e, t) {
  994. return [
  995. // `String.prototype.match` method
  996. // https://tc39.es/ecma262/#sec-string.prototype.match
  997. function(i) {
  998. var n = Ry(this), o = Ay(i) ? Ny(i, a) : void 0;
  999. if (o) return Ey(o, i, n);
  1000. var s = Jt(n);
  1001. return new RegExp(i)[a](s);
  1002. },
  1003. // `RegExp.prototype[@@match]` method
  1004. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  1005. function(r) {
  1006. var i = Cy(this), n = Jt(r), o = t(e, i, n);
  1007. if (o.done) return o.value;
  1008. var s = Jt(My(i));
  1009. if (!~Aa(s, "g")) return ks(i, n);
  1010. var u = !!~Aa(s, "u") || !!~Aa(s, "v");
  1011. i.lastIndex = 0;
  1012. for (var l = [], h = 0, f; (f = ks(i, n)) !== null; ) {
  1013. var c = Jt(f[0]);
  1014. l[h] = c, c === "" && (i.lastIndex = Iy(n, Py(i.lastIndex), u)), h++;
  1015. }
  1016. return h === 0 ? null : l;
  1017. }
  1018. ];
  1019. });
  1020. var Ki = L, _y = Sr, Vy = Math.floor, Pa = Ki("".charAt), Dy = Ki("".replace), Ra = Ki("".slice), Ly = /\$([$&'`]|\d{1,2}|<[^>]*>)/g, ky = /\$([$&'`]|\d{1,2})/g, By = function(a, e, t, r, i, n) {
  1021. var o = t + a.length, s = r.length, u = ky;
  1022. return i !== void 0 && (i = _y(i), u = Ly), Dy(n, u, function(l, h) {
  1023. var f;
  1024. switch (Pa(h, 0)) {
  1025. case "$":
  1026. return "$";
  1027. case "&":
  1028. return a;
  1029. case "`":
  1030. return Ra(e, 0, t);
  1031. case "'":
  1032. return Ra(e, o);
  1033. case "<":
  1034. f = i[Ra(h, 1, -1)];
  1035. break;
  1036. default:
  1037. var c = +h;
  1038. if (c === 0) return l;
  1039. if (c > s) {
  1040. var v = Vy(c / 10);
  1041. return v === 0 ? l : v <= s ? r[v - 1] === void 0 ? Pa(h, 1) : r[v - 1] + Pa(h, 1) : l;
  1042. }
  1043. f = r[c - 1];
  1044. }
  1045. return f === void 0 ? "" : f;
  1046. });
  1047. }, jy = bu, Bs = Y, Dr = L, Fy = Xi, Uy = D, Gy = J, zy = k, Hy = ae, Yy = Cr, Xy = ut, _e = pe, Wy = ve, qy = qi, Qy = ot, Ky = By, Zy = Vr, Jy = Qi, em = z, vi = em("replace"), tm = Math.max, rm = Math.min, am = Dr([].concat), Na = Dr([].push), We = Dr("".indexOf), js = Dr("".slice), im = function(a) {
  1048. return a === void 0 ? a : String(a);
  1049. }, nm = function() {
  1050. return "a".replace(/./, "$0") === "$0";
  1051. }(), Fs = function() {
  1052. return /./[vi] ? /./[vi]("a", "$0") === "" : !1;
  1053. }(), sm = !Uy(function() {
  1054. var a = /./;
  1055. return a.exec = function() {
  1056. var e = [];
  1057. return e.groups = { a: "7" }, e;
  1058. }, "".replace(a, "$<a>") !== "7";
  1059. });
  1060. Fy("replace", function(a, e, t) {
  1061. var r = Fs ? "$" : "$0";
  1062. return [
  1063. // `String.prototype.replace` method
  1064. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1065. function(n, o) {
  1066. var s = Wy(this), u = Hy(n) ? Qy(n, vi) : void 0;
  1067. return u ? Bs(u, n, s, o) : Bs(e, _e(s), n, o);
  1068. },
  1069. // `RegExp.prototype[@@replace]` method
  1070. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1071. function(i, n) {
  1072. var o = Gy(this), s = _e(i), u = zy(n);
  1073. u || (n = _e(n));
  1074. var l = _e(Zy(o));
  1075. if (typeof n == "string" && !~We(n, r) && !~We(n, "$<") && !~We(l, "y")) {
  1076. var h = t(e, o, s, n);
  1077. if (h.done) return h.value;
  1078. }
  1079. var f = !!~We(l, "g"), c;
  1080. f && (c = !!~We(l, "u") || !!~We(l, "v"), o.lastIndex = 0);
  1081. for (var v = [], g; g = Jy(o, s), !(g === null || (Na(v, g), !f)); ) {
  1082. var d = _e(g[0]);
  1083. d === "" && (o.lastIndex = qy(s, Xy(o.lastIndex), c));
  1084. }
  1085. for (var p = "", y = 0, T = 0; T < v.length; T++) {
  1086. g = v[T];
  1087. for (var b = _e(g[0]), x = tm(rm(Yy(g.index), s.length), 0), $ = [], E, O = 1; O < g.length; O++) Na($, im(g[O]));
  1088. var C = g.groups;
  1089. if (u) {
  1090. var P = am([b], $, x, s);
  1091. C !== void 0 && Na(P, C), E = _e(jy(n, void 0, P));
  1092. } else
  1093. E = Ky(b, s, x, $, C, n);
  1094. x >= y && (p += js(s, y, x) + E, y = x + b.length);
  1095. }
  1096. return p + js(s, y);
  1097. }
  1098. ];
  1099. }, !sm || !nm || Fs);
  1100. var om = ae, um = Ce, lm = z, hm = lm("match"), vm = function(a) {
  1101. var e;
  1102. return om(a) && ((e = a[hm]) !== void 0 ? !!e : um(a) === "RegExp");
  1103. }, fm = vm, cm = TypeError, Zi = function(a) {
  1104. if (fm(a))
  1105. throw new cm("The method doesn't accept regular expressions");
  1106. return a;
  1107. }, gm = z, dm = gm("match"), Ji = function(a) {
  1108. var e = /./;
  1109. try {
  1110. "/./"[a](e);
  1111. } catch (t) {
  1112. try {
  1113. return e[dm] = !1, "/./"[a](e);
  1114. } catch (r) {
  1115. }
  1116. }
  1117. return !1;
  1118. }, pm = ee, ym = Rr, mm = $t.f, bm = ut, Us = pe, xm = Zi, Tm = ve, Om = Ji, Sm = ym("".slice), Em = Math.min, Zu = Om("startsWith"), $m = !Zu && !!function() {
  1119. var a = mm(String.prototype, "startsWith");
  1120. return a && !a.writable;
  1121. }();
  1122. pm({ target: "String", proto: !0, forced: !$m && !Zu }, {
  1123. startsWith: function(e) {
  1124. var t = Us(Tm(this));
  1125. xm(e);
  1126. var r = Us(e), i = bm(Em(arguments.length > 1 ? arguments[1] : void 0, t.length));
  1127. return Sm(t, i, i + r.length) === r;
  1128. }
  1129. });
  1130. var wm = z, Cm = Hi, Am = Te.f, fi = wm("unscopables"), ci = Array.prototype;
  1131. ci[fi] === void 0 && Am(ci, fi, {
  1132. configurable: !0,
  1133. value: Cm(null)
  1134. });
  1135. var Pm = function(a) {
  1136. ci[fi][a] = !0;
  1137. }, Rm = D, Nm = !Rm(function() {
  1138. function a() {
  1139. }
  1140. return a.prototype.constructor = null, Object.getPrototypeOf(new a()) !== a.prototype;
  1141. }), Im = fe, Mm = k, _m = Sr, Vm = Pi, Dm = Nm, Gs = Vm("IE_PROTO"), gi = Object, Lm = gi.prototype, Ju = Dm ? gi.getPrototypeOf : function(a) {
  1142. var e = _m(a);
  1143. if (Im(e, Gs)) return e[Gs];
  1144. var t = e.constructor;
  1145. return Mm(t) && e instanceof t ? t.prototype : e instanceof gi ? Lm : null;
  1146. }, km = D, Bm = k, jm = ae, zs = Ju, Fm = Ue, Um = z, di = Um("iterator"), el = !1, Be, Ia, Ma;
  1147. [].keys && (Ma = [].keys(), "next" in Ma ? (Ia = zs(zs(Ma)), Ia !== Object.prototype && (Be = Ia)) : el = !0);
  1148. var Gm = !jm(Be) || km(function() {
  1149. var a = {};
  1150. return Be[di].call(a) !== a;
  1151. });
  1152. Gm && (Be = {});
  1153. Bm(Be[di]) || Fm(Be, di, function() {
  1154. return this;
  1155. });
  1156. var tl = {
  1157. IteratorPrototype: Be,
  1158. BUGGY_SAFARI_ITERATORS: el
  1159. }, zm = tl.IteratorPrototype, Hm = Hi, Ym = Si, Xm = Pr, Wm = Mr, qm = function() {
  1160. return this;
  1161. }, Qm = function(a, e, t, r) {
  1162. var i = e + " Iterator";
  1163. return a.prototype = Hm(zm, { next: Ym(+!r, t) }), Xm(a, i, !1), Wm[i] = qm, a;
  1164. }, Km = ee, Zm = Y, rl = $r, Jm = k, e0 = Qm, Hs = Ju, Ys = hu, t0 = Pr, r0 = At, _a = Ue, a0 = z, i0 = Mr, al = tl, n0 = rl.PROPER, s0 = rl.CONFIGURABLE, Xs = al.IteratorPrototype, er = al.BUGGY_SAFARI_ITERATORS, gt = a0("iterator"), Ws = "keys", dt = "values", qs = "entries", o0 = function() {
  1165. return this;
  1166. }, u0 = function(a, e, t, r, i, n, o) {
  1167. e0(t, e, r);
  1168. var s = function(y) {
  1169. if (y === i && c) return c;
  1170. if (!er && y && y in h) return h[y];
  1171. switch (y) {
  1172. case Ws:
  1173. return function() {
  1174. return new t(this, y);
  1175. };
  1176. case dt:
  1177. return function() {
  1178. return new t(this, y);
  1179. };
  1180. case qs:
  1181. return function() {
  1182. return new t(this, y);
  1183. };
  1184. }
  1185. return function() {
  1186. return new t(this);
  1187. };
  1188. }, u = e + " Iterator", l = !1, h = a.prototype, f = h[gt] || h["@@iterator"] || i && h[i], c = !er && f || s(i), v = e === "Array" && h.entries || f, g, d, p;
  1189. if (v && (g = Hs(v.call(new a())), g !== Object.prototype && g.next && (Hs(g) !== Xs && (Ys ? Ys(g, Xs) : Jm(g[gt]) || _a(g, gt, o0)), t0(g, u, !0))), n0 && i === dt && f && f.name !== dt && (s0 ? r0(h, "name", dt) : (l = !0, c = function() {
  1190. return Zm(f, this);
  1191. })), i)
  1192. if (d = {
  1193. values: s(dt),
  1194. keys: n ? c : s(Ws),
  1195. entries: s(qs)
  1196. }, o) for (p in d)
  1197. (er || l || !(p in h)) && _a(h, p, d[p]);
  1198. else Km({ target: e, proto: !0, forced: er || l }, d);
  1199. return h[gt] !== c && _a(h, gt, c, { name: i }), i0[e] = c, d;
  1200. }, l0 = function(a, e) {
  1201. return { value: a, done: e };
  1202. }, h0 = wt, en = Pm, Qs = Mr, il = wr, v0 = Te.f, f0 = u0, tr = l0, c0 = he, nl = "Array Iterator", g0 = il.set, d0 = il.getterFor(nl), p0 = f0(Array, "Array", function(a, e) {
  1203. g0(this, {
  1204. type: nl,
  1205. target: h0(a),
  1206. // target
  1207. index: 0,
  1208. // next index
  1209. kind: e
  1210. // kind
  1211. });
  1212. }, function() {
  1213. var a = d0(this), e = a.target, t = a.index++;
  1214. if (!e || t >= e.length)
  1215. return a.target = null, tr(void 0, !0);
  1216. switch (a.kind) {
  1217. case "keys":
  1218. return tr(t, !1);
  1219. case "values":
  1220. return tr(e[t], !1);
  1221. }
  1222. return tr([t, e[t]], !1);
  1223. }, "values"), Ks = Qs.Arguments = Qs.Array;
  1224. en("keys");
  1225. en("values");
  1226. en("entries");
  1227. if (c0 && Ks.name !== "values") try {
  1228. v0(Ks, "name", { value: "values" });
  1229. } catch (a) {
  1230. }
  1231. var y0 = {
  1232. CSSRuleList: 0,
  1233. CSSStyleDeclaration: 0,
  1234. CSSValueList: 0,
  1235. ClientRectList: 0,
  1236. DOMRectList: 0,
  1237. DOMStringList: 0,
  1238. DOMTokenList: 1,
  1239. DataTransferItemList: 0,
  1240. FileList: 0,
  1241. HTMLAllCollection: 0,
  1242. HTMLCollection: 0,
  1243. HTMLFormElement: 0,
  1244. HTMLSelectElement: 0,
  1245. MediaList: 0,
  1246. MimeTypeArray: 0,
  1247. NamedNodeMap: 0,
  1248. NodeList: 1,
  1249. PaintRequestList: 0,
  1250. Plugin: 0,
  1251. PluginArray: 0,
  1252. SVGLengthList: 0,
  1253. SVGNumberList: 0,
  1254. SVGPathSegList: 0,
  1255. SVGPointList: 0,
  1256. SVGStringList: 0,
  1257. SVGTransformList: 0,
  1258. SourceBufferList: 0,
  1259. StyleSheetList: 0,
  1260. TextTrackCueList: 0,
  1261. TextTrackList: 0,
  1262. TouchList: 0
  1263. }, m0 = Er, Va = m0("span").classList, Zs = Va && Va.constructor && Va.constructor.prototype, b0 = Zs === Object.prototype ? void 0 : Zs, Js = _, sl = y0, x0 = b0, yt = p0, eo = At, T0 = Pr, O0 = z, Da = O0("iterator"), La = yt.values, ol = function(a, e) {
  1264. if (a) {
  1265. if (a[Da] !== La) try {
  1266. eo(a, Da, La);
  1267. } catch (r) {
  1268. a[Da] = La;
  1269. }
  1270. if (T0(a, e, !0), sl[e]) {
  1271. for (var t in yt)
  1272. if (a[t] !== yt[t]) try {
  1273. eo(a, t, yt[t]);
  1274. } catch (r) {
  1275. a[t] = yt[t];
  1276. }
  1277. }
  1278. }
  1279. };
  1280. for (var ka in sl)
  1281. ol(Js[ka] && Js[ka].prototype, ka);
  1282. ol(x0, "DOMTokenList");
  1283. var S0 = Ae, E0 = Sr, $0 = Uo, w0 = Ii, to = TypeError, ro = "Reduce of empty array with no initial value", C0 = function(a) {
  1284. return function(e, t, r, i) {
  1285. var n = E0(e), o = $0(n), s = w0(n);
  1286. if (S0(t), s === 0 && r < 2) throw new to(ro);
  1287. var u = a ? s - 1 : 0, l = a ? -1 : 1;
  1288. if (r < 2) for (; ; ) {
  1289. if (u in o) {
  1290. i = o[u], u += l;
  1291. break;
  1292. }
  1293. if (u += l, a ? u < 0 : s <= u)
  1294. throw new to(ro);
  1295. }
  1296. for (; a ? u >= 0 : s > u; u += l) u in o && (i = t(i, o[u], u, n));
  1297. return i;
  1298. };
  1299. }, A0 = {
  1300. // `Array.prototype.reduce` method
  1301. // https://tc39.es/ecma262/#sec-array.prototype.reduce
  1302. left: C0(!1)
  1303. }, P0 = D, ul = function(a, e) {
  1304. var t = [][a];
  1305. return !!t && P0(function() {
  1306. t.call(null, e || function() {
  1307. return 1;
  1308. }, 1);
  1309. });
  1310. }, R0 = ee, N0 = A0.left, I0 = ul, ao = Ei, M0 = Ar, _0 = !M0 && ao > 79 && ao < 83, V0 = _0 || !I0("reduce");
  1311. R0({ target: "Array", proto: !0, forced: V0 }, {
  1312. reduce: function(e) {
  1313. var t = arguments.length;
  1314. return N0(this, e, t, t > 1 ? arguments[1] : void 0);
  1315. }
  1316. });
  1317. var D0 = ee, L0 = Rr, k0 = $t.f, B0 = ut, io = pe, j0 = Zi, F0 = ve, U0 = Ji, G0 = L0("".slice), z0 = Math.min, ll = U0("endsWith"), H0 = !ll && !!function() {
  1318. var a = k0(String.prototype, "endsWith");
  1319. return a && !a.writable;
  1320. }();
  1321. D0({ target: "String", proto: !0, forced: !H0 && !ll }, {
  1322. endsWith: function(e) {
  1323. var t = io(F0(this));
  1324. j0(e);
  1325. var r = io(e), i = arguments.length > 1 ? arguments[1] : void 0, n = t.length, o = i === void 0 ? n : z0(B0(i), n);
  1326. return G0(t, o - r.length, o) === r;
  1327. }
  1328. });
  1329. var Ba = Y, tn = L, Y0 = Xi, X0 = J, W0 = ae, q0 = ve, Q0 = yu, K0 = qi, Z0 = ut, ja = pe, J0 = ot, eb = Vr, no = Qi, tb = Yu, rb = D, qe = tb.UNSUPPORTED_Y, ab = 4294967295, ib = Math.min, Fa = tn([].push), Ua = tn("".slice), rr = tn("".indexOf), nb = !rb(function() {
  1330. var a = /(?:)/, e = a.exec;
  1331. a.exec = function() {
  1332. return e.apply(this, arguments);
  1333. };
  1334. var t = "ab".split(a);
  1335. return t.length !== 2 || t[0] !== "a" || t[1] !== "b";
  1336. }), so = "abbc".split(/(b)*/)[1] === "c" || // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1337. "test".split(/(?:)/, -1).length !== 4 || "ab".split(/(?:ab)*/).length !== 2 || ".".split(/(.?)(.?)/).length !== 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  1338. ".".split(/()()/).length > 1 || "".split(/.?/).length;
  1339. Y0("split", function(a, e, t) {
  1340. var r = "0".split(void 0, 0).length ? function(i, n) {
  1341. return i === void 0 && n === 0 ? [] : Ba(e, this, i, n);
  1342. } : e;
  1343. return [
  1344. // `String.prototype.split` method
  1345. // https://tc39.es/ecma262/#sec-string.prototype.split
  1346. function(n, o) {
  1347. var s = q0(this), u = W0(n) ? J0(n, a) : void 0;
  1348. return u ? Ba(u, n, s, o) : Ba(r, ja(s), n, o);
  1349. },
  1350. // `RegExp.prototype[@@split]` method
  1351. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1352. //
  1353. // NOTE: This cannot be properly polyfilled in engines that don't support
  1354. // the 'y' flag.
  1355. function(i, n) {
  1356. var o = X0(this), s = ja(i);
  1357. if (!so) {
  1358. var u = t(r, o, s, n, r !== e);
  1359. if (u.done) return u.value;
  1360. }
  1361. var l = Q0(o, RegExp), h = ja(eb(o)), f = !!~rr(h, "u") || !!~rr(h, "v");
  1362. qe ? ~rr(h, "g") || (h += "g") : ~rr(h, "y") || (h += "y");
  1363. var c = new l(qe ? "^(?:" + o.source + ")" : o, h), v = n === void 0 ? ab : n >>> 0;
  1364. if (v === 0) return [];
  1365. if (s.length === 0) return no(c, s) === null ? [s] : [];
  1366. for (var g = 0, d = 0, p = []; d < s.length; ) {
  1367. c.lastIndex = qe ? 0 : d;
  1368. var y = no(c, qe ? Ua(s, d) : s), T;
  1369. if (y === null || (T = ib(Z0(c.lastIndex + (qe ? d : 0)), s.length)) === g)
  1370. d = K0(s, d, f);
  1371. else {
  1372. if (Fa(p, Ua(s, g, d)), p.length === v) return p;
  1373. for (var b = 1; b <= y.length - 1; b++)
  1374. if (Fa(p, y[b]), p.length === v) return p;
  1375. d = g = T;
  1376. }
  1377. }
  1378. return Fa(p, Ua(s, g)), p;
  1379. }
  1380. ];
  1381. }, so || !nb, qe);
  1382. var Lr = { exports: {} }, mt = { exports: {} };
  1383. (function() {
  1384. var a, e, t, r, i, n;
  1385. typeof performance != "undefined" && performance !== null && performance.now ? mt.exports = function() {
  1386. return performance.now();
  1387. } : typeof process != "undefined" && process !== null && process.hrtime ? (mt.exports = function() {
  1388. return (a() - i) / 1e6;
  1389. }, e = process.hrtime, a = function() {
  1390. var o;
  1391. return o = e(), o[0] * 1e9 + o[1];
  1392. }, r = a(), n = process.uptime() * 1e9, i = r - n) : Date.now ? (mt.exports = function() {
  1393. return Date.now() - t;
  1394. }, t = Date.now()) : (mt.exports = function() {
  1395. return (/* @__PURE__ */ new Date()).getTime() - t;
  1396. }, t = (/* @__PURE__ */ new Date()).getTime());
  1397. }).call(Ke);
  1398. var sb = mt.exports, ob = sb, be = typeof window == "undefined" ? Ke : window, ar = ["moz", "webkit"], rt = "AnimationFrame", st = be["request" + rt], Et = be["cancel" + rt] || be["cancelRequest" + rt];
  1399. for (var pt = 0; !st && pt < ar.length; pt++)
  1400. st = be[ar[pt] + "Request" + rt], Et = be[ar[pt] + "Cancel" + rt] || be[ar[pt] + "CancelRequest" + rt];
  1401. if (!st || !Et) {
  1402. var Ga = 0, oo = 0, Ve = [], ub = 1e3 / 60;
  1403. st = function(a) {
  1404. if (Ve.length === 0) {
  1405. var e = ob(), t = Math.max(0, ub - (e - Ga));
  1406. Ga = t + e, setTimeout(function() {
  1407. var r = Ve.slice(0);
  1408. Ve.length = 0;
  1409. for (var i = 0; i < r.length; i++)
  1410. if (!r[i].cancelled)
  1411. try {
  1412. r[i].callback(Ga);
  1413. } catch (n) {
  1414. setTimeout(function() {
  1415. throw n;
  1416. }, 0);
  1417. }
  1418. }, Math.round(t));
  1419. }
  1420. return Ve.push({
  1421. handle: ++oo,
  1422. callback: a,
  1423. cancelled: !1
  1424. }), oo;
  1425. }, Et = function(a) {
  1426. for (var e = 0; e < Ve.length; e++)
  1427. Ve[e].handle === a && (Ve[e].cancelled = !0);
  1428. };
  1429. }
  1430. Lr.exports = function(a) {
  1431. return st.call(be, a);
  1432. };
  1433. Lr.exports.cancel = function() {
  1434. Et.apply(be, arguments);
  1435. };
  1436. Lr.exports.polyfill = function(a) {
  1437. a || (a = be), a.requestAnimationFrame = st, a.cancelAnimationFrame = Et;
  1438. };
  1439. var lb = Lr.exports;
  1440. const za = /* @__PURE__ */ Vo(lb);
  1441. var hl = `
  1442. \v\f\r                 \u2028\u2029\uFEFF`, hb = L, vb = ve, fb = pe, pi = hl, uo = hb("".replace), cb = RegExp("^[" + pi + "]+"), gb = RegExp("(^|[^" + pi + "])[" + pi + "]+$"), db = function(a) {
  1443. return function(e) {
  1444. var t = fb(vb(e));
  1445. return a & 1 && (t = uo(t, cb, "")), a & 2 && (t = uo(t, gb, "$1")), t;
  1446. };
  1447. }, pb = {
  1448. // `String.prototype.trim` method
  1449. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1450. trim: db(3)
  1451. }, yb = $r.PROPER, mb = D, lo = hl, ho = "​…᠎", bb = function(a) {
  1452. return mb(function() {
  1453. return !!lo[a]() || ho[a]() !== ho || yb && lo[a].name !== a;
  1454. });
  1455. }, xb = ee, Tb = pb.trim, Ob = bb;
  1456. xb({ target: "String", proto: !0, forced: Ob("trim") }, {
  1457. trim: function() {
  1458. return Tb(this);
  1459. }
  1460. });
  1461. var Sb = function(a) {
  1462. this.ok = !1, this.alpha = 1, a.charAt(0) == "#" && (a = a.substr(1, 6)), a = a.replace(/ /g, ""), a = a.toLowerCase();
  1463. var e = {
  1464. aliceblue: "f0f8ff",
  1465. antiquewhite: "faebd7",
  1466. aqua: "00ffff",
  1467. aquamarine: "7fffd4",
  1468. azure: "f0ffff",
  1469. beige: "f5f5dc",
  1470. bisque: "ffe4c4",
  1471. black: "000000",
  1472. blanchedalmond: "ffebcd",
  1473. blue: "0000ff",
  1474. blueviolet: "8a2be2",
  1475. brown: "a52a2a",
  1476. burlywood: "deb887",
  1477. cadetblue: "5f9ea0",
  1478. chartreuse: "7fff00",
  1479. chocolate: "d2691e",
  1480. coral: "ff7f50",
  1481. cornflowerblue: "6495ed",
  1482. cornsilk: "fff8dc",
  1483. crimson: "dc143c",
  1484. cyan: "00ffff",
  1485. darkblue: "00008b",
  1486. darkcyan: "008b8b",
  1487. darkgoldenrod: "b8860b",
  1488. darkgray: "a9a9a9",
  1489. darkgreen: "006400",
  1490. darkkhaki: "bdb76b",
  1491. darkmagenta: "8b008b",
  1492. darkolivegreen: "556b2f",
  1493. darkorange: "ff8c00",
  1494. darkorchid: "9932cc",
  1495. darkred: "8b0000",
  1496. darksalmon: "e9967a",
  1497. darkseagreen: "8fbc8f",
  1498. darkslateblue: "483d8b",
  1499. darkslategray: "2f4f4f",
  1500. darkturquoise: "00ced1",
  1501. darkviolet: "9400d3",
  1502. deeppink: "ff1493",
  1503. deepskyblue: "00bfff",
  1504. dimgray: "696969",
  1505. dodgerblue: "1e90ff",
  1506. feldspar: "d19275",
  1507. firebrick: "b22222",
  1508. floralwhite: "fffaf0",
  1509. forestgreen: "228b22",
  1510. fuchsia: "ff00ff",
  1511. gainsboro: "dcdcdc",
  1512. ghostwhite: "f8f8ff",
  1513. gold: "ffd700",
  1514. goldenrod: "daa520",
  1515. gray: "808080",
  1516. green: "008000",
  1517. greenyellow: "adff2f",
  1518. honeydew: "f0fff0",
  1519. hotpink: "ff69b4",
  1520. indianred: "cd5c5c",
  1521. indigo: "4b0082",
  1522. ivory: "fffff0",
  1523. khaki: "f0e68c",
  1524. lavender: "e6e6fa",
  1525. lavenderblush: "fff0f5",
  1526. lawngreen: "7cfc00",
  1527. lemonchiffon: "fffacd",
  1528. lightblue: "add8e6",
  1529. lightcoral: "f08080",
  1530. lightcyan: "e0ffff",
  1531. lightgoldenrodyellow: "fafad2",
  1532. lightgrey: "d3d3d3",
  1533. lightgreen: "90ee90",
  1534. lightpink: "ffb6c1",
  1535. lightsalmon: "ffa07a",
  1536. lightseagreen: "20b2aa",
  1537. lightskyblue: "87cefa",
  1538. lightslateblue: "8470ff",
  1539. lightslategray: "778899",
  1540. lightsteelblue: "b0c4de",
  1541. lightyellow: "ffffe0",
  1542. lime: "00ff00",
  1543. limegreen: "32cd32",
  1544. linen: "faf0e6",
  1545. magenta: "ff00ff",
  1546. maroon: "800000",
  1547. mediumaquamarine: "66cdaa",
  1548. mediumblue: "0000cd",
  1549. mediumorchid: "ba55d3",
  1550. mediumpurple: "9370d8",
  1551. mediumseagreen: "3cb371",
  1552. mediumslateblue: "7b68ee",
  1553. mediumspringgreen: "00fa9a",
  1554. mediumturquoise: "48d1cc",
  1555. mediumvioletred: "c71585",
  1556. midnightblue: "191970",
  1557. mintcream: "f5fffa",
  1558. mistyrose: "ffe4e1",
  1559. moccasin: "ffe4b5",
  1560. navajowhite: "ffdead",
  1561. navy: "000080",
  1562. oldlace: "fdf5e6",
  1563. olive: "808000",
  1564. olivedrab: "6b8e23",
  1565. orange: "ffa500",
  1566. orangered: "ff4500",
  1567. orchid: "da70d6",
  1568. palegoldenrod: "eee8aa",
  1569. palegreen: "98fb98",
  1570. paleturquoise: "afeeee",
  1571. palevioletred: "d87093",
  1572. papayawhip: "ffefd5",
  1573. peachpuff: "ffdab9",
  1574. peru: "cd853f",
  1575. pink: "ffc0cb",
  1576. plum: "dda0dd",
  1577. powderblue: "b0e0e6",
  1578. purple: "800080",
  1579. rebeccapurple: "663399",
  1580. red: "ff0000",
  1581. rosybrown: "bc8f8f",
  1582. royalblue: "4169e1",
  1583. saddlebrown: "8b4513",
  1584. salmon: "fa8072",
  1585. sandybrown: "f4a460",
  1586. seagreen: "2e8b57",
  1587. seashell: "fff5ee",
  1588. sienna: "a0522d",
  1589. silver: "c0c0c0",
  1590. skyblue: "87ceeb",
  1591. slateblue: "6a5acd",
  1592. slategray: "708090",
  1593. snow: "fffafa",
  1594. springgreen: "00ff7f",
  1595. steelblue: "4682b4",
  1596. tan: "d2b48c",
  1597. teal: "008080",
  1598. thistle: "d8bfd8",
  1599. tomato: "ff6347",
  1600. turquoise: "40e0d0",
  1601. violet: "ee82ee",
  1602. violetred: "d02090",
  1603. wheat: "f5deb3",
  1604. white: "ffffff",
  1605. whitesmoke: "f5f5f5",
  1606. yellow: "ffff00",
  1607. yellowgreen: "9acd32"
  1608. };
  1609. a = e[a] || a;
  1610. for (var t = [
  1611. {
  1612. re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
  1613. example: ["rgba(123, 234, 45, 0.8)", "rgba(255,234,245,1.0)"],
  1614. process: function(u) {
  1615. return [
  1616. parseInt(u[1]),
  1617. parseInt(u[2]),
  1618. parseInt(u[3]),
  1619. parseFloat(u[4])
  1620. ];
  1621. }
  1622. },
  1623. {
  1624. re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
  1625. example: ["rgb(123, 234, 45)", "rgb(255,234,245)"],
  1626. process: function(u) {
  1627. return [
  1628. parseInt(u[1]),
  1629. parseInt(u[2]),
  1630. parseInt(u[3])
  1631. ];
  1632. }
  1633. },
  1634. {
  1635. re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  1636. example: ["#00ff00", "336699"],
  1637. process: function(u) {
  1638. return [
  1639. parseInt(u[1], 16),
  1640. parseInt(u[2], 16),
  1641. parseInt(u[3], 16)
  1642. ];
  1643. }
  1644. },
  1645. {
  1646. re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  1647. example: ["#fb0", "f0f"],
  1648. process: function(u) {
  1649. return [
  1650. parseInt(u[1] + u[1], 16),
  1651. parseInt(u[2] + u[2], 16),
  1652. parseInt(u[3] + u[3], 16)
  1653. ];
  1654. }
  1655. }
  1656. ], r = 0; r < t.length; r++) {
  1657. var i = t[r].re, n = t[r].process, o = i.exec(a);
  1658. if (o) {
  1659. var s = n(o);
  1660. this.r = s[0], this.g = s[1], this.b = s[2], s.length > 3 && (this.alpha = s[3]), this.ok = !0;
  1661. }
  1662. }
  1663. 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() {
  1664. return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
  1665. }, this.toRGBA = function() {
  1666. return "rgba(" + this.r + ", " + this.g + ", " + this.b + ", " + this.alpha + ")";
  1667. }, this.toHex = function() {
  1668. var u = this.r.toString(16), l = this.g.toString(16), h = this.b.toString(16);
  1669. return u.length == 1 && (u = "0" + u), l.length == 1 && (l = "0" + l), h.length == 1 && (h = "0" + h), "#" + u + l + h;
  1670. }, this.getHelpXML = function() {
  1671. for (var u = new Array(), l = 0; l < t.length; l++)
  1672. for (var h = t[l].example, f = 0; f < h.length; f++)
  1673. u[u.length] = h[f];
  1674. for (var c in e)
  1675. u[u.length] = c;
  1676. var v = document.createElement("ul");
  1677. v.setAttribute("id", "rgbcolor-examples");
  1678. for (var l = 0; l < u.length; l++)
  1679. try {
  1680. var g = document.createElement("li"), d = new RGBColor(u[l]), p = document.createElement("div");
  1681. p.style.cssText = "margin: 3px; border: 1px solid black; background:" + d.toHex() + "; color:" + d.toHex(), p.appendChild(document.createTextNode("test"));
  1682. var y = document.createTextNode(
  1683. " " + u[l] + " -> " + d.toRGB() + " -> " + d.toHex()
  1684. );
  1685. g.appendChild(p), g.appendChild(y), v.appendChild(g);
  1686. } catch (b) {
  1687. }
  1688. return v;
  1689. };
  1690. };
  1691. const yi = /* @__PURE__ */ Vo(Sb);
  1692. var Eb = ee, $b = Rr, wb = nu.indexOf, Cb = ul, mi = $b([].indexOf), vl = !!mi && 1 / mi([1], 1, -0) < 0, Ab = vl || !Cb("indexOf");
  1693. Eb({ target: "Array", proto: !0, forced: Ab }, {
  1694. indexOf: function(e) {
  1695. var t = arguments.length > 1 ? arguments[1] : void 0;
  1696. return vl ? mi(this, e, t) || 0 : wb(this, e, t);
  1697. }
  1698. });
  1699. var Pb = ee, Rb = L, Nb = Zi, Ib = ve, vo = pe, Mb = Ji, _b = Rb("".indexOf);
  1700. Pb({ target: "String", proto: !0, forced: !Mb("includes") }, {
  1701. includes: function(e) {
  1702. return !!~_b(
  1703. vo(Ib(this)),
  1704. vo(Nb(e)),
  1705. arguments.length > 1 ? arguments[1] : void 0
  1706. );
  1707. }
  1708. });
  1709. var Vb = Ce, Db = Array.isArray || function(e) {
  1710. return Vb(e) === "Array";
  1711. }, Lb = ee, kb = L, Bb = Db, jb = kb([].reverse), fo = [1, 2];
  1712. Lb({ target: "Array", proto: !0, forced: String(fo) === String(fo.reverse()) }, {
  1713. reverse: function() {
  1714. return Bb(this) && (this.length = this.length), jb(this);
  1715. }
  1716. });
  1717. /*! *****************************************************************************
  1718. Copyright (c) Microsoft Corporation.
  1719. Permission to use, copy, modify, and/or distribute this software for any
  1720. purpose with or without fee is hereby granted.
  1721. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1722. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1723. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1724. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1725. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1726. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1727. PERFORMANCE OF THIS SOFTWARE.
  1728. ***************************************************************************** */
  1729. var fl = function(a, e) {
  1730. return (fl = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
  1731. t.__proto__ = r;
  1732. } || function(t, r) {
  1733. for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i]);
  1734. })(a, e);
  1735. };
  1736. function cl(a, e) {
  1737. if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
  1738. function t() {
  1739. this.constructor = a;
  1740. }
  1741. fl(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
  1742. }
  1743. function Fb(a) {
  1744. var e = "";
  1745. Array.isArray(a) || (a = [a]);
  1746. for (var t = 0; t < a.length; t++) {
  1747. var r = a[t];
  1748. if (r.type === m.CLOSE_PATH) e += "z";
  1749. else if (r.type === m.HORIZ_LINE_TO) e += (r.relative ? "h" : "H") + r.x;
  1750. else if (r.type === m.VERT_LINE_TO) e += (r.relative ? "v" : "V") + r.y;
  1751. else if (r.type === m.MOVE_TO) e += (r.relative ? "m" : "M") + r.x + " " + r.y;
  1752. else if (r.type === m.LINE_TO) e += (r.relative ? "l" : "L") + r.x + " " + r.y;
  1753. else if (r.type === m.CURVE_TO) e += (r.relative ? "c" : "C") + r.x1 + " " + r.y1 + " " + r.x2 + " " + r.y2 + " " + r.x + " " + r.y;
  1754. else if (r.type === m.SMOOTH_CURVE_TO) e += (r.relative ? "s" : "S") + r.x2 + " " + r.y2 + " " + r.x + " " + r.y;
  1755. else if (r.type === m.QUAD_TO) e += (r.relative ? "q" : "Q") + r.x1 + " " + r.y1 + " " + r.x + " " + r.y;
  1756. else if (r.type === m.SMOOTH_QUAD_TO) e += (r.relative ? "t" : "T") + r.x + " " + r.y;
  1757. else {
  1758. if (r.type !== m.ARC) throw new Error('Unexpected command type "' + r.type + '" at index ' + t + ".");
  1759. e += (r.relative ? "a" : "A") + r.rX + " " + r.rY + " " + r.xRot + " " + +r.lArcFlag + " " + +r.sweepFlag + " " + r.x + " " + r.y;
  1760. }
  1761. }
  1762. return e;
  1763. }
  1764. function bi(a, e) {
  1765. var t = a[0], r = a[1];
  1766. return [t * Math.cos(e) - r * Math.sin(e), t * Math.sin(e) + r * Math.cos(e)];
  1767. }
  1768. function ue() {
  1769. for (var a = [], e = 0; e < arguments.length; e++) a[e] = arguments[e];
  1770. for (var t = 0; t < a.length; t++) if (typeof a[t] != "number") throw new Error("assertNumbers arguments[" + t + "] is not a number. " + typeof a[t] + " == typeof " + a[t]);
  1771. return !0;
  1772. }
  1773. var Se = Math.PI;
  1774. function Ha(a, e, t) {
  1775. a.lArcFlag = a.lArcFlag === 0 ? 0 : 1, a.sweepFlag = a.sweepFlag === 0 ? 0 : 1;
  1776. var r = a.rX, i = a.rY, n = a.x, o = a.y;
  1777. r = Math.abs(a.rX), i = Math.abs(a.rY);
  1778. var s = bi([(e - n) / 2, (t - o) / 2], -a.xRot / 180 * Se), u = s[0], l = s[1], h = Math.pow(u, 2) / Math.pow(r, 2) + Math.pow(l, 2) / Math.pow(i, 2);
  1779. 1 < h && (r *= Math.sqrt(h), i *= Math.sqrt(h)), a.rX = r, a.rY = i;
  1780. var f = Math.pow(r, 2) * Math.pow(l, 2) + Math.pow(i, 2) * Math.pow(u, 2), c = (a.lArcFlag !== a.sweepFlag ? 1 : -1) * Math.sqrt(Math.max(0, (Math.pow(r, 2) * Math.pow(i, 2) - f) / f)), v = r * l / i * c, g = -i * u / r * c, d = bi([v, g], a.xRot / 180 * Se);
  1781. a.cX = d[0] + (e + n) / 2, a.cY = d[1] + (t + o) / 2, a.phi1 = Math.atan2((l - g) / i, (u - v) / r), a.phi2 = Math.atan2((-l - g) / i, (-u - v) / r), a.sweepFlag === 0 && a.phi2 > a.phi1 && (a.phi2 -= 2 * Se), a.sweepFlag === 1 && a.phi2 < a.phi1 && (a.phi2 += 2 * Se), a.phi1 *= 180 / Se, a.phi2 *= 180 / Se;
  1782. }
  1783. function co(a, e, t) {
  1784. ue(a, e, t);
  1785. var r = a * a + e * e - t * t;
  1786. if (0 > r) return [];
  1787. if (r === 0) return [[a * t / (a * a + e * e), e * t / (a * a + e * e)]];
  1788. var i = Math.sqrt(r);
  1789. return [[(a * t + e * i) / (a * a + e * e), (e * t - a * i) / (a * a + e * e)], [(a * t - e * i) / (a * a + e * e), (e * t + a * i) / (a * a + e * e)]];
  1790. }
  1791. var U, ye = Math.PI / 180;
  1792. function go(a, e, t) {
  1793. return (1 - t) * a + t * e;
  1794. }
  1795. function po(a, e, t, r) {
  1796. return a + Math.cos(r / 180 * Se) * e + Math.sin(r / 180 * Se) * t;
  1797. }
  1798. function yo(a, e, t, r) {
  1799. var i = 1e-6, n = e - a, o = t - e, s = 3 * n + 3 * (r - t) - 6 * o, u = 6 * (o - n), l = 3 * n;
  1800. return Math.abs(s) < i ? [-l / u] : function(h, f, c) {
  1801. var v = h * h / 4 - f;
  1802. if (v < -c) return [];
  1803. if (v <= c) return [-h / 2];
  1804. var g = Math.sqrt(v);
  1805. return [-h / 2 - g, -h / 2 + g];
  1806. }(u / s, l / s, i);
  1807. }
  1808. function mo(a, e, t, r, i) {
  1809. var n = 1 - i;
  1810. return a * (n * n * n) + e * (3 * n * n * i) + t * (3 * n * i * i) + r * (i * i * i);
  1811. }
  1812. (function(a) {
  1813. function e() {
  1814. return i(function(s, u, l) {
  1815. return s.relative && (s.x1 !== void 0 && (s.x1 += u), s.y1 !== void 0 && (s.y1 += l), s.x2 !== void 0 && (s.x2 += u), s.y2 !== void 0 && (s.y2 += l), s.x !== void 0 && (s.x += u), s.y !== void 0 && (s.y += l), s.relative = !1), s;
  1816. });
  1817. }
  1818. function t() {
  1819. var s = NaN, u = NaN, l = NaN, h = NaN;
  1820. return i(function(f, c, v) {
  1821. return f.type & m.SMOOTH_CURVE_TO && (f.type = m.CURVE_TO, s = isNaN(s) ? c : s, u = isNaN(u) ? v : u, f.x1 = f.relative ? c - s : 2 * c - s, f.y1 = f.relative ? v - u : 2 * v - u), f.type & m.CURVE_TO ? (s = f.relative ? c + f.x2 : f.x2, u = f.relative ? v + f.y2 : f.y2) : (s = NaN, u = NaN), f.type & m.SMOOTH_QUAD_TO && (f.type = m.QUAD_TO, l = isNaN(l) ? c : l, h = isNaN(h) ? v : h, f.x1 = f.relative ? c - l : 2 * c - l, f.y1 = f.relative ? v - h : 2 * v - h), f.type & m.QUAD_TO ? (l = f.relative ? c + f.x1 : f.x1, h = f.relative ? v + f.y1 : f.y1) : (l = NaN, h = NaN), f;
  1822. });
  1823. }
  1824. function r() {
  1825. var s = NaN, u = NaN;
  1826. return i(function(l, h, f) {
  1827. if (l.type & m.SMOOTH_QUAD_TO && (l.type = m.QUAD_TO, s = isNaN(s) ? h : s, u = isNaN(u) ? f : u, l.x1 = l.relative ? h - s : 2 * h - s, l.y1 = l.relative ? f - u : 2 * f - u), l.type & m.QUAD_TO) {
  1828. s = l.relative ? h + l.x1 : l.x1, u = l.relative ? f + l.y1 : l.y1;
  1829. var c = l.x1, v = l.y1;
  1830. l.type = m.CURVE_TO, l.x1 = ((l.relative ? 0 : h) + 2 * c) / 3, l.y1 = ((l.relative ? 0 : f) + 2 * v) / 3, l.x2 = (l.x + 2 * c) / 3, l.y2 = (l.y + 2 * v) / 3;
  1831. } else s = NaN, u = NaN;
  1832. return l;
  1833. });
  1834. }
  1835. function i(s) {
  1836. var u = 0, l = 0, h = NaN, f = NaN;
  1837. return function(c) {
  1838. if (isNaN(h) && !(c.type & m.MOVE_TO)) throw new Error("path must start with moveto");
  1839. var v = s(c, u, l, h, f);
  1840. return c.type & m.CLOSE_PATH && (u = h, l = f), c.x !== void 0 && (u = c.relative ? u + c.x : c.x), c.y !== void 0 && (l = c.relative ? l + c.y : c.y), c.type & m.MOVE_TO && (h = u, f = l), v;
  1841. };
  1842. }
  1843. function n(s, u, l, h, f, c) {
  1844. return ue(s, u, l, h, f, c), i(function(v, g, d, p) {
  1845. var y = v.x1, T = v.x2, b = v.relative && !isNaN(p), x = v.x !== void 0 ? v.x : b ? 0 : g, $ = v.y !== void 0 ? v.y : b ? 0 : d;
  1846. function E(se) {
  1847. return se * se;
  1848. }
  1849. v.type & m.HORIZ_LINE_TO && u !== 0 && (v.type = m.LINE_TO, v.y = v.relative ? 0 : d), v.type & m.VERT_LINE_TO && l !== 0 && (v.type = m.LINE_TO, v.x = v.relative ? 0 : g), v.x !== void 0 && (v.x = v.x * s + $ * l + (b ? 0 : f)), v.y !== void 0 && (v.y = x * u + v.y * h + (b ? 0 : c)), v.x1 !== void 0 && (v.x1 = v.x1 * s + v.y1 * l + (b ? 0 : f)), v.y1 !== void 0 && (v.y1 = y * u + v.y1 * h + (b ? 0 : c)), v.x2 !== void 0 && (v.x2 = v.x2 * s + v.y2 * l + (b ? 0 : f)), v.y2 !== void 0 && (v.y2 = T * u + v.y2 * h + (b ? 0 : c));
  1850. var O = s * h - u * l;
  1851. if (v.xRot !== void 0 && (s !== 1 || u !== 0 || l !== 0 || h !== 1)) if (O === 0) delete v.rX, delete v.rY, delete v.xRot, delete v.lArcFlag, delete v.sweepFlag, v.type = m.LINE_TO;
  1852. else {
  1853. var C = v.xRot * Math.PI / 180, P = Math.sin(C), V = Math.cos(C), j = 1 / E(v.rX), R = 1 / E(v.rY), X = E(V) * j + E(P) * R, W = 2 * P * V * (j - R), G = E(P) * j + E(V) * R, q = X * h * h - W * u * h + G * u * u, H = W * (s * h + u * l) - 2 * (X * l * h + G * s * u), Q = X * l * l - W * s * l + G * s * s, N = (Math.atan2(H, q - Q) + Math.PI) % Math.PI / 2, M = Math.sin(N), K = Math.cos(N);
  1854. v.rX = Math.abs(O) / Math.sqrt(q * E(K) + H * M * K + Q * E(M)), v.rY = Math.abs(O) / Math.sqrt(q * E(M) - H * M * K + Q * E(K)), v.xRot = 180 * N / Math.PI;
  1855. }
  1856. return v.sweepFlag !== void 0 && 0 > O && (v.sweepFlag = +!v.sweepFlag), v;
  1857. });
  1858. }
  1859. function o() {
  1860. return function(s) {
  1861. var u = {};
  1862. for (var l in s) u[l] = s[l];
  1863. return u;
  1864. };
  1865. }
  1866. a.ROUND = function(s) {
  1867. function u(l) {
  1868. return Math.round(l * s) / s;
  1869. }
  1870. return s === void 0 && (s = 1e13), ue(s), function(l) {
  1871. return l.x1 !== void 0 && (l.x1 = u(l.x1)), l.y1 !== void 0 && (l.y1 = u(l.y1)), l.x2 !== void 0 && (l.x2 = u(l.x2)), l.y2 !== void 0 && (l.y2 = u(l.y2)), l.x !== void 0 && (l.x = u(l.x)), l.y !== void 0 && (l.y = u(l.y)), l.rX !== void 0 && (l.rX = u(l.rX)), l.rY !== void 0 && (l.rY = u(l.rY)), l;
  1872. };
  1873. }, a.TO_ABS = e, a.TO_REL = function() {
  1874. return i(function(s, u, l) {
  1875. return s.relative || (s.x1 !== void 0 && (s.x1 -= u), s.y1 !== void 0 && (s.y1 -= l), s.x2 !== void 0 && (s.x2 -= u), s.y2 !== void 0 && (s.y2 -= l), s.x !== void 0 && (s.x -= u), s.y !== void 0 && (s.y -= l), s.relative = !0), s;
  1876. });
  1877. }, a.NORMALIZE_HVZ = function(s, u, l) {
  1878. return s === void 0 && (s = !0), u === void 0 && (u = !0), l === void 0 && (l = !0), i(function(h, f, c, v, g) {
  1879. if (isNaN(v) && !(h.type & m.MOVE_TO)) throw new Error("path must start with moveto");
  1880. return u && h.type & m.HORIZ_LINE_TO && (h.type = m.LINE_TO, h.y = h.relative ? 0 : c), l && h.type & m.VERT_LINE_TO && (h.type = m.LINE_TO, h.x = h.relative ? 0 : f), s && h.type & m.CLOSE_PATH && (h.type = m.LINE_TO, h.x = h.relative ? v - f : v, h.y = h.relative ? g - c : g), h.type & m.ARC && (h.rX === 0 || h.rY === 0) && (h.type = m.LINE_TO, delete h.rX, delete h.rY, delete h.xRot, delete h.lArcFlag, delete h.sweepFlag), h;
  1881. });
  1882. }, a.NORMALIZE_ST = t, a.QT_TO_C = r, a.INFO = i, a.SANITIZE = function(s) {
  1883. s === void 0 && (s = 0), ue(s);
  1884. var u = NaN, l = NaN, h = NaN, f = NaN;
  1885. return i(function(c, v, g, d, p) {
  1886. var y = Math.abs, T = !1, b = 0, x = 0;
  1887. if (c.type & m.SMOOTH_CURVE_TO && (b = isNaN(u) ? 0 : v - u, x = isNaN(l) ? 0 : g - l), c.type & (m.CURVE_TO | m.SMOOTH_CURVE_TO) ? (u = c.relative ? v + c.x2 : c.x2, l = c.relative ? g + c.y2 : c.y2) : (u = NaN, l = NaN), c.type & m.SMOOTH_QUAD_TO ? (h = isNaN(h) ? v : 2 * v - h, f = isNaN(f) ? g : 2 * g - f) : c.type & m.QUAD_TO ? (h = c.relative ? v + c.x1 : c.x1, f = c.relative ? g + c.y1 : c.y2) : (h = NaN, f = NaN), c.type & m.LINE_COMMANDS || c.type & m.ARC && (c.rX === 0 || c.rY === 0 || !c.lArcFlag) || c.type & m.CURVE_TO || c.type & m.SMOOTH_CURVE_TO || c.type & m.QUAD_TO || c.type & m.SMOOTH_QUAD_TO) {
  1888. var $ = c.x === void 0 ? 0 : c.relative ? c.x : c.x - v, E = c.y === void 0 ? 0 : c.relative ? c.y : c.y - g;
  1889. b = isNaN(h) ? c.x1 === void 0 ? b : c.relative ? c.x : c.x1 - v : h - v, x = isNaN(f) ? c.y1 === void 0 ? x : c.relative ? c.y : c.y1 - g : f - g;
  1890. var O = c.x2 === void 0 ? 0 : c.relative ? c.x : c.x2 - v, C = c.y2 === void 0 ? 0 : c.relative ? c.y : c.y2 - g;
  1891. y($) <= s && y(E) <= s && y(b) <= s && y(x) <= s && y(O) <= s && y(C) <= s && (T = !0);
  1892. }
  1893. return c.type & m.CLOSE_PATH && y(v - d) <= s && y(g - p) <= s && (T = !0), T ? [] : c;
  1894. });
  1895. }, a.MATRIX = n, a.ROTATE = function(s, u, l) {
  1896. u === void 0 && (u = 0), l === void 0 && (l = 0), ue(s, u, l);
  1897. var h = Math.sin(s), f = Math.cos(s);
  1898. return n(f, h, -h, f, u - u * f + l * h, l - u * h - l * f);
  1899. }, a.TRANSLATE = function(s, u) {
  1900. return u === void 0 && (u = 0), ue(s, u), n(1, 0, 0, 1, s, u);
  1901. }, a.SCALE = function(s, u) {
  1902. return u === void 0 && (u = s), ue(s, u), n(s, 0, 0, u, 0, 0);
  1903. }, a.SKEW_X = function(s) {
  1904. return ue(s), n(1, 0, Math.atan(s), 1, 0, 0);
  1905. }, a.SKEW_Y = function(s) {
  1906. return ue(s), n(1, Math.atan(s), 0, 1, 0, 0);
  1907. }, a.X_AXIS_SYMMETRY = function(s) {
  1908. return s === void 0 && (s = 0), ue(s), n(-1, 0, 0, 1, s, 0);
  1909. }, a.Y_AXIS_SYMMETRY = function(s) {
  1910. return s === void 0 && (s = 0), ue(s), n(1, 0, 0, -1, 0, s);
  1911. }, a.A_TO_C = function() {
  1912. return i(function(s, u, l) {
  1913. return m.ARC === s.type ? function(h, f, c) {
  1914. var v, g, d, p;
  1915. h.cX || Ha(h, f, c);
  1916. for (var y = Math.min(h.phi1, h.phi2), T = Math.max(h.phi1, h.phi2) - y, b = Math.ceil(T / 90), x = new Array(b), $ = f, E = c, O = 0; O < b; O++) {
  1917. var C = go(h.phi1, h.phi2, O / b), P = go(h.phi1, h.phi2, (O + 1) / b), V = P - C, j = 4 / 3 * Math.tan(V * ye / 4), R = [Math.cos(C * ye) - j * Math.sin(C * ye), Math.sin(C * ye) + j * Math.cos(C * ye)], X = R[0], W = R[1], G = [Math.cos(P * ye), Math.sin(P * ye)], q = G[0], H = G[1], Q = [q + j * Math.sin(P * ye), H - j * Math.cos(P * ye)], N = Q[0], M = Q[1];
  1918. x[O] = { relative: h.relative, type: m.CURVE_TO };
  1919. var K = function(se, ge) {
  1920. var Oe = bi([se * h.rX, ge * h.rY], h.xRot), ze = Oe[0], It = Oe[1];
  1921. return [h.cX + ze, h.cY + It];
  1922. };
  1923. v = K(X, W), x[O].x1 = v[0], x[O].y1 = v[1], g = K(N, M), x[O].x2 = g[0], x[O].y2 = g[1], d = K(q, H), x[O].x = d[0], x[O].y = d[1], h.relative && (x[O].x1 -= $, x[O].y1 -= E, x[O].x2 -= $, x[O].y2 -= E, x[O].x -= $, x[O].y -= E), $ = (p = [x[O].x, x[O].y])[0], E = p[1];
  1924. }
  1925. return x;
  1926. }(s, s.relative ? 0 : u, s.relative ? 0 : l) : s;
  1927. });
  1928. }, a.ANNOTATE_ARCS = function() {
  1929. return i(function(s, u, l) {
  1930. return s.relative && (u = 0, l = 0), m.ARC === s.type && Ha(s, u, l), s;
  1931. });
  1932. }, a.CLONE = o, a.CALCULATE_BOUNDS = function() {
  1933. var s = function(c) {
  1934. var v = {};
  1935. for (var g in c) v[g] = c[g];
  1936. return v;
  1937. }, u = e(), l = r(), h = t(), f = i(function(c, v, g) {
  1938. var d = h(l(u(s(c))));
  1939. function p(M) {
  1940. M > f.maxX && (f.maxX = M), M < f.minX && (f.minX = M);
  1941. }
  1942. function y(M) {
  1943. M > f.maxY && (f.maxY = M), M < f.minY && (f.minY = M);
  1944. }
  1945. if (d.type & m.DRAWING_COMMANDS && (p(v), y(g)), d.type & m.HORIZ_LINE_TO && p(d.x), d.type & m.VERT_LINE_TO && y(d.y), d.type & m.LINE_TO && (p(d.x), y(d.y)), d.type & m.CURVE_TO) {
  1946. p(d.x), y(d.y);
  1947. for (var T = 0, b = yo(v, d.x1, d.x2, d.x); T < b.length; T++)
  1948. 0 < (N = b[T]) && 1 > N && p(mo(v, d.x1, d.x2, d.x, N));
  1949. for (var x = 0, $ = yo(g, d.y1, d.y2, d.y); x < $.length; x++)
  1950. 0 < (N = $[x]) && 1 > N && y(mo(g, d.y1, d.y2, d.y, N));
  1951. }
  1952. if (d.type & m.ARC) {
  1953. p(d.x), y(d.y), Ha(d, v, g);
  1954. for (var E = d.xRot / 180 * Math.PI, O = Math.cos(E) * d.rX, C = Math.sin(E) * d.rX, P = -Math.sin(E) * d.rY, V = Math.cos(E) * d.rY, j = d.phi1 < d.phi2 ? [d.phi1, d.phi2] : -180 > d.phi2 ? [d.phi2 + 360, d.phi1 + 360] : [d.phi2, d.phi1], R = j[0], X = j[1], W = function(M) {
  1955. var K = M[0], se = M[1], ge = 180 * Math.atan2(se, K) / Math.PI;
  1956. return ge < R ? ge + 360 : ge;
  1957. }, G = 0, q = co(P, -O, 0).map(W); G < q.length; G++)
  1958. (N = q[G]) > R && N < X && p(po(d.cX, O, P, N));
  1959. for (var H = 0, Q = co(V, -C, 0).map(W); H < Q.length; H++) {
  1960. var N;
  1961. (N = Q[H]) > R && N < X && y(po(d.cY, C, V, N));
  1962. }
  1963. }
  1964. return c;
  1965. });
  1966. return f.minX = 1 / 0, f.maxX = -1 / 0, f.minY = 1 / 0, f.maxY = -1 / 0, f;
  1967. };
  1968. })(U || (U = {}));
  1969. var oe, gl = function() {
  1970. function a() {
  1971. }
  1972. return a.prototype.round = function(e) {
  1973. return this.transform(U.ROUND(e));
  1974. }, a.prototype.toAbs = function() {
  1975. return this.transform(U.TO_ABS());
  1976. }, a.prototype.toRel = function() {
  1977. return this.transform(U.TO_REL());
  1978. }, a.prototype.normalizeHVZ = function(e, t, r) {
  1979. return this.transform(U.NORMALIZE_HVZ(e, t, r));
  1980. }, a.prototype.normalizeST = function() {
  1981. return this.transform(U.NORMALIZE_ST());
  1982. }, a.prototype.qtToC = function() {
  1983. return this.transform(U.QT_TO_C());
  1984. }, a.prototype.aToC = function() {
  1985. return this.transform(U.A_TO_C());
  1986. }, a.prototype.sanitize = function(e) {
  1987. return this.transform(U.SANITIZE(e));
  1988. }, a.prototype.translate = function(e, t) {
  1989. return this.transform(U.TRANSLATE(e, t));
  1990. }, a.prototype.scale = function(e, t) {
  1991. return this.transform(U.SCALE(e, t));
  1992. }, a.prototype.rotate = function(e, t, r) {
  1993. return this.transform(U.ROTATE(e, t, r));
  1994. }, a.prototype.matrix = function(e, t, r, i, n, o) {
  1995. return this.transform(U.MATRIX(e, t, r, i, n, o));
  1996. }, a.prototype.skewX = function(e) {
  1997. return this.transform(U.SKEW_X(e));
  1998. }, a.prototype.skewY = function(e) {
  1999. return this.transform(U.SKEW_Y(e));
  2000. }, a.prototype.xSymmetry = function(e) {
  2001. return this.transform(U.X_AXIS_SYMMETRY(e));
  2002. }, a.prototype.ySymmetry = function(e) {
  2003. return this.transform(U.Y_AXIS_SYMMETRY(e));
  2004. }, a.prototype.annotateArcs = function() {
  2005. return this.transform(U.ANNOTATE_ARCS());
  2006. }, a;
  2007. }(), Ub = function(a) {
  2008. return a === " " || a === " " || a === "\r" || a === `
  2009. `;
  2010. }, bo = function(a) {
  2011. return 48 <= a.charCodeAt(0) && a.charCodeAt(0) <= 57;
  2012. }, Gb = function(a) {
  2013. function e() {
  2014. var t = a.call(this) || this;
  2015. return t.curNumber = "", t.curCommandType = -1, t.curCommandRelative = !1, t.canParseCommandOrComma = !0, t.curNumberHasExp = !1, t.curNumberHasExpDigits = !1, t.curNumberHasDecimal = !1, t.curArgs = [], t;
  2016. }
  2017. return cl(e, a), e.prototype.finish = function(t) {
  2018. if (t === void 0 && (t = []), this.parse(" ", t), this.curArgs.length !== 0 || !this.canParseCommandOrComma) throw new SyntaxError("Unterminated command at the path end.");
  2019. return t;
  2020. }, e.prototype.parse = function(t, r) {
  2021. var i = this;
  2022. r === void 0 && (r = []);
  2023. for (var n = function(f) {
  2024. r.push(f), i.curArgs.length = 0, i.canParseCommandOrComma = !0;
  2025. }, o = 0; o < t.length; o++) {
  2026. var s = t[o], u = !(this.curCommandType !== m.ARC || this.curArgs.length !== 3 && this.curArgs.length !== 4 || this.curNumber.length !== 1 || this.curNumber !== "0" && this.curNumber !== "1"), l = bo(s) && (this.curNumber === "0" && s === "0" || u);
  2027. if (!bo(s) || l) if (s !== "e" && s !== "E") if (s !== "-" && s !== "+" || !this.curNumberHasExp || this.curNumberHasExpDigits) if (s !== "." || this.curNumberHasExp || this.curNumberHasDecimal || u) {
  2028. if (this.curNumber && this.curCommandType !== -1) {
  2029. var h = Number(this.curNumber);
  2030. if (isNaN(h)) throw new SyntaxError("Invalid number ending at " + o);
  2031. if (this.curCommandType === m.ARC) {
  2032. if (this.curArgs.length === 0 || this.curArgs.length === 1) {
  2033. if (0 > h) throw new SyntaxError('Expected positive number, got "' + h + '" at index "' + o + '"');
  2034. } 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 + '"');
  2035. }
  2036. this.curArgs.push(h), this.curArgs.length === zb[this.curCommandType] && (m.HORIZ_LINE_TO === this.curCommandType ? n({ type: m.HORIZ_LINE_TO, relative: this.curCommandRelative, x: h }) : m.VERT_LINE_TO === this.curCommandType ? n({ type: m.VERT_LINE_TO, relative: this.curCommandRelative, y: h }) : this.curCommandType === m.MOVE_TO || this.curCommandType === m.LINE_TO || this.curCommandType === m.SMOOTH_QUAD_TO ? (n({ type: this.curCommandType, relative: this.curCommandRelative, x: this.curArgs[0], y: this.curArgs[1] }), m.MOVE_TO === this.curCommandType && (this.curCommandType = m.LINE_TO)) : this.curCommandType === m.CURVE_TO ? n({ type: m.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 === m.SMOOTH_CURVE_TO ? n({ type: m.SMOOTH_CURVE_TO, relative: this.curCommandRelative, x2: this.curArgs[0], y2: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === m.QUAD_TO ? n({ type: m.QUAD_TO, relative: this.curCommandRelative, x1: this.curArgs[0], y1: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === m.ARC && n({ type: m.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;
  2037. }
  2038. if (!Ub(s)) if (s === "," && this.canParseCommandOrComma) this.canParseCommandOrComma = !1;
  2039. else if (s !== "+" && s !== "-" && s !== ".") if (l) this.curNumber = s, this.curNumberHasDecimal = !1;
  2040. else {
  2041. if (this.curArgs.length !== 0) throw new SyntaxError("Unterminated command at index " + o + ".");
  2042. if (!this.canParseCommandOrComma) throw new SyntaxError('Unexpected character "' + s + '" at index ' + o + ". Command cannot follow comma");
  2043. if (this.canParseCommandOrComma = !1, s !== "z" && s !== "Z") if (s === "h" || s === "H") this.curCommandType = m.HORIZ_LINE_TO, this.curCommandRelative = s === "h";
  2044. else if (s === "v" || s === "V") this.curCommandType = m.VERT_LINE_TO, this.curCommandRelative = s === "v";
  2045. else if (s === "m" || s === "M") this.curCommandType = m.MOVE_TO, this.curCommandRelative = s === "m";
  2046. else if (s === "l" || s === "L") this.curCommandType = m.LINE_TO, this.curCommandRelative = s === "l";
  2047. else if (s === "c" || s === "C") this.curCommandType = m.CURVE_TO, this.curCommandRelative = s === "c";
  2048. else if (s === "s" || s === "S") this.curCommandType = m.SMOOTH_CURVE_TO, this.curCommandRelative = s === "s";
  2049. else if (s === "q" || s === "Q") this.curCommandType = m.QUAD_TO, this.curCommandRelative = s === "q";
  2050. else if (s === "t" || s === "T") this.curCommandType = m.SMOOTH_QUAD_TO, this.curCommandRelative = s === "t";
  2051. else {
  2052. if (s !== "a" && s !== "A") throw new SyntaxError('Unexpected character "' + s + '" at index ' + o + ".");
  2053. this.curCommandType = m.ARC, this.curCommandRelative = s === "a";
  2054. }
  2055. else r.push({ type: m.CLOSE_PATH }), this.canParseCommandOrComma = !0, this.curCommandType = -1;
  2056. }
  2057. else this.curNumber = s, this.curNumberHasDecimal = s === ".";
  2058. } else this.curNumber += s, this.curNumberHasDecimal = !0;
  2059. else this.curNumber += s;
  2060. else this.curNumber += s, this.curNumberHasExp = !0;
  2061. else this.curNumber += s, this.curNumberHasExpDigits = this.curNumberHasExp;
  2062. }
  2063. return r;
  2064. }, e.prototype.transform = function(t) {
  2065. return Object.create(this, { parse: { value: function(r, i) {
  2066. i === void 0 && (i = []);
  2067. for (var n = 0, o = Object.getPrototypeOf(this).parse.call(this, r); n < o.length; n++) {
  2068. var s = o[n], u = t(s);
  2069. Array.isArray(u) ? i.push.apply(i, u) : i.push(u);
  2070. }
  2071. return i;
  2072. } } });
  2073. }, e;
  2074. }(gl), m = function(a) {
  2075. function e(t) {
  2076. var r = a.call(this) || this;
  2077. return r.commands = typeof t == "string" ? e.parse(t) : t, r;
  2078. }
  2079. return cl(e, a), e.prototype.encode = function() {
  2080. return e.encode(this.commands);
  2081. }, e.prototype.getBounds = function() {
  2082. var t = U.CALCULATE_BOUNDS();
  2083. return this.transform(t), t;
  2084. }, e.prototype.transform = function(t) {
  2085. for (var r = [], i = 0, n = this.commands; i < n.length; i++) {
  2086. var o = t(n[i]);
  2087. Array.isArray(o) ? r.push.apply(r, o) : r.push(o);
  2088. }
  2089. return this.commands = r, this;
  2090. }, e.encode = function(t) {
  2091. return Fb(t);
  2092. }, e.parse = function(t) {
  2093. var r = new Gb(), i = [];
  2094. return r.parse(t, i), r.finish(i), i;
  2095. }, e.CLOSE_PATH = 1, e.MOVE_TO = 2, e.HORIZ_LINE_TO = 4, e.VERT_LINE_TO = 8, e.LINE_TO = 16, e.CURVE_TO = 32, e.SMOOTH_CURVE_TO = 64, e.QUAD_TO = 128, e.SMOOTH_QUAD_TO = 256, e.ARC = 512, e.LINE_COMMANDS = e.LINE_TO | e.HORIZ_LINE_TO | e.VERT_LINE_TO, e.DRAWING_COMMANDS = e.HORIZ_LINE_TO | e.VERT_LINE_TO | e.LINE_TO | e.CURVE_TO | e.SMOOTH_CURVE_TO | e.QUAD_TO | e.SMOOTH_QUAD_TO | e.ARC, e;
  2096. }(gl), zb = ((oe = {})[m.MOVE_TO] = 2, oe[m.LINE_TO] = 2, oe[m.HORIZ_LINE_TO] = 1, oe[m.VERT_LINE_TO] = 1, oe[m.CLOSE_PATH] = 0, oe[m.QUAD_TO] = 4, oe[m.SMOOTH_QUAD_TO] = 2, oe[m.CURVE_TO] = 6, oe[m.SMOOTH_CURVE_TO] = 4, oe[m.ARC] = 7, oe), Hb = $r.PROPER, Yb = Ue, Xb = J, xo = pe, Wb = D, qb = Vr, rn = "toString", dl = RegExp.prototype, pl = dl[rn], Qb = Wb(function() {
  2097. return pl.call({ source: "a", flags: "b" }) !== "/a/b";
  2098. }), Kb = Hb && pl.name !== rn;
  2099. (Qb || Kb) && Yb(dl, rn, function() {
  2100. var e = Xb(this), t = xo(e.source), r = xo(qb(e));
  2101. return "/" + t + "/" + r;
  2102. }, { unsafe: !0 });
  2103. function fr(a) {
  2104. "@babel/helpers - typeof";
  2105. return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? fr = function(e) {
  2106. return typeof e;
  2107. } : fr = function(e) {
  2108. return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  2109. }, fr(a);
  2110. }
  2111. function Zb(a, e) {
  2112. if (!(a instanceof e))
  2113. throw new TypeError("Cannot call a class as a function");
  2114. }
  2115. var Jb = [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], e1 = [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];
  2116. function t1(a, e, t, r, i) {
  2117. if (typeof a == "string" && (a = document.getElementById(a)), !a || fr(a) !== "object" || !("getContext" in a))
  2118. throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");
  2119. var n = a.getContext("2d");
  2120. try {
  2121. return n.getImageData(e, t, r, i);
  2122. } catch (o) {
  2123. throw new Error("unable to access image data: " + o);
  2124. }
  2125. }
  2126. function r1(a, e, t, r, i, n) {
  2127. if (!(isNaN(n) || n < 1)) {
  2128. n |= 0;
  2129. var o = t1(a, e, t, r, i);
  2130. o = a1(o, e, t, r, i, n), a.getContext("2d").putImageData(o, e, t);
  2131. }
  2132. }
  2133. function a1(a, e, t, r, i, n) {
  2134. for (var o = a.data, s = 2 * n + 1, u = r - 1, l = i - 1, h = n + 1, f = h * (h + 1) / 2, c = new To(), v = c, g, d = 1; d < s; d++)
  2135. v = v.next = new To(), d === h && (g = v);
  2136. v.next = c;
  2137. for (var p = null, y = null, T = 0, b = 0, x = Jb[n], $ = e1[n], E = 0; E < i; E++) {
  2138. v = c;
  2139. for (var O = o[b], C = o[b + 1], P = o[b + 2], V = o[b + 3], j = 0; j < h; j++)
  2140. v.r = O, v.g = C, v.b = P, v.a = V, v = v.next;
  2141. for (var R = 0, X = 0, W = 0, G = 0, q = h * O, H = h * C, Q = h * P, N = h * V, M = f * O, K = f * C, se = f * P, ge = f * V, Oe = 1; Oe < h; Oe++) {
  2142. var ze = b + ((u < Oe ? u : Oe) << 2), It = o[ze], sn = o[ze + 1], on = o[ze + 2], un = o[ze + 3], Mt = h - Oe;
  2143. M += (v.r = It) * Mt, K += (v.g = sn) * Mt, se += (v.b = on) * Mt, ge += (v.a = un) * Mt, R += It, X += sn, W += on, G += un, v = v.next;
  2144. }
  2145. p = c, y = g;
  2146. for (var Ur = 0; Ur < r; Ur++) {
  2147. var Gr = ge * x >>> $;
  2148. if (o[b + 3] = Gr, Gr !== 0) {
  2149. var zr = 255 / Gr;
  2150. o[b] = (M * x >>> $) * zr, o[b + 1] = (K * x >>> $) * zr, o[b + 2] = (se * x >>> $) * zr;
  2151. } else
  2152. o[b] = o[b + 1] = o[b + 2] = 0;
  2153. M -= q, K -= H, se -= Q, ge -= N, q -= p.r, H -= p.g, Q -= p.b, N -= p.a;
  2154. var Pe = Ur + n + 1;
  2155. Pe = T + (Pe < u ? Pe : u) << 2, R += p.r = o[Pe], X += p.g = o[Pe + 1], W += p.b = o[Pe + 2], G += p.a = o[Pe + 3], M += R, K += X, se += W, ge += G, p = p.next;
  2156. var _t = y, ln = _t.r, hn = _t.g, vn = _t.b, fn = _t.a;
  2157. q += ln, H += hn, Q += vn, N += fn, R -= ln, X -= hn, W -= vn, G -= fn, y = y.next, b += 4;
  2158. }
  2159. T += r;
  2160. }
  2161. for (var He = 0; He < r; He++) {
  2162. b = He << 2;
  2163. var Re = o[b], Ne = o[b + 1], Ie = o[b + 2], te = o[b + 3], Hr = h * Re, Yr = h * Ne, Xr = h * Ie, Wr = h * te, Vt = f * Re, Dt = f * Ne, Lt = f * Ie, kt = f * te;
  2164. v = c;
  2165. for (var cn = 0; cn < h; cn++)
  2166. v.r = Re, v.g = Ne, v.b = Ie, v.a = te, v = v.next;
  2167. for (var gn = r, qr = 0, Qr = 0, Kr = 0, Zr = 0, Bt = 1; Bt <= n; Bt++) {
  2168. b = gn + He << 2;
  2169. var jt = h - Bt;
  2170. Vt += (v.r = Re = o[b]) * jt, Dt += (v.g = Ne = o[b + 1]) * jt, Lt += (v.b = Ie = o[b + 2]) * jt, kt += (v.a = te = o[b + 3]) * jt, Zr += Re, qr += Ne, Qr += Ie, Kr += te, v = v.next, Bt < l && (gn += r);
  2171. }
  2172. b = He, p = c, y = g;
  2173. for (var Jr = 0; Jr < i; Jr++) {
  2174. var re = b << 2;
  2175. o[re + 3] = te = kt * x >>> $, te > 0 ? (te = 255 / te, o[re] = (Vt * x >>> $) * te, o[re + 1] = (Dt * x >>> $) * te, o[re + 2] = (Lt * x >>> $) * te) : o[re] = o[re + 1] = o[re + 2] = 0, Vt -= Hr, Dt -= Yr, Lt -= Xr, kt -= Wr, Hr -= p.r, Yr -= p.g, Xr -= p.b, Wr -= p.a, re = He + ((re = Jr + h) < l ? re : l) * r << 2, Vt += Zr += p.r = o[re], Dt += qr += p.g = o[re + 1], Lt += Qr += p.b = o[re + 2], kt += Kr += p.a = o[re + 3], p = p.next, Hr += Re = y.r, Yr += Ne = y.g, Xr += Ie = y.b, Wr += te = y.a, Zr -= Re, qr -= Ne, Qr -= Ie, Kr -= te, y = y.next, b += r;
  2176. }
  2177. }
  2178. return a;
  2179. }
  2180. var To = (
  2181. /**
  2182. * Set properties.
  2183. */
  2184. function a() {
  2185. Zb(this, a), this.r = 0, this.g = 0, this.b = 0, this.a = 0, this.next = null;
  2186. }
  2187. );
  2188. function i1() {
  2189. var {
  2190. DOMParser: a
  2191. } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
  2192. window: null,
  2193. ignoreAnimation: !0,
  2194. ignoreMouse: !0,
  2195. DOMParser: a,
  2196. createCanvas(t, r) {
  2197. return new OffscreenCanvas(t, r);
  2198. },
  2199. createImage(t) {
  2200. return xe(function* () {
  2201. var r = yield fetch(t), i = yield r.blob(), n = yield createImageBitmap(i);
  2202. return n;
  2203. })();
  2204. }
  2205. };
  2206. return (typeof DOMParser != "undefined" || typeof a == "undefined") && Reflect.deleteProperty(e, "DOMParser"), e;
  2207. }
  2208. function n1(a) {
  2209. var {
  2210. DOMParser: e,
  2211. canvas: t,
  2212. fetch: r
  2213. } = a;
  2214. return {
  2215. window: null,
  2216. ignoreAnimation: !0,
  2217. ignoreMouse: !0,
  2218. DOMParser: e,
  2219. fetch: r,
  2220. createCanvas: t.createCanvas,
  2221. createImage: t.loadImage
  2222. };
  2223. }
  2224. var y2 = /* @__PURE__ */ Object.freeze({
  2225. __proto__: null,
  2226. offscreen: i1,
  2227. node: n1
  2228. });
  2229. function ht(a) {
  2230. return a.replace(/(?!\u3000)\s+/gm, " ");
  2231. }
  2232. function s1(a) {
  2233. return a.replace(/^[\n \t]+/, "");
  2234. }
  2235. function o1(a) {
  2236. return a.replace(/[\n \t]+$/, "");
  2237. }
  2238. function ne(a) {
  2239. var e = (a || "").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || [];
  2240. return e.map(parseFloat);
  2241. }
  2242. var u1 = /^[A-Z-]+$/;
  2243. function l1(a) {
  2244. return u1.test(a) ? a.toLowerCase() : a;
  2245. }
  2246. function yl(a) {
  2247. var e = /url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(a) || [];
  2248. return e[2] || e[3] || e[4];
  2249. }
  2250. function h1(a) {
  2251. if (!a.startsWith("rgb"))
  2252. return a;
  2253. var e = 3, t = a.replace(/\d+(\.\d+)?/g, (r, i) => e-- && i ? String(Math.round(parseFloat(r))) : r);
  2254. return t;
  2255. }
  2256. var v1 = /(\[[^\]]+\])/g, f1 = /(#[^\s+>~.[:]+)/g, c1 = /(\.[^\s+>~.[:]+)/g, g1 = /(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi, d1 = /(:[\w-]+\([^)]*\))/gi, p1 = /(:[^\s+>~.[:]+)/g, y1 = /([^\s+>~.[:]+)/g;
  2257. function De(a, e) {
  2258. var t = e.exec(a);
  2259. return t ? [a.replace(e, " "), t.length] : [a, 0];
  2260. }
  2261. function m1(a) {
  2262. var e = [0, 0, 0], t = a.replace(/:not\(([^)]*)\)/g, " $1 ").replace(/{[\s\S]*/gm, " "), r = 0;
  2263. return [t, r] = De(t, v1), e[1] += r, [t, r] = De(t, f1), e[0] += r, [t, r] = De(t, c1), e[1] += r, [t, r] = De(t, g1), e[2] += r, [t, r] = De(t, d1), e[1] += r, [t, r] = De(t, p1), e[1] += r, t = t.replace(/[*\s+>~]/g, " ").replace(/[#.]/g, " "), [t, r] = De(t, y1), e[2] += r, e.join("");
  2264. }
  2265. var at = 1e-8;
  2266. function Oo(a) {
  2267. return Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2));
  2268. }
  2269. function xi(a, e) {
  2270. return (a[0] * e[0] + a[1] * e[1]) / (Oo(a) * Oo(e));
  2271. }
  2272. function So(a, e) {
  2273. return (a[0] * e[1] < a[1] * e[0] ? -1 : 1) * Math.acos(xi(a, e));
  2274. }
  2275. function Eo(a) {
  2276. return a * a * a;
  2277. }
  2278. function $o(a) {
  2279. return 3 * a * a * (1 - a);
  2280. }
  2281. function wo(a) {
  2282. return 3 * a * (1 - a) * (1 - a);
  2283. }
  2284. function Co(a) {
  2285. return (1 - a) * (1 - a) * (1 - a);
  2286. }
  2287. function Ao(a) {
  2288. return a * a;
  2289. }
  2290. function Po(a) {
  2291. return 2 * a * (1 - a);
  2292. }
  2293. function Ro(a) {
  2294. return (1 - a) * (1 - a);
  2295. }
  2296. class S {
  2297. constructor(e, t, r) {
  2298. this.document = e, this.name = t, this.value = r, this.isNormalizedColor = !1;
  2299. }
  2300. static empty(e) {
  2301. return new S(e, "EMPTY", "");
  2302. }
  2303. split() {
  2304. var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : " ", {
  2305. document: t,
  2306. name: r
  2307. } = this;
  2308. return ht(this.getString()).trim().split(e).map((i) => new S(t, r, i));
  2309. }
  2310. hasValue(e) {
  2311. var {
  2312. value: t
  2313. } = this;
  2314. return t !== null && t !== "" && (e || t !== 0) && typeof t != "undefined";
  2315. }
  2316. isString(e) {
  2317. var {
  2318. value: t
  2319. } = this, r = typeof t == "string";
  2320. return !r || !e ? r : e.test(t);
  2321. }
  2322. isUrlDefinition() {
  2323. return this.isString(/^url\(/);
  2324. }
  2325. isPixels() {
  2326. if (!this.hasValue())
  2327. return !1;
  2328. var e = this.getString();
  2329. switch (!0) {
  2330. case e.endsWith("px"):
  2331. case /^[0-9]+$/.test(e):
  2332. return !0;
  2333. default:
  2334. return !1;
  2335. }
  2336. }
  2337. setValue(e) {
  2338. return this.value = e, this;
  2339. }
  2340. getValue(e) {
  2341. return typeof e == "undefined" || this.hasValue() ? this.value : e;
  2342. }
  2343. getNumber(e) {
  2344. if (!this.hasValue())
  2345. return typeof e == "undefined" ? 0 : parseFloat(e);
  2346. var {
  2347. value: t
  2348. } = this, r = parseFloat(t);
  2349. return this.isString(/%$/) && (r /= 100), r;
  2350. }
  2351. getString(e) {
  2352. return typeof e == "undefined" || this.hasValue() ? typeof this.value == "undefined" ? "" : String(this.value) : String(e);
  2353. }
  2354. getColor(e) {
  2355. var t = this.getString(e);
  2356. return this.isNormalizedColor || (this.isNormalizedColor = !0, t = h1(t), this.value = t), t;
  2357. }
  2358. getDpi() {
  2359. return 96;
  2360. }
  2361. getRem() {
  2362. return this.document.rootEmSize;
  2363. }
  2364. getEm() {
  2365. return this.document.emSize;
  2366. }
  2367. getUnits() {
  2368. return this.getString().replace(/[0-9.-]/g, "");
  2369. }
  2370. getPixels(e) {
  2371. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  2372. if (!this.hasValue())
  2373. return 0;
  2374. var [r, i] = typeof e == "boolean" ? [void 0, e] : [e], {
  2375. viewPort: n
  2376. } = this.document.screen;
  2377. switch (!0) {
  2378. case this.isString(/vmin$/):
  2379. return this.getNumber() / 100 * Math.min(n.computeSize("x"), n.computeSize("y"));
  2380. case this.isString(/vmax$/):
  2381. return this.getNumber() / 100 * Math.max(n.computeSize("x"), n.computeSize("y"));
  2382. case this.isString(/vw$/):
  2383. return this.getNumber() / 100 * n.computeSize("x");
  2384. case this.isString(/vh$/):
  2385. return this.getNumber() / 100 * n.computeSize("y");
  2386. case this.isString(/rem$/):
  2387. return this.getNumber() * this.getRem();
  2388. case this.isString(/em$/):
  2389. return this.getNumber() * this.getEm();
  2390. case this.isString(/ex$/):
  2391. return this.getNumber() * this.getEm() / 2;
  2392. case this.isString(/px$/):
  2393. return this.getNumber();
  2394. case this.isString(/pt$/):
  2395. return this.getNumber() * this.getDpi() * (1 / 72);
  2396. case this.isString(/pc$/):
  2397. return this.getNumber() * 15;
  2398. case this.isString(/cm$/):
  2399. return this.getNumber() * this.getDpi() / 2.54;
  2400. case this.isString(/mm$/):
  2401. return this.getNumber() * this.getDpi() / 25.4;
  2402. case this.isString(/in$/):
  2403. return this.getNumber() * this.getDpi();
  2404. case (this.isString(/%$/) && i):
  2405. return this.getNumber() * this.getEm();
  2406. case this.isString(/%$/):
  2407. return this.getNumber() * n.computeSize(r);
  2408. default: {
  2409. var o = this.getNumber();
  2410. return t && o < 1 ? o * n.computeSize(r) : o;
  2411. }
  2412. }
  2413. }
  2414. getMilliseconds() {
  2415. return this.hasValue() ? this.isString(/ms$/) ? this.getNumber() : this.getNumber() * 1e3 : 0;
  2416. }
  2417. getRadians() {
  2418. if (!this.hasValue())
  2419. return 0;
  2420. switch (!0) {
  2421. case this.isString(/deg$/):
  2422. return this.getNumber() * (Math.PI / 180);
  2423. case this.isString(/grad$/):
  2424. return this.getNumber() * (Math.PI / 200);
  2425. case this.isString(/rad$/):
  2426. return this.getNumber();
  2427. default:
  2428. return this.getNumber() * (Math.PI / 180);
  2429. }
  2430. }
  2431. getDefinition() {
  2432. var e = this.getString(), t = /#([^)'"]+)/.exec(e);
  2433. return t && (t = t[1]), t || (t = e), this.document.definitions[t];
  2434. }
  2435. getFillStyleDefinition(e, t) {
  2436. var r = this.getDefinition();
  2437. if (!r)
  2438. return null;
  2439. if (typeof r.createGradient == "function")
  2440. return r.createGradient(this.document.ctx, e, t);
  2441. if (typeof r.createPattern == "function") {
  2442. if (r.getHrefAttribute().hasValue()) {
  2443. var i = r.getAttribute("patternTransform");
  2444. r = r.getHrefAttribute().getDefinition(), i.hasValue() && r.getAttribute("patternTransform", !0).setValue(i.value);
  2445. }
  2446. return r.createPattern(this.document.ctx, e, t);
  2447. }
  2448. return null;
  2449. }
  2450. getTextBaseline() {
  2451. return this.hasValue() ? S.textBaselineMapping[this.getString()] : null;
  2452. }
  2453. addOpacity(e) {
  2454. for (var t = this.getColor(), r = t.length, i = 0, n = 0; n < r && (t[n] === "," && i++, i !== 3); n++)
  2455. ;
  2456. if (e.hasValue() && this.isString() && i !== 3) {
  2457. var o = new yi(t);
  2458. o.ok && (o.alpha = e.getNumber(), t = o.toRGBA());
  2459. }
  2460. return new S(this.document, this.name, t);
  2461. }
  2462. }
  2463. S.textBaselineMapping = {
  2464. baseline: "alphabetic",
  2465. "before-edge": "top",
  2466. "text-before-edge": "top",
  2467. middle: "middle",
  2468. central: "middle",
  2469. "after-edge": "bottom",
  2470. "text-after-edge": "bottom",
  2471. ideographic: "ideographic",
  2472. alphabetic: "alphabetic",
  2473. hanging: "hanging",
  2474. mathematical: "alphabetic"
  2475. };
  2476. class b1 {
  2477. constructor() {
  2478. this.viewPorts = [];
  2479. }
  2480. clear() {
  2481. this.viewPorts = [];
  2482. }
  2483. setCurrent(e, t) {
  2484. this.viewPorts.push({
  2485. width: e,
  2486. height: t
  2487. });
  2488. }
  2489. removeCurrent() {
  2490. this.viewPorts.pop();
  2491. }
  2492. getCurrent() {
  2493. var {
  2494. viewPorts: e
  2495. } = this;
  2496. return e[e.length - 1];
  2497. }
  2498. get width() {
  2499. return this.getCurrent().width;
  2500. }
  2501. get height() {
  2502. return this.getCurrent().height;
  2503. }
  2504. computeSize(e) {
  2505. return typeof e == "number" ? e : e === "x" ? this.width : e === "y" ? this.height : Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2);
  2506. }
  2507. }
  2508. class B {
  2509. constructor(e, t) {
  2510. this.x = e, this.y = t;
  2511. }
  2512. static parse(e) {
  2513. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, [r = t, i = t] = ne(e);
  2514. return new B(r, i);
  2515. }
  2516. static parseScale(e) {
  2517. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, [r = t, i = r] = ne(e);
  2518. return new B(r, i);
  2519. }
  2520. static parsePath(e) {
  2521. for (var t = ne(e), r = t.length, i = [], n = 0; n < r; n += 2)
  2522. i.push(new B(t[n], t[n + 1]));
  2523. return i;
  2524. }
  2525. angleTo(e) {
  2526. return Math.atan2(e.y - this.y, e.x - this.x);
  2527. }
  2528. applyTransform(e) {
  2529. var {
  2530. x: t,
  2531. y: r
  2532. } = this, i = t * e[0] + r * e[2] + e[4], n = t * e[1] + r * e[3] + e[5];
  2533. this.x = i, this.y = n;
  2534. }
  2535. }
  2536. class x1 {
  2537. constructor(e) {
  2538. this.screen = e, this.working = !1, this.events = [], this.eventElements = [], this.onClick = this.onClick.bind(this), this.onMouseMove = this.onMouseMove.bind(this);
  2539. }
  2540. isWorking() {
  2541. return this.working;
  2542. }
  2543. start() {
  2544. if (!this.working) {
  2545. var {
  2546. screen: e,
  2547. onClick: t,
  2548. onMouseMove: r
  2549. } = this, i = e.ctx.canvas;
  2550. i.onclick = t, i.onmousemove = r, this.working = !0;
  2551. }
  2552. }
  2553. stop() {
  2554. if (this.working) {
  2555. var e = this.screen.ctx.canvas;
  2556. this.working = !1, e.onclick = null, e.onmousemove = null;
  2557. }
  2558. }
  2559. hasEvents() {
  2560. return this.working && this.events.length > 0;
  2561. }
  2562. runEvents() {
  2563. if (this.working) {
  2564. var {
  2565. screen: e,
  2566. events: t,
  2567. eventElements: r
  2568. } = this, {
  2569. style: i
  2570. } = e.ctx.canvas;
  2571. i && (i.cursor = ""), t.forEach((n, o) => {
  2572. for (var {
  2573. run: s
  2574. } = n, u = r[o]; u; )
  2575. s(u), u = u.parent;
  2576. }), this.events = [], this.eventElements = [];
  2577. }
  2578. }
  2579. checkPath(e, t) {
  2580. if (!(!this.working || !t)) {
  2581. var {
  2582. events: r,
  2583. eventElements: i
  2584. } = this;
  2585. r.forEach((n, o) => {
  2586. var {
  2587. x: s,
  2588. y: u
  2589. } = n;
  2590. !i[o] && t.isPointInPath && t.isPointInPath(s, u) && (i[o] = e);
  2591. });
  2592. }
  2593. }
  2594. checkBoundingBox(e, t) {
  2595. if (!(!this.working || !t)) {
  2596. var {
  2597. events: r,
  2598. eventElements: i
  2599. } = this;
  2600. r.forEach((n, o) => {
  2601. var {
  2602. x: s,
  2603. y: u
  2604. } = n;
  2605. !i[o] && t.isPointInBox(s, u) && (i[o] = e);
  2606. });
  2607. }
  2608. }
  2609. mapXY(e, t) {
  2610. for (var {
  2611. window: r,
  2612. ctx: i
  2613. } = this.screen, n = new B(e, t), o = i.canvas; o; )
  2614. n.x -= o.offsetLeft, n.y -= o.offsetTop, o = o.offsetParent;
  2615. return r.scrollX && (n.x += r.scrollX), r.scrollY && (n.y += r.scrollY), n;
  2616. }
  2617. onClick(e) {
  2618. var {
  2619. x: t,
  2620. y: r
  2621. } = this.mapXY(e.clientX, e.clientY);
  2622. this.events.push({
  2623. type: "onclick",
  2624. x: t,
  2625. y: r,
  2626. run(i) {
  2627. i.onClick && i.onClick();
  2628. }
  2629. });
  2630. }
  2631. onMouseMove(e) {
  2632. var {
  2633. x: t,
  2634. y: r
  2635. } = this.mapXY(e.clientX, e.clientY);
  2636. this.events.push({
  2637. type: "onmousemove",
  2638. x: t,
  2639. y: r,
  2640. run(i) {
  2641. i.onMouseMove && i.onMouseMove();
  2642. }
  2643. });
  2644. }
  2645. }
  2646. var ml = typeof window != "undefined" ? window : null, bl = typeof fetch != "undefined" ? fetch.bind(void 0) : null;
  2647. class kr {
  2648. constructor(e) {
  2649. var {
  2650. fetch: t = bl,
  2651. window: r = ml
  2652. } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  2653. this.ctx = e, this.FRAMERATE = 30, this.MAX_VIRTUAL_PIXELS = 3e4, this.CLIENT_WIDTH = 800, this.CLIENT_HEIGHT = 600, this.viewPort = new b1(), this.mouse = new x1(this), this.animations = [], this.waits = [], this.frameDuration = 0, this.isReadyLock = !1, this.isFirstRender = !0, this.intervalId = null, this.window = r, this.fetch = t;
  2654. }
  2655. wait(e) {
  2656. this.waits.push(e);
  2657. }
  2658. ready() {
  2659. return this.readyPromise ? this.readyPromise : Promise.resolve();
  2660. }
  2661. isReady() {
  2662. if (this.isReadyLock)
  2663. return !0;
  2664. var e = this.waits.every((t) => t());
  2665. return e && (this.waits = [], this.resolveReady && this.resolveReady()), this.isReadyLock = e, e;
  2666. }
  2667. setDefaults(e) {
  2668. e.strokeStyle = "rgba(0,0,0,0)", e.lineCap = "butt", e.lineJoin = "miter", e.miterLimit = 4;
  2669. }
  2670. setViewBox(e) {
  2671. var {
  2672. document: t,
  2673. ctx: r,
  2674. aspectRatio: i,
  2675. width: n,
  2676. desiredWidth: o,
  2677. height: s,
  2678. desiredHeight: u,
  2679. minX: l = 0,
  2680. minY: h = 0,
  2681. refX: f,
  2682. refY: c,
  2683. clip: v = !1,
  2684. clipX: g = 0,
  2685. clipY: d = 0
  2686. } = e, p = ht(i).replace(/^defer\s/, ""), [y, T] = p.split(" "), b = y || "xMidYMid", x = T || "meet", $ = n / o, E = s / u, O = Math.min($, E), C = Math.max($, E), P = o, V = u;
  2687. x === "meet" && (P *= O, V *= O), x === "slice" && (P *= C, V *= C);
  2688. var j = new S(t, "refX", f), R = new S(t, "refY", c), X = j.hasValue() && R.hasValue();
  2689. if (X && r.translate(-O * j.getPixels("x"), -O * R.getPixels("y")), v) {
  2690. var W = O * g, G = O * d;
  2691. r.beginPath(), r.moveTo(W, G), r.lineTo(n, G), r.lineTo(n, s), r.lineTo(W, s), r.closePath(), r.clip();
  2692. }
  2693. if (!X) {
  2694. var q = x === "meet" && O === E, H = x === "slice" && C === E, Q = x === "meet" && O === $, N = x === "slice" && C === $;
  2695. b.startsWith("xMid") && (q || H) && r.translate(n / 2 - P / 2, 0), b.endsWith("YMid") && (Q || N) && r.translate(0, s / 2 - V / 2), b.startsWith("xMax") && (q || H) && r.translate(n - P, 0), b.endsWith("YMax") && (Q || N) && r.translate(0, s - V);
  2696. }
  2697. switch (!0) {
  2698. case b === "none":
  2699. r.scale($, E);
  2700. break;
  2701. case x === "meet":
  2702. r.scale(O, O);
  2703. break;
  2704. case x === "slice":
  2705. r.scale(C, C);
  2706. break;
  2707. }
  2708. r.translate(-l, -h);
  2709. }
  2710. start(e) {
  2711. var {
  2712. enableRedraw: t = !1,
  2713. ignoreMouse: r = !1,
  2714. ignoreAnimation: i = !1,
  2715. ignoreDimensions: n = !1,
  2716. ignoreClear: o = !1,
  2717. forceRedraw: s,
  2718. scaleWidth: u,
  2719. scaleHeight: l,
  2720. offsetX: h,
  2721. offsetY: f
  2722. } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
  2723. FRAMERATE: c,
  2724. mouse: v
  2725. } = this, g = 1e3 / c;
  2726. if (this.frameDuration = g, this.readyPromise = new Promise((b) => {
  2727. this.resolveReady = b;
  2728. }), this.isReady() && this.render(e, n, o, u, l, h, f), !!t) {
  2729. var d = Date.now(), p = d, y = 0, T = () => {
  2730. d = Date.now(), y = d - p, y >= g && (p = d - y % g, this.shouldUpdate(i, s) && (this.render(e, n, o, u, l, h, f), v.runEvents())), this.intervalId = za(T);
  2731. };
  2732. r || v.start(), this.intervalId = za(T);
  2733. }
  2734. }
  2735. stop() {
  2736. this.intervalId && (za.cancel(this.intervalId), this.intervalId = null), this.mouse.stop();
  2737. }
  2738. shouldUpdate(e, t) {
  2739. if (!e) {
  2740. var {
  2741. frameDuration: r
  2742. } = this, i = this.animations.reduce((n, o) => o.update(r) || n, !1);
  2743. if (i)
  2744. return !0;
  2745. }
  2746. return !!(typeof t == "function" && t() || !this.isReadyLock && this.isReady() || this.mouse.hasEvents());
  2747. }
  2748. render(e, t, r, i, n, o, s) {
  2749. var {
  2750. CLIENT_WIDTH: u,
  2751. CLIENT_HEIGHT: l,
  2752. viewPort: h,
  2753. ctx: f,
  2754. isFirstRender: c
  2755. } = this, v = f.canvas;
  2756. h.clear(), v.width && v.height ? h.setCurrent(v.width, v.height) : h.setCurrent(u, l);
  2757. var g = e.getStyle("width"), d = e.getStyle("height");
  2758. !t && (c || typeof i != "number" && typeof n != "number") && (g.hasValue() && (v.width = g.getPixels("x"), v.style && (v.style.width = "".concat(v.width, "px"))), d.hasValue() && (v.height = d.getPixels("y"), v.style && (v.style.height = "".concat(v.height, "px"))));
  2759. var p = v.clientWidth || v.width, y = v.clientHeight || v.height;
  2760. if (t && g.hasValue() && d.hasValue() && (p = g.getPixels("x"), y = d.getPixels("y")), h.setCurrent(p, y), typeof o == "number" && e.getAttribute("x", !0).setValue(o), typeof s == "number" && e.getAttribute("y", !0).setValue(s), typeof i == "number" || typeof n == "number") {
  2761. var T = ne(e.getAttribute("viewBox").getString()), b = 0, x = 0;
  2762. if (typeof i == "number") {
  2763. var $ = e.getStyle("width");
  2764. $.hasValue() ? b = $.getPixels("x") / i : isNaN(T[2]) || (b = T[2] / i);
  2765. }
  2766. if (typeof n == "number") {
  2767. var E = e.getStyle("height");
  2768. E.hasValue() ? x = E.getPixels("y") / n : isNaN(T[3]) || (x = T[3] / n);
  2769. }
  2770. b || (b = x), x || (x = b), e.getAttribute("width", !0).setValue(i), e.getAttribute("height", !0).setValue(n);
  2771. var O = e.getStyle("transform", !0, !0);
  2772. O.setValue("".concat(O.getString(), " scale(").concat(1 / b, ", ").concat(1 / x, ")"));
  2773. }
  2774. r || f.clearRect(0, 0, p, y), e.render(f), c && (this.isFirstRender = !1);
  2775. }
  2776. }
  2777. kr.defaultWindow = ml;
  2778. kr.defaultFetch = bl;
  2779. var {
  2780. defaultFetch: T1
  2781. } = kr, O1 = typeof DOMParser != "undefined" ? DOMParser : null;
  2782. class Ya {
  2783. constructor() {
  2784. var {
  2785. fetch: e = T1,
  2786. DOMParser: t = O1
  2787. } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  2788. this.fetch = e, this.DOMParser = t;
  2789. }
  2790. parse(e) {
  2791. var t = this;
  2792. return xe(function* () {
  2793. return e.startsWith("<") ? t.parseFromString(e) : t.load(e);
  2794. })();
  2795. }
  2796. parseFromString(e) {
  2797. var t = new this.DOMParser();
  2798. try {
  2799. return this.checkDocument(t.parseFromString(e, "image/svg+xml"));
  2800. } catch (r) {
  2801. return this.checkDocument(t.parseFromString(e, "text/xml"));
  2802. }
  2803. }
  2804. checkDocument(e) {
  2805. var t = e.getElementsByTagName("parsererror")[0];
  2806. if (t)
  2807. throw new Error(t.textContent);
  2808. return e;
  2809. }
  2810. load(e) {
  2811. var t = this;
  2812. return xe(function* () {
  2813. var r = yield t.fetch(e), i = yield r.text();
  2814. return t.parseFromString(i);
  2815. })();
  2816. }
  2817. }
  2818. class S1 {
  2819. constructor(e, t) {
  2820. this.type = "translate", this.point = null, this.point = B.parse(t);
  2821. }
  2822. apply(e) {
  2823. var {
  2824. x: t,
  2825. y: r
  2826. } = this.point;
  2827. e.translate(t || 0, r || 0);
  2828. }
  2829. unapply(e) {
  2830. var {
  2831. x: t,
  2832. y: r
  2833. } = this.point;
  2834. e.translate(-1 * t || 0, -1 * r || 0);
  2835. }
  2836. applyToPoint(e) {
  2837. var {
  2838. x: t,
  2839. y: r
  2840. } = this.point;
  2841. e.applyTransform([1, 0, 0, 1, t || 0, r || 0]);
  2842. }
  2843. }
  2844. class E1 {
  2845. constructor(e, t, r) {
  2846. this.type = "rotate", this.angle = null, this.originX = null, this.originY = null, this.cx = 0, this.cy = 0;
  2847. var i = ne(t);
  2848. this.angle = new S(e, "angle", i[0]), this.originX = r[0], this.originY = r[1], this.cx = i[1] || 0, this.cy = i[2] || 0;
  2849. }
  2850. apply(e) {
  2851. var {
  2852. cx: t,
  2853. cy: r,
  2854. originX: i,
  2855. originY: n,
  2856. angle: o
  2857. } = this, s = t + i.getPixels("x"), u = r + n.getPixels("y");
  2858. e.translate(s, u), e.rotate(o.getRadians()), e.translate(-s, -u);
  2859. }
  2860. unapply(e) {
  2861. var {
  2862. cx: t,
  2863. cy: r,
  2864. originX: i,
  2865. originY: n,
  2866. angle: o
  2867. } = this, s = t + i.getPixels("x"), u = r + n.getPixels("y");
  2868. e.translate(s, u), e.rotate(-1 * o.getRadians()), e.translate(-s, -u);
  2869. }
  2870. applyToPoint(e) {
  2871. var {
  2872. cx: t,
  2873. cy: r,
  2874. angle: i
  2875. } = this, n = i.getRadians();
  2876. e.applyTransform([
  2877. 1,
  2878. 0,
  2879. 0,
  2880. 1,
  2881. t || 0,
  2882. r || 0
  2883. // this.p.y
  2884. ]), e.applyTransform([Math.cos(n), Math.sin(n), -Math.sin(n), Math.cos(n), 0, 0]), e.applyTransform([
  2885. 1,
  2886. 0,
  2887. 0,
  2888. 1,
  2889. -t || 0,
  2890. -r || 0
  2891. // -this.p.y
  2892. ]);
  2893. }
  2894. }
  2895. class $1 {
  2896. constructor(e, t, r) {
  2897. this.type = "scale", this.scale = null, this.originX = null, this.originY = null;
  2898. var i = B.parseScale(t);
  2899. (i.x === 0 || i.y === 0) && (i.x = at, i.y = at), this.scale = i, this.originX = r[0], this.originY = r[1];
  2900. }
  2901. apply(e) {
  2902. var {
  2903. scale: {
  2904. x: t,
  2905. y: r
  2906. },
  2907. originX: i,
  2908. originY: n
  2909. } = this, o = i.getPixels("x"), s = n.getPixels("y");
  2910. e.translate(o, s), e.scale(t, r || t), e.translate(-o, -s);
  2911. }
  2912. unapply(e) {
  2913. var {
  2914. scale: {
  2915. x: t,
  2916. y: r
  2917. },
  2918. originX: i,
  2919. originY: n
  2920. } = this, o = i.getPixels("x"), s = n.getPixels("y");
  2921. e.translate(o, s), e.scale(1 / t, 1 / r || t), e.translate(-o, -s);
  2922. }
  2923. applyToPoint(e) {
  2924. var {
  2925. x: t,
  2926. y: r
  2927. } = this.scale;
  2928. e.applyTransform([t || 0, 0, 0, r || 0, 0, 0]);
  2929. }
  2930. }
  2931. class xl {
  2932. constructor(e, t, r) {
  2933. this.type = "matrix", this.matrix = [], this.originX = null, this.originY = null, this.matrix = ne(t), this.originX = r[0], this.originY = r[1];
  2934. }
  2935. apply(e) {
  2936. var {
  2937. originX: t,
  2938. originY: r,
  2939. matrix: i
  2940. } = this, n = t.getPixels("x"), o = r.getPixels("y");
  2941. e.translate(n, o), e.transform(i[0], i[1], i[2], i[3], i[4], i[5]), e.translate(-n, -o);
  2942. }
  2943. unapply(e) {
  2944. var {
  2945. originX: t,
  2946. originY: r,
  2947. matrix: i
  2948. } = this, n = i[0], o = i[2], s = i[4], u = i[1], l = i[3], h = i[5], f = 0, c = 0, v = 1, g = 1 / (n * (l * v - h * c) - o * (u * v - h * f) + s * (u * c - l * f)), d = t.getPixels("x"), p = r.getPixels("y");
  2949. e.translate(d, p), e.transform(g * (l * v - h * c), g * (h * f - u * v), g * (s * c - o * v), g * (n * v - s * f), g * (o * h - s * l), g * (s * u - n * h)), e.translate(-d, -p);
  2950. }
  2951. applyToPoint(e) {
  2952. e.applyTransform(this.matrix);
  2953. }
  2954. }
  2955. class Tl extends xl {
  2956. constructor(e, t, r) {
  2957. super(e, t, r), this.type = "skew", this.angle = null, this.angle = new S(e, "angle", t);
  2958. }
  2959. }
  2960. class w1 extends Tl {
  2961. constructor(e, t, r) {
  2962. super(e, t, r), this.type = "skewX", this.matrix = [1, 0, Math.tan(this.angle.getRadians()), 1, 0, 0];
  2963. }
  2964. }
  2965. class C1 extends Tl {
  2966. constructor(e, t, r) {
  2967. super(e, t, r), this.type = "skewY", this.matrix = [1, Math.tan(this.angle.getRadians()), 0, 1, 0, 0];
  2968. }
  2969. }
  2970. function A1(a) {
  2971. return ht(a).trim().replace(/\)([a-zA-Z])/g, ") $1").replace(/\)(\s?,\s?)/g, ") ").split(/\s(?=[a-z])/);
  2972. }
  2973. function P1(a) {
  2974. var [e, t] = a.split("(");
  2975. return [e.trim(), t.trim().replace(")", "")];
  2976. }
  2977. class je {
  2978. constructor(e, t, r) {
  2979. this.document = e, this.transforms = [];
  2980. var i = A1(t);
  2981. i.forEach((n) => {
  2982. if (n !== "none") {
  2983. var [o, s] = P1(n), u = je.transformTypes[o];
  2984. typeof u != "undefined" && this.transforms.push(new u(this.document, s, r));
  2985. }
  2986. });
  2987. }
  2988. static fromElement(e, t) {
  2989. var r = t.getStyle("transform", !1, !0), [i, n = i] = t.getStyle("transform-origin", !1, !0).split(), o = [i, n];
  2990. return r.hasValue() ? new je(e, r.getString(), o) : null;
  2991. }
  2992. apply(e) {
  2993. for (var {
  2994. transforms: t
  2995. } = this, r = t.length, i = 0; i < r; i++)
  2996. t[i].apply(e);
  2997. }
  2998. unapply(e) {
  2999. for (var {
  3000. transforms: t
  3001. } = this, r = t.length, i = r - 1; i >= 0; i--)
  3002. t[i].unapply(e);
  3003. }
  3004. // TODO: applyToPoint unused ... remove?
  3005. applyToPoint(e) {
  3006. for (var {
  3007. transforms: t
  3008. } = this, r = t.length, i = 0; i < r; i++)
  3009. t[i].applyToPoint(e);
  3010. }
  3011. }
  3012. je.transformTypes = {
  3013. translate: S1,
  3014. rotate: E1,
  3015. scale: $1,
  3016. matrix: xl,
  3017. skewX: w1,
  3018. skewY: C1
  3019. };
  3020. class I {
  3021. constructor(e, t) {
  3022. var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
  3023. if (this.document = e, this.node = t, this.captureTextNodes = r, this.attributes = /* @__PURE__ */ Object.create(null), this.styles = /* @__PURE__ */ Object.create(null), this.stylesSpecificity = /* @__PURE__ */ Object.create(null), this.animationFrozen = !1, this.animationFrozenValue = "", this.parent = null, this.children = [], !(!t || t.nodeType !== 1)) {
  3024. if (Array.from(t.attributes).forEach((s) => {
  3025. var u = l1(s.nodeName);
  3026. this.attributes[u] = new S(e, u, s.value);
  3027. }), this.addStylesFromStyleDefinition(), this.getAttribute("style").hasValue()) {
  3028. var i = this.getAttribute("style").getString().split(";").map((s) => s.trim());
  3029. i.forEach((s) => {
  3030. if (s) {
  3031. var [u, l] = s.split(":").map((h) => h.trim());
  3032. this.styles[u] = new S(e, u, l);
  3033. }
  3034. });
  3035. }
  3036. var {
  3037. definitions: n
  3038. } = e, o = this.getAttribute("id");
  3039. o.hasValue() && (n[o.getString()] || (n[o.getString()] = this)), Array.from(t.childNodes).forEach((s) => {
  3040. if (s.nodeType === 1)
  3041. this.addChild(s);
  3042. else if (r && (s.nodeType === 3 || s.nodeType === 4)) {
  3043. var u = e.createTextNode(s);
  3044. u.getText().length > 0 && this.addChild(u);
  3045. }
  3046. });
  3047. }
  3048. }
  3049. getAttribute(e) {
  3050. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = this.attributes[e];
  3051. if (!r && t) {
  3052. var i = new S(this.document, e, "");
  3053. return this.attributes[e] = i, i;
  3054. }
  3055. return r || S.empty(this.document);
  3056. }
  3057. getHrefAttribute() {
  3058. for (var e in this.attributes)
  3059. if (e === "href" || e.endsWith(":href"))
  3060. return this.attributes[e];
  3061. return S.empty(this.document);
  3062. }
  3063. getStyle(e) {
  3064. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, i = this.styles[e];
  3065. if (i)
  3066. return i;
  3067. var n = this.getAttribute(e);
  3068. if (n != null && n.hasValue())
  3069. return this.styles[e] = n, n;
  3070. if (!r) {
  3071. var {
  3072. parent: o
  3073. } = this;
  3074. if (o) {
  3075. var s = o.getStyle(e);
  3076. if (s != null && s.hasValue())
  3077. return s;
  3078. }
  3079. }
  3080. if (t) {
  3081. var u = new S(this.document, e, "");
  3082. return this.styles[e] = u, u;
  3083. }
  3084. return i || S.empty(this.document);
  3085. }
  3086. render(e) {
  3087. if (!(this.getStyle("display").getString() === "none" || this.getStyle("visibility").getString() === "hidden")) {
  3088. if (e.save(), this.getStyle("mask").hasValue()) {
  3089. var t = this.getStyle("mask").getDefinition();
  3090. t && (this.applyEffects(e), t.apply(e, this));
  3091. } else if (this.getStyle("filter").getValue("none") !== "none") {
  3092. var r = this.getStyle("filter").getDefinition();
  3093. r && (this.applyEffects(e), r.apply(e, this));
  3094. } else
  3095. this.setContext(e), this.renderChildren(e), this.clearContext(e);
  3096. e.restore();
  3097. }
  3098. }
  3099. setContext(e) {
  3100. }
  3101. applyEffects(e) {
  3102. var t = je.fromElement(this.document, this);
  3103. t && t.apply(e);
  3104. var r = this.getStyle("clip-path", !1, !0);
  3105. if (r.hasValue()) {
  3106. var i = r.getDefinition();
  3107. i && i.apply(e);
  3108. }
  3109. }
  3110. clearContext(e) {
  3111. }
  3112. renderChildren(e) {
  3113. this.children.forEach((t) => {
  3114. t.render(e);
  3115. });
  3116. }
  3117. addChild(e) {
  3118. var t = e instanceof I ? e : this.document.createElement(e);
  3119. t.parent = this, I.ignoreChildTypes.includes(t.type) || this.children.push(t);
  3120. }
  3121. matchesSelector(e) {
  3122. var t, {
  3123. node: r
  3124. } = this;
  3125. if (typeof r.matches == "function")
  3126. return r.matches(e);
  3127. var i = (t = r.getAttribute) === null || t === void 0 ? void 0 : t.call(r, "class");
  3128. return !i || i === "" ? !1 : i.split(" ").some((n) => ".".concat(n) === e);
  3129. }
  3130. addStylesFromStyleDefinition() {
  3131. var {
  3132. styles: e,
  3133. stylesSpecificity: t
  3134. } = this.document;
  3135. for (var r in e)
  3136. if (!r.startsWith("@") && this.matchesSelector(r)) {
  3137. var i = e[r], n = t[r];
  3138. if (i)
  3139. for (var o in i) {
  3140. var s = this.stylesSpecificity[o];
  3141. typeof s == "undefined" && (s = "000"), n >= s && (this.styles[o] = i[o], this.stylesSpecificity[o] = n);
  3142. }
  3143. }
  3144. }
  3145. removeStyles(e, t) {
  3146. var r = t.reduce((i, n) => {
  3147. var o = e.getStyle(n);
  3148. if (!o.hasValue())
  3149. return i;
  3150. var s = o.getString();
  3151. return o.setValue(""), [...i, [n, s]];
  3152. }, []);
  3153. return r;
  3154. }
  3155. restoreStyles(e, t) {
  3156. t.forEach((r) => {
  3157. var [i, n] = r;
  3158. e.getStyle(i, !0).setValue(n);
  3159. });
  3160. }
  3161. isFirstChild() {
  3162. var e;
  3163. return ((e = this.parent) === null || e === void 0 ? void 0 : e.children.indexOf(this)) === 0;
  3164. }
  3165. }
  3166. I.ignoreChildTypes = ["title"];
  3167. class R1 extends I {
  3168. constructor(e, t, r) {
  3169. super(e, t, r);
  3170. }
  3171. }
  3172. function N1(a) {
  3173. var e = a.trim();
  3174. return /^('|")/.test(e) ? e : '"'.concat(e, '"');
  3175. }
  3176. function I1(a) {
  3177. return typeof process == "undefined" ? a : a.trim().split(",").map(N1).join(",");
  3178. }
  3179. function M1(a) {
  3180. if (!a)
  3181. return "";
  3182. var e = a.trim().toLowerCase();
  3183. switch (e) {
  3184. case "normal":
  3185. case "italic":
  3186. case "oblique":
  3187. case "inherit":
  3188. case "initial":
  3189. case "unset":
  3190. return e;
  3191. default:
  3192. return /^oblique\s+(-|)\d+deg$/.test(e) ? e : "";
  3193. }
  3194. }
  3195. function _1(a) {
  3196. if (!a)
  3197. return "";
  3198. var e = a.trim().toLowerCase();
  3199. switch (e) {
  3200. case "normal":
  3201. case "bold":
  3202. case "lighter":
  3203. case "bolder":
  3204. case "inherit":
  3205. case "initial":
  3206. case "unset":
  3207. return e;
  3208. default:
  3209. return /^[\d.]+$/.test(e) ? e : "";
  3210. }
  3211. }
  3212. class Z {
  3213. constructor(e, t, r, i, n, o) {
  3214. var s = o ? typeof o == "string" ? Z.parse(o) : o : {};
  3215. this.fontFamily = n || s.fontFamily, this.fontSize = i || s.fontSize, this.fontStyle = e || s.fontStyle, this.fontWeight = r || s.fontWeight, this.fontVariant = t || s.fontVariant;
  3216. }
  3217. static parse() {
  3218. var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", t = arguments.length > 1 ? arguments[1] : void 0, r = "", i = "", n = "", o = "", s = "", u = ht(e).trim().split(" "), l = {
  3219. fontSize: !1,
  3220. fontStyle: !1,
  3221. fontWeight: !1,
  3222. fontVariant: !1
  3223. };
  3224. return u.forEach((h) => {
  3225. switch (!0) {
  3226. case (!l.fontStyle && Z.styles.includes(h)):
  3227. h !== "inherit" && (r = h), l.fontStyle = !0;
  3228. break;
  3229. case (!l.fontVariant && Z.variants.includes(h)):
  3230. h !== "inherit" && (i = h), l.fontStyle = !0, l.fontVariant = !0;
  3231. break;
  3232. case (!l.fontWeight && Z.weights.includes(h)):
  3233. h !== "inherit" && (n = h), l.fontStyle = !0, l.fontVariant = !0, l.fontWeight = !0;
  3234. break;
  3235. case !l.fontSize:
  3236. h !== "inherit" && ([o] = h.split("/")), l.fontStyle = !0, l.fontVariant = !0, l.fontWeight = !0, l.fontSize = !0;
  3237. break;
  3238. default:
  3239. h !== "inherit" && (s += h);
  3240. }
  3241. }), new Z(r, i, n, o, s, t);
  3242. }
  3243. toString() {
  3244. return [
  3245. M1(this.fontStyle),
  3246. this.fontVariant,
  3247. _1(this.fontWeight),
  3248. this.fontSize,
  3249. // Wrap fontFamily only on nodejs and only for canvas.ctx
  3250. I1(this.fontFamily)
  3251. ].join(" ").trim();
  3252. }
  3253. }
  3254. Z.styles = "normal|italic|oblique|inherit";
  3255. Z.variants = "normal|small-caps|inherit";
  3256. Z.weights = "normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";
  3257. class ce {
  3258. constructor() {
  3259. var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Number.NaN, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.NaN, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Number.NaN, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Number.NaN;
  3260. this.x1 = e, this.y1 = t, this.x2 = r, this.y2 = i, this.addPoint(e, t), this.addPoint(r, i);
  3261. }
  3262. get x() {
  3263. return this.x1;
  3264. }
  3265. get y() {
  3266. return this.y1;
  3267. }
  3268. get width() {
  3269. return this.x2 - this.x1;
  3270. }
  3271. get height() {
  3272. return this.y2 - this.y1;
  3273. }
  3274. addPoint(e, t) {
  3275. typeof e != "undefined" && ((isNaN(this.x1) || isNaN(this.x2)) && (this.x1 = e, this.x2 = e), e < this.x1 && (this.x1 = e), e > this.x2 && (this.x2 = e)), typeof t != "undefined" && ((isNaN(this.y1) || isNaN(this.y2)) && (this.y1 = t, this.y2 = t), t < this.y1 && (this.y1 = t), t > this.y2 && (this.y2 = t));
  3276. }
  3277. addX(e) {
  3278. this.addPoint(e, null);
  3279. }
  3280. addY(e) {
  3281. this.addPoint(null, e);
  3282. }
  3283. addBoundingBox(e) {
  3284. if (e) {
  3285. var {
  3286. x1: t,
  3287. y1: r,
  3288. x2: i,
  3289. y2: n
  3290. } = e;
  3291. this.addPoint(t, r), this.addPoint(i, n);
  3292. }
  3293. }
  3294. sumCubic(e, t, r, i, n) {
  3295. return Math.pow(1 - e, 3) * t + 3 * Math.pow(1 - e, 2) * e * r + 3 * (1 - e) * Math.pow(e, 2) * i + Math.pow(e, 3) * n;
  3296. }
  3297. bezierCurveAdd(e, t, r, i, n) {
  3298. var o = 6 * t - 12 * r + 6 * i, s = -3 * t + 9 * r - 9 * i + 3 * n, u = 3 * r - 3 * t;
  3299. if (s === 0) {
  3300. if (o === 0)
  3301. return;
  3302. var l = -u / o;
  3303. 0 < l && l < 1 && (e ? this.addX(this.sumCubic(l, t, r, i, n)) : this.addY(this.sumCubic(l, t, r, i, n)));
  3304. return;
  3305. }
  3306. var h = Math.pow(o, 2) - 4 * u * s;
  3307. if (!(h < 0)) {
  3308. var f = (-o + Math.sqrt(h)) / (2 * s);
  3309. 0 < f && f < 1 && (e ? this.addX(this.sumCubic(f, t, r, i, n)) : this.addY(this.sumCubic(f, t, r, i, n)));
  3310. var c = (-o - Math.sqrt(h)) / (2 * s);
  3311. 0 < c && c < 1 && (e ? this.addX(this.sumCubic(c, t, r, i, n)) : this.addY(this.sumCubic(c, t, r, i, n)));
  3312. }
  3313. }
  3314. // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
  3315. addBezierCurve(e, t, r, i, n, o, s, u) {
  3316. this.addPoint(e, t), this.addPoint(s, u), this.bezierCurveAdd(!0, e, r, n, s), this.bezierCurveAdd(!1, t, i, o, u);
  3317. }
  3318. addQuadraticCurve(e, t, r, i, n, o) {
  3319. var s = e + 0.6666666666666666 * (r - e), u = t + 2 / 3 * (i - t), l = s + 1 / 3 * (n - e), h = u + 1 / 3 * (o - t);
  3320. this.addBezierCurve(e, t, s, l, u, h, n, o);
  3321. }
  3322. isPointInBox(e, t) {
  3323. var {
  3324. x1: r,
  3325. y1: i,
  3326. x2: n,
  3327. y2: o
  3328. } = this;
  3329. return r <= e && e <= n && i <= t && t <= o;
  3330. }
  3331. }
  3332. class w extends m {
  3333. constructor(e) {
  3334. super(e.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 = [];
  3335. }
  3336. reset() {
  3337. this.i = -1, this.command = null, this.previousCommand = null, this.start = new B(0, 0), this.control = new B(0, 0), this.current = new B(0, 0), this.points = [], this.angles = [];
  3338. }
  3339. isEnd() {
  3340. var {
  3341. i: e,
  3342. commands: t
  3343. } = this;
  3344. return e >= t.length - 1;
  3345. }
  3346. next() {
  3347. var e = this.commands[++this.i];
  3348. return this.previousCommand = this.command, this.command = e, e;
  3349. }
  3350. getPoint() {
  3351. var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "x", t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "y", r = new B(this.command[e], this.command[t]);
  3352. return this.makeAbsolute(r);
  3353. }
  3354. getAsControlPoint(e, t) {
  3355. var r = this.getPoint(e, t);
  3356. return this.control = r, r;
  3357. }
  3358. getAsCurrentPoint(e, t) {
  3359. var r = this.getPoint(e, t);
  3360. return this.current = r, r;
  3361. }
  3362. getReflectedControlPoint() {
  3363. var e = this.previousCommand.type;
  3364. if (e !== m.CURVE_TO && e !== m.SMOOTH_CURVE_TO && e !== m.QUAD_TO && e !== m.SMOOTH_QUAD_TO)
  3365. return this.current;
  3366. var {
  3367. current: {
  3368. x: t,
  3369. y: r
  3370. },
  3371. control: {
  3372. x: i,
  3373. y: n
  3374. }
  3375. } = this, o = new B(2 * t - i, 2 * r - n);
  3376. return o;
  3377. }
  3378. makeAbsolute(e) {
  3379. if (this.command.relative) {
  3380. var {
  3381. x: t,
  3382. y: r
  3383. } = this.current;
  3384. e.x += t, e.y += r;
  3385. }
  3386. return e;
  3387. }
  3388. addMarker(e, t, r) {
  3389. var {
  3390. points: i,
  3391. angles: n
  3392. } = this;
  3393. r && n.length > 0 && !n[n.length - 1] && (n[n.length - 1] = i[i.length - 1].angleTo(r)), this.addMarkerAngle(e, t ? t.angleTo(e) : null);
  3394. }
  3395. addMarkerAngle(e, t) {
  3396. this.points.push(e), this.angles.push(t);
  3397. }
  3398. getMarkerPoints() {
  3399. return this.points;
  3400. }
  3401. getMarkerAngles() {
  3402. for (var {
  3403. angles: e
  3404. } = this, t = e.length, r = 0; r < t; r++)
  3405. if (!e[r]) {
  3406. for (var i = r + 1; i < t; i++)
  3407. if (e[i]) {
  3408. e[r] = e[i];
  3409. break;
  3410. }
  3411. }
  3412. return e;
  3413. }
  3414. }
  3415. class Ge extends I {
  3416. constructor() {
  3417. super(...arguments), this.modifiedEmSizeStack = !1;
  3418. }
  3419. calculateOpacity() {
  3420. for (var e = 1, t = this; t; ) {
  3421. var r = t.getStyle("opacity", !1, !0);
  3422. r.hasValue(!0) && (e *= r.getNumber()), t = t.parent;
  3423. }
  3424. return e;
  3425. }
  3426. setContext(e) {
  3427. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  3428. if (!t) {
  3429. var r = this.getStyle("fill"), i = this.getStyle("fill-opacity"), n = this.getStyle("stroke"), o = this.getStyle("stroke-opacity");
  3430. if (r.isUrlDefinition()) {
  3431. var s = r.getFillStyleDefinition(this, i);
  3432. s && (e.fillStyle = s);
  3433. } else if (r.hasValue()) {
  3434. r.getString() === "currentColor" && r.setValue(this.getStyle("color").getColor());
  3435. var u = r.getColor();
  3436. u !== "inherit" && (e.fillStyle = u === "none" ? "rgba(0,0,0,0)" : u);
  3437. }
  3438. if (i.hasValue()) {
  3439. var l = new S(this.document, "fill", e.fillStyle).addOpacity(i).getColor();
  3440. e.fillStyle = l;
  3441. }
  3442. if (n.isUrlDefinition()) {
  3443. var h = n.getFillStyleDefinition(this, o);
  3444. h && (e.strokeStyle = h);
  3445. } else if (n.hasValue()) {
  3446. n.getString() === "currentColor" && n.setValue(this.getStyle("color").getColor());
  3447. var f = n.getString();
  3448. f !== "inherit" && (e.strokeStyle = f === "none" ? "rgba(0,0,0,0)" : f);
  3449. }
  3450. if (o.hasValue()) {
  3451. var c = new S(this.document, "stroke", e.strokeStyle).addOpacity(o).getString();
  3452. e.strokeStyle = c;
  3453. }
  3454. var v = this.getStyle("stroke-width");
  3455. if (v.hasValue()) {
  3456. var g = v.getPixels();
  3457. e.lineWidth = g || at;
  3458. }
  3459. var d = this.getStyle("stroke-linecap"), p = this.getStyle("stroke-linejoin"), y = this.getStyle("stroke-miterlimit"), T = this.getStyle("stroke-dasharray"), b = this.getStyle("stroke-dashoffset");
  3460. if (d.hasValue() && (e.lineCap = d.getString()), p.hasValue() && (e.lineJoin = p.getString()), y.hasValue() && (e.miterLimit = y.getNumber()), T.hasValue() && T.getString() !== "none") {
  3461. var x = ne(T.getString());
  3462. typeof e.setLineDash != "undefined" ? e.setLineDash(x) : typeof e.webkitLineDash != "undefined" ? e.webkitLineDash = x : typeof e.mozDash != "undefined" && !(x.length === 1 && x[0] === 0) && (e.mozDash = x);
  3463. var $ = b.getPixels();
  3464. typeof e.lineDashOffset != "undefined" ? e.lineDashOffset = $ : typeof e.webkitLineDashOffset != "undefined" ? e.webkitLineDashOffset = $ : typeof e.mozDashOffset != "undefined" && (e.mozDashOffset = $);
  3465. }
  3466. }
  3467. if (this.modifiedEmSizeStack = !1, typeof e.font != "undefined") {
  3468. var E = this.getStyle("font"), O = this.getStyle("font-style"), C = this.getStyle("font-variant"), P = this.getStyle("font-weight"), V = this.getStyle("font-size"), j = this.getStyle("font-family"), R = new Z(O.getString(), C.getString(), P.getString(), V.hasValue() ? "".concat(V.getPixels(!0), "px") : "", j.getString(), Z.parse(E.getString(), e.font));
  3469. O.setValue(R.fontStyle), C.setValue(R.fontVariant), P.setValue(R.fontWeight), V.setValue(R.fontSize), j.setValue(R.fontFamily), e.font = R.toString(), V.isPixels() && (this.document.emSize = V.getPixels(), this.modifiedEmSizeStack = !0);
  3470. }
  3471. t || (this.applyEffects(e), e.globalAlpha = this.calculateOpacity());
  3472. }
  3473. clearContext(e) {
  3474. super.clearContext(e), this.modifiedEmSizeStack && this.document.popEmSize();
  3475. }
  3476. }
  3477. class A extends Ge {
  3478. constructor(e, t, r) {
  3479. super(e, t, r), this.type = "path", this.pathParser = null, this.pathParser = new w(this.getAttribute("d").getString());
  3480. }
  3481. path(e) {
  3482. var {
  3483. pathParser: t
  3484. } = this, r = new ce();
  3485. for (t.reset(), e && e.beginPath(); !t.isEnd(); )
  3486. switch (t.next().type) {
  3487. case w.MOVE_TO:
  3488. this.pathM(e, r);
  3489. break;
  3490. case w.LINE_TO:
  3491. this.pathL(e, r);
  3492. break;
  3493. case w.HORIZ_LINE_TO:
  3494. this.pathH(e, r);
  3495. break;
  3496. case w.VERT_LINE_TO:
  3497. this.pathV(e, r);
  3498. break;
  3499. case w.CURVE_TO:
  3500. this.pathC(e, r);
  3501. break;
  3502. case w.SMOOTH_CURVE_TO:
  3503. this.pathS(e, r);
  3504. break;
  3505. case w.QUAD_TO:
  3506. this.pathQ(e, r);
  3507. break;
  3508. case w.SMOOTH_QUAD_TO:
  3509. this.pathT(e, r);
  3510. break;
  3511. case w.ARC:
  3512. this.pathA(e, r);
  3513. break;
  3514. case w.CLOSE_PATH:
  3515. this.pathZ(e, r);
  3516. break;
  3517. }
  3518. return r;
  3519. }
  3520. getBoundingBox(e) {
  3521. return this.path();
  3522. }
  3523. getMarkers() {
  3524. var {
  3525. pathParser: e
  3526. } = this, t = e.getMarkerPoints(), r = e.getMarkerAngles(), i = t.map((n, o) => [n, r[o]]);
  3527. return i;
  3528. }
  3529. renderChildren(e) {
  3530. this.path(e), this.document.screen.mouse.checkPath(this, e);
  3531. var t = this.getStyle("fill-rule");
  3532. e.fillStyle !== "" && (t.getString("inherit") !== "inherit" ? e.fill(t.getString()) : e.fill()), e.strokeStyle !== "" && (this.getAttribute("vector-effect").getString() === "non-scaling-stroke" ? (e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.stroke(), e.restore()) : e.stroke());
  3533. var r = this.getMarkers();
  3534. if (r) {
  3535. var i = r.length - 1, n = this.getStyle("marker-start"), o = this.getStyle("marker-mid"), s = this.getStyle("marker-end");
  3536. if (n.isUrlDefinition()) {
  3537. var u = n.getDefinition(), [l, h] = r[0];
  3538. u.render(e, l, h);
  3539. }
  3540. if (o.isUrlDefinition())
  3541. for (var f = o.getDefinition(), c = 1; c < i; c++) {
  3542. var [v, g] = r[c];
  3543. f.render(e, v, g);
  3544. }
  3545. if (s.isUrlDefinition()) {
  3546. var d = s.getDefinition(), [p, y] = r[i];
  3547. d.render(e, p, y);
  3548. }
  3549. }
  3550. }
  3551. static pathM(e) {
  3552. var t = e.getAsCurrentPoint();
  3553. return e.start = e.current, {
  3554. point: t
  3555. };
  3556. }
  3557. pathM(e, t) {
  3558. var {
  3559. pathParser: r
  3560. } = this, {
  3561. point: i
  3562. } = A.pathM(r), {
  3563. x: n,
  3564. y: o
  3565. } = i;
  3566. r.addMarker(i), t.addPoint(n, o), e && e.moveTo(n, o);
  3567. }
  3568. static pathL(e) {
  3569. var {
  3570. current: t
  3571. } = e, r = e.getAsCurrentPoint();
  3572. return {
  3573. current: t,
  3574. point: r
  3575. };
  3576. }
  3577. pathL(e, t) {
  3578. var {
  3579. pathParser: r
  3580. } = this, {
  3581. current: i,
  3582. point: n
  3583. } = A.pathL(r), {
  3584. x: o,
  3585. y: s
  3586. } = n;
  3587. r.addMarker(n, i), t.addPoint(o, s), e && e.lineTo(o, s);
  3588. }
  3589. static pathH(e) {
  3590. var {
  3591. current: t,
  3592. command: r
  3593. } = e, i = new B((r.relative ? t.x : 0) + r.x, t.y);
  3594. return e.current = i, {
  3595. current: t,
  3596. point: i
  3597. };
  3598. }
  3599. pathH(e, t) {
  3600. var {
  3601. pathParser: r
  3602. } = this, {
  3603. current: i,
  3604. point: n
  3605. } = A.pathH(r), {
  3606. x: o,
  3607. y: s
  3608. } = n;
  3609. r.addMarker(n, i), t.addPoint(o, s), e && e.lineTo(o, s);
  3610. }
  3611. static pathV(e) {
  3612. var {
  3613. current: t,
  3614. command: r
  3615. } = e, i = new B(t.x, (r.relative ? t.y : 0) + r.y);
  3616. return e.current = i, {
  3617. current: t,
  3618. point: i
  3619. };
  3620. }
  3621. pathV(e, t) {
  3622. var {
  3623. pathParser: r
  3624. } = this, {
  3625. current: i,
  3626. point: n
  3627. } = A.pathV(r), {
  3628. x: o,
  3629. y: s
  3630. } = n;
  3631. r.addMarker(n, i), t.addPoint(o, s), e && e.lineTo(o, s);
  3632. }
  3633. static pathC(e) {
  3634. var {
  3635. current: t
  3636. } = e, r = e.getPoint("x1", "y1"), i = e.getAsControlPoint("x2", "y2"), n = e.getAsCurrentPoint();
  3637. return {
  3638. current: t,
  3639. point: r,
  3640. controlPoint: i,
  3641. currentPoint: n
  3642. };
  3643. }
  3644. pathC(e, t) {
  3645. var {
  3646. pathParser: r
  3647. } = this, {
  3648. current: i,
  3649. point: n,
  3650. controlPoint: o,
  3651. currentPoint: s
  3652. } = A.pathC(r);
  3653. r.addMarker(s, o, n), t.addBezierCurve(i.x, i.y, n.x, n.y, o.x, o.y, s.x, s.y), e && e.bezierCurveTo(n.x, n.y, o.x, o.y, s.x, s.y);
  3654. }
  3655. static pathS(e) {
  3656. var {
  3657. current: t
  3658. } = e, r = e.getReflectedControlPoint(), i = e.getAsControlPoint("x2", "y2"), n = e.getAsCurrentPoint();
  3659. return {
  3660. current: t,
  3661. point: r,
  3662. controlPoint: i,
  3663. currentPoint: n
  3664. };
  3665. }
  3666. pathS(e, t) {
  3667. var {
  3668. pathParser: r
  3669. } = this, {
  3670. current: i,
  3671. point: n,
  3672. controlPoint: o,
  3673. currentPoint: s
  3674. } = A.pathS(r);
  3675. r.addMarker(s, o, n), t.addBezierCurve(i.x, i.y, n.x, n.y, o.x, o.y, s.x, s.y), e && e.bezierCurveTo(n.x, n.y, o.x, o.y, s.x, s.y);
  3676. }
  3677. static pathQ(e) {
  3678. var {
  3679. current: t
  3680. } = e, r = e.getAsControlPoint("x1", "y1"), i = e.getAsCurrentPoint();
  3681. return {
  3682. current: t,
  3683. controlPoint: r,
  3684. currentPoint: i
  3685. };
  3686. }
  3687. pathQ(e, t) {
  3688. var {
  3689. pathParser: r
  3690. } = this, {
  3691. current: i,
  3692. controlPoint: n,
  3693. currentPoint: o
  3694. } = A.pathQ(r);
  3695. r.addMarker(o, n, n), t.addQuadraticCurve(i.x, i.y, n.x, n.y, o.x, o.y), e && e.quadraticCurveTo(n.x, n.y, o.x, o.y);
  3696. }
  3697. static pathT(e) {
  3698. var {
  3699. current: t
  3700. } = e, r = e.getReflectedControlPoint();
  3701. e.control = r;
  3702. var i = e.getAsCurrentPoint();
  3703. return {
  3704. current: t,
  3705. controlPoint: r,
  3706. currentPoint: i
  3707. };
  3708. }
  3709. pathT(e, t) {
  3710. var {
  3711. pathParser: r
  3712. } = this, {
  3713. current: i,
  3714. controlPoint: n,
  3715. currentPoint: o
  3716. } = A.pathT(r);
  3717. r.addMarker(o, n, n), t.addQuadraticCurve(i.x, i.y, n.x, n.y, o.x, o.y), e && e.quadraticCurveTo(n.x, n.y, o.x, o.y);
  3718. }
  3719. static pathA(e) {
  3720. var {
  3721. current: t,
  3722. command: r
  3723. } = e, {
  3724. rX: i,
  3725. rY: n,
  3726. xRot: o,
  3727. lArcFlag: s,
  3728. sweepFlag: u
  3729. } = r, l = o * (Math.PI / 180), h = e.getAsCurrentPoint(), f = new B(Math.cos(l) * (t.x - h.x) / 2 + Math.sin(l) * (t.y - h.y) / 2, -Math.sin(l) * (t.x - h.x) / 2 + Math.cos(l) * (t.y - h.y) / 2), c = Math.pow(f.x, 2) / Math.pow(i, 2) + Math.pow(f.y, 2) / Math.pow(n, 2);
  3730. c > 1 && (i *= Math.sqrt(c), n *= Math.sqrt(c));
  3731. var v = (s === u ? -1 : 1) * Math.sqrt((Math.pow(i, 2) * Math.pow(n, 2) - Math.pow(i, 2) * Math.pow(f.y, 2) - Math.pow(n, 2) * Math.pow(f.x, 2)) / (Math.pow(i, 2) * Math.pow(f.y, 2) + Math.pow(n, 2) * Math.pow(f.x, 2)));
  3732. isNaN(v) && (v = 0);
  3733. var g = new B(v * i * f.y / n, v * -n * f.x / i), d = new B((t.x + h.x) / 2 + Math.cos(l) * g.x - Math.sin(l) * g.y, (t.y + h.y) / 2 + Math.sin(l) * g.x + Math.cos(l) * g.y), p = So([1, 0], [(f.x - g.x) / i, (f.y - g.y) / n]), y = [(f.x - g.x) / i, (f.y - g.y) / n], T = [(-f.x - g.x) / i, (-f.y - g.y) / n], b = So(y, T);
  3734. return xi(y, T) <= -1 && (b = Math.PI), xi(y, T) >= 1 && (b = 0), {
  3735. currentPoint: h,
  3736. rX: i,
  3737. rY: n,
  3738. sweepFlag: u,
  3739. xAxisRotation: l,
  3740. centp: d,
  3741. a1: p,
  3742. ad: b
  3743. };
  3744. }
  3745. pathA(e, t) {
  3746. var {
  3747. pathParser: r
  3748. } = this, {
  3749. currentPoint: i,
  3750. rX: n,
  3751. rY: o,
  3752. sweepFlag: s,
  3753. xAxisRotation: u,
  3754. centp: l,
  3755. a1: h,
  3756. ad: f
  3757. } = A.pathA(r), c = 1 - s ? 1 : -1, v = h + c * (f / 2), g = new B(l.x + n * Math.cos(v), l.y + o * Math.sin(v));
  3758. if (r.addMarkerAngle(g, v - c * Math.PI / 2), r.addMarkerAngle(i, v - c * Math.PI), t.addPoint(i.x, i.y), e && !isNaN(h) && !isNaN(f)) {
  3759. var d = n > o ? n : o, p = n > o ? 1 : n / o, y = n > o ? o / n : 1;
  3760. e.translate(l.x, l.y), e.rotate(u), e.scale(p, y), e.arc(0, 0, d, h, h + f, !!(1 - s)), e.scale(1 / p, 1 / y), e.rotate(-u), e.translate(-l.x, -l.y);
  3761. }
  3762. }
  3763. static pathZ(e) {
  3764. e.current = e.start;
  3765. }
  3766. pathZ(e, t) {
  3767. A.pathZ(this.pathParser), e && t.x1 !== t.x2 && t.y1 !== t.y2 && e.closePath();
  3768. }
  3769. }
  3770. class Ol extends A {
  3771. constructor(e, t, r) {
  3772. super(e, t, 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();
  3773. }
  3774. }
  3775. class we extends Ge {
  3776. constructor(e, t, r) {
  3777. super(e, t, new.target === we ? !0 : r), this.type = "text", this.x = 0, this.y = 0, this.measureCache = -1;
  3778. }
  3779. setContext(e) {
  3780. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
  3781. super.setContext(e, t);
  3782. var r = this.getStyle("dominant-baseline").getTextBaseline() || this.getStyle("alignment-baseline").getTextBaseline();
  3783. r && (e.textBaseline = r);
  3784. }
  3785. initializeCoordinates() {
  3786. this.x = 0, this.y = 0, this.leafTexts = [], this.textChunkStart = 0, this.minX = Number.POSITIVE_INFINITY, this.maxX = Number.NEGATIVE_INFINITY;
  3787. }
  3788. getBoundingBox(e) {
  3789. if (this.type !== "text")
  3790. return this.getTElementBoundingBox(e);
  3791. this.initializeCoordinates(), this.adjustChildCoordinatesRecursive(e);
  3792. var t = null;
  3793. return this.children.forEach((r, i) => {
  3794. var n = this.getChildBoundingBox(e, this, this, i);
  3795. t ? t.addBoundingBox(n) : t = n;
  3796. }), t;
  3797. }
  3798. getFontSize() {
  3799. var {
  3800. document: e,
  3801. parent: t
  3802. } = this, r = Z.parse(e.ctx.font).fontSize, i = t.getStyle("font-size").getNumber(r);
  3803. return i;
  3804. }
  3805. getTElementBoundingBox(e) {
  3806. var t = this.getFontSize();
  3807. return new ce(this.x, this.y - t, this.x + this.measureText(e), this.y);
  3808. }
  3809. getGlyph(e, t, r) {
  3810. var i = t[r], n = null;
  3811. if (e.isArabic) {
  3812. var o = t.length, s = t[r - 1], u = t[r + 1], l = "isolated";
  3813. if ((r === 0 || s === " ") && r < o - 1 && u !== " " && (l = "terminal"), r > 0 && s !== " " && r < o - 1 && u !== " " && (l = "medial"), r > 0 && s !== " " && (r === o - 1 || u === " ") && (l = "initial"), typeof e.glyphs[i] != "undefined") {
  3814. var h = e.glyphs[i];
  3815. n = h instanceof Ol ? h : h[l];
  3816. }
  3817. } else
  3818. n = e.glyphs[i];
  3819. return n || (n = e.missingGlyph), n;
  3820. }
  3821. getText() {
  3822. return "";
  3823. }
  3824. getTextFromNode(e) {
  3825. var t = e || this.node, r = Array.from(t.parentNode.childNodes), i = r.indexOf(t), n = r.length - 1, o = ht(
  3826. // textNode.value
  3827. // || textNode.text
  3828. t.textContent || ""
  3829. );
  3830. return i === 0 && (o = s1(o)), i === n && (o = o1(o)), o;
  3831. }
  3832. renderChildren(e) {
  3833. if (this.type !== "text") {
  3834. this.renderTElementChildren(e);
  3835. return;
  3836. }
  3837. this.initializeCoordinates(), this.adjustChildCoordinatesRecursive(e), this.children.forEach((r, i) => {
  3838. this.renderChild(e, this, this, i);
  3839. });
  3840. var {
  3841. mouse: t
  3842. } = this.document.screen;
  3843. t.isWorking() && t.checkBoundingBox(this, this.getBoundingBox(e));
  3844. }
  3845. renderTElementChildren(e) {
  3846. var {
  3847. document: t,
  3848. parent: r
  3849. } = this, i = this.getText(), n = r.getStyle("font-family").getDefinition();
  3850. if (n) {
  3851. for (var {
  3852. unitsPerEm: o
  3853. } = n.fontFace, s = Z.parse(t.ctx.font), u = r.getStyle("font-size").getNumber(s.fontSize), l = r.getStyle("font-style").getString(s.fontStyle), h = u / o, f = n.isRTL ? i.split("").reverse().join("") : i, c = ne(r.getAttribute("dx").getString()), v = f.length, g = 0; g < v; g++) {
  3854. var d = this.getGlyph(n, f, g);
  3855. e.translate(this.x, this.y), e.scale(h, -h);
  3856. var p = e.lineWidth;
  3857. e.lineWidth = e.lineWidth * o / u, l === "italic" && e.transform(1, 0, 0.4, 1, 0, 0), d.render(e), l === "italic" && e.transform(1, 0, -0.4, 1, 0, 0), e.lineWidth = p, e.scale(1 / h, -1 / h), e.translate(-this.x, -this.y), this.x += u * (d.horizAdvX || n.horizAdvX) / o, typeof c[g] != "undefined" && !isNaN(c[g]) && (this.x += c[g]);
  3858. }
  3859. return;
  3860. }
  3861. var {
  3862. x: y,
  3863. y: T
  3864. } = this;
  3865. e.fillStyle && e.fillText(i, y, T), e.strokeStyle && e.strokeText(i, y, T);
  3866. }
  3867. applyAnchoring() {
  3868. if (!(this.textChunkStart >= this.leafTexts.length)) {
  3869. var e = this.leafTexts[this.textChunkStart], t = e.getStyle("text-anchor").getString("start"), r = !1, i = 0;
  3870. t === "start" && !r || t === "end" && r ? i = e.x - this.minX : t === "end" && !r || t === "start" && r ? i = e.x - this.maxX : i = e.x - (this.minX + this.maxX) / 2;
  3871. for (var n = this.textChunkStart; n < this.leafTexts.length; n++)
  3872. this.leafTexts[n].x += i;
  3873. this.minX = Number.POSITIVE_INFINITY, this.maxX = Number.NEGATIVE_INFINITY, this.textChunkStart = this.leafTexts.length;
  3874. }
  3875. }
  3876. adjustChildCoordinatesRecursive(e) {
  3877. this.children.forEach((t, r) => {
  3878. this.adjustChildCoordinatesRecursiveCore(e, this, this, r);
  3879. }), this.applyAnchoring();
  3880. }
  3881. adjustChildCoordinatesRecursiveCore(e, t, r, i) {
  3882. var n = r.children[i];
  3883. n.children.length > 0 ? n.children.forEach((o, s) => {
  3884. t.adjustChildCoordinatesRecursiveCore(e, t, n, s);
  3885. }) : this.adjustChildCoordinates(e, t, r, i);
  3886. }
  3887. adjustChildCoordinates(e, t, r, i) {
  3888. var n = r.children[i];
  3889. if (typeof n.measureText != "function")
  3890. return n;
  3891. e.save(), n.setContext(e, !0);
  3892. var o = n.getAttribute("x"), s = n.getAttribute("y"), u = n.getAttribute("dx"), l = n.getAttribute("dy"), h = n.getStyle("font-family").getDefinition(), f = !!h && h.isRTL;
  3893. i === 0 && (o.hasValue() || o.setValue(n.getInheritedAttribute("x")), s.hasValue() || s.setValue(n.getInheritedAttribute("y")), u.hasValue() || u.setValue(n.getInheritedAttribute("dx")), l.hasValue() || l.setValue(n.getInheritedAttribute("dy")));
  3894. var c = n.measureText(e);
  3895. return f && (t.x -= c), o.hasValue() ? (t.applyAnchoring(), n.x = o.getPixels("x"), u.hasValue() && (n.x += u.getPixels("x"))) : (u.hasValue() && (t.x += u.getPixels("x")), n.x = t.x), t.x = n.x, f || (t.x += c), s.hasValue() ? (n.y = s.getPixels("y"), l.hasValue() && (n.y += l.getPixels("y"))) : (l.hasValue() && (t.y += l.getPixels("y")), n.y = t.y), t.y = n.y, t.leafTexts.push(n), t.minX = Math.min(t.minX, n.x, n.x + c), t.maxX = Math.max(t.maxX, n.x, n.x + c), n.clearContext(e), e.restore(), n;
  3896. }
  3897. getChildBoundingBox(e, t, r, i) {
  3898. var n = r.children[i];
  3899. if (typeof n.getBoundingBox != "function")
  3900. return null;
  3901. var o = n.getBoundingBox(e);
  3902. return o ? (n.children.forEach((s, u) => {
  3903. var l = t.getChildBoundingBox(e, t, n, u);
  3904. o.addBoundingBox(l);
  3905. }), o) : null;
  3906. }
  3907. renderChild(e, t, r, i) {
  3908. var n = r.children[i];
  3909. n.render(e), n.children.forEach((o, s) => {
  3910. t.renderChild(e, t, n, s);
  3911. });
  3912. }
  3913. measureText(e) {
  3914. var {
  3915. measureCache: t
  3916. } = this;
  3917. if (~t)
  3918. return t;
  3919. var r = this.getText(), i = this.measureTargetText(e, r);
  3920. return this.measureCache = i, i;
  3921. }
  3922. measureTargetText(e, t) {
  3923. if (!t.length)
  3924. return 0;
  3925. var {
  3926. parent: r
  3927. } = this, i = r.getStyle("font-family").getDefinition();
  3928. if (i) {
  3929. for (var n = this.getFontSize(), o = i.isRTL ? t.split("").reverse().join("") : t, s = ne(r.getAttribute("dx").getString()), u = o.length, l = 0, h = 0; h < u; h++) {
  3930. var f = this.getGlyph(i, o, h);
  3931. l += (f.horizAdvX || i.horizAdvX) * n / i.fontFace.unitsPerEm, typeof s[h] != "undefined" && !isNaN(s[h]) && (l += s[h]);
  3932. }
  3933. return l;
  3934. }
  3935. if (!e.measureText)
  3936. return t.length * 10;
  3937. e.save(), this.setContext(e, !0);
  3938. var {
  3939. width: c
  3940. } = e.measureText(t);
  3941. return this.clearContext(e), e.restore(), c;
  3942. }
  3943. /**
  3944. * Inherits positional attributes from {@link TextElement} parent(s). Attributes
  3945. * are only inherited from a parent to its first child.
  3946. * @param name - The attribute name.
  3947. * @returns The attribute value or null.
  3948. */
  3949. getInheritedAttribute(e) {
  3950. for (var t = this; t instanceof we && t.isFirstChild(); ) {
  3951. var r = t.parent.getAttribute(e);
  3952. if (r.hasValue(!0))
  3953. return r.getValue("0");
  3954. t = t.parent;
  3955. }
  3956. return null;
  3957. }
  3958. }
  3959. class Br extends we {
  3960. constructor(e, t, r) {
  3961. super(e, t, new.target === Br ? !0 : r), this.type = "tspan", this.text = this.children.length > 0 ? "" : this.getTextFromNode();
  3962. }
  3963. getText() {
  3964. return this.text;
  3965. }
  3966. }
  3967. class V1 extends Br {
  3968. constructor() {
  3969. super(...arguments), this.type = "textNode";
  3970. }
  3971. }
  3972. class Nt extends Ge {
  3973. constructor() {
  3974. super(...arguments), this.type = "svg", this.root = !1;
  3975. }
  3976. setContext(e) {
  3977. var t, {
  3978. document: r
  3979. } = this, {
  3980. screen: i,
  3981. window: n
  3982. } = r, o = e.canvas;
  3983. if (i.setDefaults(e), o.style && typeof e.font != "undefined" && n && typeof n.getComputedStyle != "undefined") {
  3984. e.font = n.getComputedStyle(o).getPropertyValue("font");
  3985. var s = new S(r, "fontSize", Z.parse(e.font).fontSize);
  3986. s.hasValue() && (r.rootEmSize = s.getPixels("y"), r.emSize = r.rootEmSize);
  3987. }
  3988. this.getAttribute("x").hasValue() || this.getAttribute("x", !0).setValue(0), this.getAttribute("y").hasValue() || this.getAttribute("y", !0).setValue(0);
  3989. var {
  3990. width: u,
  3991. height: l
  3992. } = i.viewPort;
  3993. 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");
  3994. var h = this.getAttribute("refX"), f = this.getAttribute("refY"), c = this.getAttribute("viewBox"), v = c.hasValue() ? ne(c.getString()) : null, g = !this.root && this.getStyle("overflow").getValue("hidden") !== "visible", d = 0, p = 0, y = 0, T = 0;
  3995. v && (d = v[0], p = v[1]), this.root || (u = this.getStyle("width").getPixels("x"), l = this.getStyle("height").getPixels("y"), this.type === "marker" && (y = d, T = p, d = 0, p = 0)), i.viewPort.setCurrent(u, l), this.node && (!this.parent || ((t = this.node.parentNode) === null || t === void 0 ? void 0 : t.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(e), e.translate(this.getAttribute("x").getPixels("x"), this.getAttribute("y").getPixels("y")), v && (u = v[2], l = v[3]), r.setViewBox({
  3996. ctx: e,
  3997. aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
  3998. width: i.viewPort.width,
  3999. desiredWidth: u,
  4000. height: i.viewPort.height,
  4001. desiredHeight: l,
  4002. minX: d,
  4003. minY: p,
  4004. refX: h.getValue(),
  4005. refY: f.getValue(),
  4006. clip: g,
  4007. clipX: y,
  4008. clipY: T
  4009. }), v && (i.viewPort.removeCurrent(), i.viewPort.setCurrent(u, l));
  4010. }
  4011. clearContext(e) {
  4012. super.clearContext(e), this.document.screen.viewPort.removeCurrent();
  4013. }
  4014. /**
  4015. * Resize SVG to fit in given size.
  4016. * @param width
  4017. * @param height
  4018. * @param preserveAspectRatio
  4019. */
  4020. resize(e) {
  4021. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, i = this.getAttribute("width", !0), n = this.getAttribute("height", !0), o = this.getAttribute("viewBox"), s = this.getAttribute("style"), u = i.getNumber(0), l = n.getNumber(0);
  4022. if (r)
  4023. if (typeof r == "string")
  4024. this.getAttribute("preserveAspectRatio", !0).setValue(r);
  4025. else {
  4026. var h = this.getAttribute("preserveAspectRatio");
  4027. h.hasValue() && h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/, "$1"));
  4028. }
  4029. if (i.setValue(e), n.setValue(t), o.hasValue() || o.setValue("0 0 ".concat(u || e, " ").concat(l || t)), s.hasValue()) {
  4030. var f = this.getStyle("width"), c = this.getStyle("height");
  4031. f.hasValue() && f.setValue("".concat(e, "px")), c.hasValue() && c.setValue("".concat(t, "px"));
  4032. }
  4033. }
  4034. }
  4035. class Sl extends A {
  4036. constructor() {
  4037. super(...arguments), this.type = "rect";
  4038. }
  4039. path(e) {
  4040. var t = this.getAttribute("x").getPixels("x"), r = this.getAttribute("y").getPixels("y"), i = this.getStyle("width", !1, !0).getPixels("x"), n = this.getStyle("height", !1, !0).getPixels("y"), o = this.getAttribute("rx"), s = this.getAttribute("ry"), u = o.getPixels("x"), l = s.getPixels("y");
  4041. if (o.hasValue() && !s.hasValue() && (l = u), s.hasValue() && !o.hasValue() && (u = l), u = Math.min(u, i / 2), l = Math.min(l, n / 2), e) {
  4042. var h = 4 * ((Math.sqrt(2) - 1) / 3);
  4043. e.beginPath(), n > 0 && i > 0 && (e.moveTo(t + u, r), e.lineTo(t + i - u, r), e.bezierCurveTo(t + i - u + h * u, r, t + i, r + l - h * l, t + i, r + l), e.lineTo(t + i, r + n - l), e.bezierCurveTo(t + i, r + n - l + h * l, t + i - u + h * u, r + n, t + i - u, r + n), e.lineTo(t + u, r + n), e.bezierCurveTo(t + u - h * u, r + n, t, r + n - l + h * l, t, r + n - l), e.lineTo(t, r + l), e.bezierCurveTo(t, r + l - h * l, t + u - h * u, r, t + u, r), e.closePath());
  4044. }
  4045. return new ce(t, r, t + i, r + n);
  4046. }
  4047. getMarkers() {
  4048. return null;
  4049. }
  4050. }
  4051. class D1 extends A {
  4052. constructor() {
  4053. super(...arguments), this.type = "circle";
  4054. }
  4055. path(e) {
  4056. var t = this.getAttribute("cx").getPixels("x"), r = this.getAttribute("cy").getPixels("y"), i = this.getAttribute("r").getPixels();
  4057. return e && i > 0 && (e.beginPath(), e.arc(t, r, i, 0, Math.PI * 2, !1), e.closePath()), new ce(t - i, r - i, t + i, r + i);
  4058. }
  4059. getMarkers() {
  4060. return null;
  4061. }
  4062. }
  4063. class L1 extends A {
  4064. constructor() {
  4065. super(...arguments), this.type = "ellipse";
  4066. }
  4067. path(e) {
  4068. var t = 4 * ((Math.sqrt(2) - 1) / 3), r = this.getAttribute("rx").getPixels("x"), i = this.getAttribute("ry").getPixels("y"), n = this.getAttribute("cx").getPixels("x"), o = this.getAttribute("cy").getPixels("y");
  4069. return e && r > 0 && i > 0 && (e.beginPath(), e.moveTo(n + r, o), e.bezierCurveTo(n + r, o + t * i, n + t * r, o + i, n, o + i), e.bezierCurveTo(n - t * r, o + i, n - r, o + t * i, n - r, o), e.bezierCurveTo(n - r, o - t * i, n - t * r, o - i, n, o - i), e.bezierCurveTo(n + t * r, o - i, n + r, o - t * i, n + r, o), e.closePath()), new ce(n - r, o - i, n + r, o + i);
  4070. }
  4071. getMarkers() {
  4072. return null;
  4073. }
  4074. }
  4075. class k1 extends A {
  4076. constructor() {
  4077. super(...arguments), this.type = "line";
  4078. }
  4079. getPoints() {
  4080. return [new B(this.getAttribute("x1").getPixels("x"), this.getAttribute("y1").getPixels("y")), new B(this.getAttribute("x2").getPixels("x"), this.getAttribute("y2").getPixels("y"))];
  4081. }
  4082. path(e) {
  4083. var [{
  4084. x: t,
  4085. y: r
  4086. }, {
  4087. x: i,
  4088. y: n
  4089. }] = this.getPoints();
  4090. return e && (e.beginPath(), e.moveTo(t, r), e.lineTo(i, n)), new ce(t, r, i, n);
  4091. }
  4092. getMarkers() {
  4093. var [e, t] = this.getPoints(), r = e.angleTo(t);
  4094. return [[e, r], [t, r]];
  4095. }
  4096. }
  4097. class El extends A {
  4098. constructor(e, t, r) {
  4099. super(e, t, r), this.type = "polyline", this.points = [], this.points = B.parsePath(this.getAttribute("points").getString());
  4100. }
  4101. path(e) {
  4102. var {
  4103. points: t
  4104. } = this, [{
  4105. x: r,
  4106. y: i
  4107. }] = t, n = new ce(r, i);
  4108. return e && (e.beginPath(), e.moveTo(r, i)), t.forEach((o) => {
  4109. var {
  4110. x: s,
  4111. y: u
  4112. } = o;
  4113. n.addPoint(s, u), e && e.lineTo(s, u);
  4114. }), n;
  4115. }
  4116. getMarkers() {
  4117. var {
  4118. points: e
  4119. } = this, t = e.length - 1, r = [];
  4120. return e.forEach((i, n) => {
  4121. n !== t && r.push([i, i.angleTo(e[n + 1])]);
  4122. }), r.length > 0 && r.push([e[e.length - 1], r[r.length - 1][1]]), r;
  4123. }
  4124. }
  4125. class B1 extends El {
  4126. constructor() {
  4127. super(...arguments), this.type = "polygon";
  4128. }
  4129. path(e) {
  4130. var t = super.path(e), [{
  4131. x: r,
  4132. y: i
  4133. }] = this.points;
  4134. return e && (e.lineTo(r, i), e.closePath()), t;
  4135. }
  4136. }
  4137. class j1 extends I {
  4138. constructor() {
  4139. super(...arguments), this.type = "pattern";
  4140. }
  4141. createPattern(e, t, r) {
  4142. var i = this.getStyle("width").getPixels("x", !0), n = this.getStyle("height").getPixels("y", !0), o = new Nt(this.document, null);
  4143. o.attributes.viewBox = new S(this.document, "viewBox", this.getAttribute("viewBox").getValue()), o.attributes.width = new S(this.document, "width", "".concat(i, "px")), o.attributes.height = new S(this.document, "height", "".concat(n, "px")), o.attributes.transform = new S(this.document, "transform", this.getAttribute("patternTransform").getValue()), o.children = this.children;
  4144. var s = this.document.createCanvas(i, n), u = s.getContext("2d"), l = this.getAttribute("x"), h = this.getAttribute("y");
  4145. l.hasValue() && h.hasValue() && u.translate(l.getPixels("x", !0), h.getPixels("y", !0)), r.hasValue() ? this.styles["fill-opacity"] = r : Reflect.deleteProperty(this.styles, "fill-opacity");
  4146. for (var f = -1; f <= 1; f++)
  4147. for (var c = -1; c <= 1; c++)
  4148. u.save(), o.attributes.x = new S(this.document, "x", f * s.width), o.attributes.y = new S(this.document, "y", c * s.height), o.render(u), u.restore();
  4149. var v = e.createPattern(s, "repeat");
  4150. return v;
  4151. }
  4152. }
  4153. class F1 extends I {
  4154. constructor() {
  4155. super(...arguments), this.type = "marker";
  4156. }
  4157. render(e, t, r) {
  4158. if (t) {
  4159. var {
  4160. x: i,
  4161. y: n
  4162. } = t, o = this.getAttribute("orient").getString("auto"), s = this.getAttribute("markerUnits").getString("strokeWidth");
  4163. e.translate(i, n), o === "auto" && e.rotate(r), s === "strokeWidth" && e.scale(e.lineWidth, e.lineWidth), e.save();
  4164. var u = new Nt(this.document, null);
  4165. u.type = this.type, u.attributes.viewBox = new S(this.document, "viewBox", this.getAttribute("viewBox").getValue()), u.attributes.refX = new S(this.document, "refX", this.getAttribute("refX").getValue()), u.attributes.refY = new S(this.document, "refY", this.getAttribute("refY").getValue()), u.attributes.width = new S(this.document, "width", this.getAttribute("markerWidth").getValue()), u.attributes.height = new S(this.document, "height", this.getAttribute("markerHeight").getValue()), u.attributes.overflow = new S(this.document, "overflow", this.getAttribute("overflow").getValue()), u.attributes.fill = new S(this.document, "fill", this.getAttribute("fill").getColor("black")), u.attributes.stroke = new S(this.document, "stroke", this.getAttribute("stroke").getValue("none")), u.children = this.children, u.render(e), e.restore(), s === "strokeWidth" && e.scale(1 / e.lineWidth, 1 / e.lineWidth), o === "auto" && e.rotate(-r), e.translate(-i, -n);
  4166. }
  4167. }
  4168. }
  4169. class U1 extends I {
  4170. constructor() {
  4171. super(...arguments), this.type = "defs";
  4172. }
  4173. render() {
  4174. }
  4175. }
  4176. class an extends Ge {
  4177. constructor() {
  4178. super(...arguments), this.type = "g";
  4179. }
  4180. getBoundingBox(e) {
  4181. var t = new ce();
  4182. return this.children.forEach((r) => {
  4183. t.addBoundingBox(r.getBoundingBox(e));
  4184. }), t;
  4185. }
  4186. }
  4187. class $l extends I {
  4188. constructor(e, t, r) {
  4189. super(e, t, r), this.attributesToInherit = ["gradientUnits"], this.stops = [];
  4190. var {
  4191. stops: i,
  4192. children: n
  4193. } = this;
  4194. n.forEach((o) => {
  4195. o.type === "stop" && i.push(o);
  4196. });
  4197. }
  4198. getGradientUnits() {
  4199. return this.getAttribute("gradientUnits").getString("objectBoundingBox");
  4200. }
  4201. createGradient(e, t, r) {
  4202. var i = this;
  4203. this.getHrefAttribute().hasValue() && (i = this.getHrefAttribute().getDefinition(), this.inheritStopContainer(i));
  4204. var {
  4205. stops: n
  4206. } = i, o = this.getGradient(e, t);
  4207. if (!o)
  4208. return this.addParentOpacity(r, n[n.length - 1].color);
  4209. if (n.forEach((p) => {
  4210. o.addColorStop(p.offset, this.addParentOpacity(r, p.color));
  4211. }), this.getAttribute("gradientTransform").hasValue()) {
  4212. var {
  4213. document: s
  4214. } = this, {
  4215. MAX_VIRTUAL_PIXELS: u,
  4216. viewPort: l
  4217. } = s.screen, [h] = l.viewPorts, f = new Sl(s, null);
  4218. f.attributes.x = new S(s, "x", -u / 3), f.attributes.y = new S(s, "y", -u / 3), f.attributes.width = new S(s, "width", u), f.attributes.height = new S(s, "height", u);
  4219. var c = new an(s, null);
  4220. c.attributes.transform = new S(s, "transform", this.getAttribute("gradientTransform").getValue()), c.children = [f];
  4221. var v = new Nt(s, null);
  4222. v.attributes.x = new S(s, "x", 0), v.attributes.y = new S(s, "y", 0), v.attributes.width = new S(s, "width", h.width), v.attributes.height = new S(s, "height", h.height), v.children = [c];
  4223. var g = s.createCanvas(h.width, h.height), d = g.getContext("2d");
  4224. return d.fillStyle = o, v.render(d), d.createPattern(g, "no-repeat");
  4225. }
  4226. return o;
  4227. }
  4228. inheritStopContainer(e) {
  4229. this.attributesToInherit.forEach((t) => {
  4230. !this.getAttribute(t).hasValue() && e.getAttribute(t).hasValue() && this.getAttribute(t, !0).setValue(e.getAttribute(t).getValue());
  4231. });
  4232. }
  4233. addParentOpacity(e, t) {
  4234. if (e.hasValue()) {
  4235. var r = new S(this.document, "color", t);
  4236. return r.addOpacity(e).getColor();
  4237. }
  4238. return t;
  4239. }
  4240. }
  4241. class G1 extends $l {
  4242. constructor(e, t, r) {
  4243. super(e, t, r), this.type = "linearGradient", this.attributesToInherit.push("x1", "y1", "x2", "y2");
  4244. }
  4245. getGradient(e, t) {
  4246. var r = this.getGradientUnits() === "objectBoundingBox", i = r ? t.getBoundingBox(e) : null;
  4247. if (r && !i)
  4248. return null;
  4249. !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));
  4250. var n = r ? i.x + i.width * this.getAttribute("x1").getNumber() : this.getAttribute("x1").getPixels("x"), o = r ? i.y + i.height * this.getAttribute("y1").getNumber() : this.getAttribute("y1").getPixels("y"), s = r ? i.x + i.width * this.getAttribute("x2").getNumber() : this.getAttribute("x2").getPixels("x"), u = r ? i.y + i.height * this.getAttribute("y2").getNumber() : this.getAttribute("y2").getPixels("y");
  4251. return n === s && o === u ? null : e.createLinearGradient(n, o, s, u);
  4252. }
  4253. }
  4254. class z1 extends $l {
  4255. constructor(e, t, r) {
  4256. super(e, t, r), this.type = "radialGradient", this.attributesToInherit.push("cx", "cy", "r", "fx", "fy", "fr");
  4257. }
  4258. getGradient(e, t) {
  4259. var r = this.getGradientUnits() === "objectBoundingBox", i = t.getBoundingBox(e);
  4260. if (r && !i)
  4261. return null;
  4262. 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%");
  4263. var n = r ? i.x + i.width * this.getAttribute("cx").getNumber() : this.getAttribute("cx").getPixels("x"), o = r ? i.y + i.height * this.getAttribute("cy").getNumber() : this.getAttribute("cy").getPixels("y"), s = n, u = o;
  4264. this.getAttribute("fx").hasValue() && (s = r ? i.x + i.width * this.getAttribute("fx").getNumber() : this.getAttribute("fx").getPixels("x")), this.getAttribute("fy").hasValue() && (u = r ? i.y + i.height * this.getAttribute("fy").getNumber() : this.getAttribute("fy").getPixels("y"));
  4265. var l = r ? (i.width + i.height) / 2 * this.getAttribute("r").getNumber() : this.getAttribute("r").getPixels(), h = this.getAttribute("fr").getPixels();
  4266. return e.createRadialGradient(s, u, h, n, o, l);
  4267. }
  4268. }
  4269. class H1 extends I {
  4270. constructor(e, t, r) {
  4271. super(e, t, r), this.type = "stop";
  4272. var i = Math.max(0, Math.min(1, this.getAttribute("offset").getNumber())), n = this.getStyle("stop-opacity"), o = this.getStyle("stop-color", !0);
  4273. o.getString() === "" && o.setValue("#000"), n.hasValue() && (o = o.addOpacity(n)), this.offset = i, this.color = o.getColor();
  4274. }
  4275. }
  4276. class nn extends I {
  4277. constructor(e, t, r) {
  4278. super(e, t, r), this.type = "animate", this.duration = 0, this.initialValue = null, this.initialUnits = "", this.removed = !1, this.frozen = !1, e.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 S(e, "values", null);
  4279. var i = this.getAttribute("values");
  4280. i.hasValue() && this.values.setValue(i.getString().split(";"));
  4281. }
  4282. getProperty() {
  4283. var e = this.getAttribute("attributeType").getString(), t = this.getAttribute("attributeName").getString();
  4284. return e === "CSS" ? this.parent.getStyle(t, !0) : this.parent.getAttribute(t, !0);
  4285. }
  4286. calcValue() {
  4287. var {
  4288. initialUnits: e
  4289. } = this, {
  4290. progress: t,
  4291. from: r,
  4292. to: i
  4293. } = this.getProgress(), n = r.getNumber() + (i.getNumber() - r.getNumber()) * t;
  4294. return e === "%" && (n *= 100), "".concat(n).concat(e);
  4295. }
  4296. update(e) {
  4297. var {
  4298. parent: t
  4299. } = this, r = this.getProperty();
  4300. if (this.initialValue || (this.initialValue = r.getString(), this.initialUnits = r.getUnits()), this.duration > this.maxDuration) {
  4301. var i = this.getAttribute("fill").getString("remove");
  4302. if (this.getAttribute("repeatCount").getString() === "indefinite" || this.getAttribute("repeatDur").getString() === "indefinite")
  4303. this.duration = 0;
  4304. else if (i === "freeze" && !this.frozen)
  4305. this.frozen = !0, t.animationFrozen = !0, t.animationFrozenValue = r.getString();
  4306. else if (i === "remove" && !this.removed)
  4307. return this.removed = !0, r.setValue(t.animationFrozen ? t.animationFrozenValue : this.initialValue), !0;
  4308. return !1;
  4309. }
  4310. this.duration += e;
  4311. var n = !1;
  4312. if (this.begin < this.duration) {
  4313. var o = this.calcValue(), s = this.getAttribute("type");
  4314. if (s.hasValue()) {
  4315. var u = s.getString();
  4316. o = "".concat(u, "(").concat(o, ")");
  4317. }
  4318. r.setValue(o), n = !0;
  4319. }
  4320. return n;
  4321. }
  4322. getProgress() {
  4323. var {
  4324. document: e,
  4325. values: t
  4326. } = this, r = {
  4327. progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
  4328. };
  4329. if (t.hasValue()) {
  4330. var i = r.progress * (t.getValue().length - 1), n = Math.floor(i), o = Math.ceil(i);
  4331. r.from = new S(e, "from", parseFloat(t.getValue()[n])), r.to = new S(e, "to", parseFloat(t.getValue()[o])), r.progress = (i - n) / (o - n);
  4332. } else
  4333. r.from = this.from, r.to = this.to;
  4334. return r;
  4335. }
  4336. }
  4337. class Y1 extends nn {
  4338. constructor() {
  4339. super(...arguments), this.type = "animateColor";
  4340. }
  4341. calcValue() {
  4342. var {
  4343. progress: e,
  4344. from: t,
  4345. to: r
  4346. } = this.getProgress(), i = new yi(t.getColor()), n = new yi(r.getColor());
  4347. if (i.ok && n.ok) {
  4348. var o = i.r + (n.r - i.r) * e, s = i.g + (n.g - i.g) * e, u = i.b + (n.b - i.b) * e;
  4349. return "rgb(".concat(Math.floor(o), ", ").concat(Math.floor(s), ", ").concat(Math.floor(u), ")");
  4350. }
  4351. return this.getAttribute("from").getColor();
  4352. }
  4353. }
  4354. class X1 extends nn {
  4355. constructor() {
  4356. super(...arguments), this.type = "animateTransform";
  4357. }
  4358. calcValue() {
  4359. var {
  4360. progress: e,
  4361. from: t,
  4362. to: r
  4363. } = this.getProgress(), i = ne(t.getString()), n = ne(r.getString()), o = i.map((s, u) => {
  4364. var l = n[u];
  4365. return s + (l - s) * e;
  4366. }).join(" ");
  4367. return o;
  4368. }
  4369. }
  4370. class W1 extends I {
  4371. constructor(e, t, r) {
  4372. super(e, t, r), this.type = "font", this.glyphs = /* @__PURE__ */ Object.create(null), this.horizAdvX = this.getAttribute("horiz-adv-x").getNumber();
  4373. var {
  4374. definitions: i
  4375. } = e, {
  4376. children: n
  4377. } = this;
  4378. for (var o of n)
  4379. switch (o.type) {
  4380. case "font-face": {
  4381. this.fontFace = o;
  4382. var s = o.getStyle("font-family");
  4383. s.hasValue() && (i[s.getString()] = this);
  4384. break;
  4385. }
  4386. case "missing-glyph":
  4387. this.missingGlyph = o;
  4388. break;
  4389. case "glyph": {
  4390. var u = o;
  4391. u.arabicForm ? (this.isRTL = !0, this.isArabic = !0, typeof this.glyphs[u.unicode] == "undefined" && (this.glyphs[u.unicode] = /* @__PURE__ */ Object.create(null)), this.glyphs[u.unicode][u.arabicForm] = u) : this.glyphs[u.unicode] = u;
  4392. break;
  4393. }
  4394. }
  4395. }
  4396. render() {
  4397. }
  4398. }
  4399. class q1 extends I {
  4400. constructor(e, t, r) {
  4401. super(e, t, 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();
  4402. }
  4403. }
  4404. class Q1 extends A {
  4405. constructor() {
  4406. super(...arguments), this.type = "missing-glyph", this.horizAdvX = 0;
  4407. }
  4408. }
  4409. class K1 extends we {
  4410. constructor() {
  4411. super(...arguments), this.type = "tref";
  4412. }
  4413. getText() {
  4414. var e = this.getHrefAttribute().getDefinition();
  4415. if (e) {
  4416. var t = e.children[0];
  4417. if (t)
  4418. return t.getText();
  4419. }
  4420. return "";
  4421. }
  4422. }
  4423. class Z1 extends we {
  4424. constructor(e, t, r) {
  4425. super(e, t, r), this.type = "a";
  4426. var {
  4427. childNodes: i
  4428. } = t, n = i[0], o = i.length > 0 && Array.from(i).every((s) => s.nodeType === 3);
  4429. this.hasText = o, this.text = o ? this.getTextFromNode(n) : "";
  4430. }
  4431. getText() {
  4432. return this.text;
  4433. }
  4434. renderChildren(e) {
  4435. if (this.hasText) {
  4436. super.renderChildren(e);
  4437. var {
  4438. document: t,
  4439. x: r,
  4440. y: i
  4441. } = this, {
  4442. mouse: n
  4443. } = t.screen, o = new S(t, "fontSize", Z.parse(t.ctx.font).fontSize);
  4444. n.isWorking() && n.checkBoundingBox(this, new ce(r, i - o.getPixels("y"), r + this.measureText(e), i));
  4445. } else if (this.children.length > 0) {
  4446. var s = new an(this.document, null);
  4447. s.children = this.children, s.parent = this, s.render(e);
  4448. }
  4449. }
  4450. onClick() {
  4451. var {
  4452. window: e
  4453. } = this.document;
  4454. e && e.open(this.getHrefAttribute().getString());
  4455. }
  4456. onMouseMove() {
  4457. var e = this.document.ctx;
  4458. e.canvas.style.cursor = "pointer";
  4459. }
  4460. }
  4461. function No(a, e) {
  4462. var t = Object.keys(a);
  4463. if (Object.getOwnPropertySymbols) {
  4464. var r = Object.getOwnPropertySymbols(a);
  4465. e && (r = r.filter(function(i) {
  4466. return Object.getOwnPropertyDescriptor(a, i).enumerable;
  4467. })), t.push.apply(t, r);
  4468. }
  4469. return t;
  4470. }
  4471. function ir(a) {
  4472. for (var e = 1; e < arguments.length; e++) {
  4473. var t = arguments[e] != null ? arguments[e] : {};
  4474. e % 2 ? No(Object(t), !0).forEach(function(r) {
  4475. Oi(a, r, t[r]);
  4476. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : No(Object(t)).forEach(function(r) {
  4477. Object.defineProperty(a, r, Object.getOwnPropertyDescriptor(t, r));
  4478. });
  4479. }
  4480. return a;
  4481. }
  4482. class J1 extends we {
  4483. constructor(e, t, r) {
  4484. super(e, t, r), this.type = "textPath", this.textWidth = 0, this.textHeight = 0, this.pathLength = -1, this.glyphInfo = null, this.letterSpacingCache = [], this.measuresCache = /* @__PURE__ */ new Map([["", 0]]);
  4485. var i = this.getHrefAttribute().getDefinition();
  4486. this.text = this.getTextFromNode(), this.dataArray = this.parsePathData(i);
  4487. }
  4488. getText() {
  4489. return this.text;
  4490. }
  4491. path(e) {
  4492. var {
  4493. dataArray: t
  4494. } = this;
  4495. e && e.beginPath(), t.forEach((r) => {
  4496. var {
  4497. type: i,
  4498. points: n
  4499. } = r;
  4500. switch (i) {
  4501. case w.LINE_TO:
  4502. e && e.lineTo(n[0], n[1]);
  4503. break;
  4504. case w.MOVE_TO:
  4505. e && e.moveTo(n[0], n[1]);
  4506. break;
  4507. case w.CURVE_TO:
  4508. e && e.bezierCurveTo(n[0], n[1], n[2], n[3], n[4], n[5]);
  4509. break;
  4510. case w.QUAD_TO:
  4511. e && e.quadraticCurveTo(n[0], n[1], n[2], n[3]);
  4512. break;
  4513. case w.ARC: {
  4514. var [o, s, u, l, h, f, c, v] = n, g = u > l ? u : l, d = u > l ? 1 : u / l, p = u > l ? l / u : 1;
  4515. e && (e.translate(o, s), e.rotate(c), e.scale(d, p), e.arc(0, 0, g, h, h + f, !!(1 - v)), e.scale(1 / d, 1 / p), e.rotate(-c), e.translate(-o, -s));
  4516. break;
  4517. }
  4518. case w.CLOSE_PATH:
  4519. e && e.closePath();
  4520. break;
  4521. }
  4522. });
  4523. }
  4524. renderChildren(e) {
  4525. this.setTextData(e), e.save();
  4526. var t = this.parent.getStyle("text-decoration").getString(), r = this.getFontSize(), {
  4527. glyphInfo: i
  4528. } = this, n = e.fillStyle;
  4529. t === "underline" && e.beginPath(), i.forEach((o, s) => {
  4530. var {
  4531. p0: u,
  4532. p1: l,
  4533. rotation: h,
  4534. text: f
  4535. } = o;
  4536. e.save(), e.translate(u.x, u.y), e.rotate(h), e.fillStyle && e.fillText(f, 0, 0), e.strokeStyle && e.strokeText(f, 0, 0), e.restore(), t === "underline" && (s === 0 && e.moveTo(u.x, u.y + r / 8), e.lineTo(l.x, l.y + r / 5));
  4537. }), t === "underline" && (e.lineWidth = r / 20, e.strokeStyle = n, e.stroke(), e.closePath()), e.restore();
  4538. }
  4539. getLetterSpacingAt() {
  4540. var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
  4541. return this.letterSpacingCache[e] || 0;
  4542. }
  4543. findSegmentToFitChar(e, t, r, i, n, o, s, u, l) {
  4544. var h = o, f = this.measureText(e, u);
  4545. u === " " && t === "justify" && r < i && (f += (i - r) / n), l > -1 && (h += this.getLetterSpacingAt(l));
  4546. var c = this.textHeight / 20, v = this.getEquidistantPointOnPath(h, c, 0), g = this.getEquidistantPointOnPath(h + f, c, 0), d = {
  4547. p0: v,
  4548. p1: g
  4549. }, p = v && g ? Math.atan2(g.y - v.y, g.x - v.x) : 0;
  4550. if (s) {
  4551. var y = Math.cos(Math.PI / 2 + p) * s, T = Math.cos(-p) * s;
  4552. d.p0 = ir(ir({}, v), {}, {
  4553. x: v.x + y,
  4554. y: v.y + T
  4555. }), d.p1 = ir(ir({}, g), {}, {
  4556. x: g.x + y,
  4557. y: g.y + T
  4558. });
  4559. }
  4560. return h += f, {
  4561. offset: h,
  4562. segment: d,
  4563. rotation: p
  4564. };
  4565. }
  4566. measureText(e, t) {
  4567. var {
  4568. measuresCache: r
  4569. } = this, i = t || this.getText();
  4570. if (r.has(i))
  4571. return r.get(i);
  4572. var n = this.measureTargetText(e, i);
  4573. return r.set(i, n), n;
  4574. }
  4575. // This method supposes what all custom fonts already loaded.
  4576. // If some font will be loaded after this method call, <textPath> will not be rendered correctly.
  4577. // You need to call this method manually to update glyphs cache.
  4578. setTextData(e) {
  4579. if (!this.glyphInfo) {
  4580. var t = this.getText(), r = t.split(""), i = t.split(" ").length - 1, n = this.parent.getAttribute("dx").split().map((x) => x.getPixels("x")), o = this.parent.getAttribute("dy").getPixels("y"), s = this.parent.getStyle("text-anchor").getString("start"), u = this.getStyle("letter-spacing"), l = this.parent.getStyle("letter-spacing"), h = 0;
  4581. !u.hasValue() || u.getValue() === "inherit" ? h = l.getPixels() : u.hasValue() && u.getValue() !== "initial" && u.getValue() !== "unset" && (h = u.getPixels());
  4582. var f = [], c = t.length;
  4583. this.letterSpacingCache = f;
  4584. for (var v = 0; v < c; v++)
  4585. f.push(typeof n[v] != "undefined" ? n[v] : h);
  4586. var g = f.reduce((x, $, E) => E === 0 ? 0 : x + $ || 0, 0), d = this.measureText(e), p = Math.max(d + g, 0);
  4587. this.textWidth = d, this.textHeight = this.getFontSize(), this.glyphInfo = [];
  4588. var y = this.getPathLength(), T = this.getStyle("startOffset").getNumber(0) * y, b = 0;
  4589. (s === "middle" || s === "center") && (b = -p / 2), (s === "end" || s === "right") && (b = -p), b += T, r.forEach((x, $) => {
  4590. var {
  4591. offset: E,
  4592. segment: O,
  4593. rotation: C
  4594. } = this.findSegmentToFitChar(e, s, p, y, i, b, o, x, $);
  4595. b = E, !(!O.p0 || !O.p1) && this.glyphInfo.push({
  4596. // transposeX: midpoint.x,
  4597. // transposeY: midpoint.y,
  4598. text: r[$],
  4599. p0: O.p0,
  4600. p1: O.p1,
  4601. rotation: C
  4602. });
  4603. });
  4604. }
  4605. }
  4606. parsePathData(e) {
  4607. if (this.pathLength = -1, !e)
  4608. return [];
  4609. var t = [], {
  4610. pathParser: r
  4611. } = e;
  4612. for (r.reset(); !r.isEnd(); ) {
  4613. var {
  4614. current: i
  4615. } = r, n = i ? i.x : 0, o = i ? i.y : 0, s = r.next(), u = s.type, l = [];
  4616. switch (s.type) {
  4617. case w.MOVE_TO:
  4618. this.pathM(r, l);
  4619. break;
  4620. case w.LINE_TO:
  4621. u = this.pathL(r, l);
  4622. break;
  4623. case w.HORIZ_LINE_TO:
  4624. u = this.pathH(r, l);
  4625. break;
  4626. case w.VERT_LINE_TO:
  4627. u = this.pathV(r, l);
  4628. break;
  4629. case w.CURVE_TO:
  4630. this.pathC(r, l);
  4631. break;
  4632. case w.SMOOTH_CURVE_TO:
  4633. u = this.pathS(r, l);
  4634. break;
  4635. case w.QUAD_TO:
  4636. this.pathQ(r, l);
  4637. break;
  4638. case w.SMOOTH_QUAD_TO:
  4639. u = this.pathT(r, l);
  4640. break;
  4641. case w.ARC:
  4642. l = this.pathA(r);
  4643. break;
  4644. case w.CLOSE_PATH:
  4645. A.pathZ(r);
  4646. break;
  4647. }
  4648. s.type !== w.CLOSE_PATH ? t.push({
  4649. type: u,
  4650. points: l,
  4651. start: {
  4652. x: n,
  4653. y: o
  4654. },
  4655. pathLength: this.calcLength(n, o, u, l)
  4656. }) : t.push({
  4657. type: w.CLOSE_PATH,
  4658. points: [],
  4659. pathLength: 0
  4660. });
  4661. }
  4662. return t;
  4663. }
  4664. pathM(e, t) {
  4665. var {
  4666. x: r,
  4667. y: i
  4668. } = A.pathM(e).point;
  4669. t.push(r, i);
  4670. }
  4671. pathL(e, t) {
  4672. var {
  4673. x: r,
  4674. y: i
  4675. } = A.pathL(e).point;
  4676. return t.push(r, i), w.LINE_TO;
  4677. }
  4678. pathH(e, t) {
  4679. var {
  4680. x: r,
  4681. y: i
  4682. } = A.pathH(e).point;
  4683. return t.push(r, i), w.LINE_TO;
  4684. }
  4685. pathV(e, t) {
  4686. var {
  4687. x: r,
  4688. y: i
  4689. } = A.pathV(e).point;
  4690. return t.push(r, i), w.LINE_TO;
  4691. }
  4692. pathC(e, t) {
  4693. var {
  4694. point: r,
  4695. controlPoint: i,
  4696. currentPoint: n
  4697. } = A.pathC(e);
  4698. t.push(r.x, r.y, i.x, i.y, n.x, n.y);
  4699. }
  4700. pathS(e, t) {
  4701. var {
  4702. point: r,
  4703. controlPoint: i,
  4704. currentPoint: n
  4705. } = A.pathS(e);
  4706. return t.push(r.x, r.y, i.x, i.y, n.x, n.y), w.CURVE_TO;
  4707. }
  4708. pathQ(e, t) {
  4709. var {
  4710. controlPoint: r,
  4711. currentPoint: i
  4712. } = A.pathQ(e);
  4713. t.push(r.x, r.y, i.x, i.y);
  4714. }
  4715. pathT(e, t) {
  4716. var {
  4717. controlPoint: r,
  4718. currentPoint: i
  4719. } = A.pathT(e);
  4720. return t.push(r.x, r.y, i.x, i.y), w.QUAD_TO;
  4721. }
  4722. pathA(e) {
  4723. var {
  4724. rX: t,
  4725. rY: r,
  4726. sweepFlag: i,
  4727. xAxisRotation: n,
  4728. centp: o,
  4729. a1: s,
  4730. ad: u
  4731. } = A.pathA(e);
  4732. return i === 0 && u > 0 && (u -= 2 * Math.PI), i === 1 && u < 0 && (u += 2 * Math.PI), [o.x, o.y, t, r, s, u, n, i];
  4733. }
  4734. calcLength(e, t, r, i) {
  4735. var n = 0, o = null, s = null, u = 0;
  4736. switch (r) {
  4737. case w.LINE_TO:
  4738. return this.getLineLength(e, t, i[0], i[1]);
  4739. case w.CURVE_TO:
  4740. for (n = 0, o = this.getPointOnCubicBezier(0, e, t, i[0], i[1], i[2], i[3], i[4], i[5]), u = 0.01; u <= 1; u += 0.01)
  4741. s = this.getPointOnCubicBezier(u, e, t, i[0], i[1], i[2], i[3], i[4], i[5]), n += this.getLineLength(o.x, o.y, s.x, s.y), o = s;
  4742. return n;
  4743. case w.QUAD_TO:
  4744. for (n = 0, o = this.getPointOnQuadraticBezier(0, e, t, i[0], i[1], i[2], i[3]), u = 0.01; u <= 1; u += 0.01)
  4745. s = this.getPointOnQuadraticBezier(u, e, t, i[0], i[1], i[2], i[3]), n += this.getLineLength(o.x, o.y, s.x, s.y), o = s;
  4746. return n;
  4747. case w.ARC: {
  4748. n = 0;
  4749. var l = i[4], h = i[5], f = i[4] + h, c = Math.PI / 180;
  4750. if (Math.abs(l - f) < c && (c = Math.abs(l - f)), o = this.getPointOnEllipticalArc(i[0], i[1], i[2], i[3], l, 0), h < 0)
  4751. for (u = l - c; u > f; u -= c)
  4752. s = this.getPointOnEllipticalArc(i[0], i[1], i[2], i[3], u, 0), n += this.getLineLength(o.x, o.y, s.x, s.y), o = s;
  4753. else
  4754. for (u = l + c; u < f; u += c)
  4755. s = this.getPointOnEllipticalArc(i[0], i[1], i[2], i[3], u, 0), n += this.getLineLength(o.x, o.y, s.x, s.y), o = s;
  4756. return s = this.getPointOnEllipticalArc(i[0], i[1], i[2], i[3], f, 0), n += this.getLineLength(o.x, o.y, s.x, s.y), n;
  4757. }
  4758. }
  4759. return 0;
  4760. }
  4761. getPointOnLine(e, t, r, i, n) {
  4762. var o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : t, s = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : r, u = (n - r) / (i - t + at), l = Math.sqrt(e * e / (1 + u * u));
  4763. i < t && (l *= -1);
  4764. var h = u * l, f = null;
  4765. if (i === t)
  4766. f = {
  4767. x: o,
  4768. y: s + h
  4769. };
  4770. else if ((s - r) / (o - t + at) === u)
  4771. f = {
  4772. x: o + l,
  4773. y: s + h
  4774. };
  4775. else {
  4776. var c = 0, v = 0, g = this.getLineLength(t, r, i, n);
  4777. if (g < at)
  4778. return null;
  4779. var d = (o - t) * (i - t) + (s - r) * (n - r);
  4780. d /= g * g, c = t + d * (i - t), v = r + d * (n - r);
  4781. var p = this.getLineLength(o, s, c, v), y = Math.sqrt(e * e - p * p);
  4782. l = Math.sqrt(y * y / (1 + u * u)), i < t && (l *= -1), h = u * l, f = {
  4783. x: c + l,
  4784. y: v + h
  4785. };
  4786. }
  4787. return f;
  4788. }
  4789. getPointOnPath(e) {
  4790. var t = this.getPathLength(), r = 0, i = null;
  4791. if (e < -5e-5 || e - 5e-5 > t)
  4792. return null;
  4793. var {
  4794. dataArray: n
  4795. } = this;
  4796. for (var o of n) {
  4797. if (o && (o.pathLength < 5e-5 || r + o.pathLength + 5e-5 < e)) {
  4798. r += o.pathLength;
  4799. continue;
  4800. }
  4801. var s = e - r, u = 0;
  4802. switch (o.type) {
  4803. case w.LINE_TO:
  4804. i = this.getPointOnLine(s, o.start.x, o.start.y, o.points[0], o.points[1], o.start.x, o.start.y);
  4805. break;
  4806. case w.ARC: {
  4807. var l = o.points[4], h = o.points[5], f = o.points[4] + h;
  4808. if (u = l + s / o.pathLength * h, h < 0 && u < f || h >= 0 && u > f)
  4809. break;
  4810. i = this.getPointOnEllipticalArc(o.points[0], o.points[1], o.points[2], o.points[3], u, o.points[6]);
  4811. break;
  4812. }
  4813. case w.CURVE_TO:
  4814. u = s / o.pathLength, u > 1 && (u = 1), i = 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]);
  4815. break;
  4816. case w.QUAD_TO:
  4817. u = s / o.pathLength, u > 1 && (u = 1), i = this.getPointOnQuadraticBezier(u, o.start.x, o.start.y, o.points[0], o.points[1], o.points[2], o.points[3]);
  4818. break;
  4819. }
  4820. if (i)
  4821. return i;
  4822. break;
  4823. }
  4824. return null;
  4825. }
  4826. getLineLength(e, t, r, i) {
  4827. return Math.sqrt((r - e) * (r - e) + (i - t) * (i - t));
  4828. }
  4829. getPathLength() {
  4830. return this.pathLength === -1 && (this.pathLength = this.dataArray.reduce((e, t) => t.pathLength > 0 ? e + t.pathLength : e, 0)), this.pathLength;
  4831. }
  4832. getPointOnCubicBezier(e, t, r, i, n, o, s, u, l) {
  4833. var h = u * Eo(e) + o * $o(e) + i * wo(e) + t * Co(e), f = l * Eo(e) + s * $o(e) + n * wo(e) + r * Co(e);
  4834. return {
  4835. x: h,
  4836. y: f
  4837. };
  4838. }
  4839. getPointOnQuadraticBezier(e, t, r, i, n, o, s) {
  4840. var u = o * Ao(e) + i * Po(e) + t * Ro(e), l = s * Ao(e) + n * Po(e) + r * Ro(e);
  4841. return {
  4842. x: u,
  4843. y: l
  4844. };
  4845. }
  4846. getPointOnEllipticalArc(e, t, r, i, n, o) {
  4847. var s = Math.cos(o), u = Math.sin(o), l = {
  4848. x: r * Math.cos(n),
  4849. y: i * Math.sin(n)
  4850. };
  4851. return {
  4852. x: e + (l.x * s - l.y * u),
  4853. y: t + (l.x * u + l.y * s)
  4854. };
  4855. }
  4856. // TODO need some optimisations. possibly build cache only for curved segments?
  4857. buildEquidistantCache(e, t) {
  4858. var r = this.getPathLength(), i = t || 0.25, n = e || r / 100;
  4859. if (!this.equidistantCache || this.equidistantCache.step !== n || this.equidistantCache.precision !== i) {
  4860. this.equidistantCache = {
  4861. step: n,
  4862. precision: i,
  4863. points: []
  4864. };
  4865. for (var o = 0, s = 0; s <= r; s += i) {
  4866. var u = this.getPointOnPath(s), l = this.getPointOnPath(s + i);
  4867. !u || !l || (o += this.getLineLength(u.x, u.y, l.x, l.y), o >= n && (this.equidistantCache.points.push({
  4868. x: u.x,
  4869. y: u.y,
  4870. distance: s
  4871. }), o -= n));
  4872. }
  4873. }
  4874. }
  4875. getEquidistantPointOnPath(e, t, r) {
  4876. if (this.buildEquidistantCache(t, r), e < 0 || e - this.getPathLength() > 5e-5)
  4877. return null;
  4878. var i = Math.round(e / this.getPathLength() * (this.equidistantCache.points.length - 1));
  4879. return this.equidistantCache.points[i] || null;
  4880. }
  4881. }
  4882. var e2 = /^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;
  4883. class t2 extends Ge {
  4884. constructor(e, t, r) {
  4885. super(e, t, r), this.type = "image", this.loaded = !1;
  4886. var i = this.getHrefAttribute().getString();
  4887. if (i) {
  4888. var n = i.endsWith(".svg") || /^\s*data:image\/svg\+xml/i.test(i);
  4889. e.images.push(this), n ? this.loadSvg(i) : this.loadImage(i), this.isSvg = n;
  4890. }
  4891. }
  4892. loadImage(e) {
  4893. var t = this;
  4894. return xe(function* () {
  4895. try {
  4896. var r = yield t.document.createImage(e);
  4897. t.image = r;
  4898. } catch (i) {
  4899. console.error('Error while loading image "'.concat(e, '":'), i);
  4900. }
  4901. t.loaded = !0;
  4902. })();
  4903. }
  4904. loadSvg(e) {
  4905. var t = this;
  4906. return xe(function* () {
  4907. var r = e2.exec(e);
  4908. if (r) {
  4909. var i = r[5];
  4910. r[4] === "base64" ? t.image = atob(i) : t.image = decodeURIComponent(i);
  4911. } else
  4912. try {
  4913. var n = yield t.document.fetch(e), o = yield n.text();
  4914. t.image = o;
  4915. } catch (s) {
  4916. console.error('Error while loading image "'.concat(e, '":'), s);
  4917. }
  4918. t.loaded = !0;
  4919. })();
  4920. }
  4921. renderChildren(e) {
  4922. var {
  4923. document: t,
  4924. image: r,
  4925. loaded: i
  4926. } = this, n = this.getAttribute("x").getPixels("x"), o = this.getAttribute("y").getPixels("y"), s = this.getStyle("width").getPixels("x"), u = this.getStyle("height").getPixels("y");
  4927. if (!(!i || !r || !s || !u)) {
  4928. if (e.save(), e.translate(n, o), this.isSvg) {
  4929. var l = t.canvg.forkString(e, this.image, {
  4930. ignoreMouse: !0,
  4931. ignoreAnimation: !0,
  4932. ignoreDimensions: !0,
  4933. ignoreClear: !0,
  4934. offsetX: 0,
  4935. offsetY: 0,
  4936. scaleWidth: s,
  4937. scaleHeight: u
  4938. });
  4939. l.document.documentElement.parent = this, l.render();
  4940. } else {
  4941. var h = this.image;
  4942. t.setViewBox({
  4943. ctx: e,
  4944. aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
  4945. width: s,
  4946. desiredWidth: h.width,
  4947. height: u,
  4948. desiredHeight: h.height
  4949. }), this.loaded && (typeof h.complete == "undefined" || h.complete) && e.drawImage(h, 0, 0);
  4950. }
  4951. e.restore();
  4952. }
  4953. }
  4954. getBoundingBox() {
  4955. var e = this.getAttribute("x").getPixels("x"), t = this.getAttribute("y").getPixels("y"), r = this.getStyle("width").getPixels("x"), i = this.getStyle("height").getPixels("y");
  4956. return new ce(e, t, e + r, t + i);
  4957. }
  4958. }
  4959. class r2 extends Ge {
  4960. constructor() {
  4961. super(...arguments), this.type = "symbol";
  4962. }
  4963. render(e) {
  4964. }
  4965. }
  4966. class a2 {
  4967. constructor(e) {
  4968. this.document = e, this.loaded = !1, e.fonts.push(this);
  4969. }
  4970. load(e, t) {
  4971. var r = this;
  4972. return xe(function* () {
  4973. try {
  4974. var {
  4975. document: i
  4976. } = r, n = yield i.canvg.parser.load(t), o = n.getElementsByTagName("font");
  4977. Array.from(o).forEach((s) => {
  4978. var u = i.createElement(s);
  4979. i.definitions[e] = u;
  4980. });
  4981. } catch (s) {
  4982. console.error('Error while loading font "'.concat(t, '":'), s);
  4983. }
  4984. r.loaded = !0;
  4985. })();
  4986. }
  4987. }
  4988. class wl extends I {
  4989. constructor(e, t, r) {
  4990. super(e, t, r), this.type = "style";
  4991. var i = ht(
  4992. Array.from(t.childNodes).map((o) => o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, "").replace(/@import.*;/g, "")
  4993. // remove imports
  4994. ), n = i.split("}");
  4995. n.forEach((o) => {
  4996. var s = o.trim();
  4997. if (s) {
  4998. var u = s.split("{"), l = u[0].split(","), h = u[1].split(";");
  4999. l.forEach((f) => {
  5000. var c = f.trim();
  5001. if (c) {
  5002. var v = e.styles[c] || {};
  5003. if (h.forEach((p) => {
  5004. var y = p.indexOf(":"), T = p.substr(0, y).trim(), b = p.substr(y + 1, p.length - y).trim();
  5005. T && b && (v[T] = new S(e, T, b));
  5006. }), e.styles[c] = v, e.stylesSpecificity[c] = m1(c), c === "@font-face") {
  5007. var g = v["font-family"].getString().replace(/"|'/g, ""), d = v.src.getString().split(",");
  5008. d.forEach((p) => {
  5009. if (p.indexOf('format("svg")') > 0) {
  5010. var y = yl(p);
  5011. y && new a2(e).load(g, y);
  5012. }
  5013. });
  5014. }
  5015. }
  5016. });
  5017. }
  5018. });
  5019. }
  5020. }
  5021. wl.parseExternalUrl = yl;
  5022. class i2 extends Ge {
  5023. constructor() {
  5024. super(...arguments), this.type = "use";
  5025. }
  5026. setContext(e) {
  5027. super.setContext(e);
  5028. var t = this.getAttribute("x"), r = this.getAttribute("y");
  5029. t.hasValue() && e.translate(t.getPixels("x"), 0), r.hasValue() && e.translate(0, r.getPixels("y"));
  5030. }
  5031. path(e) {
  5032. var {
  5033. element: t
  5034. } = this;
  5035. t && t.path(e);
  5036. }
  5037. renderChildren(e) {
  5038. var {
  5039. document: t,
  5040. element: r
  5041. } = this;
  5042. if (r) {
  5043. var i = r;
  5044. if (r.type === "symbol" && (i = new Nt(t, null), i.attributes.viewBox = new S(t, "viewBox", r.getAttribute("viewBox").getString()), i.attributes.preserveAspectRatio = new S(t, "preserveAspectRatio", r.getAttribute("preserveAspectRatio").getString()), i.attributes.overflow = new S(t, "overflow", r.getAttribute("overflow").getString()), i.children = r.children, r.styles.opacity = new S(t, "opacity", this.calculateOpacity())), i.type === "svg") {
  5045. var n = this.getStyle("width", !1, !0), o = this.getStyle("height", !1, !0);
  5046. n.hasValue() && (i.attributes.width = new S(t, "width", n.getString())), o.hasValue() && (i.attributes.height = new S(t, "height", o.getString()));
  5047. }
  5048. var s = i.parent;
  5049. i.parent = this, i.render(e), i.parent = s;
  5050. }
  5051. }
  5052. getBoundingBox(e) {
  5053. var {
  5054. element: t
  5055. } = this;
  5056. return t ? t.getBoundingBox(e) : null;
  5057. }
  5058. elementTransform() {
  5059. var {
  5060. document: e,
  5061. element: t
  5062. } = this;
  5063. return je.fromElement(e, t);
  5064. }
  5065. get element() {
  5066. return this.cachedElement || (this.cachedElement = this.getHrefAttribute().getDefinition()), this.cachedElement;
  5067. }
  5068. }
  5069. function nr(a, e, t, r, i, n) {
  5070. return a[t * r * 4 + e * 4 + n];
  5071. }
  5072. function sr(a, e, t, r, i, n, o) {
  5073. a[t * r * 4 + e * 4 + n] = o;
  5074. }
  5075. function F(a, e, t) {
  5076. var r = a[e];
  5077. return r * t;
  5078. }
  5079. function me(a, e, t, r) {
  5080. return e + Math.cos(a) * t + Math.sin(a) * r;
  5081. }
  5082. class Cl extends I {
  5083. constructor(e, t, r) {
  5084. super(e, t, r), this.type = "feColorMatrix";
  5085. var i = ne(this.getAttribute("values").getString());
  5086. switch (this.getAttribute("type").getString("matrix")) {
  5087. case "saturate": {
  5088. var n = i[0];
  5089. i = [0.213 + 0.787 * n, 0.715 - 0.715 * n, 0.072 - 0.072 * n, 0, 0, 0.213 - 0.213 * n, 0.715 + 0.285 * n, 0.072 - 0.072 * n, 0, 0, 0.213 - 0.213 * n, 0.715 - 0.715 * n, 0.072 + 0.928 * n, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
  5090. break;
  5091. }
  5092. case "hueRotate": {
  5093. var o = i[0] * Math.PI / 180;
  5094. i = [me(o, 0.213, 0.787, -0.213), me(o, 0.715, -0.715, -0.715), me(o, 0.072, -0.072, 0.928), 0, 0, me(o, 0.213, -0.213, 0.143), me(o, 0.715, 0.285, 0.14), me(o, 0.072, -0.072, -0.283), 0, 0, me(o, 0.213, -0.213, -0.787), me(o, 0.715, -0.715, 0.715), me(o, 0.072, 0.928, 0.072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
  5095. break;
  5096. }
  5097. case "luminanceToAlpha":
  5098. i = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0, 0, 0, 0, 0, 1];
  5099. break;
  5100. }
  5101. this.matrix = i, this.includeOpacity = this.getAttribute("includeOpacity").hasValue();
  5102. }
  5103. apply(e, t, r, i, n) {
  5104. for (var {
  5105. includeOpacity: o,
  5106. matrix: s
  5107. } = this, u = e.getImageData(0, 0, i, n), l = 0; l < n; l++)
  5108. for (var h = 0; h < i; h++) {
  5109. var f = nr(u.data, h, l, i, n, 0), c = nr(u.data, h, l, i, n, 1), v = nr(u.data, h, l, i, n, 2), g = nr(u.data, h, l, i, n, 3), d = F(s, 0, f) + F(s, 1, c) + F(s, 2, v) + F(s, 3, g) + F(s, 4, 1), p = F(s, 5, f) + F(s, 6, c) + F(s, 7, v) + F(s, 8, g) + F(s, 9, 1), y = F(s, 10, f) + F(s, 11, c) + F(s, 12, v) + F(s, 13, g) + F(s, 14, 1), T = F(s, 15, f) + F(s, 16, c) + F(s, 17, v) + F(s, 18, g) + F(s, 19, 1);
  5110. o && (d = 0, p = 0, y = 0, T *= g / 255), sr(u.data, h, l, i, n, 0, d), sr(u.data, h, l, i, n, 1, p), sr(u.data, h, l, i, n, 2, y), sr(u.data, h, l, i, n, 3, T);
  5111. }
  5112. e.clearRect(0, 0, i, n), e.putImageData(u, 0, 0);
  5113. }
  5114. }
  5115. class jr extends I {
  5116. constructor() {
  5117. super(...arguments), this.type = "mask";
  5118. }
  5119. apply(e, t) {
  5120. var {
  5121. document: r
  5122. } = this, i = this.getAttribute("x").getPixels("x"), n = this.getAttribute("y").getPixels("y"), o = this.getStyle("width").getPixels("x"), s = this.getStyle("height").getPixels("y");
  5123. if (!o && !s) {
  5124. var u = new ce();
  5125. this.children.forEach((g) => {
  5126. u.addBoundingBox(g.getBoundingBox(e));
  5127. }), i = Math.floor(u.x1), n = Math.floor(u.y1), o = Math.floor(u.width), s = Math.floor(u.height);
  5128. }
  5129. var l = this.removeStyles(t, jr.ignoreStyles), h = r.createCanvas(i + o, n + s), f = h.getContext("2d");
  5130. r.screen.setDefaults(f), this.renderChildren(f), new Cl(r, {
  5131. nodeType: 1,
  5132. childNodes: [],
  5133. attributes: [{
  5134. nodeName: "type",
  5135. value: "luminanceToAlpha"
  5136. }, {
  5137. nodeName: "includeOpacity",
  5138. value: "true"
  5139. }]
  5140. }).apply(f, 0, 0, i + o, n + s);
  5141. var c = r.createCanvas(i + o, n + s), v = c.getContext("2d");
  5142. r.screen.setDefaults(v), t.render(v), v.globalCompositeOperation = "destination-in", v.fillStyle = f.createPattern(h, "no-repeat"), v.fillRect(0, 0, i + o, n + s), e.fillStyle = v.createPattern(c, "no-repeat"), e.fillRect(0, 0, i + o, n + s), this.restoreStyles(t, l);
  5143. }
  5144. render(e) {
  5145. }
  5146. }
  5147. jr.ignoreStyles = ["mask", "transform", "clip-path"];
  5148. var Io = () => {
  5149. };
  5150. class n2 extends I {
  5151. constructor() {
  5152. super(...arguments), this.type = "clipPath";
  5153. }
  5154. apply(e) {
  5155. var {
  5156. document: t
  5157. } = this, r = Reflect.getPrototypeOf(e), {
  5158. beginPath: i,
  5159. closePath: n
  5160. } = e;
  5161. r && (r.beginPath = Io, r.closePath = Io), Reflect.apply(i, e, []), this.children.forEach((o) => {
  5162. if (typeof o.path != "undefined") {
  5163. var s = typeof o.elementTransform != "undefined" ? o.elementTransform() : null;
  5164. s || (s = je.fromElement(t, o)), s && s.apply(e), o.path(e), r && (r.closePath = n), s && s.unapply(e);
  5165. }
  5166. }), Reflect.apply(n, e, []), e.clip(), r && (r.beginPath = i, r.closePath = n);
  5167. }
  5168. render(e) {
  5169. }
  5170. }
  5171. class Fr extends I {
  5172. constructor() {
  5173. super(...arguments), this.type = "filter";
  5174. }
  5175. apply(e, t) {
  5176. var {
  5177. document: r,
  5178. children: i
  5179. } = this, n = t.getBoundingBox(e);
  5180. if (n) {
  5181. var o = 0, s = 0;
  5182. i.forEach((y) => {
  5183. var T = y.extraFilterDistance || 0;
  5184. o = Math.max(o, T), s = Math.max(s, T);
  5185. });
  5186. var u = Math.floor(n.width), l = Math.floor(n.height), h = u + 2 * o, f = l + 2 * s;
  5187. if (!(h < 1 || f < 1)) {
  5188. var c = Math.floor(n.x), v = Math.floor(n.y), g = this.removeStyles(t, Fr.ignoreStyles), d = r.createCanvas(h, f), p = d.getContext("2d");
  5189. r.screen.setDefaults(p), p.translate(-c + o, -v + s), t.render(p), i.forEach((y) => {
  5190. typeof y.apply == "function" && y.apply(p, 0, 0, h, f);
  5191. }), e.drawImage(d, 0, 0, h, f, c - o, v - s, h, f), this.restoreStyles(t, g);
  5192. }
  5193. }
  5194. }
  5195. render(e) {
  5196. }
  5197. }
  5198. Fr.ignoreStyles = ["filter", "transform", "clip-path"];
  5199. class s2 extends I {
  5200. constructor(e, t, r) {
  5201. super(e, t, r), this.type = "feDropShadow", this.addStylesFromStyleDefinition();
  5202. }
  5203. apply(e, t, r, i, n) {
  5204. }
  5205. }
  5206. class o2 extends I {
  5207. constructor() {
  5208. super(...arguments), this.type = "feMorphology";
  5209. }
  5210. apply(e, t, r, i, n) {
  5211. }
  5212. }
  5213. class u2 extends I {
  5214. constructor() {
  5215. super(...arguments), this.type = "feComposite";
  5216. }
  5217. apply(e, t, r, i, n) {
  5218. }
  5219. }
  5220. class l2 extends I {
  5221. constructor(e, t, r) {
  5222. super(e, t, r), this.type = "feGaussianBlur", this.blurRadius = Math.floor(this.getAttribute("stdDeviation").getNumber()), this.extraFilterDistance = this.blurRadius;
  5223. }
  5224. apply(e, t, r, i, n) {
  5225. var {
  5226. document: o,
  5227. blurRadius: s
  5228. } = this, u = o.window ? o.window.document.body : null, l = e.canvas;
  5229. l.id = o.getUniqueId(), u && (l.style.display = "none", u.appendChild(l)), r1(l, t, r, i, n, s), u && u.removeChild(l);
  5230. }
  5231. }
  5232. class h2 extends I {
  5233. constructor() {
  5234. super(...arguments), this.type = "title";
  5235. }
  5236. }
  5237. class v2 extends I {
  5238. constructor() {
  5239. super(...arguments), this.type = "desc";
  5240. }
  5241. }
  5242. var f2 = {
  5243. svg: Nt,
  5244. rect: Sl,
  5245. circle: D1,
  5246. ellipse: L1,
  5247. line: k1,
  5248. polyline: El,
  5249. polygon: B1,
  5250. path: A,
  5251. pattern: j1,
  5252. marker: F1,
  5253. defs: U1,
  5254. linearGradient: G1,
  5255. radialGradient: z1,
  5256. stop: H1,
  5257. animate: nn,
  5258. animateColor: Y1,
  5259. animateTransform: X1,
  5260. font: W1,
  5261. "font-face": q1,
  5262. "missing-glyph": Q1,
  5263. glyph: Ol,
  5264. text: we,
  5265. tspan: Br,
  5266. tref: K1,
  5267. a: Z1,
  5268. textPath: J1,
  5269. image: t2,
  5270. g: an,
  5271. symbol: r2,
  5272. style: wl,
  5273. use: i2,
  5274. mask: jr,
  5275. clipPath: n2,
  5276. filter: Fr,
  5277. feDropShadow: s2,
  5278. feMorphology: o2,
  5279. feComposite: u2,
  5280. feColorMatrix: Cl,
  5281. feGaussianBlur: l2,
  5282. title: h2,
  5283. desc: v2
  5284. };
  5285. function Mo(a, e) {
  5286. var t = Object.keys(a);
  5287. if (Object.getOwnPropertySymbols) {
  5288. var r = Object.getOwnPropertySymbols(a);
  5289. e && (r = r.filter(function(i) {
  5290. return Object.getOwnPropertyDescriptor(a, i).enumerable;
  5291. })), t.push.apply(t, r);
  5292. }
  5293. return t;
  5294. }
  5295. function c2(a) {
  5296. for (var e = 1; e < arguments.length; e++) {
  5297. var t = arguments[e] != null ? arguments[e] : {};
  5298. e % 2 ? Mo(Object(t), !0).forEach(function(r) {
  5299. Oi(a, r, t[r]);
  5300. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : Mo(Object(t)).forEach(function(r) {
  5301. Object.defineProperty(a, r, Object.getOwnPropertyDescriptor(t, r));
  5302. });
  5303. }
  5304. return a;
  5305. }
  5306. function g2(a, e) {
  5307. var t = document.createElement("canvas");
  5308. return t.width = a, t.height = e, t;
  5309. }
  5310. function d2(a) {
  5311. return Ti.apply(this, arguments);
  5312. }
  5313. function Ti() {
  5314. return Ti = xe(function* (a) {
  5315. var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, t = document.createElement("img");
  5316. return e && (t.crossOrigin = "Anonymous"), new Promise((r, i) => {
  5317. t.onload = () => {
  5318. r(t);
  5319. }, t.onerror = (n, o, s, u, l) => {
  5320. i(l);
  5321. }, t.src = a;
  5322. });
  5323. }), Ti.apply(this, arguments);
  5324. }
  5325. class Ee {
  5326. constructor(e) {
  5327. var {
  5328. rootEmSize: t = 12,
  5329. emSize: r = 12,
  5330. createCanvas: i = Ee.createCanvas,
  5331. createImage: n = Ee.createImage,
  5332. anonymousCrossOrigin: o
  5333. } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  5334. this.canvg = e, this.definitions = /* @__PURE__ */ Object.create(null), this.styles = /* @__PURE__ */ Object.create(null), this.stylesSpecificity = /* @__PURE__ */ Object.create(null), this.images = [], this.fonts = [], this.emSizeStack = [], this.uniqueId = 0, this.screen = e.screen, this.rootEmSize = t, this.emSize = r, this.createCanvas = i, this.createImage = this.bindCreateImage(n, o), this.screen.wait(this.isImagesLoaded.bind(this)), this.screen.wait(this.isFontsLoaded.bind(this));
  5335. }
  5336. bindCreateImage(e, t) {
  5337. return typeof t == "boolean" ? (r, i) => e(r, typeof i == "boolean" ? i : t) : e;
  5338. }
  5339. get window() {
  5340. return this.screen.window;
  5341. }
  5342. get fetch() {
  5343. return this.screen.fetch;
  5344. }
  5345. get ctx() {
  5346. return this.screen.ctx;
  5347. }
  5348. get emSize() {
  5349. var {
  5350. emSizeStack: e
  5351. } = this;
  5352. return e[e.length - 1];
  5353. }
  5354. set emSize(e) {
  5355. var {
  5356. emSizeStack: t
  5357. } = this;
  5358. t.push(e);
  5359. }
  5360. popEmSize() {
  5361. var {
  5362. emSizeStack: e
  5363. } = this;
  5364. e.pop();
  5365. }
  5366. getUniqueId() {
  5367. return "canvg".concat(++this.uniqueId);
  5368. }
  5369. isImagesLoaded() {
  5370. return this.images.every((e) => e.loaded);
  5371. }
  5372. isFontsLoaded() {
  5373. return this.fonts.every((e) => e.loaded);
  5374. }
  5375. createDocumentElement(e) {
  5376. var t = this.createElement(e.documentElement);
  5377. return t.root = !0, t.addStylesFromStyleDefinition(), this.documentElement = t, t;
  5378. }
  5379. createElement(e) {
  5380. var t = e.nodeName.replace(/^[^:]+:/, ""), r = Ee.elementTypes[t];
  5381. return typeof r != "undefined" ? new r(this, e) : new R1(this, e);
  5382. }
  5383. createTextNode(e) {
  5384. return new V1(this, e);
  5385. }
  5386. setViewBox(e) {
  5387. this.screen.setViewBox(c2({
  5388. document: this
  5389. }, e));
  5390. }
  5391. }
  5392. Ee.createCanvas = g2;
  5393. Ee.createImage = d2;
  5394. Ee.elementTypes = f2;
  5395. function _o(a, e) {
  5396. var t = Object.keys(a);
  5397. if (Object.getOwnPropertySymbols) {
  5398. var r = Object.getOwnPropertySymbols(a);
  5399. e && (r = r.filter(function(i) {
  5400. return Object.getOwnPropertyDescriptor(a, i).enumerable;
  5401. })), t.push.apply(t, r);
  5402. }
  5403. return t;
  5404. }
  5405. function Le(a) {
  5406. for (var e = 1; e < arguments.length; e++) {
  5407. var t = arguments[e] != null ? arguments[e] : {};
  5408. e % 2 ? _o(Object(t), !0).forEach(function(r) {
  5409. Oi(a, r, t[r]);
  5410. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : _o(Object(t)).forEach(function(r) {
  5411. Object.defineProperty(a, r, Object.getOwnPropertyDescriptor(t, r));
  5412. });
  5413. }
  5414. return a;
  5415. }
  5416. class bt {
  5417. /**
  5418. * Main constructor.
  5419. * @param ctx - Rendering context.
  5420. * @param svg - SVG Document.
  5421. * @param options - Rendering options.
  5422. */
  5423. constructor(e, t) {
  5424. var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  5425. this.parser = new Ya(r), this.screen = new kr(e, r), this.options = r;
  5426. var i = new Ee(this, r), n = i.createDocumentElement(t);
  5427. this.document = i, this.documentElement = n;
  5428. }
  5429. /**
  5430. * Create Canvg instance from SVG source string or URL.
  5431. * @param ctx - Rendering context.
  5432. * @param svg - SVG source string or URL.
  5433. * @param options - Rendering options.
  5434. * @returns Canvg instance.
  5435. */
  5436. static from(e, t) {
  5437. var r = arguments;
  5438. return xe(function* () {
  5439. var i = r.length > 2 && r[2] !== void 0 ? r[2] : {}, n = new Ya(i), o = yield n.parse(t);
  5440. return new bt(e, o, i);
  5441. })();
  5442. }
  5443. /**
  5444. * Create Canvg instance from SVG source string.
  5445. * @param ctx - Rendering context.
  5446. * @param svg - SVG source string.
  5447. * @param options - Rendering options.
  5448. * @returns Canvg instance.
  5449. */
  5450. static fromString(e, t) {
  5451. var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = new Ya(r), n = i.parseFromString(t);
  5452. return new bt(e, n, r);
  5453. }
  5454. /**
  5455. * Create new Canvg instance with inherited options.
  5456. * @param ctx - Rendering context.
  5457. * @param svg - SVG source string or URL.
  5458. * @param options - Rendering options.
  5459. * @returns Canvg instance.
  5460. */
  5461. fork(e, t) {
  5462. var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  5463. return bt.from(e, t, Le(Le({}, this.options), r));
  5464. }
  5465. /**
  5466. * Create new Canvg instance with inherited options.
  5467. * @param ctx - Rendering context.
  5468. * @param svg - SVG source string.
  5469. * @param options - Rendering options.
  5470. * @returns Canvg instance.
  5471. */
  5472. forkString(e, t) {
  5473. var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  5474. return bt.fromString(e, t, Le(Le({}, this.options), r));
  5475. }
  5476. /**
  5477. * Document is ready promise.
  5478. * @returns Ready promise.
  5479. */
  5480. ready() {
  5481. return this.screen.ready();
  5482. }
  5483. /**
  5484. * Document is ready value.
  5485. * @returns Is ready or not.
  5486. */
  5487. isReady() {
  5488. return this.screen.isReady();
  5489. }
  5490. /**
  5491. * Render only first frame, ignoring animations and mouse.
  5492. * @param options - Rendering options.
  5493. */
  5494. render() {
  5495. var e = arguments, t = this;
  5496. return xe(function* () {
  5497. var r = e.length > 0 && e[0] !== void 0 ? e[0] : {};
  5498. t.start(Le({
  5499. enableRedraw: !0,
  5500. ignoreAnimation: !0,
  5501. ignoreMouse: !0
  5502. }, r)), yield t.ready(), t.stop();
  5503. })();
  5504. }
  5505. /**
  5506. * Start rendering.
  5507. * @param options - Render options.
  5508. */
  5509. start() {
  5510. var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, {
  5511. documentElement: t,
  5512. screen: r,
  5513. options: i
  5514. } = this;
  5515. r.start(t, Le(Le({
  5516. enableRedraw: !0
  5517. }, i), e));
  5518. }
  5519. /**
  5520. * Stop rendering.
  5521. */
  5522. stop() {
  5523. this.screen.stop();
  5524. }
  5525. /**
  5526. * Resize SVG to fit in given size.
  5527. * @param width
  5528. * @param height
  5529. * @param preserveAspectRatio
  5530. */
  5531. resize(e) {
  5532. var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
  5533. this.documentElement.resize(e, t, r);
  5534. }
  5535. }
  5536. export {
  5537. Z1 as AElement,
  5538. Y1 as AnimateColorElement,
  5539. nn as AnimateElement,
  5540. X1 as AnimateTransformElement,
  5541. ce as BoundingBox,
  5542. Eo as CB1,
  5543. $o as CB2,
  5544. wo as CB3,
  5545. Co as CB4,
  5546. bt as Canvg,
  5547. D1 as CircleElement,
  5548. n2 as ClipPathElement,
  5549. U1 as DefsElement,
  5550. v2 as DescElement,
  5551. Ee as Document,
  5552. I as Element,
  5553. L1 as EllipseElement,
  5554. Cl as FeColorMatrixElement,
  5555. u2 as FeCompositeElement,
  5556. s2 as FeDropShadowElement,
  5557. l2 as FeGaussianBlurElement,
  5558. o2 as FeMorphologyElement,
  5559. Fr as FilterElement,
  5560. Z as Font,
  5561. W1 as FontElement,
  5562. q1 as FontFaceElement,
  5563. an as GElement,
  5564. Ol as GlyphElement,
  5565. $l as GradientElement,
  5566. t2 as ImageElement,
  5567. k1 as LineElement,
  5568. G1 as LinearGradientElement,
  5569. F1 as MarkerElement,
  5570. jr as MaskElement,
  5571. xl as Matrix,
  5572. Q1 as MissingGlyphElement,
  5573. x1 as Mouse,
  5574. at as PSEUDO_ZERO,
  5575. Ya as Parser,
  5576. A as PathElement,
  5577. w as PathParser,
  5578. j1 as PatternElement,
  5579. B as Point,
  5580. B1 as PolygonElement,
  5581. El as PolylineElement,
  5582. S as Property,
  5583. Ao as QB1,
  5584. Po as QB2,
  5585. Ro as QB3,
  5586. z1 as RadialGradientElement,
  5587. Sl as RectElement,
  5588. Ge as RenderedElement,
  5589. E1 as Rotate,
  5590. Nt as SVGElement,
  5591. a2 as SVGFontLoader,
  5592. $1 as Scale,
  5593. kr as Screen,
  5594. Tl as Skew,
  5595. w1 as SkewX,
  5596. C1 as SkewY,
  5597. H1 as StopElement,
  5598. wl as StyleElement,
  5599. r2 as SymbolElement,
  5600. K1 as TRefElement,
  5601. Br as TSpanElement,
  5602. we as TextElement,
  5603. J1 as TextPathElement,
  5604. h2 as TitleElement,
  5605. je as Transform,
  5606. S1 as Translate,
  5607. R1 as UnknownElement,
  5608. i2 as UseElement,
  5609. b1 as ViewPort,
  5610. ht as compressSpaces,
  5611. bt as default,
  5612. m1 as getSelectorSpecificity,
  5613. l1 as normalizeAttributeName,
  5614. h1 as normalizeColor,
  5615. yl as parseExternalUrl,
  5616. y2 as presets,
  5617. ne as toNumbers,
  5618. s1 as trimLeft,
  5619. o1 as trimRight,
  5620. Oo as vectorMagnitude,
  5621. So as vectorsAngle,
  5622. xi as vectorsRatio
  5623. };