TXLivePusher-2.1.1.min.js 1.3 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092
  1. !(function (t, e) {
  2. 'object' == typeof exports && 'undefined' != typeof module
  3. ? (module.exports = e())
  4. : 'function' == typeof define && define.amd
  5. ? define(e)
  6. : ((t =
  7. 'undefined' != typeof globalThis
  8. ? globalThis
  9. : t || self).TXLivePusher = e());
  10. })(this, function () {
  11. 'use strict';
  12. function t(t, e) {
  13. return (
  14. e.forEach(function (e) {
  15. e &&
  16. 'string' != typeof e &&
  17. !Array.isArray(e) &&
  18. Object.keys(e).forEach(function (r) {
  19. if ('default' !== r && !(r in t)) {
  20. var n = Object.getOwnPropertyDescriptor(e, r);
  21. Object.defineProperty(
  22. t,
  23. r,
  24. n.get
  25. ? n
  26. : {
  27. enumerable: !0,
  28. get: function () {
  29. return e[r];
  30. },
  31. }
  32. );
  33. }
  34. });
  35. }),
  36. Object.freeze(t)
  37. );
  38. }
  39. var e =
  40. 'undefined' != typeof globalThis
  41. ? globalThis
  42. : 'undefined' != typeof window
  43. ? window
  44. : 'undefined' != typeof global
  45. ? global
  46. : 'undefined' != typeof self
  47. ? self
  48. : {};
  49. function r(t) {
  50. return t &&
  51. t.__esModule &&
  52. Object.prototype.hasOwnProperty.call(t, 'default')
  53. ? t.default
  54. : t;
  55. }
  56. function n(t) {
  57. if (t.__esModule) return t;
  58. var e = Object.defineProperty({}, '__esModule', { value: !0 });
  59. return (
  60. Object.keys(t).forEach(function (r) {
  61. var n = Object.getOwnPropertyDescriptor(t, r);
  62. Object.defineProperty(
  63. e,
  64. r,
  65. n.get
  66. ? n
  67. : {
  68. enumerable: !0,
  69. get: function () {
  70. return t[r];
  71. },
  72. }
  73. );
  74. }),
  75. e
  76. );
  77. }
  78. var i = function (t) {
  79. return t && t.Math == Math && t;
  80. },
  81. o =
  82. i('object' == typeof globalThis && globalThis) ||
  83. i('object' == typeof window && window) ||
  84. i('object' == typeof self && self) ||
  85. i('object' == typeof e && e) ||
  86. (function () {
  87. return this;
  88. })() ||
  89. Function('return this')(),
  90. s = function (t) {
  91. try {
  92. return !!t();
  93. } catch (t) {
  94. return !0;
  95. }
  96. },
  97. a = !s(function () {
  98. var t = function () {}.bind();
  99. return 'function' != typeof t || t.hasOwnProperty('prototype');
  100. }),
  101. u = a,
  102. c = Function.prototype,
  103. h = c.apply,
  104. l = c.call,
  105. d =
  106. ('object' == typeof Reflect && Reflect.apply) ||
  107. (u
  108. ? l.bind(h)
  109. : function () {
  110. return l.apply(h, arguments);
  111. }),
  112. f = a,
  113. p = Function.prototype,
  114. v = p.call,
  115. m = f && p.bind.bind(v, v),
  116. y = f
  117. ? m
  118. : function (t) {
  119. return function () {
  120. return v.apply(t, arguments);
  121. };
  122. },
  123. g = y,
  124. _ = g({}.toString),
  125. b = g(''.slice),
  126. T = function (t) {
  127. return b(_(t), 8, -1);
  128. },
  129. x = T,
  130. E = y,
  131. S = function (t) {
  132. if ('Function' === x(t)) return E(t);
  133. },
  134. w = 'object' == typeof document && document.all,
  135. R = { all: w, IS_HTMLDDA: void 0 === w && void 0 !== w },
  136. C = R.all,
  137. P = R.IS_HTMLDDA
  138. ? function (t) {
  139. return 'function' == typeof t || t === C;
  140. }
  141. : function (t) {
  142. return 'function' == typeof t;
  143. },
  144. A = {},
  145. O = !s(function () {
  146. return (
  147. 7 !=
  148. Object.defineProperty({}, 1, {
  149. get: function () {
  150. return 7;
  151. },
  152. })[1]
  153. );
  154. }),
  155. I = a,
  156. M = Function.prototype.call,
  157. D = I
  158. ? M.bind(M)
  159. : function () {
  160. return M.apply(M, arguments);
  161. },
  162. L = {},
  163. F = {}.propertyIsEnumerable,
  164. N = Object.getOwnPropertyDescriptor,
  165. k = N && !F.call({ 1: 2 }, 1);
  166. L.f = k
  167. ? function (t) {
  168. var e = N(this, t);
  169. return !!e && e.enumerable;
  170. }
  171. : F;
  172. var B,
  173. G,
  174. U = function (t, e) {
  175. return {
  176. enumerable: !(1 & t),
  177. configurable: !(2 & t),
  178. writable: !(4 & t),
  179. value: e,
  180. };
  181. },
  182. j = s,
  183. X = T,
  184. V = Object,
  185. H = S(''.split),
  186. W = j(function () {
  187. return !V('z').propertyIsEnumerable(0);
  188. })
  189. ? function (t) {
  190. return 'String' == X(t) ? H(t, '') : V(t);
  191. }
  192. : V,
  193. Y = function (t) {
  194. return null == t;
  195. },
  196. z = Y,
  197. Z = TypeError,
  198. J = function (t) {
  199. if (z(t)) throw Z("Can't call method on " + t);
  200. return t;
  201. },
  202. K = W,
  203. q = J,
  204. Q = function (t) {
  205. return K(q(t));
  206. },
  207. $ = P,
  208. tt = R.all,
  209. et = R.IS_HTMLDDA
  210. ? function (t) {
  211. return 'object' == typeof t ? null !== t : $(t) || t === tt;
  212. }
  213. : function (t) {
  214. return 'object' == typeof t ? null !== t : $(t);
  215. },
  216. rt = {},
  217. nt = rt,
  218. it = o,
  219. ot = P,
  220. st = function (t) {
  221. return ot(t) ? t : void 0;
  222. },
  223. at = function (t, e) {
  224. return arguments.length < 2
  225. ? st(nt[t]) || st(it[t])
  226. : (nt[t] && nt[t][e]) || (it[t] && it[t][e]);
  227. },
  228. ut = S({}.isPrototypeOf),
  229. ct = at('navigator', 'userAgent') || '',
  230. ht = o,
  231. lt = ct,
  232. dt = ht.process,
  233. ft = ht.Deno,
  234. pt = (dt && dt.versions) || (ft && ft.version),
  235. vt = pt && pt.v8;
  236. vt && (G = (B = vt.split('.'))[0] > 0 && B[0] < 4 ? 1 : +(B[0] + B[1])),
  237. !G &&
  238. lt &&
  239. (!(B = lt.match(/Edge\/(\d+)/)) || B[1] >= 74) &&
  240. (B = lt.match(/Chrome\/(\d+)/)) &&
  241. (G = +B[1]);
  242. var mt = G,
  243. yt = mt,
  244. gt = s,
  245. _t =
  246. !!Object.getOwnPropertySymbols &&
  247. !gt(function () {
  248. var t = Symbol();
  249. return (
  250. !String(t) ||
  251. !(Object(t) instanceof Symbol) ||
  252. (!Symbol.sham && yt && yt < 41)
  253. );
  254. }),
  255. bt = _t && !Symbol.sham && 'symbol' == typeof Symbol.iterator,
  256. Tt = at,
  257. xt = P,
  258. Et = ut,
  259. St = Object,
  260. wt = bt
  261. ? function (t) {
  262. return 'symbol' == typeof t;
  263. }
  264. : function (t) {
  265. var e = Tt('Symbol');
  266. return xt(e) && Et(e.prototype, St(t));
  267. },
  268. Rt = String,
  269. Ct = function (t) {
  270. try {
  271. return Rt(t);
  272. } catch (t) {
  273. return 'Object';
  274. }
  275. },
  276. Pt = P,
  277. At = Ct,
  278. Ot = TypeError,
  279. It = function (t) {
  280. if (Pt(t)) return t;
  281. throw Ot(At(t) + ' is not a function');
  282. },
  283. Mt = It,
  284. Dt = Y,
  285. Lt = function (t, e) {
  286. var r = t[e];
  287. return Dt(r) ? void 0 : Mt(r);
  288. },
  289. Ft = D,
  290. Nt = P,
  291. kt = et,
  292. Bt = TypeError,
  293. Gt = { exports: {} },
  294. Ut = o,
  295. jt = Object.defineProperty,
  296. Xt = function (t, e) {
  297. try {
  298. jt(Ut, t, { value: e, configurable: !0, writable: !0 });
  299. } catch (r) {
  300. Ut[t] = e;
  301. }
  302. return e;
  303. },
  304. Vt = '__core-js_shared__',
  305. Ht = o[Vt] || Xt(Vt, {}),
  306. Wt = Ht;
  307. (Gt.exports = function (t, e) {
  308. return Wt[t] || (Wt[t] = void 0 !== e ? e : {});
  309. })('versions', []).push({
  310. version: '3.26.0',
  311. mode: 'pure',
  312. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  313. license: 'https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE',
  314. source: 'https://github.com/zloirock/core-js',
  315. });
  316. var Yt = J,
  317. zt = Object,
  318. Zt = function (t) {
  319. return zt(Yt(t));
  320. },
  321. Jt = Zt,
  322. Kt = S({}.hasOwnProperty),
  323. qt =
  324. Object.hasOwn ||
  325. function (t, e) {
  326. return Kt(Jt(t), e);
  327. },
  328. Qt = S,
  329. $t = 0,
  330. te = Math.random(),
  331. ee = Qt((1).toString),
  332. re = function (t) {
  333. return 'Symbol(' + (void 0 === t ? '' : t) + ')_' + ee(++$t + te, 36);
  334. },
  335. ne = o,
  336. ie = Gt.exports,
  337. oe = qt,
  338. se = re,
  339. ae = _t,
  340. ue = bt,
  341. ce = ie('wks'),
  342. he = ne.Symbol,
  343. le = he && he.for,
  344. de = ue ? he : (he && he.withoutSetter) || se,
  345. fe = function (t) {
  346. if (!oe(ce, t) || (!ae && 'string' != typeof ce[t])) {
  347. var e = 'Symbol.' + t;
  348. ae && oe(he, t) ? (ce[t] = he[t]) : (ce[t] = ue && le ? le(e) : de(e));
  349. }
  350. return ce[t];
  351. },
  352. pe = D,
  353. ve = et,
  354. me = wt,
  355. ye = Lt,
  356. ge = function (t, e) {
  357. var r, n;
  358. if ('string' === e && Nt((r = t.toString)) && !kt((n = Ft(r, t))))
  359. return n;
  360. if (Nt((r = t.valueOf)) && !kt((n = Ft(r, t)))) return n;
  361. if ('string' !== e && Nt((r = t.toString)) && !kt((n = Ft(r, t))))
  362. return n;
  363. throw Bt("Can't convert object to primitive value");
  364. },
  365. _e = TypeError,
  366. be = fe('toPrimitive'),
  367. Te = function (t, e) {
  368. if (!ve(t) || me(t)) return t;
  369. var r,
  370. n = ye(t, be);
  371. if (n) {
  372. if (
  373. (void 0 === e && (e = 'default'), (r = pe(n, t, e)), !ve(r) || me(r))
  374. )
  375. return r;
  376. throw _e("Can't convert object to primitive value");
  377. }
  378. return void 0 === e && (e = 'number'), ge(t, e);
  379. },
  380. xe = wt,
  381. Ee = function (t) {
  382. var e = Te(t, 'string');
  383. return xe(e) ? e : e + '';
  384. },
  385. Se = et,
  386. we = o.document,
  387. Re = Se(we) && Se(we.createElement),
  388. Ce = function (t) {
  389. return Re ? we.createElement(t) : {};
  390. },
  391. Pe = Ce,
  392. Ae =
  393. !O &&
  394. !s(function () {
  395. return (
  396. 7 !=
  397. Object.defineProperty(Pe('div'), 'a', {
  398. get: function () {
  399. return 7;
  400. },
  401. }).a
  402. );
  403. }),
  404. Oe = O,
  405. Ie = D,
  406. Me = L,
  407. De = U,
  408. Le = Q,
  409. Fe = Ee,
  410. Ne = qt,
  411. ke = Ae,
  412. Be = Object.getOwnPropertyDescriptor;
  413. A.f = Oe
  414. ? Be
  415. : function (t, e) {
  416. if (((t = Le(t)), (e = Fe(e)), ke))
  417. try {
  418. return Be(t, e);
  419. } catch (t) {}
  420. if (Ne(t, e)) return De(!Ie(Me.f, t, e), t[e]);
  421. };
  422. var Ge = s,
  423. Ue = P,
  424. je = /#|\.prototype\./,
  425. Xe = function (t, e) {
  426. var r = He[Ve(t)];
  427. return r == Ye || (r != We && (Ue(e) ? Ge(e) : !!e));
  428. },
  429. Ve = (Xe.normalize = function (t) {
  430. return String(t).replace(je, '.').toLowerCase();
  431. }),
  432. He = (Xe.data = {}),
  433. We = (Xe.NATIVE = 'N'),
  434. Ye = (Xe.POLYFILL = 'P'),
  435. ze = Xe,
  436. Ze = It,
  437. Je = a,
  438. Ke = S(S.bind),
  439. qe = function (t, e) {
  440. return (
  441. Ze(t),
  442. void 0 === e
  443. ? t
  444. : Je
  445. ? Ke(t, e)
  446. : function () {
  447. return t.apply(e, arguments);
  448. }
  449. );
  450. },
  451. Qe = {},
  452. $e =
  453. O &&
  454. s(function () {
  455. return (
  456. 42 !=
  457. Object.defineProperty(function () {}, 'prototype', {
  458. value: 42,
  459. writable: !1,
  460. }).prototype
  461. );
  462. }),
  463. tr = et,
  464. er = String,
  465. rr = TypeError,
  466. nr = function (t) {
  467. if (tr(t)) return t;
  468. throw rr(er(t) + ' is not an object');
  469. },
  470. ir = O,
  471. or = Ae,
  472. sr = $e,
  473. ar = nr,
  474. ur = Ee,
  475. cr = TypeError,
  476. hr = Object.defineProperty,
  477. lr = Object.getOwnPropertyDescriptor,
  478. dr = 'enumerable',
  479. fr = 'configurable',
  480. pr = 'writable';
  481. Qe.f = ir
  482. ? sr
  483. ? function (t, e, r) {
  484. if (
  485. (ar(t),
  486. (e = ur(e)),
  487. ar(r),
  488. 'function' == typeof t &&
  489. 'prototype' === e &&
  490. 'value' in r &&
  491. pr in r &&
  492. !r.writable)
  493. ) {
  494. var n = lr(t, e);
  495. n &&
  496. n.writable &&
  497. ((t[e] = r.value),
  498. (r = {
  499. configurable: fr in r ? r.configurable : n.configurable,
  500. enumerable: dr in r ? r.enumerable : n.enumerable,
  501. writable: !1,
  502. }));
  503. }
  504. return hr(t, e, r);
  505. }
  506. : hr
  507. : function (t, e, r) {
  508. if ((ar(t), (e = ur(e)), ar(r), or))
  509. try {
  510. return hr(t, e, r);
  511. } catch (t) {}
  512. if ('get' in r || 'set' in r) throw cr('Accessors not supported');
  513. return 'value' in r && (t[e] = r.value), t;
  514. };
  515. var vr = Qe,
  516. mr = U,
  517. yr = O
  518. ? function (t, e, r) {
  519. return vr.f(t, e, mr(1, r));
  520. }
  521. : function (t, e, r) {
  522. return (t[e] = r), t;
  523. },
  524. gr = o,
  525. _r = d,
  526. br = S,
  527. Tr = P,
  528. xr = A.f,
  529. Er = ze,
  530. Sr = rt,
  531. wr = qe,
  532. Rr = yr,
  533. Cr = qt,
  534. Pr = function (t) {
  535. var e = function (r, n, i) {
  536. if (this instanceof e) {
  537. switch (arguments.length) {
  538. case 0:
  539. return new t();
  540. case 1:
  541. return new t(r);
  542. case 2:
  543. return new t(r, n);
  544. }
  545. return new t(r, n, i);
  546. }
  547. return _r(t, this, arguments);
  548. };
  549. return (e.prototype = t.prototype), e;
  550. },
  551. Ar = function (t, e) {
  552. var r,
  553. n,
  554. i,
  555. o,
  556. s,
  557. a,
  558. u,
  559. c,
  560. h = t.target,
  561. l = t.global,
  562. d = t.stat,
  563. f = t.proto,
  564. p = l ? gr : d ? gr[h] : (gr[h] || {}).prototype,
  565. v = l ? Sr : Sr[h] || Rr(Sr, h, {})[h],
  566. m = v.prototype;
  567. for (i in e)
  568. (r = !Er(l ? i : h + (d ? '.' : '#') + i, t.forced) && p && Cr(p, i)),
  569. (s = v[i]),
  570. r && (a = t.dontCallGetSet ? (c = xr(p, i)) && c.value : p[i]),
  571. (o = r && a ? a : e[i]),
  572. (r && typeof s == typeof o) ||
  573. ((u =
  574. t.bind && r
  575. ? wr(o, gr)
  576. : t.wrap && r
  577. ? Pr(o)
  578. : f && Tr(o)
  579. ? br(o)
  580. : o),
  581. (t.sham || (o && o.sham) || (s && s.sham)) && Rr(u, 'sham', !0),
  582. Rr(v, i, u),
  583. f &&
  584. (Cr(Sr, (n = h + 'Prototype')) || Rr(Sr, n, {}),
  585. Rr(Sr[n], i, o),
  586. t.real && m && !m[i] && Rr(m, i, o)));
  587. },
  588. Or = T,
  589. Ir =
  590. Array.isArray ||
  591. function (t) {
  592. return 'Array' == Or(t);
  593. },
  594. Mr = Math.ceil,
  595. Dr = Math.floor,
  596. Lr =
  597. Math.trunc ||
  598. function (t) {
  599. var e = +t;
  600. return (e > 0 ? Dr : Mr)(e);
  601. },
  602. Fr = Lr,
  603. Nr = function (t) {
  604. var e = +t;
  605. return e != e || 0 === e ? 0 : Fr(e);
  606. },
  607. kr = Nr,
  608. Br = Math.min,
  609. Gr = function (t) {
  610. return t > 0 ? Br(kr(t), 9007199254740991) : 0;
  611. },
  612. Ur = Gr,
  613. jr = function (t) {
  614. return Ur(t.length);
  615. },
  616. Xr = TypeError,
  617. Vr = function (t) {
  618. if (t > 9007199254740991) throw Xr('Maximum allowed index exceeded');
  619. return t;
  620. },
  621. Hr = Ee,
  622. Wr = Qe,
  623. Yr = U,
  624. zr = function (t, e, r) {
  625. var n = Hr(e);
  626. n in t ? Wr.f(t, n, Yr(0, r)) : (t[n] = r);
  627. },
  628. Zr = {};
  629. Zr[fe('toStringTag')] = 'z';
  630. var Jr = '[object z]' === String(Zr),
  631. Kr = Jr,
  632. qr = P,
  633. Qr = T,
  634. $r = fe('toStringTag'),
  635. tn = Object,
  636. en =
  637. 'Arguments' ==
  638. Qr(
  639. (function () {
  640. return arguments;
  641. })()
  642. ),
  643. rn = Kr
  644. ? Qr
  645. : function (t) {
  646. var e, r, n;
  647. return void 0 === t
  648. ? 'Undefined'
  649. : null === t
  650. ? 'Null'
  651. : 'string' ==
  652. typeof (r = (function (t, e) {
  653. try {
  654. return t[e];
  655. } catch (t) {}
  656. })((e = tn(t)), $r))
  657. ? r
  658. : en
  659. ? Qr(e)
  660. : 'Object' == (n = Qr(e)) && qr(e.callee)
  661. ? 'Arguments'
  662. : n;
  663. },
  664. nn = P,
  665. on = Ht,
  666. sn = S(Function.toString);
  667. nn(on.inspectSource) ||
  668. (on.inspectSource = function (t) {
  669. return sn(t);
  670. });
  671. var an = on.inspectSource,
  672. un = S,
  673. cn = s,
  674. hn = P,
  675. ln = rn,
  676. dn = an,
  677. fn = function () {},
  678. pn = [],
  679. vn = at('Reflect', 'construct'),
  680. mn = /^\s*(?:class|function)\b/,
  681. yn = un(mn.exec),
  682. gn = !mn.exec(fn),
  683. _n = function (t) {
  684. if (!hn(t)) return !1;
  685. try {
  686. return vn(fn, pn, t), !0;
  687. } catch (t) {
  688. return !1;
  689. }
  690. },
  691. bn = function (t) {
  692. if (!hn(t)) return !1;
  693. switch (ln(t)) {
  694. case 'AsyncFunction':
  695. case 'GeneratorFunction':
  696. case 'AsyncGeneratorFunction':
  697. return !1;
  698. }
  699. try {
  700. return gn || !!yn(mn, dn(t));
  701. } catch (t) {
  702. return !0;
  703. }
  704. };
  705. bn.sham = !0;
  706. var Tn =
  707. !vn ||
  708. cn(function () {
  709. var t;
  710. return (
  711. _n(_n.call) ||
  712. !_n(Object) ||
  713. !_n(function () {
  714. t = !0;
  715. }) ||
  716. t
  717. );
  718. })
  719. ? bn
  720. : _n,
  721. xn = Ir,
  722. En = Tn,
  723. Sn = et,
  724. wn = fe('species'),
  725. Rn = Array,
  726. Cn = function (t) {
  727. var e;
  728. return (
  729. xn(t) &&
  730. ((e = t.constructor),
  731. ((En(e) && (e === Rn || xn(e.prototype))) ||
  732. (Sn(e) && null === (e = e[wn]))) &&
  733. (e = void 0)),
  734. void 0 === e ? Rn : e
  735. );
  736. },
  737. Pn = function (t, e) {
  738. return new (Cn(t))(0 === e ? 0 : e);
  739. },
  740. An = s,
  741. On = mt,
  742. In = fe('species'),
  743. Mn = function (t) {
  744. return (
  745. On >= 51 ||
  746. !An(function () {
  747. var e = [];
  748. return (
  749. ((e.constructor = {})[In] = function () {
  750. return { foo: 1 };
  751. }),
  752. 1 !== e[t](Boolean).foo
  753. );
  754. })
  755. );
  756. },
  757. Dn = Ar,
  758. Ln = s,
  759. Fn = Ir,
  760. Nn = et,
  761. kn = Zt,
  762. Bn = jr,
  763. Gn = Vr,
  764. Un = zr,
  765. jn = Pn,
  766. Xn = Mn,
  767. Vn = mt,
  768. Hn = fe('isConcatSpreadable'),
  769. Wn =
  770. Vn >= 51 ||
  771. !Ln(function () {
  772. var t = [];
  773. return (t[Hn] = !1), t.concat()[0] !== t;
  774. }),
  775. Yn = Xn('concat'),
  776. zn = function (t) {
  777. if (!Nn(t)) return !1;
  778. var e = t[Hn];
  779. return void 0 !== e ? !!e : Fn(t);
  780. };
  781. Dn(
  782. { target: 'Array', proto: !0, arity: 1, forced: !Wn || !Yn },
  783. {
  784. concat: function (t) {
  785. var e,
  786. r,
  787. n,
  788. i,
  789. o,
  790. s = kn(this),
  791. a = jn(s, 0),
  792. u = 0;
  793. for (e = -1, n = arguments.length; e < n; e++)
  794. if (zn((o = -1 === e ? s : arguments[e])))
  795. for (i = Bn(o), Gn(u + i), r = 0; r < i; r++, u++)
  796. r in o && Un(a, u, o[r]);
  797. else Gn(u + 1), Un(a, u++, o);
  798. return (a.length = u), a;
  799. },
  800. }
  801. );
  802. var Zn = rn,
  803. Jn = String,
  804. Kn = function (t) {
  805. if ('Symbol' === Zn(t))
  806. throw TypeError('Cannot convert a Symbol value to a string');
  807. return Jn(t);
  808. },
  809. qn = {},
  810. Qn = Nr,
  811. $n = Math.max,
  812. ti = Math.min,
  813. ei = function (t, e) {
  814. var r = Qn(t);
  815. return r < 0 ? $n(r + e, 0) : ti(r, e);
  816. },
  817. ri = Q,
  818. ni = ei,
  819. ii = jr,
  820. oi = function (t) {
  821. return function (e, r, n) {
  822. var i,
  823. o = ri(e),
  824. s = ii(o),
  825. a = ni(n, s);
  826. if (t && r != r) {
  827. for (; s > a; ) if ((i = o[a++]) != i) return !0;
  828. } else
  829. for (; s > a; a++)
  830. if ((t || a in o) && o[a] === r) return t || a || 0;
  831. return !t && -1;
  832. };
  833. },
  834. si = { includes: oi(!0), indexOf: oi(!1) },
  835. ai = {},
  836. ui = qt,
  837. ci = Q,
  838. hi = si.indexOf,
  839. li = ai,
  840. di = S([].push),
  841. fi = function (t, e) {
  842. var r,
  843. n = ci(t),
  844. i = 0,
  845. o = [];
  846. for (r in n) !ui(li, r) && ui(n, r) && di(o, r);
  847. for (; e.length > i; ) ui(n, (r = e[i++])) && (~hi(o, r) || di(o, r));
  848. return o;
  849. },
  850. pi = [
  851. 'constructor',
  852. 'hasOwnProperty',
  853. 'isPrototypeOf',
  854. 'propertyIsEnumerable',
  855. 'toLocaleString',
  856. 'toString',
  857. 'valueOf',
  858. ],
  859. vi = fi,
  860. mi = pi,
  861. yi =
  862. Object.keys ||
  863. function (t) {
  864. return vi(t, mi);
  865. },
  866. gi = O,
  867. _i = $e,
  868. bi = Qe,
  869. Ti = nr,
  870. xi = Q,
  871. Ei = yi;
  872. qn.f =
  873. gi && !_i
  874. ? Object.defineProperties
  875. : function (t, e) {
  876. Ti(t);
  877. for (var r, n = xi(e), i = Ei(e), o = i.length, s = 0; o > s; )
  878. bi.f(t, (r = i[s++]), n[r]);
  879. return t;
  880. };
  881. var Si,
  882. wi = at('document', 'documentElement'),
  883. Ri = Gt.exports,
  884. Ci = re,
  885. Pi = Ri('keys'),
  886. Ai = function (t) {
  887. return Pi[t] || (Pi[t] = Ci(t));
  888. },
  889. Oi = nr,
  890. Ii = qn,
  891. Mi = pi,
  892. Di = ai,
  893. Li = wi,
  894. Fi = Ce,
  895. Ni = Ai('IE_PROTO'),
  896. ki = function () {},
  897. Bi = function (t) {
  898. return '<script>' + t + '</' + 'script>';
  899. },
  900. Gi = function (t) {
  901. t.write(Bi('')), t.close();
  902. var e = t.parentWindow.Object;
  903. return (t = null), e;
  904. },
  905. Ui = function () {
  906. try {
  907. Si = new ActiveXObject('htmlfile');
  908. } catch (t) {}
  909. var t, e;
  910. Ui =
  911. 'undefined' != typeof document
  912. ? document.domain && Si
  913. ? Gi(Si)
  914. : (((e = Fi('iframe')).style.display = 'none'),
  915. Li.appendChild(e),
  916. (e.src = String('javascript:')),
  917. (t = e.contentWindow.document).open(),
  918. t.write(Bi('document.F=Object')),
  919. t.close(),
  920. t.F)
  921. : Gi(Si);
  922. for (var r = Mi.length; r--; ) delete Ui.prototype[Mi[r]];
  923. return Ui();
  924. };
  925. Di[Ni] = !0;
  926. var ji =
  927. Object.create ||
  928. function (t, e) {
  929. var r;
  930. return (
  931. null !== t
  932. ? ((ki.prototype = Oi(t)),
  933. (r = new ki()),
  934. (ki.prototype = null),
  935. (r[Ni] = t))
  936. : (r = Ui()),
  937. void 0 === e ? r : Ii.f(r, e)
  938. );
  939. },
  940. Xi = {},
  941. Vi = fi,
  942. Hi = pi.concat('length', 'prototype');
  943. Xi.f =
  944. Object.getOwnPropertyNames ||
  945. function (t) {
  946. return Vi(t, Hi);
  947. };
  948. var Wi = {},
  949. Yi = ei,
  950. zi = jr,
  951. Zi = zr,
  952. Ji = Array,
  953. Ki = Math.max,
  954. qi = function (t, e, r) {
  955. for (
  956. var n = zi(t),
  957. i = Yi(e, n),
  958. o = Yi(void 0 === r ? n : r, n),
  959. s = Ji(Ki(o - i, 0)),
  960. a = 0;
  961. i < o;
  962. i++, a++
  963. )
  964. Zi(s, a, t[i]);
  965. return (s.length = a), s;
  966. },
  967. Qi = T,
  968. $i = Q,
  969. to = Xi.f,
  970. eo = qi,
  971. ro =
  972. 'object' == typeof window && window && Object.getOwnPropertyNames
  973. ? Object.getOwnPropertyNames(window)
  974. : [];
  975. Wi.f = function (t) {
  976. return ro && 'Window' == Qi(t)
  977. ? (function (t) {
  978. try {
  979. return to(t);
  980. } catch (t) {
  981. return eo(ro);
  982. }
  983. })(t)
  984. : to($i(t));
  985. };
  986. var no = {};
  987. no.f = Object.getOwnPropertySymbols;
  988. var io = yr,
  989. oo = function (t, e, r, n) {
  990. return n && n.enumerable ? (t[e] = r) : io(t, e, r), t;
  991. },
  992. so = {},
  993. ao = fe;
  994. so.f = ao;
  995. var uo,
  996. co,
  997. ho,
  998. lo = rt,
  999. fo = qt,
  1000. po = so,
  1001. vo = Qe.f,
  1002. mo = function (t) {
  1003. var e = lo.Symbol || (lo.Symbol = {});
  1004. fo(e, t) || vo(e, t, { value: po.f(t) });
  1005. },
  1006. yo = D,
  1007. go = at,
  1008. _o = fe,
  1009. bo = oo,
  1010. To = function () {
  1011. var t = go('Symbol'),
  1012. e = t && t.prototype,
  1013. r = e && e.valueOf,
  1014. n = _o('toPrimitive');
  1015. e &&
  1016. !e[n] &&
  1017. bo(
  1018. e,
  1019. n,
  1020. function (t) {
  1021. return yo(r, this);
  1022. },
  1023. { arity: 1 }
  1024. );
  1025. },
  1026. xo = rn,
  1027. Eo = Jr
  1028. ? {}.toString
  1029. : function () {
  1030. return '[object ' + xo(this) + ']';
  1031. },
  1032. So = Jr,
  1033. wo = Qe.f,
  1034. Ro = yr,
  1035. Co = qt,
  1036. Po = Eo,
  1037. Ao = fe('toStringTag'),
  1038. Oo = function (t, e, r, n) {
  1039. if (t) {
  1040. var i = r ? t : t.prototype;
  1041. Co(i, Ao) || wo(i, Ao, { configurable: !0, value: e }),
  1042. n && !So && Ro(i, 'toString', Po);
  1043. }
  1044. },
  1045. Io = P,
  1046. Mo = o.WeakMap,
  1047. Do = Io(Mo) && /native code/.test(String(Mo)),
  1048. Lo = o,
  1049. Fo = et,
  1050. No = yr,
  1051. ko = qt,
  1052. Bo = Ht,
  1053. Go = Ai,
  1054. Uo = ai,
  1055. jo = 'Object already initialized',
  1056. Xo = Lo.TypeError,
  1057. Vo = Lo.WeakMap;
  1058. if (Do || Bo.state) {
  1059. var Ho = Bo.state || (Bo.state = new Vo());
  1060. (Ho.get = Ho.get),
  1061. (Ho.has = Ho.has),
  1062. (Ho.set = Ho.set),
  1063. (uo = function (t, e) {
  1064. if (Ho.has(t)) throw Xo(jo);
  1065. return (e.facade = t), Ho.set(t, e), e;
  1066. }),
  1067. (co = function (t) {
  1068. return Ho.get(t) || {};
  1069. }),
  1070. (ho = function (t) {
  1071. return Ho.has(t);
  1072. });
  1073. } else {
  1074. var Wo = Go('state');
  1075. (Uo[Wo] = !0),
  1076. (uo = function (t, e) {
  1077. if (ko(t, Wo)) throw Xo(jo);
  1078. return (e.facade = t), No(t, Wo, e), e;
  1079. }),
  1080. (co = function (t) {
  1081. return ko(t, Wo) ? t[Wo] : {};
  1082. }),
  1083. (ho = function (t) {
  1084. return ko(t, Wo);
  1085. });
  1086. }
  1087. var Yo = {
  1088. set: uo,
  1089. get: co,
  1090. has: ho,
  1091. enforce: function (t) {
  1092. return ho(t) ? co(t) : uo(t, {});
  1093. },
  1094. getterFor: function (t) {
  1095. return function (e) {
  1096. var r;
  1097. if (!Fo(e) || (r = co(e)).type !== t)
  1098. throw Xo('Incompatible receiver, ' + t + ' required');
  1099. return r;
  1100. };
  1101. },
  1102. },
  1103. zo = qe,
  1104. Zo = W,
  1105. Jo = Zt,
  1106. Ko = jr,
  1107. qo = Pn,
  1108. Qo = S([].push),
  1109. $o = function (t) {
  1110. var e = 1 == t,
  1111. r = 2 == t,
  1112. n = 3 == t,
  1113. i = 4 == t,
  1114. o = 6 == t,
  1115. s = 7 == t,
  1116. a = 5 == t || o;
  1117. return function (u, c, h, l) {
  1118. for (
  1119. var d,
  1120. f,
  1121. p = Jo(u),
  1122. v = Zo(p),
  1123. m = zo(c, h),
  1124. y = Ko(v),
  1125. g = 0,
  1126. _ = l || qo,
  1127. b = e ? _(u, y) : r || s ? _(u, 0) : void 0;
  1128. y > g;
  1129. g++
  1130. )
  1131. if ((a || g in v) && ((f = m((d = v[g]), g, p)), t))
  1132. if (e) b[g] = f;
  1133. else if (f)
  1134. switch (t) {
  1135. case 3:
  1136. return !0;
  1137. case 5:
  1138. return d;
  1139. case 6:
  1140. return g;
  1141. case 2:
  1142. Qo(b, d);
  1143. }
  1144. else
  1145. switch (t) {
  1146. case 4:
  1147. return !1;
  1148. case 7:
  1149. Qo(b, d);
  1150. }
  1151. return o ? -1 : n || i ? i : b;
  1152. };
  1153. },
  1154. ts = {
  1155. forEach: $o(0),
  1156. map: $o(1),
  1157. filter: $o(2),
  1158. some: $o(3),
  1159. every: $o(4),
  1160. find: $o(5),
  1161. findIndex: $o(6),
  1162. filterReject: $o(7),
  1163. },
  1164. es = Ar,
  1165. rs = o,
  1166. ns = D,
  1167. is = S,
  1168. os = O,
  1169. ss = _t,
  1170. as = s,
  1171. us = qt,
  1172. cs = ut,
  1173. hs = nr,
  1174. ls = Q,
  1175. ds = Ee,
  1176. fs = Kn,
  1177. ps = U,
  1178. vs = ji,
  1179. ms = yi,
  1180. ys = Xi,
  1181. gs = Wi,
  1182. _s = no,
  1183. bs = A,
  1184. Ts = Qe,
  1185. xs = qn,
  1186. Es = L,
  1187. Ss = oo,
  1188. ws = Gt.exports,
  1189. Rs = ai,
  1190. Cs = re,
  1191. Ps = fe,
  1192. As = so,
  1193. Os = mo,
  1194. Is = To,
  1195. Ms = Oo,
  1196. Ds = Yo,
  1197. Ls = ts.forEach,
  1198. Fs = Ai('hidden'),
  1199. Ns = 'Symbol',
  1200. ks = Ds.set,
  1201. Bs = Ds.getterFor(Ns),
  1202. Gs = Object.prototype,
  1203. Us = rs.Symbol,
  1204. js = Us && Us.prototype,
  1205. Xs = rs.TypeError,
  1206. Vs = rs.QObject,
  1207. Hs = bs.f,
  1208. Ws = Ts.f,
  1209. Ys = gs.f,
  1210. zs = Es.f,
  1211. Zs = is([].push),
  1212. Js = ws('symbols'),
  1213. Ks = ws('op-symbols'),
  1214. qs = ws('wks'),
  1215. Qs = !Vs || !Vs.prototype || !Vs.prototype.findChild,
  1216. $s =
  1217. os &&
  1218. as(function () {
  1219. return (
  1220. 7 !=
  1221. vs(
  1222. Ws({}, 'a', {
  1223. get: function () {
  1224. return Ws(this, 'a', { value: 7 }).a;
  1225. },
  1226. })
  1227. ).a
  1228. );
  1229. })
  1230. ? function (t, e, r) {
  1231. var n = Hs(Gs, e);
  1232. n && delete Gs[e], Ws(t, e, r), n && t !== Gs && Ws(Gs, e, n);
  1233. }
  1234. : Ws,
  1235. ta = function (t, e) {
  1236. var r = (Js[t] = vs(js));
  1237. return (
  1238. ks(r, { type: Ns, tag: t, description: e }),
  1239. os || (r.description = e),
  1240. r
  1241. );
  1242. },
  1243. ea = function (t, e, r) {
  1244. t === Gs && ea(Ks, e, r), hs(t);
  1245. var n = ds(e);
  1246. return (
  1247. hs(r),
  1248. us(Js, n)
  1249. ? (r.enumerable
  1250. ? (us(t, Fs) && t[Fs][n] && (t[Fs][n] = !1),
  1251. (r = vs(r, { enumerable: ps(0, !1) })))
  1252. : (us(t, Fs) || Ws(t, Fs, ps(1, {})), (t[Fs][n] = !0)),
  1253. $s(t, n, r))
  1254. : Ws(t, n, r)
  1255. );
  1256. },
  1257. ra = function (t, e) {
  1258. hs(t);
  1259. var r = ls(e),
  1260. n = ms(r).concat(sa(r));
  1261. return (
  1262. Ls(n, function (e) {
  1263. (os && !ns(na, r, e)) || ea(t, e, r[e]);
  1264. }),
  1265. t
  1266. );
  1267. },
  1268. na = function (t) {
  1269. var e = ds(t),
  1270. r = ns(zs, this, e);
  1271. return (
  1272. !(this === Gs && us(Js, e) && !us(Ks, e)) &&
  1273. (!(r || !us(this, e) || !us(Js, e) || (us(this, Fs) && this[Fs][e])) ||
  1274. r)
  1275. );
  1276. },
  1277. ia = function (t, e) {
  1278. var r = ls(t),
  1279. n = ds(e);
  1280. if (r !== Gs || !us(Js, n) || us(Ks, n)) {
  1281. var i = Hs(r, n);
  1282. return (
  1283. !i || !us(Js, n) || (us(r, Fs) && r[Fs][n]) || (i.enumerable = !0), i
  1284. );
  1285. }
  1286. },
  1287. oa = function (t) {
  1288. var e = Ys(ls(t)),
  1289. r = [];
  1290. return (
  1291. Ls(e, function (t) {
  1292. us(Js, t) || us(Rs, t) || Zs(r, t);
  1293. }),
  1294. r
  1295. );
  1296. },
  1297. sa = function (t) {
  1298. var e = t === Gs,
  1299. r = Ys(e ? Ks : ls(t)),
  1300. n = [];
  1301. return (
  1302. Ls(r, function (t) {
  1303. !us(Js, t) || (e && !us(Gs, t)) || Zs(n, Js[t]);
  1304. }),
  1305. n
  1306. );
  1307. };
  1308. ss ||
  1309. ((Us = function () {
  1310. if (cs(js, this)) throw Xs('Symbol is not a constructor');
  1311. var t =
  1312. arguments.length && void 0 !== arguments[0]
  1313. ? fs(arguments[0])
  1314. : void 0,
  1315. e = Cs(t),
  1316. r = function (t) {
  1317. this === Gs && ns(r, Ks, t),
  1318. us(this, Fs) && us(this[Fs], e) && (this[Fs][e] = !1),
  1319. $s(this, e, ps(1, t));
  1320. };
  1321. return os && Qs && $s(Gs, e, { configurable: !0, set: r }), ta(e, t);
  1322. }),
  1323. Ss((js = Us.prototype), 'toString', function () {
  1324. return Bs(this).tag;
  1325. }),
  1326. Ss(Us, 'withoutSetter', function (t) {
  1327. return ta(Cs(t), t);
  1328. }),
  1329. (Es.f = na),
  1330. (Ts.f = ea),
  1331. (xs.f = ra),
  1332. (bs.f = ia),
  1333. (ys.f = gs.f = oa),
  1334. (_s.f = sa),
  1335. (As.f = function (t) {
  1336. return ta(Ps(t), t);
  1337. }),
  1338. os &&
  1339. Ws(js, 'description', {
  1340. configurable: !0,
  1341. get: function () {
  1342. return Bs(this).description;
  1343. },
  1344. })),
  1345. es(
  1346. { global: !0, constructor: !0, wrap: !0, forced: !ss, sham: !ss },
  1347. { Symbol: Us }
  1348. ),
  1349. Ls(ms(qs), function (t) {
  1350. Os(t);
  1351. }),
  1352. es(
  1353. { target: Ns, stat: !0, forced: !ss },
  1354. {
  1355. useSetter: function () {
  1356. Qs = !0;
  1357. },
  1358. useSimple: function () {
  1359. Qs = !1;
  1360. },
  1361. }
  1362. ),
  1363. es(
  1364. { target: 'Object', stat: !0, forced: !ss, sham: !os },
  1365. {
  1366. create: function (t, e) {
  1367. return void 0 === e ? vs(t) : ra(vs(t), e);
  1368. },
  1369. defineProperty: ea,
  1370. defineProperties: ra,
  1371. getOwnPropertyDescriptor: ia,
  1372. }
  1373. ),
  1374. es(
  1375. { target: 'Object', stat: !0, forced: !ss },
  1376. { getOwnPropertyNames: oa }
  1377. ),
  1378. Is(),
  1379. Ms(Us, Ns),
  1380. (Rs[Fs] = !0);
  1381. var aa = _t && !!Symbol.for && !!Symbol.keyFor,
  1382. ua = Ar,
  1383. ca = at,
  1384. ha = qt,
  1385. la = Kn,
  1386. da = Gt.exports,
  1387. fa = aa,
  1388. pa = da('string-to-symbol-registry'),
  1389. va = da('symbol-to-string-registry');
  1390. ua(
  1391. { target: 'Symbol', stat: !0, forced: !fa },
  1392. {
  1393. for: function (t) {
  1394. var e = la(t);
  1395. if (ha(pa, e)) return pa[e];
  1396. var r = ca('Symbol')(e);
  1397. return (pa[e] = r), (va[r] = e), r;
  1398. },
  1399. }
  1400. );
  1401. var ma = Ar,
  1402. ya = qt,
  1403. ga = wt,
  1404. _a = Ct,
  1405. ba = aa,
  1406. Ta = (0, Gt.exports)('symbol-to-string-registry');
  1407. ma(
  1408. { target: 'Symbol', stat: !0, forced: !ba },
  1409. {
  1410. keyFor: function (t) {
  1411. if (!ga(t)) throw TypeError(_a(t) + ' is not a symbol');
  1412. if (ya(Ta, t)) return Ta[t];
  1413. },
  1414. }
  1415. );
  1416. var xa = S([].slice),
  1417. Ea = Ar,
  1418. Sa = at,
  1419. wa = d,
  1420. Ra = D,
  1421. Ca = S,
  1422. Pa = s,
  1423. Aa = Ir,
  1424. Oa = P,
  1425. Ia = et,
  1426. Ma = wt,
  1427. Da = xa,
  1428. La = _t,
  1429. Fa = Sa('JSON', 'stringify'),
  1430. Na = Ca(/./.exec),
  1431. ka = Ca(''.charAt),
  1432. Ba = Ca(''.charCodeAt),
  1433. Ga = Ca(''.replace),
  1434. Ua = Ca((1).toString),
  1435. ja = /[\uD800-\uDFFF]/g,
  1436. Xa = /^[\uD800-\uDBFF]$/,
  1437. Va = /^[\uDC00-\uDFFF]$/,
  1438. Ha =
  1439. !La ||
  1440. Pa(function () {
  1441. var t = Sa('Symbol')();
  1442. return (
  1443. '[null]' != Fa([t]) || '{}' != Fa({ a: t }) || '{}' != Fa(Object(t))
  1444. );
  1445. }),
  1446. Wa = Pa(function () {
  1447. return (
  1448. '"\\udf06\\ud834"' !== Fa('\udf06\ud834') ||
  1449. '"\\udead"' !== Fa('\udead')
  1450. );
  1451. }),
  1452. Ya = function (t, e) {
  1453. var r = Da(arguments),
  1454. n = e;
  1455. if ((Ia(e) || void 0 !== t) && !Ma(t))
  1456. return (
  1457. Aa(e) ||
  1458. (e = function (t, e) {
  1459. if ((Oa(n) && (e = Ra(n, this, t, e)), !Ma(e))) return e;
  1460. }),
  1461. (r[1] = e),
  1462. wa(Fa, null, r)
  1463. );
  1464. },
  1465. za = function (t, e, r) {
  1466. var n = ka(r, e - 1),
  1467. i = ka(r, e + 1);
  1468. return (Na(Xa, t) && !Na(Va, i)) || (Na(Va, t) && !Na(Xa, n))
  1469. ? '\\u' + Ua(Ba(t, 0), 16)
  1470. : t;
  1471. };
  1472. Fa &&
  1473. Ea(
  1474. { target: 'JSON', stat: !0, arity: 3, forced: Ha || Wa },
  1475. {
  1476. stringify: function (t, e, r) {
  1477. var n = Da(arguments),
  1478. i = wa(Ha ? Ya : Fa, null, n);
  1479. return Wa && 'string' == typeof i ? Ga(i, ja, za) : i;
  1480. },
  1481. }
  1482. );
  1483. var Za = no,
  1484. Ja = Zt;
  1485. Ar(
  1486. {
  1487. target: 'Object',
  1488. stat: !0,
  1489. forced:
  1490. !_t ||
  1491. s(function () {
  1492. Za.f(1);
  1493. }),
  1494. },
  1495. {
  1496. getOwnPropertySymbols: function (t) {
  1497. var e = Za.f;
  1498. return e ? e(Ja(t)) : [];
  1499. },
  1500. }
  1501. ),
  1502. mo('asyncIterator'),
  1503. mo('hasInstance'),
  1504. mo('isConcatSpreadable'),
  1505. mo('iterator'),
  1506. mo('match'),
  1507. mo('matchAll'),
  1508. mo('replace'),
  1509. mo('search'),
  1510. mo('species'),
  1511. mo('split');
  1512. var Ka = To;
  1513. mo('toPrimitive'), Ka();
  1514. var qa = at,
  1515. Qa = Oo;
  1516. mo('toStringTag'),
  1517. Qa(qa('Symbol'), 'Symbol'),
  1518. mo('unscopables'),
  1519. Oo(o.JSON, 'JSON', !0);
  1520. var $a,
  1521. tu,
  1522. eu,
  1523. ru = rt.Symbol,
  1524. nu = {},
  1525. iu = O,
  1526. ou = qt,
  1527. su = Function.prototype,
  1528. au = iu && Object.getOwnPropertyDescriptor,
  1529. uu = ou(su, 'name'),
  1530. cu = {
  1531. EXISTS: uu,
  1532. PROPER: uu && 'something' === function () {}.name,
  1533. CONFIGURABLE: uu && (!iu || (iu && au(su, 'name').configurable)),
  1534. },
  1535. hu = !s(function () {
  1536. function t() {}
  1537. return (
  1538. (t.prototype.constructor = null),
  1539. Object.getPrototypeOf(new t()) !== t.prototype
  1540. );
  1541. }),
  1542. lu = qt,
  1543. du = P,
  1544. fu = Zt,
  1545. pu = hu,
  1546. vu = Ai('IE_PROTO'),
  1547. mu = Object,
  1548. yu = mu.prototype,
  1549. gu = pu
  1550. ? mu.getPrototypeOf
  1551. : function (t) {
  1552. var e = fu(t);
  1553. if (lu(e, vu)) return e[vu];
  1554. var r = e.constructor;
  1555. return du(r) && e instanceof r
  1556. ? r.prototype
  1557. : e instanceof mu
  1558. ? yu
  1559. : null;
  1560. },
  1561. _u = s,
  1562. bu = P,
  1563. Tu = et,
  1564. xu = ji,
  1565. Eu = gu,
  1566. Su = oo,
  1567. wu = fe('iterator'),
  1568. Ru = !1;
  1569. [].keys &&
  1570. ('next' in (eu = [].keys())
  1571. ? (tu = Eu(Eu(eu))) !== Object.prototype && ($a = tu)
  1572. : (Ru = !0));
  1573. var Cu =
  1574. !Tu($a) ||
  1575. _u(function () {
  1576. var t = {};
  1577. return $a[wu].call(t) !== t;
  1578. });
  1579. bu(($a = Cu ? {} : xu($a))[wu]) ||
  1580. Su($a, wu, function () {
  1581. return this;
  1582. });
  1583. var Pu = { IteratorPrototype: $a, BUGGY_SAFARI_ITERATORS: Ru },
  1584. Au = Pu.IteratorPrototype,
  1585. Ou = ji,
  1586. Iu = U,
  1587. Mu = Oo,
  1588. Du = nu,
  1589. Lu = function () {
  1590. return this;
  1591. },
  1592. Fu = function (t, e, r, n) {
  1593. var i = e + ' Iterator';
  1594. return (
  1595. (t.prototype = Ou(Au, { next: Iu(+!n, r) })),
  1596. Mu(t, i, !1, !0),
  1597. (Du[i] = Lu),
  1598. t
  1599. );
  1600. },
  1601. Nu = P,
  1602. ku = String,
  1603. Bu = TypeError,
  1604. Gu = S,
  1605. Uu = nr,
  1606. ju = function (t) {
  1607. if ('object' == typeof t || Nu(t)) return t;
  1608. throw Bu("Can't set " + ku(t) + ' as a prototype');
  1609. },
  1610. Xu =
  1611. Object.setPrototypeOf ||
  1612. ('__proto__' in {}
  1613. ? (function () {
  1614. var t,
  1615. e = !1,
  1616. r = {};
  1617. try {
  1618. (t = Gu(
  1619. Object.getOwnPropertyDescriptor(Object.prototype, '__proto__')
  1620. .set
  1621. ))(r, []),
  1622. (e = r instanceof Array);
  1623. } catch (t) {}
  1624. return function (r, n) {
  1625. return Uu(r), ju(n), e ? t(r, n) : (r.__proto__ = n), r;
  1626. };
  1627. })()
  1628. : void 0),
  1629. Vu = Ar,
  1630. Hu = D,
  1631. Wu = cu,
  1632. Yu = Fu,
  1633. zu = gu,
  1634. Zu = Oo,
  1635. Ju = oo,
  1636. Ku = nu,
  1637. qu = Pu,
  1638. Qu = Wu.PROPER,
  1639. $u = qu.BUGGY_SAFARI_ITERATORS,
  1640. tc = fe('iterator'),
  1641. ec = 'keys',
  1642. rc = 'values',
  1643. nc = 'entries',
  1644. ic = function () {
  1645. return this;
  1646. },
  1647. oc = function (t, e, r, n, i, o, s) {
  1648. Yu(r, e, n);
  1649. var a,
  1650. u,
  1651. c,
  1652. h = function (t) {
  1653. if (t === i && v) return v;
  1654. if (!$u && t in f) return f[t];
  1655. switch (t) {
  1656. case ec:
  1657. case rc:
  1658. case nc:
  1659. return function () {
  1660. return new r(this, t);
  1661. };
  1662. }
  1663. return function () {
  1664. return new r(this);
  1665. };
  1666. },
  1667. l = e + ' Iterator',
  1668. d = !1,
  1669. f = t.prototype,
  1670. p = f[tc] || f['@@iterator'] || (i && f[i]),
  1671. v = (!$u && p) || h(i),
  1672. m = ('Array' == e && f.entries) || p;
  1673. if (
  1674. (m &&
  1675. (a = zu(m.call(new t()))) !== Object.prototype &&
  1676. a.next &&
  1677. (Zu(a, l, !0, !0), (Ku[l] = ic)),
  1678. Qu &&
  1679. i == rc &&
  1680. p &&
  1681. p.name !== rc &&
  1682. ((d = !0),
  1683. (v = function () {
  1684. return Hu(p, this);
  1685. })),
  1686. i)
  1687. )
  1688. if (((u = { values: h(rc), keys: o ? v : h(ec), entries: h(nc) }), s))
  1689. for (c in u) ($u || d || !(c in f)) && Ju(f, c, u[c]);
  1690. else Vu({ target: e, proto: !0, forced: $u || d }, u);
  1691. return s && f[tc] !== v && Ju(f, tc, v, { name: i }), (Ku[e] = v), u;
  1692. },
  1693. sc = function (t, e) {
  1694. return { value: t, done: e };
  1695. },
  1696. ac = Q,
  1697. uc = function () {},
  1698. cc = nu,
  1699. hc = Yo,
  1700. lc = (Qe.f, oc),
  1701. dc = sc,
  1702. fc = 'Array Iterator',
  1703. pc = hc.set,
  1704. vc = hc.getterFor(fc);
  1705. lc(
  1706. Array,
  1707. 'Array',
  1708. function (t, e) {
  1709. pc(this, { type: fc, target: ac(t), index: 0, kind: e });
  1710. },
  1711. function () {
  1712. var t = vc(this),
  1713. e = t.target,
  1714. r = t.kind,
  1715. n = t.index++;
  1716. return !e || n >= e.length
  1717. ? ((t.target = void 0), dc(void 0, !0))
  1718. : dc('keys' == r ? n : 'values' == r ? e[n] : [n, e[n]], !1);
  1719. },
  1720. 'values'
  1721. );
  1722. cc.Arguments = cc.Array;
  1723. uc(), uc(), uc();
  1724. var mc = {
  1725. CSSRuleList: 0,
  1726. CSSStyleDeclaration: 0,
  1727. CSSValueList: 0,
  1728. ClientRectList: 0,
  1729. DOMRectList: 0,
  1730. DOMStringList: 0,
  1731. DOMTokenList: 1,
  1732. DataTransferItemList: 0,
  1733. FileList: 0,
  1734. HTMLAllCollection: 0,
  1735. HTMLCollection: 0,
  1736. HTMLFormElement: 0,
  1737. HTMLSelectElement: 0,
  1738. MediaList: 0,
  1739. MimeTypeArray: 0,
  1740. NamedNodeMap: 0,
  1741. NodeList: 1,
  1742. PaintRequestList: 0,
  1743. Plugin: 0,
  1744. PluginArray: 0,
  1745. SVGLengthList: 0,
  1746. SVGNumberList: 0,
  1747. SVGPathSegList: 0,
  1748. SVGPointList: 0,
  1749. SVGStringList: 0,
  1750. SVGTransformList: 0,
  1751. SourceBufferList: 0,
  1752. StyleSheetList: 0,
  1753. TextTrackCueList: 0,
  1754. TextTrackList: 0,
  1755. TouchList: 0,
  1756. },
  1757. yc = o,
  1758. gc = rn,
  1759. _c = yr,
  1760. bc = nu,
  1761. Tc = fe('toStringTag');
  1762. for (var xc in mc) {
  1763. var Ec = yc[xc],
  1764. Sc = Ec && Ec.prototype;
  1765. Sc && gc(Sc) !== Tc && _c(Sc, Tc, xc), (bc[xc] = bc.Array);
  1766. }
  1767. var wc = ru;
  1768. mo('asyncDispose'),
  1769. mo('dispose'),
  1770. mo('matcher'),
  1771. mo('metadataKey'),
  1772. mo('observable'),
  1773. mo('metadata'),
  1774. mo('patternMatch'),
  1775. mo('replaceAll');
  1776. var Rc = wc,
  1777. Cc = S,
  1778. Pc = Nr,
  1779. Ac = Kn,
  1780. Oc = J,
  1781. Ic = Cc(''.charAt),
  1782. Mc = Cc(''.charCodeAt),
  1783. Dc = Cc(''.slice),
  1784. Lc = function (t) {
  1785. return function (e, r) {
  1786. var n,
  1787. i,
  1788. o = Ac(Oc(e)),
  1789. s = Pc(r),
  1790. a = o.length;
  1791. return s < 0 || s >= a
  1792. ? t
  1793. ? ''
  1794. : void 0
  1795. : (n = Mc(o, s)) < 55296 ||
  1796. n > 56319 ||
  1797. s + 1 === a ||
  1798. (i = Mc(o, s + 1)) < 56320 ||
  1799. i > 57343
  1800. ? t
  1801. ? Ic(o, s)
  1802. : n
  1803. : t
  1804. ? Dc(o, s, s + 2)
  1805. : i - 56320 + ((n - 55296) << 10) + 65536;
  1806. };
  1807. },
  1808. Fc = { codeAt: Lc(!1), charAt: Lc(!0) },
  1809. Nc = Fc.charAt,
  1810. kc = Kn,
  1811. Bc = Yo,
  1812. Gc = oc,
  1813. Uc = sc,
  1814. jc = 'String Iterator',
  1815. Xc = Bc.set,
  1816. Vc = Bc.getterFor(jc);
  1817. Gc(
  1818. String,
  1819. 'String',
  1820. function (t) {
  1821. Xc(this, { type: jc, string: kc(t), index: 0 });
  1822. },
  1823. function () {
  1824. var t,
  1825. e = Vc(this),
  1826. r = e.string,
  1827. n = e.index;
  1828. return n >= r.length
  1829. ? Uc(void 0, !0)
  1830. : ((t = Nc(r, n)), (e.index += t.length), Uc(t, !1));
  1831. }
  1832. );
  1833. var Hc = so.f('iterator');
  1834. function Wc(t) {
  1835. return (
  1836. (Wc =
  1837. 'function' == typeof Rc && 'symbol' == typeof Hc
  1838. ? function (t) {
  1839. return typeof t;
  1840. }
  1841. : function (t) {
  1842. return t &&
  1843. 'function' == typeof Rc &&
  1844. t.constructor === Rc &&
  1845. t !== Rc.prototype
  1846. ? 'symbol'
  1847. : typeof t;
  1848. }),
  1849. Wc(t)
  1850. );
  1851. }
  1852. var Yc = S,
  1853. zc = It,
  1854. Zc = et,
  1855. Jc = qt,
  1856. Kc = xa,
  1857. qc = a,
  1858. Qc = Function,
  1859. $c = Yc([].concat),
  1860. th = Yc([].join),
  1861. eh = {},
  1862. rh = function (t, e, r) {
  1863. if (!Jc(eh, e)) {
  1864. for (var n = [], i = 0; i < e; i++) n[i] = 'a[' + i + ']';
  1865. eh[e] = Qc('C,a', 'return new C(' + th(n, ',') + ')');
  1866. }
  1867. return eh[e](t, r);
  1868. },
  1869. nh = qc
  1870. ? Qc.bind
  1871. : function (t) {
  1872. var e = zc(this),
  1873. r = e.prototype,
  1874. n = Kc(arguments, 1),
  1875. i = function () {
  1876. var r = $c(n, Kc(arguments));
  1877. return this instanceof i ? rh(e, r.length, r) : e.apply(t, r);
  1878. };
  1879. return Zc(r) && (i.prototype = r), i;
  1880. },
  1881. ih = nh;
  1882. Ar(
  1883. { target: 'Function', proto: !0, forced: Function.bind !== ih },
  1884. { bind: ih }
  1885. );
  1886. var oh = rt,
  1887. sh = function (t) {
  1888. return oh[t + 'Prototype'];
  1889. },
  1890. ah = sh('Function').bind,
  1891. uh = ut,
  1892. ch = ah,
  1893. hh = Function.prototype,
  1894. lh = function (t) {
  1895. var e = t.bind;
  1896. return t === hh || (uh(hh, t) && e === hh.bind) ? ch : e;
  1897. },
  1898. dh = sh('Array').concat,
  1899. fh = ut,
  1900. ph = dh,
  1901. vh = Array.prototype,
  1902. mh = function (t) {
  1903. var e = t.concat;
  1904. return t === vh || (fh(vh, t) && e === vh.concat) ? ph : e;
  1905. },
  1906. yh = s,
  1907. gh = function (t, e) {
  1908. var r = [][t];
  1909. return (
  1910. !!r &&
  1911. yh(function () {
  1912. r.call(
  1913. null,
  1914. e ||
  1915. function () {
  1916. return 1;
  1917. },
  1918. 1
  1919. );
  1920. })
  1921. );
  1922. },
  1923. _h = ts.forEach,
  1924. bh = gh('forEach')
  1925. ? [].forEach
  1926. : function (t) {
  1927. return _h(this, t, arguments.length > 1 ? arguments[1] : void 0);
  1928. };
  1929. Ar({ target: 'Array', proto: !0, forced: [].forEach != bh }, { forEach: bh });
  1930. var Th = sh('Array').forEach,
  1931. xh = rn,
  1932. Eh = qt,
  1933. Sh = ut,
  1934. wh = Th,
  1935. Rh = Array.prototype,
  1936. Ch = { DOMTokenList: !0, NodeList: !0 },
  1937. Ph = function (t) {
  1938. var e = t.forEach;
  1939. return t === Rh || (Sh(Rh, t) && e === Rh.forEach) || Eh(Ch, xh(t))
  1940. ? wh
  1941. : e;
  1942. },
  1943. Ah = ts.filter;
  1944. Ar(
  1945. { target: 'Array', proto: !0, forced: !Mn('filter') },
  1946. {
  1947. filter: function (t) {
  1948. return Ah(this, t, arguments.length > 1 ? arguments[1] : void 0);
  1949. },
  1950. }
  1951. );
  1952. var Oh = sh('Array').filter,
  1953. Ih = ut,
  1954. Mh = Oh,
  1955. Dh = Array.prototype,
  1956. Lh = function (t) {
  1957. var e = t.filter;
  1958. return t === Dh || (Ih(Dh, t) && e === Dh.filter) ? Mh : e;
  1959. },
  1960. Fh = Ar,
  1961. Nh = ts.findIndex,
  1962. kh = 'findIndex',
  1963. Bh = !0;
  1964. kh in [] &&
  1965. Array(1).findIndex(function () {
  1966. Bh = !1;
  1967. }),
  1968. Fh(
  1969. { target: 'Array', proto: !0, forced: Bh },
  1970. {
  1971. findIndex: function (t) {
  1972. return Nh(this, t, arguments.length > 1 ? arguments[1] : void 0);
  1973. },
  1974. }
  1975. );
  1976. var Gh = sh('Array').findIndex,
  1977. Uh = ut,
  1978. jh = Gh,
  1979. Xh = Array.prototype,
  1980. Vh = function (t) {
  1981. var e = t.findIndex;
  1982. return t === Xh || (Uh(Xh, t) && e === Xh.findIndex) ? jh : e;
  1983. },
  1984. Hh = O,
  1985. Wh = Ir,
  1986. Yh = TypeError,
  1987. zh = Object.getOwnPropertyDescriptor,
  1988. Zh =
  1989. Hh &&
  1990. !(function () {
  1991. if (void 0 !== this) return !0;
  1992. try {
  1993. Object.defineProperty([], 'length', { writable: !1 }).length = 1;
  1994. } catch (t) {
  1995. return t instanceof TypeError;
  1996. }
  1997. })(),
  1998. Jh = Ct,
  1999. Kh = TypeError,
  2000. qh = Ar,
  2001. Qh = Zt,
  2002. $h = ei,
  2003. tl = Nr,
  2004. el = jr,
  2005. rl = Zh
  2006. ? function (t, e) {
  2007. if (Wh(t) && !zh(t, 'length').writable)
  2008. throw Yh('Cannot set read only .length');
  2009. return (t.length = e);
  2010. }
  2011. : function (t, e) {
  2012. return (t.length = e);
  2013. },
  2014. nl = Vr,
  2015. il = Pn,
  2016. ol = zr,
  2017. sl = function (t, e) {
  2018. if (!delete t[e])
  2019. throw Kh('Cannot delete property ' + Jh(e) + ' of ' + Jh(t));
  2020. },
  2021. al = Mn('splice'),
  2022. ul = Math.max,
  2023. cl = Math.min;
  2024. qh(
  2025. { target: 'Array', proto: !0, forced: !al },
  2026. {
  2027. splice: function (t, e) {
  2028. var r,
  2029. n,
  2030. i,
  2031. o,
  2032. s,
  2033. a,
  2034. u = Qh(this),
  2035. c = el(u),
  2036. h = $h(t, c),
  2037. l = arguments.length;
  2038. for (
  2039. 0 === l
  2040. ? (r = n = 0)
  2041. : 1 === l
  2042. ? ((r = 0), (n = c - h))
  2043. : ((r = l - 2), (n = cl(ul(tl(e), 0), c - h))),
  2044. nl(c + r - n),
  2045. i = il(u, n),
  2046. o = 0;
  2047. o < n;
  2048. o++
  2049. )
  2050. (s = h + o) in u && ol(i, o, u[s]);
  2051. if (((i.length = n), r < n)) {
  2052. for (o = h; o < c - n; o++)
  2053. (a = o + r), (s = o + n) in u ? (u[a] = u[s]) : sl(u, a);
  2054. for (o = c; o > c - n + r; o--) sl(u, o - 1);
  2055. } else if (r > n)
  2056. for (o = c - n; o > h; o--)
  2057. (a = o + r - 1), (s = o + n - 1) in u ? (u[a] = u[s]) : sl(u, a);
  2058. for (o = 0; o < r; o++) u[o + h] = arguments[o + 2];
  2059. return rl(u, c - n + r), i;
  2060. },
  2061. }
  2062. );
  2063. var hl = sh('Array').splice,
  2064. ll = ut,
  2065. dl = hl,
  2066. fl = Array.prototype,
  2067. pl = function (t) {
  2068. var e = t.splice;
  2069. return t === fl || (ll(fl, t) && e === fl.splice) ? dl : e;
  2070. },
  2071. vl = Ar,
  2072. ml = ts.find,
  2073. yl = 'find',
  2074. gl = !0;
  2075. yl in [] &&
  2076. Array(1).find(function () {
  2077. gl = !1;
  2078. }),
  2079. vl(
  2080. { target: 'Array', proto: !0, forced: gl },
  2081. {
  2082. find: function (t) {
  2083. return ml(this, t, arguments.length > 1 ? arguments[1] : void 0);
  2084. },
  2085. }
  2086. );
  2087. var _l = sh('Array').find,
  2088. bl = ut,
  2089. Tl = _l,
  2090. xl = Array.prototype,
  2091. El = function (t) {
  2092. var e = t.find;
  2093. return t === xl || (bl(xl, t) && e === xl.find) ? Tl : e;
  2094. },
  2095. Sl = Zt,
  2096. wl = yi;
  2097. Ar(
  2098. {
  2099. target: 'Object',
  2100. stat: !0,
  2101. forced: s(function () {
  2102. wl(1);
  2103. }),
  2104. },
  2105. {
  2106. keys: function (t) {
  2107. return wl(Sl(t));
  2108. },
  2109. }
  2110. );
  2111. var Rl = rt.Object.keys,
  2112. Cl = si.includes;
  2113. Ar(
  2114. {
  2115. target: 'Array',
  2116. proto: !0,
  2117. forced: s(function () {
  2118. return !Array(1).includes();
  2119. }),
  2120. },
  2121. {
  2122. includes: function (t) {
  2123. return Cl(this, t, arguments.length > 1 ? arguments[1] : void 0);
  2124. },
  2125. }
  2126. );
  2127. var Pl = sh('Array').includes,
  2128. Al = et,
  2129. Ol = T,
  2130. Il = fe('match'),
  2131. Ml = function (t) {
  2132. var e;
  2133. return Al(t) && (void 0 !== (e = t[Il]) ? !!e : 'RegExp' == Ol(t));
  2134. },
  2135. Dl = TypeError,
  2136. Ll = function (t) {
  2137. if (Ml(t)) throw Dl("The method doesn't accept regular expressions");
  2138. return t;
  2139. },
  2140. Fl = fe('match'),
  2141. Nl = function (t) {
  2142. var e = /./;
  2143. try {
  2144. '/./'[t](e);
  2145. } catch (r) {
  2146. try {
  2147. return (e[Fl] = !1), '/./'[t](e);
  2148. } catch (t) {}
  2149. }
  2150. return !1;
  2151. },
  2152. kl = Ar,
  2153. Bl = Ll,
  2154. Gl = J,
  2155. Ul = Kn,
  2156. jl = Nl,
  2157. Xl = S(''.indexOf);
  2158. kl(
  2159. { target: 'String', proto: !0, forced: !jl('includes') },
  2160. {
  2161. includes: function (t) {
  2162. return !!~Xl(
  2163. Ul(Gl(this)),
  2164. Ul(Bl(t)),
  2165. arguments.length > 1 ? arguments[1] : void 0
  2166. );
  2167. },
  2168. }
  2169. );
  2170. var Vl = sh('String').includes,
  2171. Hl = ut,
  2172. Wl = Pl,
  2173. Yl = Vl,
  2174. zl = Array.prototype,
  2175. Zl = String.prototype,
  2176. Jl = function (t) {
  2177. var e = t.includes;
  2178. return t === zl || (Hl(zl, t) && e === zl.includes)
  2179. ? Wl
  2180. : 'string' == typeof t || t === Zl || (Hl(Zl, t) && e === Zl.includes)
  2181. ? Yl
  2182. : e;
  2183. },
  2184. Kl = TypeError,
  2185. ql = function (t, e) {
  2186. if (t < e) throw Kl('Not enough arguments');
  2187. return t;
  2188. },
  2189. Ql = o,
  2190. $l = d,
  2191. td = P,
  2192. ed = xa,
  2193. rd = ql,
  2194. nd = /MSIE .\./.test(ct),
  2195. id = Ql.Function,
  2196. od = function (t) {
  2197. return nd
  2198. ? function (e, r) {
  2199. var n = rd(arguments.length, 1) > 2,
  2200. i = td(e) ? e : id(e),
  2201. o = n ? ed(arguments, 2) : void 0;
  2202. return t(
  2203. n
  2204. ? function () {
  2205. $l(i, this, o);
  2206. }
  2207. : i,
  2208. r
  2209. );
  2210. }
  2211. : t;
  2212. },
  2213. sd = { setTimeout: od(Ql.setTimeout), setInterval: od(Ql.setInterval) },
  2214. ad = sd.setInterval;
  2215. Ar(
  2216. { global: !0, bind: !0, forced: o.setInterval !== ad },
  2217. { setInterval: ad }
  2218. );
  2219. var ud = sd.setTimeout;
  2220. Ar({ global: !0, bind: !0, forced: o.setTimeout !== ud }, { setTimeout: ud });
  2221. var cd = rt.setTimeout,
  2222. hd = ts.map;
  2223. Ar(
  2224. { target: 'Array', proto: !0, forced: !Mn('map') },
  2225. {
  2226. map: function (t) {
  2227. return hd(this, t, arguments.length > 1 ? arguments[1] : void 0);
  2228. },
  2229. }
  2230. );
  2231. var ld = sh('Array').map,
  2232. dd = ut,
  2233. fd = ld,
  2234. pd = Array.prototype,
  2235. vd = function (t) {
  2236. var e = t.map;
  2237. return t === pd || (dd(pd, t) && e === pd.map) ? fd : e;
  2238. },
  2239. md = ts.some;
  2240. Ar(
  2241. { target: 'Array', proto: !0, forced: !gh('some') },
  2242. {
  2243. some: function (t) {
  2244. return md(this, t, arguments.length > 1 ? arguments[1] : void 0);
  2245. },
  2246. }
  2247. );
  2248. var yd = sh('Array').some,
  2249. gd = ut,
  2250. _d = yd,
  2251. bd = Array.prototype,
  2252. Td = function (t) {
  2253. var e = t.some;
  2254. return t === bd || (gd(bd, t) && e === bd.some) ? _d : e;
  2255. },
  2256. xd = function () {
  2257. return (
  2258. (xd =
  2259. Object.assign ||
  2260. function (t) {
  2261. for (var e, r = 1, n = arguments.length; r < n; r++)
  2262. for (var i in (e = arguments[r]))
  2263. Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
  2264. return t;
  2265. }),
  2266. xd.apply(this, arguments)
  2267. );
  2268. };
  2269. function Ed(t, e, r, n) {
  2270. return new (r || (r = Promise))(function (i, o) {
  2271. function s(t) {
  2272. try {
  2273. u(n.next(t));
  2274. } catch (t) {
  2275. o(t);
  2276. }
  2277. }
  2278. function a(t) {
  2279. try {
  2280. u(n.throw(t));
  2281. } catch (t) {
  2282. o(t);
  2283. }
  2284. }
  2285. function u(t) {
  2286. var e;
  2287. t.done
  2288. ? i(t.value)
  2289. : ((e = t.value),
  2290. e instanceof r
  2291. ? e
  2292. : new r(function (t) {
  2293. t(e);
  2294. })).then(s, a);
  2295. }
  2296. u((n = n.apply(t, e || [])).next());
  2297. });
  2298. }
  2299. function Sd(t, e) {
  2300. var r,
  2301. n,
  2302. i,
  2303. o,
  2304. s = {
  2305. label: 0,
  2306. sent: function () {
  2307. if (1 & i[0]) throw i[1];
  2308. return i[1];
  2309. },
  2310. trys: [],
  2311. ops: [],
  2312. };
  2313. return (
  2314. (o = { next: a(0), throw: a(1), return: a(2) }),
  2315. 'function' == typeof Symbol &&
  2316. (o[Symbol.iterator] = function () {
  2317. return this;
  2318. }),
  2319. o
  2320. );
  2321. function a(o) {
  2322. return function (a) {
  2323. return (function (o) {
  2324. if (r) throw new TypeError('Generator is already executing.');
  2325. for (; s; )
  2326. try {
  2327. if (
  2328. ((r = 1),
  2329. n &&
  2330. (i =
  2331. 2 & o[0]
  2332. ? n.return
  2333. : o[0]
  2334. ? n.throw || ((i = n.return) && i.call(n), 0)
  2335. : n.next) &&
  2336. !(i = i.call(n, o[1])).done)
  2337. )
  2338. return i;
  2339. switch (((n = 0), i && (o = [2 & o[0], i.value]), o[0])) {
  2340. case 0:
  2341. case 1:
  2342. i = o;
  2343. break;
  2344. case 4:
  2345. return s.label++, { value: o[1], done: !1 };
  2346. case 5:
  2347. s.label++, (n = o[1]), (o = [0]);
  2348. continue;
  2349. case 7:
  2350. (o = s.ops.pop()), s.trys.pop();
  2351. continue;
  2352. default:
  2353. if (
  2354. !((i = s.trys),
  2355. (i = i.length > 0 && i[i.length - 1]) ||
  2356. (6 !== o[0] && 2 !== o[0]))
  2357. ) {
  2358. s = 0;
  2359. continue;
  2360. }
  2361. if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) {
  2362. s.label = o[1];
  2363. break;
  2364. }
  2365. if (6 === o[0] && s.label < i[1]) {
  2366. (s.label = i[1]), (i = o);
  2367. break;
  2368. }
  2369. if (i && s.label < i[2]) {
  2370. (s.label = i[2]), s.ops.push(o);
  2371. break;
  2372. }
  2373. i[2] && s.ops.pop(), s.trys.pop();
  2374. continue;
  2375. }
  2376. o = e.call(t, s);
  2377. } catch (t) {
  2378. (o = [6, t]), (n = 0);
  2379. } finally {
  2380. r = i = 0;
  2381. }
  2382. if (5 & o[0]) throw o[1];
  2383. return { value: o[0] ? o[1] : void 0, done: !0 };
  2384. })([o, a]);
  2385. };
  2386. }
  2387. }
  2388. function wd(t) {
  2389. var e = 'function' == typeof Symbol && Symbol.iterator,
  2390. r = e && t[e],
  2391. n = 0;
  2392. if (r) return r.call(t);
  2393. if (t && 'number' == typeof t.length)
  2394. return {
  2395. next: function () {
  2396. return (
  2397. t && n >= t.length && (t = void 0), { value: t && t[n++], done: !t }
  2398. );
  2399. },
  2400. };
  2401. throw new TypeError(
  2402. e ? 'Object is not iterable.' : 'Symbol.iterator is not defined.'
  2403. );
  2404. }
  2405. function Rd(t, e) {
  2406. var r = 'function' == typeof Symbol && t[Symbol.iterator];
  2407. if (!r) return t;
  2408. var n,
  2409. i,
  2410. o = r.call(t),
  2411. s = [];
  2412. try {
  2413. for (; (void 0 === e || e-- > 0) && !(n = o.next()).done; )
  2414. s.push(n.value);
  2415. } catch (t) {
  2416. i = { error: t };
  2417. } finally {
  2418. try {
  2419. n && !n.done && (r = o.return) && r.call(o);
  2420. } finally {
  2421. if (i) throw i.error;
  2422. }
  2423. }
  2424. return s;
  2425. }
  2426. let Cd = !0,
  2427. Pd = !0;
  2428. function Ad(t, e, r) {
  2429. const n = t.match(e);
  2430. return n && n.length >= r && parseInt(n[r], 10);
  2431. }
  2432. function Od(t, e, r) {
  2433. if (!t.RTCPeerConnection) return;
  2434. const n = t.RTCPeerConnection.prototype,
  2435. i = n.addEventListener;
  2436. n.addEventListener = function (t, n) {
  2437. if (t !== e) return i.apply(this, arguments);
  2438. const o = (t) => {
  2439. const e = r(t);
  2440. e && (n.handleEvent ? n.handleEvent(e) : n(e));
  2441. };
  2442. return (
  2443. (this._eventMap = this._eventMap || {}),
  2444. this._eventMap[e] || (this._eventMap[e] = new Map()),
  2445. this._eventMap[e].set(n, o),
  2446. i.apply(this, [t, o])
  2447. );
  2448. };
  2449. const o = n.removeEventListener;
  2450. (n.removeEventListener = function (t, r) {
  2451. if (t !== e || !this._eventMap || !this._eventMap[e])
  2452. return o.apply(this, arguments);
  2453. if (!this._eventMap[e].has(r)) return o.apply(this, arguments);
  2454. const n = this._eventMap[e].get(r);
  2455. return (
  2456. this._eventMap[e].delete(r),
  2457. 0 === this._eventMap[e].size && delete this._eventMap[e],
  2458. 0 === Object.keys(this._eventMap).length && delete this._eventMap,
  2459. o.apply(this, [t, n])
  2460. );
  2461. }),
  2462. Object.defineProperty(n, 'on' + e, {
  2463. get() {
  2464. return this['_on' + e];
  2465. },
  2466. set(t) {
  2467. this['_on' + e] &&
  2468. (this.removeEventListener(e, this['_on' + e]),
  2469. delete this['_on' + e]),
  2470. t && this.addEventListener(e, (this['_on' + e] = t));
  2471. },
  2472. enumerable: !0,
  2473. configurable: !0,
  2474. });
  2475. }
  2476. function Id(t) {
  2477. return 'boolean' != typeof t
  2478. ? new Error('Argument type: ' + typeof t + '. Please use a boolean.')
  2479. : ((Cd = t),
  2480. t ? 'adapter.js logging disabled' : 'adapter.js logging enabled');
  2481. }
  2482. function Md(t) {
  2483. return 'boolean' != typeof t
  2484. ? new Error('Argument type: ' + typeof t + '. Please use a boolean.')
  2485. : ((Pd = !t),
  2486. 'adapter.js deprecation warnings ' + (t ? 'disabled' : 'enabled'));
  2487. }
  2488. function Dd() {
  2489. if ('object' == typeof window) {
  2490. if (Cd) return;
  2491. 'undefined' != typeof console &&
  2492. 'function' == typeof console.log &&
  2493. console.log.apply(console, arguments);
  2494. }
  2495. }
  2496. function Ld(t, e) {
  2497. Pd && console.warn(t + ' is deprecated, please use ' + e + ' instead.');
  2498. }
  2499. function Fd(t) {
  2500. return '[object Object]' === Object.prototype.toString.call(t);
  2501. }
  2502. function Nd(t) {
  2503. return Fd(t)
  2504. ? Object.keys(t).reduce(function (e, r) {
  2505. const n = Fd(t[r]),
  2506. i = n ? Nd(t[r]) : t[r],
  2507. o = n && !Object.keys(i).length;
  2508. return void 0 === i || o ? e : Object.assign(e, { [r]: i });
  2509. }, {})
  2510. : t;
  2511. }
  2512. function kd(t, e, r) {
  2513. e &&
  2514. !r.has(e.id) &&
  2515. (r.set(e.id, e),
  2516. Object.keys(e).forEach((n) => {
  2517. n.endsWith('Id')
  2518. ? kd(t, t.get(e[n]), r)
  2519. : n.endsWith('Ids') &&
  2520. e[n].forEach((e) => {
  2521. kd(t, t.get(e), r);
  2522. });
  2523. }));
  2524. }
  2525. function Bd(t, e, r) {
  2526. const n = r ? 'outbound-rtp' : 'inbound-rtp',
  2527. i = new Map();
  2528. if (null === e) return i;
  2529. const o = [];
  2530. return (
  2531. t.forEach((t) => {
  2532. 'track' === t.type && t.trackIdentifier === e.id && o.push(t);
  2533. }),
  2534. o.forEach((e) => {
  2535. t.forEach((r) => {
  2536. r.type === n && r.trackId === e.id && kd(t, r, i);
  2537. });
  2538. }),
  2539. i
  2540. );
  2541. }
  2542. const Gd = Dd;
  2543. function Ud(t, e) {
  2544. const r = t && t.navigator;
  2545. if (!r.mediaDevices) return;
  2546. const n = function (t) {
  2547. if ('object' != typeof t || t.mandatory || t.optional) return t;
  2548. const e = {};
  2549. return (
  2550. Object.keys(t).forEach((r) => {
  2551. if ('require' === r || 'advanced' === r || 'mediaSource' === r)
  2552. return;
  2553. const n = 'object' == typeof t[r] ? t[r] : { ideal: t[r] };
  2554. void 0 !== n.exact &&
  2555. 'number' == typeof n.exact &&
  2556. (n.min = n.max = n.exact);
  2557. const i = function (t, e) {
  2558. return t
  2559. ? t + e.charAt(0).toUpperCase() + e.slice(1)
  2560. : 'deviceId' === e
  2561. ? 'sourceId'
  2562. : e;
  2563. };
  2564. if (void 0 !== n.ideal) {
  2565. e.optional = e.optional || [];
  2566. let t = {};
  2567. 'number' == typeof n.ideal
  2568. ? ((t[i('min', r)] = n.ideal),
  2569. e.optional.push(t),
  2570. (t = {}),
  2571. (t[i('max', r)] = n.ideal),
  2572. e.optional.push(t))
  2573. : ((t[i('', r)] = n.ideal), e.optional.push(t));
  2574. }
  2575. void 0 !== n.exact && 'number' != typeof n.exact
  2576. ? ((e.mandatory = e.mandatory || {}),
  2577. (e.mandatory[i('', r)] = n.exact))
  2578. : ['min', 'max'].forEach((t) => {
  2579. void 0 !== n[t] &&
  2580. ((e.mandatory = e.mandatory || {}),
  2581. (e.mandatory[i(t, r)] = n[t]));
  2582. });
  2583. }),
  2584. t.advanced && (e.optional = (e.optional || []).concat(t.advanced)),
  2585. e
  2586. );
  2587. },
  2588. i = function (t, i) {
  2589. if (e.version >= 61) return i(t);
  2590. if ((t = JSON.parse(JSON.stringify(t))) && 'object' == typeof t.audio) {
  2591. const e = function (t, e, r) {
  2592. e in t && !(r in t) && ((t[r] = t[e]), delete t[e]);
  2593. };
  2594. e(
  2595. (t = JSON.parse(JSON.stringify(t))).audio,
  2596. 'autoGainControl',
  2597. 'googAutoGainControl'
  2598. ),
  2599. e(t.audio, 'noiseSuppression', 'googNoiseSuppression'),
  2600. (t.audio = n(t.audio));
  2601. }
  2602. if (t && 'object' == typeof t.video) {
  2603. let o = t.video.facingMode;
  2604. o = o && ('object' == typeof o ? o : { ideal: o });
  2605. const s = e.version < 66;
  2606. if (
  2607. o &&
  2608. ('user' === o.exact ||
  2609. 'environment' === o.exact ||
  2610. 'user' === o.ideal ||
  2611. 'environment' === o.ideal) &&
  2612. (!r.mediaDevices.getSupportedConstraints ||
  2613. !r.mediaDevices.getSupportedConstraints().facingMode ||
  2614. s)
  2615. ) {
  2616. let e;
  2617. if (
  2618. (delete t.video.facingMode,
  2619. 'environment' === o.exact || 'environment' === o.ideal
  2620. ? (e = ['back', 'rear'])
  2621. : ('user' !== o.exact && 'user' !== o.ideal) || (e = ['front']),
  2622. e)
  2623. )
  2624. return r.mediaDevices.enumerateDevices().then((r) => {
  2625. r = r.filter((t) => 'videoinput' === t.kind);
  2626. let s = r.find((t) =>
  2627. e.some((e) => t.label.toLowerCase().includes(e))
  2628. );
  2629. return (
  2630. !s && r.length && e.includes('back') && (s = r[r.length - 1]),
  2631. s &&
  2632. (t.video.deviceId = o.exact
  2633. ? { exact: s.deviceId }
  2634. : { ideal: s.deviceId }),
  2635. (t.video = n(t.video)),
  2636. Gd('chrome: ' + JSON.stringify(t)),
  2637. i(t)
  2638. );
  2639. });
  2640. }
  2641. t.video = n(t.video);
  2642. }
  2643. return Gd('chrome: ' + JSON.stringify(t)), i(t);
  2644. },
  2645. o = function (t) {
  2646. return e.version >= 64
  2647. ? t
  2648. : {
  2649. name:
  2650. {
  2651. PermissionDeniedError: 'NotAllowedError',
  2652. PermissionDismissedError: 'NotAllowedError',
  2653. InvalidStateError: 'NotAllowedError',
  2654. DevicesNotFoundError: 'NotFoundError',
  2655. ConstraintNotSatisfiedError: 'OverconstrainedError',
  2656. TrackStartError: 'NotReadableError',
  2657. MediaDeviceFailedDueToShutdown: 'NotAllowedError',
  2658. MediaDeviceKillSwitchOn: 'NotAllowedError',
  2659. TabCaptureError: 'AbortError',
  2660. ScreenCaptureError: 'AbortError',
  2661. DeviceCaptureError: 'AbortError',
  2662. }[t.name] || t.name,
  2663. message: t.message,
  2664. constraint: t.constraint || t.constraintName,
  2665. toString() {
  2666. return this.name + (this.message && ': ') + this.message;
  2667. },
  2668. };
  2669. };
  2670. if (
  2671. ((r.getUserMedia = function (t, e, n) {
  2672. i(t, (t) => {
  2673. r.webkitGetUserMedia(t, e, (t) => {
  2674. n && n(o(t));
  2675. });
  2676. });
  2677. }.bind(r)),
  2678. r.mediaDevices.getUserMedia)
  2679. ) {
  2680. const t = r.mediaDevices.getUserMedia.bind(r.mediaDevices);
  2681. r.mediaDevices.getUserMedia = function (e) {
  2682. return i(e, (e) =>
  2683. t(e).then(
  2684. (t) => {
  2685. if (
  2686. (e.audio && !t.getAudioTracks().length) ||
  2687. (e.video && !t.getVideoTracks().length)
  2688. )
  2689. throw (
  2690. (t.getTracks().forEach((t) => {
  2691. t.stop();
  2692. }),
  2693. new DOMException('', 'NotFoundError'))
  2694. );
  2695. return t;
  2696. },
  2697. (t) => Promise.reject(o(t))
  2698. )
  2699. );
  2700. };
  2701. }
  2702. }
  2703. function jd(t) {
  2704. t.MediaStream = t.MediaStream || t.webkitMediaStream;
  2705. }
  2706. function Xd(t) {
  2707. if (
  2708. 'object' == typeof t &&
  2709. t.RTCPeerConnection &&
  2710. !('ontrack' in t.RTCPeerConnection.prototype)
  2711. ) {
  2712. Object.defineProperty(t.RTCPeerConnection.prototype, 'ontrack', {
  2713. get() {
  2714. return this._ontrack;
  2715. },
  2716. set(t) {
  2717. this._ontrack && this.removeEventListener('track', this._ontrack),
  2718. this.addEventListener('track', (this._ontrack = t));
  2719. },
  2720. enumerable: !0,
  2721. configurable: !0,
  2722. });
  2723. const e = t.RTCPeerConnection.prototype.setRemoteDescription;
  2724. t.RTCPeerConnection.prototype.setRemoteDescription = function () {
  2725. return (
  2726. this._ontrackpoly ||
  2727. ((this._ontrackpoly = (e) => {
  2728. e.stream.addEventListener('addtrack', (r) => {
  2729. let n;
  2730. n = t.RTCPeerConnection.prototype.getReceivers
  2731. ? this.getReceivers().find(
  2732. (t) => t.track && t.track.id === r.track.id
  2733. )
  2734. : { track: r.track };
  2735. const i = new Event('track');
  2736. (i.track = r.track),
  2737. (i.receiver = n),
  2738. (i.transceiver = { receiver: n }),
  2739. (i.streams = [e.stream]),
  2740. this.dispatchEvent(i);
  2741. }),
  2742. e.stream.getTracks().forEach((r) => {
  2743. let n;
  2744. n = t.RTCPeerConnection.prototype.getReceivers
  2745. ? this.getReceivers().find(
  2746. (t) => t.track && t.track.id === r.id
  2747. )
  2748. : { track: r };
  2749. const i = new Event('track');
  2750. (i.track = r),
  2751. (i.receiver = n),
  2752. (i.transceiver = { receiver: n }),
  2753. (i.streams = [e.stream]),
  2754. this.dispatchEvent(i);
  2755. });
  2756. }),
  2757. this.addEventListener('addstream', this._ontrackpoly)),
  2758. e.apply(this, arguments)
  2759. );
  2760. };
  2761. } else
  2762. Od(
  2763. t,
  2764. 'track',
  2765. (t) => (
  2766. t.transceiver ||
  2767. Object.defineProperty(t, 'transceiver', {
  2768. value: { receiver: t.receiver },
  2769. }),
  2770. t
  2771. )
  2772. );
  2773. }
  2774. function Vd(t) {
  2775. if (
  2776. 'object' == typeof t &&
  2777. t.RTCPeerConnection &&
  2778. !('getSenders' in t.RTCPeerConnection.prototype) &&
  2779. 'createDTMFSender' in t.RTCPeerConnection.prototype
  2780. ) {
  2781. const e = function (t, e) {
  2782. return {
  2783. track: e,
  2784. get dtmf() {
  2785. return (
  2786. void 0 === this._dtmf &&
  2787. ('audio' === e.kind
  2788. ? (this._dtmf = t.createDTMFSender(e))
  2789. : (this._dtmf = null)),
  2790. this._dtmf
  2791. );
  2792. },
  2793. _pc: t,
  2794. };
  2795. };
  2796. if (!t.RTCPeerConnection.prototype.getSenders) {
  2797. t.RTCPeerConnection.prototype.getSenders = function () {
  2798. return (this._senders = this._senders || []), this._senders.slice();
  2799. };
  2800. const r = t.RTCPeerConnection.prototype.addTrack;
  2801. t.RTCPeerConnection.prototype.addTrack = function (t, n) {
  2802. let i = r.apply(this, arguments);
  2803. return i || ((i = e(this, t)), this._senders.push(i)), i;
  2804. };
  2805. const n = t.RTCPeerConnection.prototype.removeTrack;
  2806. t.RTCPeerConnection.prototype.removeTrack = function (t) {
  2807. n.apply(this, arguments);
  2808. const e = this._senders.indexOf(t);
  2809. -1 !== e && this._senders.splice(e, 1);
  2810. };
  2811. }
  2812. const r = t.RTCPeerConnection.prototype.addStream;
  2813. t.RTCPeerConnection.prototype.addStream = function (t) {
  2814. (this._senders = this._senders || []),
  2815. r.apply(this, [t]),
  2816. t.getTracks().forEach((t) => {
  2817. this._senders.push(e(this, t));
  2818. });
  2819. };
  2820. const n = t.RTCPeerConnection.prototype.removeStream;
  2821. t.RTCPeerConnection.prototype.removeStream = function (t) {
  2822. (this._senders = this._senders || []),
  2823. n.apply(this, [t]),
  2824. t.getTracks().forEach((t) => {
  2825. const e = this._senders.find((e) => e.track === t);
  2826. e && this._senders.splice(this._senders.indexOf(e), 1);
  2827. });
  2828. };
  2829. } else if (
  2830. 'object' == typeof t &&
  2831. t.RTCPeerConnection &&
  2832. 'getSenders' in t.RTCPeerConnection.prototype &&
  2833. 'createDTMFSender' in t.RTCPeerConnection.prototype &&
  2834. t.RTCRtpSender &&
  2835. !('dtmf' in t.RTCRtpSender.prototype)
  2836. ) {
  2837. const e = t.RTCPeerConnection.prototype.getSenders;
  2838. (t.RTCPeerConnection.prototype.getSenders = function () {
  2839. const t = e.apply(this, []);
  2840. return t.forEach((t) => (t._pc = this)), t;
  2841. }),
  2842. Object.defineProperty(t.RTCRtpSender.prototype, 'dtmf', {
  2843. get() {
  2844. return (
  2845. void 0 === this._dtmf &&
  2846. ('audio' === this.track.kind
  2847. ? (this._dtmf = this._pc.createDTMFSender(this.track))
  2848. : (this._dtmf = null)),
  2849. this._dtmf
  2850. );
  2851. },
  2852. });
  2853. }
  2854. }
  2855. function Hd(t) {
  2856. if (!t.RTCPeerConnection) return;
  2857. const e = t.RTCPeerConnection.prototype.getStats;
  2858. t.RTCPeerConnection.prototype.getStats = function () {
  2859. const [t, r, n] = arguments;
  2860. if (arguments.length > 0 && 'function' == typeof t)
  2861. return e.apply(this, arguments);
  2862. if (0 === e.length && (0 === arguments.length || 'function' != typeof t))
  2863. return e.apply(this, []);
  2864. const i = function (t) {
  2865. const e = {};
  2866. return (
  2867. t.result().forEach((t) => {
  2868. const r = {
  2869. id: t.id,
  2870. timestamp: t.timestamp,
  2871. type:
  2872. {
  2873. localcandidate: 'local-candidate',
  2874. remotecandidate: 'remote-candidate',
  2875. }[t.type] || t.type,
  2876. };
  2877. t.names().forEach((e) => {
  2878. r[e] = t.stat(e);
  2879. }),
  2880. (e[r.id] = r);
  2881. }),
  2882. e
  2883. );
  2884. },
  2885. o = function (t) {
  2886. return new Map(Object.keys(t).map((e) => [e, t[e]]));
  2887. };
  2888. if (arguments.length >= 2) {
  2889. const n = function (t) {
  2890. r(o(i(t)));
  2891. };
  2892. return e.apply(this, [n, t]);
  2893. }
  2894. return new Promise((t, r) => {
  2895. e.apply(this, [
  2896. function (e) {
  2897. t(o(i(e)));
  2898. },
  2899. r,
  2900. ]);
  2901. }).then(r, n);
  2902. };
  2903. }
  2904. function Wd(t) {
  2905. if (
  2906. !(
  2907. 'object' == typeof t &&
  2908. t.RTCPeerConnection &&
  2909. t.RTCRtpSender &&
  2910. t.RTCRtpReceiver
  2911. )
  2912. )
  2913. return;
  2914. if (!('getStats' in t.RTCRtpSender.prototype)) {
  2915. const e = t.RTCPeerConnection.prototype.getSenders;
  2916. e &&
  2917. (t.RTCPeerConnection.prototype.getSenders = function () {
  2918. const t = e.apply(this, []);
  2919. return t.forEach((t) => (t._pc = this)), t;
  2920. });
  2921. const r = t.RTCPeerConnection.prototype.addTrack;
  2922. r &&
  2923. (t.RTCPeerConnection.prototype.addTrack = function () {
  2924. const t = r.apply(this, arguments);
  2925. return (t._pc = this), t;
  2926. }),
  2927. (t.RTCRtpSender.prototype.getStats = function () {
  2928. const t = this;
  2929. return this._pc.getStats().then((e) => Bd(e, t.track, !0));
  2930. });
  2931. }
  2932. if (!('getStats' in t.RTCRtpReceiver.prototype)) {
  2933. const e = t.RTCPeerConnection.prototype.getReceivers;
  2934. e &&
  2935. (t.RTCPeerConnection.prototype.getReceivers = function () {
  2936. const t = e.apply(this, []);
  2937. return t.forEach((t) => (t._pc = this)), t;
  2938. }),
  2939. Od(t, 'track', (t) => ((t.receiver._pc = t.srcElement), t)),
  2940. (t.RTCRtpReceiver.prototype.getStats = function () {
  2941. const t = this;
  2942. return this._pc.getStats().then((e) => Bd(e, t.track, !1));
  2943. });
  2944. }
  2945. if (
  2946. !('getStats' in t.RTCRtpSender.prototype) ||
  2947. !('getStats' in t.RTCRtpReceiver.prototype)
  2948. )
  2949. return;
  2950. const e = t.RTCPeerConnection.prototype.getStats;
  2951. t.RTCPeerConnection.prototype.getStats = function () {
  2952. if (arguments.length > 0 && arguments[0] instanceof t.MediaStreamTrack) {
  2953. const t = arguments[0];
  2954. let e, r, n;
  2955. return (
  2956. this.getSenders().forEach((r) => {
  2957. r.track === t && (e ? (n = !0) : (e = r));
  2958. }),
  2959. this.getReceivers().forEach(
  2960. (e) => (e.track === t && (r ? (n = !0) : (r = e)), e.track === t)
  2961. ),
  2962. n || (e && r)
  2963. ? Promise.reject(
  2964. new DOMException(
  2965. 'There are more than one sender or receiver for the track.',
  2966. 'InvalidAccessError'
  2967. )
  2968. )
  2969. : e
  2970. ? e.getStats()
  2971. : r
  2972. ? r.getStats()
  2973. : Promise.reject(
  2974. new DOMException(
  2975. 'There is no sender or receiver for the track.',
  2976. 'InvalidAccessError'
  2977. )
  2978. )
  2979. );
  2980. }
  2981. return e.apply(this, arguments);
  2982. };
  2983. }
  2984. function Yd(t) {
  2985. t.RTCPeerConnection.prototype.getLocalStreams = function () {
  2986. return (
  2987. (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
  2988. Object.keys(this._shimmedLocalStreams).map(
  2989. (t) => this._shimmedLocalStreams[t][0]
  2990. )
  2991. );
  2992. };
  2993. const e = t.RTCPeerConnection.prototype.addTrack;
  2994. t.RTCPeerConnection.prototype.addTrack = function (t, r) {
  2995. if (!r) return e.apply(this, arguments);
  2996. this._shimmedLocalStreams = this._shimmedLocalStreams || {};
  2997. const n = e.apply(this, arguments);
  2998. return (
  2999. this._shimmedLocalStreams[r.id]
  3000. ? -1 === this._shimmedLocalStreams[r.id].indexOf(n) &&
  3001. this._shimmedLocalStreams[r.id].push(n)
  3002. : (this._shimmedLocalStreams[r.id] = [r, n]),
  3003. n
  3004. );
  3005. };
  3006. const r = t.RTCPeerConnection.prototype.addStream;
  3007. t.RTCPeerConnection.prototype.addStream = function (t) {
  3008. (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
  3009. t.getTracks().forEach((t) => {
  3010. const e = this.getSenders().find((e) => e.track === t);
  3011. if (e)
  3012. throw new DOMException(
  3013. 'Track already exists.',
  3014. 'InvalidAccessError'
  3015. );
  3016. });
  3017. const e = this.getSenders();
  3018. r.apply(this, arguments);
  3019. const n = this.getSenders().filter((t) => -1 === e.indexOf(t));
  3020. this._shimmedLocalStreams[t.id] = [t].concat(n);
  3021. };
  3022. const n = t.RTCPeerConnection.prototype.removeStream;
  3023. t.RTCPeerConnection.prototype.removeStream = function (t) {
  3024. return (
  3025. (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
  3026. delete this._shimmedLocalStreams[t.id],
  3027. n.apply(this, arguments)
  3028. );
  3029. };
  3030. const i = t.RTCPeerConnection.prototype.removeTrack;
  3031. t.RTCPeerConnection.prototype.removeTrack = function (t) {
  3032. return (
  3033. (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
  3034. t &&
  3035. Object.keys(this._shimmedLocalStreams).forEach((e) => {
  3036. const r = this._shimmedLocalStreams[e].indexOf(t);
  3037. -1 !== r && this._shimmedLocalStreams[e].splice(r, 1),
  3038. 1 === this._shimmedLocalStreams[e].length &&
  3039. delete this._shimmedLocalStreams[e];
  3040. }),
  3041. i.apply(this, arguments)
  3042. );
  3043. };
  3044. }
  3045. function zd(t, e) {
  3046. if (!t.RTCPeerConnection) return;
  3047. if (t.RTCPeerConnection.prototype.addTrack && e.version >= 65) return Yd(t);
  3048. const r = t.RTCPeerConnection.prototype.getLocalStreams;
  3049. t.RTCPeerConnection.prototype.getLocalStreams = function () {
  3050. const t = r.apply(this);
  3051. return (
  3052. (this._reverseStreams = this._reverseStreams || {}),
  3053. t.map((t) => this._reverseStreams[t.id])
  3054. );
  3055. };
  3056. const n = t.RTCPeerConnection.prototype.addStream;
  3057. t.RTCPeerConnection.prototype.addStream = function (e) {
  3058. if (
  3059. ((this._streams = this._streams || {}),
  3060. (this._reverseStreams = this._reverseStreams || {}),
  3061. e.getTracks().forEach((t) => {
  3062. const e = this.getSenders().find((e) => e.track === t);
  3063. if (e)
  3064. throw new DOMException(
  3065. 'Track already exists.',
  3066. 'InvalidAccessError'
  3067. );
  3068. }),
  3069. !this._reverseStreams[e.id])
  3070. ) {
  3071. const r = new t.MediaStream(e.getTracks());
  3072. (this._streams[e.id] = r), (this._reverseStreams[r.id] = e), (e = r);
  3073. }
  3074. n.apply(this, [e]);
  3075. };
  3076. const i = t.RTCPeerConnection.prototype.removeStream;
  3077. function o(t, e) {
  3078. let r = e.sdp;
  3079. return (
  3080. Object.keys(t._reverseStreams || []).forEach((e) => {
  3081. const n = t._reverseStreams[e],
  3082. i = t._streams[n.id];
  3083. r = r.replace(new RegExp(i.id, 'g'), n.id);
  3084. }),
  3085. new RTCSessionDescription({ type: e.type, sdp: r })
  3086. );
  3087. }
  3088. function s(t, e) {
  3089. let r = e.sdp;
  3090. return (
  3091. Object.keys(t._reverseStreams || []).forEach((e) => {
  3092. const n = t._reverseStreams[e],
  3093. i = t._streams[n.id];
  3094. r = r.replace(new RegExp(n.id, 'g'), i.id);
  3095. }),
  3096. new RTCSessionDescription({ type: e.type, sdp: r })
  3097. );
  3098. }
  3099. (t.RTCPeerConnection.prototype.removeStream = function (t) {
  3100. (this._streams = this._streams || {}),
  3101. (this._reverseStreams = this._reverseStreams || {}),
  3102. i.apply(this, [this._streams[t.id] || t]),
  3103. delete this._reverseStreams[
  3104. this._streams[t.id] ? this._streams[t.id].id : t.id
  3105. ],
  3106. delete this._streams[t.id];
  3107. }),
  3108. (t.RTCPeerConnection.prototype.addTrack = function (e, r) {
  3109. if ('closed' === this.signalingState)
  3110. throw new DOMException(
  3111. "The RTCPeerConnection's signalingState is 'closed'.",
  3112. 'InvalidStateError'
  3113. );
  3114. const n = [].slice.call(arguments, 1);
  3115. if (1 !== n.length || !n[0].getTracks().find((t) => t === e))
  3116. throw new DOMException(
  3117. 'The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.',
  3118. 'NotSupportedError'
  3119. );
  3120. const i = this.getSenders().find((t) => t.track === e);
  3121. if (i)
  3122. throw new DOMException('Track already exists.', 'InvalidAccessError');
  3123. (this._streams = this._streams || {}),
  3124. (this._reverseStreams = this._reverseStreams || {});
  3125. const o = this._streams[r.id];
  3126. if (o)
  3127. o.addTrack(e),
  3128. Promise.resolve().then(() => {
  3129. this.dispatchEvent(new Event('negotiationneeded'));
  3130. });
  3131. else {
  3132. const n = new t.MediaStream([e]);
  3133. (this._streams[r.id] = n),
  3134. (this._reverseStreams[n.id] = r),
  3135. this.addStream(n);
  3136. }
  3137. return this.getSenders().find((t) => t.track === e);
  3138. }),
  3139. ['createOffer', 'createAnswer'].forEach(function (e) {
  3140. const r = t.RTCPeerConnection.prototype[e],
  3141. n = {
  3142. [e]() {
  3143. const t = arguments;
  3144. return arguments.length && 'function' == typeof arguments[0]
  3145. ? r.apply(this, [
  3146. (e) => {
  3147. const r = o(this, e);
  3148. t[0].apply(null, [r]);
  3149. },
  3150. (e) => {
  3151. t[1] && t[1].apply(null, e);
  3152. },
  3153. arguments[2],
  3154. ])
  3155. : r.apply(this, arguments).then((t) => o(this, t));
  3156. },
  3157. };
  3158. t.RTCPeerConnection.prototype[e] = n[e];
  3159. });
  3160. const a = t.RTCPeerConnection.prototype.setLocalDescription;
  3161. t.RTCPeerConnection.prototype.setLocalDescription = function () {
  3162. return arguments.length && arguments[0].type
  3163. ? ((arguments[0] = s(this, arguments[0])), a.apply(this, arguments))
  3164. : a.apply(this, arguments);
  3165. };
  3166. const u = Object.getOwnPropertyDescriptor(
  3167. t.RTCPeerConnection.prototype,
  3168. 'localDescription'
  3169. );
  3170. Object.defineProperty(t.RTCPeerConnection.prototype, 'localDescription', {
  3171. get() {
  3172. const t = u.get.apply(this);
  3173. return '' === t.type ? t : o(this, t);
  3174. },
  3175. }),
  3176. (t.RTCPeerConnection.prototype.removeTrack = function (t) {
  3177. if ('closed' === this.signalingState)
  3178. throw new DOMException(
  3179. "The RTCPeerConnection's signalingState is 'closed'.",
  3180. 'InvalidStateError'
  3181. );
  3182. if (!t._pc)
  3183. throw new DOMException(
  3184. 'Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.',
  3185. 'TypeError'
  3186. );
  3187. if (!(t._pc === this))
  3188. throw new DOMException(
  3189. 'Sender was not created by this connection.',
  3190. 'InvalidAccessError'
  3191. );
  3192. let e;
  3193. (this._streams = this._streams || {}),
  3194. Object.keys(this._streams).forEach((r) => {
  3195. this._streams[r].getTracks().find((e) => t.track === e) &&
  3196. (e = this._streams[r]);
  3197. }),
  3198. e &&
  3199. (1 === e.getTracks().length
  3200. ? this.removeStream(this._reverseStreams[e.id])
  3201. : e.removeTrack(t.track),
  3202. this.dispatchEvent(new Event('negotiationneeded')));
  3203. });
  3204. }
  3205. function Zd(t, e) {
  3206. !t.RTCPeerConnection &&
  3207. t.webkitRTCPeerConnection &&
  3208. (t.RTCPeerConnection = t.webkitRTCPeerConnection),
  3209. t.RTCPeerConnection &&
  3210. e.version < 53 &&
  3211. [
  3212. 'setLocalDescription',
  3213. 'setRemoteDescription',
  3214. 'addIceCandidate',
  3215. ].forEach(function (e) {
  3216. const r = t.RTCPeerConnection.prototype[e],
  3217. n = {
  3218. [e]() {
  3219. return (
  3220. (arguments[0] = new (
  3221. 'addIceCandidate' === e
  3222. ? t.RTCIceCandidate
  3223. : t.RTCSessionDescription
  3224. )(arguments[0])),
  3225. r.apply(this, arguments)
  3226. );
  3227. },
  3228. };
  3229. t.RTCPeerConnection.prototype[e] = n[e];
  3230. });
  3231. }
  3232. function Jd(t, e) {
  3233. Od(t, 'negotiationneeded', (t) => {
  3234. const r = t.target;
  3235. if (
  3236. !(
  3237. e.version < 72 ||
  3238. (r.getConfiguration && 'plan-b' === r.getConfiguration().sdpSemantics)
  3239. ) ||
  3240. 'stable' === r.signalingState
  3241. )
  3242. return t;
  3243. });
  3244. }
  3245. var Kd = Object.freeze({
  3246. __proto__: null,
  3247. shimMediaStream: jd,
  3248. shimOnTrack: Xd,
  3249. shimGetSendersWithDtmf: Vd,
  3250. shimGetStats: Hd,
  3251. shimSenderReceiverGetStats: Wd,
  3252. shimAddTrackRemoveTrackWithNative: Yd,
  3253. shimAddTrackRemoveTrack: zd,
  3254. shimPeerConnection: Zd,
  3255. fixNegotiationNeeded: Jd,
  3256. shimGetUserMedia: Ud,
  3257. shimGetDisplayMedia: function (t, e) {
  3258. (t.navigator.mediaDevices &&
  3259. 'getDisplayMedia' in t.navigator.mediaDevices) ||
  3260. (t.navigator.mediaDevices &&
  3261. ('function' == typeof e
  3262. ? (t.navigator.mediaDevices.getDisplayMedia = function (r) {
  3263. return e(r).then((e) => {
  3264. const n = r.video && r.video.width,
  3265. i = r.video && r.video.height,
  3266. o = r.video && r.video.frameRate;
  3267. return (
  3268. (r.video = {
  3269. mandatory: {
  3270. chromeMediaSource: 'desktop',
  3271. chromeMediaSourceId: e,
  3272. maxFrameRate: o || 3,
  3273. },
  3274. }),
  3275. n && (r.video.mandatory.maxWidth = n),
  3276. i && (r.video.mandatory.maxHeight = i),
  3277. t.navigator.mediaDevices.getUserMedia(r)
  3278. );
  3279. });
  3280. })
  3281. : console.error(
  3282. 'shimGetDisplayMedia: getSourceId argument is not a function'
  3283. )));
  3284. },
  3285. });
  3286. function qd(t, e) {
  3287. const r = t && t.navigator,
  3288. n = t && t.MediaStreamTrack;
  3289. if (
  3290. ((r.getUserMedia = function (t, e, n) {
  3291. Ld('navigator.getUserMedia', 'navigator.mediaDevices.getUserMedia'),
  3292. r.mediaDevices.getUserMedia(t).then(e, n);
  3293. }),
  3294. !(
  3295. e.version > 55 &&
  3296. 'autoGainControl' in r.mediaDevices.getSupportedConstraints()
  3297. ))
  3298. ) {
  3299. const t = function (t, e, r) {
  3300. e in t && !(r in t) && ((t[r] = t[e]), delete t[e]);
  3301. },
  3302. e = r.mediaDevices.getUserMedia.bind(r.mediaDevices);
  3303. if (
  3304. ((r.mediaDevices.getUserMedia = function (r) {
  3305. return (
  3306. 'object' == typeof r &&
  3307. 'object' == typeof r.audio &&
  3308. ((r = JSON.parse(JSON.stringify(r))),
  3309. t(r.audio, 'autoGainControl', 'mozAutoGainControl'),
  3310. t(r.audio, 'noiseSuppression', 'mozNoiseSuppression')),
  3311. e(r)
  3312. );
  3313. }),
  3314. n && n.prototype.getSettings)
  3315. ) {
  3316. const e = n.prototype.getSettings;
  3317. n.prototype.getSettings = function () {
  3318. const r = e.apply(this, arguments);
  3319. return (
  3320. t(r, 'mozAutoGainControl', 'autoGainControl'),
  3321. t(r, 'mozNoiseSuppression', 'noiseSuppression'),
  3322. r
  3323. );
  3324. };
  3325. }
  3326. if (n && n.prototype.applyConstraints) {
  3327. const e = n.prototype.applyConstraints;
  3328. n.prototype.applyConstraints = function (r) {
  3329. return (
  3330. 'audio' === this.kind &&
  3331. 'object' == typeof r &&
  3332. ((r = JSON.parse(JSON.stringify(r))),
  3333. t(r, 'autoGainControl', 'mozAutoGainControl'),
  3334. t(r, 'noiseSuppression', 'mozNoiseSuppression')),
  3335. e.apply(this, [r])
  3336. );
  3337. };
  3338. }
  3339. }
  3340. }
  3341. function Qd(t) {
  3342. 'object' == typeof t &&
  3343. t.RTCTrackEvent &&
  3344. 'receiver' in t.RTCTrackEvent.prototype &&
  3345. !('transceiver' in t.RTCTrackEvent.prototype) &&
  3346. Object.defineProperty(t.RTCTrackEvent.prototype, 'transceiver', {
  3347. get() {
  3348. return { receiver: this.receiver };
  3349. },
  3350. });
  3351. }
  3352. function $d(t, e) {
  3353. if (
  3354. 'object' != typeof t ||
  3355. (!t.RTCPeerConnection && !t.mozRTCPeerConnection)
  3356. )
  3357. return;
  3358. !t.RTCPeerConnection &&
  3359. t.mozRTCPeerConnection &&
  3360. (t.RTCPeerConnection = t.mozRTCPeerConnection),
  3361. e.version < 53 &&
  3362. [
  3363. 'setLocalDescription',
  3364. 'setRemoteDescription',
  3365. 'addIceCandidate',
  3366. ].forEach(function (e) {
  3367. const r = t.RTCPeerConnection.prototype[e],
  3368. n = {
  3369. [e]() {
  3370. return (
  3371. (arguments[0] = new (
  3372. 'addIceCandidate' === e
  3373. ? t.RTCIceCandidate
  3374. : t.RTCSessionDescription
  3375. )(arguments[0])),
  3376. r.apply(this, arguments)
  3377. );
  3378. },
  3379. };
  3380. t.RTCPeerConnection.prototype[e] = n[e];
  3381. });
  3382. const r = {
  3383. inboundrtp: 'inbound-rtp',
  3384. outboundrtp: 'outbound-rtp',
  3385. candidatepair: 'candidate-pair',
  3386. localcandidate: 'local-candidate',
  3387. remotecandidate: 'remote-candidate',
  3388. },
  3389. n = t.RTCPeerConnection.prototype.getStats;
  3390. t.RTCPeerConnection.prototype.getStats = function () {
  3391. const [t, i, o] = arguments;
  3392. return n
  3393. .apply(this, [t || null])
  3394. .then((t) => {
  3395. if (e.version < 53 && !i)
  3396. try {
  3397. t.forEach((t) => {
  3398. t.type = r[t.type] || t.type;
  3399. });
  3400. } catch (e) {
  3401. if ('TypeError' !== e.name) throw e;
  3402. t.forEach((e, n) => {
  3403. t.set(n, Object.assign({}, e, { type: r[e.type] || e.type }));
  3404. });
  3405. }
  3406. return t;
  3407. })
  3408. .then(i, o);
  3409. };
  3410. }
  3411. function tf(t) {
  3412. if ('object' != typeof t || !t.RTCPeerConnection || !t.RTCRtpSender) return;
  3413. if (t.RTCRtpSender && 'getStats' in t.RTCRtpSender.prototype) return;
  3414. const e = t.RTCPeerConnection.prototype.getSenders;
  3415. e &&
  3416. (t.RTCPeerConnection.prototype.getSenders = function () {
  3417. const t = e.apply(this, []);
  3418. return t.forEach((t) => (t._pc = this)), t;
  3419. });
  3420. const r = t.RTCPeerConnection.prototype.addTrack;
  3421. r &&
  3422. (t.RTCPeerConnection.prototype.addTrack = function () {
  3423. const t = r.apply(this, arguments);
  3424. return (t._pc = this), t;
  3425. }),
  3426. (t.RTCRtpSender.prototype.getStats = function () {
  3427. return this.track
  3428. ? this._pc.getStats(this.track)
  3429. : Promise.resolve(new Map());
  3430. });
  3431. }
  3432. function ef(t) {
  3433. if ('object' != typeof t || !t.RTCPeerConnection || !t.RTCRtpSender) return;
  3434. if (t.RTCRtpSender && 'getStats' in t.RTCRtpReceiver.prototype) return;
  3435. const e = t.RTCPeerConnection.prototype.getReceivers;
  3436. e &&
  3437. (t.RTCPeerConnection.prototype.getReceivers = function () {
  3438. const t = e.apply(this, []);
  3439. return t.forEach((t) => (t._pc = this)), t;
  3440. }),
  3441. Od(t, 'track', (t) => ((t.receiver._pc = t.srcElement), t)),
  3442. (t.RTCRtpReceiver.prototype.getStats = function () {
  3443. return this._pc.getStats(this.track);
  3444. });
  3445. }
  3446. function rf(t) {
  3447. t.RTCPeerConnection &&
  3448. !('removeStream' in t.RTCPeerConnection.prototype) &&
  3449. (t.RTCPeerConnection.prototype.removeStream = function (t) {
  3450. Ld('removeStream', 'removeTrack'),
  3451. this.getSenders().forEach((e) => {
  3452. e.track && t.getTracks().includes(e.track) && this.removeTrack(e);
  3453. });
  3454. });
  3455. }
  3456. function nf(t) {
  3457. t.DataChannel && !t.RTCDataChannel && (t.RTCDataChannel = t.DataChannel);
  3458. }
  3459. function of(t) {
  3460. if ('object' != typeof t || !t.RTCPeerConnection) return;
  3461. const e = t.RTCPeerConnection.prototype.addTransceiver;
  3462. e &&
  3463. (t.RTCPeerConnection.prototype.addTransceiver = function () {
  3464. this.setParametersPromises = [];
  3465. let t = arguments[1] && arguments[1].sendEncodings;
  3466. void 0 === t && (t = []), (t = [...t]);
  3467. const r = t.length > 0;
  3468. r &&
  3469. t.forEach((t) => {
  3470. if ('rid' in t) {
  3471. if (!/^[a-z0-9]{0,16}$/i.test(t.rid))
  3472. throw new TypeError('Invalid RID value provided.');
  3473. }
  3474. if (
  3475. 'scaleResolutionDownBy' in t &&
  3476. !(parseFloat(t.scaleResolutionDownBy) >= 1)
  3477. )
  3478. throw new RangeError('scale_resolution_down_by must be >= 1.0');
  3479. if ('maxFramerate' in t && !(parseFloat(t.maxFramerate) >= 0))
  3480. throw new RangeError('max_framerate must be >= 0.0');
  3481. });
  3482. const n = e.apply(this, arguments);
  3483. if (r) {
  3484. const { sender: e } = n,
  3485. r = e.getParameters();
  3486. (!('encodings' in r) ||
  3487. (1 === r.encodings.length &&
  3488. 0 === Object.keys(r.encodings[0]).length)) &&
  3489. ((r.encodings = t),
  3490. (e.sendEncodings = t),
  3491. this.setParametersPromises.push(
  3492. e
  3493. .setParameters(r)
  3494. .then(() => {
  3495. delete e.sendEncodings;
  3496. })
  3497. .catch(() => {
  3498. delete e.sendEncodings;
  3499. })
  3500. ));
  3501. }
  3502. return n;
  3503. });
  3504. }
  3505. function sf(t) {
  3506. if ('object' != typeof t || !t.RTCRtpSender) return;
  3507. const e = t.RTCRtpSender.prototype.getParameters;
  3508. e &&
  3509. (t.RTCRtpSender.prototype.getParameters = function () {
  3510. const t = e.apply(this, arguments);
  3511. return (
  3512. 'encodings' in t ||
  3513. (t.encodings = [].concat(this.sendEncodings || [{}])),
  3514. t
  3515. );
  3516. });
  3517. }
  3518. function af(t) {
  3519. if ('object' != typeof t || !t.RTCPeerConnection) return;
  3520. const e = t.RTCPeerConnection.prototype.createOffer;
  3521. t.RTCPeerConnection.prototype.createOffer = function () {
  3522. return this.setParametersPromises && this.setParametersPromises.length
  3523. ? Promise.all(this.setParametersPromises)
  3524. .then(() => e.apply(this, arguments))
  3525. .finally(() => {
  3526. this.setParametersPromises = [];
  3527. })
  3528. : e.apply(this, arguments);
  3529. };
  3530. }
  3531. function uf(t) {
  3532. if ('object' != typeof t || !t.RTCPeerConnection) return;
  3533. const e = t.RTCPeerConnection.prototype.createAnswer;
  3534. t.RTCPeerConnection.prototype.createAnswer = function () {
  3535. return this.setParametersPromises && this.setParametersPromises.length
  3536. ? Promise.all(this.setParametersPromises)
  3537. .then(() => e.apply(this, arguments))
  3538. .finally(() => {
  3539. this.setParametersPromises = [];
  3540. })
  3541. : e.apply(this, arguments);
  3542. };
  3543. }
  3544. var cf = Object.freeze({
  3545. __proto__: null,
  3546. shimOnTrack: Qd,
  3547. shimPeerConnection: $d,
  3548. shimSenderGetStats: tf,
  3549. shimReceiverGetStats: ef,
  3550. shimRemoveStream: rf,
  3551. shimRTCDataChannel: nf,
  3552. shimAddTransceiver: of,
  3553. shimGetParameters: sf,
  3554. shimCreateOffer: af,
  3555. shimCreateAnswer: uf,
  3556. shimGetUserMedia: qd,
  3557. shimGetDisplayMedia: function (t, e) {
  3558. (t.navigator.mediaDevices &&
  3559. 'getDisplayMedia' in t.navigator.mediaDevices) ||
  3560. (t.navigator.mediaDevices &&
  3561. (t.navigator.mediaDevices.getDisplayMedia = function (r) {
  3562. if (!r || !r.video) {
  3563. const t = new DOMException(
  3564. 'getDisplayMedia without video constraints is undefined'
  3565. );
  3566. return (
  3567. (t.name = 'NotFoundError'), (t.code = 8), Promise.reject(t)
  3568. );
  3569. }
  3570. return (
  3571. !0 === r.video
  3572. ? (r.video = { mediaSource: e })
  3573. : (r.video.mediaSource = e),
  3574. t.navigator.mediaDevices.getUserMedia(r)
  3575. );
  3576. }));
  3577. },
  3578. });
  3579. function hf(t) {
  3580. if ('object' == typeof t && t.RTCPeerConnection) {
  3581. if (
  3582. ('getLocalStreams' in t.RTCPeerConnection.prototype ||
  3583. (t.RTCPeerConnection.prototype.getLocalStreams = function () {
  3584. return (
  3585. this._localStreams || (this._localStreams = []),
  3586. this._localStreams
  3587. );
  3588. }),
  3589. !('addStream' in t.RTCPeerConnection.prototype))
  3590. ) {
  3591. const e = t.RTCPeerConnection.prototype.addTrack;
  3592. (t.RTCPeerConnection.prototype.addStream = function (t) {
  3593. this._localStreams || (this._localStreams = []),
  3594. this._localStreams.includes(t) || this._localStreams.push(t),
  3595. t.getAudioTracks().forEach((r) => e.call(this, r, t)),
  3596. t.getVideoTracks().forEach((r) => e.call(this, r, t));
  3597. }),
  3598. (t.RTCPeerConnection.prototype.addTrack = function (t, ...r) {
  3599. return (
  3600. r &&
  3601. r.forEach((t) => {
  3602. this._localStreams
  3603. ? this._localStreams.includes(t) ||
  3604. this._localStreams.push(t)
  3605. : (this._localStreams = [t]);
  3606. }),
  3607. e.apply(this, arguments)
  3608. );
  3609. });
  3610. }
  3611. 'removeStream' in t.RTCPeerConnection.prototype ||
  3612. (t.RTCPeerConnection.prototype.removeStream = function (t) {
  3613. this._localStreams || (this._localStreams = []);
  3614. const e = this._localStreams.indexOf(t);
  3615. if (-1 === e) return;
  3616. this._localStreams.splice(e, 1);
  3617. const r = t.getTracks();
  3618. this.getSenders().forEach((t) => {
  3619. r.includes(t.track) && this.removeTrack(t);
  3620. });
  3621. });
  3622. }
  3623. }
  3624. function lf(t) {
  3625. if (
  3626. 'object' == typeof t &&
  3627. t.RTCPeerConnection &&
  3628. ('getRemoteStreams' in t.RTCPeerConnection.prototype ||
  3629. (t.RTCPeerConnection.prototype.getRemoteStreams = function () {
  3630. return this._remoteStreams ? this._remoteStreams : [];
  3631. }),
  3632. !('onaddstream' in t.RTCPeerConnection.prototype))
  3633. ) {
  3634. Object.defineProperty(t.RTCPeerConnection.prototype, 'onaddstream', {
  3635. get() {
  3636. return this._onaddstream;
  3637. },
  3638. set(t) {
  3639. this._onaddstream &&
  3640. (this.removeEventListener('addstream', this._onaddstream),
  3641. this.removeEventListener('track', this._onaddstreampoly)),
  3642. this.addEventListener('addstream', (this._onaddstream = t)),
  3643. this.addEventListener(
  3644. 'track',
  3645. (this._onaddstreampoly = (t) => {
  3646. t.streams.forEach((t) => {
  3647. if (
  3648. (this._remoteStreams || (this._remoteStreams = []),
  3649. this._remoteStreams.includes(t))
  3650. )
  3651. return;
  3652. this._remoteStreams.push(t);
  3653. const e = new Event('addstream');
  3654. (e.stream = t), this.dispatchEvent(e);
  3655. });
  3656. })
  3657. );
  3658. },
  3659. });
  3660. const e = t.RTCPeerConnection.prototype.setRemoteDescription;
  3661. t.RTCPeerConnection.prototype.setRemoteDescription = function () {
  3662. const t = this;
  3663. return (
  3664. this._onaddstreampoly ||
  3665. this.addEventListener(
  3666. 'track',
  3667. (this._onaddstreampoly = function (e) {
  3668. e.streams.forEach((e) => {
  3669. if (
  3670. (t._remoteStreams || (t._remoteStreams = []),
  3671. t._remoteStreams.indexOf(e) >= 0)
  3672. )
  3673. return;
  3674. t._remoteStreams.push(e);
  3675. const r = new Event('addstream');
  3676. (r.stream = e), t.dispatchEvent(r);
  3677. });
  3678. })
  3679. ),
  3680. e.apply(t, arguments)
  3681. );
  3682. };
  3683. }
  3684. }
  3685. function df(t) {
  3686. if ('object' != typeof t || !t.RTCPeerConnection) return;
  3687. const e = t.RTCPeerConnection.prototype,
  3688. r = e.createOffer,
  3689. n = e.createAnswer,
  3690. i = e.setLocalDescription,
  3691. o = e.setRemoteDescription,
  3692. s = e.addIceCandidate;
  3693. (e.createOffer = function (t, e) {
  3694. const n = arguments.length >= 2 ? arguments[2] : arguments[0],
  3695. i = r.apply(this, [n]);
  3696. return e ? (i.then(t, e), Promise.resolve()) : i;
  3697. }),
  3698. (e.createAnswer = function (t, e) {
  3699. const r = arguments.length >= 2 ? arguments[2] : arguments[0],
  3700. i = n.apply(this, [r]);
  3701. return e ? (i.then(t, e), Promise.resolve()) : i;
  3702. });
  3703. let a = function (t, e, r) {
  3704. const n = i.apply(this, [t]);
  3705. return r ? (n.then(e, r), Promise.resolve()) : n;
  3706. };
  3707. (e.setLocalDescription = a),
  3708. (a = function (t, e, r) {
  3709. const n = o.apply(this, [t]);
  3710. return r ? (n.then(e, r), Promise.resolve()) : n;
  3711. }),
  3712. (e.setRemoteDescription = a),
  3713. (a = function (t, e, r) {
  3714. const n = s.apply(this, [t]);
  3715. return r ? (n.then(e, r), Promise.resolve()) : n;
  3716. }),
  3717. (e.addIceCandidate = a);
  3718. }
  3719. function ff(t) {
  3720. const e = t && t.navigator;
  3721. if (e.mediaDevices && e.mediaDevices.getUserMedia) {
  3722. const t = e.mediaDevices,
  3723. r = t.getUserMedia.bind(t);
  3724. e.mediaDevices.getUserMedia = (t) => r(pf(t));
  3725. }
  3726. !e.getUserMedia &&
  3727. e.mediaDevices &&
  3728. e.mediaDevices.getUserMedia &&
  3729. (e.getUserMedia = function (t, r, n) {
  3730. e.mediaDevices.getUserMedia(t).then(r, n);
  3731. }.bind(e));
  3732. }
  3733. function pf(t) {
  3734. return t && void 0 !== t.video
  3735. ? Object.assign({}, t, { video: Nd(t.video) })
  3736. : t;
  3737. }
  3738. function vf(t) {
  3739. if (!t.RTCPeerConnection) return;
  3740. const e = t.RTCPeerConnection;
  3741. (t.RTCPeerConnection = function (t, r) {
  3742. if (t && t.iceServers) {
  3743. const e = [];
  3744. for (let r = 0; r < t.iceServers.length; r++) {
  3745. let n = t.iceServers[r];
  3746. void 0 === n.urls && n.url
  3747. ? (Ld('RTCIceServer.url', 'RTCIceServer.urls'),
  3748. (n = JSON.parse(JSON.stringify(n))),
  3749. (n.urls = n.url),
  3750. delete n.url,
  3751. e.push(n))
  3752. : e.push(t.iceServers[r]);
  3753. }
  3754. t.iceServers = e;
  3755. }
  3756. return new e(t, r);
  3757. }),
  3758. (t.RTCPeerConnection.prototype = e.prototype),
  3759. 'generateCertificate' in e &&
  3760. Object.defineProperty(t.RTCPeerConnection, 'generateCertificate', {
  3761. get: () => e.generateCertificate,
  3762. });
  3763. }
  3764. function mf(t) {
  3765. 'object' == typeof t &&
  3766. t.RTCTrackEvent &&
  3767. 'receiver' in t.RTCTrackEvent.prototype &&
  3768. !('transceiver' in t.RTCTrackEvent.prototype) &&
  3769. Object.defineProperty(t.RTCTrackEvent.prototype, 'transceiver', {
  3770. get() {
  3771. return { receiver: this.receiver };
  3772. },
  3773. });
  3774. }
  3775. function yf(t) {
  3776. const e = t.RTCPeerConnection.prototype.createOffer;
  3777. t.RTCPeerConnection.prototype.createOffer = function (t) {
  3778. if (t) {
  3779. void 0 !== t.offerToReceiveAudio &&
  3780. (t.offerToReceiveAudio = !!t.offerToReceiveAudio);
  3781. const e = this.getTransceivers().find(
  3782. (t) => 'audio' === t.receiver.track.kind
  3783. );
  3784. !1 === t.offerToReceiveAudio && e
  3785. ? 'sendrecv' === e.direction
  3786. ? e.setDirection
  3787. ? e.setDirection('sendonly')
  3788. : (e.direction = 'sendonly')
  3789. : 'recvonly' === e.direction &&
  3790. (e.setDirection
  3791. ? e.setDirection('inactive')
  3792. : (e.direction = 'inactive'))
  3793. : !0 !== t.offerToReceiveAudio ||
  3794. e ||
  3795. this.addTransceiver('audio', { direction: 'recvonly' }),
  3796. void 0 !== t.offerToReceiveVideo &&
  3797. (t.offerToReceiveVideo = !!t.offerToReceiveVideo);
  3798. const r = this.getTransceivers().find(
  3799. (t) => 'video' === t.receiver.track.kind
  3800. );
  3801. !1 === t.offerToReceiveVideo && r
  3802. ? 'sendrecv' === r.direction
  3803. ? r.setDirection
  3804. ? r.setDirection('sendonly')
  3805. : (r.direction = 'sendonly')
  3806. : 'recvonly' === r.direction &&
  3807. (r.setDirection
  3808. ? r.setDirection('inactive')
  3809. : (r.direction = 'inactive'))
  3810. : !0 !== t.offerToReceiveVideo ||
  3811. r ||
  3812. this.addTransceiver('video', { direction: 'recvonly' });
  3813. }
  3814. return e.apply(this, arguments);
  3815. };
  3816. }
  3817. function gf(t) {
  3818. 'object' != typeof t ||
  3819. t.AudioContext ||
  3820. (t.AudioContext = t.webkitAudioContext);
  3821. }
  3822. var _f = Object.freeze({
  3823. __proto__: null,
  3824. shimLocalStreamsAPI: hf,
  3825. shimRemoteStreamsAPI: lf,
  3826. shimCallbacksAPI: df,
  3827. shimGetUserMedia: ff,
  3828. shimConstraints: pf,
  3829. shimRTCIceServerUrls: vf,
  3830. shimTrackEventTransceiver: mf,
  3831. shimCreateOfferLegacy: yf,
  3832. shimAudioContext: gf,
  3833. }),
  3834. bf = { exports: {} };
  3835. !(function (t) {
  3836. const e = {
  3837. generateIdentifier: function () {
  3838. return Math.random().toString(36).substring(2, 12);
  3839. },
  3840. };
  3841. (e.localCName = e.generateIdentifier()),
  3842. (e.splitLines = function (t) {
  3843. return t
  3844. .trim()
  3845. .split('\n')
  3846. .map((t) => t.trim());
  3847. }),
  3848. (e.splitSections = function (t) {
  3849. return t
  3850. .split('\nm=')
  3851. .map((t, e) => (e > 0 ? 'm=' + t : t).trim() + '\r\n');
  3852. }),
  3853. (e.getDescription = function (t) {
  3854. const r = e.splitSections(t);
  3855. return r && r[0];
  3856. }),
  3857. (e.getMediaSections = function (t) {
  3858. const r = e.splitSections(t);
  3859. return r.shift(), r;
  3860. }),
  3861. (e.matchPrefix = function (t, r) {
  3862. return e.splitLines(t).filter((t) => 0 === t.indexOf(r));
  3863. }),
  3864. (e.parseCandidate = function (t) {
  3865. let e;
  3866. e =
  3867. 0 === t.indexOf('a=candidate:')
  3868. ? t.substring(12).split(' ')
  3869. : t.substring(10).split(' ');
  3870. const r = {
  3871. foundation: e[0],
  3872. component: { 1: 'rtp', 2: 'rtcp' }[e[1]] || e[1],
  3873. protocol: e[2].toLowerCase(),
  3874. priority: parseInt(e[3], 10),
  3875. ip: e[4],
  3876. address: e[4],
  3877. port: parseInt(e[5], 10),
  3878. type: e[7],
  3879. };
  3880. for (let t = 8; t < e.length; t += 2)
  3881. switch (e[t]) {
  3882. case 'raddr':
  3883. r.relatedAddress = e[t + 1];
  3884. break;
  3885. case 'rport':
  3886. r.relatedPort = parseInt(e[t + 1], 10);
  3887. break;
  3888. case 'tcptype':
  3889. r.tcpType = e[t + 1];
  3890. break;
  3891. case 'ufrag':
  3892. (r.ufrag = e[t + 1]), (r.usernameFragment = e[t + 1]);
  3893. break;
  3894. default:
  3895. void 0 === r[e[t]] && (r[e[t]] = e[t + 1]);
  3896. }
  3897. return r;
  3898. }),
  3899. (e.writeCandidate = function (t) {
  3900. const e = [];
  3901. e.push(t.foundation);
  3902. const r = t.component;
  3903. 'rtp' === r ? e.push(1) : 'rtcp' === r ? e.push(2) : e.push(r),
  3904. e.push(t.protocol.toUpperCase()),
  3905. e.push(t.priority),
  3906. e.push(t.address || t.ip),
  3907. e.push(t.port);
  3908. const n = t.type;
  3909. return (
  3910. e.push('typ'),
  3911. e.push(n),
  3912. 'host' !== n &&
  3913. t.relatedAddress &&
  3914. t.relatedPort &&
  3915. (e.push('raddr'),
  3916. e.push(t.relatedAddress),
  3917. e.push('rport'),
  3918. e.push(t.relatedPort)),
  3919. t.tcpType &&
  3920. 'tcp' === t.protocol.toLowerCase() &&
  3921. (e.push('tcptype'), e.push(t.tcpType)),
  3922. (t.usernameFragment || t.ufrag) &&
  3923. (e.push('ufrag'), e.push(t.usernameFragment || t.ufrag)),
  3924. 'candidate:' + e.join(' ')
  3925. );
  3926. }),
  3927. (e.parseIceOptions = function (t) {
  3928. return t.substring(14).split(' ');
  3929. }),
  3930. (e.parseRtpMap = function (t) {
  3931. let e = t.substring(9).split(' ');
  3932. const r = { payloadType: parseInt(e.shift(), 10) };
  3933. return (
  3934. (e = e[0].split('/')),
  3935. (r.name = e[0]),
  3936. (r.clockRate = parseInt(e[1], 10)),
  3937. (r.channels = 3 === e.length ? parseInt(e[2], 10) : 1),
  3938. (r.numChannels = r.channels),
  3939. r
  3940. );
  3941. }),
  3942. (e.writeRtpMap = function (t) {
  3943. let e = t.payloadType;
  3944. void 0 !== t.preferredPayloadType && (e = t.preferredPayloadType);
  3945. const r = t.channels || t.numChannels || 1;
  3946. return (
  3947. 'a=rtpmap:' +
  3948. e +
  3949. ' ' +
  3950. t.name +
  3951. '/' +
  3952. t.clockRate +
  3953. (1 !== r ? '/' + r : '') +
  3954. '\r\n'
  3955. );
  3956. }),
  3957. (e.parseExtmap = function (t) {
  3958. const e = t.substring(9).split(' ');
  3959. return {
  3960. id: parseInt(e[0], 10),
  3961. direction: e[0].indexOf('/') > 0 ? e[0].split('/')[1] : 'sendrecv',
  3962. uri: e[1],
  3963. attributes: e.slice(2).join(' '),
  3964. };
  3965. }),
  3966. (e.writeExtmap = function (t) {
  3967. return (
  3968. 'a=extmap:' +
  3969. (t.id || t.preferredId) +
  3970. (t.direction && 'sendrecv' !== t.direction ? '/' + t.direction : '') +
  3971. ' ' +
  3972. t.uri +
  3973. (t.attributes ? ' ' + t.attributes : '') +
  3974. '\r\n'
  3975. );
  3976. }),
  3977. (e.parseFmtp = function (t) {
  3978. const e = {};
  3979. let r;
  3980. const n = t.substring(t.indexOf(' ') + 1).split(';');
  3981. for (let t = 0; t < n.length; t++)
  3982. (r = n[t].trim().split('=')), (e[r[0].trim()] = r[1]);
  3983. return e;
  3984. }),
  3985. (e.writeFmtp = function (t) {
  3986. let e = '',
  3987. r = t.payloadType;
  3988. if (
  3989. (void 0 !== t.preferredPayloadType && (r = t.preferredPayloadType),
  3990. t.parameters && Object.keys(t.parameters).length)
  3991. ) {
  3992. const n = [];
  3993. Object.keys(t.parameters).forEach((e) => {
  3994. void 0 !== t.parameters[e]
  3995. ? n.push(e + '=' + t.parameters[e])
  3996. : n.push(e);
  3997. }),
  3998. (e += 'a=fmtp:' + r + ' ' + n.join(';') + '\r\n');
  3999. }
  4000. return e;
  4001. }),
  4002. (e.parseRtcpFb = function (t) {
  4003. const e = t.substring(t.indexOf(' ') + 1).split(' ');
  4004. return { type: e.shift(), parameter: e.join(' ') };
  4005. }),
  4006. (e.writeRtcpFb = function (t) {
  4007. let e = '',
  4008. r = t.payloadType;
  4009. return (
  4010. void 0 !== t.preferredPayloadType && (r = t.preferredPayloadType),
  4011. t.rtcpFeedback &&
  4012. t.rtcpFeedback.length &&
  4013. t.rtcpFeedback.forEach((t) => {
  4014. e +=
  4015. 'a=rtcp-fb:' +
  4016. r +
  4017. ' ' +
  4018. t.type +
  4019. (t.parameter && t.parameter.length ? ' ' + t.parameter : '') +
  4020. '\r\n';
  4021. }),
  4022. e
  4023. );
  4024. }),
  4025. (e.parseSsrcMedia = function (t) {
  4026. const e = t.indexOf(' '),
  4027. r = { ssrc: parseInt(t.substring(7, e), 10) },
  4028. n = t.indexOf(':', e);
  4029. return (
  4030. n > -1
  4031. ? ((r.attribute = t.substring(e + 1, n)),
  4032. (r.value = t.substring(n + 1)))
  4033. : (r.attribute = t.substring(e + 1)),
  4034. r
  4035. );
  4036. }),
  4037. (e.parseSsrcGroup = function (t) {
  4038. const e = t.substring(13).split(' ');
  4039. return { semantics: e.shift(), ssrcs: e.map((t) => parseInt(t, 10)) };
  4040. }),
  4041. (e.getMid = function (t) {
  4042. const r = e.matchPrefix(t, 'a=mid:')[0];
  4043. if (r) return r.substring(6);
  4044. }),
  4045. (e.parseFingerprint = function (t) {
  4046. const e = t.substring(14).split(' ');
  4047. return { algorithm: e[0].toLowerCase(), value: e[1].toUpperCase() };
  4048. }),
  4049. (e.getDtlsParameters = function (t, r) {
  4050. return {
  4051. role: 'auto',
  4052. fingerprints: e
  4053. .matchPrefix(t + r, 'a=fingerprint:')
  4054. .map(e.parseFingerprint),
  4055. };
  4056. }),
  4057. (e.writeDtlsParameters = function (t, e) {
  4058. let r = 'a=setup:' + e + '\r\n';
  4059. return (
  4060. t.fingerprints.forEach((t) => {
  4061. r += 'a=fingerprint:' + t.algorithm + ' ' + t.value + '\r\n';
  4062. }),
  4063. r
  4064. );
  4065. }),
  4066. (e.parseCryptoLine = function (t) {
  4067. const e = t.substring(9).split(' ');
  4068. return {
  4069. tag: parseInt(e[0], 10),
  4070. cryptoSuite: e[1],
  4071. keyParams: e[2],
  4072. sessionParams: e.slice(3),
  4073. };
  4074. }),
  4075. (e.writeCryptoLine = function (t) {
  4076. return (
  4077. 'a=crypto:' +
  4078. t.tag +
  4079. ' ' +
  4080. t.cryptoSuite +
  4081. ' ' +
  4082. ('object' == typeof t.keyParams
  4083. ? e.writeCryptoKeyParams(t.keyParams)
  4084. : t.keyParams) +
  4085. (t.sessionParams ? ' ' + t.sessionParams.join(' ') : '') +
  4086. '\r\n'
  4087. );
  4088. }),
  4089. (e.parseCryptoKeyParams = function (t) {
  4090. if (0 !== t.indexOf('inline:')) return null;
  4091. const e = t.substring(7).split('|');
  4092. return {
  4093. keyMethod: 'inline',
  4094. keySalt: e[0],
  4095. lifeTime: e[1],
  4096. mkiValue: e[2] ? e[2].split(':')[0] : void 0,
  4097. mkiLength: e[2] ? e[2].split(':')[1] : void 0,
  4098. };
  4099. }),
  4100. (e.writeCryptoKeyParams = function (t) {
  4101. return (
  4102. t.keyMethod +
  4103. ':' +
  4104. t.keySalt +
  4105. (t.lifeTime ? '|' + t.lifeTime : '') +
  4106. (t.mkiValue && t.mkiLength
  4107. ? '|' + t.mkiValue + ':' + t.mkiLength
  4108. : '')
  4109. );
  4110. }),
  4111. (e.getCryptoParameters = function (t, r) {
  4112. return e.matchPrefix(t + r, 'a=crypto:').map(e.parseCryptoLine);
  4113. }),
  4114. (e.getIceParameters = function (t, r) {
  4115. const n = e.matchPrefix(t + r, 'a=ice-ufrag:')[0],
  4116. i = e.matchPrefix(t + r, 'a=ice-pwd:')[0];
  4117. return n && i
  4118. ? { usernameFragment: n.substring(12), password: i.substring(10) }
  4119. : null;
  4120. }),
  4121. (e.writeIceParameters = function (t) {
  4122. let e =
  4123. 'a=ice-ufrag:' +
  4124. t.usernameFragment +
  4125. '\r\na=ice-pwd:' +
  4126. t.password +
  4127. '\r\n';
  4128. return t.iceLite && (e += 'a=ice-lite\r\n'), e;
  4129. }),
  4130. (e.parseRtpParameters = function (t) {
  4131. const r = {
  4132. codecs: [],
  4133. headerExtensions: [],
  4134. fecMechanisms: [],
  4135. rtcp: [],
  4136. },
  4137. n = e.splitLines(t)[0].split(' ');
  4138. r.profile = n[2];
  4139. for (let i = 3; i < n.length; i++) {
  4140. const o = n[i],
  4141. s = e.matchPrefix(t, 'a=rtpmap:' + o + ' ')[0];
  4142. if (s) {
  4143. const n = e.parseRtpMap(s),
  4144. i = e.matchPrefix(t, 'a=fmtp:' + o + ' ');
  4145. switch (
  4146. ((n.parameters = i.length ? e.parseFmtp(i[0]) : {}),
  4147. (n.rtcpFeedback = e
  4148. .matchPrefix(t, 'a=rtcp-fb:' + o + ' ')
  4149. .map(e.parseRtcpFb)),
  4150. r.codecs.push(n),
  4151. n.name.toUpperCase())
  4152. ) {
  4153. case 'RED':
  4154. case 'ULPFEC':
  4155. r.fecMechanisms.push(n.name.toUpperCase());
  4156. }
  4157. }
  4158. }
  4159. e.matchPrefix(t, 'a=extmap:').forEach((t) => {
  4160. r.headerExtensions.push(e.parseExtmap(t));
  4161. });
  4162. const i = e.matchPrefix(t, 'a=rtcp-fb:* ').map(e.parseRtcpFb);
  4163. return (
  4164. r.codecs.forEach((t) => {
  4165. i.forEach((e) => {
  4166. t.rtcpFeedback.find(
  4167. (t) => t.type === e.type && t.parameter === e.parameter
  4168. ) || t.rtcpFeedback.push(e);
  4169. });
  4170. }),
  4171. r
  4172. );
  4173. }),
  4174. (e.writeRtpDescription = function (t, r) {
  4175. let n = '';
  4176. (n += 'm=' + t + ' '),
  4177. (n += r.codecs.length > 0 ? '9' : '0'),
  4178. (n += ' ' + (r.profile || 'UDP/TLS/RTP/SAVPF') + ' '),
  4179. (n +=
  4180. r.codecs
  4181. .map((t) =>
  4182. void 0 !== t.preferredPayloadType
  4183. ? t.preferredPayloadType
  4184. : t.payloadType
  4185. )
  4186. .join(' ') + '\r\n'),
  4187. (n += 'c=IN IP4 0.0.0.0\r\n'),
  4188. (n += 'a=rtcp:9 IN IP4 0.0.0.0\r\n'),
  4189. r.codecs.forEach((t) => {
  4190. (n += e.writeRtpMap(t)),
  4191. (n += e.writeFmtp(t)),
  4192. (n += e.writeRtcpFb(t));
  4193. });
  4194. let i = 0;
  4195. return (
  4196. r.codecs.forEach((t) => {
  4197. t.maxptime > i && (i = t.maxptime);
  4198. }),
  4199. i > 0 && (n += 'a=maxptime:' + i + '\r\n'),
  4200. r.headerExtensions &&
  4201. r.headerExtensions.forEach((t) => {
  4202. n += e.writeExtmap(t);
  4203. }),
  4204. n
  4205. );
  4206. }),
  4207. (e.parseRtpEncodingParameters = function (t) {
  4208. const r = [],
  4209. n = e.parseRtpParameters(t),
  4210. i = -1 !== n.fecMechanisms.indexOf('RED'),
  4211. o = -1 !== n.fecMechanisms.indexOf('ULPFEC'),
  4212. s = e
  4213. .matchPrefix(t, 'a=ssrc:')
  4214. .map((t) => e.parseSsrcMedia(t))
  4215. .filter((t) => 'cname' === t.attribute),
  4216. a = s.length > 0 && s[0].ssrc;
  4217. let u;
  4218. const c = e.matchPrefix(t, 'a=ssrc-group:FID').map((t) =>
  4219. t
  4220. .substring(17)
  4221. .split(' ')
  4222. .map((t) => parseInt(t, 10))
  4223. );
  4224. c.length > 0 && c[0].length > 1 && c[0][0] === a && (u = c[0][1]),
  4225. n.codecs.forEach((t) => {
  4226. if ('RTX' === t.name.toUpperCase() && t.parameters.apt) {
  4227. let e = {
  4228. ssrc: a,
  4229. codecPayloadType: parseInt(t.parameters.apt, 10),
  4230. };
  4231. a && u && (e.rtx = { ssrc: u }),
  4232. r.push(e),
  4233. i &&
  4234. ((e = JSON.parse(JSON.stringify(e))),
  4235. (e.fec = { ssrc: a, mechanism: o ? 'red+ulpfec' : 'red' }),
  4236. r.push(e));
  4237. }
  4238. }),
  4239. 0 === r.length && a && r.push({ ssrc: a });
  4240. let h = e.matchPrefix(t, 'b=');
  4241. return (
  4242. h.length &&
  4243. ((h =
  4244. 0 === h[0].indexOf('b=TIAS:')
  4245. ? parseInt(h[0].substring(7), 10)
  4246. : 0 === h[0].indexOf('b=AS:')
  4247. ? 1e3 * parseInt(h[0].substring(5), 10) * 0.95 - 16e3
  4248. : void 0),
  4249. r.forEach((t) => {
  4250. t.maxBitrate = h;
  4251. })),
  4252. r
  4253. );
  4254. }),
  4255. (e.parseRtcpParameters = function (t) {
  4256. const r = {},
  4257. n = e
  4258. .matchPrefix(t, 'a=ssrc:')
  4259. .map((t) => e.parseSsrcMedia(t))
  4260. .filter((t) => 'cname' === t.attribute)[0];
  4261. n && ((r.cname = n.value), (r.ssrc = n.ssrc));
  4262. const i = e.matchPrefix(t, 'a=rtcp-rsize');
  4263. (r.reducedSize = i.length > 0), (r.compound = 0 === i.length);
  4264. const o = e.matchPrefix(t, 'a=rtcp-mux');
  4265. return (r.mux = o.length > 0), r;
  4266. }),
  4267. (e.writeRtcpParameters = function (t) {
  4268. let e = '';
  4269. return (
  4270. t.reducedSize && (e += 'a=rtcp-rsize\r\n'),
  4271. t.mux && (e += 'a=rtcp-mux\r\n'),
  4272. void 0 !== t.ssrc &&
  4273. t.cname &&
  4274. (e += 'a=ssrc:' + t.ssrc + ' cname:' + t.cname + '\r\n'),
  4275. e
  4276. );
  4277. }),
  4278. (e.parseMsid = function (t) {
  4279. let r;
  4280. const n = e.matchPrefix(t, 'a=msid:');
  4281. if (1 === n.length)
  4282. return (
  4283. (r = n[0].substring(7).split(' ')), { stream: r[0], track: r[1] }
  4284. );
  4285. const i = e
  4286. .matchPrefix(t, 'a=ssrc:')
  4287. .map((t) => e.parseSsrcMedia(t))
  4288. .filter((t) => 'msid' === t.attribute);
  4289. return i.length > 0
  4290. ? ((r = i[0].value.split(' ')), { stream: r[0], track: r[1] })
  4291. : void 0;
  4292. }),
  4293. (e.parseSctpDescription = function (t) {
  4294. const r = e.parseMLine(t),
  4295. n = e.matchPrefix(t, 'a=max-message-size:');
  4296. let i;
  4297. n.length > 0 && (i = parseInt(n[0].substring(19), 10)),
  4298. isNaN(i) && (i = 65536);
  4299. const o = e.matchPrefix(t, 'a=sctp-port:');
  4300. if (o.length > 0)
  4301. return {
  4302. port: parseInt(o[0].substring(12), 10),
  4303. protocol: r.fmt,
  4304. maxMessageSize: i,
  4305. };
  4306. const s = e.matchPrefix(t, 'a=sctpmap:');
  4307. if (s.length > 0) {
  4308. const t = s[0].substring(10).split(' ');
  4309. return {
  4310. port: parseInt(t[0], 10),
  4311. protocol: t[1],
  4312. maxMessageSize: i,
  4313. };
  4314. }
  4315. }),
  4316. (e.writeSctpDescription = function (t, e) {
  4317. let r = [];
  4318. return (
  4319. (r =
  4320. 'DTLS/SCTP' !== t.protocol
  4321. ? [
  4322. 'm=' +
  4323. t.kind +
  4324. ' 9 ' +
  4325. t.protocol +
  4326. ' ' +
  4327. e.protocol +
  4328. '\r\n',
  4329. 'c=IN IP4 0.0.0.0\r\n',
  4330. 'a=sctp-port:' + e.port + '\r\n',
  4331. ]
  4332. : [
  4333. 'm=' + t.kind + ' 9 ' + t.protocol + ' ' + e.port + '\r\n',
  4334. 'c=IN IP4 0.0.0.0\r\n',
  4335. 'a=sctpmap:' + e.port + ' ' + e.protocol + ' 65535\r\n',
  4336. ]),
  4337. void 0 !== e.maxMessageSize &&
  4338. r.push('a=max-message-size:' + e.maxMessageSize + '\r\n'),
  4339. r.join('')
  4340. );
  4341. }),
  4342. (e.generateSessionId = function () {
  4343. return Math.random().toString().substr(2, 22);
  4344. }),
  4345. (e.writeSessionBoilerplate = function (t, r, n) {
  4346. let i;
  4347. const o = void 0 !== r ? r : 2;
  4348. i = t || e.generateSessionId();
  4349. return (
  4350. 'v=0\r\no=' +
  4351. (n || 'thisisadapterortc') +
  4352. ' ' +
  4353. i +
  4354. ' ' +
  4355. o +
  4356. ' IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n'
  4357. );
  4358. }),
  4359. (e.getDirection = function (t, r) {
  4360. const n = e.splitLines(t);
  4361. for (let t = 0; t < n.length; t++)
  4362. switch (n[t]) {
  4363. case 'a=sendrecv':
  4364. case 'a=sendonly':
  4365. case 'a=recvonly':
  4366. case 'a=inactive':
  4367. return n[t].substring(2);
  4368. }
  4369. return r ? e.getDirection(r) : 'sendrecv';
  4370. }),
  4371. (e.getKind = function (t) {
  4372. return e.splitLines(t)[0].split(' ')[0].substring(2);
  4373. }),
  4374. (e.isRejected = function (t) {
  4375. return '0' === t.split(' ', 2)[1];
  4376. }),
  4377. (e.parseMLine = function (t) {
  4378. const r = e.splitLines(t)[0].substring(2).split(' ');
  4379. return {
  4380. kind: r[0],
  4381. port: parseInt(r[1], 10),
  4382. protocol: r[2],
  4383. fmt: r.slice(3).join(' '),
  4384. };
  4385. }),
  4386. (e.parseOLine = function (t) {
  4387. const r = e.matchPrefix(t, 'o=')[0].substring(2).split(' ');
  4388. return {
  4389. username: r[0],
  4390. sessionId: r[1],
  4391. sessionVersion: parseInt(r[2], 10),
  4392. netType: r[3],
  4393. addressType: r[4],
  4394. address: r[5],
  4395. };
  4396. }),
  4397. (e.isValidSDP = function (t) {
  4398. if ('string' != typeof t || 0 === t.length) return !1;
  4399. const r = e.splitLines(t);
  4400. for (let t = 0; t < r.length; t++)
  4401. if (r[t].length < 2 || '=' !== r[t].charAt(1)) return !1;
  4402. return !0;
  4403. }),
  4404. (t.exports = e);
  4405. })(bf);
  4406. var Tf = bf.exports,
  4407. xf = t({ __proto__: null, default: Tf }, [bf.exports]);
  4408. function Ef(t) {
  4409. if (
  4410. !t.RTCIceCandidate ||
  4411. (t.RTCIceCandidate && 'foundation' in t.RTCIceCandidate.prototype)
  4412. )
  4413. return;
  4414. const e = t.RTCIceCandidate;
  4415. (t.RTCIceCandidate = function (t) {
  4416. if (
  4417. ('object' == typeof t &&
  4418. t.candidate &&
  4419. 0 === t.candidate.indexOf('a=') &&
  4420. ((t = JSON.parse(JSON.stringify(t))).candidate =
  4421. t.candidate.substring(2)),
  4422. t.candidate && t.candidate.length)
  4423. ) {
  4424. const r = new e(t),
  4425. n = Tf.parseCandidate(t.candidate);
  4426. for (const t in n)
  4427. t in r || Object.defineProperty(r, t, { value: n[t] });
  4428. return (
  4429. (r.toJSON = function () {
  4430. return {
  4431. candidate: r.candidate,
  4432. sdpMid: r.sdpMid,
  4433. sdpMLineIndex: r.sdpMLineIndex,
  4434. usernameFragment: r.usernameFragment,
  4435. };
  4436. }),
  4437. r
  4438. );
  4439. }
  4440. return new e(t);
  4441. }),
  4442. (t.RTCIceCandidate.prototype = e.prototype),
  4443. Od(
  4444. t,
  4445. 'icecandidate',
  4446. (e) => (
  4447. e.candidate &&
  4448. Object.defineProperty(e, 'candidate', {
  4449. value: new t.RTCIceCandidate(e.candidate),
  4450. writable: 'false',
  4451. }),
  4452. e
  4453. )
  4454. );
  4455. }
  4456. function Sf(t) {
  4457. !t.RTCIceCandidate ||
  4458. (t.RTCIceCandidate && 'relayProtocol' in t.RTCIceCandidate.prototype) ||
  4459. Od(t, 'icecandidate', (t) => {
  4460. if (t.candidate) {
  4461. const e = Tf.parseCandidate(t.candidate.candidate);
  4462. 'relay' === e.type &&
  4463. (t.candidate.relayProtocol = { 0: 'tls', 1: 'tcp', 2: 'udp' }[
  4464. e.priority >> 24
  4465. ]);
  4466. }
  4467. return t;
  4468. });
  4469. }
  4470. function wf(t, e) {
  4471. if (!t.RTCPeerConnection) return;
  4472. 'sctp' in t.RTCPeerConnection.prototype ||
  4473. Object.defineProperty(t.RTCPeerConnection.prototype, 'sctp', {
  4474. get() {
  4475. return void 0 === this._sctp ? null : this._sctp;
  4476. },
  4477. });
  4478. const r = function (t) {
  4479. if (!t || !t.sdp) return !1;
  4480. const e = Tf.splitSections(t.sdp);
  4481. return (
  4482. e.shift(),
  4483. e.some((t) => {
  4484. const e = Tf.parseMLine(t);
  4485. return (
  4486. e && 'application' === e.kind && -1 !== e.protocol.indexOf('SCTP')
  4487. );
  4488. })
  4489. );
  4490. },
  4491. n = function (t) {
  4492. const e = t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);
  4493. if (null === e || e.length < 2) return -1;
  4494. const r = parseInt(e[1], 10);
  4495. return r != r ? -1 : r;
  4496. },
  4497. i = function (t) {
  4498. let r = 65536;
  4499. return (
  4500. 'firefox' === e.browser &&
  4501. (r =
  4502. e.version < 57
  4503. ? -1 === t
  4504. ? 16384
  4505. : 2147483637
  4506. : e.version < 60
  4507. ? 57 === e.version
  4508. ? 65535
  4509. : 65536
  4510. : 2147483637),
  4511. r
  4512. );
  4513. },
  4514. o = function (t, r) {
  4515. let n = 65536;
  4516. 'firefox' === e.browser && 57 === e.version && (n = 65535);
  4517. const i = Tf.matchPrefix(t.sdp, 'a=max-message-size:');
  4518. return (
  4519. i.length > 0
  4520. ? (n = parseInt(i[0].substring(19), 10))
  4521. : 'firefox' === e.browser && -1 !== r && (n = 2147483637),
  4522. n
  4523. );
  4524. },
  4525. s = t.RTCPeerConnection.prototype.setRemoteDescription;
  4526. t.RTCPeerConnection.prototype.setRemoteDescription = function () {
  4527. if (((this._sctp = null), 'chrome' === e.browser && e.version >= 76)) {
  4528. const { sdpSemantics: t } = this.getConfiguration();
  4529. 'plan-b' === t &&
  4530. Object.defineProperty(this, 'sctp', {
  4531. get() {
  4532. return void 0 === this._sctp ? null : this._sctp;
  4533. },
  4534. enumerable: !0,
  4535. configurable: !0,
  4536. });
  4537. }
  4538. if (r(arguments[0])) {
  4539. const t = n(arguments[0]),
  4540. e = i(t),
  4541. r = o(arguments[0], t);
  4542. let s;
  4543. s =
  4544. 0 === e && 0 === r
  4545. ? Number.POSITIVE_INFINITY
  4546. : 0 === e || 0 === r
  4547. ? Math.max(e, r)
  4548. : Math.min(e, r);
  4549. const a = {};
  4550. Object.defineProperty(a, 'maxMessageSize', { get: () => s }),
  4551. (this._sctp = a);
  4552. }
  4553. return s.apply(this, arguments);
  4554. };
  4555. }
  4556. function Rf(t) {
  4557. if (
  4558. !t.RTCPeerConnection ||
  4559. !('createDataChannel' in t.RTCPeerConnection.prototype)
  4560. )
  4561. return;
  4562. function e(t, e) {
  4563. const r = t.send;
  4564. t.send = function () {
  4565. const n = arguments[0],
  4566. i = n.length || n.size || n.byteLength;
  4567. if ('open' === t.readyState && e.sctp && i > e.sctp.maxMessageSize)
  4568. throw new TypeError(
  4569. 'Message too large (can send a maximum of ' +
  4570. e.sctp.maxMessageSize +
  4571. ' bytes)'
  4572. );
  4573. return r.apply(t, arguments);
  4574. };
  4575. }
  4576. const r = t.RTCPeerConnection.prototype.createDataChannel;
  4577. (t.RTCPeerConnection.prototype.createDataChannel = function () {
  4578. const t = r.apply(this, arguments);
  4579. return e(t, this), t;
  4580. }),
  4581. Od(t, 'datachannel', (t) => (e(t.channel, t.target), t));
  4582. }
  4583. function Cf(t) {
  4584. if (
  4585. !t.RTCPeerConnection ||
  4586. 'connectionState' in t.RTCPeerConnection.prototype
  4587. )
  4588. return;
  4589. const e = t.RTCPeerConnection.prototype;
  4590. Object.defineProperty(e, 'connectionState', {
  4591. get() {
  4592. return (
  4593. { completed: 'connected', checking: 'connecting' }[
  4594. this.iceConnectionState
  4595. ] || this.iceConnectionState
  4596. );
  4597. },
  4598. enumerable: !0,
  4599. configurable: !0,
  4600. }),
  4601. Object.defineProperty(e, 'onconnectionstatechange', {
  4602. get() {
  4603. return this._onconnectionstatechange || null;
  4604. },
  4605. set(t) {
  4606. this._onconnectionstatechange &&
  4607. (this.removeEventListener(
  4608. 'connectionstatechange',
  4609. this._onconnectionstatechange
  4610. ),
  4611. delete this._onconnectionstatechange),
  4612. t &&
  4613. this.addEventListener(
  4614. 'connectionstatechange',
  4615. (this._onconnectionstatechange = t)
  4616. );
  4617. },
  4618. enumerable: !0,
  4619. configurable: !0,
  4620. }),
  4621. ['setLocalDescription', 'setRemoteDescription'].forEach((t) => {
  4622. const r = e[t];
  4623. e[t] = function () {
  4624. return (
  4625. this._connectionstatechangepoly ||
  4626. ((this._connectionstatechangepoly = (t) => {
  4627. const e = t.target;
  4628. if (e._lastConnectionState !== e.connectionState) {
  4629. e._lastConnectionState = e.connectionState;
  4630. const r = new Event('connectionstatechange', t);
  4631. e.dispatchEvent(r);
  4632. }
  4633. return t;
  4634. }),
  4635. this.addEventListener(
  4636. 'iceconnectionstatechange',
  4637. this._connectionstatechangepoly
  4638. )),
  4639. r.apply(this, arguments)
  4640. );
  4641. };
  4642. });
  4643. }
  4644. function Pf(t, e) {
  4645. if (!t.RTCPeerConnection) return;
  4646. if ('chrome' === e.browser && e.version >= 71) return;
  4647. if ('safari' === e.browser && e.version >= 605) return;
  4648. const r = t.RTCPeerConnection.prototype.setRemoteDescription;
  4649. t.RTCPeerConnection.prototype.setRemoteDescription = function (e) {
  4650. if (e && e.sdp && -1 !== e.sdp.indexOf('\na=extmap-allow-mixed')) {
  4651. const r = e.sdp
  4652. .split('\n')
  4653. .filter((t) => 'a=extmap-allow-mixed' !== t.trim())
  4654. .join('\n');
  4655. t.RTCSessionDescription && e instanceof t.RTCSessionDescription
  4656. ? (arguments[0] = new t.RTCSessionDescription({
  4657. type: e.type,
  4658. sdp: r,
  4659. }))
  4660. : (e.sdp = r);
  4661. }
  4662. return r.apply(this, arguments);
  4663. };
  4664. }
  4665. function Af(t, e) {
  4666. if (!t.RTCPeerConnection || !t.RTCPeerConnection.prototype) return;
  4667. const r = t.RTCPeerConnection.prototype.addIceCandidate;
  4668. r &&
  4669. 0 !== r.length &&
  4670. (t.RTCPeerConnection.prototype.addIceCandidate = function () {
  4671. return arguments[0]
  4672. ? (('chrome' === e.browser && e.version < 78) ||
  4673. ('firefox' === e.browser && e.version < 68) ||
  4674. 'safari' === e.browser) &&
  4675. arguments[0] &&
  4676. '' === arguments[0].candidate
  4677. ? Promise.resolve()
  4678. : r.apply(this, arguments)
  4679. : (arguments[1] && arguments[1].apply(null), Promise.resolve());
  4680. });
  4681. }
  4682. function Of(t, e) {
  4683. if (!t.RTCPeerConnection || !t.RTCPeerConnection.prototype) return;
  4684. const r = t.RTCPeerConnection.prototype.setLocalDescription;
  4685. r &&
  4686. 0 !== r.length &&
  4687. (t.RTCPeerConnection.prototype.setLocalDescription = function () {
  4688. let t = arguments[0] || {};
  4689. if ('object' != typeof t || (t.type && t.sdp))
  4690. return r.apply(this, arguments);
  4691. if (((t = { type: t.type, sdp: t.sdp }), !t.type))
  4692. switch (this.signalingState) {
  4693. case 'stable':
  4694. case 'have-local-offer':
  4695. case 'have-remote-pranswer':
  4696. t.type = 'offer';
  4697. break;
  4698. default:
  4699. t.type = 'answer';
  4700. }
  4701. if (t.sdp || ('offer' !== t.type && 'answer' !== t.type))
  4702. return r.apply(this, [t]);
  4703. const e = 'offer' === t.type ? this.createOffer : this.createAnswer;
  4704. return e.apply(this).then((t) => r.apply(this, [t]));
  4705. });
  4706. }
  4707. var If = Object.freeze({
  4708. __proto__: null,
  4709. shimRTCIceCandidate: Ef,
  4710. shimRTCIceCandidateRelayProtocol: Sf,
  4711. shimMaxMessageSize: wf,
  4712. shimSendThrowTypeError: Rf,
  4713. shimConnectionState: Cf,
  4714. removeExtmapAllowMixed: Pf,
  4715. shimAddIceCandidateNullOrEmpty: Af,
  4716. shimParameterlessSetLocalDescription: Of,
  4717. });
  4718. const Mf = (function (
  4719. { window: t } = {},
  4720. e = { shimChrome: !0, shimFirefox: !0, shimSafari: !0 }
  4721. ) {
  4722. const r = Dd,
  4723. n = (function (t) {
  4724. const e = { browser: null, version: null };
  4725. if (void 0 === t || !t.navigator || !t.navigator.userAgent)
  4726. return (e.browser = 'Not a browser.'), e;
  4727. const { navigator: r } = t;
  4728. if (r.mozGetUserMedia)
  4729. (e.browser = 'firefox'),
  4730. (e.version = Ad(r.userAgent, /Firefox\/(\d+)\./, 1));
  4731. else if (
  4732. r.webkitGetUserMedia ||
  4733. (!1 === t.isSecureContext && t.webkitRTCPeerConnection)
  4734. )
  4735. (e.browser = 'chrome'),
  4736. (e.version = Ad(r.userAgent, /Chrom(e|ium)\/(\d+)\./, 2));
  4737. else {
  4738. if (
  4739. !t.RTCPeerConnection ||
  4740. !r.userAgent.match(/AppleWebKit\/(\d+)\./)
  4741. )
  4742. return (e.browser = 'Not a supported browser.'), e;
  4743. (e.browser = 'safari'),
  4744. (e.version = Ad(r.userAgent, /AppleWebKit\/(\d+)\./, 1)),
  4745. (e.supportsUnifiedPlan =
  4746. t.RTCRtpTransceiver &&
  4747. 'currentDirection' in t.RTCRtpTransceiver.prototype);
  4748. }
  4749. return e;
  4750. })(t),
  4751. i = {
  4752. browserDetails: n,
  4753. commonShim: If,
  4754. extractVersion: Ad,
  4755. disableLog: Id,
  4756. disableWarnings: Md,
  4757. sdp: xf,
  4758. };
  4759. switch (n.browser) {
  4760. case 'chrome':
  4761. if (!Kd || !Zd || !e.shimChrome)
  4762. return r('Chrome shim is not included in this adapter release.'), i;
  4763. if (null === n.version)
  4764. return r('Chrome shim can not determine version, not shimming.'), i;
  4765. r('adapter.js shimming chrome.'),
  4766. (i.browserShim = Kd),
  4767. Af(t, n),
  4768. Of(t),
  4769. Ud(t, n),
  4770. jd(t),
  4771. Zd(t, n),
  4772. Xd(t),
  4773. zd(t, n),
  4774. Vd(t),
  4775. Hd(t),
  4776. Wd(t),
  4777. Jd(t, n),
  4778. Ef(t),
  4779. Sf(t),
  4780. Cf(t),
  4781. wf(t, n),
  4782. Rf(t),
  4783. Pf(t, n);
  4784. break;
  4785. case 'firefox':
  4786. if (!cf || !$d || !e.shimFirefox)
  4787. return r('Firefox shim is not included in this adapter release.'), i;
  4788. r('adapter.js shimming firefox.'),
  4789. (i.browserShim = cf),
  4790. Af(t, n),
  4791. Of(t),
  4792. qd(t, n),
  4793. $d(t, n),
  4794. Qd(t),
  4795. rf(t),
  4796. tf(t),
  4797. ef(t),
  4798. nf(t),
  4799. of(t),
  4800. sf(t),
  4801. af(t),
  4802. uf(t),
  4803. Ef(t),
  4804. Cf(t),
  4805. wf(t, n),
  4806. Rf(t);
  4807. break;
  4808. case 'safari':
  4809. if (!_f || !e.shimSafari)
  4810. return r('Safari shim is not included in this adapter release.'), i;
  4811. r('adapter.js shimming safari.'),
  4812. (i.browserShim = _f),
  4813. Af(t, n),
  4814. Of(t),
  4815. vf(t),
  4816. yf(t),
  4817. df(t),
  4818. hf(t),
  4819. lf(t),
  4820. mf(t),
  4821. ff(t),
  4822. gf(t),
  4823. Ef(t),
  4824. Sf(t),
  4825. wf(t, n),
  4826. Rf(t),
  4827. Pf(t, n);
  4828. break;
  4829. default:
  4830. r('Unsupported browser!');
  4831. }
  4832. return i;
  4833. })({ window: 'undefined' == typeof window ? void 0 : window });
  4834. let Df = (t = 21) =>
  4835. crypto
  4836. .getRandomValues(new Uint8Array(t))
  4837. .reduce(
  4838. (t, e) =>
  4839. (t +=
  4840. (e &= 63) < 36
  4841. ? e.toString(36)
  4842. : e < 62
  4843. ? (e - 26).toString(36).toUpperCase()
  4844. : e > 62
  4845. ? '-'
  4846. : '_'),
  4847. ''
  4848. );
  4849. var Lf = { exports: {} },
  4850. Ff = 1e3,
  4851. Nf = 60 * Ff,
  4852. kf = 60 * Nf,
  4853. Bf = 24 * kf,
  4854. Gf = 7 * Bf,
  4855. Uf = 365.25 * Bf,
  4856. jf = function (t, e) {
  4857. e = e || {};
  4858. var r = typeof t;
  4859. if ('string' === r && t.length > 0)
  4860. return (function (t) {
  4861. if ((t = String(t)).length > 100) return;
  4862. var e =
  4863. /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  4864. t
  4865. );
  4866. if (!e) return;
  4867. var r = parseFloat(e[1]);
  4868. switch ((e[2] || 'ms').toLowerCase()) {
  4869. case 'years':
  4870. case 'year':
  4871. case 'yrs':
  4872. case 'yr':
  4873. case 'y':
  4874. return r * Uf;
  4875. case 'weeks':
  4876. case 'week':
  4877. case 'w':
  4878. return r * Gf;
  4879. case 'days':
  4880. case 'day':
  4881. case 'd':
  4882. return r * Bf;
  4883. case 'hours':
  4884. case 'hour':
  4885. case 'hrs':
  4886. case 'hr':
  4887. case 'h':
  4888. return r * kf;
  4889. case 'minutes':
  4890. case 'minute':
  4891. case 'mins':
  4892. case 'min':
  4893. case 'm':
  4894. return r * Nf;
  4895. case 'seconds':
  4896. case 'second':
  4897. case 'secs':
  4898. case 'sec':
  4899. case 's':
  4900. return r * Ff;
  4901. case 'milliseconds':
  4902. case 'millisecond':
  4903. case 'msecs':
  4904. case 'msec':
  4905. case 'ms':
  4906. return r;
  4907. default:
  4908. return;
  4909. }
  4910. })(t);
  4911. if ('number' === r && isFinite(t))
  4912. return e.long
  4913. ? (function (t) {
  4914. var e = Math.abs(t);
  4915. if (e >= Bf) return Xf(t, e, Bf, 'day');
  4916. if (e >= kf) return Xf(t, e, kf, 'hour');
  4917. if (e >= Nf) return Xf(t, e, Nf, 'minute');
  4918. if (e >= Ff) return Xf(t, e, Ff, 'second');
  4919. return t + ' ms';
  4920. })(t)
  4921. : (function (t) {
  4922. var e = Math.abs(t);
  4923. if (e >= Bf) return Math.round(t / Bf) + 'd';
  4924. if (e >= kf) return Math.round(t / kf) + 'h';
  4925. if (e >= Nf) return Math.round(t / Nf) + 'm';
  4926. if (e >= Ff) return Math.round(t / Ff) + 's';
  4927. return t + 'ms';
  4928. })(t);
  4929. throw new Error(
  4930. 'val is not a non-empty string or a valid number. val=' +
  4931. JSON.stringify(t)
  4932. );
  4933. };
  4934. function Xf(t, e, r, n) {
  4935. var i = e >= 1.5 * r;
  4936. return Math.round(t / r) + ' ' + n + (i ? 's' : '');
  4937. }
  4938. var Vf = function (t) {
  4939. function e(t) {
  4940. let n,
  4941. i,
  4942. o,
  4943. s = null;
  4944. function a(...t) {
  4945. if (!a.enabled) return;
  4946. const r = a,
  4947. i = Number(new Date()),
  4948. o = i - (n || i);
  4949. (r.diff = o),
  4950. (r.prev = n),
  4951. (r.curr = i),
  4952. (n = i),
  4953. (t[0] = e.coerce(t[0])),
  4954. 'string' != typeof t[0] && t.unshift('%O');
  4955. let s = 0;
  4956. (t[0] = t[0].replace(/%([a-zA-Z%])/g, (n, i) => {
  4957. if ('%%' === n) return '%';
  4958. s++;
  4959. const o = e.formatters[i];
  4960. if ('function' == typeof o) {
  4961. const e = t[s];
  4962. (n = o.call(r, e)), t.splice(s, 1), s--;
  4963. }
  4964. return n;
  4965. })),
  4966. e.formatArgs.call(r, t);
  4967. (r.log || e.log).apply(r, t);
  4968. }
  4969. return (
  4970. (a.namespace = t),
  4971. (a.useColors = e.useColors()),
  4972. (a.color = e.selectColor(t)),
  4973. (a.extend = r),
  4974. (a.destroy = e.destroy),
  4975. Object.defineProperty(a, 'enabled', {
  4976. enumerable: !0,
  4977. configurable: !1,
  4978. get: () =>
  4979. null !== s
  4980. ? s
  4981. : (i !== e.namespaces && ((i = e.namespaces), (o = e.enabled(t))),
  4982. o),
  4983. set: (t) => {
  4984. s = t;
  4985. },
  4986. }),
  4987. 'function' == typeof e.init && e.init(a),
  4988. a
  4989. );
  4990. }
  4991. function r(t, r) {
  4992. const n = e(this.namespace + (void 0 === r ? ':' : r) + t);
  4993. return (n.log = this.log), n;
  4994. }
  4995. function n(t) {
  4996. return t
  4997. .toString()
  4998. .substring(2, t.toString().length - 2)
  4999. .replace(/\.\*\?$/, '*');
  5000. }
  5001. return (
  5002. (e.debug = e),
  5003. (e.default = e),
  5004. (e.coerce = function (t) {
  5005. if (t instanceof Error) return t.stack || t.message;
  5006. return t;
  5007. }),
  5008. (e.disable = function () {
  5009. const t = [
  5010. ...e.names.map(n),
  5011. ...e.skips.map(n).map((t) => '-' + t),
  5012. ].join(',');
  5013. return e.enable(''), t;
  5014. }),
  5015. (e.enable = function (t) {
  5016. let r;
  5017. e.save(t), (e.namespaces = t), (e.names = []), (e.skips = []);
  5018. const n = ('string' == typeof t ? t : '').split(/[\s,]+/),
  5019. i = n.length;
  5020. for (r = 0; r < i; r++)
  5021. n[r] &&
  5022. ('-' === (t = n[r].replace(/\*/g, '.*?'))[0]
  5023. ? e.skips.push(new RegExp('^' + t.slice(1) + '$'))
  5024. : e.names.push(new RegExp('^' + t + '$')));
  5025. }),
  5026. (e.enabled = function (t) {
  5027. if ('*' === t[t.length - 1]) return !0;
  5028. let r, n;
  5029. for (r = 0, n = e.skips.length; r < n; r++)
  5030. if (e.skips[r].test(t)) return !1;
  5031. for (r = 0, n = e.names.length; r < n; r++)
  5032. if (e.names[r].test(t)) return !0;
  5033. return !1;
  5034. }),
  5035. (e.humanize = jf),
  5036. (e.destroy = function () {
  5037. console.warn(
  5038. 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
  5039. );
  5040. }),
  5041. Object.keys(t).forEach((r) => {
  5042. e[r] = t[r];
  5043. }),
  5044. (e.names = []),
  5045. (e.skips = []),
  5046. (e.formatters = {}),
  5047. (e.selectColor = function (t) {
  5048. let r = 0;
  5049. for (let e = 0; e < t.length; e++)
  5050. (r = (r << 5) - r + t.charCodeAt(e)), (r |= 0);
  5051. return e.colors[Math.abs(r) % e.colors.length];
  5052. }),
  5053. e.enable(e.load()),
  5054. e
  5055. );
  5056. };
  5057. !(function (t, e) {
  5058. (e.formatArgs = function (e) {
  5059. if (
  5060. ((e[0] =
  5061. (this.useColors ? '%c' : '') +
  5062. this.namespace +
  5063. (this.useColors ? ' %c' : ' ') +
  5064. e[0] +
  5065. (this.useColors ? '%c ' : ' ') +
  5066. '+' +
  5067. t.exports.humanize(this.diff)),
  5068. !this.useColors)
  5069. )
  5070. return;
  5071. const r = 'color: ' + this.color;
  5072. e.splice(1, 0, r, 'color: inherit');
  5073. let n = 0,
  5074. i = 0;
  5075. e[0].replace(/%[a-zA-Z%]/g, (t) => {
  5076. '%%' !== t && (n++, '%c' === t && (i = n));
  5077. }),
  5078. e.splice(i, 0, r);
  5079. }),
  5080. (e.save = function (t) {
  5081. try {
  5082. t ? e.storage.setItem('debug', t) : e.storage.removeItem('debug');
  5083. } catch (t) {}
  5084. }),
  5085. (e.load = function () {
  5086. let t;
  5087. try {
  5088. t = e.storage.getItem('debug');
  5089. } catch (t) {}
  5090. !t &&
  5091. 'undefined' != typeof process &&
  5092. 'env' in process &&
  5093. (t = process.env.DEBUG);
  5094. return t;
  5095. }),
  5096. (e.useColors = function () {
  5097. if (
  5098. 'undefined' != typeof window &&
  5099. window.process &&
  5100. ('renderer' === window.process.type || window.process.__nwjs)
  5101. )
  5102. return !0;
  5103. if (
  5104. 'undefined' != typeof navigator &&
  5105. navigator.userAgent &&
  5106. navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)
  5107. )
  5108. return !1;
  5109. return (
  5110. ('undefined' != typeof document &&
  5111. document.documentElement &&
  5112. document.documentElement.style &&
  5113. document.documentElement.style.WebkitAppearance) ||
  5114. ('undefined' != typeof window &&
  5115. window.console &&
  5116. (window.console.firebug ||
  5117. (window.console.exception && window.console.table))) ||
  5118. ('undefined' != typeof navigator &&
  5119. navigator.userAgent &&
  5120. navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
  5121. parseInt(RegExp.$1, 10) >= 31) ||
  5122. ('undefined' != typeof navigator &&
  5123. navigator.userAgent &&
  5124. navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))
  5125. );
  5126. }),
  5127. (e.storage = (function () {
  5128. try {
  5129. return localStorage;
  5130. } catch (t) {}
  5131. })()),
  5132. (e.destroy = (() => {
  5133. let t = !1;
  5134. return () => {
  5135. t ||
  5136. ((t = !0),
  5137. console.warn(
  5138. 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
  5139. ));
  5140. };
  5141. })()),
  5142. (e.colors = [
  5143. '#0000CC',
  5144. '#0000FF',
  5145. '#0033CC',
  5146. '#0033FF',
  5147. '#0066CC',
  5148. '#0066FF',
  5149. '#0099CC',
  5150. '#0099FF',
  5151. '#00CC00',
  5152. '#00CC33',
  5153. '#00CC66',
  5154. '#00CC99',
  5155. '#00CCCC',
  5156. '#00CCFF',
  5157. '#3300CC',
  5158. '#3300FF',
  5159. '#3333CC',
  5160. '#3333FF',
  5161. '#3366CC',
  5162. '#3366FF',
  5163. '#3399CC',
  5164. '#3399FF',
  5165. '#33CC00',
  5166. '#33CC33',
  5167. '#33CC66',
  5168. '#33CC99',
  5169. '#33CCCC',
  5170. '#33CCFF',
  5171. '#6600CC',
  5172. '#6600FF',
  5173. '#6633CC',
  5174. '#6633FF',
  5175. '#66CC00',
  5176. '#66CC33',
  5177. '#9900CC',
  5178. '#9900FF',
  5179. '#9933CC',
  5180. '#9933FF',
  5181. '#99CC00',
  5182. '#99CC33',
  5183. '#CC0000',
  5184. '#CC0033',
  5185. '#CC0066',
  5186. '#CC0099',
  5187. '#CC00CC',
  5188. '#CC00FF',
  5189. '#CC3300',
  5190. '#CC3333',
  5191. '#CC3366',
  5192. '#CC3399',
  5193. '#CC33CC',
  5194. '#CC33FF',
  5195. '#CC6600',
  5196. '#CC6633',
  5197. '#CC9900',
  5198. '#CC9933',
  5199. '#CCCC00',
  5200. '#CCCC33',
  5201. '#FF0000',
  5202. '#FF0033',
  5203. '#FF0066',
  5204. '#FF0099',
  5205. '#FF00CC',
  5206. '#FF00FF',
  5207. '#FF3300',
  5208. '#FF3333',
  5209. '#FF3366',
  5210. '#FF3399',
  5211. '#FF33CC',
  5212. '#FF33FF',
  5213. '#FF6600',
  5214. '#FF6633',
  5215. '#FF9900',
  5216. '#FF9933',
  5217. '#FFCC00',
  5218. '#FFCC33',
  5219. ]),
  5220. (e.log = console.debug || console.log || (() => {})),
  5221. (t.exports = Vf(e));
  5222. const { formatters: r } = t.exports;
  5223. r.j = function (t) {
  5224. try {
  5225. return JSON.stringify(t);
  5226. } catch (t) {
  5227. return '[UnexpectedJSONParseError]: ' + t.message;
  5228. }
  5229. };
  5230. })(Lf, Lf.exports);
  5231. var Hf,
  5232. Wf,
  5233. Yf = Lf.exports,
  5234. zf = '2.1.1',
  5235. Zf =
  5236. 'max-width:100%;max-height:100%;object-fit:contain;display:block;margin:0 auto;',
  5237. Jf = {
  5238. '120p': { width: 160, height: 120, frameRate: 15, bitrate: 200 },
  5239. '180p': { width: 320, height: 180, frameRate: 15, bitrate: 350 },
  5240. '240p': { width: 320, height: 240, frameRate: 15, bitrate: 400 },
  5241. '360p': { width: 640, height: 360, frameRate: 15, bitrate: 800 },
  5242. '480p': { width: 640, height: 480, frameRate: 15, bitrate: 900 },
  5243. '720p': { width: 1280, height: 720, frameRate: 15, bitrate: 1500 },
  5244. '1080p': { width: 1920, height: 1080, frameRate: 15, bitrate: 2e3 },
  5245. '2K': { width: 2560, height: 1440, frameRate: 30, bitrate: 4860 },
  5246. '4K': { width: 3840, height: 2160, frameRate: 30, bitrate: 9e3 },
  5247. },
  5248. Kf = {
  5249. standard: { sampleRate: 48e3, bitrate: 40 },
  5250. high: { sampleRate: 48e3, bitrate: 128 },
  5251. };
  5252. !(function (t) {
  5253. (t[(t.TXLIVE_ERROR_WEBRTC_FAILED = -1)] = 'TXLIVE_ERROR_WEBRTC_FAILED'),
  5254. (t[(t.TXLIVE_ERROR_REQUEST_FAILED = -2)] = 'TXLIVE_ERROR_REQUEST_FAILED'),
  5255. (t[(t.TXLIVE_WARNING_CAMERA_START_FAILED = -1001)] =
  5256. 'TXLIVE_WARNING_CAMERA_START_FAILED'),
  5257. (t[(t.TXLIVE_WARNING_MICROPHONE_START_FAILED = -1002)] =
  5258. 'TXLIVE_WARNING_MICROPHONE_START_FAILED'),
  5259. (t[(t.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED = -1003)] =
  5260. 'TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED'),
  5261. (t[(t.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED = -1004)] =
  5262. 'TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED'),
  5263. (t[(t.TXLIVE_WARNING_CAMERA_INTERRUPTED = -1005)] =
  5264. 'TXLIVE_WARNING_CAMERA_INTERRUPTED'),
  5265. (t[(t.TXLIVE_WARNING_MICROPHONE_INTERRUPTED = -1006)] =
  5266. 'TXLIVE_WARNING_MICROPHONE_INTERRUPTED'),
  5267. (t[(t.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED = -1007)] =
  5268. 'TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED');
  5269. })(Hf || (Hf = {})),
  5270. (function (t) {
  5271. (t[(t.TXLIVE_PUSH_STATUS_DISCONNECTED = 0)] =
  5272. 'TXLIVE_PUSH_STATUS_DISCONNECTED'),
  5273. (t[(t.TXLIVE_PUSH_STATUS_CONNECTING = 1)] =
  5274. 'TXLIVE_PUSH_STATUS_CONNECTING'),
  5275. (t[(t.TXLIVE_PUSH_STATUS_CONNECTED = 2)] =
  5276. 'TXLIVE_PUSH_STATUS_CONNECTED'),
  5277. (t[(t.TXLIVE_PUSH_STATUS_RECONNECTING = 3)] =
  5278. 'TXLIVE_PUSH_STATUS_RECONNECTING');
  5279. })(Wf || (Wf = {}));
  5280. var qf,
  5281. Qf,
  5282. $f = 'disconnected',
  5283. tp = 'connecting',
  5284. ep = 'connected',
  5285. rp = 'request_push_start',
  5286. np = 'request_push_success',
  5287. ip = ['device', 'screen', 'file'],
  5288. op = {
  5289. deviceId: '',
  5290. frameRate: 15,
  5291. resolution: { width: 1280, height: 720 },
  5292. },
  5293. sp = {
  5294. deviceId: '',
  5295. sampleRate: 48e3,
  5296. echoCancellation: !0,
  5297. noiseSuppression: !0,
  5298. autoGainControl: !0,
  5299. },
  5300. ap = ['image/bmp', 'image/jpeg', 'image/png'],
  5301. up = ['.bmp', '.jpeg', '.jpg', '.png'],
  5302. cp = {
  5303. type: mh(
  5304. (qf = [
  5305. 'video/mp4',
  5306. 'video/webm',
  5307. 'video/ogg',
  5308. 'audio/mpeg',
  5309. 'audio/ogg',
  5310. 'audio/wav',
  5311. ])
  5312. ).call(qf, ap),
  5313. extension: mh((Qf = ['.mp4', '.webm', '.ogg', '.mp3', '.wav'])).call(
  5314. Qf,
  5315. up
  5316. ),
  5317. },
  5318. hp = 'track_stop',
  5319. lp = 'stream_stop',
  5320. dp = ['user', 'environment'],
  5321. fp =
  5322. 'object' == typeof global && global && global.Object === Object && global,
  5323. pp = 'object' == typeof self && self && self.Object === Object && self,
  5324. vp = fp || pp || Function('return this')(),
  5325. mp = vp.Symbol,
  5326. yp = Object.prototype,
  5327. gp = yp.hasOwnProperty,
  5328. _p = yp.toString,
  5329. bp = mp ? mp.toStringTag : void 0;
  5330. var Tp = Object.prototype.toString;
  5331. var xp = mp ? mp.toStringTag : void 0;
  5332. function Ep(t) {
  5333. return null == t
  5334. ? void 0 === t
  5335. ? '[object Undefined]'
  5336. : '[object Null]'
  5337. : xp && xp in Object(t)
  5338. ? (function (t) {
  5339. var e = gp.call(t, bp),
  5340. r = t[bp];
  5341. try {
  5342. t[bp] = void 0;
  5343. var n = !0;
  5344. } catch (t) {}
  5345. var i = _p.call(t);
  5346. return n && (e ? (t[bp] = r) : delete t[bp]), i;
  5347. })(t)
  5348. : (function (t) {
  5349. return Tp.call(t);
  5350. })(t);
  5351. }
  5352. function Sp(t) {
  5353. return null != t && 'object' == typeof t;
  5354. }
  5355. var wp = Array.isArray;
  5356. function Rp(t) {
  5357. var e = typeof t;
  5358. return null != t && ('object' == e || 'function' == e);
  5359. }
  5360. function Cp(t) {
  5361. return t;
  5362. }
  5363. function Pp(t) {
  5364. if (!Rp(t)) return !1;
  5365. var e = Ep(t);
  5366. return (
  5367. '[object Function]' == e ||
  5368. '[object GeneratorFunction]' == e ||
  5369. '[object AsyncFunction]' == e ||
  5370. '[object Proxy]' == e
  5371. );
  5372. }
  5373. var Ap = vp['__core-js_shared__'],
  5374. Op = (function () {
  5375. var t = /[^.]+$/.exec((Ap && Ap.keys && Ap.keys.IE_PROTO) || '');
  5376. return t ? 'Symbol(src)_1.' + t : '';
  5377. })();
  5378. var Ip = Function.prototype.toString;
  5379. function Mp(t) {
  5380. if (null != t) {
  5381. try {
  5382. return Ip.call(t);
  5383. } catch (t) {}
  5384. try {
  5385. return t + '';
  5386. } catch (t) {}
  5387. }
  5388. return '';
  5389. }
  5390. var Dp = /^\[object .+?Constructor\]$/,
  5391. Lp = Function.prototype,
  5392. Fp = Object.prototype,
  5393. Np = Lp.toString,
  5394. kp = Fp.hasOwnProperty,
  5395. Bp = RegExp(
  5396. '^' +
  5397. Np.call(kp)
  5398. .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
  5399. .replace(
  5400. /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
  5401. '$1.*?'
  5402. ) +
  5403. '$'
  5404. );
  5405. function Gp(t) {
  5406. return (
  5407. !(!Rp(t) || ((e = t), Op && Op in e)) && (Pp(t) ? Bp : Dp).test(Mp(t))
  5408. );
  5409. var e;
  5410. }
  5411. function Up(t, e) {
  5412. var r = (function (t, e) {
  5413. return null == t ? void 0 : t[e];
  5414. })(t, e);
  5415. return Gp(r) ? r : void 0;
  5416. }
  5417. var jp = Up(vp, 'WeakMap'),
  5418. Xp = Object.create,
  5419. Vp = (function () {
  5420. function t() {}
  5421. return function (e) {
  5422. if (!Rp(e)) return {};
  5423. if (Xp) return Xp(e);
  5424. t.prototype = e;
  5425. var r = new t();
  5426. return (t.prototype = void 0), r;
  5427. };
  5428. })();
  5429. function Hp(t, e, r) {
  5430. switch (r.length) {
  5431. case 0:
  5432. return t.call(e);
  5433. case 1:
  5434. return t.call(e, r[0]);
  5435. case 2:
  5436. return t.call(e, r[0], r[1]);
  5437. case 3:
  5438. return t.call(e, r[0], r[1], r[2]);
  5439. }
  5440. return t.apply(e, r);
  5441. }
  5442. var Wp = Date.now;
  5443. var Yp,
  5444. zp,
  5445. Zp,
  5446. Jp = (function () {
  5447. try {
  5448. var t = Up(Object, 'defineProperty');
  5449. return t({}, '', {}), t;
  5450. } catch (t) {}
  5451. })(),
  5452. Kp = Jp,
  5453. qp = Kp
  5454. ? function (t, e) {
  5455. return Kp(t, 'toString', {
  5456. configurable: !0,
  5457. enumerable: !1,
  5458. value:
  5459. ((r = e),
  5460. function () {
  5461. return r;
  5462. }),
  5463. writable: !0,
  5464. });
  5465. var r;
  5466. }
  5467. : Cp,
  5468. Qp =
  5469. ((Yp = qp),
  5470. (zp = 0),
  5471. (Zp = 0),
  5472. function () {
  5473. var t = Wp(),
  5474. e = 16 - (t - Zp);
  5475. if (((Zp = t), e > 0)) {
  5476. if (++zp >= 800) return arguments[0];
  5477. } else zp = 0;
  5478. return Yp.apply(void 0, arguments);
  5479. }),
  5480. $p = Qp;
  5481. function tv(t) {
  5482. return t != t;
  5483. }
  5484. function ev(t, e) {
  5485. return (
  5486. !!(null == t ? 0 : t.length) &&
  5487. (function (t, e, r) {
  5488. return e == e
  5489. ? (function (t, e, r) {
  5490. for (var n = r - 1, i = t.length; ++n < i; )
  5491. if (t[n] === e) return n;
  5492. return -1;
  5493. })(t, e, r)
  5494. : (function (t, e, r, n) {
  5495. for (var i = t.length, o = r + (n ? 1 : -1); n ? o-- : ++o < i; )
  5496. if (e(t[o], o, t)) return o;
  5497. return -1;
  5498. })(t, tv, r);
  5499. })(t, e, 0) > -1
  5500. );
  5501. }
  5502. var rv = /^(?:0|[1-9]\d*)$/;
  5503. function nv(t, e) {
  5504. var r = typeof t;
  5505. return (
  5506. !!(e = null == e ? 9007199254740991 : e) &&
  5507. ('number' == r || ('symbol' != r && rv.test(t))) &&
  5508. t > -1 &&
  5509. t % 1 == 0 &&
  5510. t < e
  5511. );
  5512. }
  5513. function iv(t, e, r) {
  5514. '__proto__' == e && Kp
  5515. ? Kp(t, e, { configurable: !0, enumerable: !0, value: r, writable: !0 })
  5516. : (t[e] = r);
  5517. }
  5518. function ov(t, e) {
  5519. return t === e || (t != t && e != e);
  5520. }
  5521. var sv = Object.prototype.hasOwnProperty;
  5522. function av(t, e, r) {
  5523. var n = t[e];
  5524. (sv.call(t, e) && ov(n, r) && (void 0 !== r || e in t)) || iv(t, e, r);
  5525. }
  5526. function uv(t, e, r, n) {
  5527. var i = !r;
  5528. r || (r = {});
  5529. for (var o = -1, s = e.length; ++o < s; ) {
  5530. var a = e[o],
  5531. u = n ? n(r[a], t[a], a, r, t) : void 0;
  5532. void 0 === u && (u = t[a]), i ? iv(r, a, u) : av(r, a, u);
  5533. }
  5534. return r;
  5535. }
  5536. var cv = Math.max;
  5537. function hv(t) {
  5538. return (
  5539. 'number' == typeof t && t > -1 && t % 1 == 0 && t <= 9007199254740991
  5540. );
  5541. }
  5542. function lv(t) {
  5543. return null != t && hv(t.length) && !Pp(t);
  5544. }
  5545. var dv = Object.prototype;
  5546. function fv(t) {
  5547. var e = t && t.constructor;
  5548. return t === (('function' == typeof e && e.prototype) || dv);
  5549. }
  5550. function pv(t) {
  5551. return Sp(t) && '[object Arguments]' == Ep(t);
  5552. }
  5553. var vv = Object.prototype,
  5554. mv = vv.hasOwnProperty,
  5555. yv = vv.propertyIsEnumerable,
  5556. gv = pv(
  5557. (function () {
  5558. return arguments;
  5559. })()
  5560. )
  5561. ? pv
  5562. : function (t) {
  5563. return Sp(t) && mv.call(t, 'callee') && !yv.call(t, 'callee');
  5564. },
  5565. _v = gv;
  5566. var bv =
  5567. 'object' == typeof exports && exports && !exports.nodeType && exports,
  5568. Tv =
  5569. bv && 'object' == typeof module && module && !module.nodeType && module,
  5570. xv = Tv && Tv.exports === bv ? vp.Buffer : void 0,
  5571. Ev =
  5572. (xv ? xv.isBuffer : void 0) ||
  5573. function () {
  5574. return !1;
  5575. },
  5576. Sv = {};
  5577. function wv(t) {
  5578. return function (e) {
  5579. return t(e);
  5580. };
  5581. }
  5582. (Sv['[object Float32Array]'] =
  5583. Sv['[object Float64Array]'] =
  5584. Sv['[object Int8Array]'] =
  5585. Sv['[object Int16Array]'] =
  5586. Sv['[object Int32Array]'] =
  5587. Sv['[object Uint8Array]'] =
  5588. Sv['[object Uint8ClampedArray]'] =
  5589. Sv['[object Uint16Array]'] =
  5590. Sv['[object Uint32Array]'] =
  5591. !0),
  5592. (Sv['[object Arguments]'] =
  5593. Sv['[object Array]'] =
  5594. Sv['[object ArrayBuffer]'] =
  5595. Sv['[object Boolean]'] =
  5596. Sv['[object DataView]'] =
  5597. Sv['[object Date]'] =
  5598. Sv['[object Error]'] =
  5599. Sv['[object Function]'] =
  5600. Sv['[object Map]'] =
  5601. Sv['[object Number]'] =
  5602. Sv['[object Object]'] =
  5603. Sv['[object RegExp]'] =
  5604. Sv['[object Set]'] =
  5605. Sv['[object String]'] =
  5606. Sv['[object WeakMap]'] =
  5607. !1);
  5608. var Rv =
  5609. 'object' == typeof exports && exports && !exports.nodeType && exports,
  5610. Cv =
  5611. Rv && 'object' == typeof module && module && !module.nodeType && module,
  5612. Pv = Cv && Cv.exports === Rv && fp.process,
  5613. Av = (function () {
  5614. try {
  5615. var t = Cv && Cv.require && Cv.require('util').types;
  5616. return t || (Pv && Pv.binding && Pv.binding('util'));
  5617. } catch (t) {}
  5618. })(),
  5619. Ov = Av && Av.isTypedArray,
  5620. Iv = Ov
  5621. ? wv(Ov)
  5622. : function (t) {
  5623. return Sp(t) && hv(t.length) && !!Sv[Ep(t)];
  5624. },
  5625. Mv = Object.prototype.hasOwnProperty;
  5626. function Dv(t, e) {
  5627. var r = wp(t),
  5628. n = !r && _v(t),
  5629. i = !r && !n && Ev(t),
  5630. o = !r && !n && !i && Iv(t),
  5631. s = r || n || i || o,
  5632. a = s
  5633. ? (function (t, e) {
  5634. for (var r = -1, n = Array(t); ++r < t; ) n[r] = e(r);
  5635. return n;
  5636. })(t.length, String)
  5637. : [],
  5638. u = a.length;
  5639. for (var c in t)
  5640. (!e && !Mv.call(t, c)) ||
  5641. (s &&
  5642. ('length' == c ||
  5643. (i && ('offset' == c || 'parent' == c)) ||
  5644. (o && ('buffer' == c || 'byteLength' == c || 'byteOffset' == c)) ||
  5645. nv(c, u))) ||
  5646. a.push(c);
  5647. return a;
  5648. }
  5649. function Lv(t, e) {
  5650. return function (r) {
  5651. return t(e(r));
  5652. };
  5653. }
  5654. var Fv = Lv(Object.keys, Object),
  5655. Nv = Object.prototype.hasOwnProperty;
  5656. function kv(t) {
  5657. return lv(t)
  5658. ? Dv(t)
  5659. : (function (t) {
  5660. if (!fv(t)) return Fv(t);
  5661. var e = [];
  5662. for (var r in Object(t))
  5663. Nv.call(t, r) && 'constructor' != r && e.push(r);
  5664. return e;
  5665. })(t);
  5666. }
  5667. var Bv = Object.prototype.hasOwnProperty;
  5668. function Gv(t) {
  5669. if (!Rp(t))
  5670. return (function (t) {
  5671. var e = [];
  5672. if (null != t) for (var r in Object(t)) e.push(r);
  5673. return e;
  5674. })(t);
  5675. var e = fv(t),
  5676. r = [];
  5677. for (var n in t) ('constructor' != n || (!e && Bv.call(t, n))) && r.push(n);
  5678. return r;
  5679. }
  5680. function Uv(t) {
  5681. return lv(t) ? Dv(t, !0) : Gv(t);
  5682. }
  5683. var jv = Up(Object, 'create');
  5684. var Xv = Object.prototype.hasOwnProperty;
  5685. var Vv = Object.prototype.hasOwnProperty;
  5686. function Hv(t) {
  5687. var e = -1,
  5688. r = null == t ? 0 : t.length;
  5689. for (this.clear(); ++e < r; ) {
  5690. var n = t[e];
  5691. this.set(n[0], n[1]);
  5692. }
  5693. }
  5694. function Wv(t, e) {
  5695. for (var r = t.length; r--; ) if (ov(t[r][0], e)) return r;
  5696. return -1;
  5697. }
  5698. (Hv.prototype.clear = function () {
  5699. (this.__data__ = jv ? jv(null) : {}), (this.size = 0);
  5700. }),
  5701. (Hv.prototype.delete = function (t) {
  5702. var e = this.has(t) && delete this.__data__[t];
  5703. return (this.size -= e ? 1 : 0), e;
  5704. }),
  5705. (Hv.prototype.get = function (t) {
  5706. var e = this.__data__;
  5707. if (jv) {
  5708. var r = e[t];
  5709. return '__lodash_hash_undefined__' === r ? void 0 : r;
  5710. }
  5711. return Xv.call(e, t) ? e[t] : void 0;
  5712. }),
  5713. (Hv.prototype.has = function (t) {
  5714. var e = this.__data__;
  5715. return jv ? void 0 !== e[t] : Vv.call(e, t);
  5716. }),
  5717. (Hv.prototype.set = function (t, e) {
  5718. var r = this.__data__;
  5719. return (
  5720. (this.size += this.has(t) ? 0 : 1),
  5721. (r[t] = jv && void 0 === e ? '__lodash_hash_undefined__' : e),
  5722. this
  5723. );
  5724. });
  5725. var Yv = Array.prototype.splice;
  5726. function zv(t) {
  5727. var e = -1,
  5728. r = null == t ? 0 : t.length;
  5729. for (this.clear(); ++e < r; ) {
  5730. var n = t[e];
  5731. this.set(n[0], n[1]);
  5732. }
  5733. }
  5734. (zv.prototype.clear = function () {
  5735. (this.__data__ = []), (this.size = 0);
  5736. }),
  5737. (zv.prototype.delete = function (t) {
  5738. var e = this.__data__,
  5739. r = Wv(e, t);
  5740. return (
  5741. !(r < 0) &&
  5742. (r == e.length - 1 ? e.pop() : Yv.call(e, r, 1), --this.size, !0)
  5743. );
  5744. }),
  5745. (zv.prototype.get = function (t) {
  5746. var e = this.__data__,
  5747. r = Wv(e, t);
  5748. return r < 0 ? void 0 : e[r][1];
  5749. }),
  5750. (zv.prototype.has = function (t) {
  5751. return Wv(this.__data__, t) > -1;
  5752. }),
  5753. (zv.prototype.set = function (t, e) {
  5754. var r = this.__data__,
  5755. n = Wv(r, t);
  5756. return n < 0 ? (++this.size, r.push([t, e])) : (r[n][1] = e), this;
  5757. });
  5758. var Zv = Up(vp, 'Map');
  5759. function Jv(t, e) {
  5760. var r,
  5761. n,
  5762. i = t.__data__;
  5763. return (
  5764. 'string' == (n = typeof (r = e)) ||
  5765. 'number' == n ||
  5766. 'symbol' == n ||
  5767. 'boolean' == n
  5768. ? '__proto__' !== r
  5769. : null === r
  5770. )
  5771. ? i['string' == typeof e ? 'string' : 'hash']
  5772. : i.map;
  5773. }
  5774. function Kv(t) {
  5775. var e = -1,
  5776. r = null == t ? 0 : t.length;
  5777. for (this.clear(); ++e < r; ) {
  5778. var n = t[e];
  5779. this.set(n[0], n[1]);
  5780. }
  5781. }
  5782. function qv(t, e) {
  5783. for (var r = -1, n = e.length, i = t.length; ++r < n; ) t[i + r] = e[r];
  5784. return t;
  5785. }
  5786. (Kv.prototype.clear = function () {
  5787. (this.size = 0),
  5788. (this.__data__ = {
  5789. hash: new Hv(),
  5790. map: new (Zv || zv)(),
  5791. string: new Hv(),
  5792. });
  5793. }),
  5794. (Kv.prototype.delete = function (t) {
  5795. var e = Jv(this, t).delete(t);
  5796. return (this.size -= e ? 1 : 0), e;
  5797. }),
  5798. (Kv.prototype.get = function (t) {
  5799. return Jv(this, t).get(t);
  5800. }),
  5801. (Kv.prototype.has = function (t) {
  5802. return Jv(this, t).has(t);
  5803. }),
  5804. (Kv.prototype.set = function (t, e) {
  5805. var r = Jv(this, t),
  5806. n = r.size;
  5807. return r.set(t, e), (this.size += r.size == n ? 0 : 1), this;
  5808. });
  5809. var Qv = mp ? mp.isConcatSpreadable : void 0;
  5810. function $v(t) {
  5811. return wp(t) || _v(t) || !!(Qv && t && t[Qv]);
  5812. }
  5813. function tm(t, e, r, n, i) {
  5814. var o = -1,
  5815. s = t.length;
  5816. for (r || (r = $v), i || (i = []); ++o < s; ) {
  5817. var a = t[o];
  5818. e > 0 && r(a)
  5819. ? e > 1
  5820. ? tm(a, e - 1, r, n, i)
  5821. : qv(i, a)
  5822. : n || (i[i.length] = a);
  5823. }
  5824. return i;
  5825. }
  5826. var em = Lv(Object.getPrototypeOf, Object);
  5827. function rm(t) {
  5828. var e = (this.__data__ = new zv(t));
  5829. this.size = e.size;
  5830. }
  5831. (rm.prototype.clear = function () {
  5832. (this.__data__ = new zv()), (this.size = 0);
  5833. }),
  5834. (rm.prototype.delete = function (t) {
  5835. var e = this.__data__,
  5836. r = e.delete(t);
  5837. return (this.size = e.size), r;
  5838. }),
  5839. (rm.prototype.get = function (t) {
  5840. return this.__data__.get(t);
  5841. }),
  5842. (rm.prototype.has = function (t) {
  5843. return this.__data__.has(t);
  5844. }),
  5845. (rm.prototype.set = function (t, e) {
  5846. var r = this.__data__;
  5847. if (r instanceof zv) {
  5848. var n = r.__data__;
  5849. if (!Zv || n.length < 199)
  5850. return n.push([t, e]), (this.size = ++r.size), this;
  5851. r = this.__data__ = new Kv(n);
  5852. }
  5853. return r.set(t, e), (this.size = r.size), this;
  5854. });
  5855. var nm =
  5856. 'object' == typeof exports && exports && !exports.nodeType && exports,
  5857. im =
  5858. nm && 'object' == typeof module && module && !module.nodeType && module,
  5859. om = im && im.exports === nm ? vp.Buffer : void 0,
  5860. sm = om ? om.allocUnsafe : void 0;
  5861. function am() {
  5862. return [];
  5863. }
  5864. var um = Object.prototype.propertyIsEnumerable,
  5865. cm = Object.getOwnPropertySymbols,
  5866. hm = cm
  5867. ? function (t) {
  5868. return null == t
  5869. ? []
  5870. : ((t = Object(t)),
  5871. (function (t, e) {
  5872. for (
  5873. var r = -1, n = null == t ? 0 : t.length, i = 0, o = [];
  5874. ++r < n;
  5875. ) {
  5876. var s = t[r];
  5877. e(s, r, t) && (o[i++] = s);
  5878. }
  5879. return o;
  5880. })(cm(t), function (e) {
  5881. return um.call(t, e);
  5882. }));
  5883. }
  5884. : am,
  5885. lm = hm;
  5886. var dm = Object.getOwnPropertySymbols
  5887. ? function (t) {
  5888. for (var e = []; t; ) qv(e, lm(t)), (t = em(t));
  5889. return e;
  5890. }
  5891. : am;
  5892. function fm(t, e, r) {
  5893. var n = e(t);
  5894. return wp(t) ? n : qv(n, r(t));
  5895. }
  5896. function pm(t) {
  5897. return fm(t, kv, lm);
  5898. }
  5899. function vm(t) {
  5900. return fm(t, Uv, dm);
  5901. }
  5902. var mm = Up(vp, 'DataView'),
  5903. ym = Up(vp, 'Promise'),
  5904. gm = Up(vp, 'Set'),
  5905. _m = '[object Map]',
  5906. bm = '[object Promise]',
  5907. Tm = '[object Set]',
  5908. xm = '[object WeakMap]',
  5909. Em = '[object DataView]',
  5910. Sm = Mp(mm),
  5911. wm = Mp(Zv),
  5912. Rm = Mp(ym),
  5913. Cm = Mp(gm),
  5914. Pm = Mp(jp),
  5915. Am = Ep;
  5916. ((mm && Am(new mm(new ArrayBuffer(1))) != Em) ||
  5917. (Zv && Am(new Zv()) != _m) ||
  5918. (ym && Am(ym.resolve()) != bm) ||
  5919. (gm && Am(new gm()) != Tm) ||
  5920. (jp && Am(new jp()) != xm)) &&
  5921. (Am = function (t) {
  5922. var e = Ep(t),
  5923. r = '[object Object]' == e ? t.constructor : void 0,
  5924. n = r ? Mp(r) : '';
  5925. if (n)
  5926. switch (n) {
  5927. case Sm:
  5928. return Em;
  5929. case wm:
  5930. return _m;
  5931. case Rm:
  5932. return bm;
  5933. case Cm:
  5934. return Tm;
  5935. case Pm:
  5936. return xm;
  5937. }
  5938. return e;
  5939. });
  5940. var Om = Am,
  5941. Im = Object.prototype.hasOwnProperty;
  5942. var Mm = vp.Uint8Array;
  5943. function Dm(t) {
  5944. var e = new t.constructor(t.byteLength);
  5945. return new Mm(e).set(new Mm(t)), e;
  5946. }
  5947. var Lm = /\w*$/;
  5948. var Fm = mp ? mp.prototype : void 0,
  5949. Nm = Fm ? Fm.valueOf : void 0;
  5950. function km(t, e, r) {
  5951. var n,
  5952. i,
  5953. o = t.constructor;
  5954. switch (e) {
  5955. case '[object ArrayBuffer]':
  5956. return Dm(t);
  5957. case '[object Boolean]':
  5958. case '[object Date]':
  5959. return new o(+t);
  5960. case '[object DataView]':
  5961. return (function (t, e) {
  5962. var r = e ? Dm(t.buffer) : t.buffer;
  5963. return new t.constructor(r, t.byteOffset, t.byteLength);
  5964. })(t, r);
  5965. case '[object Float32Array]':
  5966. case '[object Float64Array]':
  5967. case '[object Int8Array]':
  5968. case '[object Int16Array]':
  5969. case '[object Int32Array]':
  5970. case '[object Uint8Array]':
  5971. case '[object Uint8ClampedArray]':
  5972. case '[object Uint16Array]':
  5973. case '[object Uint32Array]':
  5974. return (function (t, e) {
  5975. var r = e ? Dm(t.buffer) : t.buffer;
  5976. return new t.constructor(r, t.byteOffset, t.length);
  5977. })(t, r);
  5978. case '[object Map]':
  5979. case '[object Set]':
  5980. return new o();
  5981. case '[object Number]':
  5982. case '[object String]':
  5983. return new o(t);
  5984. case '[object RegExp]':
  5985. return (
  5986. ((i = new (n = t).constructor(n.source, Lm.exec(n))).lastIndex =
  5987. n.lastIndex),
  5988. i
  5989. );
  5990. case '[object Symbol]':
  5991. return (function (t) {
  5992. return Nm ? Object(Nm.call(t)) : {};
  5993. })(t);
  5994. }
  5995. }
  5996. var Bm = Av && Av.isMap,
  5997. Gm = Bm
  5998. ? wv(Bm)
  5999. : function (t) {
  6000. return Sp(t) && '[object Map]' == Om(t);
  6001. };
  6002. var Um = Av && Av.isSet,
  6003. jm = Um
  6004. ? wv(Um)
  6005. : function (t) {
  6006. return Sp(t) && '[object Set]' == Om(t);
  6007. },
  6008. Xm = '[object Arguments]',
  6009. Vm = '[object Function]',
  6010. Hm = '[object Object]',
  6011. Wm = {};
  6012. function Ym(t, e, r, n, i, o) {
  6013. var s,
  6014. a = 1 & e,
  6015. u = 2 & e,
  6016. c = 4 & e;
  6017. if ((r && (s = i ? r(t, n, i, o) : r(t)), void 0 !== s)) return s;
  6018. if (!Rp(t)) return t;
  6019. var h = wp(t);
  6020. if (h) {
  6021. if (
  6022. ((s = (function (t) {
  6023. var e = t.length,
  6024. r = new t.constructor(e);
  6025. return (
  6026. e &&
  6027. 'string' == typeof t[0] &&
  6028. Im.call(t, 'index') &&
  6029. ((r.index = t.index), (r.input = t.input)),
  6030. r
  6031. );
  6032. })(t)),
  6033. !a)
  6034. )
  6035. return (function (t, e) {
  6036. var r = -1,
  6037. n = t.length;
  6038. for (e || (e = Array(n)); ++r < n; ) e[r] = t[r];
  6039. return e;
  6040. })(t, s);
  6041. } else {
  6042. var l = Om(t),
  6043. d = l == Vm || '[object GeneratorFunction]' == l;
  6044. if (Ev(t))
  6045. return (function (t, e) {
  6046. if (e) return t.slice();
  6047. var r = t.length,
  6048. n = sm ? sm(r) : new t.constructor(r);
  6049. return t.copy(n), n;
  6050. })(t, a);
  6051. if (l == Hm || l == Xm || (d && !i)) {
  6052. if (
  6053. ((s =
  6054. u || d
  6055. ? {}
  6056. : (function (t) {
  6057. return 'function' != typeof t.constructor || fv(t)
  6058. ? {}
  6059. : Vp(em(t));
  6060. })(t)),
  6061. !a)
  6062. )
  6063. return u
  6064. ? (function (t, e) {
  6065. return uv(t, dm(t), e);
  6066. })(
  6067. t,
  6068. (function (t, e) {
  6069. return t && uv(e, Uv(e), t);
  6070. })(s, t)
  6071. )
  6072. : (function (t, e) {
  6073. return uv(t, lm(t), e);
  6074. })(
  6075. t,
  6076. (function (t, e) {
  6077. return t && uv(e, kv(e), t);
  6078. })(s, t)
  6079. );
  6080. } else {
  6081. if (!Wm[l]) return i ? t : {};
  6082. s = km(t, l, a);
  6083. }
  6084. }
  6085. o || (o = new rm());
  6086. var f = o.get(t);
  6087. if (f) return f;
  6088. o.set(t, s),
  6089. jm(t)
  6090. ? t.forEach(function (n) {
  6091. s.add(Ym(n, e, r, n, t, o));
  6092. })
  6093. : Gm(t) &&
  6094. t.forEach(function (n, i) {
  6095. s.set(i, Ym(n, e, r, i, t, o));
  6096. });
  6097. var p = h ? void 0 : (c ? (u ? vm : pm) : u ? Uv : kv)(t);
  6098. return (
  6099. (function (t, e) {
  6100. for (
  6101. var r = -1, n = null == t ? 0 : t.length;
  6102. ++r < n && !1 !== e(t[r], r, t);
  6103. );
  6104. })(p || t, function (n, i) {
  6105. p && (n = t[(i = n)]), av(s, i, Ym(n, e, r, i, t, o));
  6106. }),
  6107. s
  6108. );
  6109. }
  6110. (Wm[Xm] =
  6111. Wm['[object Array]'] =
  6112. Wm['[object ArrayBuffer]'] =
  6113. Wm['[object DataView]'] =
  6114. Wm['[object Boolean]'] =
  6115. Wm['[object Date]'] =
  6116. Wm['[object Float32Array]'] =
  6117. Wm['[object Float64Array]'] =
  6118. Wm['[object Int8Array]'] =
  6119. Wm['[object Int16Array]'] =
  6120. Wm['[object Int32Array]'] =
  6121. Wm['[object Map]'] =
  6122. Wm['[object Number]'] =
  6123. Wm[Hm] =
  6124. Wm['[object RegExp]'] =
  6125. Wm['[object Set]'] =
  6126. Wm['[object String]'] =
  6127. Wm['[object Symbol]'] =
  6128. Wm['[object Uint8Array]'] =
  6129. Wm['[object Uint8ClampedArray]'] =
  6130. Wm['[object Uint16Array]'] =
  6131. Wm['[object Uint32Array]'] =
  6132. !0),
  6133. (Wm['[object Error]'] = Wm[Vm] = Wm['[object WeakMap]'] = !1);
  6134. function zm(t) {
  6135. return Ym(t, 5);
  6136. }
  6137. function Zm(t) {
  6138. var e = -1,
  6139. r = null == t ? 0 : t.length;
  6140. for (this.__data__ = new Kv(); ++e < r; ) this.add(t[e]);
  6141. }
  6142. function Jm(t, e) {
  6143. for (var r = -1, n = null == t ? 0 : t.length; ++r < n; )
  6144. if (e(t[r], r, t)) return !0;
  6145. return !1;
  6146. }
  6147. function Km(t, e) {
  6148. return t.has(e);
  6149. }
  6150. (Zm.prototype.add = Zm.prototype.push =
  6151. function (t) {
  6152. return this.__data__.set(t, '__lodash_hash_undefined__'), this;
  6153. }),
  6154. (Zm.prototype.has = function (t) {
  6155. return this.__data__.has(t);
  6156. });
  6157. function qm(t, e, r, n, i, o) {
  6158. var s = 1 & r,
  6159. a = t.length,
  6160. u = e.length;
  6161. if (a != u && !(s && u > a)) return !1;
  6162. var c = o.get(t),
  6163. h = o.get(e);
  6164. if (c && h) return c == e && h == t;
  6165. var l = -1,
  6166. d = !0,
  6167. f = 2 & r ? new Zm() : void 0;
  6168. for (o.set(t, e), o.set(e, t); ++l < a; ) {
  6169. var p = t[l],
  6170. v = e[l];
  6171. if (n) var m = s ? n(v, p, l, e, t, o) : n(p, v, l, t, e, o);
  6172. if (void 0 !== m) {
  6173. if (m) continue;
  6174. d = !1;
  6175. break;
  6176. }
  6177. if (f) {
  6178. if (
  6179. !Jm(e, function (t, e) {
  6180. if (!Km(f, e) && (p === t || i(p, t, r, n, o))) return f.push(e);
  6181. })
  6182. ) {
  6183. d = !1;
  6184. break;
  6185. }
  6186. } else if (p !== v && !i(p, v, r, n, o)) {
  6187. d = !1;
  6188. break;
  6189. }
  6190. }
  6191. return o.delete(t), o.delete(e), d;
  6192. }
  6193. function Qm(t) {
  6194. var e = -1,
  6195. r = Array(t.size);
  6196. return (
  6197. t.forEach(function (t, n) {
  6198. r[++e] = [n, t];
  6199. }),
  6200. r
  6201. );
  6202. }
  6203. function $m(t) {
  6204. var e = -1,
  6205. r = Array(t.size);
  6206. return (
  6207. t.forEach(function (t) {
  6208. r[++e] = t;
  6209. }),
  6210. r
  6211. );
  6212. }
  6213. var ty = mp ? mp.prototype : void 0,
  6214. ey = ty ? ty.valueOf : void 0;
  6215. var ry = Object.prototype.hasOwnProperty;
  6216. var ny = '[object Arguments]',
  6217. iy = '[object Array]',
  6218. oy = '[object Object]',
  6219. sy = Object.prototype.hasOwnProperty;
  6220. function ay(t, e, r, n, i, o) {
  6221. var s = wp(t),
  6222. a = wp(e),
  6223. u = s ? iy : Om(t),
  6224. c = a ? iy : Om(e),
  6225. h = (u = u == ny ? oy : u) == oy,
  6226. l = (c = c == ny ? oy : c) == oy,
  6227. d = u == c;
  6228. if (d && Ev(t)) {
  6229. if (!Ev(e)) return !1;
  6230. (s = !0), (h = !1);
  6231. }
  6232. if (d && !h)
  6233. return (
  6234. o || (o = new rm()),
  6235. s || Iv(t)
  6236. ? qm(t, e, r, n, i, o)
  6237. : (function (t, e, r, n, i, o, s) {
  6238. switch (r) {
  6239. case '[object DataView]':
  6240. if (
  6241. t.byteLength != e.byteLength ||
  6242. t.byteOffset != e.byteOffset
  6243. )
  6244. return !1;
  6245. (t = t.buffer), (e = e.buffer);
  6246. case '[object ArrayBuffer]':
  6247. return !(
  6248. t.byteLength != e.byteLength || !o(new Mm(t), new Mm(e))
  6249. );
  6250. case '[object Boolean]':
  6251. case '[object Date]':
  6252. case '[object Number]':
  6253. return ov(+t, +e);
  6254. case '[object Error]':
  6255. return t.name == e.name && t.message == e.message;
  6256. case '[object RegExp]':
  6257. case '[object String]':
  6258. return t == e + '';
  6259. case '[object Map]':
  6260. var a = Qm;
  6261. case '[object Set]':
  6262. var u = 1 & n;
  6263. if ((a || (a = $m), t.size != e.size && !u)) return !1;
  6264. var c = s.get(t);
  6265. if (c) return c == e;
  6266. (n |= 2), s.set(t, e);
  6267. var h = qm(a(t), a(e), n, i, o, s);
  6268. return s.delete(t), h;
  6269. case '[object Symbol]':
  6270. if (ey) return ey.call(t) == ey.call(e);
  6271. }
  6272. return !1;
  6273. })(t, e, u, r, n, i, o)
  6274. );
  6275. if (!(1 & r)) {
  6276. var f = h && sy.call(t, '__wrapped__'),
  6277. p = l && sy.call(e, '__wrapped__');
  6278. if (f || p) {
  6279. var v = f ? t.value() : t,
  6280. m = p ? e.value() : e;
  6281. return o || (o = new rm()), i(v, m, r, n, o);
  6282. }
  6283. }
  6284. return (
  6285. !!d &&
  6286. (o || (o = new rm()),
  6287. (function (t, e, r, n, i, o) {
  6288. var s = 1 & r,
  6289. a = pm(t),
  6290. u = a.length;
  6291. if (u != pm(e).length && !s) return !1;
  6292. for (var c = u; c--; ) {
  6293. var h = a[c];
  6294. if (!(s ? h in e : ry.call(e, h))) return !1;
  6295. }
  6296. var l = o.get(t),
  6297. d = o.get(e);
  6298. if (l && d) return l == e && d == t;
  6299. var f = !0;
  6300. o.set(t, e), o.set(e, t);
  6301. for (var p = s; ++c < u; ) {
  6302. var v = t[(h = a[c])],
  6303. m = e[h];
  6304. if (n) var y = s ? n(m, v, h, e, t, o) : n(v, m, h, t, e, o);
  6305. if (!(void 0 === y ? v === m || i(v, m, r, n, o) : y)) {
  6306. f = !1;
  6307. break;
  6308. }
  6309. p || (p = 'constructor' == h);
  6310. }
  6311. if (f && !p) {
  6312. var g = t.constructor,
  6313. _ = e.constructor;
  6314. g == _ ||
  6315. !('constructor' in t) ||
  6316. !('constructor' in e) ||
  6317. ('function' == typeof g &&
  6318. g instanceof g &&
  6319. 'function' == typeof _ &&
  6320. _ instanceof _) ||
  6321. (f = !1);
  6322. }
  6323. return o.delete(t), o.delete(e), f;
  6324. })(t, e, r, n, i, o))
  6325. );
  6326. }
  6327. function uy(t, e, r, n, i) {
  6328. return (
  6329. t === e ||
  6330. (null == t || null == e || (!Sp(t) && !Sp(e))
  6331. ? t != t && e != e
  6332. : ay(t, e, r, n, uy, i))
  6333. );
  6334. }
  6335. function cy(t) {
  6336. return Sp(t) && lv(t);
  6337. }
  6338. function hy(t, e, r) {
  6339. for (var n = -1, i = null == t ? 0 : t.length; ++n < i; )
  6340. if (r(e, t[n])) return !0;
  6341. return !1;
  6342. }
  6343. function ly(t, e, r, n) {
  6344. var i = -1,
  6345. o = ev,
  6346. s = !0,
  6347. a = t.length,
  6348. u = [],
  6349. c = e.length;
  6350. if (!a) return u;
  6351. r &&
  6352. (e = (function (t, e) {
  6353. for (var r = -1, n = null == t ? 0 : t.length, i = Array(n); ++r < n; )
  6354. i[r] = e(t[r], r, t);
  6355. return i;
  6356. })(e, wv(r))),
  6357. n
  6358. ? ((o = hy), (s = !1))
  6359. : e.length >= 200 && ((o = Km), (s = !1), (e = new Zm(e)));
  6360. t: for (; ++i < a; ) {
  6361. var h = t[i],
  6362. l = null == r ? h : r(h);
  6363. if (((h = n || 0 !== h ? h : 0), s && l == l)) {
  6364. for (var d = c; d--; ) if (e[d] === l) continue t;
  6365. u.push(h);
  6366. } else o(e, l, n) || u.push(h);
  6367. }
  6368. return u;
  6369. }
  6370. var dy = (function (t, e) {
  6371. return $p(
  6372. (function (t, e, r) {
  6373. return (
  6374. (e = cv(void 0 === e ? t.length - 1 : e, 0)),
  6375. function () {
  6376. for (
  6377. var n = arguments,
  6378. i = -1,
  6379. o = cv(n.length - e, 0),
  6380. s = Array(o);
  6381. ++i < o;
  6382. )
  6383. s[i] = n[e + i];
  6384. i = -1;
  6385. for (var a = Array(e + 1); ++i < e; ) a[i] = n[i];
  6386. return (a[e] = r(s)), Hp(t, this, a);
  6387. }
  6388. );
  6389. })(t, e, Cp),
  6390. t + ''
  6391. );
  6392. })(function (t, e) {
  6393. var r = (function (t) {
  6394. var e = null == t ? 0 : t.length;
  6395. return e ? t[e - 1] : void 0;
  6396. })(e);
  6397. return (
  6398. cy(r) && (r = void 0), cy(t) ? ly(t, tm(e, 1, cy, !0), void 0, r) : []
  6399. );
  6400. }),
  6401. fy = dy;
  6402. function py(t, e) {
  6403. return uy(t, e);
  6404. }
  6405. var vy =
  6406. 'position:fixed;left:0;top:0;pointer-events:none;opacity:0;z-index:-1;',
  6407. my = function (t) {
  6408. if ('suspended' === t.state || 'interrupted' === t.state) {
  6409. var e = document.body,
  6410. r = ['touchstart', 'touchend', 'mouseup', 'click'];
  6411. Ph(r).call(r, function (t) {
  6412. return e.addEventListener(t, n, !1);
  6413. }),
  6414. n();
  6415. }
  6416. function n() {
  6417. t.resume().then(i).catch(null);
  6418. }
  6419. function i() {
  6420. Ph(r).call(r, function (t) {
  6421. return e.removeEventListener(t, n, !1);
  6422. });
  6423. }
  6424. },
  6425. yy = function () {
  6426. var t = null;
  6427. return (
  6428. window.TXLiveAudioContext
  6429. ? (t = window.TXLiveAudioContext)
  6430. : ((t = new (window.AudioContext || window.webkitAudioContext)()),
  6431. (window.TXLiveAudioContext = t)),
  6432. my(t),
  6433. t
  6434. );
  6435. },
  6436. gy = function (t) {
  6437. void 0 === t && (t = {});
  6438. var e = t.parentEl,
  6439. r = void 0 === e ? document.body : e,
  6440. n = t.style,
  6441. i = void 0 === n ? vy : n,
  6442. o = t.crossOrigin,
  6443. s = void 0 === o || o,
  6444. a = t.loop,
  6445. u = void 0 === a || a,
  6446. c = document.createElement('video');
  6447. return (
  6448. (c.autoplay = !0),
  6449. (c.controls = !1),
  6450. (c.preload = 'auto'),
  6451. (c.playsInline = !0),
  6452. c.setAttribute('webkit-playsinline', ''),
  6453. c.setAttribute('x5-playsinline', ''),
  6454. (c.loop = u),
  6455. s && (c.crossOrigin = 'anonymous'),
  6456. c.setAttribute('style', i),
  6457. r.appendChild(c),
  6458. c
  6459. );
  6460. },
  6461. _y = function (t) {
  6462. return t instanceof HTMLVideoElement
  6463. ? { width: t.videoWidth, height: t.videoHeight }
  6464. : t instanceof HTMLImageElement
  6465. ? { width: t.naturalWidth, height: t.naturalHeight }
  6466. : { width: t.width, height: t.height };
  6467. },
  6468. by = '\t\n\v\f\r                 \u2028\u2029\ufeff',
  6469. Ty = J,
  6470. xy = Kn,
  6471. Ey = S(''.replace),
  6472. Sy = '[\t\n\v\f\r                 \u2028\u2029\ufeff]',
  6473. wy = RegExp('^' + Sy + Sy + '*'),
  6474. Ry = RegExp(Sy + Sy + '*$'),
  6475. Cy = function (t) {
  6476. return function (e) {
  6477. var r = xy(Ty(e));
  6478. return 1 & t && (r = Ey(r, wy, '')), 2 & t && (r = Ey(r, Ry, '')), r;
  6479. };
  6480. },
  6481. Py = { start: Cy(1), end: Cy(2), trim: Cy(3) },
  6482. Ay = o,
  6483. Oy = s,
  6484. Iy = S,
  6485. My = Kn,
  6486. Dy = Py.trim,
  6487. Ly = by,
  6488. Fy = Ay.parseInt,
  6489. Ny = Ay.Symbol,
  6490. ky = Ny && Ny.iterator,
  6491. By = /^[+-]?0x/i,
  6492. Gy = Iy(By.exec),
  6493. Uy =
  6494. 8 !== Fy(Ly + '08') ||
  6495. 22 !== Fy(Ly + '0x16') ||
  6496. (ky &&
  6497. !Oy(function () {
  6498. Fy(Object(ky));
  6499. }))
  6500. ? function (t, e) {
  6501. var r = Dy(My(t));
  6502. return Fy(r, e >>> 0 || (Gy(By, r) ? 16 : 10));
  6503. }
  6504. : Fy;
  6505. Ar({ global: !0, forced: parseInt != Uy }, { parseInt: Uy });
  6506. var jy = rt.parseInt,
  6507. Xy = at,
  6508. Vy = Xi,
  6509. Hy = no,
  6510. Wy = nr,
  6511. Yy = S([].concat),
  6512. zy =
  6513. Xy('Reflect', 'ownKeys') ||
  6514. function (t) {
  6515. var e = Vy.f(Wy(t)),
  6516. r = Hy.f;
  6517. return r ? Yy(e, r(t)) : e;
  6518. },
  6519. Zy = qt,
  6520. Jy = zy,
  6521. Ky = A,
  6522. qy = Qe,
  6523. Qy = Error,
  6524. $y = S(''.replace),
  6525. tg = String(Qy('zxcasd').stack),
  6526. eg = /\n\s*at [^:]*:[^\n]*/,
  6527. rg = eg.test(tg),
  6528. ng = et,
  6529. ig = yr,
  6530. og = nu,
  6531. sg = fe('iterator'),
  6532. ag = Array.prototype,
  6533. ug = function (t) {
  6534. return void 0 !== t && (og.Array === t || ag[sg] === t);
  6535. },
  6536. cg = rn,
  6537. hg = Lt,
  6538. lg = Y,
  6539. dg = nu,
  6540. fg = fe('iterator'),
  6541. pg = function (t) {
  6542. if (!lg(t)) return hg(t, fg) || hg(t, '@@iterator') || dg[cg(t)];
  6543. },
  6544. vg = D,
  6545. mg = It,
  6546. yg = nr,
  6547. gg = Ct,
  6548. _g = pg,
  6549. bg = TypeError,
  6550. Tg = function (t, e) {
  6551. var r = arguments.length < 2 ? _g(t) : e;
  6552. if (mg(r)) return yg(vg(r, t));
  6553. throw bg(gg(t) + ' is not iterable');
  6554. },
  6555. xg = D,
  6556. Eg = nr,
  6557. Sg = Lt,
  6558. wg = function (t, e, r) {
  6559. var n, i;
  6560. Eg(t);
  6561. try {
  6562. if (!(n = Sg(t, 'return'))) {
  6563. if ('throw' === e) throw r;
  6564. return r;
  6565. }
  6566. n = xg(n, t);
  6567. } catch (t) {
  6568. (i = !0), (n = t);
  6569. }
  6570. if ('throw' === e) throw r;
  6571. if (i) throw n;
  6572. return Eg(n), r;
  6573. },
  6574. Rg = qe,
  6575. Cg = D,
  6576. Pg = nr,
  6577. Ag = Ct,
  6578. Og = ug,
  6579. Ig = jr,
  6580. Mg = ut,
  6581. Dg = Tg,
  6582. Lg = pg,
  6583. Fg = wg,
  6584. Ng = TypeError,
  6585. kg = function (t, e) {
  6586. (this.stopped = t), (this.result = e);
  6587. },
  6588. Bg = kg.prototype,
  6589. Gg = function (t, e, r) {
  6590. var n,
  6591. i,
  6592. o,
  6593. s,
  6594. a,
  6595. u,
  6596. c,
  6597. h = r && r.that,
  6598. l = !(!r || !r.AS_ENTRIES),
  6599. d = !(!r || !r.IS_RECORD),
  6600. f = !(!r || !r.IS_ITERATOR),
  6601. p = !(!r || !r.INTERRUPTED),
  6602. v = Rg(e, h),
  6603. m = function (t) {
  6604. return n && Fg(n, 'normal', t), new kg(!0, t);
  6605. },
  6606. y = function (t) {
  6607. return l
  6608. ? (Pg(t), p ? v(t[0], t[1], m) : v(t[0], t[1]))
  6609. : p
  6610. ? v(t, m)
  6611. : v(t);
  6612. };
  6613. if (d) n = t.iterator;
  6614. else if (f) n = t;
  6615. else {
  6616. if (!(i = Lg(t))) throw Ng(Ag(t) + ' is not iterable');
  6617. if (Og(i)) {
  6618. for (o = 0, s = Ig(t); s > o; o++)
  6619. if ((a = y(t[o])) && Mg(Bg, a)) return a;
  6620. return new kg(!1);
  6621. }
  6622. n = Dg(t, i);
  6623. }
  6624. for (u = d ? t.next : n.next; !(c = Cg(u, n)).done; ) {
  6625. try {
  6626. a = y(c.value);
  6627. } catch (t) {
  6628. Fg(n, 'throw', t);
  6629. }
  6630. if ('object' == typeof a && a && Mg(Bg, a)) return a;
  6631. }
  6632. return new kg(!1);
  6633. },
  6634. Ug = Kn,
  6635. jg = U,
  6636. Xg = !s(function () {
  6637. var t = Error('a');
  6638. return (
  6639. !('stack' in t) ||
  6640. (Object.defineProperty(t, 'stack', jg(1, 7)), 7 !== t.stack)
  6641. );
  6642. }),
  6643. Vg = Ar,
  6644. Hg = ut,
  6645. Wg = gu,
  6646. Yg = Xu,
  6647. zg = function (t, e, r) {
  6648. for (var n = Jy(e), i = qy.f, o = Ky.f, s = 0; s < n.length; s++) {
  6649. var a = n[s];
  6650. Zy(t, a) || (r && Zy(r, a)) || i(t, a, o(e, a));
  6651. }
  6652. },
  6653. Zg = ji,
  6654. Jg = yr,
  6655. Kg = U,
  6656. qg = function (t, e) {
  6657. if (rg && 'string' == typeof t && !Qy.prepareStackTrace)
  6658. for (; e--; ) t = $y(t, eg, '');
  6659. return t;
  6660. },
  6661. Qg = function (t, e) {
  6662. ng(e) && 'cause' in e && ig(t, 'cause', e.cause);
  6663. },
  6664. $g = Gg,
  6665. t_ = function (t, e) {
  6666. return void 0 === t ? (arguments.length < 2 ? '' : e) : Ug(t);
  6667. },
  6668. e_ = Xg,
  6669. r_ = fe('toStringTag'),
  6670. n_ = Error,
  6671. i_ = [].push,
  6672. o_ = function (t, e) {
  6673. var r,
  6674. n = arguments.length > 2 ? arguments[2] : void 0,
  6675. i = Hg(s_, this);
  6676. Yg
  6677. ? (r = Yg(n_(), i ? Wg(this) : s_))
  6678. : ((r = i ? this : Zg(s_)), Jg(r, r_, 'Error')),
  6679. void 0 !== e && Jg(r, 'message', t_(e)),
  6680. e_ && Jg(r, 'stack', qg(r.stack, 1)),
  6681. Qg(r, n);
  6682. var o = [];
  6683. return $g(t, i_, { that: o }), Jg(r, 'errors', o), r;
  6684. };
  6685. Yg ? Yg(o_, n_) : zg(o_, n_, { name: !0 });
  6686. var s_ = (o_.prototype = Zg(n_.prototype, {
  6687. constructor: Kg(1, o_),
  6688. message: Kg(1, ''),
  6689. name: Kg(1, 'AggregateError'),
  6690. }));
  6691. Vg({ global: !0, constructor: !0, arity: 2 }, { AggregateError: o_ });
  6692. var a_,
  6693. u_,
  6694. c_,
  6695. h_,
  6696. l_ = 'process' == T(o.process),
  6697. d_ = at,
  6698. f_ = Qe,
  6699. p_ = O,
  6700. v_ = fe('species'),
  6701. m_ = ut,
  6702. y_ = TypeError,
  6703. g_ = function (t, e) {
  6704. if (m_(e, t)) return t;
  6705. throw y_('Incorrect invocation');
  6706. },
  6707. __ = Tn,
  6708. b_ = Ct,
  6709. T_ = TypeError,
  6710. x_ = nr,
  6711. E_ = function (t) {
  6712. if (__(t)) return t;
  6713. throw T_(b_(t) + ' is not a constructor');
  6714. },
  6715. S_ = Y,
  6716. w_ = fe('species'),
  6717. R_ = function (t, e) {
  6718. var r,
  6719. n = x_(t).constructor;
  6720. return void 0 === n || S_((r = x_(n)[w_])) ? e : E_(r);
  6721. },
  6722. C_ = /(?:ipad|iphone|ipod).*applewebkit/i.test(ct),
  6723. P_ = o,
  6724. A_ = d,
  6725. O_ = qe,
  6726. I_ = P,
  6727. M_ = qt,
  6728. D_ = s,
  6729. L_ = wi,
  6730. F_ = xa,
  6731. N_ = Ce,
  6732. k_ = ql,
  6733. B_ = C_,
  6734. G_ = l_,
  6735. U_ = P_.setImmediate,
  6736. j_ = P_.clearImmediate,
  6737. X_ = P_.process,
  6738. V_ = P_.Dispatch,
  6739. H_ = P_.Function,
  6740. W_ = P_.MessageChannel,
  6741. Y_ = P_.String,
  6742. z_ = 0,
  6743. Z_ = {},
  6744. J_ = 'onreadystatechange';
  6745. try {
  6746. a_ = P_.location;
  6747. } catch (t) {}
  6748. var K_ = function (t) {
  6749. if (M_(Z_, t)) {
  6750. var e = Z_[t];
  6751. delete Z_[t], e();
  6752. }
  6753. },
  6754. q_ = function (t) {
  6755. return function () {
  6756. K_(t);
  6757. };
  6758. },
  6759. Q_ = function (t) {
  6760. K_(t.data);
  6761. },
  6762. $_ = function (t) {
  6763. P_.postMessage(Y_(t), a_.protocol + '//' + a_.host);
  6764. };
  6765. (U_ && j_) ||
  6766. ((U_ = function (t) {
  6767. k_(arguments.length, 1);
  6768. var e = I_(t) ? t : H_(t),
  6769. r = F_(arguments, 1);
  6770. return (
  6771. (Z_[++z_] = function () {
  6772. A_(e, void 0, r);
  6773. }),
  6774. u_(z_),
  6775. z_
  6776. );
  6777. }),
  6778. (j_ = function (t) {
  6779. delete Z_[t];
  6780. }),
  6781. G_
  6782. ? (u_ = function (t) {
  6783. X_.nextTick(q_(t));
  6784. })
  6785. : V_ && V_.now
  6786. ? (u_ = function (t) {
  6787. V_.now(q_(t));
  6788. })
  6789. : W_ && !B_
  6790. ? ((h_ = (c_ = new W_()).port2),
  6791. (c_.port1.onmessage = Q_),
  6792. (u_ = O_(h_.postMessage, h_)))
  6793. : P_.addEventListener &&
  6794. I_(P_.postMessage) &&
  6795. !P_.importScripts &&
  6796. a_ &&
  6797. 'file:' !== a_.protocol &&
  6798. !D_($_)
  6799. ? ((u_ = $_), P_.addEventListener('message', Q_, !1))
  6800. : (u_ =
  6801. J_ in N_('script')
  6802. ? function (t) {
  6803. L_.appendChild(N_('script')).onreadystatechange = function () {
  6804. L_.removeChild(this), K_(t);
  6805. };
  6806. }
  6807. : function (t) {
  6808. setTimeout(q_(t), 0);
  6809. }));
  6810. var tb,
  6811. eb,
  6812. rb,
  6813. nb,
  6814. ib,
  6815. ob,
  6816. sb,
  6817. ab,
  6818. ub = { set: U_, clear: j_ },
  6819. cb = o,
  6820. hb = /ipad|iphone|ipod/i.test(ct) && void 0 !== cb.Pebble,
  6821. lb = /web0s(?!.*chrome)/i.test(ct),
  6822. db = o,
  6823. fb = qe,
  6824. pb = A.f,
  6825. vb = ub.set,
  6826. mb = C_,
  6827. yb = hb,
  6828. gb = lb,
  6829. _b = l_,
  6830. bb = db.MutationObserver || db.WebKitMutationObserver,
  6831. Tb = db.document,
  6832. xb = db.process,
  6833. Eb = db.Promise,
  6834. Sb = pb(db, 'queueMicrotask'),
  6835. wb = Sb && Sb.value;
  6836. wb ||
  6837. ((tb = function () {
  6838. var t, e;
  6839. for (_b && (t = xb.domain) && t.exit(); eb; ) {
  6840. (e = eb.fn), (eb = eb.next);
  6841. try {
  6842. e();
  6843. } catch (t) {
  6844. throw (eb ? nb() : (rb = void 0), t);
  6845. }
  6846. }
  6847. (rb = void 0), t && t.enter();
  6848. }),
  6849. mb || _b || gb || !bb || !Tb
  6850. ? !yb && Eb && Eb.resolve
  6851. ? (((sb = Eb.resolve(void 0)).constructor = Eb),
  6852. (ab = fb(sb.then, sb)),
  6853. (nb = function () {
  6854. ab(tb);
  6855. }))
  6856. : _b
  6857. ? (nb = function () {
  6858. xb.nextTick(tb);
  6859. })
  6860. : ((vb = fb(vb, db)),
  6861. (nb = function () {
  6862. vb(tb);
  6863. }))
  6864. : ((ib = !0),
  6865. (ob = Tb.createTextNode('')),
  6866. new bb(tb).observe(ob, { characterData: !0 }),
  6867. (nb = function () {
  6868. ob.data = ib = !ib;
  6869. })));
  6870. var Rb =
  6871. wb ||
  6872. function (t) {
  6873. var e = { fn: t, next: void 0 };
  6874. rb && (rb.next = e), eb || ((eb = e), nb()), (rb = e);
  6875. },
  6876. Cb = o,
  6877. Pb = function (t) {
  6878. try {
  6879. return { error: !1, value: t() };
  6880. } catch (t) {
  6881. return { error: !0, value: t };
  6882. }
  6883. },
  6884. Ab = function () {
  6885. (this.head = null), (this.tail = null);
  6886. };
  6887. Ab.prototype = {
  6888. add: function (t) {
  6889. var e = { item: t, next: null };
  6890. this.head ? (this.tail.next = e) : (this.head = e), (this.tail = e);
  6891. },
  6892. get: function () {
  6893. var t = this.head;
  6894. if (t)
  6895. return (
  6896. (this.head = t.next), this.tail === t && (this.tail = null), t.item
  6897. );
  6898. },
  6899. };
  6900. var Ob = Ab,
  6901. Ib = o.Promise,
  6902. Mb = 'object' == typeof Deno && Deno && 'object' == typeof Deno.version,
  6903. Db = !Mb && !l_ && 'object' == typeof window && 'object' == typeof document,
  6904. Lb = o,
  6905. Fb = Ib,
  6906. Nb = P,
  6907. kb = ze,
  6908. Bb = an,
  6909. Gb = fe,
  6910. Ub = Db,
  6911. jb = Mb,
  6912. Xb = mt,
  6913. Vb = Fb && Fb.prototype,
  6914. Hb = Gb('species'),
  6915. Wb = !1,
  6916. Yb = Nb(Lb.PromiseRejectionEvent),
  6917. zb = kb('Promise', function () {
  6918. var t = Bb(Fb),
  6919. e = t !== String(Fb);
  6920. if (!e && 66 === Xb) return !0;
  6921. if (!Vb.catch || !Vb.finally) return !0;
  6922. if (!Xb || Xb < 51 || !/native code/.test(t)) {
  6923. var r = new Fb(function (t) {
  6924. t(1);
  6925. }),
  6926. n = function (t) {
  6927. t(
  6928. function () {},
  6929. function () {}
  6930. );
  6931. };
  6932. if (
  6933. (((r.constructor = {})[Hb] = n),
  6934. !(Wb = r.then(function () {}) instanceof n))
  6935. )
  6936. return !0;
  6937. }
  6938. return !e && (Ub || jb) && !Yb;
  6939. }),
  6940. Zb = { CONSTRUCTOR: zb, REJECTION_EVENT: Yb, SUBCLASSING: Wb },
  6941. Jb = {},
  6942. Kb = It,
  6943. qb = TypeError,
  6944. Qb = function (t) {
  6945. var e, r;
  6946. (this.promise = new t(function (t, n) {
  6947. if (void 0 !== e || void 0 !== r) throw qb('Bad Promise constructor');
  6948. (e = t), (r = n);
  6949. })),
  6950. (this.resolve = Kb(e)),
  6951. (this.reject = Kb(r));
  6952. };
  6953. Jb.f = function (t) {
  6954. return new Qb(t);
  6955. };
  6956. var $b,
  6957. tT,
  6958. eT = Ar,
  6959. rT = l_,
  6960. nT = o,
  6961. iT = D,
  6962. oT = oo,
  6963. sT = Oo,
  6964. aT = function (t) {
  6965. var e = d_(t),
  6966. r = f_.f;
  6967. p_ &&
  6968. e &&
  6969. !e[v_] &&
  6970. r(e, v_, {
  6971. configurable: !0,
  6972. get: function () {
  6973. return this;
  6974. },
  6975. });
  6976. },
  6977. uT = It,
  6978. cT = P,
  6979. hT = et,
  6980. lT = g_,
  6981. dT = R_,
  6982. fT = ub.set,
  6983. pT = Rb,
  6984. vT = function (t, e) {
  6985. var r = Cb.console;
  6986. r && r.error && (1 == arguments.length ? r.error(t) : r.error(t, e));
  6987. },
  6988. mT = Pb,
  6989. yT = Ob,
  6990. gT = Yo,
  6991. _T = Ib,
  6992. bT = Zb,
  6993. TT = Jb,
  6994. xT = 'Promise',
  6995. ET = bT.CONSTRUCTOR,
  6996. ST = bT.REJECTION_EVENT,
  6997. wT = gT.getterFor(xT),
  6998. RT = gT.set,
  6999. CT = _T && _T.prototype,
  7000. PT = _T,
  7001. AT = CT,
  7002. OT = nT.TypeError,
  7003. IT = nT.document,
  7004. MT = nT.process,
  7005. DT = TT.f,
  7006. LT = DT,
  7007. FT = !!(IT && IT.createEvent && nT.dispatchEvent),
  7008. NT = 'unhandledrejection',
  7009. kT = function (t) {
  7010. var e;
  7011. return !(!hT(t) || !cT((e = t.then))) && e;
  7012. },
  7013. BT = function (t, e) {
  7014. var r,
  7015. n,
  7016. i,
  7017. o = e.value,
  7018. s = 1 == e.state,
  7019. a = s ? t.ok : t.fail,
  7020. u = t.resolve,
  7021. c = t.reject,
  7022. h = t.domain;
  7023. try {
  7024. a
  7025. ? (s || (2 === e.rejection && VT(e), (e.rejection = 1)),
  7026. !0 === a
  7027. ? (r = o)
  7028. : (h && h.enter(), (r = a(o)), h && (h.exit(), (i = !0))),
  7029. r === t.promise
  7030. ? c(OT('Promise-chain cycle'))
  7031. : (n = kT(r))
  7032. ? iT(n, r, u, c)
  7033. : u(r))
  7034. : c(o);
  7035. } catch (t) {
  7036. h && !i && h.exit(), c(t);
  7037. }
  7038. },
  7039. GT = function (t, e) {
  7040. t.notified ||
  7041. ((t.notified = !0),
  7042. pT(function () {
  7043. for (var r, n = t.reactions; (r = n.get()); ) BT(r, t);
  7044. (t.notified = !1), e && !t.rejection && jT(t);
  7045. }));
  7046. },
  7047. UT = function (t, e, r) {
  7048. var n, i;
  7049. FT
  7050. ? (((n = IT.createEvent('Event')).promise = e),
  7051. (n.reason = r),
  7052. n.initEvent(t, !1, !0),
  7053. nT.dispatchEvent(n))
  7054. : (n = { promise: e, reason: r }),
  7055. !ST && (i = nT['on' + t])
  7056. ? i(n)
  7057. : t === NT && vT('Unhandled promise rejection', r);
  7058. },
  7059. jT = function (t) {
  7060. iT(fT, nT, function () {
  7061. var e,
  7062. r = t.facade,
  7063. n = t.value;
  7064. if (
  7065. XT(t) &&
  7066. ((e = mT(function () {
  7067. rT ? MT.emit('unhandledRejection', n, r) : UT(NT, r, n);
  7068. })),
  7069. (t.rejection = rT || XT(t) ? 2 : 1),
  7070. e.error)
  7071. )
  7072. throw e.value;
  7073. });
  7074. },
  7075. XT = function (t) {
  7076. return 1 !== t.rejection && !t.parent;
  7077. },
  7078. VT = function (t) {
  7079. iT(fT, nT, function () {
  7080. var e = t.facade;
  7081. rT
  7082. ? MT.emit('rejectionHandled', e)
  7083. : UT('rejectionhandled', e, t.value);
  7084. });
  7085. },
  7086. HT = function (t, e, r) {
  7087. return function (n) {
  7088. t(e, n, r);
  7089. };
  7090. },
  7091. WT = function (t, e, r) {
  7092. t.done ||
  7093. ((t.done = !0), r && (t = r), (t.value = e), (t.state = 2), GT(t, !0));
  7094. },
  7095. YT = function (t, e, r) {
  7096. if (!t.done) {
  7097. (t.done = !0), r && (t = r);
  7098. try {
  7099. if (t.facade === e) throw OT("Promise can't be resolved itself");
  7100. var n = kT(e);
  7101. n
  7102. ? pT(function () {
  7103. var r = { done: !1 };
  7104. try {
  7105. iT(n, e, HT(YT, r, t), HT(WT, r, t));
  7106. } catch (e) {
  7107. WT(r, e, t);
  7108. }
  7109. })
  7110. : ((t.value = e), (t.state = 1), GT(t, !1));
  7111. } catch (e) {
  7112. WT({ done: !1 }, e, t);
  7113. }
  7114. }
  7115. };
  7116. ET &&
  7117. ((AT = (PT = function (t) {
  7118. lT(this, AT), uT(t), iT($b, this);
  7119. var e = wT(this);
  7120. try {
  7121. t(HT(YT, e), HT(WT, e));
  7122. } catch (t) {
  7123. WT(e, t);
  7124. }
  7125. }).prototype),
  7126. (($b = function (t) {
  7127. RT(this, {
  7128. type: xT,
  7129. done: !1,
  7130. notified: !1,
  7131. parent: !1,
  7132. reactions: new yT(),
  7133. rejection: !1,
  7134. state: 0,
  7135. value: void 0,
  7136. });
  7137. }).prototype = oT(AT, 'then', function (t, e) {
  7138. var r = wT(this),
  7139. n = DT(dT(this, PT));
  7140. return (
  7141. (r.parent = !0),
  7142. (n.ok = !cT(t) || t),
  7143. (n.fail = cT(e) && e),
  7144. (n.domain = rT ? MT.domain : void 0),
  7145. 0 == r.state
  7146. ? r.reactions.add(n)
  7147. : pT(function () {
  7148. BT(n, r);
  7149. }),
  7150. n.promise
  7151. );
  7152. })),
  7153. (tT = function () {
  7154. var t = new $b(),
  7155. e = wT(t);
  7156. (this.promise = t), (this.resolve = HT(YT, e)), (this.reject = HT(WT, e));
  7157. }),
  7158. (TT.f = DT =
  7159. function (t) {
  7160. return t === PT || undefined === t ? new tT(t) : LT(t);
  7161. })),
  7162. eT({ global: !0, constructor: !0, wrap: !0, forced: ET }, { Promise: PT }),
  7163. sT(PT, xT, !1, !0),
  7164. aT(xT);
  7165. var zT = fe('iterator'),
  7166. ZT = !1;
  7167. try {
  7168. var JT = 0,
  7169. KT = {
  7170. next: function () {
  7171. return { done: !!JT++ };
  7172. },
  7173. return: function () {
  7174. ZT = !0;
  7175. },
  7176. };
  7177. (KT[zT] = function () {
  7178. return this;
  7179. }),
  7180. Array.from(KT, function () {
  7181. throw 2;
  7182. });
  7183. } catch (t) {}
  7184. var qT = Ib,
  7185. QT = function (t, e) {
  7186. if (!e && !ZT) return !1;
  7187. var r = !1;
  7188. try {
  7189. var n = {};
  7190. (n[zT] = function () {
  7191. return {
  7192. next: function () {
  7193. return { done: (r = !0) };
  7194. },
  7195. };
  7196. }),
  7197. t(n);
  7198. } catch (t) {}
  7199. return r;
  7200. },
  7201. $T =
  7202. Zb.CONSTRUCTOR ||
  7203. !QT(function (t) {
  7204. qT.all(t).then(void 0, function () {});
  7205. }),
  7206. tx = D,
  7207. ex = It,
  7208. rx = Jb,
  7209. nx = Pb,
  7210. ix = Gg;
  7211. Ar(
  7212. { target: 'Promise', stat: !0, forced: $T },
  7213. {
  7214. all: function (t) {
  7215. var e = this,
  7216. r = rx.f(e),
  7217. n = r.resolve,
  7218. i = r.reject,
  7219. o = nx(function () {
  7220. var r = ex(e.resolve),
  7221. o = [],
  7222. s = 0,
  7223. a = 1;
  7224. ix(t, function (t) {
  7225. var u = s++,
  7226. c = !1;
  7227. a++,
  7228. tx(r, e, t).then(function (t) {
  7229. c || ((c = !0), (o[u] = t), --a || n(o));
  7230. }, i);
  7231. }),
  7232. --a || n(o);
  7233. });
  7234. return o.error && i(o.value), r.promise;
  7235. },
  7236. }
  7237. );
  7238. var ox = Ar,
  7239. sx = Zb.CONSTRUCTOR;
  7240. Ib && Ib.prototype,
  7241. ox(
  7242. { target: 'Promise', proto: !0, forced: sx, real: !0 },
  7243. {
  7244. catch: function (t) {
  7245. return this.then(void 0, t);
  7246. },
  7247. }
  7248. );
  7249. var ax = D,
  7250. ux = It,
  7251. cx = Jb,
  7252. hx = Pb,
  7253. lx = Gg;
  7254. Ar(
  7255. { target: 'Promise', stat: !0, forced: $T },
  7256. {
  7257. race: function (t) {
  7258. var e = this,
  7259. r = cx.f(e),
  7260. n = r.reject,
  7261. i = hx(function () {
  7262. var i = ux(e.resolve);
  7263. lx(t, function (t) {
  7264. ax(i, e, t).then(r.resolve, n);
  7265. });
  7266. });
  7267. return i.error && n(i.value), r.promise;
  7268. },
  7269. }
  7270. );
  7271. var dx = D,
  7272. fx = Jb;
  7273. Ar(
  7274. { target: 'Promise', stat: !0, forced: Zb.CONSTRUCTOR },
  7275. {
  7276. reject: function (t) {
  7277. var e = fx.f(this);
  7278. return dx(e.reject, void 0, t), e.promise;
  7279. },
  7280. }
  7281. );
  7282. var px = nr,
  7283. vx = et,
  7284. mx = Jb,
  7285. yx = function (t, e) {
  7286. if ((px(t), vx(e) && e.constructor === t)) return e;
  7287. var r = mx.f(t);
  7288. return (0, r.resolve)(e), r.promise;
  7289. },
  7290. gx = Ar,
  7291. _x = Ib,
  7292. bx = Zb.CONSTRUCTOR,
  7293. Tx = yx,
  7294. xx = at('Promise'),
  7295. Ex = !bx;
  7296. gx(
  7297. { target: 'Promise', stat: !0, forced: true },
  7298. {
  7299. resolve: function (t) {
  7300. return Tx(Ex && this === xx ? _x : this, t);
  7301. },
  7302. }
  7303. );
  7304. var Sx = D,
  7305. wx = It,
  7306. Rx = Jb,
  7307. Cx = Pb,
  7308. Px = Gg;
  7309. Ar(
  7310. { target: 'Promise', stat: !0 },
  7311. {
  7312. allSettled: function (t) {
  7313. var e = this,
  7314. r = Rx.f(e),
  7315. n = r.resolve,
  7316. i = r.reject,
  7317. o = Cx(function () {
  7318. var r = wx(e.resolve),
  7319. i = [],
  7320. o = 0,
  7321. s = 1;
  7322. Px(t, function (t) {
  7323. var a = o++,
  7324. u = !1;
  7325. s++,
  7326. Sx(r, e, t).then(
  7327. function (t) {
  7328. u ||
  7329. ((u = !0),
  7330. (i[a] = { status: 'fulfilled', value: t }),
  7331. --s || n(i));
  7332. },
  7333. function (t) {
  7334. u ||
  7335. ((u = !0),
  7336. (i[a] = { status: 'rejected', reason: t }),
  7337. --s || n(i));
  7338. }
  7339. );
  7340. }),
  7341. --s || n(i);
  7342. });
  7343. return o.error && i(o.value), r.promise;
  7344. },
  7345. }
  7346. );
  7347. var Ax = D,
  7348. Ox = It,
  7349. Ix = at,
  7350. Mx = Jb,
  7351. Dx = Pb,
  7352. Lx = Gg,
  7353. Fx = 'No one promise resolved';
  7354. Ar(
  7355. { target: 'Promise', stat: !0 },
  7356. {
  7357. any: function (t) {
  7358. var e = this,
  7359. r = Ix('AggregateError'),
  7360. n = Mx.f(e),
  7361. i = n.resolve,
  7362. o = n.reject,
  7363. s = Dx(function () {
  7364. var n = Ox(e.resolve),
  7365. s = [],
  7366. a = 0,
  7367. u = 1,
  7368. c = !1;
  7369. Lx(t, function (t) {
  7370. var h = a++,
  7371. l = !1;
  7372. u++,
  7373. Ax(n, e, t).then(
  7374. function (t) {
  7375. l || c || ((c = !0), i(t));
  7376. },
  7377. function (t) {
  7378. l || c || ((l = !0), (s[h] = t), --u || o(new r(s, Fx)));
  7379. }
  7380. );
  7381. }),
  7382. --u || o(new r(s, Fx));
  7383. });
  7384. return s.error && o(s.value), n.promise;
  7385. },
  7386. }
  7387. );
  7388. var Nx = Ar,
  7389. kx = Ib,
  7390. Bx = s,
  7391. Gx = at,
  7392. Ux = P,
  7393. jx = R_,
  7394. Xx = yx,
  7395. Vx = kx && kx.prototype;
  7396. Nx(
  7397. {
  7398. target: 'Promise',
  7399. proto: !0,
  7400. real: !0,
  7401. forced:
  7402. !!kx &&
  7403. Bx(function () {
  7404. Vx.finally.call({ then: function () {} }, function () {});
  7405. }),
  7406. },
  7407. {
  7408. finally: function (t) {
  7409. var e = jx(this, Gx('Promise')),
  7410. r = Ux(t);
  7411. return this.then(
  7412. r
  7413. ? function (r) {
  7414. return Xx(e, t()).then(function () {
  7415. return r;
  7416. });
  7417. }
  7418. : t,
  7419. r
  7420. ? function (r) {
  7421. return Xx(e, t()).then(function () {
  7422. throw r;
  7423. });
  7424. }
  7425. : t
  7426. );
  7427. },
  7428. }
  7429. );
  7430. var Hx = rt.Promise,
  7431. Wx = Jb,
  7432. Yx = Pb;
  7433. Ar(
  7434. { target: 'Promise', stat: !0, forced: !0 },
  7435. {
  7436. try: function (t) {
  7437. var e = Wx.f(this),
  7438. r = Yx(t);
  7439. return (r.error ? e.reject : e.resolve)(r.value), e.promise;
  7440. },
  7441. }
  7442. );
  7443. var zx = Hx,
  7444. Zx = /Version\/(\d+)\.(\d+)/i,
  7445. Jx = /OS (\d+)_(\d+)_?(\d+)?/i;
  7446. /firefox\/(\d+)\./i.test(navigator.userAgent);
  7447. var Kx =
  7448. /safari\/(\d+)\./i.test(navigator.userAgent) &&
  7449. !/chrome\/(\d+)\./i.test(navigator.userAgent),
  7450. qx = /iPhone|iPad|iOS/i.test(navigator.userAgent),
  7451. Qx = (function () {
  7452. var t = navigator.userAgent.match(Zx);
  7453. return t ? [jy(t[1], 10), jy(t[2], 10)] : [];
  7454. })(),
  7455. $x =
  7456. (Kx && 15 === Qx[0]) ||
  7457. (qx &&
  7458. 15 ===
  7459. (function () {
  7460. var t = navigator.userAgent.match(Jx);
  7461. return t ? jy(t[1], 10) : null;
  7462. })()),
  7463. tE = Kx && 16 === Qx[0] && Qx[1] < 4,
  7464. eE = function () {
  7465. var t, e;
  7466. return !(
  7467. !(null === (t = navigator.mediaDevices) || void 0 === t
  7468. ? void 0
  7469. : t.enumerateDevices) ||
  7470. !(null === (e = navigator.mediaDevices) || void 0 === e
  7471. ? void 0
  7472. : e.getUserMedia)
  7473. );
  7474. },
  7475. rE = function () {
  7476. var t;
  7477. return !!(null === (t = navigator.mediaDevices) || void 0 === t
  7478. ? void 0
  7479. : t.getDisplayMedia);
  7480. },
  7481. nE = rt,
  7482. iE = d;
  7483. nE.JSON || (nE.JSON = { stringify: JSON.stringify });
  7484. var oE = function (t, e, r) {
  7485. return iE(nE.JSON.stringify, null, arguments);
  7486. },
  7487. sE = oE,
  7488. aE = function (t, e) {
  7489. return fetch(t, {
  7490. body: sE(e),
  7491. cache: 'no-cache',
  7492. credentials: 'same-origin',
  7493. headers: { 'content-type': 'application/json' },
  7494. method: 'POST',
  7495. mode: 'cors',
  7496. }).then(function (t) {
  7497. if (200 !== t.status) throw new Error('status Code:'.concat(t.status));
  7498. return t.json();
  7499. });
  7500. },
  7501. uE = Ar,
  7502. cE = S,
  7503. hE = Gr,
  7504. lE = Kn,
  7505. dE = Ll,
  7506. fE = J,
  7507. pE = Nl,
  7508. vE = cE(''.endsWith),
  7509. mE = cE(''.slice),
  7510. yE = Math.min;
  7511. uE(
  7512. { target: 'String', proto: !0, forced: !pE('endsWith') },
  7513. {
  7514. endsWith: function (t) {
  7515. var e = lE(fE(this));
  7516. dE(t);
  7517. var r = arguments.length > 1 ? arguments[1] : void 0,
  7518. n = e.length,
  7519. i = void 0 === r ? n : yE(hE(r), n),
  7520. o = lE(t);
  7521. return vE ? vE(e, o, i) : mE(e, i - o.length, i) === o;
  7522. },
  7523. }
  7524. );
  7525. var gE = sh('String').endsWith,
  7526. _E = ut,
  7527. bE = gE,
  7528. TE = String.prototype,
  7529. xE = function (t) {
  7530. var e = t.endsWith;
  7531. return 'string' == typeof t ||
  7532. t === TE ||
  7533. (_E(TE, t) && e === TE.endsWith)
  7534. ? bE
  7535. : e;
  7536. },
  7537. EE = ts.every;
  7538. Ar(
  7539. { target: 'Array', proto: !0, forced: !gh('every') },
  7540. {
  7541. every: function (t) {
  7542. return EE(this, t, arguments.length > 1 ? arguments[1] : void 0);
  7543. },
  7544. }
  7545. );
  7546. var SE = sh('Array').every,
  7547. wE = ut,
  7548. RE = SE,
  7549. CE = Array.prototype,
  7550. PE = function (t) {
  7551. var e = t.every;
  7552. return t === CE || (wE(CE, t) && e === CE.every) ? RE : e;
  7553. },
  7554. AE = Yf('stream:device'),
  7555. OE = (function () {
  7556. function t() {
  7557. this.mediaStream = null;
  7558. }
  7559. return (
  7560. (t.prototype.start = function (t) {
  7561. var e = t.video,
  7562. r = t.audio;
  7563. return Ed(this, void 0, void 0, function () {
  7564. var t, n, i, o, s, a, u, c, h, l, d, f, p;
  7565. return Sd(this, function (v) {
  7566. switch (v.label) {
  7567. case 0:
  7568. if (this.mediaStream)
  7569. return AE('stream is existed'), [2, this.mediaStream];
  7570. (t = {}),
  7571. e &&
  7572. ((s = e.deviceId),
  7573. (n = e.frameRate),
  7574. (i = e.resolution),
  7575. (o = {
  7576. frameRate: { ideal: n },
  7577. width: { ideal: i.width },
  7578. height: { ideal: i.height },
  7579. }),
  7580. s &&
  7581. (Jl(dp).call(dp, s)
  7582. ? (o.facingMode = { exact: s })
  7583. : (o.deviceId = { exact: s })),
  7584. (t.video = o)),
  7585. r &&
  7586. ((s = r.deviceId),
  7587. (a = r.sampleRate),
  7588. (u = r.echoCancellation),
  7589. (c = r.noiseSuppression),
  7590. (h = r.autoGainControl),
  7591. (l = {
  7592. sampleRate: a,
  7593. echoCancellation: u,
  7594. noiseSuppression: c,
  7595. autoGainControl: h,
  7596. }),
  7597. s && (l.deviceId = { exact: s }),
  7598. (t.audio = l)),
  7599. (v.label = 1);
  7600. case 1:
  7601. return (
  7602. v.trys.push([1, 3, , 4]),
  7603. (d = this),
  7604. [4, navigator.mediaDevices.getUserMedia(t)]
  7605. );
  7606. case 2:
  7607. return (d.mediaStream = v.sent()), [2, this.mediaStream];
  7608. case 3:
  7609. switch (
  7610. ((f = v.sent()),
  7611. AE('start error, '.concat(f.toString())),
  7612. (p = ''),
  7613. f.name)
  7614. ) {
  7615. case 'NotFoundError':
  7616. case 'DevicesNotFoundError':
  7617. p = 'NotFoundError';
  7618. break;
  7619. case 'NotAllowedError':
  7620. case 'PermissionDeniedError':
  7621. p = 'NotAllowedError';
  7622. break;
  7623. default:
  7624. p = f.name;
  7625. }
  7626. throw (f.name !== p && (f.name = p), f);
  7627. case 4:
  7628. return [2];
  7629. }
  7630. });
  7631. });
  7632. }),
  7633. (t.prototype.stop = function () {
  7634. var t, e;
  7635. null === (e = this.mediaStream) ||
  7636. void 0 === e ||
  7637. Ph((t = e.getTracks())).call(t, function (t) {
  7638. 'ended' !== t.readyState && t.stop();
  7639. }),
  7640. (this.mediaStream = null);
  7641. }),
  7642. (t.prototype.getResolution = function () {
  7643. if (!this.mediaStream) return null;
  7644. var t = this.mediaStream.getVideoTracks();
  7645. if (0 === t.length) return null;
  7646. var e = t[0].getSettings();
  7647. return { width: e.width, height: e.height };
  7648. }),
  7649. t
  7650. );
  7651. })(),
  7652. IE = Yf('stream:screen'),
  7653. ME = (function () {
  7654. function t() {
  7655. this.mediaStream = null;
  7656. }
  7657. return (
  7658. (t.prototype.start = function (t) {
  7659. var e = t.video,
  7660. r = t.audio;
  7661. return Ed(this, void 0, void 0, function () {
  7662. var t, n, i, o, s, a, u, c, h, l;
  7663. return Sd(this, function (d) {
  7664. var f;
  7665. switch (d.label) {
  7666. case 0:
  7667. if (this.mediaStream)
  7668. return IE('stream is existed'), [2, this.mediaStream];
  7669. (t = {}),
  7670. e &&
  7671. ((n = e.frameRate),
  7672. (i = e.resolution),
  7673. (o = {
  7674. frameRate: { ideal: n },
  7675. width: tE ? { max: i.width } : { ideal: i.width },
  7676. height: tE ? { max: i.height } : { ideal: i.height },
  7677. }),
  7678. (t.video = o)),
  7679. r &&
  7680. ((s = r.echoCancellation),
  7681. (a = r.noiseSuppression),
  7682. (u = r.autoGainControl),
  7683. (c = {
  7684. echoCancellation: s,
  7685. noiseSuppression: a,
  7686. autoGainControl: u,
  7687. }),
  7688. (t.audio = c)),
  7689. (d.label = 1);
  7690. case 1:
  7691. return (
  7692. d.trys.push([1, 3, , 4]),
  7693. (h = this),
  7694. [4, navigator.mediaDevices.getDisplayMedia(t)]
  7695. );
  7696. case 2:
  7697. return (
  7698. (h.mediaStream = d.sent()),
  7699. Ph((f = this.mediaStream.getVideoTracks())).call(
  7700. f,
  7701. function (r) {
  7702. var n;
  7703. null === (n = r.applyConstraints) ||
  7704. void 0 === n ||
  7705. n
  7706. .call(
  7707. r,
  7708. xd(xd({}, t.video), {
  7709. frameRate: {
  7710. min: e.frameRate,
  7711. ideal: e.frameRate,
  7712. },
  7713. })
  7714. )
  7715. .catch(function (t) {
  7716. IE(
  7717. 'video track applyConstraints error, '.concat(
  7718. t.toString()
  7719. )
  7720. );
  7721. }),
  7722. (r.contentHint = 'detail');
  7723. }
  7724. ),
  7725. [2, this.mediaStream]
  7726. );
  7727. case 3:
  7728. throw (
  7729. ((l = d.sent()),
  7730. IE('start error, '.concat(l.toString())),
  7731. l)
  7732. );
  7733. case 4:
  7734. return [2];
  7735. }
  7736. });
  7737. });
  7738. }),
  7739. (t.prototype.stop = function () {
  7740. var t, e;
  7741. null === (e = this.mediaStream) ||
  7742. void 0 === e ||
  7743. Ph((t = e.getTracks())).call(t, function (t) {
  7744. 'ended' !== t.readyState && t.stop();
  7745. }),
  7746. (this.mediaStream = null);
  7747. }),
  7748. (t.prototype.getResolution = function () {
  7749. if (!this.mediaStream) return null;
  7750. var t = this.mediaStream.getVideoTracks();
  7751. if (0 === t.length) return null;
  7752. var e = t[0].getSettings();
  7753. return { width: e.width, height: e.height };
  7754. }),
  7755. t
  7756. );
  7757. })(),
  7758. DE = s,
  7759. LE = fe('iterator'),
  7760. FE = !DE(function () {
  7761. var t = new URL('b?a=1&b=2&c=3', 'http://a'),
  7762. e = t.searchParams,
  7763. r = '';
  7764. return (
  7765. (t.pathname = 'c%20d'),
  7766. e.forEach(function (t, n) {
  7767. e.delete('b'), (r += n + t);
  7768. }),
  7769. !t.toJSON ||
  7770. !e.sort ||
  7771. 'http://a/c%20d?a=1&c=3' !== t.href ||
  7772. '3' !== e.get('c') ||
  7773. 'a=1' !== String(new URLSearchParams('?a=1')) ||
  7774. !e[LE] ||
  7775. 'a' !== new URL('https://a@b').username ||
  7776. 'b' !== new URLSearchParams(new URLSearchParams('a=b')).get('a') ||
  7777. 'xn--e1aybc' !== new URL('http://тест').host ||
  7778. '#%D0%B1' !== new URL('http://a#б').hash ||
  7779. 'a1c3' !== r ||
  7780. 'x' !== new URL('http://x', void 0).host
  7781. );
  7782. }),
  7783. NE = Qe,
  7784. kE = O,
  7785. BE = S,
  7786. GE = D,
  7787. UE = s,
  7788. jE = yi,
  7789. XE = no,
  7790. VE = L,
  7791. HE = Zt,
  7792. WE = W,
  7793. YE = Object.assign,
  7794. zE = Object.defineProperty,
  7795. ZE = BE([].concat),
  7796. JE =
  7797. !YE ||
  7798. UE(function () {
  7799. if (
  7800. kE &&
  7801. 1 !==
  7802. YE(
  7803. { b: 1 },
  7804. YE(
  7805. zE({}, 'a', {
  7806. enumerable: !0,
  7807. get: function () {
  7808. zE(this, 'b', { value: 3, enumerable: !1 });
  7809. },
  7810. }),
  7811. { b: 2 }
  7812. )
  7813. ).b
  7814. )
  7815. return !0;
  7816. var t = {},
  7817. e = {},
  7818. r = Symbol(),
  7819. n = 'abcdefghijklmnopqrst';
  7820. return (
  7821. (t[r] = 7),
  7822. n.split('').forEach(function (t) {
  7823. e[t] = t;
  7824. }),
  7825. 7 != YE({}, t)[r] || jE(YE({}, e)).join('') != n
  7826. );
  7827. })
  7828. ? function (t, e) {
  7829. for (
  7830. var r = HE(t), n = arguments.length, i = 1, o = XE.f, s = VE.f;
  7831. n > i;
  7832. )
  7833. for (
  7834. var a,
  7835. u = WE(arguments[i++]),
  7836. c = o ? ZE(jE(u), o(u)) : jE(u),
  7837. h = c.length,
  7838. l = 0;
  7839. h > l;
  7840. )
  7841. (a = c[l++]), (kE && !GE(s, u, a)) || (r[a] = u[a]);
  7842. return r;
  7843. }
  7844. : YE,
  7845. KE = nr,
  7846. qE = wg,
  7847. QE = qe,
  7848. $E = D,
  7849. tS = Zt,
  7850. eS = function (t, e, r, n) {
  7851. try {
  7852. return n ? e(KE(r)[0], r[1]) : e(r);
  7853. } catch (e) {
  7854. qE(t, 'throw', e);
  7855. }
  7856. },
  7857. rS = ug,
  7858. nS = Tn,
  7859. iS = jr,
  7860. oS = zr,
  7861. sS = Tg,
  7862. aS = pg,
  7863. uS = Array,
  7864. cS = S,
  7865. hS = 2147483647,
  7866. lS = /[^\0-\u007E]/,
  7867. dS = /[.\u3002\uFF0E\uFF61]/g,
  7868. fS = 'Overflow: input needs wider integers to process',
  7869. pS = RangeError,
  7870. vS = cS(dS.exec),
  7871. mS = Math.floor,
  7872. yS = String.fromCharCode,
  7873. gS = cS(''.charCodeAt),
  7874. _S = cS([].join),
  7875. bS = cS([].push),
  7876. TS = cS(''.replace),
  7877. xS = cS(''.split),
  7878. ES = cS(''.toLowerCase),
  7879. SS = function (t) {
  7880. return t + 22 + 75 * (t < 26);
  7881. },
  7882. wS = function (t, e, r) {
  7883. var n = 0;
  7884. for (t = r ? mS(t / 700) : t >> 1, t += mS(t / e); t > 455; )
  7885. (t = mS(t / 35)), (n += 36);
  7886. return mS(n + (36 * t) / (t + 38));
  7887. },
  7888. RS = function (t) {
  7889. var e = [];
  7890. t = (function (t) {
  7891. for (var e = [], r = 0, n = t.length; r < n; ) {
  7892. var i = gS(t, r++);
  7893. if (i >= 55296 && i <= 56319 && r < n) {
  7894. var o = gS(t, r++);
  7895. 56320 == (64512 & o)
  7896. ? bS(e, ((1023 & i) << 10) + (1023 & o) + 65536)
  7897. : (bS(e, i), r--);
  7898. } else bS(e, i);
  7899. }
  7900. return e;
  7901. })(t);
  7902. var r,
  7903. n,
  7904. i = t.length,
  7905. o = 128,
  7906. s = 0,
  7907. a = 72;
  7908. for (r = 0; r < t.length; r++) (n = t[r]) < 128 && bS(e, yS(n));
  7909. var u = e.length,
  7910. c = u;
  7911. for (u && bS(e, '-'); c < i; ) {
  7912. var h = hS;
  7913. for (r = 0; r < t.length; r++) (n = t[r]) >= o && n < h && (h = n);
  7914. var l = c + 1;
  7915. if (h - o > mS((hS - s) / l)) throw pS(fS);
  7916. for (s += (h - o) * l, o = h, r = 0; r < t.length; r++) {
  7917. if ((n = t[r]) < o && ++s > hS) throw pS(fS);
  7918. if (n == o) {
  7919. for (var d = s, f = 36; ; ) {
  7920. var p = f <= a ? 1 : f >= a + 26 ? 26 : f - a;
  7921. if (d < p) break;
  7922. var v = d - p,
  7923. m = 36 - p;
  7924. bS(e, yS(SS(p + (v % m)))), (d = mS(v / m)), (f += 36);
  7925. }
  7926. bS(e, yS(SS(d))), (a = wS(s, l, c == u)), (s = 0), c++;
  7927. }
  7928. }
  7929. s++, o++;
  7930. }
  7931. return _S(e, '');
  7932. },
  7933. CS = oo,
  7934. PS = qi,
  7935. AS = Math.floor,
  7936. OS = function (t, e) {
  7937. var r = t.length,
  7938. n = AS(r / 2);
  7939. return r < 8 ? IS(t, e) : MS(t, OS(PS(t, 0, n), e), OS(PS(t, n), e), e);
  7940. },
  7941. IS = function (t, e) {
  7942. for (var r, n, i = t.length, o = 1; o < i; ) {
  7943. for (n = o, r = t[o]; n && e(t[n - 1], r) > 0; ) t[n] = t[--n];
  7944. n !== o++ && (t[n] = r);
  7945. }
  7946. return t;
  7947. },
  7948. MS = function (t, e, r, n) {
  7949. for (var i = e.length, o = r.length, s = 0, a = 0; s < i || a < o; )
  7950. t[s + a] =
  7951. s < i && a < o
  7952. ? n(e[s], r[a]) <= 0
  7953. ? e[s++]
  7954. : r[a++]
  7955. : s < i
  7956. ? e[s++]
  7957. : r[a++];
  7958. return t;
  7959. },
  7960. DS = Ar,
  7961. LS = o,
  7962. FS = D,
  7963. NS = S,
  7964. kS = O,
  7965. BS = FE,
  7966. GS = oo,
  7967. US = function (t, e, r) {
  7968. for (var n in e)
  7969. r && r.unsafe && t[n] ? (t[n] = e[n]) : CS(t, n, e[n], r);
  7970. return t;
  7971. },
  7972. jS = Oo,
  7973. XS = Fu,
  7974. VS = Yo,
  7975. HS = g_,
  7976. WS = P,
  7977. YS = qt,
  7978. zS = qe,
  7979. ZS = rn,
  7980. JS = nr,
  7981. KS = et,
  7982. qS = Kn,
  7983. QS = ji,
  7984. $S = U,
  7985. tw = Tg,
  7986. ew = pg,
  7987. rw = ql,
  7988. nw = OS,
  7989. iw = fe('iterator'),
  7990. ow = 'URLSearchParams',
  7991. sw = 'URLSearchParamsIterator',
  7992. aw = VS.set,
  7993. uw = VS.getterFor(ow),
  7994. cw = VS.getterFor(sw),
  7995. hw = Object.getOwnPropertyDescriptor,
  7996. lw = function (t) {
  7997. if (!kS) return LS[t];
  7998. var e = hw(LS, t);
  7999. return e && e.value;
  8000. },
  8001. dw = lw('fetch'),
  8002. fw = lw('Request'),
  8003. pw = lw('Headers'),
  8004. vw = fw && fw.prototype,
  8005. mw = pw && pw.prototype,
  8006. yw = LS.RegExp,
  8007. gw = LS.TypeError,
  8008. _w = LS.decodeURIComponent,
  8009. bw = LS.encodeURIComponent,
  8010. Tw = NS(''.charAt),
  8011. xw = NS([].join),
  8012. Ew = NS([].push),
  8013. Sw = NS(''.replace),
  8014. ww = NS([].shift),
  8015. Rw = NS([].splice),
  8016. Cw = NS(''.split),
  8017. Pw = NS(''.slice),
  8018. Aw = /\+/g,
  8019. Ow = Array(4),
  8020. Iw = function (t) {
  8021. return (
  8022. Ow[t - 1] || (Ow[t - 1] = yw('((?:%[\\da-f]{2}){' + t + '})', 'gi'))
  8023. );
  8024. },
  8025. Mw = function (t) {
  8026. try {
  8027. return _w(t);
  8028. } catch (e) {
  8029. return t;
  8030. }
  8031. },
  8032. Dw = function (t) {
  8033. var e = Sw(t, Aw, ' '),
  8034. r = 4;
  8035. try {
  8036. return _w(e);
  8037. } catch (t) {
  8038. for (; r; ) e = Sw(e, Iw(r--), Mw);
  8039. return e;
  8040. }
  8041. },
  8042. Lw = /[!'()~]|%20/g,
  8043. Fw = {
  8044. '!': '%21',
  8045. "'": '%27',
  8046. '(': '%28',
  8047. ')': '%29',
  8048. '~': '%7E',
  8049. '%20': '+',
  8050. },
  8051. Nw = function (t) {
  8052. return Fw[t];
  8053. },
  8054. kw = function (t) {
  8055. return Sw(bw(t), Lw, Nw);
  8056. },
  8057. Bw = XS(
  8058. function (t, e) {
  8059. aw(this, { type: sw, iterator: tw(uw(t).entries), kind: e });
  8060. },
  8061. 'Iterator',
  8062. function () {
  8063. var t = cw(this),
  8064. e = t.kind,
  8065. r = t.iterator.next(),
  8066. n = r.value;
  8067. return (
  8068. r.done ||
  8069. (r.value =
  8070. 'keys' === e
  8071. ? n.key
  8072. : 'values' === e
  8073. ? n.value
  8074. : [n.key, n.value]),
  8075. r
  8076. );
  8077. },
  8078. !0
  8079. ),
  8080. Gw = function (t) {
  8081. (this.entries = []),
  8082. (this.url = null),
  8083. void 0 !== t &&
  8084. (KS(t)
  8085. ? this.parseObject(t)
  8086. : this.parseQuery(
  8087. 'string' == typeof t ? ('?' === Tw(t, 0) ? Pw(t, 1) : t) : qS(t)
  8088. ));
  8089. };
  8090. Gw.prototype = {
  8091. type: ow,
  8092. bindURL: function (t) {
  8093. (this.url = t), this.update();
  8094. },
  8095. parseObject: function (t) {
  8096. var e,
  8097. r,
  8098. n,
  8099. i,
  8100. o,
  8101. s,
  8102. a,
  8103. u = ew(t);
  8104. if (u)
  8105. for (r = (e = tw(t, u)).next; !(n = FS(r, e)).done; ) {
  8106. if (
  8107. ((o = (i = tw(JS(n.value))).next),
  8108. (s = FS(o, i)).done || (a = FS(o, i)).done || !FS(o, i).done)
  8109. )
  8110. throw gw('Expected sequence with length 2');
  8111. Ew(this.entries, { key: qS(s.value), value: qS(a.value) });
  8112. }
  8113. else
  8114. for (var c in t)
  8115. YS(t, c) && Ew(this.entries, { key: c, value: qS(t[c]) });
  8116. },
  8117. parseQuery: function (t) {
  8118. if (t)
  8119. for (var e, r, n = Cw(t, '&'), i = 0; i < n.length; )
  8120. (e = n[i++]).length &&
  8121. ((r = Cw(e, '=')),
  8122. Ew(this.entries, { key: Dw(ww(r)), value: Dw(xw(r, '=')) }));
  8123. },
  8124. serialize: function () {
  8125. for (var t, e = this.entries, r = [], n = 0; n < e.length; )
  8126. (t = e[n++]), Ew(r, kw(t.key) + '=' + kw(t.value));
  8127. return xw(r, '&');
  8128. },
  8129. update: function () {
  8130. (this.entries.length = 0), this.parseQuery(this.url.query);
  8131. },
  8132. updateURL: function () {
  8133. this.url && this.url.update();
  8134. },
  8135. };
  8136. var Uw = function () {
  8137. HS(this, jw);
  8138. var t = arguments.length > 0 ? arguments[0] : void 0;
  8139. aw(this, new Gw(t));
  8140. },
  8141. jw = Uw.prototype;
  8142. if (
  8143. (US(
  8144. jw,
  8145. {
  8146. append: function (t, e) {
  8147. rw(arguments.length, 2);
  8148. var r = uw(this);
  8149. Ew(r.entries, { key: qS(t), value: qS(e) }), r.updateURL();
  8150. },
  8151. delete: function (t) {
  8152. rw(arguments.length, 1);
  8153. for (
  8154. var e = uw(this), r = e.entries, n = qS(t), i = 0;
  8155. i < r.length;
  8156. )
  8157. r[i].key === n ? Rw(r, i, 1) : i++;
  8158. e.updateURL();
  8159. },
  8160. get: function (t) {
  8161. rw(arguments.length, 1);
  8162. for (var e = uw(this).entries, r = qS(t), n = 0; n < e.length; n++)
  8163. if (e[n].key === r) return e[n].value;
  8164. return null;
  8165. },
  8166. getAll: function (t) {
  8167. rw(arguments.length, 1);
  8168. for (
  8169. var e = uw(this).entries, r = qS(t), n = [], i = 0;
  8170. i < e.length;
  8171. i++
  8172. )
  8173. e[i].key === r && Ew(n, e[i].value);
  8174. return n;
  8175. },
  8176. has: function (t) {
  8177. rw(arguments.length, 1);
  8178. for (var e = uw(this).entries, r = qS(t), n = 0; n < e.length; )
  8179. if (e[n++].key === r) return !0;
  8180. return !1;
  8181. },
  8182. set: function (t, e) {
  8183. rw(arguments.length, 1);
  8184. for (
  8185. var r,
  8186. n = uw(this),
  8187. i = n.entries,
  8188. o = !1,
  8189. s = qS(t),
  8190. a = qS(e),
  8191. u = 0;
  8192. u < i.length;
  8193. u++
  8194. )
  8195. (r = i[u]).key === s &&
  8196. (o ? Rw(i, u--, 1) : ((o = !0), (r.value = a)));
  8197. o || Ew(i, { key: s, value: a }), n.updateURL();
  8198. },
  8199. sort: function () {
  8200. var t = uw(this);
  8201. nw(t.entries, function (t, e) {
  8202. return t.key > e.key ? 1 : -1;
  8203. }),
  8204. t.updateURL();
  8205. },
  8206. forEach: function (t) {
  8207. for (
  8208. var e,
  8209. r = uw(this).entries,
  8210. n = zS(t, arguments.length > 1 ? arguments[1] : void 0),
  8211. i = 0;
  8212. i < r.length;
  8213. )
  8214. n((e = r[i++]).value, e.key, this);
  8215. },
  8216. keys: function () {
  8217. return new Bw(this, 'keys');
  8218. },
  8219. values: function () {
  8220. return new Bw(this, 'values');
  8221. },
  8222. entries: function () {
  8223. return new Bw(this, 'entries');
  8224. },
  8225. },
  8226. { enumerable: !0 }
  8227. ),
  8228. GS(jw, iw, jw.entries, { name: 'entries' }),
  8229. GS(
  8230. jw,
  8231. 'toString',
  8232. function () {
  8233. return uw(this).serialize();
  8234. },
  8235. { enumerable: !0 }
  8236. ),
  8237. jS(Uw, ow),
  8238. DS({ global: !0, constructor: !0, forced: !BS }, { URLSearchParams: Uw }),
  8239. !BS && WS(pw))
  8240. ) {
  8241. var Xw = NS(mw.has),
  8242. Vw = NS(mw.set),
  8243. Hw = function (t) {
  8244. if (KS(t)) {
  8245. var e,
  8246. r = t.body;
  8247. if (ZS(r) === ow)
  8248. return (
  8249. (e = t.headers ? new pw(t.headers) : new pw()),
  8250. Xw(e, 'content-type') ||
  8251. Vw(
  8252. e,
  8253. 'content-type',
  8254. 'application/x-www-form-urlencoded;charset=UTF-8'
  8255. ),
  8256. QS(t, { body: $S(0, qS(r)), headers: $S(0, e) })
  8257. );
  8258. }
  8259. return t;
  8260. };
  8261. if (
  8262. (WS(dw) &&
  8263. DS(
  8264. { global: !0, enumerable: !0, dontCallGetSet: !0, forced: !0 },
  8265. {
  8266. fetch: function (t) {
  8267. return dw(t, arguments.length > 1 ? Hw(arguments[1]) : {});
  8268. },
  8269. }
  8270. ),
  8271. WS(fw))
  8272. ) {
  8273. var Ww = function (t) {
  8274. return (
  8275. HS(this, vw), new fw(t, arguments.length > 1 ? Hw(arguments[1]) : {})
  8276. );
  8277. };
  8278. (vw.constructor = Ww),
  8279. (Ww.prototype = vw),
  8280. DS(
  8281. { global: !0, constructor: !0, dontCallGetSet: !0, forced: !0 },
  8282. { Request: Ww }
  8283. );
  8284. }
  8285. }
  8286. var Yw,
  8287. zw = Ar,
  8288. Zw = O,
  8289. Jw = FE,
  8290. Kw = o,
  8291. qw = qe,
  8292. Qw = S,
  8293. $w = oo,
  8294. tR = function (t, e, r) {
  8295. return NE.f(t, e, r);
  8296. },
  8297. eR = g_,
  8298. rR = qt,
  8299. nR = JE,
  8300. iR = function (t) {
  8301. var e = tS(t),
  8302. r = nS(this),
  8303. n = arguments.length,
  8304. i = n > 1 ? arguments[1] : void 0,
  8305. o = void 0 !== i;
  8306. o && (i = QE(i, n > 2 ? arguments[2] : void 0));
  8307. var s,
  8308. a,
  8309. u,
  8310. c,
  8311. h,
  8312. l,
  8313. d = aS(e),
  8314. f = 0;
  8315. if (!d || (this === uS && rS(d)))
  8316. for (s = iS(e), a = r ? new this(s) : uS(s); s > f; f++)
  8317. (l = o ? i(e[f], f) : e[f]), oS(a, f, l);
  8318. else
  8319. for (
  8320. h = (c = sS(e, d)).next, a = r ? new this() : [];
  8321. !(u = $E(h, c)).done;
  8322. f++
  8323. )
  8324. (l = o ? eS(c, i, [u.value, f], !0) : u.value), oS(a, f, l);
  8325. return (a.length = f), a;
  8326. },
  8327. oR = qi,
  8328. sR = Fc.codeAt,
  8329. aR = function (t) {
  8330. var e,
  8331. r,
  8332. n = [],
  8333. i = xS(TS(ES(t), dS, '.'), '.');
  8334. for (e = 0; e < i.length; e++)
  8335. (r = i[e]), bS(n, vS(lS, r) ? 'xn--' + RS(r) : r);
  8336. return _S(n, '.');
  8337. },
  8338. uR = Kn,
  8339. cR = Oo,
  8340. hR = ql,
  8341. lR = { URLSearchParams: Uw, getState: uw },
  8342. dR = Yo,
  8343. fR = dR.set,
  8344. pR = dR.getterFor('URL'),
  8345. vR = lR.URLSearchParams,
  8346. mR = lR.getState,
  8347. yR = Kw.URL,
  8348. gR = Kw.TypeError,
  8349. _R = Kw.parseInt,
  8350. bR = Math.floor,
  8351. TR = Math.pow,
  8352. xR = Qw(''.charAt),
  8353. ER = Qw(/./.exec),
  8354. SR = Qw([].join),
  8355. wR = Qw((1).toString),
  8356. RR = Qw([].pop),
  8357. CR = Qw([].push),
  8358. PR = Qw(''.replace),
  8359. AR = Qw([].shift),
  8360. OR = Qw(''.split),
  8361. IR = Qw(''.slice),
  8362. MR = Qw(''.toLowerCase),
  8363. DR = Qw([].unshift),
  8364. LR = 'Invalid scheme',
  8365. FR = 'Invalid host',
  8366. NR = 'Invalid port',
  8367. kR = /[a-z]/i,
  8368. BR = /[\d+-.a-z]/i,
  8369. GR = /\d/,
  8370. UR = /^0x/i,
  8371. jR = /^[0-7]+$/,
  8372. XR = /^\d+$/,
  8373. VR = /^[\da-f]+$/i,
  8374. HR = /[\0\t\n\r #%/:<>?@[\\\]^|]/,
  8375. WR = /[\0\t\n\r #/:<>?@[\\\]^|]/,
  8376. YR = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,
  8377. zR = /[\t\n\r]/g,
  8378. ZR = function (t) {
  8379. var e, r, n, i;
  8380. if ('number' == typeof t) {
  8381. for (e = [], r = 0; r < 4; r++) DR(e, t % 256), (t = bR(t / 256));
  8382. return SR(e, '.');
  8383. }
  8384. if ('object' == typeof t) {
  8385. for (
  8386. e = '',
  8387. n = (function (t) {
  8388. for (var e = null, r = 1, n = null, i = 0, o = 0; o < 8; o++)
  8389. 0 !== t[o]
  8390. ? (i > r && ((e = n), (r = i)), (n = null), (i = 0))
  8391. : (null === n && (n = o), ++i);
  8392. return i > r && ((e = n), (r = i)), e;
  8393. })(t),
  8394. r = 0;
  8395. r < 8;
  8396. r++
  8397. )
  8398. (i && 0 === t[r]) ||
  8399. (i && (i = !1),
  8400. n === r
  8401. ? ((e += r ? ':' : '::'), (i = !0))
  8402. : ((e += wR(t[r], 16)), r < 7 && (e += ':')));
  8403. return '[' + e + ']';
  8404. }
  8405. return t;
  8406. },
  8407. JR = {},
  8408. KR = nR({}, JR, { ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 }),
  8409. qR = nR({}, KR, { '#': 1, '?': 1, '{': 1, '}': 1 }),
  8410. QR = nR({}, qR, {
  8411. '/': 1,
  8412. ':': 1,
  8413. ';': 1,
  8414. '=': 1,
  8415. '@': 1,
  8416. '[': 1,
  8417. '\\': 1,
  8418. ']': 1,
  8419. '^': 1,
  8420. '|': 1,
  8421. }),
  8422. $R = function (t, e) {
  8423. var r = sR(t, 0);
  8424. return r > 32 && r < 127 && !rR(e, t) ? t : encodeURIComponent(t);
  8425. },
  8426. tC = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 },
  8427. eC = function (t, e) {
  8428. var r;
  8429. return (
  8430. 2 == t.length &&
  8431. ER(kR, xR(t, 0)) &&
  8432. (':' == (r = xR(t, 1)) || (!e && '|' == r))
  8433. );
  8434. },
  8435. rC = function (t) {
  8436. var e;
  8437. return (
  8438. t.length > 1 &&
  8439. eC(IR(t, 0, 2)) &&
  8440. (2 == t.length ||
  8441. '/' === (e = xR(t, 2)) ||
  8442. '\\' === e ||
  8443. '?' === e ||
  8444. '#' === e)
  8445. );
  8446. },
  8447. nC = function (t) {
  8448. return '.' === t || '%2e' === MR(t);
  8449. },
  8450. iC = {},
  8451. oC = {},
  8452. sC = {},
  8453. aC = {},
  8454. uC = {},
  8455. cC = {},
  8456. hC = {},
  8457. lC = {},
  8458. dC = {},
  8459. fC = {},
  8460. pC = {},
  8461. vC = {},
  8462. mC = {},
  8463. yC = {},
  8464. gC = {},
  8465. _C = {},
  8466. bC = {},
  8467. TC = {},
  8468. xC = {},
  8469. EC = {},
  8470. SC = {},
  8471. wC = function (t, e, r) {
  8472. var n,
  8473. i,
  8474. o,
  8475. s = uR(t);
  8476. if (e) {
  8477. if ((i = this.parse(s))) throw gR(i);
  8478. this.searchParams = null;
  8479. } else {
  8480. if ((void 0 !== r && (n = new wC(r, !0)), (i = this.parse(s, null, n))))
  8481. throw gR(i);
  8482. (o = mR(new vR())).bindURL(this), (this.searchParams = o);
  8483. }
  8484. };
  8485. wC.prototype = {
  8486. type: 'URL',
  8487. parse: function (t, e, r) {
  8488. var n,
  8489. i,
  8490. o,
  8491. s,
  8492. a,
  8493. u = this,
  8494. c = e || iC,
  8495. h = 0,
  8496. l = '',
  8497. d = !1,
  8498. f = !1,
  8499. p = !1;
  8500. for (
  8501. t = uR(t),
  8502. e ||
  8503. ((u.scheme = ''),
  8504. (u.username = ''),
  8505. (u.password = ''),
  8506. (u.host = null),
  8507. (u.port = null),
  8508. (u.path = []),
  8509. (u.query = null),
  8510. (u.fragment = null),
  8511. (u.cannotBeABaseURL = !1),
  8512. (t = PR(t, YR, ''))),
  8513. t = PR(t, zR, ''),
  8514. n = iR(t);
  8515. h <= n.length;
  8516. ) {
  8517. switch (((i = n[h]), c)) {
  8518. case iC:
  8519. if (!i || !ER(kR, i)) {
  8520. if (e) return LR;
  8521. c = sC;
  8522. continue;
  8523. }
  8524. (l += MR(i)), (c = oC);
  8525. break;
  8526. case oC:
  8527. if (i && (ER(BR, i) || '+' == i || '-' == i || '.' == i))
  8528. l += MR(i);
  8529. else {
  8530. if (':' != i) {
  8531. if (e) return LR;
  8532. (l = ''), (c = sC), (h = 0);
  8533. continue;
  8534. }
  8535. if (
  8536. e &&
  8537. (u.isSpecial() != rR(tC, l) ||
  8538. ('file' == l &&
  8539. (u.includesCredentials() || null !== u.port)) ||
  8540. ('file' == u.scheme && !u.host))
  8541. )
  8542. return;
  8543. if (((u.scheme = l), e))
  8544. return void (
  8545. u.isSpecial() &&
  8546. tC[u.scheme] == u.port &&
  8547. (u.port = null)
  8548. );
  8549. (l = ''),
  8550. 'file' == u.scheme
  8551. ? (c = yC)
  8552. : u.isSpecial() && r && r.scheme == u.scheme
  8553. ? (c = aC)
  8554. : u.isSpecial()
  8555. ? (c = lC)
  8556. : '/' == n[h + 1]
  8557. ? ((c = uC), h++)
  8558. : ((u.cannotBeABaseURL = !0), CR(u.path, ''), (c = xC));
  8559. }
  8560. break;
  8561. case sC:
  8562. if (!r || (r.cannotBeABaseURL && '#' != i)) return LR;
  8563. if (r.cannotBeABaseURL && '#' == i) {
  8564. (u.scheme = r.scheme),
  8565. (u.path = oR(r.path)),
  8566. (u.query = r.query),
  8567. (u.fragment = ''),
  8568. (u.cannotBeABaseURL = !0),
  8569. (c = SC);
  8570. break;
  8571. }
  8572. c = 'file' == r.scheme ? yC : cC;
  8573. continue;
  8574. case aC:
  8575. if ('/' != i || '/' != n[h + 1]) {
  8576. c = cC;
  8577. continue;
  8578. }
  8579. (c = dC), h++;
  8580. break;
  8581. case uC:
  8582. if ('/' == i) {
  8583. c = fC;
  8584. break;
  8585. }
  8586. c = TC;
  8587. continue;
  8588. case cC:
  8589. if (((u.scheme = r.scheme), i == Yw))
  8590. (u.username = r.username),
  8591. (u.password = r.password),
  8592. (u.host = r.host),
  8593. (u.port = r.port),
  8594. (u.path = oR(r.path)),
  8595. (u.query = r.query);
  8596. else if ('/' == i || ('\\' == i && u.isSpecial())) c = hC;
  8597. else if ('?' == i)
  8598. (u.username = r.username),
  8599. (u.password = r.password),
  8600. (u.host = r.host),
  8601. (u.port = r.port),
  8602. (u.path = oR(r.path)),
  8603. (u.query = ''),
  8604. (c = EC);
  8605. else {
  8606. if ('#' != i) {
  8607. (u.username = r.username),
  8608. (u.password = r.password),
  8609. (u.host = r.host),
  8610. (u.port = r.port),
  8611. (u.path = oR(r.path)),
  8612. u.path.length--,
  8613. (c = TC);
  8614. continue;
  8615. }
  8616. (u.username = r.username),
  8617. (u.password = r.password),
  8618. (u.host = r.host),
  8619. (u.port = r.port),
  8620. (u.path = oR(r.path)),
  8621. (u.query = r.query),
  8622. (u.fragment = ''),
  8623. (c = SC);
  8624. }
  8625. break;
  8626. case hC:
  8627. if (!u.isSpecial() || ('/' != i && '\\' != i)) {
  8628. if ('/' != i) {
  8629. (u.username = r.username),
  8630. (u.password = r.password),
  8631. (u.host = r.host),
  8632. (u.port = r.port),
  8633. (c = TC);
  8634. continue;
  8635. }
  8636. c = fC;
  8637. } else c = dC;
  8638. break;
  8639. case lC:
  8640. if (((c = dC), '/' != i || '/' != xR(l, h + 1))) continue;
  8641. h++;
  8642. break;
  8643. case dC:
  8644. if ('/' != i && '\\' != i) {
  8645. c = fC;
  8646. continue;
  8647. }
  8648. break;
  8649. case fC:
  8650. if ('@' == i) {
  8651. d && (l = '%40' + l), (d = !0), (o = iR(l));
  8652. for (var v = 0; v < o.length; v++) {
  8653. var m = o[v];
  8654. if (':' != m || p) {
  8655. var y = $R(m, QR);
  8656. p ? (u.password += y) : (u.username += y);
  8657. } else p = !0;
  8658. }
  8659. l = '';
  8660. } else if (
  8661. i == Yw ||
  8662. '/' == i ||
  8663. '?' == i ||
  8664. '#' == i ||
  8665. ('\\' == i && u.isSpecial())
  8666. ) {
  8667. if (d && '' == l) return 'Invalid authority';
  8668. (h -= iR(l).length + 1), (l = ''), (c = pC);
  8669. } else l += i;
  8670. break;
  8671. case pC:
  8672. case vC:
  8673. if (e && 'file' == u.scheme) {
  8674. c = _C;
  8675. continue;
  8676. }
  8677. if (':' != i || f) {
  8678. if (
  8679. i == Yw ||
  8680. '/' == i ||
  8681. '?' == i ||
  8682. '#' == i ||
  8683. ('\\' == i && u.isSpecial())
  8684. ) {
  8685. if (u.isSpecial() && '' == l) return FR;
  8686. if (
  8687. e &&
  8688. '' == l &&
  8689. (u.includesCredentials() || null !== u.port)
  8690. )
  8691. return;
  8692. if ((s = u.parseHost(l))) return s;
  8693. if (((l = ''), (c = bC), e)) return;
  8694. continue;
  8695. }
  8696. '[' == i ? (f = !0) : ']' == i && (f = !1), (l += i);
  8697. } else {
  8698. if ('' == l) return FR;
  8699. if ((s = u.parseHost(l))) return s;
  8700. if (((l = ''), (c = mC), e == vC)) return;
  8701. }
  8702. break;
  8703. case mC:
  8704. if (!ER(GR, i)) {
  8705. if (
  8706. i == Yw ||
  8707. '/' == i ||
  8708. '?' == i ||
  8709. '#' == i ||
  8710. ('\\' == i && u.isSpecial()) ||
  8711. e
  8712. ) {
  8713. if ('' != l) {
  8714. var g = _R(l, 10);
  8715. if (g > 65535) return NR;
  8716. (u.port = u.isSpecial() && g === tC[u.scheme] ? null : g),
  8717. (l = '');
  8718. }
  8719. if (e) return;
  8720. c = bC;
  8721. continue;
  8722. }
  8723. return NR;
  8724. }
  8725. l += i;
  8726. break;
  8727. case yC:
  8728. if (((u.scheme = 'file'), '/' == i || '\\' == i)) c = gC;
  8729. else {
  8730. if (!r || 'file' != r.scheme) {
  8731. c = TC;
  8732. continue;
  8733. }
  8734. if (i == Yw)
  8735. (u.host = r.host), (u.path = oR(r.path)), (u.query = r.query);
  8736. else if ('?' == i)
  8737. (u.host = r.host),
  8738. (u.path = oR(r.path)),
  8739. (u.query = ''),
  8740. (c = EC);
  8741. else {
  8742. if ('#' != i) {
  8743. rC(SR(oR(n, h), '')) ||
  8744. ((u.host = r.host), (u.path = oR(r.path)), u.shortenPath()),
  8745. (c = TC);
  8746. continue;
  8747. }
  8748. (u.host = r.host),
  8749. (u.path = oR(r.path)),
  8750. (u.query = r.query),
  8751. (u.fragment = ''),
  8752. (c = SC);
  8753. }
  8754. }
  8755. break;
  8756. case gC:
  8757. if ('/' == i || '\\' == i) {
  8758. c = _C;
  8759. break;
  8760. }
  8761. r &&
  8762. 'file' == r.scheme &&
  8763. !rC(SR(oR(n, h), '')) &&
  8764. (eC(r.path[0], !0) ? CR(u.path, r.path[0]) : (u.host = r.host)),
  8765. (c = TC);
  8766. continue;
  8767. case _C:
  8768. if (i == Yw || '/' == i || '\\' == i || '?' == i || '#' == i) {
  8769. if (!e && eC(l)) c = TC;
  8770. else if ('' == l) {
  8771. if (((u.host = ''), e)) return;
  8772. c = bC;
  8773. } else {
  8774. if ((s = u.parseHost(l))) return s;
  8775. if (('localhost' == u.host && (u.host = ''), e)) return;
  8776. (l = ''), (c = bC);
  8777. }
  8778. continue;
  8779. }
  8780. l += i;
  8781. break;
  8782. case bC:
  8783. if (u.isSpecial()) {
  8784. if (((c = TC), '/' != i && '\\' != i)) continue;
  8785. } else if (e || '?' != i)
  8786. if (e || '#' != i) {
  8787. if (i != Yw && ((c = TC), '/' != i)) continue;
  8788. } else (u.fragment = ''), (c = SC);
  8789. else (u.query = ''), (c = EC);
  8790. break;
  8791. case TC:
  8792. if (
  8793. i == Yw ||
  8794. '/' == i ||
  8795. ('\\' == i && u.isSpecial()) ||
  8796. (!e && ('?' == i || '#' == i))
  8797. ) {
  8798. if (
  8799. ('..' === (a = MR((a = l))) ||
  8800. '%2e.' === a ||
  8801. '.%2e' === a ||
  8802. '%2e%2e' === a
  8803. ? (u.shortenPath(),
  8804. '/' == i || ('\\' == i && u.isSpecial()) || CR(u.path, ''))
  8805. : nC(l)
  8806. ? '/' == i || ('\\' == i && u.isSpecial()) || CR(u.path, '')
  8807. : ('file' == u.scheme &&
  8808. !u.path.length &&
  8809. eC(l) &&
  8810. (u.host && (u.host = ''), (l = xR(l, 0) + ':')),
  8811. CR(u.path, l)),
  8812. (l = ''),
  8813. 'file' == u.scheme && (i == Yw || '?' == i || '#' == i))
  8814. )
  8815. for (; u.path.length > 1 && '' === u.path[0]; ) AR(u.path);
  8816. '?' == i
  8817. ? ((u.query = ''), (c = EC))
  8818. : '#' == i && ((u.fragment = ''), (c = SC));
  8819. } else l += $R(i, qR);
  8820. break;
  8821. case xC:
  8822. '?' == i
  8823. ? ((u.query = ''), (c = EC))
  8824. : '#' == i
  8825. ? ((u.fragment = ''), (c = SC))
  8826. : i != Yw && (u.path[0] += $R(i, JR));
  8827. break;
  8828. case EC:
  8829. e || '#' != i
  8830. ? i != Yw &&
  8831. ("'" == i && u.isSpecial()
  8832. ? (u.query += '%27')
  8833. : (u.query += '#' == i ? '%23' : $R(i, JR)))
  8834. : ((u.fragment = ''), (c = SC));
  8835. break;
  8836. case SC:
  8837. i != Yw && (u.fragment += $R(i, KR));
  8838. }
  8839. h++;
  8840. }
  8841. },
  8842. parseHost: function (t) {
  8843. var e, r, n;
  8844. if ('[' == xR(t, 0)) {
  8845. if (']' != xR(t, t.length - 1)) return FR;
  8846. if (
  8847. ((e = (function (t) {
  8848. var e,
  8849. r,
  8850. n,
  8851. i,
  8852. o,
  8853. s,
  8854. a,
  8855. u = [0, 0, 0, 0, 0, 0, 0, 0],
  8856. c = 0,
  8857. h = null,
  8858. l = 0,
  8859. d = function () {
  8860. return xR(t, l);
  8861. };
  8862. if (':' == d()) {
  8863. if (':' != xR(t, 1)) return;
  8864. (l += 2), (h = ++c);
  8865. }
  8866. for (; d(); ) {
  8867. if (8 == c) return;
  8868. if (':' != d()) {
  8869. for (e = r = 0; r < 4 && ER(VR, d()); )
  8870. (e = 16 * e + _R(d(), 16)), l++, r++;
  8871. if ('.' == d()) {
  8872. if (0 == r) return;
  8873. if (((l -= r), c > 6)) return;
  8874. for (n = 0; d(); ) {
  8875. if (((i = null), n > 0)) {
  8876. if (!('.' == d() && n < 4)) return;
  8877. l++;
  8878. }
  8879. if (!ER(GR, d())) return;
  8880. for (; ER(GR, d()); ) {
  8881. if (((o = _R(d(), 10)), null === i)) i = o;
  8882. else {
  8883. if (0 == i) return;
  8884. i = 10 * i + o;
  8885. }
  8886. if (i > 255) return;
  8887. l++;
  8888. }
  8889. (u[c] = 256 * u[c] + i), (2 != ++n && 4 != n) || c++;
  8890. }
  8891. if (4 != n) return;
  8892. break;
  8893. }
  8894. if (':' == d()) {
  8895. if ((l++, !d())) return;
  8896. } else if (d()) return;
  8897. u[c++] = e;
  8898. } else {
  8899. if (null !== h) return;
  8900. l++, (h = ++c);
  8901. }
  8902. }
  8903. if (null !== h)
  8904. for (s = c - h, c = 7; 0 != c && s > 0; )
  8905. (a = u[c]), (u[c--] = u[h + s - 1]), (u[h + --s] = a);
  8906. else if (8 != c) return;
  8907. return u;
  8908. })(IR(t, 1, -1))),
  8909. !e)
  8910. )
  8911. return FR;
  8912. this.host = e;
  8913. } else if (this.isSpecial()) {
  8914. if (((t = aR(t)), ER(HR, t))) return FR;
  8915. if (
  8916. ((e = (function (t) {
  8917. var e,
  8918. r,
  8919. n,
  8920. i,
  8921. o,
  8922. s,
  8923. a,
  8924. u = OR(t, '.');
  8925. if (
  8926. (u.length && '' == u[u.length - 1] && u.length--,
  8927. (e = u.length) > 4)
  8928. )
  8929. return t;
  8930. for (r = [], n = 0; n < e; n++) {
  8931. if ('' == (i = u[n])) return t;
  8932. if (
  8933. ((o = 10),
  8934. i.length > 1 &&
  8935. '0' == xR(i, 0) &&
  8936. ((o = ER(UR, i) ? 16 : 8), (i = IR(i, 8 == o ? 1 : 2))),
  8937. '' === i)
  8938. )
  8939. s = 0;
  8940. else {
  8941. if (!ER(10 == o ? XR : 8 == o ? jR : VR, i)) return t;
  8942. s = _R(i, o);
  8943. }
  8944. CR(r, s);
  8945. }
  8946. for (n = 0; n < e; n++)
  8947. if (((s = r[n]), n == e - 1)) {
  8948. if (s >= TR(256, 5 - e)) return null;
  8949. } else if (s > 255) return null;
  8950. for (a = RR(r), n = 0; n < r.length; n++)
  8951. a += r[n] * TR(256, 3 - n);
  8952. return a;
  8953. })(t)),
  8954. null === e)
  8955. )
  8956. return FR;
  8957. this.host = e;
  8958. } else {
  8959. if (ER(WR, t)) return FR;
  8960. for (e = '', r = iR(t), n = 0; n < r.length; n++) e += $R(r[n], JR);
  8961. this.host = e;
  8962. }
  8963. },
  8964. cannotHaveUsernamePasswordPort: function () {
  8965. return !this.host || this.cannotBeABaseURL || 'file' == this.scheme;
  8966. },
  8967. includesCredentials: function () {
  8968. return '' != this.username || '' != this.password;
  8969. },
  8970. isSpecial: function () {
  8971. return rR(tC, this.scheme);
  8972. },
  8973. shortenPath: function () {
  8974. var t = this.path,
  8975. e = t.length;
  8976. !e || ('file' == this.scheme && 1 == e && eC(t[0], !0)) || t.length--;
  8977. },
  8978. serialize: function () {
  8979. var t = this,
  8980. e = t.scheme,
  8981. r = t.username,
  8982. n = t.password,
  8983. i = t.host,
  8984. o = t.port,
  8985. s = t.path,
  8986. a = t.query,
  8987. u = t.fragment,
  8988. c = e + ':';
  8989. return (
  8990. null !== i
  8991. ? ((c += '//'),
  8992. t.includesCredentials() && (c += r + (n ? ':' + n : '') + '@'),
  8993. (c += ZR(i)),
  8994. null !== o && (c += ':' + o))
  8995. : 'file' == e && (c += '//'),
  8996. (c += t.cannotBeABaseURL ? s[0] : s.length ? '/' + SR(s, '/') : ''),
  8997. null !== a && (c += '?' + a),
  8998. null !== u && (c += '#' + u),
  8999. c
  9000. );
  9001. },
  9002. setHref: function (t) {
  9003. var e = this.parse(t);
  9004. if (e) throw gR(e);
  9005. this.searchParams.update();
  9006. },
  9007. getOrigin: function () {
  9008. var t = this.scheme,
  9009. e = this.port;
  9010. if ('blob' == t)
  9011. try {
  9012. return new RC(t.path[0]).origin;
  9013. } catch (t) {
  9014. return 'null';
  9015. }
  9016. return 'file' != t && this.isSpecial()
  9017. ? t + '://' + ZR(this.host) + (null !== e ? ':' + e : '')
  9018. : 'null';
  9019. },
  9020. getProtocol: function () {
  9021. return this.scheme + ':';
  9022. },
  9023. setProtocol: function (t) {
  9024. this.parse(uR(t) + ':', iC);
  9025. },
  9026. getUsername: function () {
  9027. return this.username;
  9028. },
  9029. setUsername: function (t) {
  9030. var e = iR(uR(t));
  9031. if (!this.cannotHaveUsernamePasswordPort()) {
  9032. this.username = '';
  9033. for (var r = 0; r < e.length; r++) this.username += $R(e[r], QR);
  9034. }
  9035. },
  9036. getPassword: function () {
  9037. return this.password;
  9038. },
  9039. setPassword: function (t) {
  9040. var e = iR(uR(t));
  9041. if (!this.cannotHaveUsernamePasswordPort()) {
  9042. this.password = '';
  9043. for (var r = 0; r < e.length; r++) this.password += $R(e[r], QR);
  9044. }
  9045. },
  9046. getHost: function () {
  9047. var t = this.host,
  9048. e = this.port;
  9049. return null === t ? '' : null === e ? ZR(t) : ZR(t) + ':' + e;
  9050. },
  9051. setHost: function (t) {
  9052. this.cannotBeABaseURL || this.parse(t, pC);
  9053. },
  9054. getHostname: function () {
  9055. var t = this.host;
  9056. return null === t ? '' : ZR(t);
  9057. },
  9058. setHostname: function (t) {
  9059. this.cannotBeABaseURL || this.parse(t, vC);
  9060. },
  9061. getPort: function () {
  9062. var t = this.port;
  9063. return null === t ? '' : uR(t);
  9064. },
  9065. setPort: function (t) {
  9066. this.cannotHaveUsernamePasswordPort() ||
  9067. ('' == (t = uR(t)) ? (this.port = null) : this.parse(t, mC));
  9068. },
  9069. getPathname: function () {
  9070. var t = this.path;
  9071. return this.cannotBeABaseURL ? t[0] : t.length ? '/' + SR(t, '/') : '';
  9072. },
  9073. setPathname: function (t) {
  9074. this.cannotBeABaseURL || ((this.path = []), this.parse(t, bC));
  9075. },
  9076. getSearch: function () {
  9077. var t = this.query;
  9078. return t ? '?' + t : '';
  9079. },
  9080. setSearch: function (t) {
  9081. '' == (t = uR(t))
  9082. ? (this.query = null)
  9083. : ('?' == xR(t, 0) && (t = IR(t, 1)),
  9084. (this.query = ''),
  9085. this.parse(t, EC)),
  9086. this.searchParams.update();
  9087. },
  9088. getSearchParams: function () {
  9089. return this.searchParams.facade;
  9090. },
  9091. getHash: function () {
  9092. var t = this.fragment;
  9093. return t ? '#' + t : '';
  9094. },
  9095. setHash: function (t) {
  9096. '' != (t = uR(t))
  9097. ? ('#' == xR(t, 0) && (t = IR(t, 1)),
  9098. (this.fragment = ''),
  9099. this.parse(t, SC))
  9100. : (this.fragment = null);
  9101. },
  9102. update: function () {
  9103. this.query = this.searchParams.serialize() || null;
  9104. },
  9105. };
  9106. var RC = function (t) {
  9107. var e = eR(this, CC),
  9108. r = hR(arguments.length, 1) > 1 ? arguments[1] : void 0,
  9109. n = fR(e, new wC(t, !1, r));
  9110. Zw ||
  9111. ((e.href = n.serialize()),
  9112. (e.origin = n.getOrigin()),
  9113. (e.protocol = n.getProtocol()),
  9114. (e.username = n.getUsername()),
  9115. (e.password = n.getPassword()),
  9116. (e.host = n.getHost()),
  9117. (e.hostname = n.getHostname()),
  9118. (e.port = n.getPort()),
  9119. (e.pathname = n.getPathname()),
  9120. (e.search = n.getSearch()),
  9121. (e.searchParams = n.getSearchParams()),
  9122. (e.hash = n.getHash()));
  9123. },
  9124. CC = RC.prototype,
  9125. PC = function (t, e) {
  9126. return {
  9127. get: function () {
  9128. return pR(this)[t]();
  9129. },
  9130. set:
  9131. e &&
  9132. function (t) {
  9133. return pR(this)[e](t);
  9134. },
  9135. configurable: !0,
  9136. enumerable: !0,
  9137. };
  9138. };
  9139. if (
  9140. (Zw &&
  9141. (tR(CC, 'href', PC('serialize', 'setHref')),
  9142. tR(CC, 'origin', PC('getOrigin')),
  9143. tR(CC, 'protocol', PC('getProtocol', 'setProtocol')),
  9144. tR(CC, 'username', PC('getUsername', 'setUsername')),
  9145. tR(CC, 'password', PC('getPassword', 'setPassword')),
  9146. tR(CC, 'host', PC('getHost', 'setHost')),
  9147. tR(CC, 'hostname', PC('getHostname', 'setHostname')),
  9148. tR(CC, 'port', PC('getPort', 'setPort')),
  9149. tR(CC, 'pathname', PC('getPathname', 'setPathname')),
  9150. tR(CC, 'search', PC('getSearch', 'setSearch')),
  9151. tR(CC, 'searchParams', PC('getSearchParams')),
  9152. tR(CC, 'hash', PC('getHash', 'setHash'))),
  9153. $w(
  9154. CC,
  9155. 'toJSON',
  9156. function () {
  9157. return pR(this).serialize();
  9158. },
  9159. { enumerable: !0 }
  9160. ),
  9161. $w(
  9162. CC,
  9163. 'toString',
  9164. function () {
  9165. return pR(this).serialize();
  9166. },
  9167. { enumerable: !0 }
  9168. ),
  9169. yR)
  9170. ) {
  9171. var AC = yR.createObjectURL,
  9172. OC = yR.revokeObjectURL;
  9173. AC && $w(RC, 'createObjectURL', qw(AC, yR)),
  9174. OC && $w(RC, 'revokeObjectURL', qw(OC, yR));
  9175. }
  9176. cR(RC, 'URL'),
  9177. zw({ global: !0, constructor: !0, forced: !Jw, sham: !Zw }, { URL: RC });
  9178. var IC = rt.URL;
  9179. function MC(t, e, r) {
  9180. var n = void 0 === e ? null : e,
  9181. i = (function (t, e) {
  9182. var r = atob(t);
  9183. if (e) {
  9184. for (
  9185. var n = new Uint8Array(r.length), i = 0, o = r.length;
  9186. i < o;
  9187. ++i
  9188. )
  9189. n[i] = r.charCodeAt(i);
  9190. return String.fromCharCode.apply(null, new Uint16Array(n.buffer));
  9191. }
  9192. return r;
  9193. })(t, void 0 !== r && r),
  9194. o = i.indexOf('\n', 10) + 1,
  9195. s = i.substring(o) + (n ? '//# sourceMappingURL=' + n : ''),
  9196. a = new Blob([s], { type: 'application/javascript' });
  9197. return URL.createObjectURL(a);
  9198. }
  9199. var DC = (function (t, e, r) {
  9200. var n;
  9201. return function (i) {
  9202. return (n = n || MC(t, e, r)), new Worker(n, i);
  9203. };
  9204. })(
  9205. 'Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwp2YXIgd29ya2VyX2NvZGU9ZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9InVuZGVmaW5lZCIhPXR5cGVvZiBnbG9iYWxUaGlzP2dsb2JhbFRoaXM6InVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3c/d2luZG93OiJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsP2dsb2JhbDoidW5kZWZpbmVkIiE9dHlwZW9mIHNlbGY/c2VsZjp7fSxlPWZ1bmN0aW9uKHQpe3JldHVybiB0JiZ0Lk1hdGg9PU1hdGgmJnR9LG49ZSgib2JqZWN0Ij09dHlwZW9mIGdsb2JhbFRoaXMmJmdsb2JhbFRoaXMpfHxlKCJvYmplY3QiPT10eXBlb2Ygd2luZG93JiZ3aW5kb3cpfHxlKCJvYmplY3QiPT10eXBlb2Ygc2VsZiYmc2VsZil8fGUoIm9iamVjdCI9PXR5cGVvZiB0JiZ0KXx8ZnVuY3Rpb24oKXtyZXR1cm4gdGhpc30oKXx8RnVuY3Rpb24oInJldHVybiB0aGlzIikoKSxyPWZ1bmN0aW9uKHQpe3RyeXtyZXR1cm4hIXQoKX1jYXRjaCh0KXtyZXR1cm4hMH19LG89IXIoKGZ1bmN0aW9uKCl7dmFyIHQ9ZnVuY3Rpb24oKXt9LmJpbmQoKTtyZXR1cm4iZnVuY3Rpb24iIT10eXBlb2YgdHx8dC5oYXNPd25Qcm9wZXJ0eSgicHJvdG90eXBlIil9KSksaT1vLHU9RnVuY3Rpb24ucHJvdG90eXBlLGM9dS5hcHBseSxhPXUuY2FsbCxmPSJvYmplY3QiPT10eXBlb2YgUmVmbGVjdCYmUmVmbGVjdC5hcHBseXx8KGk/YS5iaW5kKGMpOmZ1bmN0aW9uKCl7cmV0dXJuIGEuYXBwbHkoYyxhcmd1bWVudHMpfSksbD1vLHA9RnVuY3Rpb24ucHJvdG90eXBlLHM9cC5jYWxsLGI9bCYmcC5iaW5kLmJpbmQocyxzKSx5PWw/YjpmdW5jdGlvbih0KXtyZXR1cm4gZnVuY3Rpb24oKXtyZXR1cm4gcy5hcHBseSh0LGFyZ3VtZW50cyl9fSx2PXksZD12KHt9LnRvU3RyaW5nKSxoPXYoIiIuc2xpY2UpLG09ZnVuY3Rpb24odCl7cmV0dXJuIGgoZCh0KSw4LC0xKX0sZz1tLHc9eSxqPWZ1bmN0aW9uKHQpe2lmKCJGdW5jdGlvbiI9PT1nKHQpKXJldHVybiB3KHQpfSxTPSJvYmplY3QiPT10eXBlb2YgZG9jdW1lbnQmJmRvY3VtZW50LmFsbCxPPXthbGw6UyxJU19IVE1MRERBOnZvaWQgMD09PVMmJnZvaWQgMCE9PVN9LFQ9Ty5hbGwsRT1PLklTX0hUTUxEREE/ZnVuY3Rpb24odCl7cmV0dXJuImZ1bmN0aW9uIj09dHlwZW9mIHR8fHQ9PT1UfTpmdW5jdGlvbih0KXtyZXR1cm4iZnVuY3Rpb24iPT10eXBlb2YgdH0sUD17fSxJPSFyKChmdW5jdGlvbigpe3JldHVybiA3IT1PYmplY3QuZGVmaW5lUHJvcGVydHkoe30sMSx7Z2V0OmZ1bmN0aW9uKCl7cmV0dXJuIDd9fSlbMV19KSksRD1vLF89RnVuY3Rpb24ucHJvdG90eXBlLmNhbGwsTD1EP18uYmluZChfKTpmdW5jdGlvbigpe3JldHVybiBfLmFwcGx5KF8sYXJndW1lbnRzKX0saz17fSxNPXt9LnByb3BlcnR5SXNFbnVtZXJhYmxlLEM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcixGPUMmJiFNLmNhbGwoezE6Mn0sMSk7ay5mPUY/ZnVuY3Rpb24odCl7dmFyIGU9Qyh0aGlzLHQpO3JldHVybiEhZSYmZS5lbnVtZXJhYmxlfTpNO3ZhciBBLHosTj1mdW5jdGlvbih0LGUpe3JldHVybntlbnVtZXJhYmxlOiEoMSZ0KSxjb25maWd1cmFibGU6ISgyJnQpLHdyaXRhYmxlOiEoNCZ0KSx2YWx1ZTplfX0seD1yLEg9bSxSPU9iamVjdCxHPWooIiIuc3BsaXQpLFY9eCgoZnVuY3Rpb24oKXtyZXR1cm4hUigieiIpLnByb3BlcnR5SXNFbnVtZXJhYmxlKDApfSkpP2Z1bmN0aW9uKHQpe3JldHVybiJTdHJpbmciPT1IKHQpP0codCwiIik6Uih0KX06UixZPWZ1bmN0aW9uKHQpe3JldHVybiBudWxsPT10fSxxPVksQj1UeXBlRXJyb3IsSj1mdW5jdGlvbih0KXtpZihxKHQpKXRocm93IEIoIkNhbid0IGNhbGwgbWV0aG9kIG9uICIrdCk7cmV0dXJuIHR9LEs9VixRPUosVT1FLFc9Ty5hbGwsWD1PLklTX0hUTUxEREE/ZnVuY3Rpb24odCl7cmV0dXJuIm9iamVjdCI9PXR5cGVvZiB0P251bGwhPT10OlUodCl8fHQ9PT1XfTpmdW5jdGlvbih0KXtyZXR1cm4ib2JqZWN0Ij09dHlwZW9mIHQ/bnVsbCE9PXQ6VSh0KX0sWj17fSwkPVosdHQ9bixldD1FLG50PWZ1bmN0aW9uKHQpe3JldHVybiBldCh0KT90OnZvaWQgMH0scnQ9ZnVuY3Rpb24odCxlKXtyZXR1cm4gYXJndW1lbnRzLmxlbmd0aDwyP250KCRbdF0pfHxudCh0dFt0XSk6JFt0XSYmJFt0XVtlXXx8dHRbdF0mJnR0W3RdW2VdfSxvdD1qKHt9LmlzUHJvdG90eXBlT2YpLGl0PXJ0KCJuYXZpZ2F0b3IiLCJ1c2VyQWdlbnQiKXx8IiIsdXQ9bixjdD1pdCxhdD11dC5wcm9jZXNzLGZ0PXV0LkRlbm8sbHQ9YXQmJmF0LnZlcnNpb25zfHxmdCYmZnQudmVyc2lvbixwdD1sdCYmbHQudjg7cHQmJih6PShBPXB0LnNwbGl0KCIuIikpWzBdPjAmJkFbMF08ND8xOisoQVswXStBWzFdKSksIXomJmN0JiYoIShBPWN0Lm1hdGNoKC9FZGdlXC8oXGQrKS8pKXx8QVsxXT49NzQpJiYoQT1jdC5tYXRjaCgvQ2hyb21lXC8oXGQrKS8pKSYmKHo9K0FbMV0pO3ZhciBzdD16LGJ0PXIseXQ9ISFPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzJiYhYnQoKGZ1bmN0aW9uKCl7dmFyIHQ9U3ltYm9sKCk7cmV0dXJuIVN0cmluZyh0KXx8IShPYmplY3QodClpbnN0YW5jZW9mIFN5bWJvbCl8fCFTeW1ib2wuc2hhbSYmc3QmJnN0PDQxfSkpLHZ0PXl0JiYhU3ltYm9sLnNoYW0mJiJzeW1ib2wiPT10eXBlb2YgU3ltYm9sLml0ZXJhdG9yLGR0PXJ0LGh0PUUsbXQ9b3QsZ3Q9T2JqZWN0LHd0PXZ0P2Z1bmN0aW9uKHQpe3JldHVybiJzeW1ib2wiPT10eXBlb2YgdH06ZnVuY3Rpb24odCl7dmFyIGU9ZHQoIlN5bWJvbCIpO3JldHVybiBodChlKSYmbXQoZS5wcm90b3R5cGUsZ3QodCkpfSxqdD1TdHJpbmcsU3Q9RSxPdD1mdW5jdGlvbih0KXt0cnl7cmV0dXJuIGp0KHQpfWNhdGNoKHQpe3JldHVybiJPYmplY3QifX0sVHQ9VHlwZUVycm9yLEV0PWZ1bmN0aW9uKHQpe2lmKFN0KHQpKXJldHVybiB0O3Rocm93IFR0KE90KHQpKyIgaXMgbm90IGEgZnVuY3Rpb24iKX0sUHQ9RXQsSXQ9WSxEdD1MLF90PUUsTHQ9WCxrdD1UeXBlRXJyb3IsTXQ9e2V4cG9ydHM6e319LEN0PW4sRnQ9T2JqZWN0LmRlZmluZVByb3BlcnR5LEF0PWZ1bmN0aW9uKHQsZSl7dHJ5e0Z0KEN0LHQse3ZhbHVlOmUsY29uZmlndXJhYmxlOiEwLHdyaXRhYmxlOiEwfSl9Y2F0Y2gobil7Q3RbdF09ZX1yZXR1cm4gZX0senQ9Il9fY29yZS1qc19zaGFyZWRfXyIsTnQ9blt6dF18fEF0KHp0LHt9KTsoTXQuZXhwb3J0cz1mdW5jdGlvbih0LGUpe3JldHVybiBOdFt0XXx8KE50W3RdPXZvaWQgMCE9PWU/ZTp7fSl9KSgidmVyc2lvbnMiLFtdKS5wdXNoKHt2ZXJzaW9uOiIzLjI2LjAiLG1vZGU6InB1cmUiLGNvcHlyaWdodDoiwqkgMjAxNC0yMDIyIERlbmlzIFB1c2hrYXJldiAoemxvaXJvY2sucnUpIixsaWNlbnNlOiJodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcy9ibG9iL3YzLjI2LjAvTElDRU5TRSIsc291cmNlOiJodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcyJ9KTt2YXIgeHQ9SixIdD1PYmplY3QsUnQ9ZnVuY3Rpb24odCl7cmV0dXJuIEh0KHh0KHQpKX0sR3Q9aih7fS5oYXNPd25Qcm9wZXJ0eSksVnQ9T2JqZWN0Lmhhc093bnx8ZnVuY3Rpb24odCxlKXtyZXR1cm4gR3QoUnQodCksZSl9LFl0PWoscXQ9MCxCdD1NYXRoLnJhbmRvbSgpLEp0PVl0KDEuLnRvU3RyaW5nKSxLdD1uLFF0PU10LmV4cG9ydHMsVXQ9VnQsV3Q9ZnVuY3Rpb24odCl7cmV0dXJuIlN5bWJvbCgiKyh2b2lkIDA9PT10PyIiOnQpKyIpXyIrSnQoKytxdCtCdCwzNil9LFh0PXl0LFp0PXZ0LCR0PVF0KCJ3a3MiKSx0ZT1LdC5TeW1ib2wsZWU9dGUmJnRlLmZvcixuZT1adD90ZTp0ZSYmdGUud2l0aG91dFNldHRlcnx8V3QscmU9TCxvZT1YLGllPXd0LHVlPWZ1bmN0aW9uKHQsZSl7dmFyIG49dFtlXTtyZXR1cm4gSXQobik/dm9pZCAwOlB0KG4pfSxjZT1mdW5jdGlvbih0LGUpe3ZhciBuLHI7aWYoInN0cmluZyI9PT1lJiZfdChuPXQudG9TdHJpbmcpJiYhTHQocj1EdChuLHQpKSlyZXR1cm4gcjtpZihfdChuPXQudmFsdWVPZikmJiFMdChyPUR0KG4sdCkpKXJldHVybiByO2lmKCJzdHJpbmciIT09ZSYmX3Qobj10LnRvU3RyaW5nKSYmIUx0KHI9RHQobix0KSkpcmV0dXJuIHI7dGhyb3cga3QoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfSxhZT1UeXBlRXJyb3IsZmU9ZnVuY3Rpb24odCl7aWYoIVV0KCR0LHQpfHwhWHQmJiJzdHJpbmciIT10eXBlb2YgJHRbdF0pe3ZhciBlPSJTeW1ib2wuIit0O1h0JiZVdCh0ZSx0KT8kdFt0XT10ZVt0XTokdFt0XT1adCYmZWU/ZWUoZSk6bmUoZSl9cmV0dXJuICR0W3RdfSgidG9QcmltaXRpdmUiKSxsZT1mdW5jdGlvbih0LGUpe2lmKCFvZSh0KXx8aWUodCkpcmV0dXJuIHQ7dmFyIG4scj11ZSh0LGZlKTtpZihyKXtpZih2b2lkIDA9PT1lJiYoZT0iZGVmYXVsdCIpLG49cmUocix0LGUpLCFvZShuKXx8aWUobikpcmV0dXJuIG47dGhyb3cgYWUoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfXJldHVybiB2b2lkIDA9PT1lJiYoZT0ibnVtYmVyIiksY2UodCxlKX0scGU9d3Qsc2U9ZnVuY3Rpb24odCl7dmFyIGU9bGUodCwic3RyaW5nIik7cmV0dXJuIHBlKGUpP2U6ZSsiIn0sYmU9WCx5ZT1uLmRvY3VtZW50LHZlPWJlKHllKSYmYmUoeWUuY3JlYXRlRWxlbWVudCksZGU9ZnVuY3Rpb24odCl7cmV0dXJuIHZlP3llLmNyZWF0ZUVsZW1lbnQodCk6e319LGhlPSFJJiYhcigoZnVuY3Rpb24oKXtyZXR1cm4gNyE9T2JqZWN0LmRlZmluZVByb3BlcnR5KGRlKCJkaXYiKSwiYSIse2dldDpmdW5jdGlvbigpe3JldHVybiA3fX0pLmF9KSksbWU9SSxnZT1MLHdlPWssamU9TixTZT1mdW5jdGlvbih0KXtyZXR1cm4gSyhRKHQpKX0sT2U9c2UsVGU9VnQsRWU9aGUsUGU9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtQLmY9bWU/UGU6ZnVuY3Rpb24odCxlKXtpZih0PVNlKHQpLGU9T2UoZSksRWUpdHJ5e3JldHVybiBQZSh0LGUpfWNhdGNoKHQpe31pZihUZSh0LGUpKXJldHVybiBqZSghZ2Uod2UuZix0LGUpLHRbZV0pfTt2YXIgSWU9cixEZT1FLF9lPS8jfFwucHJvdG90eXBlXC4vLExlPWZ1bmN0aW9uKHQsZSl7dmFyIG49TWVba2UodCldO3JldHVybiBuPT1GZXx8biE9Q2UmJihEZShlKT9JZShlKTohIWUpfSxrZT1MZS5ub3JtYWxpemU9ZnVuY3Rpb24odCl7cmV0dXJuIFN0cmluZyh0KS5yZXBsYWNlKF9lLCIuIikudG9Mb3dlckNhc2UoKX0sTWU9TGUuZGF0YT17fSxDZT1MZS5OQVRJVkU9Ik4iLEZlPUxlLlBPTFlGSUxMPSJQIixBZT1MZSx6ZT1FdCxOZT1vLHhlPWooai5iaW5kKSxIZT17fSxSZT1JJiZyKChmdW5jdGlvbigpe3JldHVybiA0MiE9T2JqZWN0LmRlZmluZVByb3BlcnR5KChmdW5jdGlvbigpe30pLCJwcm90b3R5cGUiLHt2YWx1ZTo0Mix3cml0YWJsZTohMX0pLnByb3RvdHlwZX0pKSxHZT1YLFZlPVN0cmluZyxZZT1UeXBlRXJyb3IscWU9SSxCZT1oZSxKZT1SZSxLZT1mdW5jdGlvbih0KXtpZihHZSh0KSlyZXR1cm4gdDt0aHJvdyBZZShWZSh0KSsiIGlzIG5vdCBhbiBvYmplY3QiKX0sUWU9c2UsVWU9VHlwZUVycm9yLFdlPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxYZT1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yLFplPSJlbnVtZXJhYmxlIiwkZT0iY29uZmlndXJhYmxlIix0bj0id3JpdGFibGUiO0hlLmY9cWU/SmU/ZnVuY3Rpb24odCxlLG4pe2lmKEtlKHQpLGU9UWUoZSksS2UobiksImZ1bmN0aW9uIj09dHlwZW9mIHQmJiJwcm90b3R5cGUiPT09ZSYmInZhbHVlImluIG4mJnRuIGluIG4mJiFuLndyaXRhYmxlKXt2YXIgcj1YZSh0LGUpO3ImJnIud3JpdGFibGUmJih0W2VdPW4udmFsdWUsbj17Y29uZmlndXJhYmxlOiRlIGluIG4/bi5jb25maWd1cmFibGU6ci5jb25maWd1cmFibGUsZW51bWVyYWJsZTpaZSBpbiBuP24uZW51bWVyYWJsZTpyLmVudW1lcmFibGUsd3JpdGFibGU6ITF9KX1yZXR1cm4gV2UodCxlLG4pfTpXZTpmdW5jdGlvbih0LGUsbil7aWYoS2UodCksZT1RZShlKSxLZShuKSxCZSl0cnl7cmV0dXJuIFdlKHQsZSxuKX1jYXRjaCh0KXt9aWYoImdldCJpbiBufHwic2V0ImluIG4pdGhyb3cgVWUoIkFjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIik7cmV0dXJuInZhbHVlImluIG4mJih0W2VdPW4udmFsdWUpLHR9O3ZhciBlbj1IZSxubj1OLHJuPUk/ZnVuY3Rpb24odCxlLG4pe3JldHVybiBlbi5mKHQsZSxubigxLG4pKX06ZnVuY3Rpb24odCxlLG4pe3JldHVybiB0W2VdPW4sdH0sb249bix1bj1mLGNuPWosYW49RSxmbj1QLmYsbG49QWUscG49Wixzbj1mdW5jdGlvbih0LGUpe3JldHVybiB6ZSh0KSx2b2lkIDA9PT1lP3Q6TmU/eGUodCxlKTpmdW5jdGlvbigpe3JldHVybiB0LmFwcGx5KGUsYXJndW1lbnRzKX19LGJuPXJuLHluPVZ0LHZuPWZ1bmN0aW9uKHQpe3ZhciBlPWZ1bmN0aW9uKG4scixvKXtpZih0aGlzIGluc3RhbmNlb2YgZSl7c3dpdGNoKGFyZ3VtZW50cy5sZW5ndGgpe2Nhc2UgMDpyZXR1cm4gbmV3IHQ7Y2FzZSAxOnJldHVybiBuZXcgdChuKTtjYXNlIDI6cmV0dXJuIG5ldyB0KG4scil9cmV0dXJuIG5ldyB0KG4scixvKX1yZXR1cm4gdW4odCx0aGlzLGFyZ3VtZW50cyl9O3JldHVybiBlLnByb3RvdHlwZT10LnByb3RvdHlwZSxlfSxkbj1mdW5jdGlvbih0LGUpe3ZhciBuLHIsbyxpLHUsYyxhLGYsbD10LnRhcmdldCxwPXQuZ2xvYmFsLHM9dC5zdGF0LGI9dC5wcm90byx5PXA/b246cz9vbltsXToob25bbF18fHt9KS5wcm90b3R5cGUsdj1wP3BuOnBuW2xdfHxibihwbixsLHt9KVtsXSxkPXYucHJvdG90eXBlO2ZvcihvIGluIGUpbj0hbG4ocD9vOmwrKHM/Ii4iOiIjIikrbyx0LmZvcmNlZCkmJnkmJnluKHksbyksdT12W29dLG4mJihjPXQuZG9udENhbGxHZXRTZXQ/KGY9Zm4oeSxvKSkmJmYudmFsdWU6eVtvXSksaT1uJiZjP2M6ZVtvXSxuJiZ0eXBlb2YgdT09dHlwZW9mIGl8fChhPXQuYmluZCYmbj9zbihpLG9uKTp0LndyYXAmJm4/dm4oaSk6YiYmYW4oaSk/Y24oaSk6aSwodC5zaGFtfHxpJiZpLnNoYW18fHUmJnUuc2hhbSkmJmJuKGEsInNoYW0iLCEwKSxibih2LG8sYSksYiYmKHluKHBuLHI9bCsiUHJvdG90eXBlIil8fGJuKHBuLHIse30pLGJuKHBuW3JdLG8saSksdC5yZWFsJiZkJiYhZFtvXSYmYm4oZCxvLGkpKSl9LGhuPWooW10uc2xpY2UpLG1uPVR5cGVFcnJvcixnbj1uLHduPWYsam49RSxTbj1obixPbj1mdW5jdGlvbih0LGUpe2lmKHQ8ZSl0aHJvdyBtbigiTm90IGVub3VnaCBhcmd1bWVudHMiKTtyZXR1cm4gdH0sVG49L01TSUUgLlwuLy50ZXN0KGl0KSxFbj1nbi5GdW5jdGlvbixQbj1mdW5jdGlvbih0KXtyZXR1cm4gVG4/ZnVuY3Rpb24oZSxuKXt2YXIgcj1Pbihhcmd1bWVudHMubGVuZ3RoLDEpPjIsbz1qbihlKT9lOkVuKGUpLGk9cj9Tbihhcmd1bWVudHMsMik6dm9pZCAwO3JldHVybiB0KHI/ZnVuY3Rpb24oKXt3bihvLHRoaXMsaSl9Om8sbil9OnR9LEluPXtzZXRUaW1lb3V0OlBuKGduLnNldFRpbWVvdXQpLHNldEludGVydmFsOlBuKGduLnNldEludGVydmFsKX0sRG49SW4uc2V0SW50ZXJ2YWw7ZG4oe2dsb2JhbDohMCxiaW5kOiEwLGZvcmNlZDpuLnNldEludGVydmFsIT09RG59LHtzZXRJbnRlcnZhbDpEbn0pO3ZhciBfbj1Jbi5zZXRUaW1lb3V0O2RuKHtnbG9iYWw6ITAsYmluZDohMCxmb3JjZWQ6bi5zZXRUaW1lb3V0IT09X259LHtzZXRUaW1lb3V0Ol9ufSk7dmFyIExuPVouc2V0SW50ZXJ2YWwsa249ITEsTW49bnVsbDtzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLChmdW5jdGlvbih0KXt2YXIgZT10LmRhdGEsbj1lLnR5cGUscj1lLmRhdGE7c3dpdGNoKG4pe2Nhc2Uic3RhcnQiOmtufHwoa249ITAsTW49TG4oKGZ1bmN0aW9uKCl7a249ITEsc2VsZi5wb3N0TWVzc2FnZSgidGljayIpfSksci50aW1lKSk7YnJlYWs7Y2FzZSJzdG9wIjpjbGVhckludGVydmFsKE1uKSxrbj0hMX19KSwhMSk7cmV0dXJue319KCk7Cgo=',
  9206. null,
  9207. !1
  9208. ),
  9209. LC = function () {
  9210. return new DC();
  9211. },
  9212. FC = Yf('stream:media'),
  9213. NC = (function () {
  9214. function t() {
  9215. var t, e, r, n;
  9216. (this.mediaStream = null),
  9217. (this.videoEl = null),
  9218. (this.canvasEl = null),
  9219. (this.canvasContext = null),
  9220. (this.audioContext = null),
  9221. (this.audioSource = null),
  9222. (this.worker = null),
  9223. (this.config = null),
  9224. (this.promise = null),
  9225. (this.onVideoError = lh((t = this.onVideoError)).call(t, this)),
  9226. (this.onPause = lh((e = this.onPause)).call(e, this)),
  9227. (this.onVideoPlay = lh((r = this.onVideoPlay)).call(r, this)),
  9228. (this.renderCanvas = lh((n = this.renderCanvas)).call(n, this));
  9229. }
  9230. return (
  9231. (t.prototype.start = function (t) {
  9232. var e = this,
  9233. r = t.video,
  9234. n = t.audio,
  9235. i = t.fileSource;
  9236. return (
  9237. (this.config = t),
  9238. new zx(function (t, o) {
  9239. if (((e.promise = { resolve: t, reject: o }), e.mediaStream))
  9240. return FC('stream is existed'), void t(e.mediaStream);
  9241. e.videoEl || (e.videoEl = gy()),
  9242. (e.videoEl.muted = !n),
  9243. r &&
  9244. !e.canvasEl &&
  9245. ((e.canvasEl = document.createElement('canvas')),
  9246. (e.canvasContext = e.canvasEl.getContext('2d', {
  9247. desynchronized: !0,
  9248. willReadFrequently: !0,
  9249. }))),
  9250. r && !e.worker && (e.worker = LC()),
  9251. n && !e.audioContext && (e.audioContext = yy());
  9252. var s = i instanceof File ? IC.createObjectURL(i) : i;
  9253. e.playVideo(s);
  9254. })
  9255. );
  9256. }),
  9257. (t.prototype.stop = function () {
  9258. var t;
  9259. this.mediaStream
  9260. ? (this.destroy(),
  9261. Ph((t = this.mediaStream.getTracks())).call(t, function (t) {
  9262. t.stop();
  9263. }),
  9264. (this.mediaStream = null))
  9265. : FC('stream is not existed');
  9266. }),
  9267. (t.prototype.getResolution = function () {
  9268. if (!this.mediaStream) return null;
  9269. var t = this.mediaStream.getVideoTracks();
  9270. if (0 === t.length) return null;
  9271. var e = t[0].getSettings(),
  9272. r = e.width,
  9273. n = e.height;
  9274. return {
  9275. width: null != r ? r : this.canvasEl.width,
  9276. height: null != n ? n : this.canvasEl.height,
  9277. };
  9278. }),
  9279. (t.prototype.getRenderView = function () {
  9280. return this.canvasEl;
  9281. }),
  9282. (t.prototype.getRenderElement = function () {
  9283. return this.videoEl;
  9284. }),
  9285. (t.prototype.onVideoError = function () {
  9286. this.videoEl.error &&
  9287. (FC('play video error', this.videoEl.error),
  9288. this.promise.reject(this.videoEl.error));
  9289. }),
  9290. (t.prototype.onPause = function () {
  9291. var t = this;
  9292. FC('video is paused, try to resume'),
  9293. cd(function () {
  9294. t.videoEl.play();
  9295. }, 50);
  9296. }),
  9297. (t.prototype.onVideoPlay = function () {
  9298. if (!this.mediaStream) {
  9299. this.videoEl.removeEventListener('timeupdate', this.onVideoPlay);
  9300. var t = this.config,
  9301. e = t.video,
  9302. r = t.audio,
  9303. n = null,
  9304. i = null;
  9305. if (e) {
  9306. var o = e.frameRate;
  9307. this.renderCanvas(), FC('start render canvas');
  9308. try {
  9309. n = this.canvasEl.captureStream(o);
  9310. } catch (t) {
  9311. return (
  9312. FC('get video stream error, '.concat(t.toString())),
  9313. void this.promise.reject(t)
  9314. );
  9315. }
  9316. }
  9317. if (r)
  9318. try {
  9319. this.audioSource ||
  9320. (this.audioSource =
  9321. this.audioContext.createMediaElementSource(this.videoEl));
  9322. var s = this.audioContext.createMediaStreamDestination();
  9323. this.audioSource.connect(s), (i = s.stream);
  9324. } catch (t) {
  9325. return (
  9326. FC('get audio stream error, '.concat(t.toString())),
  9327. void this.promise.reject(t)
  9328. );
  9329. }
  9330. if (n || i) {
  9331. var a,
  9332. u = new MediaStream();
  9333. Ph((a = [n, i])).call(a, function (t) {
  9334. var e,
  9335. r,
  9336. n =
  9337. null ===
  9338. (r =
  9339. null === (e = null == t ? void 0 : t.getTracks) ||
  9340. void 0 === e
  9341. ? void 0
  9342. : e.call(t)) || void 0 === r
  9343. ? void 0
  9344. : r[0];
  9345. n && u.addTrack(n);
  9346. }),
  9347. (this.mediaStream = u),
  9348. this.promise.resolve(u);
  9349. }
  9350. }
  9351. }),
  9352. (t.prototype.renderCanvas = function () {
  9353. if (this.canvasEl) {
  9354. var t = this.config.video.resolution,
  9355. e = this.videoEl,
  9356. r = t.width,
  9357. n = t.height,
  9358. i = e.videoWidth,
  9359. o = e.videoHeight,
  9360. s = null,
  9361. a = null;
  9362. 0 === i || 0 === o
  9363. ? ((s = r), (a = n))
  9364. : r / n < i / o
  9365. ? ((s = r), (a = (r * o) / i))
  9366. : ((s = (n * i) / o), (a = n)),
  9367. (this.canvasEl.width = s),
  9368. (this.canvasEl.height = a);
  9369. var u = this.canvasContext;
  9370. null == u || u.clearRect(0, 0, s, a),
  9371. null == u || u.fillRect(0, 0, s, a),
  9372. null == u || u.drawImage(e, 0, 0, i, o, 0, 0, s, a),
  9373. this.requestAnimationFrameWrapper(this.renderCanvas);
  9374. } else FC('canvas destroy, render canvas stop');
  9375. }),
  9376. (t.prototype.setWorkerInterval = function (t, e) {
  9377. var r,
  9378. n,
  9379. i = this;
  9380. null === (r = this.worker) ||
  9381. void 0 === r ||
  9382. r.addEventListener('message', t),
  9383. null === (n = this.worker) ||
  9384. void 0 === n ||
  9385. n.postMessage({ type: 'start', data: { time: e } });
  9386. return function () {
  9387. var e, r;
  9388. null === (e = i.worker) ||
  9389. void 0 === e ||
  9390. e.postMessage({ type: 'stop' }),
  9391. null === (r = i.worker) ||
  9392. void 0 === r ||
  9393. r.removeEventListener('message', t);
  9394. };
  9395. }),
  9396. (t.prototype.requestAnimationFrameWrapper = function (t) {
  9397. var e = this.config.video.frameRate,
  9398. r = !1,
  9399. n = this.setWorkerInterval(function () {
  9400. !r && document.hidden && ((r = !0), n(), t());
  9401. }, 1e3 / e);
  9402. requestAnimationFrame(function () {
  9403. r || ((r = !0), n(), t());
  9404. });
  9405. }),
  9406. (t.prototype.playVideo = function (t) {
  9407. return Ed(this, void 0, void 0, function () {
  9408. var e, r;
  9409. return Sd(this, function (n) {
  9410. switch (n.label) {
  9411. case 0:
  9412. (e = this.videoEl).addEventListener(
  9413. 'error',
  9414. this.onVideoError
  9415. ),
  9416. e.addEventListener('pause', this.onPause),
  9417. e.addEventListener('timeupdate', this.onVideoPlay),
  9418. (e.src = t),
  9419. (n.label = 1);
  9420. case 1:
  9421. return n.trys.push([1, 3, , 4]), [4, e.play()];
  9422. case 2:
  9423. return n.sent(), FC('play ok'), [3, 4];
  9424. case 3:
  9425. return (
  9426. (r = n.sent()),
  9427. FC('play failed, '.concat(r.toString())),
  9428. this.promise.reject(r),
  9429. this.destroy(),
  9430. [3, 4]
  9431. );
  9432. case 4:
  9433. return [2];
  9434. }
  9435. });
  9436. });
  9437. }),
  9438. (t.prototype.destroy = function () {
  9439. var t,
  9440. e = this.videoEl;
  9441. e.removeEventListener('error', this.onVideoError),
  9442. e.removeEventListener('pause', this.onPause),
  9443. e.removeEventListener('timeupdate', this.onVideoPlay),
  9444. this.canvasEl &&
  9445. ((this.canvasContext = null), (this.canvasEl = null));
  9446. var r = e.src;
  9447. e.pause(),
  9448. (e.src = ''),
  9449. e.removeAttribute('src'),
  9450. e.load(),
  9451. r &&
  9452. this.config.fileSource instanceof File &&
  9453. IC.revokeObjectURL(r),
  9454. (this.config = null),
  9455. (this.promise = null),
  9456. this.audioSource &&
  9457. (this.audioSource.disconnect(), (this.audioSource = null)),
  9458. window.TXLiveAudioContext ||
  9459. (null === (t = this.audioContext) || void 0 === t || t.close(),
  9460. (this.audioContext = null)),
  9461. this.worker && (this.worker.terminate(), (this.worker = null)),
  9462. this.videoEl && (this.videoEl.remove(), (this.videoEl = null));
  9463. }),
  9464. t
  9465. );
  9466. })(),
  9467. kC = Yf('stream:image'),
  9468. BC = (function () {
  9469. function t() {
  9470. var t, e;
  9471. (this.mediaStream = null),
  9472. (this.imageEl = null),
  9473. (this.canvasEl = null),
  9474. (this.canvasContext = null),
  9475. (this.worker = null),
  9476. (this.config = null),
  9477. (this.promise = null),
  9478. (this.onLoad = lh((t = this.onLoad)).call(t, this)),
  9479. (this.renderCanvas = lh((e = this.renderCanvas)).call(e, this));
  9480. }
  9481. return (
  9482. (t.prototype.start = function (t) {
  9483. var e = this,
  9484. r = t.fileSource;
  9485. return (
  9486. (this.config = t),
  9487. new zx(function (t, n) {
  9488. if (((e.promise = { resolve: t, reject: n }), e.mediaStream))
  9489. return kC('stream is existed'), void t(e.mediaStream);
  9490. e.imageEl || (e.imageEl = new Image()),
  9491. e.canvasEl ||
  9492. ((e.canvasEl = document.createElement('canvas')),
  9493. (e.canvasContext = e.canvasEl.getContext('2d', {
  9494. desynchronized: !0,
  9495. }))),
  9496. e.worker || (e.worker = LC());
  9497. var i = r instanceof File ? IC.createObjectURL(r) : r;
  9498. e.loadImage(i);
  9499. })
  9500. );
  9501. }),
  9502. (t.prototype.stop = function () {
  9503. var t;
  9504. if (this.mediaStream) {
  9505. var e = this.imageEl.src;
  9506. this.imageEl.removeEventListener('load', this.onLoad),
  9507. (this.imageEl.src = ''),
  9508. (this.imageEl = null),
  9509. e &&
  9510. this.config.fileSource instanceof File &&
  9511. IC.revokeObjectURL(e),
  9512. (this.canvasContext = null),
  9513. (this.canvasEl = null),
  9514. (this.config = null),
  9515. (this.promise = null),
  9516. this.worker && (this.worker.terminate(), (this.worker = null)),
  9517. Ph((t = this.mediaStream.getTracks())).call(t, function (t) {
  9518. t.stop();
  9519. }),
  9520. (this.mediaStream = null);
  9521. } else kC('stream is not existed');
  9522. }),
  9523. (t.prototype.getResolution = function () {
  9524. if (!this.mediaStream) return null;
  9525. var t = this.mediaStream.getVideoTracks();
  9526. if (0 === t.length) return null;
  9527. var e = t[0].getSettings(),
  9528. r = e.width,
  9529. n = e.height;
  9530. return {
  9531. width: null != r ? r : this.canvasEl.width,
  9532. height: null != n ? n : this.canvasEl.height,
  9533. };
  9534. }),
  9535. (t.prototype.getRenderView = function () {
  9536. return this.canvasEl;
  9537. }),
  9538. (t.prototype.getRenderElement = function () {
  9539. return this.imageEl;
  9540. }),
  9541. (t.prototype.onLoad = function () {
  9542. var t = this.config.video.frameRate;
  9543. this.renderCanvas(), kC('start render canvas');
  9544. try {
  9545. var e = this.canvasEl.captureStream(t),
  9546. r = e.getAudioTracks();
  9547. Ph(r).call(r, function (t) {
  9548. e.removeTrack(t);
  9549. }),
  9550. (this.mediaStream = e),
  9551. this.promise.resolve(e);
  9552. } catch (t) {
  9553. kC('get image stream error, '.concat(t.toString())),
  9554. this.promise.reject(t);
  9555. }
  9556. }),
  9557. (t.prototype.renderCanvas = function () {
  9558. if (this.imageEl && this.canvasEl) {
  9559. var t = this.config.video.resolution,
  9560. e = t.width,
  9561. r = t.height,
  9562. n = this.imageEl.naturalWidth,
  9563. i = this.imageEl.naturalHeight,
  9564. o = null,
  9565. s = null;
  9566. 0 === n || 0 === i
  9567. ? ((o = e), (s = r))
  9568. : e / r < n / i
  9569. ? ((o = e), (s = (e * i) / n))
  9570. : ((o = (r * n) / i), (s = r)),
  9571. (this.canvasEl.width = o),
  9572. (this.canvasEl.height = s);
  9573. var a = this.canvasContext;
  9574. null == a || a.clearRect(0, 0, o, s),
  9575. null == a || a.fillRect(0, 0, o, s),
  9576. null == a || a.drawImage(this.imageEl, 0, 0, n, i, 0, 0, o, s),
  9577. this.requestAnimationFrameWrapper(this.renderCanvas);
  9578. } else kC('render canvas stop');
  9579. }),
  9580. (t.prototype.loadImage = function (t) {
  9581. this.imageEl.addEventListener('load', this.onLoad),
  9582. (this.imageEl.src = t);
  9583. }),
  9584. (t.prototype.setWorkerInterval = function (t, e) {
  9585. var r,
  9586. n,
  9587. i = this;
  9588. null === (r = this.worker) ||
  9589. void 0 === r ||
  9590. r.addEventListener('message', t),
  9591. null === (n = this.worker) ||
  9592. void 0 === n ||
  9593. n.postMessage({ type: 'start', data: { time: e } });
  9594. return function () {
  9595. var e, r;
  9596. null === (e = i.worker) ||
  9597. void 0 === e ||
  9598. e.postMessage({ type: 'stop' }),
  9599. null === (r = i.worker) ||
  9600. void 0 === r ||
  9601. r.removeEventListener('message', t);
  9602. };
  9603. }),
  9604. (t.prototype.requestAnimationFrameWrapper = function (t) {
  9605. var e = this.config.video.frameRate,
  9606. r = !1,
  9607. n = this.setWorkerInterval(function () {
  9608. !r && document.hidden && ((r = !0), n(), t());
  9609. }, 1e3 / e);
  9610. requestAnimationFrame(function () {
  9611. r || ((r = !0), n(), t());
  9612. });
  9613. }),
  9614. t
  9615. );
  9616. })(),
  9617. GC = Yf('stream'),
  9618. UC = (function () {
  9619. function t(t) {
  9620. (this.type = null),
  9621. (this.videoConfig = null),
  9622. (this.audioConfig = null),
  9623. (this.fileSource = null),
  9624. (this.onEvent = null),
  9625. (this.instance = null),
  9626. (this.needStopListener = !1);
  9627. var e = t.type,
  9628. r = t.video,
  9629. n = t.audio,
  9630. i = t.fileSource,
  9631. o = t.onEvent;
  9632. e && Jl(ip).call(ip, e)
  9633. ? ((this.type = e),
  9634. 'file' === e && this.setFileSource(i),
  9635. r || n
  9636. ? ((r || 'screen' === e) && (this.videoConfig = zm(op)),
  9637. n && (this.audioConfig = zm(sp)),
  9638. o && 'function' == typeof o && (this.onEvent = o))
  9639. : GC('video or audio must be existed'))
  9640. : GC('stream type('.concat(e, ') is invalid'));
  9641. }
  9642. return (
  9643. (t.prototype.setFileSource = function (t) {
  9644. var e, r;
  9645. if ('file' === this.type)
  9646. if (t)
  9647. if ('string' == typeof t || t instanceof File) {
  9648. var n =
  9649. 'string' == typeof t
  9650. ? Td((e = cp.extension)).call(e, function (e) {
  9651. var r;
  9652. return xE((r = t.toLowerCase())).call(r, e);
  9653. })
  9654. : Td((r = cp.type)).call(r, function (e) {
  9655. return t.type === e;
  9656. });
  9657. n ? (this.fileSource = t) : GC('File format is not supported');
  9658. } else GC('fileSource must be string or file object');
  9659. else GC('fileSource must be existed');
  9660. else GC('stream type must be file');
  9661. }),
  9662. (t.prototype.setVideoConfig = function (t) {
  9663. if (this.videoConfig) {
  9664. var e = t.deviceId,
  9665. r = t.frameRate,
  9666. n = t.resolution;
  9667. void 0 !== e &&
  9668. ('string' == typeof e
  9669. ? (this.videoConfig.deviceId = e)
  9670. : GC('deviceId must be string')),
  9671. void 0 !== r && 'number' == typeof r && r > 0
  9672. ? (this.videoConfig.frameRate = r)
  9673. : GC('frameRate must be a number greater than 0'),
  9674. void 0 !== n &&
  9675. 'object' === Wc(n) &&
  9676. 'number' == typeof n.width &&
  9677. 'number' == typeof n.height &&
  9678. n.width > 0 &&
  9679. n.height > 0
  9680. ? (this.videoConfig.resolution = n)
  9681. : GC(
  9682. 'resolution width and height must be a number greater than 0'
  9683. );
  9684. }
  9685. }),
  9686. (t.prototype.setAudioConfig = function (t) {
  9687. if (this.audioConfig) {
  9688. var e = t.deviceId,
  9689. r = t.sampleRate,
  9690. n = t.echoCancellation,
  9691. i = t.noiseSuppression,
  9692. o = t.autoGainControl;
  9693. void 0 !== e &&
  9694. ('string' == typeof e
  9695. ? (this.audioConfig.deviceId = e)
  9696. : GC('deviceId must be string')),
  9697. void 0 !== r && 'number' == typeof r && r > 0
  9698. ? (this.audioConfig.sampleRate = r)
  9699. : GC('sampleRate must be a number greater than 0'),
  9700. void 0 !== n && (this.audioConfig.echoCancellation = !!n),
  9701. void 0 !== i && (this.audioConfig.noiseSuppression = !!i),
  9702. void 0 !== o && (this.audioConfig.autoGainControl = !!o);
  9703. }
  9704. }),
  9705. (t.prototype.start = function () {
  9706. return Ed(this, void 0, void 0, function () {
  9707. var t, e, r, n, i, o, s;
  9708. return Sd(this, function (a) {
  9709. switch (a.label) {
  9710. case 0:
  9711. if (!this.type)
  9712. throw (
  9713. (GC('start failed, init param type is invalid'),
  9714. ((n = new Error('init param type is invalid')).name =
  9715. 'InitializedError'),
  9716. n)
  9717. );
  9718. if (!this.videoConfig && !this.audioConfig)
  9719. throw (
  9720. (GC(
  9721. 'start failed, init param video or audio must be existed'
  9722. ),
  9723. ((n = new Error(
  9724. 'init param video or audio must be existed'
  9725. )).name = 'InitializedError'),
  9726. n)
  9727. );
  9728. if ('file' === this.type && !this.fileSource)
  9729. throw (
  9730. (GC('start failed, file source is not existed'),
  9731. ((n = new Error('file source is not existed')).name =
  9732. 'NotFoundError'),
  9733. n)
  9734. );
  9735. var u, c;
  9736. if (((t = 'media'), 'file' === this.type))
  9737. if (
  9738. ((e = this.fileSource),
  9739. (r =
  9740. 'string' == typeof e
  9741. ? Td((u = up)).call(u, function (t) {
  9742. var r;
  9743. return xE((r = e.toLowerCase())).call(r, t);
  9744. })
  9745. : Td((c = ap)).call(c, function (t) {
  9746. return e.type === t;
  9747. })),
  9748. 'image' === (t = r ? 'image' : 'media') &&
  9749. !this.videoConfig)
  9750. )
  9751. throw (
  9752. (GC('start failed, init param video must be existed'),
  9753. ((n = new Error(
  9754. 'init param video must be existed'
  9755. )).name = 'InitializedError'),
  9756. n)
  9757. );
  9758. if (!this.instance) {
  9759. switch (((i = null), this.type)) {
  9760. case 'device':
  9761. i = new OE();
  9762. break;
  9763. case 'screen':
  9764. i = new ME();
  9765. break;
  9766. case 'file':
  9767. i = 'media' === t ? new NC() : new BC();
  9768. }
  9769. this.instance = i;
  9770. }
  9771. if (this.instance.mediaStream)
  9772. return (
  9773. GC('stream is existed'), [2, this.instance.mediaStream]
  9774. );
  9775. (o = void 0),
  9776. 'file' !== this.type
  9777. ? (o = {
  9778. video: this.videoConfig,
  9779. audio: this.audioConfig,
  9780. })
  9781. : 'media' === t
  9782. ? (o = {
  9783. video: this.videoConfig,
  9784. audio: !!this.audioConfig,
  9785. fileSource: this.fileSource,
  9786. })
  9787. : 'image' === t &&
  9788. (o = {
  9789. video: this.videoConfig,
  9790. fileSource: this.fileSource,
  9791. }),
  9792. (a.label = 1);
  9793. case 1:
  9794. return a.trys.push([1, 3, , 4]), [4, this.instance.start(o)];
  9795. case 2:
  9796. return (
  9797. (s = a.sent()),
  9798. (this.needStopListener = !1),
  9799. this.addStopListener(s),
  9800. [2, s]
  9801. );
  9802. case 3:
  9803. throw a.sent();
  9804. case 4:
  9805. return [2];
  9806. }
  9807. });
  9808. });
  9809. }),
  9810. (t.prototype.stop = function () {
  9811. var t, e;
  9812. (this.needStopListener = !0),
  9813. null === (t = this.instance) || void 0 === t || t.stop(),
  9814. null === (e = this.onEvent) ||
  9815. void 0 === e ||
  9816. e.call(this, { type: lp, data: { message: 'manual stop' } });
  9817. }),
  9818. (t.prototype.getMediaStream = function () {
  9819. var t;
  9820. return null === (t = this.instance) || void 0 === t
  9821. ? void 0
  9822. : t.mediaStream;
  9823. }),
  9824. (t.prototype.getVideoTrack = function () {
  9825. var t, e, r, n;
  9826. return null ===
  9827. (n =
  9828. null ===
  9829. (r =
  9830. null ===
  9831. (e =
  9832. null === (t = this.instance) || void 0 === t
  9833. ? void 0
  9834. : t.mediaStream) || void 0 === e
  9835. ? void 0
  9836. : e.getVideoTracks) || void 0 === r
  9837. ? void 0
  9838. : r.call(e)) || void 0 === n
  9839. ? void 0
  9840. : n[0];
  9841. }),
  9842. (t.prototype.getAudioTrack = function () {
  9843. var t, e, r, n;
  9844. return null ===
  9845. (n =
  9846. null ===
  9847. (r =
  9848. null ===
  9849. (e =
  9850. null === (t = this.instance) || void 0 === t
  9851. ? void 0
  9852. : t.mediaStream) || void 0 === e
  9853. ? void 0
  9854. : e.getAudioTracks) || void 0 === r
  9855. ? void 0
  9856. : r.call(e)) || void 0 === n
  9857. ? void 0
  9858. : n[0];
  9859. }),
  9860. (t.prototype.getResolution = function () {
  9861. var t;
  9862. return null === (t = this.instance) || void 0 === t
  9863. ? void 0
  9864. : t.getResolution();
  9865. }),
  9866. (t.prototype.getRenderView = function () {
  9867. return this.instance &&
  9868. (this.instance instanceof BC || this.instance instanceof NC)
  9869. ? this.instance.getRenderView()
  9870. : null;
  9871. }),
  9872. (t.prototype.getRenderElement = function () {
  9873. return this.instance &&
  9874. (this.instance instanceof BC || this.instance instanceof NC)
  9875. ? this.instance.getRenderElement()
  9876. : null;
  9877. }),
  9878. (t.prototype.addStopListener = function (t) {
  9879. var e,
  9880. r = this;
  9881. 'file' !== this.type &&
  9882. Ph((e = t.getTracks())).call(e, function (e) {
  9883. e.addEventListener(
  9884. 'ended',
  9885. function n() {
  9886. var i, o, s, a;
  9887. if (!r.needStopListener) {
  9888. GC(''.concat(e.kind, ' track is ended')),
  9889. e.stop(),
  9890. null === (o = r.onEvent) ||
  9891. void 0 === o ||
  9892. o.call(r, {
  9893. type: hp,
  9894. data: { message: 'track ended', kind: e.kind },
  9895. });
  9896. var u = PE((i = t.getTracks())).call(i, function (t) {
  9897. return 'ended' === t.readyState;
  9898. });
  9899. u &&
  9900. (GC('stream is ended'),
  9901. null === (s = r.instance) || void 0 === s || s.stop(),
  9902. null === (a = r.onEvent) ||
  9903. void 0 === a ||
  9904. a.call(r, {
  9905. type: lp,
  9906. data: { message: 'stream ended' },
  9907. })),
  9908. e.removeEventListener('ended', n, !1);
  9909. }
  9910. },
  9911. !1
  9912. );
  9913. });
  9914. }),
  9915. t
  9916. );
  9917. })(),
  9918. jC = Yf('manager:device'),
  9919. XC = (function () {
  9920. function t(t) {
  9921. this.getCommonData = null;
  9922. var e = t.getCommonData;
  9923. this.getCommonData = e;
  9924. }
  9925. return (
  9926. (t.prototype.getDevicesList = function (t) {
  9927. return Ed(this, void 0, void 0, function () {
  9928. var e, r, n, i;
  9929. return Sd(this, function (o) {
  9930. switch (o.label) {
  9931. case 0:
  9932. return (
  9933. o.trys.push([0, 2, , 3]),
  9934. [4, navigator.mediaDevices.enumerateDevices()]
  9935. );
  9936. case 1:
  9937. var s;
  9938. return (
  9939. (e = o.sent()),
  9940. (r = []),
  9941. (n = []),
  9942. Ph(e).call(e, function (t) {
  9943. var e = t.kind,
  9944. i = t.deviceId,
  9945. o = t.label;
  9946. 'videoinput' === e
  9947. ? r.push({ type: 'video', deviceId: i, deviceName: o })
  9948. : 'audioinput' === e &&
  9949. 'default' !== i &&
  9950. n.push({ type: 'audio', deviceId: i, deviceName: o });
  9951. }),
  9952. t
  9953. ? 'video' === t
  9954. ? [2, r]
  9955. : 'audio' === t
  9956. ? [2, n]
  9957. : [2, []]
  9958. : [2, mh((s = [])).call(s, r, n)]
  9959. );
  9960. case 2:
  9961. throw ((i = o.sent()), jC('enumerateDevices error: ', i), i);
  9962. case 3:
  9963. return [2];
  9964. }
  9965. });
  9966. });
  9967. }),
  9968. (t.prototype.getCurrentDevice = function (t, e) {
  9969. return Ed(this, void 0, void 0, function () {
  9970. var r, n, i, o, s, a, u, c, h, l, d, f, p;
  9971. return Sd(this, function (v) {
  9972. var m;
  9973. switch (v.label) {
  9974. case 0:
  9975. if (
  9976. ((r = this.getCommonData()),
  9977. (n = r.streamList),
  9978. (i = r.videoEffectManager),
  9979. !Jl((m = ['video', 'audio'])).call(m, t))
  9980. )
  9981. throw (jC('type is invalid'), new Error('type is invalid'));
  9982. if (i.enabled && !e)
  9983. throw (
  9984. (jC('streamId is not existed'),
  9985. new Error('streamId is not existed'))
  9986. );
  9987. if (
  9988. ((o = 'video' === t ? 'camera' : 'microphone'),
  9989. !(
  9990. (s = El(n).call(n, function (t) {
  9991. return t.type === o && (!e || t.id === e);
  9992. })) && s.source instanceof UC
  9993. ))
  9994. )
  9995. return [3, 5];
  9996. if (
  9997. !(a =
  9998. 'video' === t
  9999. ? s.source.getVideoTrack()
  10000. : s.source.getAudioTrack())
  10001. )
  10002. return [3, 5];
  10003. (u = a.getSettings().deviceId),
  10004. (c = { type: t, deviceId: u, deviceName: '' }),
  10005. (v.label = 1);
  10006. case 1:
  10007. return (
  10008. v.trys.push([1, 3, , 4]),
  10009. [4, navigator.mediaDevices.enumerateDevices()]
  10010. );
  10011. case 2:
  10012. return (
  10013. (h = v.sent()),
  10014. (l = ''.concat(t, 'input')),
  10015. (d = El(h).call(h, function (t) {
  10016. return t.kind === l && t.deviceId === u;
  10017. })) &&
  10018. ('default' === u
  10019. ? (f = El(h).call(h, function (t) {
  10020. return (
  10021. t.kind === l &&
  10022. 'default' !== t.deviceId &&
  10023. t.groupId === d.groupId
  10024. );
  10025. })) &&
  10026. ((c.deviceId = f.deviceId), (c.deviceName = f.label))
  10027. : (c.deviceName = d.label)),
  10028. [3, 4]
  10029. );
  10030. case 3:
  10031. return (
  10032. (p = v.sent()), jC('enumerateDevices error: ', p), [3, 4]
  10033. );
  10034. case 4:
  10035. return [2, c];
  10036. case 5:
  10037. return [2, null];
  10038. }
  10039. });
  10040. });
  10041. }),
  10042. (t.prototype.switchDevice = function (t, e, r) {
  10043. var n;
  10044. return Ed(this, void 0, void 0, function () {
  10045. var i,
  10046. o,
  10047. s,
  10048. a,
  10049. u,
  10050. c,
  10051. h,
  10052. l,
  10053. d,
  10054. f,
  10055. p,
  10056. v,
  10057. m,
  10058. y,
  10059. g,
  10060. _,
  10061. b,
  10062. T,
  10063. x,
  10064. E,
  10065. S,
  10066. w,
  10067. R,
  10068. C,
  10069. P,
  10070. A,
  10071. O = this;
  10072. return Sd(this, function (I) {
  10073. var M;
  10074. switch (I.label) {
  10075. case 0:
  10076. if (
  10077. ((i = this.getCommonData()),
  10078. (o = i.streamList),
  10079. (s = i.videoEffectManager),
  10080. (a = i.observer),
  10081. (u = i.videoQuality),
  10082. (c = i.audioQuality),
  10083. (h = i.streamOutput),
  10084. (l = i.isStreamPushing),
  10085. (d = i.connection),
  10086. (f = i.setProcessData),
  10087. !Jl((M = ['video', 'audio'])).call(M, t))
  10088. )
  10089. throw (jC('type is invalid'), new Error('type is invalid'));
  10090. if (!e)
  10091. throw (
  10092. (jC('deviceId is not existed'),
  10093. new Error('deviceId is not existed'))
  10094. );
  10095. if (s.enabled && !r)
  10096. throw (
  10097. (jC('streamId is not existed'),
  10098. new Error('streamId is not existed'))
  10099. );
  10100. if (
  10101. ((p = 'video' === t ? 'camera' : 'microphone'),
  10102. !(
  10103. (v = El(o).call(o, function (t) {
  10104. return t.type === p && (!r || t.id === r);
  10105. })) && v.source instanceof UC
  10106. ))
  10107. )
  10108. return [3, 9];
  10109. (m = null),
  10110. 'video' === t
  10111. ? ((m = new UC({
  10112. type: 'device',
  10113. video: !0,
  10114. audio: !1,
  10115. onEvent: function (t) {
  10116. var e, r;
  10117. t.type === lp &&
  10118. 'stream ended' ===
  10119. (null === (e = t.data) || void 0 === e
  10120. ? void 0
  10121. : e.message) &&
  10122. (null === (r = a.onWarning) ||
  10123. void 0 === r ||
  10124. r.call(
  10125. a,
  10126. Hf.TXLIVE_WARNING_CAMERA_INTERRUPTED,
  10127. 'interrupted',
  10128. { streamId: v.id }
  10129. ));
  10130. },
  10131. })),
  10132. (y = u.frameRate),
  10133. (g = u.width),
  10134. (_ = u.height),
  10135. m.setVideoConfig({
  10136. deviceId: e,
  10137. frameRate: y,
  10138. resolution: { width: g, height: _ },
  10139. }))
  10140. : ((m = new UC({
  10141. type: 'device',
  10142. video: !1,
  10143. audio: !0,
  10144. onEvent: function (t) {
  10145. var e, r;
  10146. t.type === lp &&
  10147. 'stream ended' ===
  10148. (null === (e = t.data) || void 0 === e
  10149. ? void 0
  10150. : e.message) &&
  10151. (null === (r = a.onWarning) ||
  10152. void 0 === r ||
  10153. r.call(
  10154. a,
  10155. Hf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,
  10156. 'interrupted',
  10157. { streamId: v.id }
  10158. ));
  10159. },
  10160. })),
  10161. (b = c.sampleRate),
  10162. (T = c.echoCancellation),
  10163. (x = c.noiseSuppression),
  10164. (E = c.autoGainControl),
  10165. m.setAudioConfig({
  10166. deviceId: e,
  10167. sampleRate: b,
  10168. echoCancellation: T,
  10169. noiseSuppression: x,
  10170. autoGainControl: E,
  10171. })),
  10172. (S = v.source),
  10173. (v.source = m),
  10174. (w = function () {
  10175. return Ed(O, void 0, void 0, function () {
  10176. return Sd(this, function (e) {
  10177. switch (e.label) {
  10178. case 0:
  10179. cd(function () {
  10180. S.getMediaStream() && S.stop();
  10181. }, 1500),
  10182. (e.label = 1);
  10183. case 1:
  10184. return e.trys.push([1, 3, , 5]), [4, m.start()];
  10185. case 2:
  10186. return e.sent(), [3, 5];
  10187. case 3:
  10188. return (
  10189. e.sent(),
  10190. jC(
  10191. 'switch '.concat(
  10192. 'video' === t ? 'camera' : 'microphone',
  10193. ' failed, try to switch again'
  10194. )
  10195. ),
  10196. S.getMediaStream() && S.stop(),
  10197. [4, m.start()]
  10198. );
  10199. case 4:
  10200. return e.sent(), [3, 5];
  10201. case 5:
  10202. return [2];
  10203. }
  10204. });
  10205. });
  10206. }),
  10207. (I.label = 1);
  10208. case 1:
  10209. return I.trys.push([1, 7, , 8]), [4, w()];
  10210. case 2:
  10211. return (
  10212. I.sent(),
  10213. s.enabled || 'video' !== t
  10214. ? [3, 5]
  10215. : ((R = S.getVideoTrack()),
  10216. (C = m.getVideoTrack()),
  10217. h &&
  10218. (R
  10219. ? h.removeTrack(R)
  10220. : ((P = h.getTracks()),
  10221. Ph(P).call(P, function (e) {
  10222. e.kind === t &&
  10223. 'ended' === e.readyState &&
  10224. h.removeTrack(e);
  10225. })),
  10226. h.addTrack(C)),
  10227. l && d ? [4, d.replaceStreamTrack(C)] : [3, 4])
  10228. );
  10229. case 3:
  10230. I.sent(), (I.label = 4);
  10231. case 4:
  10232. return [3, 6];
  10233. case 5:
  10234. v.track.setSource(m), f(), (I.label = 6);
  10235. case 6:
  10236. return (
  10237. S.getMediaStream() && S.stop(),
  10238. jC(
  10239. 'switch '.concat(
  10240. 'video' === t ? 'camera' : 'microphone',
  10241. ' successfully'
  10242. )
  10243. ),
  10244. [3, 8]
  10245. );
  10246. case 7:
  10247. throw (
  10248. ((A = I.sent()),
  10249. null === (n = a.onWarning) ||
  10250. void 0 === n ||
  10251. n.call(
  10252. a,
  10253. 'video' === t
  10254. ? Hf.TXLIVE_WARNING_CAMERA_START_FAILED
  10255. : Hf.TXLIVE_WARNING_MICROPHONE_START_FAILED,
  10256. A.toString(),
  10257. null
  10258. ),
  10259. A)
  10260. );
  10261. case 8:
  10262. return [3, 10];
  10263. case 9:
  10264. jC('stream is not existed'), (I.label = 10);
  10265. case 10:
  10266. return [2];
  10267. }
  10268. });
  10269. });
  10270. }),
  10271. (t.prototype.switchCamera = function (t, e) {
  10272. return this.switchDevice('video', t, e);
  10273. }),
  10274. (t.prototype.switchMicrophone = function (t, e) {
  10275. return this.switchDevice('audio', t, e);
  10276. }),
  10277. t
  10278. );
  10279. })();
  10280. Ar({ target: 'Array', stat: !0 }, { isArray: Ir });
  10281. var VC,
  10282. HC = rt.Array.isArray,
  10283. WC = { width: 1280, height: 720 },
  10284. YC = { video: ['video', 'image'], audio: ['audio'], text: ['text'] };
  10285. !(function (t) {
  10286. (t[(t.NONE = 0)] = 'NONE'),
  10287. (t[(t.LEFT_RIGHT = 1)] = 'LEFT_RIGHT'),
  10288. (t[(t.UP_DOWN = 2)] = 'UP_DOWN'),
  10289. (t[(t.ALL = 3)] = 'ALL');
  10290. })(VC || (VC = {}));
  10291. var zC = {
  10292. font: 'fontFamily',
  10293. font_size: 'fontSize',
  10294. font_color: 'fill',
  10295. bold: 'fontWeight',
  10296. italic: 'fontStyle',
  10297. shadow_color: 'dropShadowColor',
  10298. shadow_alpha: 'dropShadowAlpha',
  10299. stroke_color: 'stroke',
  10300. stroke_thickness: 'strokeThickness',
  10301. },
  10302. ZC = {
  10303. threshold: { value: -24, min: -100, max: 0 },
  10304. ratio: { value: 12, min: 1, max: 20 },
  10305. knee: { value: 30, min: 0, max: 40 },
  10306. attack: { value: 3, min: 0, max: 1e3 },
  10307. release: { value: 250, min: 0, max: 1e3 },
  10308. },
  10309. JC = Yf('process:helper'),
  10310. KC = (function () {
  10311. function t(t, e) {
  10312. (this.data = {}),
  10313. (this.data.id = Df()),
  10314. (this.data.type = t),
  10315. (this.data.order = 0);
  10316. var r = {};
  10317. (r.id = Df(8)),
  10318. (r.type = t),
  10319. e &&
  10320. ((r.source = e),
  10321. e instanceof HTMLImageElement && (r.type = 'image')),
  10322. (this.data.items = [r]);
  10323. }
  10324. return (
  10325. (t.prototype.setSource = function (t) {
  10326. var e = this.data,
  10327. r = e.type,
  10328. n = e.items[0];
  10329. 'video' === r || 'audio' === r
  10330. ? t
  10331. ? 'video' !== r ||
  10332. t instanceof UC ||
  10333. t instanceof MediaStream ||
  10334. t instanceof HTMLVideoElement ||
  10335. t instanceof HTMLImageElement
  10336. ? 'audio' !== r ||
  10337. t instanceof UC ||
  10338. t instanceof MediaStream ||
  10339. t instanceof HTMLVideoElement ||
  10340. t instanceof HTMLAudioElement
  10341. ? ((n.source = t),
  10342. t instanceof HTMLImageElement && (n.type = 'image'),
  10343. (this.data.items[0] = xd({}, n)))
  10344. : JC('audio source is invalid')
  10345. : JC('video source is invalid')
  10346. : JC('source must be existed')
  10347. : JC('type('.concat(r, ') is invalid'));
  10348. }),
  10349. (t.prototype.setOrder = function (t) {
  10350. 'number' == typeof t
  10351. ? (this.data.order = t)
  10352. : JC('order must be a number');
  10353. }),
  10354. (t.prototype.setLayout = function (t) {
  10355. var e;
  10356. if ('video' === this.data.type) {
  10357. var r = t.width,
  10358. n = t.height,
  10359. i = t.x,
  10360. o = t.y,
  10361. s = PE((e = [r, n, i, o])).call(e, function (t) {
  10362. return 'number' == typeof t;
  10363. });
  10364. if (s)
  10365. if (r < 0 || n < 0)
  10366. JC(
  10367. 'width or height must be a number greater than or equal to 0'
  10368. );
  10369. else {
  10370. var a = this.data.items[0];
  10371. this.data.items[0] = xd(xd({}, a), {
  10372. width: r,
  10373. height: n,
  10374. position: { x: i, y: o },
  10375. });
  10376. }
  10377. else JC('layout params must be number');
  10378. } else
  10379. JC('type is '.concat(this.data.type, ', setLayout is not working'));
  10380. }),
  10381. (t.prototype.setPosition = function (t, e) {
  10382. var r;
  10383. if ('video' === this.data.type || 'text' === this.data.type) {
  10384. var n = PE((r = [t, e])).call(r, function (t) {
  10385. return 'number' == typeof t;
  10386. });
  10387. if (n) {
  10388. var i = this.data.items[0];
  10389. this.data.items[0] = xd(xd({}, i), { position: { x: t, y: e } });
  10390. } else JC('position params must be number');
  10391. } else
  10392. JC(
  10393. 'type is '.concat(this.data.type, ', setPosition is not working')
  10394. );
  10395. }),
  10396. (t.prototype.setSize = function (t, e) {
  10397. var r;
  10398. if ('video' === this.data.type) {
  10399. var n = PE((r = [t, e])).call(r, function (t) {
  10400. return 'number' == typeof t;
  10401. });
  10402. if (n)
  10403. if (t < 0 || e < 0)
  10404. JC(
  10405. 'width or height must be a number greater than or equal to 0'
  10406. );
  10407. else {
  10408. var i = this.data.items[0];
  10409. this.data.items[0] = xd(xd({}, i), { width: t, height: e });
  10410. }
  10411. else JC('size params must be number');
  10412. } else
  10413. JC('type is '.concat(this.data.type, ', setSize is not working'));
  10414. }),
  10415. (t.prototype.setMirror = function (t) {
  10416. if ('video' === this.data.type)
  10417. if ('number' != typeof t || t < VC.NONE || t > VC.ALL)
  10418. JC('mirror type must be a number between 0 and 3');
  10419. else {
  10420. var e = this.data.items[0],
  10421. r = e.operations;
  10422. if (void 0 !== r || t !== VC.NONE) {
  10423. var n = Vh((r = r || [])).call(r, function (t) {
  10424. return 'image_mirror' === t.type;
  10425. }),
  10426. i = function (t) {
  10427. -1 !== n ? (r[n] = t) : r.push(t);
  10428. };
  10429. switch (t) {
  10430. case VC.NONE:
  10431. -1 !== n && pl(r).call(r, n, 1);
  10432. break;
  10433. case VC.LEFT_RIGHT:
  10434. i({ type: 'image_mirror', params: { left_right: 1 } });
  10435. break;
  10436. case VC.UP_DOWN:
  10437. i({ type: 'image_mirror', params: { up_down: 1 } });
  10438. break;
  10439. case VC.ALL:
  10440. i({
  10441. type: 'image_mirror',
  10442. params: { left_right: 1, up_down: 1 },
  10443. });
  10444. }
  10445. this.data.items[0] = xd(xd({}, e), { operations: r });
  10446. }
  10447. }
  10448. else
  10449. JC('type is '.concat(this.data.type, ', setMirror is not working'));
  10450. }),
  10451. (t.prototype.setVolume = function (t) {
  10452. if ('video' === this.data.type || 'audio' === this.data.type) {
  10453. var e = this.data.items[0];
  10454. if ('image' !== e.type)
  10455. if ('number' == typeof t) {
  10456. var r = e.operations,
  10457. n = void 0 === r ? [] : r,
  10458. i = Vh(n).call(n, function (t) {
  10459. return 'audio_volumes' === t.type;
  10460. }),
  10461. o = { type: 'audio_volumes', params: { all: t } };
  10462. -1 !== i ? (n[i] = o) : n.push(o),
  10463. (this.data.items[0] = xd(xd({}, e), { operations: n }));
  10464. } else JC('volume must be a number');
  10465. else JC('type is image, setVolume is not working');
  10466. } else
  10467. JC('type is '.concat(this.data.type, ', setVolume is not working'));
  10468. }),
  10469. (t.prototype.setCompressor = function (t) {
  10470. var e;
  10471. if ('video' === this.data.type || 'audio' === this.data.type) {
  10472. var r = this.data.items[0];
  10473. if ('image' !== r.type) {
  10474. var n = r.operations,
  10475. i = void 0 === n ? [] : n,
  10476. o = Vh(i).call(i, function (t) {
  10477. return 'audio_compressor' === t.type;
  10478. });
  10479. if (t) {
  10480. if (
  10481. PE((e = Rl(t))).call(e, function (e) {
  10482. var r = ZC[e];
  10483. if (!r) return JC('param '.concat(e, ' is invalid')), !1;
  10484. var n,
  10485. i,
  10486. o = t[e];
  10487. return (
  10488. !('number' != typeof o || o < r.min || o > r.max) ||
  10489. (JC(
  10490. mh(
  10491. (n = mh(
  10492. (i = 'param '.concat(
  10493. e,
  10494. ' must be a number between '
  10495. ))
  10496. ).call(i, r.min, ' and '))
  10497. ).call(n, r.max)
  10498. ),
  10499. !1)
  10500. );
  10501. })
  10502. ) {
  10503. var s = { type: 'audio_compressor', params: xd({}, t) };
  10504. -1 !== o ? (i[o] = s) : i.push(s),
  10505. (this.data.items[0] = xd(xd({}, r), { operations: i }));
  10506. }
  10507. } else
  10508. -1 !== o &&
  10509. (pl(i).call(i, o, 1),
  10510. (this.data.items[0] = xd(xd({}, r), { operations: i })));
  10511. } else JC('type is image, setCompressor is not working');
  10512. } else
  10513. JC(
  10514. 'type is '.concat(
  10515. this.data.type,
  10516. ', setCompressor is not working'
  10517. )
  10518. );
  10519. }),
  10520. (t.prototype.setNormalFilter = function (t) {
  10521. var e;
  10522. if ('video' === this.data.type) {
  10523. var r = this.data.items[0],
  10524. n = r.operations,
  10525. i = void 0 === n ? [] : n,
  10526. o = Vh(i).call(i, function (t) {
  10527. return 'image_filter_normal' === t.type;
  10528. });
  10529. if (t) {
  10530. if (
  10531. PE((e = Rl(t))).call(e, function (e) {
  10532. var r = t[e];
  10533. return (
  10534. !('number' != typeof r || r < -100 || r > 100) ||
  10535. (JC(
  10536. 'param '.concat(
  10537. e,
  10538. ' must be a number between -100 and 100'
  10539. )
  10540. ),
  10541. !1)
  10542. );
  10543. })
  10544. ) {
  10545. var s = { type: 'image_filter_normal', params: xd({}, t) };
  10546. -1 !== o ? (i[o] = s) : i.push(s),
  10547. (this.data.items[0] = xd(xd({}, r), { operations: i }));
  10548. }
  10549. } else
  10550. -1 !== o &&
  10551. (pl(i).call(i, o, 1),
  10552. (this.data.items[0] = xd(xd({}, r), { operations: i })));
  10553. } else
  10554. JC(
  10555. 'type is '.concat(
  10556. this.data.type,
  10557. ', setNormalFilter is not working'
  10558. )
  10559. );
  10560. }),
  10561. (t.prototype.setText = function (t, e) {
  10562. if ('text' === this.data.type)
  10563. if (t)
  10564. if ('object' !== Wc(e) || HC(e) || null === e)
  10565. JC('style is invalid');
  10566. else {
  10567. var r = this.data.items[0];
  10568. this.data.items[0] = xd(xd({}, r), {
  10569. content: { text: t, text_style: e },
  10570. });
  10571. }
  10572. else JC('text content is not existed');
  10573. else
  10574. JC('type is '.concat(this.data.type, ', setText is not working'));
  10575. }),
  10576. t
  10577. );
  10578. })(),
  10579. qC = function (t, e) {
  10580. var r;
  10581. if (Jl((r = Rl(YC))).call(r, t)) {
  10582. if ('video' === t || 'audio' === t) {
  10583. if (!e) return void JC('source must be existed');
  10584. if (
  10585. !(
  10586. 'video' !== t ||
  10587. e instanceof UC ||
  10588. e instanceof MediaStream ||
  10589. e instanceof HTMLVideoElement ||
  10590. e instanceof HTMLImageElement
  10591. )
  10592. )
  10593. return void JC('video source is invalid');
  10594. if (
  10595. !(
  10596. 'audio' !== t ||
  10597. e instanceof UC ||
  10598. e instanceof MediaStream ||
  10599. e instanceof HTMLVideoElement ||
  10600. e instanceof HTMLAudioElement
  10601. )
  10602. )
  10603. return void JC('audio source is invalid');
  10604. }
  10605. return new KC(t, e);
  10606. }
  10607. JC('type('.concat(t, ') is invalid'));
  10608. },
  10609. QC = Yf('manager:video'),
  10610. $C = (function () {
  10611. function t(t) {
  10612. (this.enabled = !1),
  10613. (this.getCommonData = null),
  10614. (this.config = {
  10615. videoWidth: null,
  10616. videoHeight: null,
  10617. videoFramerate: null,
  10618. backgroundColor: null,
  10619. });
  10620. var e = t.getCommonData;
  10621. this.getCommonData = e;
  10622. }
  10623. return (
  10624. (t.prototype.enableMixing = function (t) {
  10625. var e = this.getCommonData(),
  10626. r = e.streamList,
  10627. n = e.streamOutput;
  10628. r.length > 0 || n
  10629. ? QC('stream is existed, please stop streaming first')
  10630. : (this.enabled = !!t);
  10631. }),
  10632. (t.prototype.setMixingConfig = function (t) {
  10633. if (t) {
  10634. var e = t.videoWidth,
  10635. r = t.videoHeight,
  10636. n = t.videoFramerate,
  10637. i = t.backgroundColor;
  10638. void 0 !== e &&
  10639. ('number' == typeof e && e > 0
  10640. ? (this.config.videoWidth = e)
  10641. : QC('videoWidth must be a number greater than 0')),
  10642. void 0 !== r &&
  10643. ('number' == typeof r && r > 0
  10644. ? (this.config.videoHeight = r)
  10645. : QC('videoHeight must be a number greater than 0')),
  10646. void 0 !== n &&
  10647. ('number' == typeof n && n > 0
  10648. ? (this.config.videoFramerate = n)
  10649. : QC('videoFramerate must be a number greater than 0')),
  10650. void 0 !== i &&
  10651. ('number' == typeof i && i >= 0 && i <= 16777215
  10652. ? (this.config.backgroundColor = i)
  10653. : QC('backgroundColor must be a valid color number'));
  10654. var o = this.getCommonData().effectProcess;
  10655. if (o) {
  10656. var s = this.getMixingConfig(),
  10657. a = s.videoWidth,
  10658. u = s.videoHeight,
  10659. c = s.videoFramerate,
  10660. h = s.backgroundColor;
  10661. o.setResolution({ width: a, height: u }),
  10662. o.setFrameRate(c),
  10663. o.setBackgroundColor(h);
  10664. }
  10665. }
  10666. }),
  10667. (t.prototype.getMixingConfig = function () {
  10668. var t = this.getCommonData().videoQuality,
  10669. e = t.frameRate,
  10670. r = t.width,
  10671. n = t.height,
  10672. i = this.config,
  10673. o = i.videoWidth,
  10674. s = i.videoHeight,
  10675. a = i.videoFramerate,
  10676. u = i.backgroundColor;
  10677. return {
  10678. videoWidth: null != o ? o : r,
  10679. videoHeight: null != s ? s : n,
  10680. videoFramerate: null != a ? a : e,
  10681. backgroundColor: null != u ? u : 0,
  10682. };
  10683. }),
  10684. (t.prototype.setLayout = function (t) {
  10685. var e, r;
  10686. if (t) {
  10687. var n = this.getCommonData(),
  10688. i = n.streamList,
  10689. o = n.setProcessData,
  10690. s = HC(t) ? t : [t],
  10691. a = function (t) {
  10692. var e = t.streamId,
  10693. r = t.x,
  10694. n = t.y,
  10695. o = t.width,
  10696. s = t.height,
  10697. a = t.zOrder,
  10698. u = El(i).call(i, function (t) {
  10699. var r,
  10700. n = t.source,
  10701. i = n instanceof UC ? n.getMediaStream() : n;
  10702. return (
  10703. (null === (r = null == i ? void 0 : i.getVideoTracks()) ||
  10704. void 0 === r
  10705. ? void 0
  10706. : r.length) && t.id === e
  10707. );
  10708. });
  10709. u
  10710. ? (u.track.setOrder(a),
  10711. u.track.setSize(o, s),
  10712. u.track.setPosition(r, n))
  10713. : QC('stream '.concat(e, ' is not existed'));
  10714. };
  10715. try {
  10716. for (var u = wd(s), c = u.next(); !c.done; c = u.next()) {
  10717. a(c.value);
  10718. }
  10719. } catch (t) {
  10720. e = { error: t };
  10721. } finally {
  10722. try {
  10723. c && !c.done && (r = u.return) && r.call(u);
  10724. } finally {
  10725. if (e) throw e.error;
  10726. }
  10727. }
  10728. o();
  10729. }
  10730. }),
  10731. (t.prototype.getLayout = function (t) {
  10732. var e, r;
  10733. if (!t) return QC('streamId is not existed'), null;
  10734. var n = this.getCommonData().streamList,
  10735. i = El(n).call(n, function (e) {
  10736. return e.id === t;
  10737. });
  10738. if (!i) return QC('stream '.concat(t, ' is not existed')), null;
  10739. var o = i.track.data,
  10740. s = o.items[0];
  10741. return {
  10742. streamId: t,
  10743. zOrder: o.order,
  10744. x: null === (e = s.position) || void 0 === e ? void 0 : e.x,
  10745. y: null === (r = s.position) || void 0 === r ? void 0 : r.y,
  10746. width: s.width,
  10747. height: s.height,
  10748. };
  10749. }),
  10750. (t.prototype.setMirror = function (t) {
  10751. var e, r;
  10752. if (t) {
  10753. var n = this.getCommonData(),
  10754. i = n.streamList,
  10755. o = n.setProcessData,
  10756. s = HC(t) ? t : [t],
  10757. a = function (t) {
  10758. var e = t.streamId,
  10759. r = t.mirrorType,
  10760. n = El(i).call(i, function (t) {
  10761. var r,
  10762. n = t.source,
  10763. i = n instanceof UC ? n.getMediaStream() : n;
  10764. return (
  10765. (null === (r = null == i ? void 0 : i.getVideoTracks()) ||
  10766. void 0 === r
  10767. ? void 0
  10768. : r.length) && t.id === e
  10769. );
  10770. });
  10771. n
  10772. ? n.track.setMirror(r)
  10773. : QC('stream '.concat(e, ' is not existed'));
  10774. };
  10775. try {
  10776. for (var u = wd(s), c = u.next(); !c.done; c = u.next()) {
  10777. a(c.value);
  10778. }
  10779. } catch (t) {
  10780. e = { error: t };
  10781. } finally {
  10782. try {
  10783. c && !c.done && (r = u.return) && r.call(u);
  10784. } finally {
  10785. if (e) throw e.error;
  10786. }
  10787. }
  10788. o();
  10789. }
  10790. }),
  10791. (t.prototype.setNormalFilter = function (t) {
  10792. var e, r;
  10793. if (t) {
  10794. var n = this.getCommonData(),
  10795. i = n.streamList,
  10796. o = n.setProcessData,
  10797. s = HC(t) ? t : [t],
  10798. a = function (t) {
  10799. var e = t.streamId,
  10800. r = t.contrast,
  10801. n = void 0 === r ? 0 : r,
  10802. o = t.brightness,
  10803. s = void 0 === o ? 0 : o,
  10804. a = t.saturation,
  10805. u = void 0 === a ? 0 : a,
  10806. c = El(i).call(i, function (t) {
  10807. var r,
  10808. n = t.source,
  10809. i = n instanceof UC ? n.getMediaStream() : n;
  10810. return (
  10811. (null === (r = null == i ? void 0 : i.getVideoTracks()) ||
  10812. void 0 === r
  10813. ? void 0
  10814. : r.length) && t.id === e
  10815. );
  10816. });
  10817. c
  10818. ? c.track.setNormalFilter(
  10819. 0 === n && 0 === s && 0 === u
  10820. ? null
  10821. : { contrast: n, brightness: s, saturation: u }
  10822. )
  10823. : QC('stream '.concat(e, ' is not existed'));
  10824. };
  10825. try {
  10826. for (var u = wd(s), c = u.next(); !c.done; c = u.next()) {
  10827. a(c.value);
  10828. }
  10829. } catch (t) {
  10830. e = { error: t };
  10831. } finally {
  10832. try {
  10833. c && !c.done && (r = u.return) && r.call(u);
  10834. } finally {
  10835. if (e) throw e.error;
  10836. }
  10837. }
  10838. o();
  10839. }
  10840. }),
  10841. (t.prototype.setWatermark = function (t) {
  10842. var e,
  10843. r,
  10844. n,
  10845. i,
  10846. o = this.getCommonData(),
  10847. s = o.effectTrackList,
  10848. a = o.setProcessData,
  10849. u = Lh(s).call(s, function (t) {
  10850. return 'video' === t.data.type;
  10851. }),
  10852. c = function (t) {
  10853. var e = Vh(s).call(s, function (e) {
  10854. return e === t;
  10855. });
  10856. pl(s).call(s, e, 1);
  10857. };
  10858. try {
  10859. for (var h = wd(u), l = h.next(); !l.done; l = h.next()) {
  10860. c(l.value);
  10861. }
  10862. } catch (t) {
  10863. e = { error: t };
  10864. } finally {
  10865. try {
  10866. l && !l.done && (r = h.return) && r.call(h);
  10867. } finally {
  10868. if (e) throw e.error;
  10869. }
  10870. }
  10871. if (t) {
  10872. var d = HC(t) ? t : [t];
  10873. try {
  10874. for (var f = wd(d), p = f.next(); !p.done; p = f.next()) {
  10875. var v = p.value,
  10876. m = v.image,
  10877. y = v.x,
  10878. g = v.y,
  10879. _ = v.width,
  10880. b = v.height,
  10881. T = v.zOrder;
  10882. if (m && m instanceof HTMLImageElement) {
  10883. var x = qC('video', m);
  10884. x.setOrder(T),
  10885. x.setSize(_, b),
  10886. x.setPosition(y, g),
  10887. s.push(x);
  10888. } else QC('image is invalid');
  10889. }
  10890. } catch (t) {
  10891. n = { error: t };
  10892. } finally {
  10893. try {
  10894. p && !p.done && (i = f.return) && i.call(f);
  10895. } finally {
  10896. if (n) throw n.error;
  10897. }
  10898. }
  10899. a();
  10900. } else a();
  10901. }),
  10902. (t.prototype.setText = function (t) {
  10903. var e,
  10904. r,
  10905. n,
  10906. i,
  10907. o = this.getCommonData(),
  10908. s = o.effectTrackList,
  10909. a = o.setProcessData,
  10910. u = Lh(s).call(s, function (t) {
  10911. return 'text' === t.data.type;
  10912. }),
  10913. c = function (t) {
  10914. var e = Vh(s).call(s, function (e) {
  10915. return e === t;
  10916. });
  10917. pl(s).call(s, e, 1);
  10918. };
  10919. try {
  10920. for (var h = wd(u), l = h.next(); !l.done; l = h.next()) {
  10921. c(l.value);
  10922. }
  10923. } catch (t) {
  10924. e = { error: t };
  10925. } finally {
  10926. try {
  10927. l && !l.done && (r = h.return) && r.call(h);
  10928. } finally {
  10929. if (e) throw e.error;
  10930. }
  10931. }
  10932. if (t) {
  10933. var d = HC(t) ? t : [t];
  10934. try {
  10935. for (var f = wd(d), p = f.next(); !p.done; p = f.next()) {
  10936. var v = p.value,
  10937. m = v.text,
  10938. y = v.style,
  10939. g = v.x,
  10940. _ = v.y,
  10941. b = v.zOrder;
  10942. if (m && 'string' == typeof m) {
  10943. var T = qC('text');
  10944. T.setText(m, y),
  10945. T.setOrder(b),
  10946. T.setPosition(g, _),
  10947. s.push(T);
  10948. } else QC('text is invalid');
  10949. }
  10950. } catch (t) {
  10951. n = { error: t };
  10952. } finally {
  10953. try {
  10954. p && !p.done && (i = f.return) && i.call(f);
  10955. } finally {
  10956. if (n) throw n.error;
  10957. }
  10958. }
  10959. a();
  10960. } else a();
  10961. }),
  10962. t
  10963. );
  10964. })(),
  10965. tP = Yf('manager:audio'),
  10966. eP = (function () {
  10967. function t(t) {
  10968. this.getCommonData = null;
  10969. var e = t.getCommonData;
  10970. this.getCommonData = e;
  10971. }
  10972. return (
  10973. (t.prototype.setVolume = function (t, e) {
  10974. var r = this.getCommonData(),
  10975. n = r.videoEffectManager,
  10976. i = r.streamList,
  10977. o = r.setProcessData;
  10978. if ('number' == typeof t)
  10979. if (!n.enabled || e) {
  10980. var s = El(i).call(i, function (t) {
  10981. var r,
  10982. n = t.source,
  10983. i = n instanceof UC ? n.getMediaStream() : n;
  10984. return (
  10985. (null === (r = null == i ? void 0 : i.getAudioTracks()) ||
  10986. void 0 === r
  10987. ? void 0
  10988. : r.length) &&
  10989. (!e || t.id === e)
  10990. );
  10991. });
  10992. s ? (s.track.setVolume(t), o()) : tP('stream is not existed');
  10993. } else tP('streamId is not existed');
  10994. else tP('volume must be a number');
  10995. }),
  10996. t
  10997. );
  10998. })(),
  10999. rP = rt.setInterval,
  11000. nP = { exports: {} };
  11001. !(function (t, e) {
  11002. t.exports = (function (t) {
  11003. var e = {};
  11004. function r(n) {
  11005. if (e[n]) return e[n].exports;
  11006. var i = (e[n] = { i: n, l: !1, exports: {} });
  11007. return t[n].call(i.exports, i, i.exports, r), (i.l = !0), i.exports;
  11008. }
  11009. return (
  11010. (r.m = t),
  11011. (r.c = e),
  11012. (r.d = function (t, e, n) {
  11013. r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n });
  11014. }),
  11015. (r.r = function (t) {
  11016. 'undefined' != typeof Symbol &&
  11017. Symbol.toStringTag &&
  11018. Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }),
  11019. Object.defineProperty(t, '__esModule', { value: !0 });
  11020. }),
  11021. (r.t = function (t, e) {
  11022. if ((1 & e && (t = r(t)), 8 & e)) return t;
  11023. if (4 & e && 'object' == typeof t && t && t.__esModule) return t;
  11024. var n = Object.create(null);
  11025. if (
  11026. (r.r(n),
  11027. Object.defineProperty(n, 'default', { enumerable: !0, value: t }),
  11028. 2 & e && 'string' != typeof t)
  11029. )
  11030. for (var i in t)
  11031. r.d(
  11032. n,
  11033. i,
  11034. function (e) {
  11035. return t[e];
  11036. }.bind(null, i)
  11037. );
  11038. return n;
  11039. }),
  11040. (r.n = function (t) {
  11041. var e =
  11042. t && t.__esModule
  11043. ? function () {
  11044. return t.default;
  11045. }
  11046. : function () {
  11047. return t;
  11048. };
  11049. return r.d(e, 'a', e), e;
  11050. }),
  11051. (r.o = function (t, e) {
  11052. return Object.prototype.hasOwnProperty.call(t, e);
  11053. }),
  11054. (r.p = ''),
  11055. r((r.s = 90))
  11056. );
  11057. })({
  11058. 17: function (t, e, r) {
  11059. (e.__esModule = !0), (e.default = void 0);
  11060. var n = r(18),
  11061. i = (function () {
  11062. function t() {}
  11063. return (
  11064. (t.getFirstMatch = function (t, e) {
  11065. var r = e.match(t);
  11066. return (r && r.length > 0 && r[1]) || '';
  11067. }),
  11068. (t.getSecondMatch = function (t, e) {
  11069. var r = e.match(t);
  11070. return (r && r.length > 1 && r[2]) || '';
  11071. }),
  11072. (t.matchAndReturnConst = function (t, e, r) {
  11073. if (t.test(e)) return r;
  11074. }),
  11075. (t.getWindowsVersionName = function (t) {
  11076. switch (t) {
  11077. case 'NT':
  11078. return 'NT';
  11079. case 'XP':
  11080. case 'NT 5.1':
  11081. return 'XP';
  11082. case 'NT 5.0':
  11083. return '2000';
  11084. case 'NT 5.2':
  11085. return '2003';
  11086. case 'NT 6.0':
  11087. return 'Vista';
  11088. case 'NT 6.1':
  11089. return '7';
  11090. case 'NT 6.2':
  11091. return '8';
  11092. case 'NT 6.3':
  11093. return '8.1';
  11094. case 'NT 10.0':
  11095. return '10';
  11096. default:
  11097. return;
  11098. }
  11099. }),
  11100. (t.getMacOSVersionName = function (t) {
  11101. var e = t
  11102. .split('.')
  11103. .splice(0, 2)
  11104. .map(function (t) {
  11105. return parseInt(t, 10) || 0;
  11106. });
  11107. if ((e.push(0), 10 === e[0]))
  11108. switch (e[1]) {
  11109. case 5:
  11110. return 'Leopard';
  11111. case 6:
  11112. return 'Snow Leopard';
  11113. case 7:
  11114. return 'Lion';
  11115. case 8:
  11116. return 'Mountain Lion';
  11117. case 9:
  11118. return 'Mavericks';
  11119. case 10:
  11120. return 'Yosemite';
  11121. case 11:
  11122. return 'El Capitan';
  11123. case 12:
  11124. return 'Sierra';
  11125. case 13:
  11126. return 'High Sierra';
  11127. case 14:
  11128. return 'Mojave';
  11129. case 15:
  11130. return 'Catalina';
  11131. default:
  11132. return;
  11133. }
  11134. }),
  11135. (t.getAndroidVersionName = function (t) {
  11136. var e = t
  11137. .split('.')
  11138. .splice(0, 2)
  11139. .map(function (t) {
  11140. return parseInt(t, 10) || 0;
  11141. });
  11142. if ((e.push(0), !(1 === e[0] && e[1] < 5)))
  11143. return 1 === e[0] && e[1] < 6
  11144. ? 'Cupcake'
  11145. : 1 === e[0] && e[1] >= 6
  11146. ? 'Donut'
  11147. : 2 === e[0] && e[1] < 2
  11148. ? 'Eclair'
  11149. : 2 === e[0] && 2 === e[1]
  11150. ? 'Froyo'
  11151. : 2 === e[0] && e[1] > 2
  11152. ? 'Gingerbread'
  11153. : 3 === e[0]
  11154. ? 'Honeycomb'
  11155. : 4 === e[0] && e[1] < 1
  11156. ? 'Ice Cream Sandwich'
  11157. : 4 === e[0] && e[1] < 4
  11158. ? 'Jelly Bean'
  11159. : 4 === e[0] && e[1] >= 4
  11160. ? 'KitKat'
  11161. : 5 === e[0]
  11162. ? 'Lollipop'
  11163. : 6 === e[0]
  11164. ? 'Marshmallow'
  11165. : 7 === e[0]
  11166. ? 'Nougat'
  11167. : 8 === e[0]
  11168. ? 'Oreo'
  11169. : 9 === e[0]
  11170. ? 'Pie'
  11171. : void 0;
  11172. }),
  11173. (t.getVersionPrecision = function (t) {
  11174. return t.split('.').length;
  11175. }),
  11176. (t.compareVersions = function (e, r, n) {
  11177. void 0 === n && (n = !1);
  11178. var i = t.getVersionPrecision(e),
  11179. o = t.getVersionPrecision(r),
  11180. s = Math.max(i, o),
  11181. a = 0,
  11182. u = t.map([e, r], function (e) {
  11183. var r = s - t.getVersionPrecision(e),
  11184. n = e + new Array(r + 1).join('.0');
  11185. return t
  11186. .map(n.split('.'), function (t) {
  11187. return new Array(20 - t.length).join('0') + t;
  11188. })
  11189. .reverse();
  11190. });
  11191. for (n && (a = s - Math.min(i, o)), s -= 1; s >= a; ) {
  11192. if (u[0][s] > u[1][s]) return 1;
  11193. if (u[0][s] === u[1][s]) {
  11194. if (s === a) return 0;
  11195. s -= 1;
  11196. } else if (u[0][s] < u[1][s]) return -1;
  11197. }
  11198. }),
  11199. (t.map = function (t, e) {
  11200. var r,
  11201. n = [];
  11202. if (Array.prototype.map) return Array.prototype.map.call(t, e);
  11203. for (r = 0; r < t.length; r += 1) n.push(e(t[r]));
  11204. return n;
  11205. }),
  11206. (t.find = function (t, e) {
  11207. var r, n;
  11208. if (Array.prototype.find)
  11209. return Array.prototype.find.call(t, e);
  11210. for (r = 0, n = t.length; r < n; r += 1) {
  11211. var i = t[r];
  11212. if (e(i, r)) return i;
  11213. }
  11214. }),
  11215. (t.assign = function (t) {
  11216. for (
  11217. var e,
  11218. r,
  11219. n = t,
  11220. i = arguments.length,
  11221. o = new Array(i > 1 ? i - 1 : 0),
  11222. s = 1;
  11223. s < i;
  11224. s++
  11225. )
  11226. o[s - 1] = arguments[s];
  11227. if (Object.assign)
  11228. return Object.assign.apply(Object, [t].concat(o));
  11229. var a = function () {
  11230. var t = o[e];
  11231. 'object' == typeof t &&
  11232. null !== t &&
  11233. Object.keys(t).forEach(function (e) {
  11234. n[e] = t[e];
  11235. });
  11236. };
  11237. for (e = 0, r = o.length; e < r; e += 1) a();
  11238. return t;
  11239. }),
  11240. (t.getBrowserAlias = function (t) {
  11241. return n.BROWSER_ALIASES_MAP[t];
  11242. }),
  11243. (t.getBrowserTypeByAlias = function (t) {
  11244. return n.BROWSER_MAP[t] || '';
  11245. }),
  11246. t
  11247. );
  11248. })();
  11249. (e.default = i), (t.exports = e.default);
  11250. },
  11251. 18: function (t, e, r) {
  11252. (e.__esModule = !0),
  11253. (e.ENGINE_MAP =
  11254. e.OS_MAP =
  11255. e.PLATFORMS_MAP =
  11256. e.BROWSER_MAP =
  11257. e.BROWSER_ALIASES_MAP =
  11258. void 0),
  11259. (e.BROWSER_ALIASES_MAP = {
  11260. 'Amazon Silk': 'amazon_silk',
  11261. 'Android Browser': 'android',
  11262. Bada: 'bada',
  11263. BlackBerry: 'blackberry',
  11264. Chrome: 'chrome',
  11265. Chromium: 'chromium',
  11266. Electron: 'electron',
  11267. Epiphany: 'epiphany',
  11268. Firefox: 'firefox',
  11269. Focus: 'focus',
  11270. Generic: 'generic',
  11271. 'Google Search': 'google_search',
  11272. Googlebot: 'googlebot',
  11273. 'Internet Explorer': 'ie',
  11274. 'K-Meleon': 'k_meleon',
  11275. Maxthon: 'maxthon',
  11276. 'Microsoft Edge': 'edge',
  11277. 'MZ Browser': 'mz',
  11278. 'NAVER Whale Browser': 'naver',
  11279. Opera: 'opera',
  11280. 'Opera Coast': 'opera_coast',
  11281. PhantomJS: 'phantomjs',
  11282. Puffin: 'puffin',
  11283. QupZilla: 'qupzilla',
  11284. QQ: 'qq',
  11285. QQLite: 'qqlite',
  11286. Safari: 'safari',
  11287. Sailfish: 'sailfish',
  11288. 'Samsung Internet for Android': 'samsung_internet',
  11289. SeaMonkey: 'seamonkey',
  11290. Sleipnir: 'sleipnir',
  11291. Swing: 'swing',
  11292. Tizen: 'tizen',
  11293. 'UC Browser': 'uc',
  11294. Vivaldi: 'vivaldi',
  11295. 'WebOS Browser': 'webos',
  11296. WeChat: 'wechat',
  11297. 'Yandex Browser': 'yandex',
  11298. Roku: 'roku',
  11299. }),
  11300. (e.BROWSER_MAP = {
  11301. amazon_silk: 'Amazon Silk',
  11302. android: 'Android Browser',
  11303. bada: 'Bada',
  11304. blackberry: 'BlackBerry',
  11305. chrome: 'Chrome',
  11306. chromium: 'Chromium',
  11307. electron: 'Electron',
  11308. epiphany: 'Epiphany',
  11309. firefox: 'Firefox',
  11310. focus: 'Focus',
  11311. generic: 'Generic',
  11312. googlebot: 'Googlebot',
  11313. google_search: 'Google Search',
  11314. ie: 'Internet Explorer',
  11315. k_meleon: 'K-Meleon',
  11316. maxthon: 'Maxthon',
  11317. edge: 'Microsoft Edge',
  11318. mz: 'MZ Browser',
  11319. naver: 'NAVER Whale Browser',
  11320. opera: 'Opera',
  11321. opera_coast: 'Opera Coast',
  11322. phantomjs: 'PhantomJS',
  11323. puffin: 'Puffin',
  11324. qupzilla: 'QupZilla',
  11325. qq: 'QQ Browser',
  11326. qqlite: 'QQ Browser Lite',
  11327. safari: 'Safari',
  11328. sailfish: 'Sailfish',
  11329. samsung_internet: 'Samsung Internet for Android',
  11330. seamonkey: 'SeaMonkey',
  11331. sleipnir: 'Sleipnir',
  11332. swing: 'Swing',
  11333. tizen: 'Tizen',
  11334. uc: 'UC Browser',
  11335. vivaldi: 'Vivaldi',
  11336. webos: 'WebOS Browser',
  11337. wechat: 'WeChat',
  11338. yandex: 'Yandex Browser',
  11339. }),
  11340. (e.PLATFORMS_MAP = {
  11341. tablet: 'tablet',
  11342. mobile: 'mobile',
  11343. desktop: 'desktop',
  11344. tv: 'tv',
  11345. }),
  11346. (e.OS_MAP = {
  11347. WindowsPhone: 'Windows Phone',
  11348. Windows: 'Windows',
  11349. MacOS: 'macOS',
  11350. iOS: 'iOS',
  11351. Android: 'Android',
  11352. WebOS: 'WebOS',
  11353. BlackBerry: 'BlackBerry',
  11354. Bada: 'Bada',
  11355. Tizen: 'Tizen',
  11356. Linux: 'Linux',
  11357. ChromeOS: 'Chrome OS',
  11358. PlayStation4: 'PlayStation 4',
  11359. Roku: 'Roku',
  11360. }),
  11361. (e.ENGINE_MAP = {
  11362. EdgeHTML: 'EdgeHTML',
  11363. Blink: 'Blink',
  11364. Trident: 'Trident',
  11365. Presto: 'Presto',
  11366. Gecko: 'Gecko',
  11367. WebKit: 'WebKit',
  11368. });
  11369. },
  11370. 90: function (t, e, r) {
  11371. (e.__esModule = !0), (e.default = void 0);
  11372. var n,
  11373. i = (n = r(91)) && n.__esModule ? n : { default: n },
  11374. o = r(18);
  11375. function s(t, e) {
  11376. for (var r = 0; r < e.length; r++) {
  11377. var n = e[r];
  11378. (n.enumerable = n.enumerable || !1),
  11379. (n.configurable = !0),
  11380. 'value' in n && (n.writable = !0),
  11381. Object.defineProperty(t, n.key, n);
  11382. }
  11383. }
  11384. var a = (function () {
  11385. function t() {}
  11386. var e, r, n;
  11387. return (
  11388. (t.getParser = function (t, e) {
  11389. if ((void 0 === e && (e = !1), 'string' != typeof t))
  11390. throw new Error('UserAgent should be a string');
  11391. return new i.default(t, e);
  11392. }),
  11393. (t.parse = function (t) {
  11394. return new i.default(t).getResult();
  11395. }),
  11396. (e = t),
  11397. (n = [
  11398. {
  11399. key: 'BROWSER_MAP',
  11400. get: function () {
  11401. return o.BROWSER_MAP;
  11402. },
  11403. },
  11404. {
  11405. key: 'ENGINE_MAP',
  11406. get: function () {
  11407. return o.ENGINE_MAP;
  11408. },
  11409. },
  11410. {
  11411. key: 'OS_MAP',
  11412. get: function () {
  11413. return o.OS_MAP;
  11414. },
  11415. },
  11416. {
  11417. key: 'PLATFORMS_MAP',
  11418. get: function () {
  11419. return o.PLATFORMS_MAP;
  11420. },
  11421. },
  11422. ]),
  11423. (r = null) && s(e.prototype, r),
  11424. n && s(e, n),
  11425. t
  11426. );
  11427. })();
  11428. (e.default = a), (t.exports = e.default);
  11429. },
  11430. 91: function (t, e, r) {
  11431. (e.__esModule = !0), (e.default = void 0);
  11432. var n = u(r(92)),
  11433. i = u(r(93)),
  11434. o = u(r(94)),
  11435. s = u(r(95)),
  11436. a = u(r(17));
  11437. function u(t) {
  11438. return t && t.__esModule ? t : { default: t };
  11439. }
  11440. var c = (function () {
  11441. function t(t, e) {
  11442. if ((void 0 === e && (e = !1), null == t || '' === t))
  11443. throw new Error("UserAgent parameter can't be empty");
  11444. (this._ua = t), (this.parsedResult = {}), !0 !== e && this.parse();
  11445. }
  11446. var e = t.prototype;
  11447. return (
  11448. (e.getUA = function () {
  11449. return this._ua;
  11450. }),
  11451. (e.test = function (t) {
  11452. return t.test(this._ua);
  11453. }),
  11454. (e.parseBrowser = function () {
  11455. var t = this;
  11456. this.parsedResult.browser = {};
  11457. var e = a.default.find(n.default, function (e) {
  11458. if ('function' == typeof e.test) return e.test(t);
  11459. if (e.test instanceof Array)
  11460. return e.test.some(function (e) {
  11461. return t.test(e);
  11462. });
  11463. throw new Error("Browser's test function is not valid");
  11464. });
  11465. return (
  11466. e && (this.parsedResult.browser = e.describe(this.getUA())),
  11467. this.parsedResult.browser
  11468. );
  11469. }),
  11470. (e.getBrowser = function () {
  11471. return this.parsedResult.browser
  11472. ? this.parsedResult.browser
  11473. : this.parseBrowser();
  11474. }),
  11475. (e.getBrowserName = function (t) {
  11476. return t
  11477. ? String(this.getBrowser().name).toLowerCase() || ''
  11478. : this.getBrowser().name || '';
  11479. }),
  11480. (e.getBrowserVersion = function () {
  11481. return this.getBrowser().version;
  11482. }),
  11483. (e.getOS = function () {
  11484. return this.parsedResult.os
  11485. ? this.parsedResult.os
  11486. : this.parseOS();
  11487. }),
  11488. (e.parseOS = function () {
  11489. var t = this;
  11490. this.parsedResult.os = {};
  11491. var e = a.default.find(i.default, function (e) {
  11492. if ('function' == typeof e.test) return e.test(t);
  11493. if (e.test instanceof Array)
  11494. return e.test.some(function (e) {
  11495. return t.test(e);
  11496. });
  11497. throw new Error("Browser's test function is not valid");
  11498. });
  11499. return (
  11500. e && (this.parsedResult.os = e.describe(this.getUA())),
  11501. this.parsedResult.os
  11502. );
  11503. }),
  11504. (e.getOSName = function (t) {
  11505. var e = this.getOS().name;
  11506. return t ? String(e).toLowerCase() || '' : e || '';
  11507. }),
  11508. (e.getOSVersion = function () {
  11509. return this.getOS().version;
  11510. }),
  11511. (e.getPlatform = function () {
  11512. return this.parsedResult.platform
  11513. ? this.parsedResult.platform
  11514. : this.parsePlatform();
  11515. }),
  11516. (e.getPlatformType = function (t) {
  11517. void 0 === t && (t = !1);
  11518. var e = this.getPlatform().type;
  11519. return t ? String(e).toLowerCase() || '' : e || '';
  11520. }),
  11521. (e.parsePlatform = function () {
  11522. var t = this;
  11523. this.parsedResult.platform = {};
  11524. var e = a.default.find(o.default, function (e) {
  11525. if ('function' == typeof e.test) return e.test(t);
  11526. if (e.test instanceof Array)
  11527. return e.test.some(function (e) {
  11528. return t.test(e);
  11529. });
  11530. throw new Error("Browser's test function is not valid");
  11531. });
  11532. return (
  11533. e && (this.parsedResult.platform = e.describe(this.getUA())),
  11534. this.parsedResult.platform
  11535. );
  11536. }),
  11537. (e.getEngine = function () {
  11538. return this.parsedResult.engine
  11539. ? this.parsedResult.engine
  11540. : this.parseEngine();
  11541. }),
  11542. (e.getEngineName = function (t) {
  11543. return t
  11544. ? String(this.getEngine().name).toLowerCase() || ''
  11545. : this.getEngine().name || '';
  11546. }),
  11547. (e.parseEngine = function () {
  11548. var t = this;
  11549. this.parsedResult.engine = {};
  11550. var e = a.default.find(s.default, function (e) {
  11551. if ('function' == typeof e.test) return e.test(t);
  11552. if (e.test instanceof Array)
  11553. return e.test.some(function (e) {
  11554. return t.test(e);
  11555. });
  11556. throw new Error("Browser's test function is not valid");
  11557. });
  11558. return (
  11559. e && (this.parsedResult.engine = e.describe(this.getUA())),
  11560. this.parsedResult.engine
  11561. );
  11562. }),
  11563. (e.parse = function () {
  11564. return (
  11565. this.parseBrowser(),
  11566. this.parseOS(),
  11567. this.parsePlatform(),
  11568. this.parseEngine(),
  11569. this
  11570. );
  11571. }),
  11572. (e.getResult = function () {
  11573. return a.default.assign({}, this.parsedResult);
  11574. }),
  11575. (e.satisfies = function (t) {
  11576. var e = this,
  11577. r = {},
  11578. n = 0,
  11579. i = {},
  11580. o = 0;
  11581. if (
  11582. (Object.keys(t).forEach(function (e) {
  11583. var s = t[e];
  11584. 'string' == typeof s
  11585. ? ((i[e] = s), (o += 1))
  11586. : 'object' == typeof s && ((r[e] = s), (n += 1));
  11587. }),
  11588. n > 0)
  11589. ) {
  11590. var s = Object.keys(r),
  11591. u = a.default.find(s, function (t) {
  11592. return e.isOS(t);
  11593. });
  11594. if (u) {
  11595. var c = this.satisfies(r[u]);
  11596. if (void 0 !== c) return c;
  11597. }
  11598. var h = a.default.find(s, function (t) {
  11599. return e.isPlatform(t);
  11600. });
  11601. if (h) {
  11602. var l = this.satisfies(r[h]);
  11603. if (void 0 !== l) return l;
  11604. }
  11605. }
  11606. if (o > 0) {
  11607. var d = Object.keys(i),
  11608. f = a.default.find(d, function (t) {
  11609. return e.isBrowser(t, !0);
  11610. });
  11611. if (void 0 !== f) return this.compareVersion(i[f]);
  11612. }
  11613. }),
  11614. (e.isBrowser = function (t, e) {
  11615. void 0 === e && (e = !1);
  11616. var r = this.getBrowserName().toLowerCase(),
  11617. n = t.toLowerCase(),
  11618. i = a.default.getBrowserTypeByAlias(n);
  11619. return e && i && (n = i.toLowerCase()), n === r;
  11620. }),
  11621. (e.compareVersion = function (t) {
  11622. var e = [0],
  11623. r = t,
  11624. n = !1,
  11625. i = this.getBrowserVersion();
  11626. if ('string' == typeof i)
  11627. return (
  11628. '>' === t[0] || '<' === t[0]
  11629. ? ((r = t.substr(1)),
  11630. '=' === t[1] ? ((n = !0), (r = t.substr(2))) : (e = []),
  11631. '>' === t[0] ? e.push(1) : e.push(-1))
  11632. : '=' === t[0]
  11633. ? (r = t.substr(1))
  11634. : '~' === t[0] && ((n = !0), (r = t.substr(1))),
  11635. e.indexOf(a.default.compareVersions(i, r, n)) > -1
  11636. );
  11637. }),
  11638. (e.isOS = function (t) {
  11639. return this.getOSName(!0) === String(t).toLowerCase();
  11640. }),
  11641. (e.isPlatform = function (t) {
  11642. return this.getPlatformType(!0) === String(t).toLowerCase();
  11643. }),
  11644. (e.isEngine = function (t) {
  11645. return this.getEngineName(!0) === String(t).toLowerCase();
  11646. }),
  11647. (e.is = function (t, e) {
  11648. return (
  11649. void 0 === e && (e = !1),
  11650. this.isBrowser(t, e) || this.isOS(t) || this.isPlatform(t)
  11651. );
  11652. }),
  11653. (e.some = function (t) {
  11654. var e = this;
  11655. return (
  11656. void 0 === t && (t = []),
  11657. t.some(function (t) {
  11658. return e.is(t);
  11659. })
  11660. );
  11661. }),
  11662. t
  11663. );
  11664. })();
  11665. (e.default = c), (t.exports = e.default);
  11666. },
  11667. 92: function (t, e, r) {
  11668. (e.__esModule = !0), (e.default = void 0);
  11669. var n,
  11670. i = (n = r(17)) && n.__esModule ? n : { default: n },
  11671. o = /version\/(\d+(\.?_?\d+)+)/i,
  11672. s = [
  11673. {
  11674. test: [/googlebot/i],
  11675. describe: function (t) {
  11676. var e = { name: 'Googlebot' },
  11677. r =
  11678. i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, t) ||
  11679. i.default.getFirstMatch(o, t);
  11680. return r && (e.version = r), e;
  11681. },
  11682. },
  11683. {
  11684. test: [/opera/i],
  11685. describe: function (t) {
  11686. var e = { name: 'Opera' },
  11687. r =
  11688. i.default.getFirstMatch(o, t) ||
  11689. i.default.getFirstMatch(
  11690. /(?:opera)[\s/](\d+(\.?_?\d+)+)/i,
  11691. t
  11692. );
  11693. return r && (e.version = r), e;
  11694. },
  11695. },
  11696. {
  11697. test: [/opr\/|opios/i],
  11698. describe: function (t) {
  11699. var e = { name: 'Opera' },
  11700. r =
  11701. i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, t) ||
  11702. i.default.getFirstMatch(o, t);
  11703. return r && (e.version = r), e;
  11704. },
  11705. },
  11706. {
  11707. test: [/SamsungBrowser/i],
  11708. describe: function (t) {
  11709. var e = { name: 'Samsung Internet for Android' },
  11710. r =
  11711. i.default.getFirstMatch(o, t) ||
  11712. i.default.getFirstMatch(
  11713. /(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,
  11714. t
  11715. );
  11716. return r && (e.version = r), e;
  11717. },
  11718. },
  11719. {
  11720. test: [/Whale/i],
  11721. describe: function (t) {
  11722. var e = { name: 'NAVER Whale Browser' },
  11723. r =
  11724. i.default.getFirstMatch(o, t) ||
  11725. i.default.getFirstMatch(
  11726. /(?:whale)[\s/](\d+(?:\.\d+)+)/i,
  11727. t
  11728. );
  11729. return r && (e.version = r), e;
  11730. },
  11731. },
  11732. {
  11733. test: [/MZBrowser/i],
  11734. describe: function (t) {
  11735. var e = { name: 'MZ Browser' },
  11736. r =
  11737. i.default.getFirstMatch(
  11738. /(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,
  11739. t
  11740. ) || i.default.getFirstMatch(o, t);
  11741. return r && (e.version = r), e;
  11742. },
  11743. },
  11744. {
  11745. test: [/focus/i],
  11746. describe: function (t) {
  11747. var e = { name: 'Focus' },
  11748. r =
  11749. i.default.getFirstMatch(
  11750. /(?:focus)[\s/](\d+(?:\.\d+)+)/i,
  11751. t
  11752. ) || i.default.getFirstMatch(o, t);
  11753. return r && (e.version = r), e;
  11754. },
  11755. },
  11756. {
  11757. test: [/swing/i],
  11758. describe: function (t) {
  11759. var e = { name: 'Swing' },
  11760. r =
  11761. i.default.getFirstMatch(
  11762. /(?:swing)[\s/](\d+(?:\.\d+)+)/i,
  11763. t
  11764. ) || i.default.getFirstMatch(o, t);
  11765. return r && (e.version = r), e;
  11766. },
  11767. },
  11768. {
  11769. test: [/coast/i],
  11770. describe: function (t) {
  11771. var e = { name: 'Opera Coast' },
  11772. r =
  11773. i.default.getFirstMatch(o, t) ||
  11774. i.default.getFirstMatch(
  11775. /(?:coast)[\s/](\d+(\.?_?\d+)+)/i,
  11776. t
  11777. );
  11778. return r && (e.version = r), e;
  11779. },
  11780. },
  11781. {
  11782. test: [/opt\/\d+(?:.?_?\d+)+/i],
  11783. describe: function (t) {
  11784. var e = { name: 'Opera Touch' },
  11785. r =
  11786. i.default.getFirstMatch(
  11787. /(?:opt)[\s/](\d+(\.?_?\d+)+)/i,
  11788. t
  11789. ) || i.default.getFirstMatch(o, t);
  11790. return r && (e.version = r), e;
  11791. },
  11792. },
  11793. {
  11794. test: [/yabrowser/i],
  11795. describe: function (t) {
  11796. var e = { name: 'Yandex Browser' },
  11797. r =
  11798. i.default.getFirstMatch(
  11799. /(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,
  11800. t
  11801. ) || i.default.getFirstMatch(o, t);
  11802. return r && (e.version = r), e;
  11803. },
  11804. },
  11805. {
  11806. test: [/ucbrowser/i],
  11807. describe: function (t) {
  11808. var e = { name: 'UC Browser' },
  11809. r =
  11810. i.default.getFirstMatch(o, t) ||
  11811. i.default.getFirstMatch(
  11812. /(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,
  11813. t
  11814. );
  11815. return r && (e.version = r), e;
  11816. },
  11817. },
  11818. {
  11819. test: [/Maxthon|mxios/i],
  11820. describe: function (t) {
  11821. var e = { name: 'Maxthon' },
  11822. r =
  11823. i.default.getFirstMatch(o, t) ||
  11824. i.default.getFirstMatch(
  11825. /(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,
  11826. t
  11827. );
  11828. return r && (e.version = r), e;
  11829. },
  11830. },
  11831. {
  11832. test: [/epiphany/i],
  11833. describe: function (t) {
  11834. var e = { name: 'Epiphany' },
  11835. r =
  11836. i.default.getFirstMatch(o, t) ||
  11837. i.default.getFirstMatch(
  11838. /(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,
  11839. t
  11840. );
  11841. return r && (e.version = r), e;
  11842. },
  11843. },
  11844. {
  11845. test: [/puffin/i],
  11846. describe: function (t) {
  11847. var e = { name: 'Puffin' },
  11848. r =
  11849. i.default.getFirstMatch(o, t) ||
  11850. i.default.getFirstMatch(
  11851. /(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,
  11852. t
  11853. );
  11854. return r && (e.version = r), e;
  11855. },
  11856. },
  11857. {
  11858. test: [/sleipnir/i],
  11859. describe: function (t) {
  11860. var e = { name: 'Sleipnir' },
  11861. r =
  11862. i.default.getFirstMatch(o, t) ||
  11863. i.default.getFirstMatch(
  11864. /(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,
  11865. t
  11866. );
  11867. return r && (e.version = r), e;
  11868. },
  11869. },
  11870. {
  11871. test: [/k-meleon/i],
  11872. describe: function (t) {
  11873. var e = { name: 'K-Meleon' },
  11874. r =
  11875. i.default.getFirstMatch(o, t) ||
  11876. i.default.getFirstMatch(
  11877. /(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,
  11878. t
  11879. );
  11880. return r && (e.version = r), e;
  11881. },
  11882. },
  11883. {
  11884. test: [/micromessenger/i],
  11885. describe: function (t) {
  11886. var e = { name: 'WeChat' },
  11887. r =
  11888. i.default.getFirstMatch(
  11889. /(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,
  11890. t
  11891. ) || i.default.getFirstMatch(o, t);
  11892. return r && (e.version = r), e;
  11893. },
  11894. },
  11895. {
  11896. test: [/qqbrowser/i],
  11897. describe: function (t) {
  11898. var e = {
  11899. name: /qqbrowserlite/i.test(t)
  11900. ? 'QQ Browser Lite'
  11901. : 'QQ Browser',
  11902. },
  11903. r =
  11904. i.default.getFirstMatch(
  11905. /(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,
  11906. t
  11907. ) || i.default.getFirstMatch(o, t);
  11908. return r && (e.version = r), e;
  11909. },
  11910. },
  11911. {
  11912. test: [/msie|trident/i],
  11913. describe: function (t) {
  11914. var e = { name: 'Internet Explorer' },
  11915. r = i.default.getFirstMatch(
  11916. /(?:msie |rv:)(\d+(\.?_?\d+)+)/i,
  11917. t
  11918. );
  11919. return r && (e.version = r), e;
  11920. },
  11921. },
  11922. {
  11923. test: [/\sedg\//i],
  11924. describe: function (t) {
  11925. var e = { name: 'Microsoft Edge' },
  11926. r = i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, t);
  11927. return r && (e.version = r), e;
  11928. },
  11929. },
  11930. {
  11931. test: [/edg([ea]|ios)/i],
  11932. describe: function (t) {
  11933. var e = { name: 'Microsoft Edge' },
  11934. r = i.default.getSecondMatch(
  11935. /edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,
  11936. t
  11937. );
  11938. return r && (e.version = r), e;
  11939. },
  11940. },
  11941. {
  11942. test: [/vivaldi/i],
  11943. describe: function (t) {
  11944. var e = { name: 'Vivaldi' },
  11945. r = i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, t);
  11946. return r && (e.version = r), e;
  11947. },
  11948. },
  11949. {
  11950. test: [/seamonkey/i],
  11951. describe: function (t) {
  11952. var e = { name: 'SeaMonkey' },
  11953. r = i.default.getFirstMatch(
  11954. /seamonkey\/(\d+(\.?_?\d+)+)/i,
  11955. t
  11956. );
  11957. return r && (e.version = r), e;
  11958. },
  11959. },
  11960. {
  11961. test: [/sailfish/i],
  11962. describe: function (t) {
  11963. var e = { name: 'Sailfish' },
  11964. r = i.default.getFirstMatch(
  11965. /sailfish\s?browser\/(\d+(\.\d+)?)/i,
  11966. t
  11967. );
  11968. return r && (e.version = r), e;
  11969. },
  11970. },
  11971. {
  11972. test: [/silk/i],
  11973. describe: function (t) {
  11974. var e = { name: 'Amazon Silk' },
  11975. r = i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, t);
  11976. return r && (e.version = r), e;
  11977. },
  11978. },
  11979. {
  11980. test: [/phantom/i],
  11981. describe: function (t) {
  11982. var e = { name: 'PhantomJS' },
  11983. r = i.default.getFirstMatch(
  11984. /phantomjs\/(\d+(\.?_?\d+)+)/i,
  11985. t
  11986. );
  11987. return r && (e.version = r), e;
  11988. },
  11989. },
  11990. {
  11991. test: [/slimerjs/i],
  11992. describe: function (t) {
  11993. var e = { name: 'SlimerJS' },
  11994. r = i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, t);
  11995. return r && (e.version = r), e;
  11996. },
  11997. },
  11998. {
  11999. test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
  12000. describe: function (t) {
  12001. var e = { name: 'BlackBerry' },
  12002. r =
  12003. i.default.getFirstMatch(o, t) ||
  12004. i.default.getFirstMatch(
  12005. /blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,
  12006. t
  12007. );
  12008. return r && (e.version = r), e;
  12009. },
  12010. },
  12011. {
  12012. test: [/(web|hpw)[o0]s/i],
  12013. describe: function (t) {
  12014. var e = { name: 'WebOS Browser' },
  12015. r =
  12016. i.default.getFirstMatch(o, t) ||
  12017. i.default.getFirstMatch(
  12018. /w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,
  12019. t
  12020. );
  12021. return r && (e.version = r), e;
  12022. },
  12023. },
  12024. {
  12025. test: [/bada/i],
  12026. describe: function (t) {
  12027. var e = { name: 'Bada' },
  12028. r = i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, t);
  12029. return r && (e.version = r), e;
  12030. },
  12031. },
  12032. {
  12033. test: [/tizen/i],
  12034. describe: function (t) {
  12035. var e = { name: 'Tizen' },
  12036. r =
  12037. i.default.getFirstMatch(
  12038. /(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,
  12039. t
  12040. ) || i.default.getFirstMatch(o, t);
  12041. return r && (e.version = r), e;
  12042. },
  12043. },
  12044. {
  12045. test: [/qupzilla/i],
  12046. describe: function (t) {
  12047. var e = { name: 'QupZilla' },
  12048. r =
  12049. i.default.getFirstMatch(
  12050. /(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,
  12051. t
  12052. ) || i.default.getFirstMatch(o, t);
  12053. return r && (e.version = r), e;
  12054. },
  12055. },
  12056. {
  12057. test: [/firefox|iceweasel|fxios/i],
  12058. describe: function (t) {
  12059. var e = { name: 'Firefox' },
  12060. r = i.default.getFirstMatch(
  12061. /(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,
  12062. t
  12063. );
  12064. return r && (e.version = r), e;
  12065. },
  12066. },
  12067. {
  12068. test: [/electron/i],
  12069. describe: function (t) {
  12070. var e = { name: 'Electron' },
  12071. r = i.default.getFirstMatch(
  12072. /(?:electron)\/(\d+(\.?_?\d+)+)/i,
  12073. t
  12074. );
  12075. return r && (e.version = r), e;
  12076. },
  12077. },
  12078. {
  12079. test: [/MiuiBrowser/i],
  12080. describe: function (t) {
  12081. var e = { name: 'Miui' },
  12082. r = i.default.getFirstMatch(
  12083. /(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,
  12084. t
  12085. );
  12086. return r && (e.version = r), e;
  12087. },
  12088. },
  12089. {
  12090. test: [/chromium/i],
  12091. describe: function (t) {
  12092. var e = { name: 'Chromium' },
  12093. r =
  12094. i.default.getFirstMatch(
  12095. /(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,
  12096. t
  12097. ) || i.default.getFirstMatch(o, t);
  12098. return r && (e.version = r), e;
  12099. },
  12100. },
  12101. {
  12102. test: [/chrome|crios|crmo/i],
  12103. describe: function (t) {
  12104. var e = { name: 'Chrome' },
  12105. r = i.default.getFirstMatch(
  12106. /(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,
  12107. t
  12108. );
  12109. return r && (e.version = r), e;
  12110. },
  12111. },
  12112. {
  12113. test: [/GSA/i],
  12114. describe: function (t) {
  12115. var e = { name: 'Google Search' },
  12116. r = i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, t);
  12117. return r && (e.version = r), e;
  12118. },
  12119. },
  12120. {
  12121. test: function (t) {
  12122. var e = !t.test(/like android/i),
  12123. r = t.test(/android/i);
  12124. return e && r;
  12125. },
  12126. describe: function (t) {
  12127. var e = { name: 'Android Browser' },
  12128. r = i.default.getFirstMatch(o, t);
  12129. return r && (e.version = r), e;
  12130. },
  12131. },
  12132. {
  12133. test: [/playstation 4/i],
  12134. describe: function (t) {
  12135. var e = { name: 'PlayStation 4' },
  12136. r = i.default.getFirstMatch(o, t);
  12137. return r && (e.version = r), e;
  12138. },
  12139. },
  12140. {
  12141. test: [/safari|applewebkit/i],
  12142. describe: function (t) {
  12143. var e = { name: 'Safari' },
  12144. r = i.default.getFirstMatch(o, t);
  12145. return r && (e.version = r), e;
  12146. },
  12147. },
  12148. {
  12149. test: [/.*/i],
  12150. describe: function (t) {
  12151. var e =
  12152. -1 !== t.search('\\(')
  12153. ? /^(.*)\/(.*)[ \t]\((.*)/
  12154. : /^(.*)\/(.*) /;
  12155. return {
  12156. name: i.default.getFirstMatch(e, t),
  12157. version: i.default.getSecondMatch(e, t),
  12158. };
  12159. },
  12160. },
  12161. ];
  12162. (e.default = s), (t.exports = e.default);
  12163. },
  12164. 93: function (t, e, r) {
  12165. (e.__esModule = !0), (e.default = void 0);
  12166. var n,
  12167. i = (n = r(17)) && n.__esModule ? n : { default: n },
  12168. o = r(18),
  12169. s = [
  12170. {
  12171. test: [/Roku\/DVP/],
  12172. describe: function (t) {
  12173. var e = i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, t);
  12174. return { name: o.OS_MAP.Roku, version: e };
  12175. },
  12176. },
  12177. {
  12178. test: [/windows phone/i],
  12179. describe: function (t) {
  12180. var e = i.default.getFirstMatch(
  12181. /windows phone (?:os)?\s?(\d+(\.\d+)*)/i,
  12182. t
  12183. );
  12184. return { name: o.OS_MAP.WindowsPhone, version: e };
  12185. },
  12186. },
  12187. {
  12188. test: [/windows /i],
  12189. describe: function (t) {
  12190. var e = i.default.getFirstMatch(
  12191. /Windows ((NT|XP)( \d\d?.\d)?)/i,
  12192. t
  12193. ),
  12194. r = i.default.getWindowsVersionName(e);
  12195. return { name: o.OS_MAP.Windows, version: e, versionName: r };
  12196. },
  12197. },
  12198. {
  12199. test: [/Macintosh(.*?) FxiOS(.*?)\//],
  12200. describe: function (t) {
  12201. var e = { name: o.OS_MAP.iOS },
  12202. r = i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/, t);
  12203. return r && (e.version = r), e;
  12204. },
  12205. },
  12206. {
  12207. test: [/macintosh/i],
  12208. describe: function (t) {
  12209. var e = i.default
  12210. .getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, t)
  12211. .replace(/[_\s]/g, '.'),
  12212. r = i.default.getMacOSVersionName(e),
  12213. n = { name: o.OS_MAP.MacOS, version: e };
  12214. return r && (n.versionName = r), n;
  12215. },
  12216. },
  12217. {
  12218. test: [/(ipod|iphone|ipad)/i],
  12219. describe: function (t) {
  12220. var e = i.default
  12221. .getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, t)
  12222. .replace(/[_\s]/g, '.');
  12223. return { name: o.OS_MAP.iOS, version: e };
  12224. },
  12225. },
  12226. {
  12227. test: function (t) {
  12228. var e = !t.test(/like android/i),
  12229. r = t.test(/android/i);
  12230. return e && r;
  12231. },
  12232. describe: function (t) {
  12233. var e = i.default.getFirstMatch(
  12234. /android[\s/-](\d+(\.\d+)*)/i,
  12235. t
  12236. ),
  12237. r = i.default.getAndroidVersionName(e),
  12238. n = { name: o.OS_MAP.Android, version: e };
  12239. return r && (n.versionName = r), n;
  12240. },
  12241. },
  12242. {
  12243. test: [/(web|hpw)[o0]s/i],
  12244. describe: function (t) {
  12245. var e = i.default.getFirstMatch(
  12246. /(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,
  12247. t
  12248. ),
  12249. r = { name: o.OS_MAP.WebOS };
  12250. return e && e.length && (r.version = e), r;
  12251. },
  12252. },
  12253. {
  12254. test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
  12255. describe: function (t) {
  12256. var e =
  12257. i.default.getFirstMatch(
  12258. /rim\stablet\sos\s(\d+(\.\d+)*)/i,
  12259. t
  12260. ) ||
  12261. i.default.getFirstMatch(
  12262. /blackberry\d+\/(\d+([_\s]\d+)*)/i,
  12263. t
  12264. ) ||
  12265. i.default.getFirstMatch(/\bbb(\d+)/i, t);
  12266. return { name: o.OS_MAP.BlackBerry, version: e };
  12267. },
  12268. },
  12269. {
  12270. test: [/bada/i],
  12271. describe: function (t) {
  12272. var e = i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, t);
  12273. return { name: o.OS_MAP.Bada, version: e };
  12274. },
  12275. },
  12276. {
  12277. test: [/tizen/i],
  12278. describe: function (t) {
  12279. var e = i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, t);
  12280. return { name: o.OS_MAP.Tizen, version: e };
  12281. },
  12282. },
  12283. {
  12284. test: [/linux/i],
  12285. describe: function () {
  12286. return { name: o.OS_MAP.Linux };
  12287. },
  12288. },
  12289. {
  12290. test: [/CrOS/],
  12291. describe: function () {
  12292. return { name: o.OS_MAP.ChromeOS };
  12293. },
  12294. },
  12295. {
  12296. test: [/PlayStation 4/],
  12297. describe: function (t) {
  12298. var e = i.default.getFirstMatch(
  12299. /PlayStation 4[/\s](\d+(\.\d+)*)/i,
  12300. t
  12301. );
  12302. return { name: o.OS_MAP.PlayStation4, version: e };
  12303. },
  12304. },
  12305. ];
  12306. (e.default = s), (t.exports = e.default);
  12307. },
  12308. 94: function (t, e, r) {
  12309. (e.__esModule = !0), (e.default = void 0);
  12310. var n,
  12311. i = (n = r(17)) && n.__esModule ? n : { default: n },
  12312. o = r(18),
  12313. s = [
  12314. {
  12315. test: [/googlebot/i],
  12316. describe: function () {
  12317. return { type: 'bot', vendor: 'Google' };
  12318. },
  12319. },
  12320. {
  12321. test: [/huawei/i],
  12322. describe: function (t) {
  12323. var e = i.default.getFirstMatch(/(can-l01)/i, t) && 'Nova',
  12324. r = { type: o.PLATFORMS_MAP.mobile, vendor: 'Huawei' };
  12325. return e && (r.model = e), r;
  12326. },
  12327. },
  12328. {
  12329. test: [/nexus\s*(?:7|8|9|10).*/i],
  12330. describe: function () {
  12331. return { type: o.PLATFORMS_MAP.tablet, vendor: 'Nexus' };
  12332. },
  12333. },
  12334. {
  12335. test: [/ipad/i],
  12336. describe: function () {
  12337. return {
  12338. type: o.PLATFORMS_MAP.tablet,
  12339. vendor: 'Apple',
  12340. model: 'iPad',
  12341. };
  12342. },
  12343. },
  12344. {
  12345. test: [/Macintosh(.*?) FxiOS(.*?)\//],
  12346. describe: function () {
  12347. return {
  12348. type: o.PLATFORMS_MAP.tablet,
  12349. vendor: 'Apple',
  12350. model: 'iPad',
  12351. };
  12352. },
  12353. },
  12354. {
  12355. test: [/kftt build/i],
  12356. describe: function () {
  12357. return {
  12358. type: o.PLATFORMS_MAP.tablet,
  12359. vendor: 'Amazon',
  12360. model: 'Kindle Fire HD 7',
  12361. };
  12362. },
  12363. },
  12364. {
  12365. test: [/silk/i],
  12366. describe: function () {
  12367. return { type: o.PLATFORMS_MAP.tablet, vendor: 'Amazon' };
  12368. },
  12369. },
  12370. {
  12371. test: [/tablet(?! pc)/i],
  12372. describe: function () {
  12373. return { type: o.PLATFORMS_MAP.tablet };
  12374. },
  12375. },
  12376. {
  12377. test: function (t) {
  12378. var e = t.test(/ipod|iphone/i),
  12379. r = t.test(/like (ipod|iphone)/i);
  12380. return e && !r;
  12381. },
  12382. describe: function (t) {
  12383. var e = i.default.getFirstMatch(/(ipod|iphone)/i, t);
  12384. return {
  12385. type: o.PLATFORMS_MAP.mobile,
  12386. vendor: 'Apple',
  12387. model: e,
  12388. };
  12389. },
  12390. },
  12391. {
  12392. test: [/nexus\s*[0-6].*/i, /galaxy nexus/i],
  12393. describe: function () {
  12394. return { type: o.PLATFORMS_MAP.mobile, vendor: 'Nexus' };
  12395. },
  12396. },
  12397. {
  12398. test: [/[^-]mobi/i],
  12399. describe: function () {
  12400. return { type: o.PLATFORMS_MAP.mobile };
  12401. },
  12402. },
  12403. {
  12404. test: function (t) {
  12405. return 'blackberry' === t.getBrowserName(!0);
  12406. },
  12407. describe: function () {
  12408. return { type: o.PLATFORMS_MAP.mobile, vendor: 'BlackBerry' };
  12409. },
  12410. },
  12411. {
  12412. test: function (t) {
  12413. return 'bada' === t.getBrowserName(!0);
  12414. },
  12415. describe: function () {
  12416. return { type: o.PLATFORMS_MAP.mobile };
  12417. },
  12418. },
  12419. {
  12420. test: function (t) {
  12421. return 'windows phone' === t.getBrowserName();
  12422. },
  12423. describe: function () {
  12424. return { type: o.PLATFORMS_MAP.mobile, vendor: 'Microsoft' };
  12425. },
  12426. },
  12427. {
  12428. test: function (t) {
  12429. var e = Number(String(t.getOSVersion()).split('.')[0]);
  12430. return 'android' === t.getOSName(!0) && e >= 3;
  12431. },
  12432. describe: function () {
  12433. return { type: o.PLATFORMS_MAP.tablet };
  12434. },
  12435. },
  12436. {
  12437. test: function (t) {
  12438. return 'android' === t.getOSName(!0);
  12439. },
  12440. describe: function () {
  12441. return { type: o.PLATFORMS_MAP.mobile };
  12442. },
  12443. },
  12444. {
  12445. test: function (t) {
  12446. return 'macos' === t.getOSName(!0);
  12447. },
  12448. describe: function () {
  12449. return { type: o.PLATFORMS_MAP.desktop, vendor: 'Apple' };
  12450. },
  12451. },
  12452. {
  12453. test: function (t) {
  12454. return 'windows' === t.getOSName(!0);
  12455. },
  12456. describe: function () {
  12457. return { type: o.PLATFORMS_MAP.desktop };
  12458. },
  12459. },
  12460. {
  12461. test: function (t) {
  12462. return 'linux' === t.getOSName(!0);
  12463. },
  12464. describe: function () {
  12465. return { type: o.PLATFORMS_MAP.desktop };
  12466. },
  12467. },
  12468. {
  12469. test: function (t) {
  12470. return 'playstation 4' === t.getOSName(!0);
  12471. },
  12472. describe: function () {
  12473. return { type: o.PLATFORMS_MAP.tv };
  12474. },
  12475. },
  12476. {
  12477. test: function (t) {
  12478. return 'roku' === t.getOSName(!0);
  12479. },
  12480. describe: function () {
  12481. return { type: o.PLATFORMS_MAP.tv };
  12482. },
  12483. },
  12484. ];
  12485. (e.default = s), (t.exports = e.default);
  12486. },
  12487. 95: function (t, e, r) {
  12488. (e.__esModule = !0), (e.default = void 0);
  12489. var n,
  12490. i = (n = r(17)) && n.__esModule ? n : { default: n },
  12491. o = r(18),
  12492. s = [
  12493. {
  12494. test: function (t) {
  12495. return 'microsoft edge' === t.getBrowserName(!0);
  12496. },
  12497. describe: function (t) {
  12498. if (/\sedg\//i.test(t)) return { name: o.ENGINE_MAP.Blink };
  12499. var e = i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, t);
  12500. return { name: o.ENGINE_MAP.EdgeHTML, version: e };
  12501. },
  12502. },
  12503. {
  12504. test: [/trident/i],
  12505. describe: function (t) {
  12506. var e = { name: o.ENGINE_MAP.Trident },
  12507. r = i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, t);
  12508. return r && (e.version = r), e;
  12509. },
  12510. },
  12511. {
  12512. test: function (t) {
  12513. return t.test(/presto/i);
  12514. },
  12515. describe: function (t) {
  12516. var e = { name: o.ENGINE_MAP.Presto },
  12517. r = i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, t);
  12518. return r && (e.version = r), e;
  12519. },
  12520. },
  12521. {
  12522. test: function (t) {
  12523. var e = t.test(/gecko/i),
  12524. r = t.test(/like gecko/i);
  12525. return e && !r;
  12526. },
  12527. describe: function (t) {
  12528. var e = { name: o.ENGINE_MAP.Gecko },
  12529. r = i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, t);
  12530. return r && (e.version = r), e;
  12531. },
  12532. },
  12533. {
  12534. test: [/(apple)?webkit\/537\.36/i],
  12535. describe: function () {
  12536. return { name: o.ENGINE_MAP.Blink };
  12537. },
  12538. },
  12539. {
  12540. test: [/(apple)?webkit/i],
  12541. describe: function (t) {
  12542. var e = { name: o.ENGINE_MAP.WebKit },
  12543. r = i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, t);
  12544. return r && (e.version = r), e;
  12545. },
  12546. },
  12547. ];
  12548. (e.default = s), (t.exports = e.default);
  12549. },
  12550. });
  12551. })(nP);
  12552. var iP = r(nP.exports),
  12553. oP = (function () {
  12554. function t() {
  12555. (this.baseUrl = ''), this.setSignalingServer('webrtcpush.myqcloud.com');
  12556. }
  12557. return (
  12558. (t.prototype.setSignalingServer = function (t) {
  12559. this.baseUrl = 'https://'.concat(t);
  12560. }),
  12561. (t.prototype.fetchPushStream = function (t) {
  12562. return Ed(this, void 0, void 0, function () {
  12563. var e, r, n, i, o;
  12564. return Sd(this, function (s) {
  12565. switch (s.label) {
  12566. case 0:
  12567. (e = ''.concat(this.baseUrl, '/webrtc/v1/pushstream')),
  12568. (s.label = 1);
  12569. case 1:
  12570. return s.trys.push([1, 3, , 4]), [4, aE(e, t)];
  12571. case 2:
  12572. var a;
  12573. if (
  12574. ((r = s.sent()),
  12575. (n = r.errcode),
  12576. (i = r.errmsg),
  12577. (o = r.remotesdp),
  12578. 0 !== n)
  12579. )
  12580. throw new Error(
  12581. mh(
  12582. (a = 'push stream failed, errCode:'.concat(
  12583. n,
  12584. ', errMsg:'
  12585. ))
  12586. ).call(a, i)
  12587. );
  12588. return [2, { remoteSdp: o, sessionId: t.sessionid }];
  12589. case 3:
  12590. throw s.sent();
  12591. case 4:
  12592. return [2];
  12593. }
  12594. });
  12595. });
  12596. }),
  12597. (t.prototype.fetchStopStream = function (t) {
  12598. return Ed(this, void 0, void 0, function () {
  12599. var e, r, n, i;
  12600. return Sd(this, function (o) {
  12601. switch (o.label) {
  12602. case 0:
  12603. (e = ''.concat(this.baseUrl, '/webrtc/v1/stopstream')),
  12604. (o.label = 1);
  12605. case 1:
  12606. return o.trys.push([1, 3, , 4]), [4, aE(e, t)];
  12607. case 2:
  12608. var s;
  12609. if (
  12610. ((r = o.sent()), (n = r.errcode), (i = r.errmsg), 0 !== n)
  12611. )
  12612. throw new Error(
  12613. mh(
  12614. (s = 'stop stream failed, errCode:'.concat(
  12615. n,
  12616. ', errmsg:'
  12617. ))
  12618. ).call(s, i)
  12619. );
  12620. return [2, r];
  12621. case 3:
  12622. throw o.sent();
  12623. case 4:
  12624. return [2];
  12625. }
  12626. });
  12627. });
  12628. }),
  12629. t
  12630. );
  12631. })(),
  12632. sP = function (t, e, r) {
  12633. var n,
  12634. i,
  12635. o,
  12636. s = 'AS';
  12637. 'firefox' === Mf.browserDetails.browser && ((e *= 1e3), (s = 'TIAS'));
  12638. var a = new RegExp(
  12639. mh((n = 'm='.concat(t, ' (.*)\r\nc=IN (.*)\r\nb='))).call(
  12640. n,
  12641. s,
  12642. ':(.*)\r\n'
  12643. )
  12644. ),
  12645. u = new RegExp('m='.concat(t, ' (.*)\r\nc=IN (.*)\r\n')),
  12646. c = mh(
  12647. (i = mh((o = 'm='.concat(t, ' $1\r\nc=IN $2\r\nb='))).call(o, s, ':'))
  12648. ).call(i, e, '\r\n');
  12649. return (r = a.test(r) ? r.replace(a, c) : r.replace(u, c));
  12650. },
  12651. aP = function (t) {
  12652. var e = t.split('\r\n'),
  12653. r = [];
  12654. return (
  12655. Ph(e).call(e, function (t) {
  12656. var e = t;
  12657. Jl(t).call(t, 'a=fmtp:111') && (e = ''.concat(t, ';stereo=1'));
  12658. var n,
  12659. i = /a=rtpmap:(\d+) (opus|vp8|vp9|h264|h265|av1)/i.exec(t);
  12660. i &&
  12661. (e = mh((n = ''.concat(t, '\r\na=rtcp-fb:'))).call(
  12662. n,
  12663. i[1],
  12664. ' rrtr'
  12665. ));
  12666. r.push(e);
  12667. }),
  12668. r.join('\r\n')
  12669. );
  12670. },
  12671. uP = Yf('connection'),
  12672. cP = (function () {
  12673. function t(t) {
  12674. var e, r, n;
  12675. void 0 === t && (t = {}),
  12676. (this.status = $f),
  12677. (this.url = null),
  12678. (this.stream = null),
  12679. (this.bitrate = { video: null, audio: null }),
  12680. (this.signaling = null),
  12681. (this.signalingConfig = {}),
  12682. (this.listener = {
  12683. onEvent: null,
  12684. onStatusUpdate: null,
  12685. onStatisticsUpdate: null,
  12686. }),
  12687. (this.promise = null),
  12688. (this.peerConnection = null),
  12689. (this.negotiating = !1),
  12690. (this.intervalId = null),
  12691. (this.lastStatsReport = null),
  12692. (this.sessionId = null);
  12693. var i = t.url,
  12694. o = t.streamSource,
  12695. s = t.videoBitrate,
  12696. a = t.audioBitrate,
  12697. u = t.signalingConfig,
  12698. c = t.onEvent,
  12699. h = t.onStatusUpdate,
  12700. l = t.onStatisticsUpdate;
  12701. i && this.setUrl(i),
  12702. o && this.setStreamSource(o),
  12703. s && this.setVideoBitrate(s),
  12704. a && this.setAudioBitrate(a),
  12705. u && this.setSignalingConfig(u),
  12706. (this.signaling = new oP()),
  12707. c && 'function' == typeof c && (this.listener.onEvent = c),
  12708. h && 'function' == typeof h && (this.listener.onStatusUpdate = h),
  12709. l && 'function' == typeof l && (this.listener.onStatisticsUpdate = l),
  12710. (this.onIceConnectionStateChange = lh(
  12711. (e = this.onIceConnectionStateChange)
  12712. ).call(e, this)),
  12713. (this.onConnectionStateChange = lh(
  12714. (r = this.onConnectionStateChange)
  12715. ).call(r, this)),
  12716. (this.onNegotiationNeeded = lh((n = this.onNegotiationNeeded)).call(
  12717. n,
  12718. this
  12719. ));
  12720. }
  12721. return (
  12722. (t.prototype.setUrl = function (t) {
  12723. if (t) {
  12724. var e = (function (t) {
  12725. var e =
  12726. /^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_]+)(?:\/)([^?#]*)(?:\?*)(?:[^?#]*)/.exec(
  12727. t
  12728. );
  12729. return e ? e[1] : null;
  12730. })(t);
  12731. null !== e ? (this.url = t) : uP('url is invalid');
  12732. } else uP('url is not existed');
  12733. }),
  12734. (t.prototype.setStreamSource = function (t) {
  12735. t
  12736. ? t instanceof MediaStream || t instanceof UC
  12737. ? (this.stream =
  12738. t instanceof MediaStream ? t : t.getMediaStream())
  12739. : uP('streamSource is invalid')
  12740. : uP('streamSource is not existed');
  12741. }),
  12742. (t.prototype.setVideoBitrate = function (t) {
  12743. 'number' == typeof t && t > 0
  12744. ? this.setBitrate('video', t)
  12745. : uP('videoBitrate must be a number greater than 0');
  12746. }),
  12747. (t.prototype.setAudioBitrate = function (t) {
  12748. 'number' == typeof t && t > 0
  12749. ? this.setBitrate('audio', t)
  12750. : uP('audioBitrate must be a number greater than 0');
  12751. }),
  12752. (t.prototype.setSignalingConfig = function (t) {
  12753. if (t) {
  12754. var e = t.domainName,
  12755. r = t.extraParams;
  12756. e &&
  12757. 'string' == typeof e &&
  12758. ((this.signalingConfig.domainName = e),
  12759. this.signaling.setSignalingServer(e)),
  12760. r && 'object' === Wc(r) && (this.signalingConfig.extraParams = r);
  12761. } else uP('signalingConfig is not existed');
  12762. }),
  12763. (t.prototype.start = function () {
  12764. var t = this,
  12765. e = this,
  12766. r = e.status,
  12767. n = e.url,
  12768. i = e.stream;
  12769. return new zx(function (e, o) {
  12770. t.promise = { resolve: e, reject: o };
  12771. var s = function (t) {
  12772. var e = new Error(t);
  12773. return (e.name = 'CheckError'), e;
  12774. };
  12775. return n
  12776. ? i
  12777. ? r !== $f
  12778. ? (uP('stream is pushing'), void o(s('stream is pushing')))
  12779. : void t.startConnect()
  12780. : (uP('stream is invalid'), void o(s('stream is invalid')))
  12781. : (uP('url is invalid'), void o(s('url is invalid')));
  12782. });
  12783. }),
  12784. (t.prototype.stop = function () {
  12785. this.url &&
  12786. this.sessionId &&
  12787. (this.signaling
  12788. .fetchStopStream({
  12789. streamurl: this.url,
  12790. sessionid: this.sessionId,
  12791. })
  12792. .catch(function (t) {
  12793. uP('request stop error, '.concat(t.toString()));
  12794. }),
  12795. (this.sessionId = null)),
  12796. this.stopConnect();
  12797. }),
  12798. (t.prototype.replaceStreamTrack = function (t) {
  12799. return Ed(this, void 0, void 0, function () {
  12800. var e, r;
  12801. return Sd(this, function (n) {
  12802. var i;
  12803. switch (n.label) {
  12804. case 0:
  12805. if (this.status !== ep)
  12806. throw (
  12807. (uP('no stream is pushing'),
  12808. new Error('no stream is pushing'))
  12809. );
  12810. if (!(t instanceof MediaStreamTrack))
  12811. throw (
  12812. (uP('newTrack must be MediaStreamTrack'),
  12813. new Error('newTrack must be MediaStreamTrack'))
  12814. );
  12815. n.label = 1;
  12816. case 1:
  12817. return (
  12818. n.trys.push([1, 4, , 5]),
  12819. (e = El((i = this.peerConnection.getSenders())).call(
  12820. i,
  12821. function (e) {
  12822. return e.track && e.track.kind === t.kind;
  12823. }
  12824. ))
  12825. ? [4, e.replaceTrack(t)]
  12826. : [3, 3]
  12827. );
  12828. case 2:
  12829. n.sent(), (n.label = 3);
  12830. case 3:
  12831. return [3, 5];
  12832. case 4:
  12833. throw ((r = n.sent()), uP('sender replaceTrack failed'), r);
  12834. case 5:
  12835. return [2];
  12836. }
  12837. });
  12838. });
  12839. }),
  12840. (t.prototype.getLocalDescription = function () {
  12841. var t;
  12842. return null === (t = this.peerConnection) || void 0 === t
  12843. ? void 0
  12844. : t.localDescription;
  12845. }),
  12846. (t.prototype.getRemoteDescription = function () {
  12847. var t;
  12848. return null === (t = this.peerConnection) || void 0 === t
  12849. ? void 0
  12850. : t.remoteDescription;
  12851. }),
  12852. (t.prototype.startConnect = function () {
  12853. var t,
  12854. e,
  12855. r,
  12856. n = this;
  12857. try {
  12858. this.peerConnection = new RTCPeerConnection({
  12859. iceServers: [],
  12860. bundlePolicy: 'max-bundle',
  12861. rtcpMuxPolicy: 'require',
  12862. });
  12863. } catch (t) {
  12864. return (
  12865. uP('create connection error, '.concat(t.toString())),
  12866. void this.promise.reject(t)
  12867. );
  12868. }
  12869. (this.status = tp),
  12870. null === (r = (e = this.listener).onStatusUpdate) ||
  12871. void 0 === r ||
  12872. r.call(e, { type: tp, data: { message: 'connecting' } }),
  12873. (this.negotiating = !1),
  12874. this.peerConnection.addEventListener(
  12875. 'iceconnectionstatechange',
  12876. this.onIceConnectionStateChange
  12877. ),
  12878. this.peerConnection.addEventListener(
  12879. 'connectionstatechange',
  12880. this.onConnectionStateChange
  12881. ),
  12882. this.peerConnection.addEventListener(
  12883. 'negotiationneeded',
  12884. this.onNegotiationNeeded
  12885. ),
  12886. Ph((t = this.stream.getTracks())).call(t, function (t) {
  12887. n.peerConnection.addTrack(t, n.stream);
  12888. });
  12889. }),
  12890. (t.prototype.stopConnect = function (t) {
  12891. var e, r;
  12892. void 0 === t && (t = 'manual stop'),
  12893. this.status !== $f &&
  12894. (this.destroyConnect(),
  12895. null === (r = (e = this.listener).onStatusUpdate) ||
  12896. void 0 === r ||
  12897. r.call(e, { type: $f, data: { message: t } }));
  12898. }),
  12899. (t.prototype.destroyConnect = function () {
  12900. (this.status = $f),
  12901. (this.negotiating = !1),
  12902. (this.lastStatsReport = null),
  12903. (this.promise = null),
  12904. this.intervalId &&
  12905. (window.clearInterval(this.intervalId), (this.intervalId = null)),
  12906. this.peerConnection &&
  12907. (this.peerConnection.removeEventListener(
  12908. 'iceconnectionstatechange',
  12909. this.onIceConnectionStateChange
  12910. ),
  12911. this.peerConnection.removeEventListener(
  12912. 'connectionstatechange',
  12913. this.onConnectionStateChange
  12914. ),
  12915. this.peerConnection.removeEventListener(
  12916. 'negotiationneeded',
  12917. this.onNegotiationNeeded
  12918. ),
  12919. this.peerConnection.close(),
  12920. (this.peerConnection = null));
  12921. }),
  12922. (t.prototype.onIceConnectionStateChange = function () {
  12923. switch (
  12924. (uP(
  12925. 'onIceConnectionStateChange: '.concat(
  12926. this.peerConnection.iceConnectionState
  12927. )
  12928. ),
  12929. this.peerConnection.iceConnectionState)
  12930. ) {
  12931. case 'failed':
  12932. case 'disconnected':
  12933. uP('iceConnection disconnected, please try again'),
  12934. this.promise.reject(new Error('connection disconnected')),
  12935. this.stopConnect('connection disconnected');
  12936. }
  12937. }),
  12938. (t.prototype.onConnectionStateChange = function () {
  12939. var t, e;
  12940. switch (
  12941. (uP(
  12942. 'onConnectionStateChange: '.concat(
  12943. this.peerConnection.connectionState
  12944. )
  12945. ),
  12946. this.peerConnection.connectionState)
  12947. ) {
  12948. case 'failed':
  12949. case 'disconnected':
  12950. uP('connection disconnected, please try again'),
  12951. this.promise.reject(new Error('connection disconnected')),
  12952. this.stopConnect('connection disconnected');
  12953. break;
  12954. case 'connected':
  12955. uP('connection connected'),
  12956. (this.status = ep),
  12957. null === (e = (t = this.listener).onStatusUpdate) ||
  12958. void 0 === e ||
  12959. e.call(t, { type: ep, data: { message: 'connected' } });
  12960. var r = this.bitrate,
  12961. n = r.video,
  12962. i = r.audio;
  12963. n && this.setBitrate('video', n),
  12964. i && this.setBitrate('audio', i),
  12965. this.startStatReport(),
  12966. this.promise.resolve();
  12967. }
  12968. }),
  12969. (t.prototype.onNegotiationNeeded = function () {
  12970. uP('onNegotiationNeeded'), this.createOffer();
  12971. }),
  12972. (t.prototype.createOffer = function () {
  12973. return Ed(this, void 0, void 0, function () {
  12974. var t, e;
  12975. return Sd(this, function (r) {
  12976. switch (r.label) {
  12977. case 0:
  12978. if (
  12979. this.negotiating ||
  12980. 'stable' !== this.peerConnection.signalingState
  12981. )
  12982. return [2];
  12983. (this.negotiating = !0), (r.label = 1);
  12984. case 1:
  12985. return (
  12986. r.trys.push([1, 4, 5, 6]),
  12987. [4, this.peerConnection.createOffer()]
  12988. );
  12989. case 2:
  12990. return (
  12991. ((t = r.sent()).sdp = aP(t.sdp)),
  12992. [4, this.peerConnection.setLocalDescription(t)]
  12993. );
  12994. case 3:
  12995. return r.sent(), this.sendOffer(t), [3, 6];
  12996. case 4:
  12997. return (
  12998. (e = r.sent()),
  12999. uP('setLocalDescription error, '.concat(e.toString())),
  13000. this.promise.reject(e),
  13001. this.destroyConnect(),
  13002. [3, 6]
  13003. );
  13004. case 5:
  13005. return (this.negotiating = !1), [7];
  13006. case 6:
  13007. return [2];
  13008. }
  13009. });
  13010. });
  13011. }),
  13012. (t.prototype.sendOffer = function (t) {
  13013. var e, r, n, i, o;
  13014. return Ed(this, void 0, void 0, function () {
  13015. var s, a, u, c, h, l, d, f, p;
  13016. return Sd(this, function (v) {
  13017. var m, y, g;
  13018. switch (v.label) {
  13019. case 0:
  13020. null === (r = (e = this.listener).onEvent) ||
  13021. void 0 === r ||
  13022. r.call(e, {
  13023. type: rp,
  13024. data: { message: 'request push start' },
  13025. }),
  13026. (v.label = 1);
  13027. case 1:
  13028. return (
  13029. v.trys.push([1, 3, , 4]),
  13030. (s = iP.parse(window.navigator.userAgent)),
  13031. (a = s.browser),
  13032. (u = s.os),
  13033. (c = mh(
  13034. (m = mh(
  13035. (y = mh((g = ''.concat(u.name || 'other', ' '))).call(
  13036. g,
  13037. u.version,
  13038. ';'
  13039. ))
  13040. ).call(y, a.name || 'other', ' '))
  13041. ).call(m, a.version)),
  13042. (h =
  13043. null !== (n = this.signalingConfig.extraParams) &&
  13044. void 0 !== n
  13045. ? n
  13046. : {}),
  13047. [
  13048. 4,
  13049. this.signaling.fetchPushStream(
  13050. xd(
  13051. {
  13052. streamurl: this.url,
  13053. sessionid: Df(),
  13054. clientinfo: c,
  13055. clienttype: 'TXLivePusher-'.concat(zf),
  13056. localsdp: t,
  13057. },
  13058. h
  13059. )
  13060. ),
  13061. ]
  13062. );
  13063. case 2:
  13064. return (
  13065. (l = v.sent()),
  13066. (d = l.remoteSdp),
  13067. (f = l.sessionId),
  13068. null === (o = (i = this.listener).onEvent) ||
  13069. void 0 === o ||
  13070. o.call(i, {
  13071. type: np,
  13072. data: { message: 'request push success' },
  13073. }),
  13074. (this.sessionId = f),
  13075. this.handleAnswer(d),
  13076. [3, 4]
  13077. );
  13078. case 3:
  13079. return (
  13080. (p = v.sent()),
  13081. uP('request push error, '.concat(p.toString())),
  13082. (p.name = 'RequestError'),
  13083. this.promise.reject(p),
  13084. this.stopConnect('connection disconnected'),
  13085. [3, 4]
  13086. );
  13087. case 4:
  13088. return [2];
  13089. }
  13090. });
  13091. });
  13092. }),
  13093. (t.prototype.handleAnswer = function (t) {
  13094. return Ed(this, void 0, void 0, function () {
  13095. var e;
  13096. return Sd(this, function (r) {
  13097. switch (r.label) {
  13098. case 0:
  13099. return (
  13100. r.trys.push([0, 2, , 3]),
  13101. [
  13102. 4,
  13103. this.peerConnection.setRemoteDescription(
  13104. new RTCSessionDescription(t)
  13105. ),
  13106. ]
  13107. );
  13108. case 1:
  13109. return r.sent(), [3, 3];
  13110. case 2:
  13111. return (
  13112. (e = r.sent()),
  13113. uP('setRemoteDescription error, '.concat(e.toString())),
  13114. this.promise.reject(e),
  13115. this.destroyConnect(),
  13116. [3, 3]
  13117. );
  13118. case 3:
  13119. return [2];
  13120. }
  13121. });
  13122. });
  13123. }),
  13124. (t.prototype.setBitrate = function (t, e) {
  13125. return Ed(this, void 0, void 0, function () {
  13126. var r, n, i, o, s, a, u, c, h, l;
  13127. return Sd(this, function (d) {
  13128. var f, p;
  13129. switch (d.label) {
  13130. case 0:
  13131. if (((this.bitrate[t] = e), this.status !== ep)) return [2];
  13132. if (
  13133. ((r = Mf.browserDetails),
  13134. (n = r.browser),
  13135. (i = r.version),
  13136. !(
  13137. ('chrome' === n ||
  13138. 'safari' === n ||
  13139. ('firefox' === n && i >= 64)) &&
  13140. 'RTCRtpSender' in window &&
  13141. 'setParameters' in window.RTCRtpSender.prototype
  13142. ))
  13143. )
  13144. return [3, 5];
  13145. if (
  13146. !(o = El((f = this.peerConnection.getSenders())).call(
  13147. f,
  13148. function (e) {
  13149. return e.track && e.track.kind === t;
  13150. }
  13151. ))
  13152. )
  13153. return [3, 4];
  13154. ((s = o.getParameters()).encodings &&
  13155. 0 !== s.encodings.length) ||
  13156. (s.encodings = [{}]),
  13157. (s.encodings[0].maxBitrate = 1e3 * e),
  13158. (d.label = 1);
  13159. case 1:
  13160. return d.trys.push([1, 3, , 4]), [4, o.setParameters(s)];
  13161. case 2:
  13162. return (
  13163. d.sent(),
  13164. uP(
  13165. mh((p = ''.concat(t, ' bandwidth is set to '))).call(
  13166. p,
  13167. e,
  13168. ' kbps'
  13169. )
  13170. ),
  13171. [3, 4]
  13172. );
  13173. case 3:
  13174. return (
  13175. d.sent(),
  13176. uP('failed to set bandwidth by setting maxBitrate'),
  13177. [3, 4]
  13178. );
  13179. case 4:
  13180. return [2];
  13181. case 5:
  13182. return (
  13183. d.trys.push([5, 9, , 10]),
  13184. [4, this.peerConnection.createOffer()]
  13185. );
  13186. case 6:
  13187. return (
  13188. ((a = d.sent()).sdp = aP(a.sdp)),
  13189. [4, this.peerConnection.setLocalDescription(a)]
  13190. );
  13191. case 7:
  13192. return (
  13193. d.sent(),
  13194. (u = this.peerConnection.remoteDescription),
  13195. (c = u.type),
  13196. (h = u.sdp),
  13197. (l = { type: c, sdp: sP(t, e, h) }),
  13198. uP(
  13199. 'applying bandwidth restriction to setRemoteDescription'
  13200. ),
  13201. [4, this.peerConnection.setRemoteDescription(l)]
  13202. );
  13203. case 8:
  13204. return d.sent(), [3, 10];
  13205. case 9:
  13206. return (
  13207. d.sent(),
  13208. uP(
  13209. 'failed to setRemoteDescription with bandwidth restriction'
  13210. ),
  13211. [3, 10]
  13212. );
  13213. case 10:
  13214. return [2];
  13215. }
  13216. });
  13217. });
  13218. }),
  13219. (t.prototype.startStatReport = function () {
  13220. var t = this;
  13221. this.intervalId &&
  13222. (window.clearInterval(this.intervalId), (this.intervalId = null)),
  13223. (this.intervalId = rP(function () {
  13224. return Ed(t, void 0, void 0, function () {
  13225. var t, e, r, n;
  13226. return Sd(this, function (i) {
  13227. switch (i.label) {
  13228. case 0:
  13229. return this.peerConnection
  13230. ? [4, this.peerConnection.getStats(null)]
  13231. : [2];
  13232. case 1:
  13233. return (
  13234. (t = i.sent()),
  13235. (e = (function (t, e) {
  13236. var r, n, i, o;
  13237. if ((void 0 === e && (e = null), e)) {
  13238. var s = null,
  13239. a = null,
  13240. u = null;
  13241. Ph(t).call(t, function (t) {
  13242. 'track' === t.type &&
  13243. ('video' === t.kind || t.frameWidth) &&
  13244. (s = t.id),
  13245. 'outbound-rtp' === t.type &&
  13246. ('video' === t.kind || 'video' === t.mediaType
  13247. ? (a = t.id)
  13248. : ('audio' !== t.kind &&
  13249. 'audio' !== t.mediaType) ||
  13250. (u = t.id));
  13251. });
  13252. var c = t.get(s),
  13253. h = t.get(a),
  13254. l = e.get(s),
  13255. d = e.get(a),
  13256. f = void 0;
  13257. void 0 !== (null == h ? void 0 : h.timestamp) &&
  13258. void 0 !== (null == d ? void 0 : d.timestamp) &&
  13259. (f = (h.timestamp - d.timestamp) / 1e3);
  13260. var p = void 0;
  13261. void 0 !== (null == h ? void 0 : h.framesPerSecond)
  13262. ? (p = h.framesPerSecond)
  13263. : void 0 !==
  13264. (null == h ? void 0 : h.framerateMean)
  13265. ? (p = h.framerateMean)
  13266. : void 0 !==
  13267. (null == h ? void 0 : h.framesSent) &&
  13268. void 0 !==
  13269. (null == d ? void 0 : d.framesSent) &&
  13270. f
  13271. ? (p = (h.framesSent - d.framesSent) / f)
  13272. : void 0 !==
  13273. (null == c ? void 0 : c.framesSent) &&
  13274. void 0 !==
  13275. (null == l ? void 0 : l.framesSent) &&
  13276. f &&
  13277. (p = (c.framesSent - l.framesSent) / f);
  13278. var v = void 0;
  13279. void 0 !== (null == h ? void 0 : h.bytesSent) &&
  13280. void 0 !== (null == d ? void 0 : d.bytesSent) &&
  13281. f &&
  13282. (v = (8 * (h.bytesSent - d.bytesSent)) / f);
  13283. var m = void 0;
  13284. void 0 !==
  13285. (null == h ? void 0 : h.totalEncodeTime) &&
  13286. void 0 !==
  13287. (null == h ? void 0 : h.framesEncoded) &&
  13288. void 0 !==
  13289. (null == d ? void 0 : d.totalEncodeTime) &&
  13290. void 0 !==
  13291. (null == d ? void 0 : d.framesEncoded) &&
  13292. (m =
  13293. h.framesEncoded - d.framesEncoded
  13294. ? ((h.totalEncodeTime - d.totalEncodeTime) /
  13295. (h.framesEncoded - d.framesEncoded)) *
  13296. 1e3
  13297. : (h.totalEncodeTime / h.framesEncoded) *
  13298. 1e3);
  13299. var y = void 0;
  13300. void 0 !==
  13301. (null == h ? void 0 : h.totalPacketSendDelay) &&
  13302. void 0 !== (null == h ? void 0 : h.packetsSent) &&
  13303. void 0 !==
  13304. (null == d ? void 0 : d.totalPacketSendDelay) &&
  13305. void 0 !== (null == d ? void 0 : d.packetsSent) &&
  13306. (y =
  13307. h.packetsSent - d.packetsSent
  13308. ? ((h.totalPacketSendDelay -
  13309. d.totalPacketSendDelay) /
  13310. (h.packetsSent - d.packetsSent)) *
  13311. 1e3
  13312. : (h.totalPacketSendDelay / h.packetsSent) *
  13313. 1e3);
  13314. var g = t.get(u),
  13315. _ = e.get(u);
  13316. void 0 !== (null == g ? void 0 : g.timestamp) &&
  13317. void 0 !== (null == _ ? void 0 : _.timestamp) &&
  13318. (f = (g.timestamp - _.timestamp) / 1e3);
  13319. var b = void 0;
  13320. return (
  13321. void 0 !== (null == g ? void 0 : g.bytesSent) &&
  13322. void 0 !== (null == _ ? void 0 : _.bytesSent) &&
  13323. f &&
  13324. (b = (8 * (g.bytesSent - _.bytesSent)) / f),
  13325. {
  13326. timestamp:
  13327. null !==
  13328. (r = null == h ? void 0 : h.timestamp) &&
  13329. void 0 !== r
  13330. ? r
  13331. : null == g
  13332. ? void 0
  13333. : g.timestamp,
  13334. video: {
  13335. bitrate: v && Number(v.toFixed(2)),
  13336. framesPerSecond: p && jy(p.toString(), 10),
  13337. frameWidth:
  13338. null !==
  13339. (n = null == h ? void 0 : h.frameWidth) &&
  13340. void 0 !== n
  13341. ? n
  13342. : null == c
  13343. ? void 0
  13344. : c.frameWidth,
  13345. frameHeight:
  13346. null !==
  13347. (i =
  13348. null == h ? void 0 : h.frameHeight) &&
  13349. void 0 !== i
  13350. ? i
  13351. : null == c
  13352. ? void 0
  13353. : c.frameHeight,
  13354. framesEncoded:
  13355. null == h ? void 0 : h.framesEncoded,
  13356. framesSent:
  13357. null !==
  13358. (o = null == h ? void 0 : h.framesSent) &&
  13359. void 0 !== o
  13360. ? o
  13361. : null == c
  13362. ? void 0
  13363. : c.framesSent,
  13364. packetsSent:
  13365. null == h ? void 0 : h.packetsSent,
  13366. nackCount: null == h ? void 0 : h.nackCount,
  13367. firCount: null == h ? void 0 : h.firCount,
  13368. pliCount: null == h ? void 0 : h.pliCount,
  13369. frameEncodeAvgTime: m && Number(m.toFixed(2)),
  13370. packetSendDelay: y && Number(y.toFixed(2)),
  13371. },
  13372. audio: {
  13373. bitrate: b && Number(b.toFixed(2)),
  13374. packetsSent:
  13375. null == g ? void 0 : g.packetsSent,
  13376. },
  13377. }
  13378. );
  13379. }
  13380. })(t, this.lastStatsReport)),
  13381. (this.lastStatsReport = t),
  13382. e &&
  13383. (null ===
  13384. (n = (r = this.listener).onStatisticsUpdate) ||
  13385. void 0 === n ||
  13386. n.call(r, e)),
  13387. [2]
  13388. );
  13389. }
  13390. });
  13391. });
  13392. }, 1e3));
  13393. }),
  13394. t
  13395. );
  13396. })();
  13397. function hP(t, e) {
  13398. (this.name = 'AggregateError'), (this.errors = t), (this.message = e || '');
  13399. }
  13400. hP.prototype = Error.prototype;
  13401. var lP = setTimeout;
  13402. function dP(t) {
  13403. return Boolean(t && void 0 !== t.length);
  13404. }
  13405. function fP() {}
  13406. function pP(t) {
  13407. if (!(this instanceof pP))
  13408. throw new TypeError('Promises must be constructed via new');
  13409. if ('function' != typeof t) throw new TypeError('not a function');
  13410. (this._state = 0),
  13411. (this._handled = !1),
  13412. (this._value = void 0),
  13413. (this._deferreds = []),
  13414. bP(t, this);
  13415. }
  13416. function vP(t, e) {
  13417. for (; 3 === t._state; ) t = t._value;
  13418. 0 !== t._state
  13419. ? ((t._handled = !0),
  13420. pP._immediateFn(function () {
  13421. var r = 1 === t._state ? e.onFulfilled : e.onRejected;
  13422. if (null !== r) {
  13423. var n;
  13424. try {
  13425. n = r(t._value);
  13426. } catch (t) {
  13427. return void yP(e.promise, t);
  13428. }
  13429. mP(e.promise, n);
  13430. } else (1 === t._state ? mP : yP)(e.promise, t._value);
  13431. }))
  13432. : t._deferreds.push(e);
  13433. }
  13434. function mP(t, e) {
  13435. try {
  13436. if (e === t)
  13437. throw new TypeError('A promise cannot be resolved with itself.');
  13438. if (e && ('object' == typeof e || 'function' == typeof e)) {
  13439. var r = e.then;
  13440. if (e instanceof pP) return (t._state = 3), (t._value = e), void gP(t);
  13441. if ('function' == typeof r)
  13442. return void bP(
  13443. ((n = r),
  13444. (i = e),
  13445. function () {
  13446. n.apply(i, arguments);
  13447. }),
  13448. t
  13449. );
  13450. }
  13451. (t._state = 1), (t._value = e), gP(t);
  13452. } catch (e) {
  13453. yP(t, e);
  13454. }
  13455. var n, i;
  13456. }
  13457. function yP(t, e) {
  13458. (t._state = 2), (t._value = e), gP(t);
  13459. }
  13460. function gP(t) {
  13461. 2 === t._state &&
  13462. 0 === t._deferreds.length &&
  13463. pP._immediateFn(function () {
  13464. t._handled || pP._unhandledRejectionFn(t._value);
  13465. });
  13466. for (var e = 0, r = t._deferreds.length; e < r; e++) vP(t, t._deferreds[e]);
  13467. t._deferreds = null;
  13468. }
  13469. function _P(t, e, r) {
  13470. (this.onFulfilled = 'function' == typeof t ? t : null),
  13471. (this.onRejected = 'function' == typeof e ? e : null),
  13472. (this.promise = r);
  13473. }
  13474. function bP(t, e) {
  13475. var r = !1;
  13476. try {
  13477. t(
  13478. function (t) {
  13479. r || ((r = !0), mP(e, t));
  13480. },
  13481. function (t) {
  13482. r || ((r = !0), yP(e, t));
  13483. }
  13484. );
  13485. } catch (t) {
  13486. if (r) return;
  13487. (r = !0), yP(e, t);
  13488. }
  13489. }
  13490. (pP.prototype.catch = function (t) {
  13491. return this.then(null, t);
  13492. }),
  13493. (pP.prototype.then = function (t, e) {
  13494. var r = new this.constructor(fP);
  13495. return vP(this, new _P(t, e, r)), r;
  13496. }),
  13497. (pP.prototype.finally = function (t) {
  13498. var e = this.constructor;
  13499. return this.then(
  13500. function (r) {
  13501. return e.resolve(t()).then(function () {
  13502. return r;
  13503. });
  13504. },
  13505. function (r) {
  13506. return e.resolve(t()).then(function () {
  13507. return e.reject(r);
  13508. });
  13509. }
  13510. );
  13511. }),
  13512. (pP.all = function (t) {
  13513. return new pP(function (e, r) {
  13514. if (!dP(t)) return r(new TypeError('Promise.all accepts an array'));
  13515. var n = Array.prototype.slice.call(t);
  13516. if (0 === n.length) return e([]);
  13517. var i = n.length;
  13518. function o(t, s) {
  13519. try {
  13520. if (s && ('object' == typeof s || 'function' == typeof s)) {
  13521. var a = s.then;
  13522. if ('function' == typeof a)
  13523. return void a.call(
  13524. s,
  13525. function (e) {
  13526. o(t, e);
  13527. },
  13528. r
  13529. );
  13530. }
  13531. (n[t] = s), 0 == --i && e(n);
  13532. } catch (t) {
  13533. r(t);
  13534. }
  13535. }
  13536. for (var s = 0; s < n.length; s++) o(s, n[s]);
  13537. });
  13538. }),
  13539. (pP.any = function (t) {
  13540. var e = this;
  13541. return new e(function (r, n) {
  13542. if (!t || void 0 === t.length)
  13543. return n(new TypeError('Promise.any accepts an array'));
  13544. var i = Array.prototype.slice.call(t);
  13545. if (0 === i.length) return n();
  13546. for (var o = [], s = 0; s < i.length; s++)
  13547. try {
  13548. e.resolve(i[s])
  13549. .then(r)
  13550. .catch(function (t) {
  13551. o.push(t),
  13552. o.length === i.length &&
  13553. n(new hP(o, 'All promises were rejected'));
  13554. });
  13555. } catch (t) {
  13556. n(t);
  13557. }
  13558. });
  13559. }),
  13560. (pP.allSettled = function (t) {
  13561. return new this(function (e, r) {
  13562. if (!t || void 0 === t.length)
  13563. return r(
  13564. new TypeError(
  13565. typeof t +
  13566. ' ' +
  13567. t +
  13568. ' is not iterable(cannot read property Symbol(Symbol.iterator))'
  13569. )
  13570. );
  13571. var n = Array.prototype.slice.call(t);
  13572. if (0 === n.length) return e([]);
  13573. var i = n.length;
  13574. function o(t, r) {
  13575. if (r && ('object' == typeof r || 'function' == typeof r)) {
  13576. var s = r.then;
  13577. if ('function' == typeof s)
  13578. return void s.call(
  13579. r,
  13580. function (e) {
  13581. o(t, e);
  13582. },
  13583. function (r) {
  13584. (n[t] = { status: 'rejected', reason: r }), 0 == --i && e(n);
  13585. }
  13586. );
  13587. }
  13588. (n[t] = { status: 'fulfilled', value: r }), 0 == --i && e(n);
  13589. }
  13590. for (var s = 0; s < n.length; s++) o(s, n[s]);
  13591. });
  13592. }),
  13593. (pP.resolve = function (t) {
  13594. return t && 'object' == typeof t && t.constructor === pP
  13595. ? t
  13596. : new pP(function (e) {
  13597. e(t);
  13598. });
  13599. }),
  13600. (pP.reject = function (t) {
  13601. return new pP(function (e, r) {
  13602. r(t);
  13603. });
  13604. }),
  13605. (pP.race = function (t) {
  13606. return new pP(function (e, r) {
  13607. if (!dP(t)) return r(new TypeError('Promise.race accepts an array'));
  13608. for (var n = 0, i = t.length; n < i; n++) pP.resolve(t[n]).then(e, r);
  13609. });
  13610. }),
  13611. (pP._immediateFn =
  13612. ('function' == typeof setImmediate &&
  13613. function (t) {
  13614. setImmediate(t);
  13615. }) ||
  13616. function (t) {
  13617. lP(t, 0);
  13618. }),
  13619. (pP._unhandledRejectionFn = function (t) {
  13620. 'undefined' != typeof console &&
  13621. console &&
  13622. console.warn('Possible Unhandled Promise Rejection:', t);
  13623. });
  13624. var TP = Object.getOwnPropertySymbols,
  13625. xP = Object.prototype.hasOwnProperty,
  13626. EP = Object.prototype.propertyIsEnumerable;
  13627. function SP(t) {
  13628. if (null == t)
  13629. throw new TypeError(
  13630. 'Object.assign cannot be called with null or undefined'
  13631. );
  13632. return Object(t);
  13633. }
  13634. var wP = (function () {
  13635. try {
  13636. if (!Object.assign) return !1;
  13637. var t = new String('abc');
  13638. if (((t[5] = 'de'), '5' === Object.getOwnPropertyNames(t)[0])) return !1;
  13639. for (var e = {}, r = 0; r < 10; r++) e['_' + String.fromCharCode(r)] = r;
  13640. if (
  13641. '0123456789' !==
  13642. Object.getOwnPropertyNames(e)
  13643. .map(function (t) {
  13644. return e[t];
  13645. })
  13646. .join('')
  13647. )
  13648. return !1;
  13649. var n = {};
  13650. return (
  13651. 'abcdefghijklmnopqrst'.split('').forEach(function (t) {
  13652. n[t] = t;
  13653. }),
  13654. 'abcdefghijklmnopqrst' === Object.keys(Object.assign({}, n)).join('')
  13655. );
  13656. } catch (t) {
  13657. return !1;
  13658. }
  13659. })()
  13660. ? Object.assign
  13661. : function (t, e) {
  13662. for (var r, n, i = SP(t), o = 1; o < arguments.length; o++) {
  13663. for (var s in (r = Object(arguments[o])))
  13664. xP.call(r, s) && (i[s] = r[s]);
  13665. if (TP) {
  13666. n = TP(r);
  13667. for (var a = 0; a < n.length; a++)
  13668. EP.call(r, n[a]) && (i[n[a]] = r[n[a]]);
  13669. }
  13670. }
  13671. return i;
  13672. };
  13673. 'undefined' == typeof globalThis &&
  13674. ('undefined' != typeof self
  13675. ? (self.globalThis = self)
  13676. : 'undefined' != typeof global && (global.globalThis = global)),
  13677. globalThis.Promise || (globalThis.Promise = pP),
  13678. Object.assign || (Object.assign = wP);
  13679. if (
  13680. ((Date.now && Date.prototype.getTime) ||
  13681. (Date.now = function () {
  13682. return new Date().getTime();
  13683. }),
  13684. !globalThis.performance || !globalThis.performance.now)
  13685. ) {
  13686. var RP = Date.now();
  13687. globalThis.performance || (globalThis.performance = {}),
  13688. (globalThis.performance.now = function () {
  13689. return Date.now() - RP;
  13690. });
  13691. }
  13692. for (
  13693. var CP,
  13694. PP,
  13695. AP,
  13696. OP,
  13697. IP,
  13698. MP,
  13699. DP,
  13700. LP,
  13701. FP,
  13702. NP,
  13703. kP,
  13704. BP,
  13705. GP,
  13706. UP,
  13707. jP,
  13708. XP,
  13709. VP,
  13710. HP,
  13711. WP,
  13712. YP,
  13713. zP = Date.now(),
  13714. ZP = ['ms', 'moz', 'webkit', 'o'],
  13715. JP = 0;
  13716. JP < ZP.length && !globalThis.requestAnimationFrame;
  13717. ++JP
  13718. ) {
  13719. var KP = ZP[JP];
  13720. (globalThis.requestAnimationFrame =
  13721. globalThis[KP + 'RequestAnimationFrame']),
  13722. (globalThis.cancelAnimationFrame =
  13723. globalThis[KP + 'CancelAnimationFrame'] ||
  13724. globalThis[KP + 'CancelRequestAnimationFrame']);
  13725. }
  13726. globalThis.requestAnimationFrame ||
  13727. (globalThis.requestAnimationFrame = function (t) {
  13728. if ('function' != typeof t) throw new TypeError(t + 'is not a function');
  13729. var e = Date.now(),
  13730. r = 16 + zP - e;
  13731. return (
  13732. r < 0 && (r = 0),
  13733. (zP = e),
  13734. globalThis.self.setTimeout(function () {
  13735. (zP = Date.now()), t(performance.now());
  13736. }, r)
  13737. );
  13738. }),
  13739. globalThis.cancelAnimationFrame ||
  13740. (globalThis.cancelAnimationFrame = function (t) {
  13741. return clearTimeout(t);
  13742. }),
  13743. Math.sign ||
  13744. (Math.sign = function (t) {
  13745. return 0 === (t = Number(t)) || isNaN(t) ? t : t > 0 ? 1 : -1;
  13746. }),
  13747. Number.isInteger ||
  13748. (Number.isInteger = function (t) {
  13749. return 'number' == typeof t && isFinite(t) && Math.floor(t) === t;
  13750. }),
  13751. globalThis.ArrayBuffer || (globalThis.ArrayBuffer = Array),
  13752. globalThis.Float32Array || (globalThis.Float32Array = Array),
  13753. globalThis.Uint32Array || (globalThis.Uint32Array = Array),
  13754. globalThis.Uint16Array || (globalThis.Uint16Array = Array),
  13755. globalThis.Uint8Array || (globalThis.Uint8Array = Array),
  13756. globalThis.Int32Array || (globalThis.Int32Array = Array),
  13757. (function (t) {
  13758. (t[(t.WEBGL_LEGACY = 0)] = 'WEBGL_LEGACY'),
  13759. (t[(t.WEBGL = 1)] = 'WEBGL'),
  13760. (t[(t.WEBGL2 = 2)] = 'WEBGL2');
  13761. })(CP || (CP = {})),
  13762. (function (t) {
  13763. (t[(t.UNKNOWN = 0)] = 'UNKNOWN'),
  13764. (t[(t.WEBGL = 1)] = 'WEBGL'),
  13765. (t[(t.CANVAS = 2)] = 'CANVAS');
  13766. })(PP || (PP = {})),
  13767. (function (t) {
  13768. (t[(t.COLOR = 16384)] = 'COLOR'),
  13769. (t[(t.DEPTH = 256)] = 'DEPTH'),
  13770. (t[(t.STENCIL = 1024)] = 'STENCIL');
  13771. })(AP || (AP = {})),
  13772. (function (t) {
  13773. (t[(t.NORMAL = 0)] = 'NORMAL'),
  13774. (t[(t.ADD = 1)] = 'ADD'),
  13775. (t[(t.MULTIPLY = 2)] = 'MULTIPLY'),
  13776. (t[(t.SCREEN = 3)] = 'SCREEN'),
  13777. (t[(t.OVERLAY = 4)] = 'OVERLAY'),
  13778. (t[(t.DARKEN = 5)] = 'DARKEN'),
  13779. (t[(t.LIGHTEN = 6)] = 'LIGHTEN'),
  13780. (t[(t.COLOR_DODGE = 7)] = 'COLOR_DODGE'),
  13781. (t[(t.COLOR_BURN = 8)] = 'COLOR_BURN'),
  13782. (t[(t.HARD_LIGHT = 9)] = 'HARD_LIGHT'),
  13783. (t[(t.SOFT_LIGHT = 10)] = 'SOFT_LIGHT'),
  13784. (t[(t.DIFFERENCE = 11)] = 'DIFFERENCE'),
  13785. (t[(t.EXCLUSION = 12)] = 'EXCLUSION'),
  13786. (t[(t.HUE = 13)] = 'HUE'),
  13787. (t[(t.SATURATION = 14)] = 'SATURATION'),
  13788. (t[(t.COLOR = 15)] = 'COLOR'),
  13789. (t[(t.LUMINOSITY = 16)] = 'LUMINOSITY'),
  13790. (t[(t.NORMAL_NPM = 17)] = 'NORMAL_NPM'),
  13791. (t[(t.ADD_NPM = 18)] = 'ADD_NPM'),
  13792. (t[(t.SCREEN_NPM = 19)] = 'SCREEN_NPM'),
  13793. (t[(t.NONE = 20)] = 'NONE'),
  13794. (t[(t.SRC_OVER = 0)] = 'SRC_OVER'),
  13795. (t[(t.SRC_IN = 21)] = 'SRC_IN'),
  13796. (t[(t.SRC_OUT = 22)] = 'SRC_OUT'),
  13797. (t[(t.SRC_ATOP = 23)] = 'SRC_ATOP'),
  13798. (t[(t.DST_OVER = 24)] = 'DST_OVER'),
  13799. (t[(t.DST_IN = 25)] = 'DST_IN'),
  13800. (t[(t.DST_OUT = 26)] = 'DST_OUT'),
  13801. (t[(t.DST_ATOP = 27)] = 'DST_ATOP'),
  13802. (t[(t.ERASE = 26)] = 'ERASE'),
  13803. (t[(t.SUBTRACT = 28)] = 'SUBTRACT'),
  13804. (t[(t.XOR = 29)] = 'XOR');
  13805. })(OP || (OP = {})),
  13806. (function (t) {
  13807. (t[(t.POINTS = 0)] = 'POINTS'),
  13808. (t[(t.LINES = 1)] = 'LINES'),
  13809. (t[(t.LINE_LOOP = 2)] = 'LINE_LOOP'),
  13810. (t[(t.LINE_STRIP = 3)] = 'LINE_STRIP'),
  13811. (t[(t.TRIANGLES = 4)] = 'TRIANGLES'),
  13812. (t[(t.TRIANGLE_STRIP = 5)] = 'TRIANGLE_STRIP'),
  13813. (t[(t.TRIANGLE_FAN = 6)] = 'TRIANGLE_FAN');
  13814. })(IP || (IP = {})),
  13815. (function (t) {
  13816. (t[(t.RGBA = 6408)] = 'RGBA'),
  13817. (t[(t.RGB = 6407)] = 'RGB'),
  13818. (t[(t.RG = 33319)] = 'RG'),
  13819. (t[(t.RED = 6403)] = 'RED'),
  13820. (t[(t.RGBA_INTEGER = 36249)] = 'RGBA_INTEGER'),
  13821. (t[(t.RGB_INTEGER = 36248)] = 'RGB_INTEGER'),
  13822. (t[(t.RG_INTEGER = 33320)] = 'RG_INTEGER'),
  13823. (t[(t.RED_INTEGER = 36244)] = 'RED_INTEGER'),
  13824. (t[(t.ALPHA = 6406)] = 'ALPHA'),
  13825. (t[(t.LUMINANCE = 6409)] = 'LUMINANCE'),
  13826. (t[(t.LUMINANCE_ALPHA = 6410)] = 'LUMINANCE_ALPHA'),
  13827. (t[(t.DEPTH_COMPONENT = 6402)] = 'DEPTH_COMPONENT'),
  13828. (t[(t.DEPTH_STENCIL = 34041)] = 'DEPTH_STENCIL');
  13829. })(MP || (MP = {})),
  13830. (function (t) {
  13831. (t[(t.TEXTURE_2D = 3553)] = 'TEXTURE_2D'),
  13832. (t[(t.TEXTURE_CUBE_MAP = 34067)] = 'TEXTURE_CUBE_MAP'),
  13833. (t[(t.TEXTURE_2D_ARRAY = 35866)] = 'TEXTURE_2D_ARRAY'),
  13834. (t[(t.TEXTURE_CUBE_MAP_POSITIVE_X = 34069)] =
  13835. 'TEXTURE_CUBE_MAP_POSITIVE_X'),
  13836. (t[(t.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070)] =
  13837. 'TEXTURE_CUBE_MAP_NEGATIVE_X'),
  13838. (t[(t.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071)] =
  13839. 'TEXTURE_CUBE_MAP_POSITIVE_Y'),
  13840. (t[(t.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072)] =
  13841. 'TEXTURE_CUBE_MAP_NEGATIVE_Y'),
  13842. (t[(t.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073)] =
  13843. 'TEXTURE_CUBE_MAP_POSITIVE_Z'),
  13844. (t[(t.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074)] =
  13845. 'TEXTURE_CUBE_MAP_NEGATIVE_Z');
  13846. })(DP || (DP = {})),
  13847. (function (t) {
  13848. (t[(t.UNSIGNED_BYTE = 5121)] = 'UNSIGNED_BYTE'),
  13849. (t[(t.UNSIGNED_SHORT = 5123)] = 'UNSIGNED_SHORT'),
  13850. (t[(t.UNSIGNED_SHORT_5_6_5 = 33635)] = 'UNSIGNED_SHORT_5_6_5'),
  13851. (t[(t.UNSIGNED_SHORT_4_4_4_4 = 32819)] = 'UNSIGNED_SHORT_4_4_4_4'),
  13852. (t[(t.UNSIGNED_SHORT_5_5_5_1 = 32820)] = 'UNSIGNED_SHORT_5_5_5_1'),
  13853. (t[(t.UNSIGNED_INT = 5125)] = 'UNSIGNED_INT'),
  13854. (t[(t.UNSIGNED_INT_10F_11F_11F_REV = 35899)] =
  13855. 'UNSIGNED_INT_10F_11F_11F_REV'),
  13856. (t[(t.UNSIGNED_INT_2_10_10_10_REV = 33640)] =
  13857. 'UNSIGNED_INT_2_10_10_10_REV'),
  13858. (t[(t.UNSIGNED_INT_24_8 = 34042)] = 'UNSIGNED_INT_24_8'),
  13859. (t[(t.UNSIGNED_INT_5_9_9_9_REV = 35902)] = 'UNSIGNED_INT_5_9_9_9_REV'),
  13860. (t[(t.BYTE = 5120)] = 'BYTE'),
  13861. (t[(t.SHORT = 5122)] = 'SHORT'),
  13862. (t[(t.INT = 5124)] = 'INT'),
  13863. (t[(t.FLOAT = 5126)] = 'FLOAT'),
  13864. (t[(t.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269)] =
  13865. 'FLOAT_32_UNSIGNED_INT_24_8_REV'),
  13866. (t[(t.HALF_FLOAT = 36193)] = 'HALF_FLOAT');
  13867. })(LP || (LP = {})),
  13868. (function (t) {
  13869. (t[(t.FLOAT = 0)] = 'FLOAT'),
  13870. (t[(t.INT = 1)] = 'INT'),
  13871. (t[(t.UINT = 2)] = 'UINT');
  13872. })(FP || (FP = {})),
  13873. (function (t) {
  13874. (t[(t.NEAREST = 0)] = 'NEAREST'), (t[(t.LINEAR = 1)] = 'LINEAR');
  13875. })(NP || (NP = {})),
  13876. (function (t) {
  13877. (t[(t.CLAMP = 33071)] = 'CLAMP'),
  13878. (t[(t.REPEAT = 10497)] = 'REPEAT'),
  13879. (t[(t.MIRRORED_REPEAT = 33648)] = 'MIRRORED_REPEAT');
  13880. })(kP || (kP = {})),
  13881. (function (t) {
  13882. (t[(t.OFF = 0)] = 'OFF'),
  13883. (t[(t.POW2 = 1)] = 'POW2'),
  13884. (t[(t.ON = 2)] = 'ON'),
  13885. (t[(t.ON_MANUAL = 3)] = 'ON_MANUAL');
  13886. })(BP || (BP = {})),
  13887. (function (t) {
  13888. (t[(t.NPM = 0)] = 'NPM'),
  13889. (t[(t.UNPACK = 1)] = 'UNPACK'),
  13890. (t[(t.PMA = 2)] = 'PMA'),
  13891. (t[(t.NO_PREMULTIPLIED_ALPHA = 0)] = 'NO_PREMULTIPLIED_ALPHA'),
  13892. (t[(t.PREMULTIPLY_ON_UPLOAD = 1)] = 'PREMULTIPLY_ON_UPLOAD'),
  13893. (t[(t.PREMULTIPLY_ALPHA = 2)] = 'PREMULTIPLY_ALPHA'),
  13894. (t[(t.PREMULTIPLIED_ALPHA = 2)] = 'PREMULTIPLIED_ALPHA');
  13895. })(GP || (GP = {})),
  13896. (function (t) {
  13897. (t[(t.NO = 0)] = 'NO'),
  13898. (t[(t.YES = 1)] = 'YES'),
  13899. (t[(t.AUTO = 2)] = 'AUTO'),
  13900. (t[(t.BLEND = 0)] = 'BLEND'),
  13901. (t[(t.CLEAR = 1)] = 'CLEAR'),
  13902. (t[(t.BLIT = 2)] = 'BLIT');
  13903. })(UP || (UP = {})),
  13904. (function (t) {
  13905. (t[(t.AUTO = 0)] = 'AUTO'), (t[(t.MANUAL = 1)] = 'MANUAL');
  13906. })(jP || (jP = {})),
  13907. (function (t) {
  13908. (t.LOW = 'lowp'), (t.MEDIUM = 'mediump'), (t.HIGH = 'highp');
  13909. })(XP || (XP = {})),
  13910. (function (t) {
  13911. (t[(t.NONE = 0)] = 'NONE'),
  13912. (t[(t.SCISSOR = 1)] = 'SCISSOR'),
  13913. (t[(t.STENCIL = 2)] = 'STENCIL'),
  13914. (t[(t.SPRITE = 3)] = 'SPRITE'),
  13915. (t[(t.COLOR = 4)] = 'COLOR');
  13916. })(VP || (VP = {})),
  13917. (function (t) {
  13918. (t[(t.RED = 1)] = 'RED'),
  13919. (t[(t.GREEN = 2)] = 'GREEN'),
  13920. (t[(t.BLUE = 4)] = 'BLUE'),
  13921. (t[(t.ALPHA = 8)] = 'ALPHA');
  13922. })(HP || (HP = {})),
  13923. (function (t) {
  13924. (t[(t.NONE = 0)] = 'NONE'),
  13925. (t[(t.LOW = 2)] = 'LOW'),
  13926. (t[(t.MEDIUM = 4)] = 'MEDIUM'),
  13927. (t[(t.HIGH = 8)] = 'HIGH');
  13928. })(WP || (WP = {})),
  13929. (function (t) {
  13930. (t[(t.ELEMENT_ARRAY_BUFFER = 34963)] = 'ELEMENT_ARRAY_BUFFER'),
  13931. (t[(t.ARRAY_BUFFER = 34962)] = 'ARRAY_BUFFER'),
  13932. (t[(t.UNIFORM_BUFFER = 35345)] = 'UNIFORM_BUFFER');
  13933. })(YP || (YP = {}));
  13934. var qP = {
  13935. createCanvas: function (t, e) {
  13936. var r = document.createElement('canvas');
  13937. return (r.width = t), (r.height = e), r;
  13938. },
  13939. getWebGLRenderingContext: function () {
  13940. return WebGLRenderingContext;
  13941. },
  13942. getNavigator: function () {
  13943. return navigator;
  13944. },
  13945. getBaseUrl: function () {
  13946. var t;
  13947. return null !== (t = document.baseURI) && void 0 !== t
  13948. ? t
  13949. : window.location.href;
  13950. },
  13951. fetch: function (t, e) {
  13952. return fetch(t, e);
  13953. },
  13954. },
  13955. QP = /iPhone/i,
  13956. $P = /iPod/i,
  13957. tA = /iPad/i,
  13958. eA = /\biOS-universal(?:.+)Mac\b/i,
  13959. rA = /\bAndroid(?:.+)Mobile\b/i,
  13960. nA = /Android/i,
  13961. iA = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,
  13962. oA = /Silk/i,
  13963. sA = /Windows Phone/i,
  13964. aA = /\bWindows(?:.+)ARM\b/i,
  13965. uA = /BlackBerry/i,
  13966. cA = /BB10/i,
  13967. hA = /Opera Mini/i,
  13968. lA = /\b(CriOS|Chrome)(?:.+)Mobile/i,
  13969. dA = /Mobile(?:.+)Firefox\b/i,
  13970. fA = function (t) {
  13971. return (
  13972. void 0 !== t &&
  13973. 'MacIntel' === t.platform &&
  13974. 'number' == typeof t.maxTouchPoints &&
  13975. t.maxTouchPoints > 1 &&
  13976. 'undefined' == typeof MSStream
  13977. );
  13978. };
  13979. var pA = (function (t) {
  13980. var e = { userAgent: '', platform: '', maxTouchPoints: 0 };
  13981. t || 'undefined' == typeof navigator
  13982. ? 'string' == typeof t
  13983. ? (e.userAgent = t)
  13984. : t &&
  13985. t.userAgent &&
  13986. (e = {
  13987. userAgent: t.userAgent,
  13988. platform: t.platform,
  13989. maxTouchPoints: t.maxTouchPoints || 0,
  13990. })
  13991. : (e = {
  13992. userAgent: navigator.userAgent,
  13993. platform: navigator.platform,
  13994. maxTouchPoints: navigator.maxTouchPoints || 0,
  13995. });
  13996. var r = e.userAgent,
  13997. n = r.split('[FBAN');
  13998. void 0 !== n[1] && (r = n[0]),
  13999. void 0 !== (n = r.split('Twitter'))[1] && (r = n[0]);
  14000. var i = (function (t) {
  14001. return function (e) {
  14002. return e.test(t);
  14003. };
  14004. })(r),
  14005. o = {
  14006. apple: {
  14007. phone: i(QP) && !i(sA),
  14008. ipod: i($P),
  14009. tablet: !i(QP) && (i(tA) || fA(e)) && !i(sA),
  14010. universal: i(eA),
  14011. device: (i(QP) || i($P) || i(tA) || i(eA) || fA(e)) && !i(sA),
  14012. },
  14013. amazon: {
  14014. phone: i(iA),
  14015. tablet: !i(iA) && i(oA),
  14016. device: i(iA) || i(oA),
  14017. },
  14018. android: {
  14019. phone: (!i(sA) && i(iA)) || (!i(sA) && i(rA)),
  14020. tablet: !i(sA) && !i(iA) && !i(rA) && (i(oA) || i(nA)),
  14021. device:
  14022. (!i(sA) && (i(iA) || i(oA) || i(rA) || i(nA))) || i(/\bokhttp\b/i),
  14023. },
  14024. windows: { phone: i(sA), tablet: i(aA), device: i(sA) || i(aA) },
  14025. other: {
  14026. blackberry: i(uA),
  14027. blackberry10: i(cA),
  14028. opera: i(hA),
  14029. firefox: i(dA),
  14030. chrome: i(lA),
  14031. device: i(uA) || i(cA) || i(hA) || i(dA) || i(lA),
  14032. },
  14033. any: !1,
  14034. phone: !1,
  14035. tablet: !1,
  14036. };
  14037. return (
  14038. (o.any =
  14039. o.apple.device ||
  14040. o.android.device ||
  14041. o.windows.device ||
  14042. o.other.device),
  14043. (o.phone = o.apple.phone || o.android.phone || o.windows.phone),
  14044. (o.tablet = o.apple.tablet || o.android.tablet || o.windows.tablet),
  14045. o
  14046. );
  14047. })(globalThis.navigator);
  14048. var vA = {
  14049. ADAPTER: qP,
  14050. MIPMAP_TEXTURES: BP.POW2,
  14051. ANISOTROPIC_LEVEL: 0,
  14052. RESOLUTION: 1,
  14053. FILTER_RESOLUTION: 1,
  14054. FILTER_MULTISAMPLE: WP.NONE,
  14055. SPRITE_MAX_TEXTURES: (function (t) {
  14056. var e = !0;
  14057. if (pA.tablet || pA.phone) {
  14058. var r;
  14059. if (pA.apple.device)
  14060. if ((r = navigator.userAgent.match(/OS (\d+)_(\d+)?/)))
  14061. parseInt(r[1], 10) < 11 && (e = !1);
  14062. if (pA.android.device)
  14063. if ((r = navigator.userAgent.match(/Android\s([0-9.]*)/)))
  14064. parseInt(r[1], 10) < 7 && (e = !1);
  14065. }
  14066. return e ? t : 4;
  14067. })(32),
  14068. SPRITE_BATCH_SIZE: 4096,
  14069. RENDER_OPTIONS: {
  14070. view: null,
  14071. width: 800,
  14072. height: 600,
  14073. autoDensity: !1,
  14074. backgroundColor: 0,
  14075. backgroundAlpha: 1,
  14076. useContextAlpha: !0,
  14077. clearBeforeRender: !0,
  14078. antialias: !1,
  14079. preserveDrawingBuffer: !1,
  14080. },
  14081. GC_MODE: jP.AUTO,
  14082. GC_MAX_IDLE: 3600,
  14083. GC_MAX_CHECK_COUNT: 600,
  14084. WRAP_MODE: kP.CLAMP,
  14085. SCALE_MODE: NP.LINEAR,
  14086. PRECISION_VERTEX: XP.HIGH,
  14087. PRECISION_FRAGMENT: pA.apple.device ? XP.HIGH : XP.MEDIUM,
  14088. CAN_UPLOAD_SAME_BUFFER: !pA.apple.device,
  14089. CREATE_IMAGE_BITMAP: !1,
  14090. ROUND_PIXELS: !1,
  14091. },
  14092. mA = { exports: {} };
  14093. !(function (t) {
  14094. var e = Object.prototype.hasOwnProperty,
  14095. r = '~';
  14096. function n() {}
  14097. function i(t, e, r) {
  14098. (this.fn = t), (this.context = e), (this.once = r || !1);
  14099. }
  14100. function o(t, e, n, o, s) {
  14101. if ('function' != typeof n)
  14102. throw new TypeError('The listener must be a function');
  14103. var a = new i(n, o || t, s),
  14104. u = r ? r + e : e;
  14105. return (
  14106. t._events[u]
  14107. ? t._events[u].fn
  14108. ? (t._events[u] = [t._events[u], a])
  14109. : t._events[u].push(a)
  14110. : ((t._events[u] = a), t._eventsCount++),
  14111. t
  14112. );
  14113. }
  14114. function s(t, e) {
  14115. 0 == --t._eventsCount ? (t._events = new n()) : delete t._events[e];
  14116. }
  14117. function a() {
  14118. (this._events = new n()), (this._eventsCount = 0);
  14119. }
  14120. Object.create &&
  14121. ((n.prototype = Object.create(null)), new n().__proto__ || (r = !1)),
  14122. (a.prototype.eventNames = function () {
  14123. var t,
  14124. n,
  14125. i = [];
  14126. if (0 === this._eventsCount) return i;
  14127. for (n in (t = this._events))
  14128. e.call(t, n) && i.push(r ? n.slice(1) : n);
  14129. return Object.getOwnPropertySymbols
  14130. ? i.concat(Object.getOwnPropertySymbols(t))
  14131. : i;
  14132. }),
  14133. (a.prototype.listeners = function (t) {
  14134. var e = r ? r + t : t,
  14135. n = this._events[e];
  14136. if (!n) return [];
  14137. if (n.fn) return [n.fn];
  14138. for (var i = 0, o = n.length, s = new Array(o); i < o; i++)
  14139. s[i] = n[i].fn;
  14140. return s;
  14141. }),
  14142. (a.prototype.listenerCount = function (t) {
  14143. var e = r ? r + t : t,
  14144. n = this._events[e];
  14145. return n ? (n.fn ? 1 : n.length) : 0;
  14146. }),
  14147. (a.prototype.emit = function (t, e, n, i, o, s) {
  14148. var a = r ? r + t : t;
  14149. if (!this._events[a]) return !1;
  14150. var u,
  14151. c,
  14152. h = this._events[a],
  14153. l = arguments.length;
  14154. if (h.fn) {
  14155. switch ((h.once && this.removeListener(t, h.fn, void 0, !0), l)) {
  14156. case 1:
  14157. return h.fn.call(h.context), !0;
  14158. case 2:
  14159. return h.fn.call(h.context, e), !0;
  14160. case 3:
  14161. return h.fn.call(h.context, e, n), !0;
  14162. case 4:
  14163. return h.fn.call(h.context, e, n, i), !0;
  14164. case 5:
  14165. return h.fn.call(h.context, e, n, i, o), !0;
  14166. case 6:
  14167. return h.fn.call(h.context, e, n, i, o, s), !0;
  14168. }
  14169. for (c = 1, u = new Array(l - 1); c < l; c++) u[c - 1] = arguments[c];
  14170. h.fn.apply(h.context, u);
  14171. } else {
  14172. var d,
  14173. f = h.length;
  14174. for (c = 0; c < f; c++)
  14175. switch (
  14176. (h[c].once && this.removeListener(t, h[c].fn, void 0, !0), l)
  14177. ) {
  14178. case 1:
  14179. h[c].fn.call(h[c].context);
  14180. break;
  14181. case 2:
  14182. h[c].fn.call(h[c].context, e);
  14183. break;
  14184. case 3:
  14185. h[c].fn.call(h[c].context, e, n);
  14186. break;
  14187. case 4:
  14188. h[c].fn.call(h[c].context, e, n, i);
  14189. break;
  14190. default:
  14191. if (!u)
  14192. for (d = 1, u = new Array(l - 1); d < l; d++)
  14193. u[d - 1] = arguments[d];
  14194. h[c].fn.apply(h[c].context, u);
  14195. }
  14196. }
  14197. return !0;
  14198. }),
  14199. (a.prototype.on = function (t, e, r) {
  14200. return o(this, t, e, r, !1);
  14201. }),
  14202. (a.prototype.once = function (t, e, r) {
  14203. return o(this, t, e, r, !0);
  14204. }),
  14205. (a.prototype.removeListener = function (t, e, n, i) {
  14206. var o = r ? r + t : t;
  14207. if (!this._events[o]) return this;
  14208. if (!e) return s(this, o), this;
  14209. var a = this._events[o];
  14210. if (a.fn)
  14211. a.fn !== e || (i && !a.once) || (n && a.context !== n) || s(this, o);
  14212. else {
  14213. for (var u = 0, c = [], h = a.length; u < h; u++)
  14214. (a[u].fn !== e || (i && !a[u].once) || (n && a[u].context !== n)) &&
  14215. c.push(a[u]);
  14216. c.length ? (this._events[o] = 1 === c.length ? c[0] : c) : s(this, o);
  14217. }
  14218. return this;
  14219. }),
  14220. (a.prototype.removeAllListeners = function (t) {
  14221. var e;
  14222. return (
  14223. t
  14224. ? ((e = r ? r + t : t), this._events[e] && s(this, e))
  14225. : ((this._events = new n()), (this._eventsCount = 0)),
  14226. this
  14227. );
  14228. }),
  14229. (a.prototype.off = a.prototype.removeListener),
  14230. (a.prototype.addListener = a.prototype.on),
  14231. (a.prefixed = r),
  14232. (a.EventEmitter = a),
  14233. (t.exports = a);
  14234. })(mA);
  14235. var yA = mA.exports,
  14236. gA = { exports: {} };
  14237. function _A(t, e, r) {
  14238. r = r || 2;
  14239. var n,
  14240. i,
  14241. o,
  14242. s,
  14243. a,
  14244. u,
  14245. c,
  14246. h = e && e.length,
  14247. l = h ? e[0] * r : t.length,
  14248. d = bA(t, 0, l, r, !0),
  14249. f = [];
  14250. if (!d || d.next === d.prev) return f;
  14251. if (
  14252. (h &&
  14253. (d = (function (t, e, r, n) {
  14254. var i,
  14255. o,
  14256. s,
  14257. a = [];
  14258. for (i = 0, o = e.length; i < o; i++)
  14259. (s = bA(
  14260. t,
  14261. e[i] * n,
  14262. i < o - 1 ? e[i + 1] * n : t.length,
  14263. n,
  14264. !1
  14265. )) === s.next && (s.steiner = !0),
  14266. a.push(IA(s));
  14267. for (a.sort(CA), i = 0; i < a.length; i++) r = PA(a[i], r);
  14268. return r;
  14269. })(t, e, d, r)),
  14270. t.length > 80 * r)
  14271. ) {
  14272. (n = o = t[0]), (i = s = t[1]);
  14273. for (var p = r; p < l; p += r)
  14274. (a = t[p]) < n && (n = a),
  14275. (u = t[p + 1]) < i && (i = u),
  14276. a > o && (o = a),
  14277. u > s && (s = u);
  14278. c = 0 !== (c = Math.max(o - n, s - i)) ? 32767 / c : 0;
  14279. }
  14280. return xA(d, f, r, n, i, c, 0), f;
  14281. }
  14282. function bA(t, e, r, n, i) {
  14283. var o, s;
  14284. if (i === HA(t, e, r, n) > 0)
  14285. for (o = e; o < r; o += n) s = jA(o, t[o], t[o + 1], s);
  14286. else for (o = r - n; o >= e; o -= n) s = jA(o, t[o], t[o + 1], s);
  14287. return s && FA(s, s.next) && (XA(s), (s = s.next)), s;
  14288. }
  14289. function TA(t, e) {
  14290. if (!t) return t;
  14291. e || (e = t);
  14292. var r,
  14293. n = t;
  14294. do {
  14295. if (
  14296. ((r = !1), n.steiner || (!FA(n, n.next) && 0 !== LA(n.prev, n, n.next)))
  14297. )
  14298. n = n.next;
  14299. else {
  14300. if ((XA(n), (n = e = n.prev) === n.next)) break;
  14301. r = !0;
  14302. }
  14303. } while (r || n !== e);
  14304. return e;
  14305. }
  14306. function xA(t, e, r, n, i, o, s) {
  14307. if (t) {
  14308. !s &&
  14309. o &&
  14310. (function (t, e, r, n) {
  14311. var i = t;
  14312. do {
  14313. 0 === i.z && (i.z = OA(i.x, i.y, e, r, n)),
  14314. (i.prevZ = i.prev),
  14315. (i.nextZ = i.next),
  14316. (i = i.next);
  14317. } while (i !== t);
  14318. (i.prevZ.nextZ = null),
  14319. (i.prevZ = null),
  14320. (function (t) {
  14321. var e,
  14322. r,
  14323. n,
  14324. i,
  14325. o,
  14326. s,
  14327. a,
  14328. u,
  14329. c = 1;
  14330. do {
  14331. for (r = t, t = null, o = null, s = 0; r; ) {
  14332. for (
  14333. s++, n = r, a = 0, e = 0;
  14334. e < c && (a++, (n = n.nextZ));
  14335. e++
  14336. );
  14337. for (u = c; a > 0 || (u > 0 && n); )
  14338. 0 !== a && (0 === u || !n || r.z <= n.z)
  14339. ? ((i = r), (r = r.nextZ), a--)
  14340. : ((i = n), (n = n.nextZ), u--),
  14341. o ? (o.nextZ = i) : (t = i),
  14342. (i.prevZ = o),
  14343. (o = i);
  14344. r = n;
  14345. }
  14346. (o.nextZ = null), (c *= 2);
  14347. } while (s > 1);
  14348. })(i);
  14349. })(t, n, i, o);
  14350. for (var a, u, c = t; t.prev !== t.next; )
  14351. if (((a = t.prev), (u = t.next), o ? SA(t, n, i, o) : EA(t)))
  14352. e.push((a.i / r) | 0),
  14353. e.push((t.i / r) | 0),
  14354. e.push((u.i / r) | 0),
  14355. XA(t),
  14356. (t = u.next),
  14357. (c = u.next);
  14358. else if ((t = u) === c) {
  14359. s
  14360. ? 1 === s
  14361. ? xA((t = wA(TA(t), e, r)), e, r, n, i, o, 2)
  14362. : 2 === s && RA(t, e, r, n, i, o)
  14363. : xA(TA(t), e, r, n, i, o, 1);
  14364. break;
  14365. }
  14366. }
  14367. }
  14368. function EA(t) {
  14369. var e = t.prev,
  14370. r = t,
  14371. n = t.next;
  14372. if (LA(e, r, n) >= 0) return !1;
  14373. for (
  14374. var i = e.x,
  14375. o = r.x,
  14376. s = n.x,
  14377. a = e.y,
  14378. u = r.y,
  14379. c = n.y,
  14380. h = i < o ? (i < s ? i : s) : o < s ? o : s,
  14381. l = a < u ? (a < c ? a : c) : u < c ? u : c,
  14382. d = i > o ? (i > s ? i : s) : o > s ? o : s,
  14383. f = a > u ? (a > c ? a : c) : u > c ? u : c,
  14384. p = n.next;
  14385. p !== e;
  14386. ) {
  14387. if (
  14388. p.x >= h &&
  14389. p.x <= d &&
  14390. p.y >= l &&
  14391. p.y <= f &&
  14392. MA(i, a, o, u, s, c, p.x, p.y) &&
  14393. LA(p.prev, p, p.next) >= 0
  14394. )
  14395. return !1;
  14396. p = p.next;
  14397. }
  14398. return !0;
  14399. }
  14400. function SA(t, e, r, n) {
  14401. var i = t.prev,
  14402. o = t,
  14403. s = t.next;
  14404. if (LA(i, o, s) >= 0) return !1;
  14405. for (
  14406. var a = i.x,
  14407. u = o.x,
  14408. c = s.x,
  14409. h = i.y,
  14410. l = o.y,
  14411. d = s.y,
  14412. f = a < u ? (a < c ? a : c) : u < c ? u : c,
  14413. p = h < l ? (h < d ? h : d) : l < d ? l : d,
  14414. v = a > u ? (a > c ? a : c) : u > c ? u : c,
  14415. m = h > l ? (h > d ? h : d) : l > d ? l : d,
  14416. y = OA(f, p, e, r, n),
  14417. g = OA(v, m, e, r, n),
  14418. _ = t.prevZ,
  14419. b = t.nextZ;
  14420. _ && _.z >= y && b && b.z <= g;
  14421. ) {
  14422. if (
  14423. _.x >= f &&
  14424. _.x <= v &&
  14425. _.y >= p &&
  14426. _.y <= m &&
  14427. _ !== i &&
  14428. _ !== s &&
  14429. MA(a, h, u, l, c, d, _.x, _.y) &&
  14430. LA(_.prev, _, _.next) >= 0
  14431. )
  14432. return !1;
  14433. if (
  14434. ((_ = _.prevZ),
  14435. b.x >= f &&
  14436. b.x <= v &&
  14437. b.y >= p &&
  14438. b.y <= m &&
  14439. b !== i &&
  14440. b !== s &&
  14441. MA(a, h, u, l, c, d, b.x, b.y) &&
  14442. LA(b.prev, b, b.next) >= 0)
  14443. )
  14444. return !1;
  14445. b = b.nextZ;
  14446. }
  14447. for (; _ && _.z >= y; ) {
  14448. if (
  14449. _.x >= f &&
  14450. _.x <= v &&
  14451. _.y >= p &&
  14452. _.y <= m &&
  14453. _ !== i &&
  14454. _ !== s &&
  14455. MA(a, h, u, l, c, d, _.x, _.y) &&
  14456. LA(_.prev, _, _.next) >= 0
  14457. )
  14458. return !1;
  14459. _ = _.prevZ;
  14460. }
  14461. for (; b && b.z <= g; ) {
  14462. if (
  14463. b.x >= f &&
  14464. b.x <= v &&
  14465. b.y >= p &&
  14466. b.y <= m &&
  14467. b !== i &&
  14468. b !== s &&
  14469. MA(a, h, u, l, c, d, b.x, b.y) &&
  14470. LA(b.prev, b, b.next) >= 0
  14471. )
  14472. return !1;
  14473. b = b.nextZ;
  14474. }
  14475. return !0;
  14476. }
  14477. function wA(t, e, r) {
  14478. var n = t;
  14479. do {
  14480. var i = n.prev,
  14481. o = n.next.next;
  14482. !FA(i, o) &&
  14483. NA(i, n, n.next, o) &&
  14484. GA(i, o) &&
  14485. GA(o, i) &&
  14486. (e.push((i.i / r) | 0),
  14487. e.push((n.i / r) | 0),
  14488. e.push((o.i / r) | 0),
  14489. XA(n),
  14490. XA(n.next),
  14491. (n = t = o)),
  14492. (n = n.next);
  14493. } while (n !== t);
  14494. return TA(n);
  14495. }
  14496. function RA(t, e, r, n, i, o) {
  14497. var s = t;
  14498. do {
  14499. for (var a = s.next.next; a !== s.prev; ) {
  14500. if (s.i !== a.i && DA(s, a)) {
  14501. var u = UA(s, a);
  14502. return (
  14503. (s = TA(s, s.next)),
  14504. (u = TA(u, u.next)),
  14505. xA(s, e, r, n, i, o, 0),
  14506. void xA(u, e, r, n, i, o, 0)
  14507. );
  14508. }
  14509. a = a.next;
  14510. }
  14511. s = s.next;
  14512. } while (s !== t);
  14513. }
  14514. function CA(t, e) {
  14515. return t.x - e.x;
  14516. }
  14517. function PA(t, e) {
  14518. var r = (function (t, e) {
  14519. var r,
  14520. n = e,
  14521. i = t.x,
  14522. o = t.y,
  14523. s = -1 / 0;
  14524. do {
  14525. if (o <= n.y && o >= n.next.y && n.next.y !== n.y) {
  14526. var a = n.x + ((o - n.y) * (n.next.x - n.x)) / (n.next.y - n.y);
  14527. if (
  14528. a <= i &&
  14529. a > s &&
  14530. ((s = a), (r = n.x < n.next.x ? n : n.next), a === i)
  14531. )
  14532. return r;
  14533. }
  14534. n = n.next;
  14535. } while (n !== e);
  14536. if (!r) return null;
  14537. var u,
  14538. c = r,
  14539. h = r.x,
  14540. l = r.y,
  14541. d = 1 / 0;
  14542. n = r;
  14543. do {
  14544. i >= n.x &&
  14545. n.x >= h &&
  14546. i !== n.x &&
  14547. MA(o < l ? i : s, o, h, l, o < l ? s : i, o, n.x, n.y) &&
  14548. ((u = Math.abs(o - n.y) / (i - n.x)),
  14549. GA(n, t) &&
  14550. (u < d || (u === d && (n.x > r.x || (n.x === r.x && AA(r, n))))) &&
  14551. ((r = n), (d = u))),
  14552. (n = n.next);
  14553. } while (n !== c);
  14554. return r;
  14555. })(t, e);
  14556. if (!r) return e;
  14557. var n = UA(r, t);
  14558. return TA(n, n.next), TA(r, r.next);
  14559. }
  14560. function AA(t, e) {
  14561. return LA(t.prev, t, e.prev) < 0 && LA(e.next, t, t.next) < 0;
  14562. }
  14563. function OA(t, e, r, n, i) {
  14564. return (
  14565. (t =
  14566. 1431655765 &
  14567. ((t =
  14568. 858993459 &
  14569. ((t =
  14570. 252645135 &
  14571. ((t = 16711935 & ((t = ((t - r) * i) | 0) | (t << 8))) |
  14572. (t << 4))) |
  14573. (t << 2))) |
  14574. (t << 1))) |
  14575. ((e =
  14576. 1431655765 &
  14577. ((e =
  14578. 858993459 &
  14579. ((e =
  14580. 252645135 &
  14581. ((e = 16711935 & ((e = ((e - n) * i) | 0) | (e << 8))) |
  14582. (e << 4))) |
  14583. (e << 2))) |
  14584. (e << 1))) <<
  14585. 1)
  14586. );
  14587. }
  14588. function IA(t) {
  14589. var e = t,
  14590. r = t;
  14591. do {
  14592. (e.x < r.x || (e.x === r.x && e.y < r.y)) && (r = e), (e = e.next);
  14593. } while (e !== t);
  14594. return r;
  14595. }
  14596. function MA(t, e, r, n, i, o, s, a) {
  14597. return (
  14598. (i - s) * (e - a) >= (t - s) * (o - a) &&
  14599. (t - s) * (n - a) >= (r - s) * (e - a) &&
  14600. (r - s) * (o - a) >= (i - s) * (n - a)
  14601. );
  14602. }
  14603. function DA(t, e) {
  14604. return (
  14605. t.next.i !== e.i &&
  14606. t.prev.i !== e.i &&
  14607. !(function (t, e) {
  14608. var r = t;
  14609. do {
  14610. if (
  14611. r.i !== t.i &&
  14612. r.next.i !== t.i &&
  14613. r.i !== e.i &&
  14614. r.next.i !== e.i &&
  14615. NA(r, r.next, t, e)
  14616. )
  14617. return !0;
  14618. r = r.next;
  14619. } while (r !== t);
  14620. return !1;
  14621. })(t, e) &&
  14622. ((GA(t, e) &&
  14623. GA(e, t) &&
  14624. (function (t, e) {
  14625. var r = t,
  14626. n = !1,
  14627. i = (t.x + e.x) / 2,
  14628. o = (t.y + e.y) / 2;
  14629. do {
  14630. r.y > o != r.next.y > o &&
  14631. r.next.y !== r.y &&
  14632. i < ((r.next.x - r.x) * (o - r.y)) / (r.next.y - r.y) + r.x &&
  14633. (n = !n),
  14634. (r = r.next);
  14635. } while (r !== t);
  14636. return n;
  14637. })(t, e) &&
  14638. (LA(t.prev, t, e.prev) || LA(t, e.prev, e))) ||
  14639. (FA(t, e) && LA(t.prev, t, t.next) > 0 && LA(e.prev, e, e.next) > 0))
  14640. );
  14641. }
  14642. function LA(t, e, r) {
  14643. return (e.y - t.y) * (r.x - e.x) - (e.x - t.x) * (r.y - e.y);
  14644. }
  14645. function FA(t, e) {
  14646. return t.x === e.x && t.y === e.y;
  14647. }
  14648. function NA(t, e, r, n) {
  14649. var i = BA(LA(t, e, r)),
  14650. o = BA(LA(t, e, n)),
  14651. s = BA(LA(r, n, t)),
  14652. a = BA(LA(r, n, e));
  14653. return (
  14654. (i !== o && s !== a) ||
  14655. !(0 !== i || !kA(t, r, e)) ||
  14656. !(0 !== o || !kA(t, n, e)) ||
  14657. !(0 !== s || !kA(r, t, n)) ||
  14658. !(0 !== a || !kA(r, e, n))
  14659. );
  14660. }
  14661. function kA(t, e, r) {
  14662. return (
  14663. e.x <= Math.max(t.x, r.x) &&
  14664. e.x >= Math.min(t.x, r.x) &&
  14665. e.y <= Math.max(t.y, r.y) &&
  14666. e.y >= Math.min(t.y, r.y)
  14667. );
  14668. }
  14669. function BA(t) {
  14670. return t > 0 ? 1 : t < 0 ? -1 : 0;
  14671. }
  14672. function GA(t, e) {
  14673. return LA(t.prev, t, t.next) < 0
  14674. ? LA(t, e, t.next) >= 0 && LA(t, t.prev, e) >= 0
  14675. : LA(t, e, t.prev) < 0 || LA(t, t.next, e) < 0;
  14676. }
  14677. function UA(t, e) {
  14678. var r = new VA(t.i, t.x, t.y),
  14679. n = new VA(e.i, e.x, e.y),
  14680. i = t.next,
  14681. o = e.prev;
  14682. return (
  14683. (t.next = e),
  14684. (e.prev = t),
  14685. (r.next = i),
  14686. (i.prev = r),
  14687. (n.next = r),
  14688. (r.prev = n),
  14689. (o.next = n),
  14690. (n.prev = o),
  14691. n
  14692. );
  14693. }
  14694. function jA(t, e, r, n) {
  14695. var i = new VA(t, e, r);
  14696. return (
  14697. n
  14698. ? ((i.next = n.next), (i.prev = n), (n.next.prev = i), (n.next = i))
  14699. : ((i.prev = i), (i.next = i)),
  14700. i
  14701. );
  14702. }
  14703. function XA(t) {
  14704. (t.next.prev = t.prev),
  14705. (t.prev.next = t.next),
  14706. t.prevZ && (t.prevZ.nextZ = t.nextZ),
  14707. t.nextZ && (t.nextZ.prevZ = t.prevZ);
  14708. }
  14709. function VA(t, e, r) {
  14710. (this.i = t),
  14711. (this.x = e),
  14712. (this.y = r),
  14713. (this.prev = null),
  14714. (this.next = null),
  14715. (this.z = 0),
  14716. (this.prevZ = null),
  14717. (this.nextZ = null),
  14718. (this.steiner = !1);
  14719. }
  14720. function HA(t, e, r, n) {
  14721. for (var i = 0, o = e, s = r - n; o < r; o += n)
  14722. (i += (t[s] - t[o]) * (t[o + 1] + t[s + 1])), (s = o);
  14723. return i;
  14724. }
  14725. (gA.exports = _A),
  14726. (gA.exports.default = _A),
  14727. (_A.deviation = function (t, e, r, n) {
  14728. var i = e && e.length,
  14729. o = i ? e[0] * r : t.length,
  14730. s = Math.abs(HA(t, 0, o, r));
  14731. if (i)
  14732. for (var a = 0, u = e.length; a < u; a++) {
  14733. var c = e[a] * r,
  14734. h = a < u - 1 ? e[a + 1] * r : t.length;
  14735. s -= Math.abs(HA(t, c, h, r));
  14736. }
  14737. var l = 0;
  14738. for (a = 0; a < n.length; a += 3) {
  14739. var d = n[a] * r,
  14740. f = n[a + 1] * r,
  14741. p = n[a + 2] * r;
  14742. l += Math.abs(
  14743. (t[d] - t[p]) * (t[f + 1] - t[d + 1]) -
  14744. (t[d] - t[f]) * (t[p + 1] - t[d + 1])
  14745. );
  14746. }
  14747. return 0 === s && 0 === l ? 0 : Math.abs((l - s) / s);
  14748. }),
  14749. (_A.flatten = function (t) {
  14750. for (
  14751. var e = t[0][0].length,
  14752. r = { vertices: [], holes: [], dimensions: e },
  14753. n = 0,
  14754. i = 0;
  14755. i < t.length;
  14756. i++
  14757. ) {
  14758. for (var o = 0; o < t[i].length; o++)
  14759. for (var s = 0; s < e; s++) r.vertices.push(t[i][o][s]);
  14760. i > 0 && ((n += t[i - 1].length), r.holes.push(n));
  14761. }
  14762. return r;
  14763. });
  14764. var WA = gA.exports,
  14765. YA = { exports: {} };
  14766. !(function (t, r) {
  14767. !(function (n) {
  14768. var i = r && !r.nodeType && r,
  14769. o = t && !t.nodeType && t,
  14770. s = 'object' == typeof e && e;
  14771. (s.global !== s && s.window !== s && s.self !== s) || (n = s);
  14772. var a,
  14773. u,
  14774. c = 2147483647,
  14775. h = 36,
  14776. l = /^xn--/,
  14777. d = /[^\x20-\x7E]/,
  14778. f = /[\x2E\u3002\uFF0E\uFF61]/g,
  14779. p = {
  14780. overflow: 'Overflow: input needs wider integers to process',
  14781. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  14782. 'invalid-input': 'Invalid input',
  14783. },
  14784. v = Math.floor,
  14785. m = String.fromCharCode;
  14786. function y(t) {
  14787. throw new RangeError(p[t]);
  14788. }
  14789. function g(t, e) {
  14790. for (var r = t.length, n = []; r--; ) n[r] = e(t[r]);
  14791. return n;
  14792. }
  14793. function _(t, e) {
  14794. var r = t.split('@'),
  14795. n = '';
  14796. return (
  14797. r.length > 1 && ((n = r[0] + '@'), (t = r[1])),
  14798. n + g((t = t.replace(f, '.')).split('.'), e).join('.')
  14799. );
  14800. }
  14801. function b(t) {
  14802. for (var e, r, n = [], i = 0, o = t.length; i < o; )
  14803. (e = t.charCodeAt(i++)) >= 55296 && e <= 56319 && i < o
  14804. ? 56320 == (64512 & (r = t.charCodeAt(i++)))
  14805. ? n.push(((1023 & e) << 10) + (1023 & r) + 65536)
  14806. : (n.push(e), i--)
  14807. : n.push(e);
  14808. return n;
  14809. }
  14810. function T(t) {
  14811. return g(t, function (t) {
  14812. var e = '';
  14813. return (
  14814. t > 65535 &&
  14815. ((e += m((((t -= 65536) >>> 10) & 1023) | 55296)),
  14816. (t = 56320 | (1023 & t))),
  14817. (e += m(t))
  14818. );
  14819. }).join('');
  14820. }
  14821. function x(t, e) {
  14822. return t + 22 + 75 * (t < 26) - ((0 != e) << 5);
  14823. }
  14824. function E(t, e, r) {
  14825. var n = 0;
  14826. for (t = r ? v(t / 700) : t >> 1, t += v(t / e); t > 455; n += h)
  14827. t = v(t / 35);
  14828. return v(n + (36 * t) / (t + 38));
  14829. }
  14830. function S(t) {
  14831. var e,
  14832. r,
  14833. n,
  14834. i,
  14835. o,
  14836. s,
  14837. a,
  14838. u,
  14839. l,
  14840. d,
  14841. f,
  14842. p = [],
  14843. m = t.length,
  14844. g = 0,
  14845. _ = 128,
  14846. b = 72;
  14847. for ((r = t.lastIndexOf('-')) < 0 && (r = 0), n = 0; n < r; ++n)
  14848. t.charCodeAt(n) >= 128 && y('not-basic'), p.push(t.charCodeAt(n));
  14849. for (i = r > 0 ? r + 1 : 0; i < m; ) {
  14850. for (
  14851. o = g, s = 1, a = h;
  14852. i >= m && y('invalid-input'),
  14853. ((u =
  14854. (f = t.charCodeAt(i++)) - 48 < 10
  14855. ? f - 22
  14856. : f - 65 < 26
  14857. ? f - 65
  14858. : f - 97 < 26
  14859. ? f - 97
  14860. : h) >= h ||
  14861. u > v((c - g) / s)) &&
  14862. y('overflow'),
  14863. (g += u * s),
  14864. !(u < (l = a <= b ? 1 : a >= b + 26 ? 26 : a - b));
  14865. a += h
  14866. )
  14867. s > v(c / (d = h - l)) && y('overflow'), (s *= d);
  14868. (b = E(g - o, (e = p.length + 1), 0 == o)),
  14869. v(g / e) > c - _ && y('overflow'),
  14870. (_ += v(g / e)),
  14871. (g %= e),
  14872. p.splice(g++, 0, _);
  14873. }
  14874. return T(p);
  14875. }
  14876. function w(t) {
  14877. var e,
  14878. r,
  14879. n,
  14880. i,
  14881. o,
  14882. s,
  14883. a,
  14884. u,
  14885. l,
  14886. d,
  14887. f,
  14888. p,
  14889. g,
  14890. _,
  14891. T,
  14892. S = [];
  14893. for (p = (t = b(t)).length, e = 128, r = 0, o = 72, s = 0; s < p; ++s)
  14894. (f = t[s]) < 128 && S.push(m(f));
  14895. for (n = i = S.length, i && S.push('-'); n < p; ) {
  14896. for (a = c, s = 0; s < p; ++s) (f = t[s]) >= e && f < a && (a = f);
  14897. for (
  14898. a - e > v((c - r) / (g = n + 1)) && y('overflow'),
  14899. r += (a - e) * g,
  14900. e = a,
  14901. s = 0;
  14902. s < p;
  14903. ++s
  14904. )
  14905. if (((f = t[s]) < e && ++r > c && y('overflow'), f == e)) {
  14906. for (
  14907. u = r, l = h;
  14908. !(u < (d = l <= o ? 1 : l >= o + 26 ? 26 : l - o));
  14909. l += h
  14910. )
  14911. (T = u - d),
  14912. (_ = h - d),
  14913. S.push(m(x(d + (T % _), 0))),
  14914. (u = v(T / _));
  14915. S.push(m(x(u, 0))), (o = E(r, g, n == i)), (r = 0), ++n;
  14916. }
  14917. ++r, ++e;
  14918. }
  14919. return S.join('');
  14920. }
  14921. if (
  14922. ((a = {
  14923. version: '1.4.1',
  14924. ucs2: { decode: b, encode: T },
  14925. decode: S,
  14926. encode: w,
  14927. toASCII: function (t) {
  14928. return _(t, function (t) {
  14929. return d.test(t) ? 'xn--' + w(t) : t;
  14930. });
  14931. },
  14932. toUnicode: function (t) {
  14933. return _(t, function (t) {
  14934. return l.test(t) ? S(t.slice(4).toLowerCase()) : t;
  14935. });
  14936. },
  14937. }),
  14938. i && o)
  14939. )
  14940. if (t.exports == i) o.exports = a;
  14941. else for (u in a) a.hasOwnProperty(u) && (i[u] = a[u]);
  14942. else n.punycode = a;
  14943. })(e);
  14944. })(YA, YA.exports);
  14945. var zA,
  14946. ZA = 'undefined' != typeof Symbol && Symbol,
  14947. JA = function () {
  14948. if (
  14949. 'function' != typeof Symbol ||
  14950. 'function' != typeof Object.getOwnPropertySymbols
  14951. )
  14952. return !1;
  14953. if ('symbol' == typeof Symbol.iterator) return !0;
  14954. var t = {},
  14955. e = Symbol('test'),
  14956. r = Object(e);
  14957. if ('string' == typeof e) return !1;
  14958. if ('[object Symbol]' !== Object.prototype.toString.call(e)) return !1;
  14959. if ('[object Symbol]' !== Object.prototype.toString.call(r)) return !1;
  14960. for (e in ((t[e] = 42), t)) return !1;
  14961. if ('function' == typeof Object.keys && 0 !== Object.keys(t).length)
  14962. return !1;
  14963. if (
  14964. 'function' == typeof Object.getOwnPropertyNames &&
  14965. 0 !== Object.getOwnPropertyNames(t).length
  14966. )
  14967. return !1;
  14968. var n = Object.getOwnPropertySymbols(t);
  14969. if (1 !== n.length || n[0] !== e) return !1;
  14970. if (!Object.prototype.propertyIsEnumerable.call(t, e)) return !1;
  14971. if ('function' == typeof Object.getOwnPropertyDescriptor) {
  14972. var i = Object.getOwnPropertyDescriptor(t, e);
  14973. if (42 !== i.value || !0 !== i.enumerable) return !1;
  14974. }
  14975. return !0;
  14976. },
  14977. KA = 'Function.prototype.bind called on incompatible ',
  14978. qA = Array.prototype.slice,
  14979. QA = Object.prototype.toString,
  14980. $A = '[object Function]',
  14981. tO = function (t) {
  14982. var e = this;
  14983. if ('function' != typeof e || QA.call(e) !== $A)
  14984. throw new TypeError(KA + e);
  14985. for (
  14986. var r,
  14987. n = qA.call(arguments, 1),
  14988. i = function () {
  14989. if (this instanceof r) {
  14990. var i = e.apply(this, n.concat(qA.call(arguments)));
  14991. return Object(i) === i ? i : this;
  14992. }
  14993. return e.apply(t, n.concat(qA.call(arguments)));
  14994. },
  14995. o = Math.max(0, e.length - n.length),
  14996. s = [],
  14997. a = 0;
  14998. a < o;
  14999. a++
  15000. )
  15001. s.push('$' + a);
  15002. if (
  15003. ((r = Function(
  15004. 'binder',
  15005. 'return function (' +
  15006. s.join(',') +
  15007. '){ return binder.apply(this,arguments); }'
  15008. )(i)),
  15009. e.prototype)
  15010. ) {
  15011. var u = function () {};
  15012. (u.prototype = e.prototype),
  15013. (r.prototype = new u()),
  15014. (u.prototype = null);
  15015. }
  15016. return r;
  15017. },
  15018. eO = Function.prototype.bind || tO,
  15019. rO = eO.call(Function.call, Object.prototype.hasOwnProperty),
  15020. nO = SyntaxError,
  15021. iO = Function,
  15022. oO = TypeError,
  15023. sO = function (t) {
  15024. try {
  15025. return iO('"use strict"; return (' + t + ').constructor;')();
  15026. } catch (t) {}
  15027. },
  15028. aO = Object.getOwnPropertyDescriptor;
  15029. if (aO)
  15030. try {
  15031. aO({}, '');
  15032. } catch (t) {
  15033. aO = null;
  15034. }
  15035. var uO = function () {
  15036. throw new oO();
  15037. },
  15038. cO = aO
  15039. ? (function () {
  15040. try {
  15041. return uO;
  15042. } catch (t) {
  15043. try {
  15044. return aO(arguments, 'callee').get;
  15045. } catch (t) {
  15046. return uO;
  15047. }
  15048. }
  15049. })()
  15050. : uO,
  15051. hO =
  15052. 'function' == typeof ZA &&
  15053. 'function' == typeof Symbol &&
  15054. 'symbol' == typeof ZA('foo') &&
  15055. 'symbol' == typeof Symbol('bar') &&
  15056. JA(),
  15057. lO =
  15058. Object.getPrototypeOf ||
  15059. function (t) {
  15060. return t.__proto__;
  15061. },
  15062. dO = {},
  15063. fO = 'undefined' == typeof Uint8Array ? zA : lO(Uint8Array),
  15064. pO = {
  15065. '%AggregateError%':
  15066. 'undefined' == typeof AggregateError ? zA : AggregateError,
  15067. '%Array%': Array,
  15068. '%ArrayBuffer%': 'undefined' == typeof ArrayBuffer ? zA : ArrayBuffer,
  15069. '%ArrayIteratorPrototype%': hO ? lO([][Symbol.iterator]()) : zA,
  15070. '%AsyncFromSyncIteratorPrototype%': zA,
  15071. '%AsyncFunction%': dO,
  15072. '%AsyncGenerator%': dO,
  15073. '%AsyncGeneratorFunction%': dO,
  15074. '%AsyncIteratorPrototype%': dO,
  15075. '%Atomics%': 'undefined' == typeof Atomics ? zA : Atomics,
  15076. '%BigInt%': 'undefined' == typeof BigInt ? zA : BigInt,
  15077. '%Boolean%': Boolean,
  15078. '%DataView%': 'undefined' == typeof DataView ? zA : DataView,
  15079. '%Date%': Date,
  15080. '%decodeURI%': decodeURI,
  15081. '%decodeURIComponent%': decodeURIComponent,
  15082. '%encodeURI%': encodeURI,
  15083. '%encodeURIComponent%': encodeURIComponent,
  15084. '%Error%': Error,
  15085. '%eval%': eval,
  15086. '%EvalError%': EvalError,
  15087. '%Float32Array%': 'undefined' == typeof Float32Array ? zA : Float32Array,
  15088. '%Float64Array%': 'undefined' == typeof Float64Array ? zA : Float64Array,
  15089. '%FinalizationRegistry%':
  15090. 'undefined' == typeof FinalizationRegistry ? zA : FinalizationRegistry,
  15091. '%Function%': iO,
  15092. '%GeneratorFunction%': dO,
  15093. '%Int8Array%': 'undefined' == typeof Int8Array ? zA : Int8Array,
  15094. '%Int16Array%': 'undefined' == typeof Int16Array ? zA : Int16Array,
  15095. '%Int32Array%': 'undefined' == typeof Int32Array ? zA : Int32Array,
  15096. '%isFinite%': isFinite,
  15097. '%isNaN%': isNaN,
  15098. '%IteratorPrototype%': hO ? lO(lO([][Symbol.iterator]())) : zA,
  15099. '%JSON%': 'object' == typeof JSON ? JSON : zA,
  15100. '%Map%': 'undefined' == typeof Map ? zA : Map,
  15101. '%MapIteratorPrototype%':
  15102. 'undefined' != typeof Map && hO ? lO(new Map()[Symbol.iterator]()) : zA,
  15103. '%Math%': Math,
  15104. '%Number%': Number,
  15105. '%Object%': Object,
  15106. '%parseFloat%': parseFloat,
  15107. '%parseInt%': parseInt,
  15108. '%Promise%': 'undefined' == typeof Promise ? zA : Promise,
  15109. '%Proxy%': 'undefined' == typeof Proxy ? zA : Proxy,
  15110. '%RangeError%': RangeError,
  15111. '%ReferenceError%': ReferenceError,
  15112. '%Reflect%': 'undefined' == typeof Reflect ? zA : Reflect,
  15113. '%RegExp%': RegExp,
  15114. '%Set%': 'undefined' == typeof Set ? zA : Set,
  15115. '%SetIteratorPrototype%':
  15116. 'undefined' != typeof Set && hO ? lO(new Set()[Symbol.iterator]()) : zA,
  15117. '%SharedArrayBuffer%':
  15118. 'undefined' == typeof SharedArrayBuffer ? zA : SharedArrayBuffer,
  15119. '%String%': String,
  15120. '%StringIteratorPrototype%': hO ? lO(''[Symbol.iterator]()) : zA,
  15121. '%Symbol%': hO ? Symbol : zA,
  15122. '%SyntaxError%': nO,
  15123. '%ThrowTypeError%': cO,
  15124. '%TypedArray%': fO,
  15125. '%TypeError%': oO,
  15126. '%Uint8Array%': 'undefined' == typeof Uint8Array ? zA : Uint8Array,
  15127. '%Uint8ClampedArray%':
  15128. 'undefined' == typeof Uint8ClampedArray ? zA : Uint8ClampedArray,
  15129. '%Uint16Array%': 'undefined' == typeof Uint16Array ? zA : Uint16Array,
  15130. '%Uint32Array%': 'undefined' == typeof Uint32Array ? zA : Uint32Array,
  15131. '%URIError%': URIError,
  15132. '%WeakMap%': 'undefined' == typeof WeakMap ? zA : WeakMap,
  15133. '%WeakRef%': 'undefined' == typeof WeakRef ? zA : WeakRef,
  15134. '%WeakSet%': 'undefined' == typeof WeakSet ? zA : WeakSet,
  15135. },
  15136. vO = function t(e) {
  15137. var r;
  15138. if ('%AsyncFunction%' === e) r = sO('async function () {}');
  15139. else if ('%GeneratorFunction%' === e) r = sO('function* () {}');
  15140. else if ('%AsyncGeneratorFunction%' === e)
  15141. r = sO('async function* () {}');
  15142. else if ('%AsyncGenerator%' === e) {
  15143. var n = t('%AsyncGeneratorFunction%');
  15144. n && (r = n.prototype);
  15145. } else if ('%AsyncIteratorPrototype%' === e) {
  15146. var i = t('%AsyncGenerator%');
  15147. i && (r = lO(i.prototype));
  15148. }
  15149. return (pO[e] = r), r;
  15150. },
  15151. mO = {
  15152. '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  15153. '%ArrayPrototype%': ['Array', 'prototype'],
  15154. '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  15155. '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  15156. '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  15157. '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  15158. '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  15159. '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  15160. '%AsyncGeneratorPrototype%': [
  15161. 'AsyncGeneratorFunction',
  15162. 'prototype',
  15163. 'prototype',
  15164. ],
  15165. '%BooleanPrototype%': ['Boolean', 'prototype'],
  15166. '%DataViewPrototype%': ['DataView', 'prototype'],
  15167. '%DatePrototype%': ['Date', 'prototype'],
  15168. '%ErrorPrototype%': ['Error', 'prototype'],
  15169. '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  15170. '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  15171. '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  15172. '%FunctionPrototype%': ['Function', 'prototype'],
  15173. '%Generator%': ['GeneratorFunction', 'prototype'],
  15174. '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  15175. '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  15176. '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  15177. '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  15178. '%JSONParse%': ['JSON', 'parse'],
  15179. '%JSONStringify%': ['JSON', 'stringify'],
  15180. '%MapPrototype%': ['Map', 'prototype'],
  15181. '%NumberPrototype%': ['Number', 'prototype'],
  15182. '%ObjectPrototype%': ['Object', 'prototype'],
  15183. '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  15184. '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  15185. '%PromisePrototype%': ['Promise', 'prototype'],
  15186. '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  15187. '%Promise_all%': ['Promise', 'all'],
  15188. '%Promise_reject%': ['Promise', 'reject'],
  15189. '%Promise_resolve%': ['Promise', 'resolve'],
  15190. '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  15191. '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  15192. '%RegExpPrototype%': ['RegExp', 'prototype'],
  15193. '%SetPrototype%': ['Set', 'prototype'],
  15194. '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  15195. '%StringPrototype%': ['String', 'prototype'],
  15196. '%SymbolPrototype%': ['Symbol', 'prototype'],
  15197. '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  15198. '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  15199. '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  15200. '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  15201. '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  15202. '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  15203. '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  15204. '%URIErrorPrototype%': ['URIError', 'prototype'],
  15205. '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  15206. '%WeakSetPrototype%': ['WeakSet', 'prototype'],
  15207. },
  15208. yO = eO,
  15209. gO = rO,
  15210. _O = yO.call(Function.call, Array.prototype.concat),
  15211. bO = yO.call(Function.apply, Array.prototype.splice),
  15212. TO = yO.call(Function.call, String.prototype.replace),
  15213. xO = yO.call(Function.call, String.prototype.slice),
  15214. EO = yO.call(Function.call, RegExp.prototype.exec),
  15215. SO =
  15216. /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
  15217. wO = /\\(\\)?/g,
  15218. RO = function (t) {
  15219. var e = xO(t, 0, 1),
  15220. r = xO(t, -1);
  15221. if ('%' === e && '%' !== r)
  15222. throw new nO('invalid intrinsic syntax, expected closing `%`');
  15223. if ('%' === r && '%' !== e)
  15224. throw new nO('invalid intrinsic syntax, expected opening `%`');
  15225. var n = [];
  15226. return (
  15227. TO(t, SO, function (t, e, r, i) {
  15228. n[n.length] = r ? TO(i, wO, '$1') : e || t;
  15229. }),
  15230. n
  15231. );
  15232. },
  15233. CO = function (t, e) {
  15234. var r,
  15235. n = t;
  15236. if ((gO(mO, n) && (n = '%' + (r = mO[n])[0] + '%'), gO(pO, n))) {
  15237. var i = pO[n];
  15238. if ((i === dO && (i = vO(n)), void 0 === i && !e))
  15239. throw new oO(
  15240. 'intrinsic ' +
  15241. t +
  15242. ' exists, but is not available. Please file an issue!'
  15243. );
  15244. return { alias: r, name: n, value: i };
  15245. }
  15246. throw new nO('intrinsic ' + t + ' does not exist!');
  15247. },
  15248. PO = function (t, e) {
  15249. if ('string' != typeof t || 0 === t.length)
  15250. throw new oO('intrinsic name must be a non-empty string');
  15251. if (arguments.length > 1 && 'boolean' != typeof e)
  15252. throw new oO('"allowMissing" argument must be a boolean');
  15253. if (null === EO(/^%?[^%]*%?$/, t))
  15254. throw new nO(
  15255. '`%` may not be present anywhere but at the beginning and end of the intrinsic name'
  15256. );
  15257. var r = RO(t),
  15258. n = r.length > 0 ? r[0] : '',
  15259. i = CO('%' + n + '%', e),
  15260. o = i.name,
  15261. s = i.value,
  15262. a = !1,
  15263. u = i.alias;
  15264. u && ((n = u[0]), bO(r, _O([0, 1], u)));
  15265. for (var c = 1, h = !0; c < r.length; c += 1) {
  15266. var l = r[c],
  15267. d = xO(l, 0, 1),
  15268. f = xO(l, -1);
  15269. if (
  15270. ('"' === d ||
  15271. "'" === d ||
  15272. '`' === d ||
  15273. '"' === f ||
  15274. "'" === f ||
  15275. '`' === f) &&
  15276. d !== f
  15277. )
  15278. throw new nO('property names with quotes must have matching quotes');
  15279. if (
  15280. (('constructor' !== l && h) || (a = !0),
  15281. gO(pO, (o = '%' + (n += '.' + l) + '%')))
  15282. )
  15283. s = pO[o];
  15284. else if (null != s) {
  15285. if (!(l in s)) {
  15286. if (!e)
  15287. throw new oO(
  15288. 'base intrinsic for ' +
  15289. t +
  15290. ' exists, but the property is not available.'
  15291. );
  15292. return;
  15293. }
  15294. if (aO && c + 1 >= r.length) {
  15295. var p = aO(s, l);
  15296. s =
  15297. (h = !!p) && 'get' in p && !('originalValue' in p.get)
  15298. ? p.get
  15299. : s[l];
  15300. } else (h = gO(s, l)), (s = s[l]);
  15301. h && !a && (pO[o] = s);
  15302. }
  15303. }
  15304. return s;
  15305. },
  15306. AO = { exports: {} };
  15307. !(function (t) {
  15308. var e = eO,
  15309. r = PO,
  15310. n = r('%Function.prototype.apply%'),
  15311. i = r('%Function.prototype.call%'),
  15312. o = r('%Reflect.apply%', !0) || e.call(i, n),
  15313. s = r('%Object.getOwnPropertyDescriptor%', !0),
  15314. a = r('%Object.defineProperty%', !0),
  15315. u = r('%Math.max%');
  15316. if (a)
  15317. try {
  15318. a({}, 'a', { value: 1 });
  15319. } catch (t) {
  15320. a = null;
  15321. }
  15322. t.exports = function (t) {
  15323. var r = o(e, i, arguments);
  15324. if (s && a) {
  15325. var n = s(r, 'length');
  15326. n.configurable &&
  15327. a(r, 'length', {
  15328. value: 1 + u(0, t.length - (arguments.length - 1)),
  15329. });
  15330. }
  15331. return r;
  15332. };
  15333. var c = function () {
  15334. return o(e, n, arguments);
  15335. };
  15336. a ? a(t.exports, 'apply', { value: c }) : (t.exports.apply = c);
  15337. })(AO);
  15338. var OO = PO,
  15339. IO = AO.exports,
  15340. MO = IO(OO('String.prototype.indexOf')),
  15341. DO = n(Object.freeze({ __proto__: null, default: {} })),
  15342. LO = 'function' == typeof Map && Map.prototype,
  15343. FO =
  15344. Object.getOwnPropertyDescriptor && LO
  15345. ? Object.getOwnPropertyDescriptor(Map.prototype, 'size')
  15346. : null,
  15347. NO = LO && FO && 'function' == typeof FO.get ? FO.get : null,
  15348. kO = LO && Map.prototype.forEach,
  15349. BO = 'function' == typeof Set && Set.prototype,
  15350. GO =
  15351. Object.getOwnPropertyDescriptor && BO
  15352. ? Object.getOwnPropertyDescriptor(Set.prototype, 'size')
  15353. : null,
  15354. UO = BO && GO && 'function' == typeof GO.get ? GO.get : null,
  15355. jO = BO && Set.prototype.forEach,
  15356. XO =
  15357. 'function' == typeof WeakMap && WeakMap.prototype
  15358. ? WeakMap.prototype.has
  15359. : null,
  15360. VO =
  15361. 'function' == typeof WeakSet && WeakSet.prototype
  15362. ? WeakSet.prototype.has
  15363. : null,
  15364. HO =
  15365. 'function' == typeof WeakRef && WeakRef.prototype
  15366. ? WeakRef.prototype.deref
  15367. : null,
  15368. WO = Boolean.prototype.valueOf,
  15369. YO = Object.prototype.toString,
  15370. zO = Function.prototype.toString,
  15371. ZO = String.prototype.match,
  15372. JO = String.prototype.slice,
  15373. KO = String.prototype.replace,
  15374. qO = String.prototype.toUpperCase,
  15375. QO = String.prototype.toLowerCase,
  15376. $O = RegExp.prototype.test,
  15377. tI = Array.prototype.concat,
  15378. eI = Array.prototype.join,
  15379. rI = Array.prototype.slice,
  15380. nI = Math.floor,
  15381. iI = 'function' == typeof BigInt ? BigInt.prototype.valueOf : null,
  15382. oI = Object.getOwnPropertySymbols,
  15383. sI =
  15384. 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
  15385. ? Symbol.prototype.toString
  15386. : null,
  15387. aI = 'function' == typeof Symbol && 'object' == typeof Symbol.iterator,
  15388. uI =
  15389. 'function' == typeof Symbol &&
  15390. Symbol.toStringTag &&
  15391. (typeof Symbol.toStringTag === aI || 'symbol')
  15392. ? Symbol.toStringTag
  15393. : null,
  15394. cI = Object.prototype.propertyIsEnumerable,
  15395. hI =
  15396. ('function' == typeof Reflect
  15397. ? Reflect.getPrototypeOf
  15398. : Object.getPrototypeOf) ||
  15399. ([].__proto__ === Array.prototype
  15400. ? function (t) {
  15401. return t.__proto__;
  15402. }
  15403. : null);
  15404. function lI(t, e) {
  15405. if (
  15406. t === 1 / 0 ||
  15407. t === -1 / 0 ||
  15408. t != t ||
  15409. (t && t > -1e3 && t < 1e3) ||
  15410. $O.call(/e/, e)
  15411. )
  15412. return e;
  15413. var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
  15414. if ('number' == typeof t) {
  15415. var n = t < 0 ? -nI(-t) : nI(t);
  15416. if (n !== t) {
  15417. var i = String(n),
  15418. o = JO.call(e, i.length + 1);
  15419. return (
  15420. KO.call(i, r, '$&_') +
  15421. '.' +
  15422. KO.call(KO.call(o, /([0-9]{3})/g, '$&_'), /_$/, '')
  15423. );
  15424. }
  15425. }
  15426. return KO.call(e, r, '$&_');
  15427. }
  15428. var dI = DO,
  15429. fI = dI.custom,
  15430. pI = _I(fI) ? fI : null;
  15431. function vI(t, e, r) {
  15432. var n = 'double' === (r.quoteStyle || e) ? '"' : "'";
  15433. return n + t + n;
  15434. }
  15435. function mI(t) {
  15436. return KO.call(String(t), /"/g, '&quot;');
  15437. }
  15438. function yI(t) {
  15439. return !(
  15440. '[object Array]' !== xI(t) ||
  15441. (uI && 'object' == typeof t && uI in t)
  15442. );
  15443. }
  15444. function gI(t) {
  15445. return !(
  15446. '[object RegExp]' !== xI(t) ||
  15447. (uI && 'object' == typeof t && uI in t)
  15448. );
  15449. }
  15450. function _I(t) {
  15451. if (aI) return t && 'object' == typeof t && t instanceof Symbol;
  15452. if ('symbol' == typeof t) return !0;
  15453. if (!t || 'object' != typeof t || !sI) return !1;
  15454. try {
  15455. return sI.call(t), !0;
  15456. } catch (t) {}
  15457. return !1;
  15458. }
  15459. var bI =
  15460. Object.prototype.hasOwnProperty ||
  15461. function (t) {
  15462. return t in this;
  15463. };
  15464. function TI(t, e) {
  15465. return bI.call(t, e);
  15466. }
  15467. function xI(t) {
  15468. return YO.call(t);
  15469. }
  15470. function EI(t, e) {
  15471. if (t.indexOf) return t.indexOf(e);
  15472. for (var r = 0, n = t.length; r < n; r++) if (t[r] === e) return r;
  15473. return -1;
  15474. }
  15475. function SI(t, e) {
  15476. if (t.length > e.maxStringLength) {
  15477. var r = t.length - e.maxStringLength,
  15478. n = '... ' + r + ' more character' + (r > 1 ? 's' : '');
  15479. return SI(JO.call(t, 0, e.maxStringLength), e) + n;
  15480. }
  15481. return vI(
  15482. KO.call(KO.call(t, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, wI),
  15483. 'single',
  15484. e
  15485. );
  15486. }
  15487. function wI(t) {
  15488. var e = t.charCodeAt(0),
  15489. r = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[e];
  15490. return r ? '\\' + r : '\\x' + (e < 16 ? '0' : '') + qO.call(e.toString(16));
  15491. }
  15492. function RI(t) {
  15493. return 'Object(' + t + ')';
  15494. }
  15495. function CI(t) {
  15496. return t + ' { ? }';
  15497. }
  15498. function PI(t, e, r, n) {
  15499. return t + ' (' + e + ') {' + (n ? AI(r, n) : eI.call(r, ', ')) + '}';
  15500. }
  15501. function AI(t, e) {
  15502. if (0 === t.length) return '';
  15503. var r = '\n' + e.prev + e.base;
  15504. return r + eI.call(t, ',' + r) + '\n' + e.prev;
  15505. }
  15506. function OI(t, e) {
  15507. var r = yI(t),
  15508. n = [];
  15509. if (r) {
  15510. n.length = t.length;
  15511. for (var i = 0; i < t.length; i++) n[i] = TI(t, i) ? e(t[i], t) : '';
  15512. }
  15513. var o,
  15514. s = 'function' == typeof oI ? oI(t) : [];
  15515. if (aI) {
  15516. o = {};
  15517. for (var a = 0; a < s.length; a++) o['$' + s[a]] = s[a];
  15518. }
  15519. for (var u in t)
  15520. TI(t, u) &&
  15521. ((r && String(Number(u)) === u && u < t.length) ||
  15522. (aI && o['$' + u] instanceof Symbol) ||
  15523. ($O.call(/[^\w$]/, u)
  15524. ? n.push(e(u, t) + ': ' + e(t[u], t))
  15525. : n.push(u + ': ' + e(t[u], t))));
  15526. if ('function' == typeof oI)
  15527. for (var c = 0; c < s.length; c++)
  15528. cI.call(t, s[c]) && n.push('[' + e(s[c]) + ']: ' + e(t[s[c]], t));
  15529. return n;
  15530. }
  15531. var II = PO,
  15532. MI = function (t, e) {
  15533. var r = OO(t, !!e);
  15534. return 'function' == typeof r && MO(t, '.prototype.') > -1 ? IO(r) : r;
  15535. },
  15536. DI = function t(e, r, n, i) {
  15537. var o = r || {};
  15538. if (
  15539. TI(o, 'quoteStyle') &&
  15540. 'single' !== o.quoteStyle &&
  15541. 'double' !== o.quoteStyle
  15542. )
  15543. throw new TypeError('option "quoteStyle" must be "single" or "double"');
  15544. if (
  15545. TI(o, 'maxStringLength') &&
  15546. ('number' == typeof o.maxStringLength
  15547. ? o.maxStringLength < 0 && o.maxStringLength !== 1 / 0
  15548. : null !== o.maxStringLength)
  15549. )
  15550. throw new TypeError(
  15551. 'option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'
  15552. );
  15553. var s = !TI(o, 'customInspect') || o.customInspect;
  15554. if ('boolean' != typeof s && 'symbol' !== s)
  15555. throw new TypeError(
  15556. 'option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'
  15557. );
  15558. if (
  15559. TI(o, 'indent') &&
  15560. null !== o.indent &&
  15561. '\t' !== o.indent &&
  15562. !(parseInt(o.indent, 10) === o.indent && o.indent > 0)
  15563. )
  15564. throw new TypeError(
  15565. 'option "indent" must be "\\t", an integer > 0, or `null`'
  15566. );
  15567. if (TI(o, 'numericSeparator') && 'boolean' != typeof o.numericSeparator)
  15568. throw new TypeError(
  15569. 'option "numericSeparator", if provided, must be `true` or `false`'
  15570. );
  15571. var a = o.numericSeparator;
  15572. if (void 0 === e) return 'undefined';
  15573. if (null === e) return 'null';
  15574. if ('boolean' == typeof e) return e ? 'true' : 'false';
  15575. if ('string' == typeof e) return SI(e, o);
  15576. if ('number' == typeof e) {
  15577. if (0 === e) return 1 / 0 / e > 0 ? '0' : '-0';
  15578. var u = String(e);
  15579. return a ? lI(e, u) : u;
  15580. }
  15581. if ('bigint' == typeof e) {
  15582. var c = String(e) + 'n';
  15583. return a ? lI(e, c) : c;
  15584. }
  15585. var h = void 0 === o.depth ? 5 : o.depth;
  15586. if ((void 0 === n && (n = 0), n >= h && h > 0 && 'object' == typeof e))
  15587. return yI(e) ? '[Array]' : '[Object]';
  15588. var l = (function (t, e) {
  15589. var r;
  15590. if ('\t' === t.indent) r = '\t';
  15591. else {
  15592. if (!('number' == typeof t.indent && t.indent > 0)) return null;
  15593. r = eI.call(Array(t.indent + 1), ' ');
  15594. }
  15595. return { base: r, prev: eI.call(Array(e + 1), r) };
  15596. })(o, n);
  15597. if (void 0 === i) i = [];
  15598. else if (EI(i, e) >= 0) return '[Circular]';
  15599. function d(e, r, s) {
  15600. if ((r && (i = rI.call(i)).push(r), s)) {
  15601. var a = { depth: o.depth };
  15602. return (
  15603. TI(o, 'quoteStyle') && (a.quoteStyle = o.quoteStyle),
  15604. t(e, a, n + 1, i)
  15605. );
  15606. }
  15607. return t(e, o, n + 1, i);
  15608. }
  15609. if ('function' == typeof e && !gI(e)) {
  15610. var f = (function (t) {
  15611. if (t.name) return t.name;
  15612. var e = ZO.call(zO.call(t), /^function\s*([\w$]+)/);
  15613. if (e) return e[1];
  15614. return null;
  15615. })(e),
  15616. p = OI(e, d);
  15617. return (
  15618. '[Function' +
  15619. (f ? ': ' + f : ' (anonymous)') +
  15620. ']' +
  15621. (p.length > 0 ? ' { ' + eI.call(p, ', ') + ' }' : '')
  15622. );
  15623. }
  15624. if (_I(e)) {
  15625. var v = aI
  15626. ? KO.call(String(e), /^(Symbol\(.*\))_[^)]*$/, '$1')
  15627. : sI.call(e);
  15628. return 'object' != typeof e || aI ? v : RI(v);
  15629. }
  15630. if (
  15631. (function (t) {
  15632. if (!t || 'object' != typeof t) return !1;
  15633. if ('undefined' != typeof HTMLElement && t instanceof HTMLElement)
  15634. return !0;
  15635. return (
  15636. 'string' == typeof t.nodeName && 'function' == typeof t.getAttribute
  15637. );
  15638. })(e)
  15639. ) {
  15640. for (
  15641. var m = '<' + QO.call(String(e.nodeName)),
  15642. y = e.attributes || [],
  15643. g = 0;
  15644. g < y.length;
  15645. g++
  15646. )
  15647. m += ' ' + y[g].name + '=' + vI(mI(y[g].value), 'double', o);
  15648. return (
  15649. (m += '>'),
  15650. e.childNodes && e.childNodes.length && (m += '...'),
  15651. (m += '</' + QO.call(String(e.nodeName)) + '>')
  15652. );
  15653. }
  15654. if (yI(e)) {
  15655. if (0 === e.length) return '[]';
  15656. var _ = OI(e, d);
  15657. return l &&
  15658. !(function (t) {
  15659. for (var e = 0; e < t.length; e++)
  15660. if (EI(t[e], '\n') >= 0) return !1;
  15661. return !0;
  15662. })(_)
  15663. ? '[' + AI(_, l) + ']'
  15664. : '[ ' + eI.call(_, ', ') + ' ]';
  15665. }
  15666. if (
  15667. (function (t) {
  15668. return !(
  15669. '[object Error]' !== xI(t) ||
  15670. (uI && 'object' == typeof t && uI in t)
  15671. );
  15672. })(e)
  15673. ) {
  15674. var b = OI(e, d);
  15675. return 'cause' in Error.prototype ||
  15676. !('cause' in e) ||
  15677. cI.call(e, 'cause')
  15678. ? 0 === b.length
  15679. ? '[' + String(e) + ']'
  15680. : '{ [' + String(e) + '] ' + eI.call(b, ', ') + ' }'
  15681. : '{ [' +
  15682. String(e) +
  15683. '] ' +
  15684. eI.call(tI.call('[cause]: ' + d(e.cause), b), ', ') +
  15685. ' }';
  15686. }
  15687. if ('object' == typeof e && s) {
  15688. if (pI && 'function' == typeof e[pI] && dI)
  15689. return dI(e, { depth: h - n });
  15690. if ('symbol' !== s && 'function' == typeof e.inspect)
  15691. return e.inspect();
  15692. }
  15693. if (
  15694. (function (t) {
  15695. if (!NO || !t || 'object' != typeof t) return !1;
  15696. try {
  15697. NO.call(t);
  15698. try {
  15699. UO.call(t);
  15700. } catch (t) {
  15701. return !0;
  15702. }
  15703. return t instanceof Map;
  15704. } catch (t) {}
  15705. return !1;
  15706. })(e)
  15707. ) {
  15708. var T = [];
  15709. return (
  15710. kO.call(e, function (t, r) {
  15711. T.push(d(r, e, !0) + ' => ' + d(t, e));
  15712. }),
  15713. PI('Map', NO.call(e), T, l)
  15714. );
  15715. }
  15716. if (
  15717. (function (t) {
  15718. if (!UO || !t || 'object' != typeof t) return !1;
  15719. try {
  15720. UO.call(t);
  15721. try {
  15722. NO.call(t);
  15723. } catch (t) {
  15724. return !0;
  15725. }
  15726. return t instanceof Set;
  15727. } catch (t) {}
  15728. return !1;
  15729. })(e)
  15730. ) {
  15731. var x = [];
  15732. return (
  15733. jO.call(e, function (t) {
  15734. x.push(d(t, e));
  15735. }),
  15736. PI('Set', UO.call(e), x, l)
  15737. );
  15738. }
  15739. if (
  15740. (function (t) {
  15741. if (!XO || !t || 'object' != typeof t) return !1;
  15742. try {
  15743. XO.call(t, XO);
  15744. try {
  15745. VO.call(t, VO);
  15746. } catch (t) {
  15747. return !0;
  15748. }
  15749. return t instanceof WeakMap;
  15750. } catch (t) {}
  15751. return !1;
  15752. })(e)
  15753. )
  15754. return CI('WeakMap');
  15755. if (
  15756. (function (t) {
  15757. if (!VO || !t || 'object' != typeof t) return !1;
  15758. try {
  15759. VO.call(t, VO);
  15760. try {
  15761. XO.call(t, XO);
  15762. } catch (t) {
  15763. return !0;
  15764. }
  15765. return t instanceof WeakSet;
  15766. } catch (t) {}
  15767. return !1;
  15768. })(e)
  15769. )
  15770. return CI('WeakSet');
  15771. if (
  15772. (function (t) {
  15773. if (!HO || !t || 'object' != typeof t) return !1;
  15774. try {
  15775. return HO.call(t), !0;
  15776. } catch (t) {}
  15777. return !1;
  15778. })(e)
  15779. )
  15780. return CI('WeakRef');
  15781. if (
  15782. (function (t) {
  15783. return !(
  15784. '[object Number]' !== xI(t) ||
  15785. (uI && 'object' == typeof t && uI in t)
  15786. );
  15787. })(e)
  15788. )
  15789. return RI(d(Number(e)));
  15790. if (
  15791. (function (t) {
  15792. if (!t || 'object' != typeof t || !iI) return !1;
  15793. try {
  15794. return iI.call(t), !0;
  15795. } catch (t) {}
  15796. return !1;
  15797. })(e)
  15798. )
  15799. return RI(d(iI.call(e)));
  15800. if (
  15801. (function (t) {
  15802. return !(
  15803. '[object Boolean]' !== xI(t) ||
  15804. (uI && 'object' == typeof t && uI in t)
  15805. );
  15806. })(e)
  15807. )
  15808. return RI(WO.call(e));
  15809. if (
  15810. (function (t) {
  15811. return !(
  15812. '[object String]' !== xI(t) ||
  15813. (uI && 'object' == typeof t && uI in t)
  15814. );
  15815. })(e)
  15816. )
  15817. return RI(d(String(e)));
  15818. if (
  15819. !(function (t) {
  15820. return !(
  15821. '[object Date]' !== xI(t) ||
  15822. (uI && 'object' == typeof t && uI in t)
  15823. );
  15824. })(e) &&
  15825. !gI(e)
  15826. ) {
  15827. var E = OI(e, d),
  15828. S = hI
  15829. ? hI(e) === Object.prototype
  15830. : e instanceof Object || e.constructor === Object,
  15831. w = e instanceof Object ? '' : 'null prototype',
  15832. R =
  15833. !S && uI && Object(e) === e && uI in e
  15834. ? JO.call(xI(e), 8, -1)
  15835. : w
  15836. ? 'Object'
  15837. : '',
  15838. C =
  15839. (S || 'function' != typeof e.constructor
  15840. ? ''
  15841. : e.constructor.name
  15842. ? e.constructor.name + ' '
  15843. : '') +
  15844. (R || w
  15845. ? '[' + eI.call(tI.call([], R || [], w || []), ': ') + '] '
  15846. : '');
  15847. return 0 === E.length
  15848. ? C + '{}'
  15849. : l
  15850. ? C + '{' + AI(E, l) + '}'
  15851. : C + '{ ' + eI.call(E, ', ') + ' }';
  15852. }
  15853. return String(e);
  15854. },
  15855. LI = II('%TypeError%'),
  15856. FI = II('%WeakMap%', !0),
  15857. NI = II('%Map%', !0),
  15858. kI = MI('WeakMap.prototype.get', !0),
  15859. BI = MI('WeakMap.prototype.set', !0),
  15860. GI = MI('WeakMap.prototype.has', !0),
  15861. UI = MI('Map.prototype.get', !0),
  15862. jI = MI('Map.prototype.set', !0),
  15863. XI = MI('Map.prototype.has', !0),
  15864. VI = function (t, e) {
  15865. for (var r, n = t; null !== (r = n.next); n = r)
  15866. if (r.key === e)
  15867. return (n.next = r.next), (r.next = t.next), (t.next = r), r;
  15868. },
  15869. HI = String.prototype.replace,
  15870. WI = /%20/g,
  15871. YI = 'RFC3986',
  15872. zI = {
  15873. default: YI,
  15874. formatters: {
  15875. RFC1738: function (t) {
  15876. return HI.call(t, WI, '+');
  15877. },
  15878. RFC3986: function (t) {
  15879. return String(t);
  15880. },
  15881. },
  15882. RFC1738: 'RFC1738',
  15883. RFC3986: YI,
  15884. },
  15885. ZI = zI,
  15886. JI = Object.prototype.hasOwnProperty,
  15887. KI = Array.isArray,
  15888. qI = (function () {
  15889. for (var t = [], e = 0; e < 256; ++e)
  15890. t.push('%' + ((e < 16 ? '0' : '') + e.toString(16)).toUpperCase());
  15891. return t;
  15892. })(),
  15893. QI = function (t, e) {
  15894. for (
  15895. var r = e && e.plainObjects ? Object.create(null) : {}, n = 0;
  15896. n < t.length;
  15897. ++n
  15898. )
  15899. void 0 !== t[n] && (r[n] = t[n]);
  15900. return r;
  15901. },
  15902. $I = {
  15903. arrayToObject: QI,
  15904. assign: function (t, e) {
  15905. return Object.keys(e).reduce(function (t, r) {
  15906. return (t[r] = e[r]), t;
  15907. }, t);
  15908. },
  15909. combine: function (t, e) {
  15910. return [].concat(t, e);
  15911. },
  15912. compact: function (t) {
  15913. for (
  15914. var e = [{ obj: { o: t }, prop: 'o' }], r = [], n = 0;
  15915. n < e.length;
  15916. ++n
  15917. )
  15918. for (
  15919. var i = e[n], o = i.obj[i.prop], s = Object.keys(o), a = 0;
  15920. a < s.length;
  15921. ++a
  15922. ) {
  15923. var u = s[a],
  15924. c = o[u];
  15925. 'object' == typeof c &&
  15926. null !== c &&
  15927. -1 === r.indexOf(c) &&
  15928. (e.push({ obj: o, prop: u }), r.push(c));
  15929. }
  15930. return (
  15931. (function (t) {
  15932. for (; t.length > 1; ) {
  15933. var e = t.pop(),
  15934. r = e.obj[e.prop];
  15935. if (KI(r)) {
  15936. for (var n = [], i = 0; i < r.length; ++i)
  15937. void 0 !== r[i] && n.push(r[i]);
  15938. e.obj[e.prop] = n;
  15939. }
  15940. }
  15941. })(e),
  15942. t
  15943. );
  15944. },
  15945. decode: function (t, e, r) {
  15946. var n = t.replace(/\+/g, ' ');
  15947. if ('iso-8859-1' === r) return n.replace(/%[0-9a-f]{2}/gi, unescape);
  15948. try {
  15949. return decodeURIComponent(n);
  15950. } catch (t) {
  15951. return n;
  15952. }
  15953. },
  15954. encode: function (t, e, r, n, i) {
  15955. if (0 === t.length) return t;
  15956. var o = t;
  15957. if (
  15958. ('symbol' == typeof t
  15959. ? (o = Symbol.prototype.toString.call(t))
  15960. : 'string' != typeof t && (o = String(t)),
  15961. 'iso-8859-1' === r)
  15962. )
  15963. return escape(o).replace(/%u[0-9a-f]{4}/gi, function (t) {
  15964. return '%26%23' + parseInt(t.slice(2), 16) + '%3B';
  15965. });
  15966. for (var s = '', a = 0; a < o.length; ++a) {
  15967. var u = o.charCodeAt(a);
  15968. 45 === u ||
  15969. 46 === u ||
  15970. 95 === u ||
  15971. 126 === u ||
  15972. (u >= 48 && u <= 57) ||
  15973. (u >= 65 && u <= 90) ||
  15974. (u >= 97 && u <= 122) ||
  15975. (i === ZI.RFC1738 && (40 === u || 41 === u))
  15976. ? (s += o.charAt(a))
  15977. : u < 128
  15978. ? (s += qI[u])
  15979. : u < 2048
  15980. ? (s += qI[192 | (u >> 6)] + qI[128 | (63 & u)])
  15981. : u < 55296 || u >= 57344
  15982. ? (s +=
  15983. qI[224 | (u >> 12)] +
  15984. qI[128 | ((u >> 6) & 63)] +
  15985. qI[128 | (63 & u)])
  15986. : ((a += 1),
  15987. (u = 65536 + (((1023 & u) << 10) | (1023 & o.charCodeAt(a)))),
  15988. (s +=
  15989. qI[240 | (u >> 18)] +
  15990. qI[128 | ((u >> 12) & 63)] +
  15991. qI[128 | ((u >> 6) & 63)] +
  15992. qI[128 | (63 & u)]));
  15993. }
  15994. return s;
  15995. },
  15996. isBuffer: function (t) {
  15997. return (
  15998. !(!t || 'object' != typeof t) &&
  15999. !!(
  16000. t.constructor &&
  16001. t.constructor.isBuffer &&
  16002. t.constructor.isBuffer(t)
  16003. )
  16004. );
  16005. },
  16006. isRegExp: function (t) {
  16007. return '[object RegExp]' === Object.prototype.toString.call(t);
  16008. },
  16009. maybeMap: function (t, e) {
  16010. if (KI(t)) {
  16011. for (var r = [], n = 0; n < t.length; n += 1) r.push(e(t[n]));
  16012. return r;
  16013. }
  16014. return e(t);
  16015. },
  16016. merge: function t(e, r, n) {
  16017. if (!r) return e;
  16018. if ('object' != typeof r) {
  16019. if (KI(e)) e.push(r);
  16020. else {
  16021. if (!e || 'object' != typeof e) return [e, r];
  16022. ((n && (n.plainObjects || n.allowPrototypes)) ||
  16023. !JI.call(Object.prototype, r)) &&
  16024. (e[r] = !0);
  16025. }
  16026. return e;
  16027. }
  16028. if (!e || 'object' != typeof e) return [e].concat(r);
  16029. var i = e;
  16030. return (
  16031. KI(e) && !KI(r) && (i = QI(e, n)),
  16032. KI(e) && KI(r)
  16033. ? (r.forEach(function (r, i) {
  16034. if (JI.call(e, i)) {
  16035. var o = e[i];
  16036. o && 'object' == typeof o && r && 'object' == typeof r
  16037. ? (e[i] = t(o, r, n))
  16038. : e.push(r);
  16039. } else e[i] = r;
  16040. }),
  16041. e)
  16042. : Object.keys(r).reduce(function (e, i) {
  16043. var o = r[i];
  16044. return JI.call(e, i) ? (e[i] = t(e[i], o, n)) : (e[i] = o), e;
  16045. }, i)
  16046. );
  16047. },
  16048. },
  16049. tM = function () {
  16050. var t,
  16051. e,
  16052. r,
  16053. n = {
  16054. assert: function (t) {
  16055. if (!n.has(t))
  16056. throw new LI('Side channel does not contain ' + DI(t));
  16057. },
  16058. get: function (n) {
  16059. if (FI && n && ('object' == typeof n || 'function' == typeof n)) {
  16060. if (t) return kI(t, n);
  16061. } else if (NI) {
  16062. if (e) return UI(e, n);
  16063. } else if (r)
  16064. return (function (t, e) {
  16065. var r = VI(t, e);
  16066. return r && r.value;
  16067. })(r, n);
  16068. },
  16069. has: function (n) {
  16070. if (FI && n && ('object' == typeof n || 'function' == typeof n)) {
  16071. if (t) return GI(t, n);
  16072. } else if (NI) {
  16073. if (e) return XI(e, n);
  16074. } else if (r)
  16075. return (function (t, e) {
  16076. return !!VI(t, e);
  16077. })(r, n);
  16078. return !1;
  16079. },
  16080. set: function (n, i) {
  16081. FI && n && ('object' == typeof n || 'function' == typeof n)
  16082. ? (t || (t = new FI()), BI(t, n, i))
  16083. : NI
  16084. ? (e || (e = new NI()), jI(e, n, i))
  16085. : (r || (r = { key: {}, next: null }),
  16086. (function (t, e, r) {
  16087. var n = VI(t, e);
  16088. n
  16089. ? (n.value = r)
  16090. : (t.next = { key: e, next: t.next, value: r });
  16091. })(r, n, i));
  16092. },
  16093. };
  16094. return n;
  16095. },
  16096. eM = $I,
  16097. rM = zI,
  16098. nM = Object.prototype.hasOwnProperty,
  16099. iM = {
  16100. brackets: function (t) {
  16101. return t + '[]';
  16102. },
  16103. comma: 'comma',
  16104. indices: function (t, e) {
  16105. return t + '[' + e + ']';
  16106. },
  16107. repeat: function (t) {
  16108. return t;
  16109. },
  16110. },
  16111. oM = Array.isArray,
  16112. sM = Array.prototype.push,
  16113. aM = function (t, e) {
  16114. sM.apply(t, oM(e) ? e : [e]);
  16115. },
  16116. uM = Date.prototype.toISOString,
  16117. cM = rM.default,
  16118. hM = {
  16119. addQueryPrefix: !1,
  16120. allowDots: !1,
  16121. charset: 'utf-8',
  16122. charsetSentinel: !1,
  16123. delimiter: '&',
  16124. encode: !0,
  16125. encoder: eM.encode,
  16126. encodeValuesOnly: !1,
  16127. format: cM,
  16128. formatter: rM.formatters[cM],
  16129. indices: !1,
  16130. serializeDate: function (t) {
  16131. return uM.call(t);
  16132. },
  16133. skipNulls: !1,
  16134. strictNullHandling: !1,
  16135. },
  16136. lM = {},
  16137. dM = function t(e, r, n, i, o, s, a, u, c, h, l, d, f, p, v, m) {
  16138. for (
  16139. var y, g = e, _ = m, b = 0, T = !1;
  16140. void 0 !== (_ = _.get(lM)) && !T;
  16141. ) {
  16142. var x = _.get(e);
  16143. if (((b += 1), void 0 !== x)) {
  16144. if (x === b) throw new RangeError('Cyclic object value');
  16145. T = !0;
  16146. }
  16147. void 0 === _.get(lM) && (b = 0);
  16148. }
  16149. if (
  16150. ('function' == typeof u
  16151. ? (g = u(r, g))
  16152. : g instanceof Date
  16153. ? (g = l(g))
  16154. : 'comma' === n &&
  16155. oM(g) &&
  16156. (g = eM.maybeMap(g, function (t) {
  16157. return t instanceof Date ? l(t) : t;
  16158. })),
  16159. null === g)
  16160. ) {
  16161. if (o) return a && !p ? a(r, hM.encoder, v, 'key', d) : r;
  16162. g = '';
  16163. }
  16164. if (
  16165. 'string' == typeof (y = g) ||
  16166. 'number' == typeof y ||
  16167. 'boolean' == typeof y ||
  16168. 'symbol' == typeof y ||
  16169. 'bigint' == typeof y ||
  16170. eM.isBuffer(g)
  16171. )
  16172. return a
  16173. ? [
  16174. f(p ? r : a(r, hM.encoder, v, 'key', d)) +
  16175. '=' +
  16176. f(a(g, hM.encoder, v, 'value', d)),
  16177. ]
  16178. : [f(r) + '=' + f(String(g))];
  16179. var E,
  16180. S = [];
  16181. if (void 0 === g) return S;
  16182. if ('comma' === n && oM(g))
  16183. p && a && (g = eM.maybeMap(g, a)),
  16184. (E = [{ value: g.length > 0 ? g.join(',') || null : void 0 }]);
  16185. else if (oM(u)) E = u;
  16186. else {
  16187. var w = Object.keys(g);
  16188. E = c ? w.sort(c) : w;
  16189. }
  16190. for (
  16191. var R = i && oM(g) && 1 === g.length ? r + '[]' : r, C = 0;
  16192. C < E.length;
  16193. ++C
  16194. ) {
  16195. var P = E[C],
  16196. A = 'object' == typeof P && void 0 !== P.value ? P.value : g[P];
  16197. if (!s || null !== A) {
  16198. var O = oM(g)
  16199. ? 'function' == typeof n
  16200. ? n(R, P)
  16201. : R
  16202. : R + (h ? '.' + P : '[' + P + ']');
  16203. m.set(e, b);
  16204. var I = tM();
  16205. I.set(lM, m),
  16206. aM(
  16207. S,
  16208. t(
  16209. A,
  16210. O,
  16211. n,
  16212. i,
  16213. o,
  16214. s,
  16215. 'comma' === n && p && oM(g) ? null : a,
  16216. u,
  16217. c,
  16218. h,
  16219. l,
  16220. d,
  16221. f,
  16222. p,
  16223. v,
  16224. I
  16225. )
  16226. );
  16227. }
  16228. }
  16229. return S;
  16230. },
  16231. fM = $I,
  16232. pM = Object.prototype.hasOwnProperty,
  16233. vM = Array.isArray,
  16234. mM = {
  16235. allowDots: !1,
  16236. allowPrototypes: !1,
  16237. allowSparse: !1,
  16238. arrayLimit: 20,
  16239. charset: 'utf-8',
  16240. charsetSentinel: !1,
  16241. comma: !1,
  16242. decoder: fM.decode,
  16243. delimiter: '&',
  16244. depth: 5,
  16245. ignoreQueryPrefix: !1,
  16246. interpretNumericEntities: !1,
  16247. parameterLimit: 1e3,
  16248. parseArrays: !0,
  16249. plainObjects: !1,
  16250. strictNullHandling: !1,
  16251. },
  16252. yM = function (t) {
  16253. return t.replace(/&#(\d+);/g, function (t, e) {
  16254. return String.fromCharCode(parseInt(e, 10));
  16255. });
  16256. },
  16257. gM = function (t, e) {
  16258. return t && 'string' == typeof t && e.comma && t.indexOf(',') > -1
  16259. ? t.split(',')
  16260. : t;
  16261. },
  16262. _M = function (t, e, r, n) {
  16263. if (t) {
  16264. var i = r.allowDots ? t.replace(/\.([^.[]+)/g, '[$1]') : t,
  16265. o = /(\[[^[\]]*])/g,
  16266. s = r.depth > 0 && /(\[[^[\]]*])/.exec(i),
  16267. a = s ? i.slice(0, s.index) : i,
  16268. u = [];
  16269. if (a) {
  16270. if (
  16271. !r.plainObjects &&
  16272. pM.call(Object.prototype, a) &&
  16273. !r.allowPrototypes
  16274. )
  16275. return;
  16276. u.push(a);
  16277. }
  16278. for (
  16279. var c = 0;
  16280. r.depth > 0 && null !== (s = o.exec(i)) && c < r.depth;
  16281. ) {
  16282. if (
  16283. ((c += 1),
  16284. !r.plainObjects &&
  16285. pM.call(Object.prototype, s[1].slice(1, -1)) &&
  16286. !r.allowPrototypes)
  16287. )
  16288. return;
  16289. u.push(s[1]);
  16290. }
  16291. return (
  16292. s && u.push('[' + i.slice(s.index) + ']'),
  16293. (function (t, e, r, n) {
  16294. for (var i = n ? e : gM(e, r), o = t.length - 1; o >= 0; --o) {
  16295. var s,
  16296. a = t[o];
  16297. if ('[]' === a && r.parseArrays) s = [].concat(i);
  16298. else {
  16299. s = r.plainObjects ? Object.create(null) : {};
  16300. var u =
  16301. '[' === a.charAt(0) && ']' === a.charAt(a.length - 1)
  16302. ? a.slice(1, -1)
  16303. : a,
  16304. c = parseInt(u, 10);
  16305. r.parseArrays || '' !== u
  16306. ? !isNaN(c) &&
  16307. a !== u &&
  16308. String(c) === u &&
  16309. c >= 0 &&
  16310. r.parseArrays &&
  16311. c <= r.arrayLimit
  16312. ? ((s = [])[c] = i)
  16313. : '__proto__' !== u && (s[u] = i)
  16314. : (s = { 0: i });
  16315. }
  16316. i = s;
  16317. }
  16318. return i;
  16319. })(u, e, r, n)
  16320. );
  16321. }
  16322. },
  16323. bM = function (t, e) {
  16324. var r,
  16325. n = t,
  16326. i = (function (t) {
  16327. if (!t) return hM;
  16328. if (
  16329. null !== t.encoder &&
  16330. void 0 !== t.encoder &&
  16331. 'function' != typeof t.encoder
  16332. )
  16333. throw new TypeError('Encoder has to be a function.');
  16334. var e = t.charset || hM.charset;
  16335. if (
  16336. void 0 !== t.charset &&
  16337. 'utf-8' !== t.charset &&
  16338. 'iso-8859-1' !== t.charset
  16339. )
  16340. throw new TypeError(
  16341. 'The charset option must be either utf-8, iso-8859-1, or undefined'
  16342. );
  16343. var r = rM.default;
  16344. if (void 0 !== t.format) {
  16345. if (!nM.call(rM.formatters, t.format))
  16346. throw new TypeError('Unknown format option provided.');
  16347. r = t.format;
  16348. }
  16349. var n = rM.formatters[r],
  16350. i = hM.filter;
  16351. return (
  16352. ('function' == typeof t.filter || oM(t.filter)) && (i = t.filter),
  16353. {
  16354. addQueryPrefix:
  16355. 'boolean' == typeof t.addQueryPrefix
  16356. ? t.addQueryPrefix
  16357. : hM.addQueryPrefix,
  16358. allowDots: void 0 === t.allowDots ? hM.allowDots : !!t.allowDots,
  16359. charset: e,
  16360. charsetSentinel:
  16361. 'boolean' == typeof t.charsetSentinel
  16362. ? t.charsetSentinel
  16363. : hM.charsetSentinel,
  16364. delimiter: void 0 === t.delimiter ? hM.delimiter : t.delimiter,
  16365. encode: 'boolean' == typeof t.encode ? t.encode : hM.encode,
  16366. encoder: 'function' == typeof t.encoder ? t.encoder : hM.encoder,
  16367. encodeValuesOnly:
  16368. 'boolean' == typeof t.encodeValuesOnly
  16369. ? t.encodeValuesOnly
  16370. : hM.encodeValuesOnly,
  16371. filter: i,
  16372. format: r,
  16373. formatter: n,
  16374. serializeDate:
  16375. 'function' == typeof t.serializeDate
  16376. ? t.serializeDate
  16377. : hM.serializeDate,
  16378. skipNulls:
  16379. 'boolean' == typeof t.skipNulls ? t.skipNulls : hM.skipNulls,
  16380. sort: 'function' == typeof t.sort ? t.sort : null,
  16381. strictNullHandling:
  16382. 'boolean' == typeof t.strictNullHandling
  16383. ? t.strictNullHandling
  16384. : hM.strictNullHandling,
  16385. }
  16386. );
  16387. })(e);
  16388. 'function' == typeof i.filter
  16389. ? (n = (0, i.filter)('', n))
  16390. : oM(i.filter) && (r = i.filter);
  16391. var o,
  16392. s = [];
  16393. if ('object' != typeof n || null === n) return '';
  16394. o =
  16395. e && e.arrayFormat in iM
  16396. ? e.arrayFormat
  16397. : e && 'indices' in e
  16398. ? e.indices
  16399. ? 'indices'
  16400. : 'repeat'
  16401. : 'indices';
  16402. var a = iM[o];
  16403. if (e && 'commaRoundTrip' in e && 'boolean' != typeof e.commaRoundTrip)
  16404. throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
  16405. var u = 'comma' === a && e && e.commaRoundTrip;
  16406. r || (r = Object.keys(n)), i.sort && r.sort(i.sort);
  16407. for (var c = tM(), h = 0; h < r.length; ++h) {
  16408. var l = r[h];
  16409. (i.skipNulls && null === n[l]) ||
  16410. aM(
  16411. s,
  16412. dM(
  16413. n[l],
  16414. l,
  16415. a,
  16416. u,
  16417. i.strictNullHandling,
  16418. i.skipNulls,
  16419. i.encode ? i.encoder : null,
  16420. i.filter,
  16421. i.sort,
  16422. i.allowDots,
  16423. i.serializeDate,
  16424. i.format,
  16425. i.formatter,
  16426. i.encodeValuesOnly,
  16427. i.charset,
  16428. c
  16429. )
  16430. );
  16431. }
  16432. var d = s.join(i.delimiter),
  16433. f = !0 === i.addQueryPrefix ? '?' : '';
  16434. return (
  16435. i.charsetSentinel &&
  16436. ('iso-8859-1' === i.charset
  16437. ? (f += 'utf8=%26%2310003%3B&')
  16438. : (f += 'utf8=%E2%9C%93&')),
  16439. d.length > 0 ? f + d : ''
  16440. );
  16441. },
  16442. TM = function (t, e) {
  16443. var r = (function (t) {
  16444. if (!t) return mM;
  16445. if (
  16446. null !== t.decoder &&
  16447. void 0 !== t.decoder &&
  16448. 'function' != typeof t.decoder
  16449. )
  16450. throw new TypeError('Decoder has to be a function.');
  16451. if (
  16452. void 0 !== t.charset &&
  16453. 'utf-8' !== t.charset &&
  16454. 'iso-8859-1' !== t.charset
  16455. )
  16456. throw new TypeError(
  16457. 'The charset option must be either utf-8, iso-8859-1, or undefined'
  16458. );
  16459. var e = void 0 === t.charset ? mM.charset : t.charset;
  16460. return {
  16461. allowDots: void 0 === t.allowDots ? mM.allowDots : !!t.allowDots,
  16462. allowPrototypes:
  16463. 'boolean' == typeof t.allowPrototypes
  16464. ? t.allowPrototypes
  16465. : mM.allowPrototypes,
  16466. allowSparse:
  16467. 'boolean' == typeof t.allowSparse ? t.allowSparse : mM.allowSparse,
  16468. arrayLimit:
  16469. 'number' == typeof t.arrayLimit ? t.arrayLimit : mM.arrayLimit,
  16470. charset: e,
  16471. charsetSentinel:
  16472. 'boolean' == typeof t.charsetSentinel
  16473. ? t.charsetSentinel
  16474. : mM.charsetSentinel,
  16475. comma: 'boolean' == typeof t.comma ? t.comma : mM.comma,
  16476. decoder: 'function' == typeof t.decoder ? t.decoder : mM.decoder,
  16477. delimiter:
  16478. 'string' == typeof t.delimiter || fM.isRegExp(t.delimiter)
  16479. ? t.delimiter
  16480. : mM.delimiter,
  16481. depth:
  16482. 'number' == typeof t.depth || !1 === t.depth ? +t.depth : mM.depth,
  16483. ignoreQueryPrefix: !0 === t.ignoreQueryPrefix,
  16484. interpretNumericEntities:
  16485. 'boolean' == typeof t.interpretNumericEntities
  16486. ? t.interpretNumericEntities
  16487. : mM.interpretNumericEntities,
  16488. parameterLimit:
  16489. 'number' == typeof t.parameterLimit
  16490. ? t.parameterLimit
  16491. : mM.parameterLimit,
  16492. parseArrays: !1 !== t.parseArrays,
  16493. plainObjects:
  16494. 'boolean' == typeof t.plainObjects
  16495. ? t.plainObjects
  16496. : mM.plainObjects,
  16497. strictNullHandling:
  16498. 'boolean' == typeof t.strictNullHandling
  16499. ? t.strictNullHandling
  16500. : mM.strictNullHandling,
  16501. };
  16502. })(e);
  16503. if ('' === t || null == t)
  16504. return r.plainObjects ? Object.create(null) : {};
  16505. for (
  16506. var n =
  16507. 'string' == typeof t
  16508. ? (function (t, e) {
  16509. var r,
  16510. n = { __proto__: null },
  16511. i = e.ignoreQueryPrefix ? t.replace(/^\?/, '') : t,
  16512. o = e.parameterLimit === 1 / 0 ? void 0 : e.parameterLimit,
  16513. s = i.split(e.delimiter, o),
  16514. a = -1,
  16515. u = e.charset;
  16516. if (e.charsetSentinel)
  16517. for (r = 0; r < s.length; ++r)
  16518. 0 === s[r].indexOf('utf8=') &&
  16519. ('utf8=%E2%9C%93' === s[r]
  16520. ? (u = 'utf-8')
  16521. : 'utf8=%26%2310003%3B' === s[r] &&
  16522. (u = 'iso-8859-1'),
  16523. (a = r),
  16524. (r = s.length));
  16525. for (r = 0; r < s.length; ++r)
  16526. if (r !== a) {
  16527. var c,
  16528. h,
  16529. l = s[r],
  16530. d = l.indexOf(']='),
  16531. f = -1 === d ? l.indexOf('=') : d + 1;
  16532. -1 === f
  16533. ? ((c = e.decoder(l, mM.decoder, u, 'key')),
  16534. (h = e.strictNullHandling ? null : ''))
  16535. : ((c = e.decoder(l.slice(0, f), mM.decoder, u, 'key')),
  16536. (h = fM.maybeMap(gM(l.slice(f + 1), e), function (t) {
  16537. return e.decoder(t, mM.decoder, u, 'value');
  16538. }))),
  16539. h &&
  16540. e.interpretNumericEntities &&
  16541. 'iso-8859-1' === u &&
  16542. (h = yM(h)),
  16543. l.indexOf('[]=') > -1 && (h = vM(h) ? [h] : h),
  16544. pM.call(n, c)
  16545. ? (n[c] = fM.combine(n[c], h))
  16546. : (n[c] = h);
  16547. }
  16548. return n;
  16549. })(t, r)
  16550. : t,
  16551. i = r.plainObjects ? Object.create(null) : {},
  16552. o = Object.keys(n),
  16553. s = 0;
  16554. s < o.length;
  16555. ++s
  16556. ) {
  16557. var a = o[s],
  16558. u = _M(a, n[a], r, 'string' == typeof t);
  16559. i = fM.merge(i, u, r);
  16560. }
  16561. return !0 === r.allowSparse ? i : fM.compact(i);
  16562. },
  16563. xM = { formats: zI, parse: TM, stringify: bM },
  16564. EM = YA.exports;
  16565. function SM() {
  16566. (this.protocol = null),
  16567. (this.slashes = null),
  16568. (this.auth = null),
  16569. (this.host = null),
  16570. (this.port = null),
  16571. (this.hostname = null),
  16572. (this.hash = null),
  16573. (this.search = null),
  16574. (this.query = null),
  16575. (this.pathname = null),
  16576. (this.path = null),
  16577. (this.href = null);
  16578. }
  16579. var wM = /^([a-z0-9.+-]+:)/i,
  16580. RM = /:[0-9]*$/,
  16581. CM = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,
  16582. PM = ['{', '}', '|', '\\', '^', '`'].concat([
  16583. '<',
  16584. '>',
  16585. '"',
  16586. '`',
  16587. ' ',
  16588. '\r',
  16589. '\n',
  16590. '\t',
  16591. ]),
  16592. AM = ["'"].concat(PM),
  16593. OM = ['%', '/', '?', ';', '#'].concat(AM),
  16594. IM = ['/', '?', '#'],
  16595. MM = /^[+a-z0-9A-Z_-]{0,63}$/,
  16596. DM = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  16597. LM = { javascript: !0, 'javascript:': !0 },
  16598. FM = { javascript: !0, 'javascript:': !0 },
  16599. NM = {
  16600. http: !0,
  16601. https: !0,
  16602. ftp: !0,
  16603. gopher: !0,
  16604. file: !0,
  16605. 'http:': !0,
  16606. 'https:': !0,
  16607. 'ftp:': !0,
  16608. 'gopher:': !0,
  16609. 'file:': !0,
  16610. },
  16611. kM = xM;
  16612. function BM(t, e, r) {
  16613. if (t && 'object' == typeof t && t instanceof SM) return t;
  16614. var n = new SM();
  16615. return n.parse(t, e, r), n;
  16616. }
  16617. (SM.prototype.parse = function (t, e, r) {
  16618. if ('string' != typeof t)
  16619. throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
  16620. var n = t.indexOf('?'),
  16621. i = -1 !== n && n < t.indexOf('#') ? '?' : '#',
  16622. o = t.split(i);
  16623. o[0] = o[0].replace(/\\/g, '/');
  16624. var s = (t = o.join(i));
  16625. if (((s = s.trim()), !r && 1 === t.split('#').length)) {
  16626. var a = CM.exec(s);
  16627. if (a)
  16628. return (
  16629. (this.path = s),
  16630. (this.href = s),
  16631. (this.pathname = a[1]),
  16632. a[2]
  16633. ? ((this.search = a[2]),
  16634. (this.query = e
  16635. ? kM.parse(this.search.substr(1))
  16636. : this.search.substr(1)))
  16637. : e && ((this.search = ''), (this.query = {})),
  16638. this
  16639. );
  16640. }
  16641. var u = wM.exec(s);
  16642. if (u) {
  16643. var c = (u = u[0]).toLowerCase();
  16644. (this.protocol = c), (s = s.substr(u.length));
  16645. }
  16646. if (r || u || s.match(/^\/\/[^@/]+@[^@/]+/)) {
  16647. var h = '//' === s.substr(0, 2);
  16648. !h || (u && FM[u]) || ((s = s.substr(2)), (this.slashes = !0));
  16649. }
  16650. if (!FM[u] && (h || (u && !NM[u]))) {
  16651. for (var l, d, f = -1, p = 0; p < IM.length; p++) {
  16652. -1 !== (v = s.indexOf(IM[p])) && (-1 === f || v < f) && (f = v);
  16653. }
  16654. -1 !== (d = -1 === f ? s.lastIndexOf('@') : s.lastIndexOf('@', f)) &&
  16655. ((l = s.slice(0, d)),
  16656. (s = s.slice(d + 1)),
  16657. (this.auth = decodeURIComponent(l))),
  16658. (f = -1);
  16659. for (p = 0; p < OM.length; p++) {
  16660. var v;
  16661. -1 !== (v = s.indexOf(OM[p])) && (-1 === f || v < f) && (f = v);
  16662. }
  16663. -1 === f && (f = s.length),
  16664. (this.host = s.slice(0, f)),
  16665. (s = s.slice(f)),
  16666. this.parseHost(),
  16667. (this.hostname = this.hostname || '');
  16668. var m =
  16669. '[' === this.hostname[0] &&
  16670. ']' === this.hostname[this.hostname.length - 1];
  16671. if (!m)
  16672. for (
  16673. var y = this.hostname.split(/\./), g = ((p = 0), y.length);
  16674. p < g;
  16675. p++
  16676. ) {
  16677. var _ = y[p];
  16678. if (_ && !_.match(MM)) {
  16679. for (var b = '', T = 0, x = _.length; T < x; T++)
  16680. _.charCodeAt(T) > 127 ? (b += 'x') : (b += _[T]);
  16681. if (!b.match(MM)) {
  16682. var E = y.slice(0, p),
  16683. S = y.slice(p + 1),
  16684. w = _.match(DM);
  16685. w && (E.push(w[1]), S.unshift(w[2])),
  16686. S.length && (s = '/' + S.join('.') + s),
  16687. (this.hostname = E.join('.'));
  16688. break;
  16689. }
  16690. }
  16691. }
  16692. this.hostname.length > 255
  16693. ? (this.hostname = '')
  16694. : (this.hostname = this.hostname.toLowerCase()),
  16695. m || (this.hostname = EM.toASCII(this.hostname));
  16696. var R = this.port ? ':' + this.port : '',
  16697. C = this.hostname || '';
  16698. (this.host = C + R),
  16699. (this.href += this.host),
  16700. m &&
  16701. ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)),
  16702. '/' !== s[0] && (s = '/' + s));
  16703. }
  16704. if (!LM[c])
  16705. for (p = 0, g = AM.length; p < g; p++) {
  16706. var P = AM[p];
  16707. if (-1 !== s.indexOf(P)) {
  16708. var A = encodeURIComponent(P);
  16709. A === P && (A = escape(P)), (s = s.split(P).join(A));
  16710. }
  16711. }
  16712. var O = s.indexOf('#');
  16713. -1 !== O && ((this.hash = s.substr(O)), (s = s.slice(0, O)));
  16714. var I = s.indexOf('?');
  16715. if (
  16716. (-1 !== I
  16717. ? ((this.search = s.substr(I)),
  16718. (this.query = s.substr(I + 1)),
  16719. e && (this.query = kM.parse(this.query)),
  16720. (s = s.slice(0, I)))
  16721. : e && ((this.search = ''), (this.query = {})),
  16722. s && (this.pathname = s),
  16723. NM[c] && this.hostname && !this.pathname && (this.pathname = '/'),
  16724. this.pathname || this.search)
  16725. ) {
  16726. R = this.pathname || '';
  16727. var M = this.search || '';
  16728. this.path = R + M;
  16729. }
  16730. return (this.href = this.format()), this;
  16731. }),
  16732. (SM.prototype.format = function () {
  16733. var t = this.auth || '';
  16734. t && ((t = (t = encodeURIComponent(t)).replace(/%3A/i, ':')), (t += '@'));
  16735. var e = this.protocol || '',
  16736. r = this.pathname || '',
  16737. n = this.hash || '',
  16738. i = !1,
  16739. o = '';
  16740. this.host
  16741. ? (i = t + this.host)
  16742. : this.hostname &&
  16743. ((i =
  16744. t +
  16745. (-1 === this.hostname.indexOf(':')
  16746. ? this.hostname
  16747. : '[' + this.hostname + ']')),
  16748. this.port && (i += ':' + this.port)),
  16749. this.query &&
  16750. 'object' == typeof this.query &&
  16751. Object.keys(this.query).length &&
  16752. (o = kM.stringify(this.query, {
  16753. arrayFormat: 'repeat',
  16754. addQueryPrefix: !1,
  16755. }));
  16756. var s = this.search || (o && '?' + o) || '';
  16757. return (
  16758. e && ':' !== e.substr(-1) && (e += ':'),
  16759. this.slashes || ((!e || NM[e]) && !1 !== i)
  16760. ? ((i = '//' + (i || '')), r && '/' !== r.charAt(0) && (r = '/' + r))
  16761. : i || (i = ''),
  16762. n && '#' !== n.charAt(0) && (n = '#' + n),
  16763. s && '?' !== s.charAt(0) && (s = '?' + s),
  16764. (r = r.replace(/[?#]/g, function (t) {
  16765. return encodeURIComponent(t);
  16766. })),
  16767. e + i + r + (s = s.replace('#', '%23')) + n
  16768. );
  16769. }),
  16770. (SM.prototype.resolve = function (t) {
  16771. return this.resolveObject(BM(t, !1, !0)).format();
  16772. }),
  16773. (SM.prototype.resolveObject = function (t) {
  16774. if ('string' == typeof t) {
  16775. var e = new SM();
  16776. e.parse(t, !1, !0), (t = e);
  16777. }
  16778. for (var r = new SM(), n = Object.keys(this), i = 0; i < n.length; i++) {
  16779. var o = n[i];
  16780. r[o] = this[o];
  16781. }
  16782. if (((r.hash = t.hash), '' === t.href)) return (r.href = r.format()), r;
  16783. if (t.slashes && !t.protocol) {
  16784. for (var s = Object.keys(t), a = 0; a < s.length; a++) {
  16785. var u = s[a];
  16786. 'protocol' !== u && (r[u] = t[u]);
  16787. }
  16788. return (
  16789. NM[r.protocol] &&
  16790. r.hostname &&
  16791. !r.pathname &&
  16792. ((r.pathname = '/'), (r.path = r.pathname)),
  16793. (r.href = r.format()),
  16794. r
  16795. );
  16796. }
  16797. if (t.protocol && t.protocol !== r.protocol) {
  16798. if (!NM[t.protocol]) {
  16799. for (var c = Object.keys(t), h = 0; h < c.length; h++) {
  16800. var l = c[h];
  16801. r[l] = t[l];
  16802. }
  16803. return (r.href = r.format()), r;
  16804. }
  16805. if (((r.protocol = t.protocol), t.host || FM[t.protocol]))
  16806. r.pathname = t.pathname;
  16807. else {
  16808. for (
  16809. var d = (t.pathname || '').split('/');
  16810. d.length && !(t.host = d.shift());
  16811. );
  16812. t.host || (t.host = ''),
  16813. t.hostname || (t.hostname = ''),
  16814. '' !== d[0] && d.unshift(''),
  16815. d.length < 2 && d.unshift(''),
  16816. (r.pathname = d.join('/'));
  16817. }
  16818. if (
  16819. ((r.search = t.search),
  16820. (r.query = t.query),
  16821. (r.host = t.host || ''),
  16822. (r.auth = t.auth),
  16823. (r.hostname = t.hostname || t.host),
  16824. (r.port = t.port),
  16825. r.pathname || r.search)
  16826. ) {
  16827. var f = r.pathname || '',
  16828. p = r.search || '';
  16829. r.path = f + p;
  16830. }
  16831. return (r.slashes = r.slashes || t.slashes), (r.href = r.format()), r;
  16832. }
  16833. var v = r.pathname && '/' === r.pathname.charAt(0),
  16834. m = t.host || (t.pathname && '/' === t.pathname.charAt(0)),
  16835. y = m || v || (r.host && t.pathname),
  16836. g = y,
  16837. _ = (r.pathname && r.pathname.split('/')) || [],
  16838. b =
  16839. ((d = (t.pathname && t.pathname.split('/')) || []),
  16840. r.protocol && !NM[r.protocol]);
  16841. if (
  16842. (b &&
  16843. ((r.hostname = ''),
  16844. (r.port = null),
  16845. r.host && ('' === _[0] ? (_[0] = r.host) : _.unshift(r.host)),
  16846. (r.host = ''),
  16847. t.protocol &&
  16848. ((t.hostname = null),
  16849. (t.port = null),
  16850. t.host && ('' === d[0] ? (d[0] = t.host) : d.unshift(t.host)),
  16851. (t.host = null)),
  16852. (y = y && ('' === d[0] || '' === _[0]))),
  16853. m)
  16854. )
  16855. (r.host = t.host || '' === t.host ? t.host : r.host),
  16856. (r.hostname =
  16857. t.hostname || '' === t.hostname ? t.hostname : r.hostname),
  16858. (r.search = t.search),
  16859. (r.query = t.query),
  16860. (_ = d);
  16861. else if (d.length)
  16862. _ || (_ = []),
  16863. _.pop(),
  16864. (_ = _.concat(d)),
  16865. (r.search = t.search),
  16866. (r.query = t.query);
  16867. else if (null != t.search) {
  16868. if (b)
  16869. (r.host = _.shift()),
  16870. (r.hostname = r.host),
  16871. (w = !!(r.host && r.host.indexOf('@') > 0) && r.host.split('@')) &&
  16872. ((r.auth = w.shift()),
  16873. (r.hostname = w.shift()),
  16874. (r.host = r.hostname));
  16875. return (
  16876. (r.search = t.search),
  16877. (r.query = t.query),
  16878. (null === r.pathname && null === r.search) ||
  16879. (r.path =
  16880. (r.pathname ? r.pathname : '') + (r.search ? r.search : '')),
  16881. (r.href = r.format()),
  16882. r
  16883. );
  16884. }
  16885. if (!_.length)
  16886. return (
  16887. (r.pathname = null),
  16888. r.search ? (r.path = '/' + r.search) : (r.path = null),
  16889. (r.href = r.format()),
  16890. r
  16891. );
  16892. for (
  16893. var T = _.slice(-1)[0],
  16894. x =
  16895. ((r.host || t.host || _.length > 1) && ('.' === T || '..' === T)) ||
  16896. '' === T,
  16897. E = 0,
  16898. S = _.length;
  16899. S >= 0;
  16900. S--
  16901. )
  16902. '.' === (T = _[S])
  16903. ? _.splice(S, 1)
  16904. : '..' === T
  16905. ? (_.splice(S, 1), E++)
  16906. : E && (_.splice(S, 1), E--);
  16907. if (!y && !g) for (; E--; E) _.unshift('..');
  16908. !y || '' === _[0] || (_[0] && '/' === _[0].charAt(0)) || _.unshift(''),
  16909. x && '/' !== _.join('/').substr(-1) && _.push('');
  16910. var w,
  16911. R = '' === _[0] || (_[0] && '/' === _[0].charAt(0));
  16912. b &&
  16913. ((r.hostname = R ? '' : _.length ? _.shift() : ''),
  16914. (r.host = r.hostname),
  16915. (w = !!(r.host && r.host.indexOf('@') > 0) && r.host.split('@')) &&
  16916. ((r.auth = w.shift()),
  16917. (r.hostname = w.shift()),
  16918. (r.host = r.hostname)));
  16919. return (
  16920. (y = y || (r.host && _.length)) && !R && _.unshift(''),
  16921. _.length > 0
  16922. ? (r.pathname = _.join('/'))
  16923. : ((r.pathname = null), (r.path = null)),
  16924. (null === r.pathname && null === r.search) ||
  16925. (r.path =
  16926. (r.pathname ? r.pathname : '') + (r.search ? r.search : '')),
  16927. (r.auth = t.auth || r.auth),
  16928. (r.slashes = r.slashes || t.slashes),
  16929. (r.href = r.format()),
  16930. r
  16931. );
  16932. }),
  16933. (SM.prototype.parseHost = function () {
  16934. var t = this.host,
  16935. e = RM.exec(t);
  16936. e &&
  16937. (':' !== (e = e[0]) && (this.port = e.substr(1)),
  16938. (t = t.substr(0, t.length - e.length))),
  16939. t && (this.hostname = t);
  16940. });
  16941. var GM = {
  16942. parse: BM,
  16943. format: function (t) {
  16944. return (
  16945. 'string' == typeof t && (t = BM(t)),
  16946. t instanceof SM ? t.format() : SM.prototype.format.call(t)
  16947. );
  16948. },
  16949. resolve: function (t, e) {
  16950. return BM(t, !1, !0).resolve(e);
  16951. },
  16952. };
  16953. (vA.RETINA_PREFIX = /@([0-9\.]+)x/),
  16954. (vA.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = !1);
  16955. var UM,
  16956. jM = !1;
  16957. function XM(t) {
  16958. var e;
  16959. if (!jM) {
  16960. if (
  16961. vA.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf('chrome') > -1
  16962. ) {
  16963. var r = [
  16964. '\n %c %c %c PixiJS 6.5.10 - ✰ ' +
  16965. t +
  16966. ' ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n',
  16967. 'background: #ff66a5; padding:5px 0;',
  16968. 'background: #ff66a5; padding:5px 0;',
  16969. 'color: #ff66a5; background: #030307; padding:5px 0;',
  16970. 'background: #ff66a5; padding:5px 0;',
  16971. 'background: #ffc3dc; padding:5px 0;',
  16972. 'background: #ff66a5; padding:5px 0;',
  16973. 'color: #ff2424; background: #fff; padding:5px 0;',
  16974. 'color: #ff2424; background: #fff; padding:5px 0;',
  16975. 'color: #ff2424; background: #fff; padding:5px 0;',
  16976. ];
  16977. (e = globalThis.console).log.apply(e, r);
  16978. } else
  16979. globalThis.console &&
  16980. globalThis.console.log(
  16981. 'PixiJS 6.5.10 - ' + t + ' - http://www.pixijs.com/'
  16982. );
  16983. jM = !0;
  16984. }
  16985. }
  16986. var VM = {
  16987. aliceblue: '#f0f8ff',
  16988. antiquewhite: '#faebd7',
  16989. aqua: '#00ffff',
  16990. aquamarine: '#7fffd4',
  16991. azure: '#f0ffff',
  16992. beige: '#f5f5dc',
  16993. bisque: '#ffe4c4',
  16994. black: '#000000',
  16995. blanchedalmond: '#ffebcd',
  16996. blue: '#0000ff',
  16997. blueviolet: '#8a2be2',
  16998. brown: '#a52a2a',
  16999. burlywood: '#deb887',
  17000. cadetblue: '#5f9ea0',
  17001. chartreuse: '#7fff00',
  17002. chocolate: '#d2691e',
  17003. coral: '#ff7f50',
  17004. cornflowerblue: '#6495ed',
  17005. cornsilk: '#fff8dc',
  17006. crimson: '#dc143c',
  17007. cyan: '#00ffff',
  17008. darkblue: '#00008b',
  17009. darkcyan: '#008b8b',
  17010. darkgoldenrod: '#b8860b',
  17011. darkgray: '#a9a9a9',
  17012. darkgreen: '#006400',
  17013. darkgrey: '#a9a9a9',
  17014. darkkhaki: '#bdb76b',
  17015. darkmagenta: '#8b008b',
  17016. darkolivegreen: '#556b2f',
  17017. darkorange: '#ff8c00',
  17018. darkorchid: '#9932cc',
  17019. darkred: '#8b0000',
  17020. darksalmon: '#e9967a',
  17021. darkseagreen: '#8fbc8f',
  17022. darkslateblue: '#483d8b',
  17023. darkslategray: '#2f4f4f',
  17024. darkslategrey: '#2f4f4f',
  17025. darkturquoise: '#00ced1',
  17026. darkviolet: '#9400d3',
  17027. deeppink: '#ff1493',
  17028. deepskyblue: '#00bfff',
  17029. dimgray: '#696969',
  17030. dimgrey: '#696969',
  17031. dodgerblue: '#1e90ff',
  17032. firebrick: '#b22222',
  17033. floralwhite: '#fffaf0',
  17034. forestgreen: '#228b22',
  17035. fuchsia: '#ff00ff',
  17036. gainsboro: '#dcdcdc',
  17037. ghostwhite: '#f8f8ff',
  17038. goldenrod: '#daa520',
  17039. gold: '#ffd700',
  17040. gray: '#808080',
  17041. green: '#008000',
  17042. greenyellow: '#adff2f',
  17043. grey: '#808080',
  17044. honeydew: '#f0fff0',
  17045. hotpink: '#ff69b4',
  17046. indianred: '#cd5c5c',
  17047. indigo: '#4b0082',
  17048. ivory: '#fffff0',
  17049. khaki: '#f0e68c',
  17050. lavenderblush: '#fff0f5',
  17051. lavender: '#e6e6fa',
  17052. lawngreen: '#7cfc00',
  17053. lemonchiffon: '#fffacd',
  17054. lightblue: '#add8e6',
  17055. lightcoral: '#f08080',
  17056. lightcyan: '#e0ffff',
  17057. lightgoldenrodyellow: '#fafad2',
  17058. lightgray: '#d3d3d3',
  17059. lightgreen: '#90ee90',
  17060. lightgrey: '#d3d3d3',
  17061. lightpink: '#ffb6c1',
  17062. lightsalmon: '#ffa07a',
  17063. lightseagreen: '#20b2aa',
  17064. lightskyblue: '#87cefa',
  17065. lightslategray: '#778899',
  17066. lightslategrey: '#778899',
  17067. lightsteelblue: '#b0c4de',
  17068. lightyellow: '#ffffe0',
  17069. lime: '#00ff00',
  17070. limegreen: '#32cd32',
  17071. linen: '#faf0e6',
  17072. magenta: '#ff00ff',
  17073. maroon: '#800000',
  17074. mediumaquamarine: '#66cdaa',
  17075. mediumblue: '#0000cd',
  17076. mediumorchid: '#ba55d3',
  17077. mediumpurple: '#9370db',
  17078. mediumseagreen: '#3cb371',
  17079. mediumslateblue: '#7b68ee',
  17080. mediumspringgreen: '#00fa9a',
  17081. mediumturquoise: '#48d1cc',
  17082. mediumvioletred: '#c71585',
  17083. midnightblue: '#191970',
  17084. mintcream: '#f5fffa',
  17085. mistyrose: '#ffe4e1',
  17086. moccasin: '#ffe4b5',
  17087. navajowhite: '#ffdead',
  17088. navy: '#000080',
  17089. oldlace: '#fdf5e6',
  17090. olive: '#808000',
  17091. olivedrab: '#6b8e23',
  17092. orange: '#ffa500',
  17093. orangered: '#ff4500',
  17094. orchid: '#da70d6',
  17095. palegoldenrod: '#eee8aa',
  17096. palegreen: '#98fb98',
  17097. paleturquoise: '#afeeee',
  17098. palevioletred: '#db7093',
  17099. papayawhip: '#ffefd5',
  17100. peachpuff: '#ffdab9',
  17101. peru: '#cd853f',
  17102. pink: '#ffc0cb',
  17103. plum: '#dda0dd',
  17104. powderblue: '#b0e0e6',
  17105. purple: '#800080',
  17106. rebeccapurple: '#663399',
  17107. red: '#ff0000',
  17108. rosybrown: '#bc8f8f',
  17109. royalblue: '#4169e1',
  17110. saddlebrown: '#8b4513',
  17111. salmon: '#fa8072',
  17112. sandybrown: '#f4a460',
  17113. seagreen: '#2e8b57',
  17114. seashell: '#fff5ee',
  17115. sienna: '#a0522d',
  17116. silver: '#c0c0c0',
  17117. skyblue: '#87ceeb',
  17118. slateblue: '#6a5acd',
  17119. slategray: '#708090',
  17120. slategrey: '#708090',
  17121. snow: '#fffafa',
  17122. springgreen: '#00ff7f',
  17123. steelblue: '#4682b4',
  17124. tan: '#d2b48c',
  17125. teal: '#008080',
  17126. thistle: '#d8bfd8',
  17127. tomato: '#ff6347',
  17128. turquoise: '#40e0d0',
  17129. violet: '#ee82ee',
  17130. wheat: '#f5deb3',
  17131. white: '#ffffff',
  17132. whitesmoke: '#f5f5f5',
  17133. yellow: '#ffff00',
  17134. yellowgreen: '#9acd32',
  17135. };
  17136. function HM(t, e) {
  17137. return (
  17138. void 0 === e && (e = []),
  17139. (e[0] = ((t >> 16) & 255) / 255),
  17140. (e[1] = ((t >> 8) & 255) / 255),
  17141. (e[2] = (255 & t) / 255),
  17142. e
  17143. );
  17144. }
  17145. function WM(t) {
  17146. var e = t.toString(16);
  17147. return '#' + (e = '000000'.substring(0, 6 - e.length) + e);
  17148. }
  17149. function YM(t) {
  17150. return (
  17151. 'string' == typeof t &&
  17152. '#' === (t = VM[t.toLowerCase()] || t)[0] &&
  17153. (t = t.slice(1)),
  17154. parseInt(t, 16)
  17155. );
  17156. }
  17157. function zM(t) {
  17158. return ((255 * t[0]) << 16) + ((255 * t[1]) << 8) + ((255 * t[2]) | 0);
  17159. }
  17160. var ZM = (function () {
  17161. for (var t = [], e = [], r = 0; r < 32; r++) (t[r] = r), (e[r] = r);
  17162. (t[OP.NORMAL_NPM] = OP.NORMAL),
  17163. (t[OP.ADD_NPM] = OP.ADD),
  17164. (t[OP.SCREEN_NPM] = OP.SCREEN),
  17165. (e[OP.NORMAL] = OP.NORMAL_NPM),
  17166. (e[OP.ADD] = OP.ADD_NPM),
  17167. (e[OP.SCREEN] = OP.SCREEN_NPM);
  17168. var n = [];
  17169. return n.push(e), n.push(t), n;
  17170. })();
  17171. function JM(t, e) {
  17172. return ZM[e ? 1 : 0][t];
  17173. }
  17174. function KM(t, e) {
  17175. if (1 === e) return ((255 * e) << 24) + t;
  17176. if (0 === e) return 0;
  17177. var r = (t >> 16) & 255,
  17178. n = (t >> 8) & 255,
  17179. i = 255 & t;
  17180. return (
  17181. ((255 * e) << 24) +
  17182. ((r = (r * e + 0.5) | 0) << 16) +
  17183. ((n = (n * e + 0.5) | 0) << 8) +
  17184. (i = (i * e + 0.5) | 0)
  17185. );
  17186. }
  17187. function qM(t, e, r, n) {
  17188. return (
  17189. ((r = r || new Float32Array(4))[0] = ((t >> 16) & 255) / 255),
  17190. (r[1] = ((t >> 8) & 255) / 255),
  17191. (r[2] = (255 & t) / 255),
  17192. (n || void 0 === n) && ((r[0] *= e), (r[1] *= e), (r[2] *= e)),
  17193. (r[3] = e),
  17194. r
  17195. );
  17196. }
  17197. function QM(t) {
  17198. if (4 === t.BYTES_PER_ELEMENT)
  17199. return t instanceof Float32Array
  17200. ? 'Float32Array'
  17201. : t instanceof Uint32Array
  17202. ? 'Uint32Array'
  17203. : 'Int32Array';
  17204. if (2 === t.BYTES_PER_ELEMENT) {
  17205. if (t instanceof Uint16Array) return 'Uint16Array';
  17206. } else if (1 === t.BYTES_PER_ELEMENT && t instanceof Uint8Array)
  17207. return 'Uint8Array';
  17208. return null;
  17209. }
  17210. function $M(t) {
  17211. return (
  17212. (t += 0 === t ? 1 : 0),
  17213. --t,
  17214. (t |= t >>> 1),
  17215. (t |= t >>> 2),
  17216. (t |= t >>> 4),
  17217. (t |= t >>> 8),
  17218. (t |= t >>> 16) + 1
  17219. );
  17220. }
  17221. function tD(t) {
  17222. return !(t & (t - 1) || !t);
  17223. }
  17224. function eD(t) {
  17225. var e = (t > 65535 ? 1 : 0) << 4,
  17226. r = ((t >>>= e) > 255 ? 1 : 0) << 3;
  17227. return (
  17228. (e |= r),
  17229. (e |= r = ((t >>>= r) > 15 ? 1 : 0) << 2),
  17230. (e |= r = ((t >>>= r) > 3 ? 1 : 0) << 1) | ((t >>>= r) >> 1)
  17231. );
  17232. }
  17233. function rD(t, e, r) {
  17234. var n,
  17235. i = t.length;
  17236. if (!(e >= i || 0 === r)) {
  17237. var o = i - (r = e + r > i ? i - e : r);
  17238. for (n = e; n < o; ++n) t[n] = t[n + r];
  17239. t.length = o;
  17240. }
  17241. }
  17242. function nD(t) {
  17243. return 0 === t ? 0 : t < 0 ? -1 : 1;
  17244. }
  17245. var iD = 0;
  17246. function oD() {
  17247. return ++iD;
  17248. }
  17249. var sD = {};
  17250. function aD(t, e, r) {
  17251. if ((void 0 === r && (r = 3), !sD[e])) {
  17252. var n = new Error().stack;
  17253. void 0 === n
  17254. ? console.warn(
  17255. 'PixiJS Deprecation Warning: ',
  17256. e + '\nDeprecated since v' + t
  17257. )
  17258. : ((n = n.split('\n').splice(r).join('\n')),
  17259. console.groupCollapsed
  17260. ? (console.groupCollapsed(
  17261. '%cPixiJS Deprecation Warning: %c%s',
  17262. 'color:#614108;background:#fffbe6',
  17263. 'font-weight:normal;color:#614108;background:#fffbe6',
  17264. e + '\nDeprecated since v' + t
  17265. ),
  17266. console.warn(n),
  17267. console.groupEnd())
  17268. : (console.warn(
  17269. 'PixiJS Deprecation Warning: ',
  17270. e + '\nDeprecated since v' + t
  17271. ),
  17272. console.warn(n))),
  17273. (sD[e] = !0);
  17274. }
  17275. }
  17276. var uD,
  17277. cD = {},
  17278. hD = Object.create(null),
  17279. lD = Object.create(null),
  17280. dD = (function () {
  17281. function t(t, e, r) {
  17282. (this.canvas = vA.ADAPTER.createCanvas()),
  17283. (this.context = this.canvas.getContext('2d')),
  17284. (this.resolution = r || vA.RESOLUTION),
  17285. this.resize(t, e);
  17286. }
  17287. return (
  17288. (t.prototype.clear = function () {
  17289. this.context.setTransform(1, 0, 0, 1, 0, 0),
  17290. this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
  17291. }),
  17292. (t.prototype.resize = function (t, e) {
  17293. (this.canvas.width = Math.round(t * this.resolution)),
  17294. (this.canvas.height = Math.round(e * this.resolution));
  17295. }),
  17296. (t.prototype.destroy = function () {
  17297. (this.context = null), (this.canvas = null);
  17298. }),
  17299. Object.defineProperty(t.prototype, 'width', {
  17300. get: function () {
  17301. return this.canvas.width;
  17302. },
  17303. set: function (t) {
  17304. this.canvas.width = Math.round(t);
  17305. },
  17306. enumerable: !1,
  17307. configurable: !0,
  17308. }),
  17309. Object.defineProperty(t.prototype, 'height', {
  17310. get: function () {
  17311. return this.canvas.height;
  17312. },
  17313. set: function (t) {
  17314. this.canvas.height = Math.round(t);
  17315. },
  17316. enumerable: !1,
  17317. configurable: !0,
  17318. }),
  17319. t
  17320. );
  17321. })();
  17322. function fD(t, e) {
  17323. if ((void 0 === e && (e = globalThis.location), 0 === t.indexOf('data:')))
  17324. return '';
  17325. (e = e || globalThis.location),
  17326. uD || (uD = document.createElement('a')),
  17327. (uD.href = t);
  17328. var r = GM.parse(uD.href),
  17329. n = (!r.port && '' === e.port) || r.port === e.port;
  17330. return r.hostname === e.hostname && n && r.protocol === e.protocol
  17331. ? ''
  17332. : 'anonymous';
  17333. }
  17334. function pD(t, e) {
  17335. var r = vA.RETINA_PREFIX.exec(t);
  17336. return r ? parseFloat(r[1]) : void 0 !== e ? e : 1;
  17337. }
  17338. var vD,
  17339. mD = 2 * Math.PI,
  17340. yD = 180 / Math.PI,
  17341. gD = Math.PI / 180;
  17342. !(function (t) {
  17343. (t[(t.POLY = 0)] = 'POLY'),
  17344. (t[(t.RECT = 1)] = 'RECT'),
  17345. (t[(t.CIRC = 2)] = 'CIRC'),
  17346. (t[(t.ELIP = 3)] = 'ELIP'),
  17347. (t[(t.RREC = 4)] = 'RREC');
  17348. })(vD || (vD = {}));
  17349. var _D = (function () {
  17350. function t(t, e) {
  17351. void 0 === t && (t = 0),
  17352. void 0 === e && (e = 0),
  17353. (this.x = 0),
  17354. (this.y = 0),
  17355. (this.x = t),
  17356. (this.y = e);
  17357. }
  17358. return (
  17359. (t.prototype.clone = function () {
  17360. return new t(this.x, this.y);
  17361. }),
  17362. (t.prototype.copyFrom = function (t) {
  17363. return this.set(t.x, t.y), this;
  17364. }),
  17365. (t.prototype.copyTo = function (t) {
  17366. return t.set(this.x, this.y), t;
  17367. }),
  17368. (t.prototype.equals = function (t) {
  17369. return t.x === this.x && t.y === this.y;
  17370. }),
  17371. (t.prototype.set = function (t, e) {
  17372. return (
  17373. void 0 === t && (t = 0),
  17374. void 0 === e && (e = t),
  17375. (this.x = t),
  17376. (this.y = e),
  17377. this
  17378. );
  17379. }),
  17380. (t.prototype.toString = function () {
  17381. return '[@pixi/math:Point x=' + this.x + ' y=' + this.y + ']';
  17382. }),
  17383. t
  17384. );
  17385. })(),
  17386. bD = [new _D(), new _D(), new _D(), new _D()],
  17387. TD = (function () {
  17388. function t(t, e, r, n) {
  17389. void 0 === t && (t = 0),
  17390. void 0 === e && (e = 0),
  17391. void 0 === r && (r = 0),
  17392. void 0 === n && (n = 0),
  17393. (this.x = Number(t)),
  17394. (this.y = Number(e)),
  17395. (this.width = Number(r)),
  17396. (this.height = Number(n)),
  17397. (this.type = vD.RECT);
  17398. }
  17399. return (
  17400. Object.defineProperty(t.prototype, 'left', {
  17401. get: function () {
  17402. return this.x;
  17403. },
  17404. enumerable: !1,
  17405. configurable: !0,
  17406. }),
  17407. Object.defineProperty(t.prototype, 'right', {
  17408. get: function () {
  17409. return this.x + this.width;
  17410. },
  17411. enumerable: !1,
  17412. configurable: !0,
  17413. }),
  17414. Object.defineProperty(t.prototype, 'top', {
  17415. get: function () {
  17416. return this.y;
  17417. },
  17418. enumerable: !1,
  17419. configurable: !0,
  17420. }),
  17421. Object.defineProperty(t.prototype, 'bottom', {
  17422. get: function () {
  17423. return this.y + this.height;
  17424. },
  17425. enumerable: !1,
  17426. configurable: !0,
  17427. }),
  17428. Object.defineProperty(t, 'EMPTY', {
  17429. get: function () {
  17430. return new t(0, 0, 0, 0);
  17431. },
  17432. enumerable: !1,
  17433. configurable: !0,
  17434. }),
  17435. (t.prototype.clone = function () {
  17436. return new t(this.x, this.y, this.width, this.height);
  17437. }),
  17438. (t.prototype.copyFrom = function (t) {
  17439. return (
  17440. (this.x = t.x),
  17441. (this.y = t.y),
  17442. (this.width = t.width),
  17443. (this.height = t.height),
  17444. this
  17445. );
  17446. }),
  17447. (t.prototype.copyTo = function (t) {
  17448. return (
  17449. (t.x = this.x),
  17450. (t.y = this.y),
  17451. (t.width = this.width),
  17452. (t.height = this.height),
  17453. t
  17454. );
  17455. }),
  17456. (t.prototype.contains = function (t, e) {
  17457. return (
  17458. !(this.width <= 0 || this.height <= 0) &&
  17459. t >= this.x &&
  17460. t < this.x + this.width &&
  17461. e >= this.y &&
  17462. e < this.y + this.height
  17463. );
  17464. }),
  17465. (t.prototype.intersects = function (t, e) {
  17466. if (!e) {
  17467. var r = this.x < t.x ? t.x : this.x;
  17468. if ((this.right > t.right ? t.right : this.right) <= r) return !1;
  17469. var n = this.y < t.y ? t.y : this.y;
  17470. return (this.bottom > t.bottom ? t.bottom : this.bottom) > n;
  17471. }
  17472. var i = this.left,
  17473. o = this.right,
  17474. s = this.top,
  17475. a = this.bottom;
  17476. if (o <= i || a <= s) return !1;
  17477. var u = bD[0].set(t.left, t.top),
  17478. c = bD[1].set(t.left, t.bottom),
  17479. h = bD[2].set(t.right, t.top),
  17480. l = bD[3].set(t.right, t.bottom);
  17481. if (h.x <= u.x || c.y <= u.y) return !1;
  17482. var d = Math.sign(e.a * e.d - e.b * e.c);
  17483. if (0 === d) return !1;
  17484. if (
  17485. (e.apply(u, u),
  17486. e.apply(c, c),
  17487. e.apply(h, h),
  17488. e.apply(l, l),
  17489. Math.max(u.x, c.x, h.x, l.x) <= i ||
  17490. Math.min(u.x, c.x, h.x, l.x) >= o ||
  17491. Math.max(u.y, c.y, h.y, l.y) <= s ||
  17492. Math.min(u.y, c.y, h.y, l.y) >= a)
  17493. )
  17494. return !1;
  17495. var f = d * (c.y - u.y),
  17496. p = d * (u.x - c.x),
  17497. v = f * i + p * s,
  17498. m = f * o + p * s,
  17499. y = f * i + p * a,
  17500. g = f * o + p * a;
  17501. if (
  17502. Math.max(v, m, y, g) <= f * u.x + p * u.y ||
  17503. Math.min(v, m, y, g) >= f * l.x + p * l.y
  17504. )
  17505. return !1;
  17506. var _ = d * (u.y - h.y),
  17507. b = d * (h.x - u.x),
  17508. T = _ * i + b * s,
  17509. x = _ * o + b * s,
  17510. E = _ * i + b * a,
  17511. S = _ * o + b * a;
  17512. return !(
  17513. Math.max(T, x, E, S) <= _ * u.x + b * u.y ||
  17514. Math.min(T, x, E, S) >= _ * l.x + b * l.y
  17515. );
  17516. }),
  17517. (t.prototype.pad = function (t, e) {
  17518. return (
  17519. void 0 === t && (t = 0),
  17520. void 0 === e && (e = t),
  17521. (this.x -= t),
  17522. (this.y -= e),
  17523. (this.width += 2 * t),
  17524. (this.height += 2 * e),
  17525. this
  17526. );
  17527. }),
  17528. (t.prototype.fit = function (t) {
  17529. var e = Math.max(this.x, t.x),
  17530. r = Math.min(this.x + this.width, t.x + t.width),
  17531. n = Math.max(this.y, t.y),
  17532. i = Math.min(this.y + this.height, t.y + t.height);
  17533. return (
  17534. (this.x = e),
  17535. (this.width = Math.max(r - e, 0)),
  17536. (this.y = n),
  17537. (this.height = Math.max(i - n, 0)),
  17538. this
  17539. );
  17540. }),
  17541. (t.prototype.ceil = function (t, e) {
  17542. void 0 === t && (t = 1), void 0 === e && (e = 0.001);
  17543. var r = Math.ceil((this.x + this.width - e) * t) / t,
  17544. n = Math.ceil((this.y + this.height - e) * t) / t;
  17545. return (
  17546. (this.x = Math.floor((this.x + e) * t) / t),
  17547. (this.y = Math.floor((this.y + e) * t) / t),
  17548. (this.width = r - this.x),
  17549. (this.height = n - this.y),
  17550. this
  17551. );
  17552. }),
  17553. (t.prototype.enlarge = function (t) {
  17554. var e = Math.min(this.x, t.x),
  17555. r = Math.max(this.x + this.width, t.x + t.width),
  17556. n = Math.min(this.y, t.y),
  17557. i = Math.max(this.y + this.height, t.y + t.height);
  17558. return (
  17559. (this.x = e),
  17560. (this.width = r - e),
  17561. (this.y = n),
  17562. (this.height = i - n),
  17563. this
  17564. );
  17565. }),
  17566. (t.prototype.toString = function () {
  17567. return (
  17568. '[@pixi/math:Rectangle x=' +
  17569. this.x +
  17570. ' y=' +
  17571. this.y +
  17572. ' width=' +
  17573. this.width +
  17574. ' height=' +
  17575. this.height +
  17576. ']'
  17577. );
  17578. }),
  17579. t
  17580. );
  17581. })(),
  17582. xD = (function () {
  17583. function t(t, e, r) {
  17584. void 0 === t && (t = 0),
  17585. void 0 === e && (e = 0),
  17586. void 0 === r && (r = 0),
  17587. (this.x = t),
  17588. (this.y = e),
  17589. (this.radius = r),
  17590. (this.type = vD.CIRC);
  17591. }
  17592. return (
  17593. (t.prototype.clone = function () {
  17594. return new t(this.x, this.y, this.radius);
  17595. }),
  17596. (t.prototype.contains = function (t, e) {
  17597. if (this.radius <= 0) return !1;
  17598. var r = this.radius * this.radius,
  17599. n = this.x - t,
  17600. i = this.y - e;
  17601. return (n *= n) + (i *= i) <= r;
  17602. }),
  17603. (t.prototype.getBounds = function () {
  17604. return new TD(
  17605. this.x - this.radius,
  17606. this.y - this.radius,
  17607. 2 * this.radius,
  17608. 2 * this.radius
  17609. );
  17610. }),
  17611. (t.prototype.toString = function () {
  17612. return (
  17613. '[@pixi/math:Circle x=' +
  17614. this.x +
  17615. ' y=' +
  17616. this.y +
  17617. ' radius=' +
  17618. this.radius +
  17619. ']'
  17620. );
  17621. }),
  17622. t
  17623. );
  17624. })(),
  17625. ED = (function () {
  17626. function t(t, e, r, n) {
  17627. void 0 === t && (t = 0),
  17628. void 0 === e && (e = 0),
  17629. void 0 === r && (r = 0),
  17630. void 0 === n && (n = 0),
  17631. (this.x = t),
  17632. (this.y = e),
  17633. (this.width = r),
  17634. (this.height = n),
  17635. (this.type = vD.ELIP);
  17636. }
  17637. return (
  17638. (t.prototype.clone = function () {
  17639. return new t(this.x, this.y, this.width, this.height);
  17640. }),
  17641. (t.prototype.contains = function (t, e) {
  17642. if (this.width <= 0 || this.height <= 0) return !1;
  17643. var r = (t - this.x) / this.width,
  17644. n = (e - this.y) / this.height;
  17645. return (r *= r) + (n *= n) <= 1;
  17646. }),
  17647. (t.prototype.getBounds = function () {
  17648. return new TD(
  17649. this.x - this.width,
  17650. this.y - this.height,
  17651. this.width,
  17652. this.height
  17653. );
  17654. }),
  17655. (t.prototype.toString = function () {
  17656. return (
  17657. '[@pixi/math:Ellipse x=' +
  17658. this.x +
  17659. ' y=' +
  17660. this.y +
  17661. ' width=' +
  17662. this.width +
  17663. ' height=' +
  17664. this.height +
  17665. ']'
  17666. );
  17667. }),
  17668. t
  17669. );
  17670. })(),
  17671. SD = (function () {
  17672. function t() {
  17673. for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
  17674. e[r] = t[r];
  17675. var n = Array.isArray(e[0]) ? e[0] : e;
  17676. if ('number' != typeof n[0]) {
  17677. for (var i = [], o = 0, s = n.length; o < s; o++)
  17678. i.push(n[o].x, n[o].y);
  17679. n = i;
  17680. }
  17681. (this.points = n), (this.type = vD.POLY), (this.closeStroke = !0);
  17682. }
  17683. return (
  17684. (t.prototype.clone = function () {
  17685. var e = new t(this.points.slice());
  17686. return (e.closeStroke = this.closeStroke), e;
  17687. }),
  17688. (t.prototype.contains = function (t, e) {
  17689. for (
  17690. var r = !1, n = this.points.length / 2, i = 0, o = n - 1;
  17691. i < n;
  17692. o = i++
  17693. ) {
  17694. var s = this.points[2 * i],
  17695. a = this.points[2 * i + 1],
  17696. u = this.points[2 * o],
  17697. c = this.points[2 * o + 1];
  17698. a > e != c > e && t < ((e - a) / (c - a)) * (u - s) + s && (r = !r);
  17699. }
  17700. return r;
  17701. }),
  17702. (t.prototype.toString = function () {
  17703. return (
  17704. '[@pixi/math:PolygoncloseStroke=' +
  17705. this.closeStroke +
  17706. 'points=' +
  17707. this.points.reduce(function (t, e) {
  17708. return t + ', ' + e;
  17709. }, '') +
  17710. ']'
  17711. );
  17712. }),
  17713. t
  17714. );
  17715. })(),
  17716. wD = (function () {
  17717. function t(t, e, r, n, i) {
  17718. void 0 === t && (t = 0),
  17719. void 0 === e && (e = 0),
  17720. void 0 === r && (r = 0),
  17721. void 0 === n && (n = 0),
  17722. void 0 === i && (i = 20),
  17723. (this.x = t),
  17724. (this.y = e),
  17725. (this.width = r),
  17726. (this.height = n),
  17727. (this.radius = i),
  17728. (this.type = vD.RREC);
  17729. }
  17730. return (
  17731. (t.prototype.clone = function () {
  17732. return new t(this.x, this.y, this.width, this.height, this.radius);
  17733. }),
  17734. (t.prototype.contains = function (t, e) {
  17735. if (this.width <= 0 || this.height <= 0) return !1;
  17736. if (
  17737. t >= this.x &&
  17738. t <= this.x + this.width &&
  17739. e >= this.y &&
  17740. e <= this.y + this.height
  17741. ) {
  17742. var r = Math.max(
  17743. 0,
  17744. Math.min(this.radius, Math.min(this.width, this.height) / 2)
  17745. );
  17746. if (
  17747. (e >= this.y + r && e <= this.y + this.height - r) ||
  17748. (t >= this.x + r && t <= this.x + this.width - r)
  17749. )
  17750. return !0;
  17751. var n = t - (this.x + r),
  17752. i = e - (this.y + r),
  17753. o = r * r;
  17754. if (n * n + i * i <= o) return !0;
  17755. if ((n = t - (this.x + this.width - r)) * n + i * i <= o) return !0;
  17756. if (n * n + (i = e - (this.y + this.height - r)) * i <= o)
  17757. return !0;
  17758. if ((n = t - (this.x + r)) * n + i * i <= o) return !0;
  17759. }
  17760. return !1;
  17761. }),
  17762. (t.prototype.toString = function () {
  17763. return (
  17764. '[@pixi/math:RoundedRectangle x=' +
  17765. this.x +
  17766. ' y=' +
  17767. this.y +
  17768. 'width=' +
  17769. this.width +
  17770. ' height=' +
  17771. this.height +
  17772. ' radius=' +
  17773. this.radius +
  17774. ']'
  17775. );
  17776. }),
  17777. t
  17778. );
  17779. })(),
  17780. RD = (function () {
  17781. function t(t, e, r, n) {
  17782. void 0 === r && (r = 0),
  17783. void 0 === n && (n = 0),
  17784. (this._x = r),
  17785. (this._y = n),
  17786. (this.cb = t),
  17787. (this.scope = e);
  17788. }
  17789. return (
  17790. (t.prototype.clone = function (e, r) {
  17791. return (
  17792. void 0 === e && (e = this.cb),
  17793. void 0 === r && (r = this.scope),
  17794. new t(e, r, this._x, this._y)
  17795. );
  17796. }),
  17797. (t.prototype.set = function (t, e) {
  17798. return (
  17799. void 0 === t && (t = 0),
  17800. void 0 === e && (e = t),
  17801. (this._x === t && this._y === e) ||
  17802. ((this._x = t), (this._y = e), this.cb.call(this.scope)),
  17803. this
  17804. );
  17805. }),
  17806. (t.prototype.copyFrom = function (t) {
  17807. return (
  17808. (this._x === t.x && this._y === t.y) ||
  17809. ((this._x = t.x), (this._y = t.y), this.cb.call(this.scope)),
  17810. this
  17811. );
  17812. }),
  17813. (t.prototype.copyTo = function (t) {
  17814. return t.set(this._x, this._y), t;
  17815. }),
  17816. (t.prototype.equals = function (t) {
  17817. return t.x === this._x && t.y === this._y;
  17818. }),
  17819. (t.prototype.toString = function () {
  17820. return (
  17821. '[@pixi/math:ObservablePoint x=0 y=0 scope=' + this.scope + ']'
  17822. );
  17823. }),
  17824. Object.defineProperty(t.prototype, 'x', {
  17825. get: function () {
  17826. return this._x;
  17827. },
  17828. set: function (t) {
  17829. this._x !== t && ((this._x = t), this.cb.call(this.scope));
  17830. },
  17831. enumerable: !1,
  17832. configurable: !0,
  17833. }),
  17834. Object.defineProperty(t.prototype, 'y', {
  17835. get: function () {
  17836. return this._y;
  17837. },
  17838. set: function (t) {
  17839. this._y !== t && ((this._y = t), this.cb.call(this.scope));
  17840. },
  17841. enumerable: !1,
  17842. configurable: !0,
  17843. }),
  17844. t
  17845. );
  17846. })(),
  17847. CD = (function () {
  17848. function t(t, e, r, n, i, o) {
  17849. void 0 === t && (t = 1),
  17850. void 0 === e && (e = 0),
  17851. void 0 === r && (r = 0),
  17852. void 0 === n && (n = 1),
  17853. void 0 === i && (i = 0),
  17854. void 0 === o && (o = 0),
  17855. (this.array = null),
  17856. (this.a = t),
  17857. (this.b = e),
  17858. (this.c = r),
  17859. (this.d = n),
  17860. (this.tx = i),
  17861. (this.ty = o);
  17862. }
  17863. return (
  17864. (t.prototype.fromArray = function (t) {
  17865. (this.a = t[0]),
  17866. (this.b = t[1]),
  17867. (this.c = t[3]),
  17868. (this.d = t[4]),
  17869. (this.tx = t[2]),
  17870. (this.ty = t[5]);
  17871. }),
  17872. (t.prototype.set = function (t, e, r, n, i, o) {
  17873. return (
  17874. (this.a = t),
  17875. (this.b = e),
  17876. (this.c = r),
  17877. (this.d = n),
  17878. (this.tx = i),
  17879. (this.ty = o),
  17880. this
  17881. );
  17882. }),
  17883. (t.prototype.toArray = function (t, e) {
  17884. this.array || (this.array = new Float32Array(9));
  17885. var r = e || this.array;
  17886. return (
  17887. t
  17888. ? ((r[0] = this.a),
  17889. (r[1] = this.b),
  17890. (r[2] = 0),
  17891. (r[3] = this.c),
  17892. (r[4] = this.d),
  17893. (r[5] = 0),
  17894. (r[6] = this.tx),
  17895. (r[7] = this.ty),
  17896. (r[8] = 1))
  17897. : ((r[0] = this.a),
  17898. (r[1] = this.c),
  17899. (r[2] = this.tx),
  17900. (r[3] = this.b),
  17901. (r[4] = this.d),
  17902. (r[5] = this.ty),
  17903. (r[6] = 0),
  17904. (r[7] = 0),
  17905. (r[8] = 1)),
  17906. r
  17907. );
  17908. }),
  17909. (t.prototype.apply = function (t, e) {
  17910. e = e || new _D();
  17911. var r = t.x,
  17912. n = t.y;
  17913. return (
  17914. (e.x = this.a * r + this.c * n + this.tx),
  17915. (e.y = this.b * r + this.d * n + this.ty),
  17916. e
  17917. );
  17918. }),
  17919. (t.prototype.applyInverse = function (t, e) {
  17920. e = e || new _D();
  17921. var r = 1 / (this.a * this.d + this.c * -this.b),
  17922. n = t.x,
  17923. i = t.y;
  17924. return (
  17925. (e.x =
  17926. this.d * r * n +
  17927. -this.c * r * i +
  17928. (this.ty * this.c - this.tx * this.d) * r),
  17929. (e.y =
  17930. this.a * r * i +
  17931. -this.b * r * n +
  17932. (-this.ty * this.a + this.tx * this.b) * r),
  17933. e
  17934. );
  17935. }),
  17936. (t.prototype.translate = function (t, e) {
  17937. return (this.tx += t), (this.ty += e), this;
  17938. }),
  17939. (t.prototype.scale = function (t, e) {
  17940. return (
  17941. (this.a *= t),
  17942. (this.d *= e),
  17943. (this.c *= t),
  17944. (this.b *= e),
  17945. (this.tx *= t),
  17946. (this.ty *= e),
  17947. this
  17948. );
  17949. }),
  17950. (t.prototype.rotate = function (t) {
  17951. var e = Math.cos(t),
  17952. r = Math.sin(t),
  17953. n = this.a,
  17954. i = this.c,
  17955. o = this.tx;
  17956. return (
  17957. (this.a = n * e - this.b * r),
  17958. (this.b = n * r + this.b * e),
  17959. (this.c = i * e - this.d * r),
  17960. (this.d = i * r + this.d * e),
  17961. (this.tx = o * e - this.ty * r),
  17962. (this.ty = o * r + this.ty * e),
  17963. this
  17964. );
  17965. }),
  17966. (t.prototype.append = function (t) {
  17967. var e = this.a,
  17968. r = this.b,
  17969. n = this.c,
  17970. i = this.d;
  17971. return (
  17972. (this.a = t.a * e + t.b * n),
  17973. (this.b = t.a * r + t.b * i),
  17974. (this.c = t.c * e + t.d * n),
  17975. (this.d = t.c * r + t.d * i),
  17976. (this.tx = t.tx * e + t.ty * n + this.tx),
  17977. (this.ty = t.tx * r + t.ty * i + this.ty),
  17978. this
  17979. );
  17980. }),
  17981. (t.prototype.setTransform = function (t, e, r, n, i, o, s, a, u) {
  17982. return (
  17983. (this.a = Math.cos(s + u) * i),
  17984. (this.b = Math.sin(s + u) * i),
  17985. (this.c = -Math.sin(s - a) * o),
  17986. (this.d = Math.cos(s - a) * o),
  17987. (this.tx = t - (r * this.a + n * this.c)),
  17988. (this.ty = e - (r * this.b + n * this.d)),
  17989. this
  17990. );
  17991. }),
  17992. (t.prototype.prepend = function (t) {
  17993. var e = this.tx;
  17994. if (1 !== t.a || 0 !== t.b || 0 !== t.c || 1 !== t.d) {
  17995. var r = this.a,
  17996. n = this.c;
  17997. (this.a = r * t.a + this.b * t.c),
  17998. (this.b = r * t.b + this.b * t.d),
  17999. (this.c = n * t.a + this.d * t.c),
  18000. (this.d = n * t.b + this.d * t.d);
  18001. }
  18002. return (
  18003. (this.tx = e * t.a + this.ty * t.c + t.tx),
  18004. (this.ty = e * t.b + this.ty * t.d + t.ty),
  18005. this
  18006. );
  18007. }),
  18008. (t.prototype.decompose = function (t) {
  18009. var e = this.a,
  18010. r = this.b,
  18011. n = this.c,
  18012. i = this.d,
  18013. o = t.pivot,
  18014. s = -Math.atan2(-n, i),
  18015. a = Math.atan2(r, e),
  18016. u = Math.abs(s + a);
  18017. return (
  18018. u < 1e-5 || Math.abs(mD - u) < 1e-5
  18019. ? ((t.rotation = a), (t.skew.x = t.skew.y = 0))
  18020. : ((t.rotation = 0), (t.skew.x = s), (t.skew.y = a)),
  18021. (t.scale.x = Math.sqrt(e * e + r * r)),
  18022. (t.scale.y = Math.sqrt(n * n + i * i)),
  18023. (t.position.x = this.tx + (o.x * e + o.y * n)),
  18024. (t.position.y = this.ty + (o.x * r + o.y * i)),
  18025. t
  18026. );
  18027. }),
  18028. (t.prototype.invert = function () {
  18029. var t = this.a,
  18030. e = this.b,
  18031. r = this.c,
  18032. n = this.d,
  18033. i = this.tx,
  18034. o = t * n - e * r;
  18035. return (
  18036. (this.a = n / o),
  18037. (this.b = -e / o),
  18038. (this.c = -r / o),
  18039. (this.d = t / o),
  18040. (this.tx = (r * this.ty - n * i) / o),
  18041. (this.ty = -(t * this.ty - e * i) / o),
  18042. this
  18043. );
  18044. }),
  18045. (t.prototype.identity = function () {
  18046. return (
  18047. (this.a = 1),
  18048. (this.b = 0),
  18049. (this.c = 0),
  18050. (this.d = 1),
  18051. (this.tx = 0),
  18052. (this.ty = 0),
  18053. this
  18054. );
  18055. }),
  18056. (t.prototype.clone = function () {
  18057. var e = new t();
  18058. return (
  18059. (e.a = this.a),
  18060. (e.b = this.b),
  18061. (e.c = this.c),
  18062. (e.d = this.d),
  18063. (e.tx = this.tx),
  18064. (e.ty = this.ty),
  18065. e
  18066. );
  18067. }),
  18068. (t.prototype.copyTo = function (t) {
  18069. return (
  18070. (t.a = this.a),
  18071. (t.b = this.b),
  18072. (t.c = this.c),
  18073. (t.d = this.d),
  18074. (t.tx = this.tx),
  18075. (t.ty = this.ty),
  18076. t
  18077. );
  18078. }),
  18079. (t.prototype.copyFrom = function (t) {
  18080. return (
  18081. (this.a = t.a),
  18082. (this.b = t.b),
  18083. (this.c = t.c),
  18084. (this.d = t.d),
  18085. (this.tx = t.tx),
  18086. (this.ty = t.ty),
  18087. this
  18088. );
  18089. }),
  18090. (t.prototype.toString = function () {
  18091. return (
  18092. '[@pixi/math:Matrix a=' +
  18093. this.a +
  18094. ' b=' +
  18095. this.b +
  18096. ' c=' +
  18097. this.c +
  18098. ' d=' +
  18099. this.d +
  18100. ' tx=' +
  18101. this.tx +
  18102. ' ty=' +
  18103. this.ty +
  18104. ']'
  18105. );
  18106. }),
  18107. Object.defineProperty(t, 'IDENTITY', {
  18108. get: function () {
  18109. return new t();
  18110. },
  18111. enumerable: !1,
  18112. configurable: !0,
  18113. }),
  18114. Object.defineProperty(t, 'TEMP_MATRIX', {
  18115. get: function () {
  18116. return new t();
  18117. },
  18118. enumerable: !1,
  18119. configurable: !0,
  18120. }),
  18121. t
  18122. );
  18123. })(),
  18124. PD = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1],
  18125. AD = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1],
  18126. OD = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1],
  18127. ID = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1],
  18128. MD = [],
  18129. DD = [],
  18130. LD = Math.sign;
  18131. !(function () {
  18132. for (var t = 0; t < 16; t++) {
  18133. var e = [];
  18134. MD.push(e);
  18135. for (var r = 0; r < 16; r++)
  18136. for (
  18137. var n = LD(PD[t] * PD[r] + OD[t] * AD[r]),
  18138. i = LD(AD[t] * PD[r] + ID[t] * AD[r]),
  18139. o = LD(PD[t] * OD[r] + OD[t] * ID[r]),
  18140. s = LD(AD[t] * OD[r] + ID[t] * ID[r]),
  18141. a = 0;
  18142. a < 16;
  18143. a++
  18144. )
  18145. if (PD[a] === n && AD[a] === i && OD[a] === o && ID[a] === s) {
  18146. e.push(a);
  18147. break;
  18148. }
  18149. }
  18150. for (t = 0; t < 16; t++) {
  18151. var u = new CD();
  18152. u.set(PD[t], AD[t], OD[t], ID[t], 0, 0), DD.push(u);
  18153. }
  18154. })();
  18155. var FD = {
  18156. E: 0,
  18157. SE: 1,
  18158. S: 2,
  18159. SW: 3,
  18160. W: 4,
  18161. NW: 5,
  18162. N: 6,
  18163. NE: 7,
  18164. MIRROR_VERTICAL: 8,
  18165. MAIN_DIAGONAL: 10,
  18166. MIRROR_HORIZONTAL: 12,
  18167. REVERSE_DIAGONAL: 14,
  18168. uX: function (t) {
  18169. return PD[t];
  18170. },
  18171. uY: function (t) {
  18172. return AD[t];
  18173. },
  18174. vX: function (t) {
  18175. return OD[t];
  18176. },
  18177. vY: function (t) {
  18178. return ID[t];
  18179. },
  18180. inv: function (t) {
  18181. return 8 & t ? 15 & t : 7 & -t;
  18182. },
  18183. add: function (t, e) {
  18184. return MD[t][e];
  18185. },
  18186. sub: function (t, e) {
  18187. return MD[t][FD.inv(e)];
  18188. },
  18189. rotate180: function (t) {
  18190. return 4 ^ t;
  18191. },
  18192. isVertical: function (t) {
  18193. return 2 == (3 & t);
  18194. },
  18195. byDirection: function (t, e) {
  18196. return 2 * Math.abs(t) <= Math.abs(e)
  18197. ? e >= 0
  18198. ? FD.S
  18199. : FD.N
  18200. : 2 * Math.abs(e) <= Math.abs(t)
  18201. ? t > 0
  18202. ? FD.E
  18203. : FD.W
  18204. : e > 0
  18205. ? t > 0
  18206. ? FD.SE
  18207. : FD.SW
  18208. : t > 0
  18209. ? FD.NE
  18210. : FD.NW;
  18211. },
  18212. matrixAppendRotationInv: function (t, e, r, n) {
  18213. void 0 === r && (r = 0), void 0 === n && (n = 0);
  18214. var i = DD[FD.inv(e)];
  18215. (i.tx = r), (i.ty = n), t.append(i);
  18216. },
  18217. },
  18218. ND = (function () {
  18219. function t() {
  18220. (this.worldTransform = new CD()),
  18221. (this.localTransform = new CD()),
  18222. (this.position = new RD(this.onChange, this, 0, 0)),
  18223. (this.scale = new RD(this.onChange, this, 1, 1)),
  18224. (this.pivot = new RD(this.onChange, this, 0, 0)),
  18225. (this.skew = new RD(this.updateSkew, this, 0, 0)),
  18226. (this._rotation = 0),
  18227. (this._cx = 1),
  18228. (this._sx = 0),
  18229. (this._cy = 0),
  18230. (this._sy = 1),
  18231. (this._localID = 0),
  18232. (this._currentLocalID = 0),
  18233. (this._worldID = 0),
  18234. (this._parentID = 0);
  18235. }
  18236. return (
  18237. (t.prototype.onChange = function () {
  18238. this._localID++;
  18239. }),
  18240. (t.prototype.updateSkew = function () {
  18241. (this._cx = Math.cos(this._rotation + this.skew.y)),
  18242. (this._sx = Math.sin(this._rotation + this.skew.y)),
  18243. (this._cy = -Math.sin(this._rotation - this.skew.x)),
  18244. (this._sy = Math.cos(this._rotation - this.skew.x)),
  18245. this._localID++;
  18246. }),
  18247. (t.prototype.toString = function () {
  18248. return (
  18249. '[@pixi/math:Transform position=(' +
  18250. this.position.x +
  18251. ', ' +
  18252. this.position.y +
  18253. ') rotation=' +
  18254. this.rotation +
  18255. ' scale=(' +
  18256. this.scale.x +
  18257. ', ' +
  18258. this.scale.y +
  18259. ') skew=(' +
  18260. this.skew.x +
  18261. ', ' +
  18262. this.skew.y +
  18263. ') ]'
  18264. );
  18265. }),
  18266. (t.prototype.updateLocalTransform = function () {
  18267. var t = this.localTransform;
  18268. this._localID !== this._currentLocalID &&
  18269. ((t.a = this._cx * this.scale.x),
  18270. (t.b = this._sx * this.scale.x),
  18271. (t.c = this._cy * this.scale.y),
  18272. (t.d = this._sy * this.scale.y),
  18273. (t.tx =
  18274. this.position.x - (this.pivot.x * t.a + this.pivot.y * t.c)),
  18275. (t.ty =
  18276. this.position.y - (this.pivot.x * t.b + this.pivot.y * t.d)),
  18277. (this._currentLocalID = this._localID),
  18278. (this._parentID = -1));
  18279. }),
  18280. (t.prototype.updateTransform = function (t) {
  18281. var e = this.localTransform;
  18282. if (
  18283. (this._localID !== this._currentLocalID &&
  18284. ((e.a = this._cx * this.scale.x),
  18285. (e.b = this._sx * this.scale.x),
  18286. (e.c = this._cy * this.scale.y),
  18287. (e.d = this._sy * this.scale.y),
  18288. (e.tx =
  18289. this.position.x - (this.pivot.x * e.a + this.pivot.y * e.c)),
  18290. (e.ty =
  18291. this.position.y - (this.pivot.x * e.b + this.pivot.y * e.d)),
  18292. (this._currentLocalID = this._localID),
  18293. (this._parentID = -1)),
  18294. this._parentID !== t._worldID)
  18295. ) {
  18296. var r = t.worldTransform,
  18297. n = this.worldTransform;
  18298. (n.a = e.a * r.a + e.b * r.c),
  18299. (n.b = e.a * r.b + e.b * r.d),
  18300. (n.c = e.c * r.a + e.d * r.c),
  18301. (n.d = e.c * r.b + e.d * r.d),
  18302. (n.tx = e.tx * r.a + e.ty * r.c + r.tx),
  18303. (n.ty = e.tx * r.b + e.ty * r.d + r.ty),
  18304. (this._parentID = t._worldID),
  18305. this._worldID++;
  18306. }
  18307. }),
  18308. (t.prototype.setFromMatrix = function (t) {
  18309. t.decompose(this), this._localID++;
  18310. }),
  18311. Object.defineProperty(t.prototype, 'rotation', {
  18312. get: function () {
  18313. return this._rotation;
  18314. },
  18315. set: function (t) {
  18316. this._rotation !== t && ((this._rotation = t), this.updateSkew());
  18317. },
  18318. enumerable: !1,
  18319. configurable: !0,
  18320. }),
  18321. (t.IDENTITY = new t()),
  18322. t
  18323. );
  18324. })();
  18325. vA.SORTABLE_CHILDREN = !1;
  18326. var kD = (function () {
  18327. function t() {
  18328. (this.minX = 1 / 0),
  18329. (this.minY = 1 / 0),
  18330. (this.maxX = -1 / 0),
  18331. (this.maxY = -1 / 0),
  18332. (this.rect = null),
  18333. (this.updateID = -1);
  18334. }
  18335. return (
  18336. (t.prototype.isEmpty = function () {
  18337. return this.minX > this.maxX || this.minY > this.maxY;
  18338. }),
  18339. (t.prototype.clear = function () {
  18340. (this.minX = 1 / 0),
  18341. (this.minY = 1 / 0),
  18342. (this.maxX = -1 / 0),
  18343. (this.maxY = -1 / 0);
  18344. }),
  18345. (t.prototype.getRectangle = function (t) {
  18346. return this.minX > this.maxX || this.minY > this.maxY
  18347. ? TD.EMPTY
  18348. : (((t = t || new TD(0, 0, 1, 1)).x = this.minX),
  18349. (t.y = this.minY),
  18350. (t.width = this.maxX - this.minX),
  18351. (t.height = this.maxY - this.minY),
  18352. t);
  18353. }),
  18354. (t.prototype.addPoint = function (t) {
  18355. (this.minX = Math.min(this.minX, t.x)),
  18356. (this.maxX = Math.max(this.maxX, t.x)),
  18357. (this.minY = Math.min(this.minY, t.y)),
  18358. (this.maxY = Math.max(this.maxY, t.y));
  18359. }),
  18360. (t.prototype.addPointMatrix = function (t, e) {
  18361. var r = t.a,
  18362. n = t.b,
  18363. i = t.c,
  18364. o = t.d,
  18365. s = t.tx,
  18366. a = t.ty,
  18367. u = r * e.x + i * e.y + s,
  18368. c = n * e.x + o * e.y + a;
  18369. (this.minX = Math.min(this.minX, u)),
  18370. (this.maxX = Math.max(this.maxX, u)),
  18371. (this.minY = Math.min(this.minY, c)),
  18372. (this.maxY = Math.max(this.maxY, c));
  18373. }),
  18374. (t.prototype.addQuad = function (t) {
  18375. var e = this.minX,
  18376. r = this.minY,
  18377. n = this.maxX,
  18378. i = this.maxY,
  18379. o = t[0],
  18380. s = t[1];
  18381. (e = o < e ? o : e),
  18382. (r = s < r ? s : r),
  18383. (n = o > n ? o : n),
  18384. (i = s > i ? s : i),
  18385. (e = (o = t[2]) < e ? o : e),
  18386. (r = (s = t[3]) < r ? s : r),
  18387. (n = o > n ? o : n),
  18388. (i = s > i ? s : i),
  18389. (e = (o = t[4]) < e ? o : e),
  18390. (r = (s = t[5]) < r ? s : r),
  18391. (n = o > n ? o : n),
  18392. (i = s > i ? s : i),
  18393. (e = (o = t[6]) < e ? o : e),
  18394. (r = (s = t[7]) < r ? s : r),
  18395. (n = o > n ? o : n),
  18396. (i = s > i ? s : i),
  18397. (this.minX = e),
  18398. (this.minY = r),
  18399. (this.maxX = n),
  18400. (this.maxY = i);
  18401. }),
  18402. (t.prototype.addFrame = function (t, e, r, n, i) {
  18403. this.addFrameMatrix(t.worldTransform, e, r, n, i);
  18404. }),
  18405. (t.prototype.addFrameMatrix = function (t, e, r, n, i) {
  18406. var o = t.a,
  18407. s = t.b,
  18408. a = t.c,
  18409. u = t.d,
  18410. c = t.tx,
  18411. h = t.ty,
  18412. l = this.minX,
  18413. d = this.minY,
  18414. f = this.maxX,
  18415. p = this.maxY,
  18416. v = o * e + a * r + c,
  18417. m = s * e + u * r + h;
  18418. (l = v < l ? v : l),
  18419. (d = m < d ? m : d),
  18420. (f = v > f ? v : f),
  18421. (p = m > p ? m : p),
  18422. (l = (v = o * n + a * r + c) < l ? v : l),
  18423. (d = (m = s * n + u * r + h) < d ? m : d),
  18424. (f = v > f ? v : f),
  18425. (p = m > p ? m : p),
  18426. (l = (v = o * e + a * i + c) < l ? v : l),
  18427. (d = (m = s * e + u * i + h) < d ? m : d),
  18428. (f = v > f ? v : f),
  18429. (p = m > p ? m : p),
  18430. (l = (v = o * n + a * i + c) < l ? v : l),
  18431. (d = (m = s * n + u * i + h) < d ? m : d),
  18432. (f = v > f ? v : f),
  18433. (p = m > p ? m : p),
  18434. (this.minX = l),
  18435. (this.minY = d),
  18436. (this.maxX = f),
  18437. (this.maxY = p);
  18438. }),
  18439. (t.prototype.addVertexData = function (t, e, r) {
  18440. for (
  18441. var n = this.minX,
  18442. i = this.minY,
  18443. o = this.maxX,
  18444. s = this.maxY,
  18445. a = e;
  18446. a < r;
  18447. a += 2
  18448. ) {
  18449. var u = t[a],
  18450. c = t[a + 1];
  18451. (n = u < n ? u : n),
  18452. (i = c < i ? c : i),
  18453. (o = u > o ? u : o),
  18454. (s = c > s ? c : s);
  18455. }
  18456. (this.minX = n), (this.minY = i), (this.maxX = o), (this.maxY = s);
  18457. }),
  18458. (t.prototype.addVertices = function (t, e, r, n) {
  18459. this.addVerticesMatrix(t.worldTransform, e, r, n);
  18460. }),
  18461. (t.prototype.addVerticesMatrix = function (t, e, r, n, i, o) {
  18462. void 0 === i && (i = 0), void 0 === o && (o = i);
  18463. for (
  18464. var s = t.a,
  18465. a = t.b,
  18466. u = t.c,
  18467. c = t.d,
  18468. h = t.tx,
  18469. l = t.ty,
  18470. d = this.minX,
  18471. f = this.minY,
  18472. p = this.maxX,
  18473. v = this.maxY,
  18474. m = r;
  18475. m < n;
  18476. m += 2
  18477. ) {
  18478. var y = e[m],
  18479. g = e[m + 1],
  18480. _ = s * y + u * g + h,
  18481. b = c * g + a * y + l;
  18482. (d = Math.min(d, _ - i)),
  18483. (p = Math.max(p, _ + i)),
  18484. (f = Math.min(f, b - o)),
  18485. (v = Math.max(v, b + o));
  18486. }
  18487. (this.minX = d), (this.minY = f), (this.maxX = p), (this.maxY = v);
  18488. }),
  18489. (t.prototype.addBounds = function (t) {
  18490. var e = this.minX,
  18491. r = this.minY,
  18492. n = this.maxX,
  18493. i = this.maxY;
  18494. (this.minX = t.minX < e ? t.minX : e),
  18495. (this.minY = t.minY < r ? t.minY : r),
  18496. (this.maxX = t.maxX > n ? t.maxX : n),
  18497. (this.maxY = t.maxY > i ? t.maxY : i);
  18498. }),
  18499. (t.prototype.addBoundsMask = function (t, e) {
  18500. var r = t.minX > e.minX ? t.minX : e.minX,
  18501. n = t.minY > e.minY ? t.minY : e.minY,
  18502. i = t.maxX < e.maxX ? t.maxX : e.maxX,
  18503. o = t.maxY < e.maxY ? t.maxY : e.maxY;
  18504. if (r <= i && n <= o) {
  18505. var s = this.minX,
  18506. a = this.minY,
  18507. u = this.maxX,
  18508. c = this.maxY;
  18509. (this.minX = r < s ? r : s),
  18510. (this.minY = n < a ? n : a),
  18511. (this.maxX = i > u ? i : u),
  18512. (this.maxY = o > c ? o : c);
  18513. }
  18514. }),
  18515. (t.prototype.addBoundsMatrix = function (t, e) {
  18516. this.addFrameMatrix(e, t.minX, t.minY, t.maxX, t.maxY);
  18517. }),
  18518. (t.prototype.addBoundsArea = function (t, e) {
  18519. var r = t.minX > e.x ? t.minX : e.x,
  18520. n = t.minY > e.y ? t.minY : e.y,
  18521. i = t.maxX < e.x + e.width ? t.maxX : e.x + e.width,
  18522. o = t.maxY < e.y + e.height ? t.maxY : e.y + e.height;
  18523. if (r <= i && n <= o) {
  18524. var s = this.minX,
  18525. a = this.minY,
  18526. u = this.maxX,
  18527. c = this.maxY;
  18528. (this.minX = r < s ? r : s),
  18529. (this.minY = n < a ? n : a),
  18530. (this.maxX = i > u ? i : u),
  18531. (this.maxY = o > c ? o : c);
  18532. }
  18533. }),
  18534. (t.prototype.pad = function (t, e) {
  18535. void 0 === t && (t = 0),
  18536. void 0 === e && (e = t),
  18537. this.isEmpty() ||
  18538. ((this.minX -= t),
  18539. (this.maxX += t),
  18540. (this.minY -= e),
  18541. (this.maxY += e));
  18542. }),
  18543. (t.prototype.addFramePad = function (t, e, r, n, i, o) {
  18544. (t -= i),
  18545. (e -= o),
  18546. (r += i),
  18547. (n += o),
  18548. (this.minX = this.minX < t ? this.minX : t),
  18549. (this.maxX = this.maxX > r ? this.maxX : r),
  18550. (this.minY = this.minY < e ? this.minY : e),
  18551. (this.maxY = this.maxY > n ? this.maxY : n);
  18552. }),
  18553. t
  18554. );
  18555. })(),
  18556. BD = function (t, e) {
  18557. return (
  18558. (BD =
  18559. Object.setPrototypeOf ||
  18560. ({ __proto__: [] } instanceof Array &&
  18561. function (t, e) {
  18562. t.__proto__ = e;
  18563. }) ||
  18564. function (t, e) {
  18565. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  18566. }),
  18567. BD(t, e)
  18568. );
  18569. };
  18570. function GD(t, e) {
  18571. function r() {
  18572. this.constructor = t;
  18573. }
  18574. BD(t, e),
  18575. (t.prototype =
  18576. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  18577. }
  18578. var UD = (function (t) {
  18579. function e() {
  18580. var e = t.call(this) || this;
  18581. return (
  18582. (e.tempDisplayObjectParent = null),
  18583. (e.transform = new ND()),
  18584. (e.alpha = 1),
  18585. (e.visible = !0),
  18586. (e.renderable = !0),
  18587. (e.cullable = !1),
  18588. (e.cullArea = null),
  18589. (e.parent = null),
  18590. (e.worldAlpha = 1),
  18591. (e._lastSortedIndex = 0),
  18592. (e._zIndex = 0),
  18593. (e.filterArea = null),
  18594. (e.filters = null),
  18595. (e._enabledFilters = null),
  18596. (e._bounds = new kD()),
  18597. (e._localBounds = null),
  18598. (e._boundsID = 0),
  18599. (e._boundsRect = null),
  18600. (e._localBoundsRect = null),
  18601. (e._mask = null),
  18602. (e._maskRefCount = 0),
  18603. (e._destroyed = !1),
  18604. (e.isSprite = !1),
  18605. (e.isMask = !1),
  18606. e
  18607. );
  18608. }
  18609. return (
  18610. GD(e, t),
  18611. (e.mixin = function (t) {
  18612. for (var r = Object.keys(t), n = 0; n < r.length; ++n) {
  18613. var i = r[n];
  18614. Object.defineProperty(
  18615. e.prototype,
  18616. i,
  18617. Object.getOwnPropertyDescriptor(t, i)
  18618. );
  18619. }
  18620. }),
  18621. Object.defineProperty(e.prototype, 'destroyed', {
  18622. get: function () {
  18623. return this._destroyed;
  18624. },
  18625. enumerable: !1,
  18626. configurable: !0,
  18627. }),
  18628. (e.prototype._recursivePostUpdateTransform = function () {
  18629. this.parent
  18630. ? (this.parent._recursivePostUpdateTransform(),
  18631. this.transform.updateTransform(this.parent.transform))
  18632. : this.transform.updateTransform(
  18633. this._tempDisplayObjectParent.transform
  18634. );
  18635. }),
  18636. (e.prototype.updateTransform = function () {
  18637. this._boundsID++,
  18638. this.transform.updateTransform(this.parent.transform),
  18639. (this.worldAlpha = this.alpha * this.parent.worldAlpha);
  18640. }),
  18641. (e.prototype.getBounds = function (t, e) {
  18642. return (
  18643. t ||
  18644. (this.parent
  18645. ? (this._recursivePostUpdateTransform(), this.updateTransform())
  18646. : ((this.parent = this._tempDisplayObjectParent),
  18647. this.updateTransform(),
  18648. (this.parent = null))),
  18649. this._bounds.updateID !== this._boundsID &&
  18650. (this.calculateBounds(),
  18651. (this._bounds.updateID = this._boundsID)),
  18652. e ||
  18653. (this._boundsRect || (this._boundsRect = new TD()),
  18654. (e = this._boundsRect)),
  18655. this._bounds.getRectangle(e)
  18656. );
  18657. }),
  18658. (e.prototype.getLocalBounds = function (t) {
  18659. t ||
  18660. (this._localBoundsRect || (this._localBoundsRect = new TD()),
  18661. (t = this._localBoundsRect)),
  18662. this._localBounds || (this._localBounds = new kD());
  18663. var e = this.transform,
  18664. r = this.parent;
  18665. (this.parent = null),
  18666. (this.transform = this._tempDisplayObjectParent.transform);
  18667. var n = this._bounds,
  18668. i = this._boundsID;
  18669. this._bounds = this._localBounds;
  18670. var o = this.getBounds(!1, t);
  18671. return (
  18672. (this.parent = r),
  18673. (this.transform = e),
  18674. (this._bounds = n),
  18675. (this._bounds.updateID += this._boundsID - i),
  18676. o
  18677. );
  18678. }),
  18679. (e.prototype.toGlobal = function (t, e, r) {
  18680. return (
  18681. void 0 === r && (r = !1),
  18682. r ||
  18683. (this._recursivePostUpdateTransform(),
  18684. this.parent
  18685. ? this.displayObjectUpdateTransform()
  18686. : ((this.parent = this._tempDisplayObjectParent),
  18687. this.displayObjectUpdateTransform(),
  18688. (this.parent = null))),
  18689. this.worldTransform.apply(t, e)
  18690. );
  18691. }),
  18692. (e.prototype.toLocal = function (t, e, r, n) {
  18693. return (
  18694. e && (t = e.toGlobal(t, r, n)),
  18695. n ||
  18696. (this._recursivePostUpdateTransform(),
  18697. this.parent
  18698. ? this.displayObjectUpdateTransform()
  18699. : ((this.parent = this._tempDisplayObjectParent),
  18700. this.displayObjectUpdateTransform(),
  18701. (this.parent = null))),
  18702. this.worldTransform.applyInverse(t, r)
  18703. );
  18704. }),
  18705. (e.prototype.setParent = function (t) {
  18706. if (!t || !t.addChild)
  18707. throw new Error('setParent: Argument must be a Container');
  18708. return t.addChild(this), t;
  18709. }),
  18710. (e.prototype.setTransform = function (t, e, r, n, i, o, s, a, u) {
  18711. return (
  18712. void 0 === t && (t = 0),
  18713. void 0 === e && (e = 0),
  18714. void 0 === r && (r = 1),
  18715. void 0 === n && (n = 1),
  18716. void 0 === i && (i = 0),
  18717. void 0 === o && (o = 0),
  18718. void 0 === s && (s = 0),
  18719. void 0 === a && (a = 0),
  18720. void 0 === u && (u = 0),
  18721. (this.position.x = t),
  18722. (this.position.y = e),
  18723. (this.scale.x = r || 1),
  18724. (this.scale.y = n || 1),
  18725. (this.rotation = i),
  18726. (this.skew.x = o),
  18727. (this.skew.y = s),
  18728. (this.pivot.x = a),
  18729. (this.pivot.y = u),
  18730. this
  18731. );
  18732. }),
  18733. (e.prototype.destroy = function (t) {
  18734. this.parent && this.parent.removeChild(this),
  18735. (this._destroyed = !0),
  18736. (this.transform = null),
  18737. (this.parent = null),
  18738. (this._bounds = null),
  18739. (this.mask = null),
  18740. (this.cullArea = null),
  18741. (this.filters = null),
  18742. (this.filterArea = null),
  18743. (this.hitArea = null),
  18744. (this.interactive = !1),
  18745. (this.interactiveChildren = !1),
  18746. this.emit('destroyed'),
  18747. this.removeAllListeners();
  18748. }),
  18749. Object.defineProperty(e.prototype, '_tempDisplayObjectParent', {
  18750. get: function () {
  18751. return (
  18752. null === this.tempDisplayObjectParent &&
  18753. (this.tempDisplayObjectParent = new jD()),
  18754. this.tempDisplayObjectParent
  18755. );
  18756. },
  18757. enumerable: !1,
  18758. configurable: !0,
  18759. }),
  18760. (e.prototype.enableTempParent = function () {
  18761. var t = this.parent;
  18762. return (this.parent = this._tempDisplayObjectParent), t;
  18763. }),
  18764. (e.prototype.disableTempParent = function (t) {
  18765. this.parent = t;
  18766. }),
  18767. Object.defineProperty(e.prototype, 'x', {
  18768. get: function () {
  18769. return this.position.x;
  18770. },
  18771. set: function (t) {
  18772. this.transform.position.x = t;
  18773. },
  18774. enumerable: !1,
  18775. configurable: !0,
  18776. }),
  18777. Object.defineProperty(e.prototype, 'y', {
  18778. get: function () {
  18779. return this.position.y;
  18780. },
  18781. set: function (t) {
  18782. this.transform.position.y = t;
  18783. },
  18784. enumerable: !1,
  18785. configurable: !0,
  18786. }),
  18787. Object.defineProperty(e.prototype, 'worldTransform', {
  18788. get: function () {
  18789. return this.transform.worldTransform;
  18790. },
  18791. enumerable: !1,
  18792. configurable: !0,
  18793. }),
  18794. Object.defineProperty(e.prototype, 'localTransform', {
  18795. get: function () {
  18796. return this.transform.localTransform;
  18797. },
  18798. enumerable: !1,
  18799. configurable: !0,
  18800. }),
  18801. Object.defineProperty(e.prototype, 'position', {
  18802. get: function () {
  18803. return this.transform.position;
  18804. },
  18805. set: function (t) {
  18806. this.transform.position.copyFrom(t);
  18807. },
  18808. enumerable: !1,
  18809. configurable: !0,
  18810. }),
  18811. Object.defineProperty(e.prototype, 'scale', {
  18812. get: function () {
  18813. return this.transform.scale;
  18814. },
  18815. set: function (t) {
  18816. this.transform.scale.copyFrom(t);
  18817. },
  18818. enumerable: !1,
  18819. configurable: !0,
  18820. }),
  18821. Object.defineProperty(e.prototype, 'pivot', {
  18822. get: function () {
  18823. return this.transform.pivot;
  18824. },
  18825. set: function (t) {
  18826. this.transform.pivot.copyFrom(t);
  18827. },
  18828. enumerable: !1,
  18829. configurable: !0,
  18830. }),
  18831. Object.defineProperty(e.prototype, 'skew', {
  18832. get: function () {
  18833. return this.transform.skew;
  18834. },
  18835. set: function (t) {
  18836. this.transform.skew.copyFrom(t);
  18837. },
  18838. enumerable: !1,
  18839. configurable: !0,
  18840. }),
  18841. Object.defineProperty(e.prototype, 'rotation', {
  18842. get: function () {
  18843. return this.transform.rotation;
  18844. },
  18845. set: function (t) {
  18846. this.transform.rotation = t;
  18847. },
  18848. enumerable: !1,
  18849. configurable: !0,
  18850. }),
  18851. Object.defineProperty(e.prototype, 'angle', {
  18852. get: function () {
  18853. return this.transform.rotation * yD;
  18854. },
  18855. set: function (t) {
  18856. this.transform.rotation = t * gD;
  18857. },
  18858. enumerable: !1,
  18859. configurable: !0,
  18860. }),
  18861. Object.defineProperty(e.prototype, 'zIndex', {
  18862. get: function () {
  18863. return this._zIndex;
  18864. },
  18865. set: function (t) {
  18866. (this._zIndex = t), this.parent && (this.parent.sortDirty = !0);
  18867. },
  18868. enumerable: !1,
  18869. configurable: !0,
  18870. }),
  18871. Object.defineProperty(e.prototype, 'worldVisible', {
  18872. get: function () {
  18873. var t = this;
  18874. do {
  18875. if (!t.visible) return !1;
  18876. t = t.parent;
  18877. } while (t);
  18878. return !0;
  18879. },
  18880. enumerable: !1,
  18881. configurable: !0,
  18882. }),
  18883. Object.defineProperty(e.prototype, 'mask', {
  18884. get: function () {
  18885. return this._mask;
  18886. },
  18887. set: function (t) {
  18888. if (this._mask !== t) {
  18889. var e;
  18890. if (this._mask)
  18891. (e = this._mask.isMaskData
  18892. ? this._mask.maskObject
  18893. : this._mask) &&
  18894. (e._maskRefCount--,
  18895. 0 === e._maskRefCount &&
  18896. ((e.renderable = !0), (e.isMask = !1)));
  18897. if (((this._mask = t), this._mask))
  18898. (e = this._mask.isMaskData
  18899. ? this._mask.maskObject
  18900. : this._mask) &&
  18901. (0 === e._maskRefCount &&
  18902. ((e.renderable = !1), (e.isMask = !0)),
  18903. e._maskRefCount++);
  18904. }
  18905. },
  18906. enumerable: !1,
  18907. configurable: !0,
  18908. }),
  18909. e
  18910. );
  18911. })(yA),
  18912. jD = (function (t) {
  18913. function e() {
  18914. var e = (null !== t && t.apply(this, arguments)) || this;
  18915. return (e.sortDirty = null), e;
  18916. }
  18917. return GD(e, t), e;
  18918. })(UD);
  18919. function XD(t, e) {
  18920. return t.zIndex === e.zIndex
  18921. ? t._lastSortedIndex - e._lastSortedIndex
  18922. : t.zIndex - e.zIndex;
  18923. }
  18924. UD.prototype.displayObjectUpdateTransform = UD.prototype.updateTransform;
  18925. var VD = (function (t) {
  18926. function e() {
  18927. var e = t.call(this) || this;
  18928. return (
  18929. (e.children = []),
  18930. (e.sortableChildren = vA.SORTABLE_CHILDREN),
  18931. (e.sortDirty = !1),
  18932. e
  18933. );
  18934. }
  18935. return (
  18936. GD(e, t),
  18937. (e.prototype.onChildrenChange = function (t) {}),
  18938. (e.prototype.addChild = function () {
  18939. for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
  18940. e[r] = t[r];
  18941. if (e.length > 1)
  18942. for (var n = 0; n < e.length; n++) this.addChild(e[n]);
  18943. else {
  18944. var i = e[0];
  18945. i.parent && i.parent.removeChild(i),
  18946. (i.parent = this),
  18947. (this.sortDirty = !0),
  18948. (i.transform._parentID = -1),
  18949. this.children.push(i),
  18950. this._boundsID++,
  18951. this.onChildrenChange(this.children.length - 1),
  18952. this.emit('childAdded', i, this, this.children.length - 1),
  18953. i.emit('added', this);
  18954. }
  18955. return e[0];
  18956. }),
  18957. (e.prototype.addChildAt = function (t, e) {
  18958. if (e < 0 || e > this.children.length)
  18959. throw new Error(
  18960. t +
  18961. 'addChildAt: The index ' +
  18962. e +
  18963. ' supplied is out of bounds ' +
  18964. this.children.length
  18965. );
  18966. return (
  18967. t.parent && t.parent.removeChild(t),
  18968. (t.parent = this),
  18969. (this.sortDirty = !0),
  18970. (t.transform._parentID = -1),
  18971. this.children.splice(e, 0, t),
  18972. this._boundsID++,
  18973. this.onChildrenChange(e),
  18974. t.emit('added', this),
  18975. this.emit('childAdded', t, this, e),
  18976. t
  18977. );
  18978. }),
  18979. (e.prototype.swapChildren = function (t, e) {
  18980. if (t !== e) {
  18981. var r = this.getChildIndex(t),
  18982. n = this.getChildIndex(e);
  18983. (this.children[r] = e),
  18984. (this.children[n] = t),
  18985. this.onChildrenChange(r < n ? r : n);
  18986. }
  18987. }),
  18988. (e.prototype.getChildIndex = function (t) {
  18989. var e = this.children.indexOf(t);
  18990. if (-1 === e)
  18991. throw new Error(
  18992. 'The supplied DisplayObject must be a child of the caller'
  18993. );
  18994. return e;
  18995. }),
  18996. (e.prototype.setChildIndex = function (t, e) {
  18997. if (e < 0 || e >= this.children.length)
  18998. throw new Error(
  18999. 'The index ' +
  19000. e +
  19001. ' supplied is out of bounds ' +
  19002. this.children.length
  19003. );
  19004. var r = this.getChildIndex(t);
  19005. rD(this.children, r, 1),
  19006. this.children.splice(e, 0, t),
  19007. this.onChildrenChange(e);
  19008. }),
  19009. (e.prototype.getChildAt = function (t) {
  19010. if (t < 0 || t >= this.children.length)
  19011. throw new Error('getChildAt: Index (' + t + ') does not exist.');
  19012. return this.children[t];
  19013. }),
  19014. (e.prototype.removeChild = function () {
  19015. for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
  19016. e[r] = t[r];
  19017. if (e.length > 1)
  19018. for (var n = 0; n < e.length; n++) this.removeChild(e[n]);
  19019. else {
  19020. var i = e[0],
  19021. o = this.children.indexOf(i);
  19022. if (-1 === o) return null;
  19023. (i.parent = null),
  19024. (i.transform._parentID = -1),
  19025. rD(this.children, o, 1),
  19026. this._boundsID++,
  19027. this.onChildrenChange(o),
  19028. i.emit('removed', this),
  19029. this.emit('childRemoved', i, this, o);
  19030. }
  19031. return e[0];
  19032. }),
  19033. (e.prototype.removeChildAt = function (t) {
  19034. var e = this.getChildAt(t);
  19035. return (
  19036. (e.parent = null),
  19037. (e.transform._parentID = -1),
  19038. rD(this.children, t, 1),
  19039. this._boundsID++,
  19040. this.onChildrenChange(t),
  19041. e.emit('removed', this),
  19042. this.emit('childRemoved', e, this, t),
  19043. e
  19044. );
  19045. }),
  19046. (e.prototype.removeChildren = function (t, e) {
  19047. void 0 === t && (t = 0), void 0 === e && (e = this.children.length);
  19048. var r,
  19049. n = t,
  19050. i = e - n;
  19051. if (i > 0 && i <= e) {
  19052. r = this.children.splice(n, i);
  19053. for (var o = 0; o < r.length; ++o)
  19054. (r[o].parent = null),
  19055. r[o].transform && (r[o].transform._parentID = -1);
  19056. this._boundsID++, this.onChildrenChange(t);
  19057. for (o = 0; o < r.length; ++o)
  19058. r[o].emit('removed', this),
  19059. this.emit('childRemoved', r[o], this, o);
  19060. return r;
  19061. }
  19062. if (0 === i && 0 === this.children.length) return [];
  19063. throw new RangeError(
  19064. 'removeChildren: numeric values are outside the acceptable range.'
  19065. );
  19066. }),
  19067. (e.prototype.sortChildren = function () {
  19068. for (var t = !1, e = 0, r = this.children.length; e < r; ++e) {
  19069. var n = this.children[e];
  19070. (n._lastSortedIndex = e), t || 0 === n.zIndex || (t = !0);
  19071. }
  19072. t && this.children.length > 1 && this.children.sort(XD),
  19073. (this.sortDirty = !1);
  19074. }),
  19075. (e.prototype.updateTransform = function () {
  19076. this.sortableChildren && this.sortDirty && this.sortChildren(),
  19077. this._boundsID++,
  19078. this.transform.updateTransform(this.parent.transform),
  19079. (this.worldAlpha = this.alpha * this.parent.worldAlpha);
  19080. for (var t = 0, e = this.children.length; t < e; ++t) {
  19081. var r = this.children[t];
  19082. r.visible && r.updateTransform();
  19083. }
  19084. }),
  19085. (e.prototype.calculateBounds = function () {
  19086. this._bounds.clear(), this._calculateBounds();
  19087. for (var t = 0; t < this.children.length; t++) {
  19088. var e = this.children[t];
  19089. if (e.visible && e.renderable)
  19090. if ((e.calculateBounds(), e._mask)) {
  19091. var r = e._mask.isMaskData ? e._mask.maskObject : e._mask;
  19092. r
  19093. ? (r.calculateBounds(),
  19094. this._bounds.addBoundsMask(e._bounds, r._bounds))
  19095. : this._bounds.addBounds(e._bounds);
  19096. } else
  19097. e.filterArea
  19098. ? this._bounds.addBoundsArea(e._bounds, e.filterArea)
  19099. : this._bounds.addBounds(e._bounds);
  19100. }
  19101. this._bounds.updateID = this._boundsID;
  19102. }),
  19103. (e.prototype.getLocalBounds = function (e, r) {
  19104. void 0 === r && (r = !1);
  19105. var n = t.prototype.getLocalBounds.call(this, e);
  19106. if (!r)
  19107. for (var i = 0, o = this.children.length; i < o; ++i) {
  19108. var s = this.children[i];
  19109. s.visible && s.updateTransform();
  19110. }
  19111. return n;
  19112. }),
  19113. (e.prototype._calculateBounds = function () {}),
  19114. (e.prototype._renderWithCulling = function (t) {
  19115. var r = t.renderTexture.sourceFrame;
  19116. if (r.width > 0 && r.height > 0) {
  19117. var n, i;
  19118. if (
  19119. (this.cullArea
  19120. ? ((n = this.cullArea), (i = this.worldTransform))
  19121. : this._render !== e.prototype._render &&
  19122. (n = this.getBounds(!0)),
  19123. n && r.intersects(n, i))
  19124. )
  19125. this._render(t);
  19126. else if (this.cullArea) return;
  19127. for (var o = 0, s = this.children.length; o < s; ++o) {
  19128. var a = this.children[o],
  19129. u = a.cullable;
  19130. (a.cullable = u || !this.cullArea), a.render(t), (a.cullable = u);
  19131. }
  19132. }
  19133. }),
  19134. (e.prototype.render = function (t) {
  19135. if (this.visible && !(this.worldAlpha <= 0) && this.renderable)
  19136. if (this._mask || (this.filters && this.filters.length))
  19137. this.renderAdvanced(t);
  19138. else if (this.cullable) this._renderWithCulling(t);
  19139. else {
  19140. this._render(t);
  19141. for (var e = 0, r = this.children.length; e < r; ++e)
  19142. this.children[e].render(t);
  19143. }
  19144. }),
  19145. (e.prototype.renderAdvanced = function (t) {
  19146. var e = this.filters,
  19147. r = this._mask;
  19148. if (e) {
  19149. this._enabledFilters || (this._enabledFilters = []),
  19150. (this._enabledFilters.length = 0);
  19151. for (var n = 0; n < e.length; n++)
  19152. e[n].enabled && this._enabledFilters.push(e[n]);
  19153. }
  19154. var i =
  19155. (e && this._enabledFilters && this._enabledFilters.length) ||
  19156. (r &&
  19157. (!r.isMaskData ||
  19158. (r.enabled && (r.autoDetect || r.type !== VP.NONE))));
  19159. if (
  19160. (i && t.batch.flush(),
  19161. e &&
  19162. this._enabledFilters &&
  19163. this._enabledFilters.length &&
  19164. t.filter.push(this, this._enabledFilters),
  19165. r && t.mask.push(this, this._mask),
  19166. this.cullable)
  19167. )
  19168. this._renderWithCulling(t);
  19169. else {
  19170. this._render(t);
  19171. n = 0;
  19172. for (var o = this.children.length; n < o; ++n)
  19173. this.children[n].render(t);
  19174. }
  19175. i && t.batch.flush(),
  19176. r && t.mask.pop(this),
  19177. e &&
  19178. this._enabledFilters &&
  19179. this._enabledFilters.length &&
  19180. t.filter.pop();
  19181. }),
  19182. (e.prototype._render = function (t) {}),
  19183. (e.prototype.destroy = function (e) {
  19184. t.prototype.destroy.call(this), (this.sortDirty = !1);
  19185. var r = 'boolean' == typeof e ? e : e && e.children,
  19186. n = this.removeChildren(0, this.children.length);
  19187. if (r) for (var i = 0; i < n.length; ++i) n[i].destroy(e);
  19188. }),
  19189. Object.defineProperty(e.prototype, 'width', {
  19190. get: function () {
  19191. return this.scale.x * this.getLocalBounds().width;
  19192. },
  19193. set: function (t) {
  19194. var e = this.getLocalBounds().width;
  19195. (this.scale.x = 0 !== e ? t / e : 1), (this._width = t);
  19196. },
  19197. enumerable: !1,
  19198. configurable: !0,
  19199. }),
  19200. Object.defineProperty(e.prototype, 'height', {
  19201. get: function () {
  19202. return this.scale.y * this.getLocalBounds().height;
  19203. },
  19204. set: function (t) {
  19205. var e = this.getLocalBounds().height;
  19206. (this.scale.y = 0 !== e ? t / e : 1), (this._height = t);
  19207. },
  19208. enumerable: !1,
  19209. configurable: !0,
  19210. }),
  19211. e
  19212. );
  19213. })(UD);
  19214. VD.prototype.containerUpdateTransform = VD.prototype.updateTransform;
  19215. var HD,
  19216. WD = function () {
  19217. return (
  19218. (WD =
  19219. Object.assign ||
  19220. function (t) {
  19221. for (var e, r = arguments, n = 1, i = arguments.length; n < i; n++)
  19222. for (var o in (e = r[n]))
  19223. Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
  19224. return t;
  19225. }),
  19226. WD.apply(this, arguments)
  19227. );
  19228. };
  19229. !(function (t) {
  19230. (t.Application = 'application'),
  19231. (t.RendererPlugin = 'renderer-webgl-plugin'),
  19232. (t.CanvasRendererPlugin = 'renderer-canvas-plugin'),
  19233. (t.Loader = 'loader'),
  19234. (t.LoadParser = 'load-parser'),
  19235. (t.ResolveParser = 'resolve-parser'),
  19236. (t.CacheParser = 'cache-parser'),
  19237. (t.DetectionParser = 'detection-parser');
  19238. })(HD || (HD = {}));
  19239. var YD,
  19240. zD = function (t) {
  19241. if ('function' == typeof t || ('object' == typeof t && t.extension)) {
  19242. if (!t.extension)
  19243. throw new Error('Extension class must have an extension object');
  19244. var e =
  19245. 'object' != typeof t.extension ? { type: t.extension } : t.extension;
  19246. t = WD(WD({}, e), { ref: t });
  19247. }
  19248. if ('object' != typeof t) throw new Error('Invalid extension type');
  19249. return 'string' == typeof (t = WD({}, t)).type && (t.type = [t.type]), t;
  19250. },
  19251. ZD = {
  19252. _addHandlers: null,
  19253. _removeHandlers: null,
  19254. _queue: {},
  19255. remove: function () {
  19256. for (
  19257. var t = arguments, e = this, r = [], n = 0;
  19258. n < arguments.length;
  19259. n++
  19260. )
  19261. r[n] = t[n];
  19262. return (
  19263. r.map(zD).forEach(function (t) {
  19264. t.type.forEach(function (r) {
  19265. var n, i;
  19266. return null === (i = (n = e._removeHandlers)[r]) || void 0 === i
  19267. ? void 0
  19268. : i.call(n, t);
  19269. });
  19270. }),
  19271. this
  19272. );
  19273. },
  19274. add: function () {
  19275. for (
  19276. var t = arguments, e = this, r = [], n = 0;
  19277. n < arguments.length;
  19278. n++
  19279. )
  19280. r[n] = t[n];
  19281. return (
  19282. r.map(zD).forEach(function (t) {
  19283. t.type.forEach(function (r) {
  19284. var n = e._addHandlers,
  19285. i = e._queue;
  19286. n[r] ? n[r](t) : ((i[r] = i[r] || []), i[r].push(t));
  19287. });
  19288. }),
  19289. this
  19290. );
  19291. },
  19292. handle: function (t, e, r) {
  19293. var n = (this._addHandlers = this._addHandlers || {}),
  19294. i = (this._removeHandlers = this._removeHandlers || {});
  19295. if (n[t] || i[t])
  19296. throw new Error('Extension type ' + t + ' already has a handler');
  19297. (n[t] = e), (i[t] = r);
  19298. var o = this._queue;
  19299. return (
  19300. o[t] &&
  19301. (o[t].forEach(function (t) {
  19302. return e(t);
  19303. }),
  19304. delete o[t]),
  19305. this
  19306. );
  19307. },
  19308. handleByMap: function (t, e) {
  19309. return this.handle(
  19310. t,
  19311. function (t) {
  19312. e[t.name] = t.ref;
  19313. },
  19314. function (t) {
  19315. delete e[t.name];
  19316. }
  19317. );
  19318. },
  19319. handleByList: function (t, e) {
  19320. return this.handle(
  19321. t,
  19322. function (r) {
  19323. var n, i;
  19324. e.includes(r.ref) ||
  19325. (e.push(r.ref),
  19326. t === HD.Loader &&
  19327. (null === (i = (n = r.ref).add) || void 0 === i || i.call(n)));
  19328. },
  19329. function (t) {
  19330. var r = e.indexOf(t.ref);
  19331. -1 !== r && e.splice(r, 1);
  19332. }
  19333. );
  19334. },
  19335. },
  19336. JD = (function () {
  19337. function t(t) {
  19338. (this.items = []), (this._name = t), (this._aliasCount = 0);
  19339. }
  19340. return (
  19341. (t.prototype.emit = function (t, e, r, n, i, o, s, a) {
  19342. if (arguments.length > 8) throw new Error('max arguments reached');
  19343. var u = this,
  19344. c = u.name,
  19345. h = u.items;
  19346. this._aliasCount++;
  19347. for (var l = 0, d = h.length; l < d; l++)
  19348. h[l][c](t, e, r, n, i, o, s, a);
  19349. return h === this.items && this._aliasCount--, this;
  19350. }),
  19351. (t.prototype.ensureNonAliasedItems = function () {
  19352. this._aliasCount > 0 &&
  19353. this.items.length > 1 &&
  19354. ((this._aliasCount = 0), (this.items = this.items.slice(0)));
  19355. }),
  19356. (t.prototype.add = function (t) {
  19357. return (
  19358. t[this._name] &&
  19359. (this.ensureNonAliasedItems(),
  19360. this.remove(t),
  19361. this.items.push(t)),
  19362. this
  19363. );
  19364. }),
  19365. (t.prototype.remove = function (t) {
  19366. var e = this.items.indexOf(t);
  19367. return (
  19368. -1 !== e && (this.ensureNonAliasedItems(), this.items.splice(e, 1)),
  19369. this
  19370. );
  19371. }),
  19372. (t.prototype.contains = function (t) {
  19373. return -1 !== this.items.indexOf(t);
  19374. }),
  19375. (t.prototype.removeAll = function () {
  19376. return this.ensureNonAliasedItems(), (this.items.length = 0), this;
  19377. }),
  19378. (t.prototype.destroy = function () {
  19379. this.removeAll(), (this.items = null), (this._name = null);
  19380. }),
  19381. Object.defineProperty(t.prototype, 'empty', {
  19382. get: function () {
  19383. return 0 === this.items.length;
  19384. },
  19385. enumerable: !1,
  19386. configurable: !0,
  19387. }),
  19388. Object.defineProperty(t.prototype, 'name', {
  19389. get: function () {
  19390. return this._name;
  19391. },
  19392. enumerable: !1,
  19393. configurable: !0,
  19394. }),
  19395. t
  19396. );
  19397. })();
  19398. Object.defineProperties(JD.prototype, {
  19399. dispatch: { value: JD.prototype.emit },
  19400. run: { value: JD.prototype.emit },
  19401. }),
  19402. (vA.TARGET_FPMS = 0.06),
  19403. (function (t) {
  19404. (t[(t.INTERACTION = 50)] = 'INTERACTION'),
  19405. (t[(t.HIGH = 25)] = 'HIGH'),
  19406. (t[(t.NORMAL = 0)] = 'NORMAL'),
  19407. (t[(t.LOW = -25)] = 'LOW'),
  19408. (t[(t.UTILITY = -50)] = 'UTILITY');
  19409. })(YD || (YD = {}));
  19410. var KD = (function () {
  19411. function t(t, e, r, n) {
  19412. void 0 === e && (e = null),
  19413. void 0 === r && (r = 0),
  19414. void 0 === n && (n = !1),
  19415. (this.next = null),
  19416. (this.previous = null),
  19417. (this._destroyed = !1),
  19418. (this.fn = t),
  19419. (this.context = e),
  19420. (this.priority = r),
  19421. (this.once = n);
  19422. }
  19423. return (
  19424. (t.prototype.match = function (t, e) {
  19425. return (
  19426. void 0 === e && (e = null), this.fn === t && this.context === e
  19427. );
  19428. }),
  19429. (t.prototype.emit = function (t) {
  19430. this.fn &&
  19431. (this.context ? this.fn.call(this.context, t) : this.fn(t));
  19432. var e = this.next;
  19433. return (
  19434. this.once && this.destroy(!0),
  19435. this._destroyed && (this.next = null),
  19436. e
  19437. );
  19438. }),
  19439. (t.prototype.connect = function (t) {
  19440. (this.previous = t),
  19441. t.next && (t.next.previous = this),
  19442. (this.next = t.next),
  19443. (t.next = this);
  19444. }),
  19445. (t.prototype.destroy = function (t) {
  19446. void 0 === t && (t = !1),
  19447. (this._destroyed = !0),
  19448. (this.fn = null),
  19449. (this.context = null),
  19450. this.previous && (this.previous.next = this.next),
  19451. this.next && (this.next.previous = this.previous);
  19452. var e = this.next;
  19453. return (this.next = t ? null : e), (this.previous = null), e;
  19454. }),
  19455. t
  19456. );
  19457. })(),
  19458. qD = (function () {
  19459. function t() {
  19460. var t = this;
  19461. (this.autoStart = !1),
  19462. (this.deltaTime = 1),
  19463. (this.lastTime = -1),
  19464. (this.speed = 1),
  19465. (this.started = !1),
  19466. (this._requestId = null),
  19467. (this._maxElapsedMS = 100),
  19468. (this._minElapsedMS = 0),
  19469. (this._protected = !1),
  19470. (this._lastFrame = -1),
  19471. (this._head = new KD(null, null, 1 / 0)),
  19472. (this.deltaMS = 1 / vA.TARGET_FPMS),
  19473. (this.elapsedMS = 1 / vA.TARGET_FPMS),
  19474. (this._tick = function (e) {
  19475. (t._requestId = null),
  19476. t.started &&
  19477. (t.update(e),
  19478. t.started &&
  19479. null === t._requestId &&
  19480. t._head.next &&
  19481. (t._requestId = requestAnimationFrame(t._tick)));
  19482. });
  19483. }
  19484. return (
  19485. (t.prototype._requestIfNeeded = function () {
  19486. null === this._requestId &&
  19487. this._head.next &&
  19488. ((this.lastTime = performance.now()),
  19489. (this._lastFrame = this.lastTime),
  19490. (this._requestId = requestAnimationFrame(this._tick)));
  19491. }),
  19492. (t.prototype._cancelIfNeeded = function () {
  19493. null !== this._requestId &&
  19494. (cancelAnimationFrame(this._requestId), (this._requestId = null));
  19495. }),
  19496. (t.prototype._startIfPossible = function () {
  19497. this.started
  19498. ? this._requestIfNeeded()
  19499. : this.autoStart && this.start();
  19500. }),
  19501. (t.prototype.add = function (t, e, r) {
  19502. return (
  19503. void 0 === r && (r = YD.NORMAL), this._addListener(new KD(t, e, r))
  19504. );
  19505. }),
  19506. (t.prototype.addOnce = function (t, e, r) {
  19507. return (
  19508. void 0 === r && (r = YD.NORMAL),
  19509. this._addListener(new KD(t, e, r, !0))
  19510. );
  19511. }),
  19512. (t.prototype._addListener = function (t) {
  19513. var e = this._head.next,
  19514. r = this._head;
  19515. if (e) {
  19516. for (; e; ) {
  19517. if (t.priority > e.priority) {
  19518. t.connect(r);
  19519. break;
  19520. }
  19521. (r = e), (e = e.next);
  19522. }
  19523. t.previous || t.connect(r);
  19524. } else t.connect(r);
  19525. return this._startIfPossible(), this;
  19526. }),
  19527. (t.prototype.remove = function (t, e) {
  19528. for (var r = this._head.next; r; )
  19529. r = r.match(t, e) ? r.destroy() : r.next;
  19530. return this._head.next || this._cancelIfNeeded(), this;
  19531. }),
  19532. Object.defineProperty(t.prototype, 'count', {
  19533. get: function () {
  19534. if (!this._head) return 0;
  19535. for (var t = 0, e = this._head; (e = e.next); ) t++;
  19536. return t;
  19537. },
  19538. enumerable: !1,
  19539. configurable: !0,
  19540. }),
  19541. (t.prototype.start = function () {
  19542. this.started || ((this.started = !0), this._requestIfNeeded());
  19543. }),
  19544. (t.prototype.stop = function () {
  19545. this.started && ((this.started = !1), this._cancelIfNeeded());
  19546. }),
  19547. (t.prototype.destroy = function () {
  19548. if (!this._protected) {
  19549. this.stop();
  19550. for (var t = this._head.next; t; ) t = t.destroy(!0);
  19551. this._head.destroy(), (this._head = null);
  19552. }
  19553. }),
  19554. (t.prototype.update = function (t) {
  19555. var e;
  19556. if ((void 0 === t && (t = performance.now()), t > this.lastTime)) {
  19557. if (
  19558. ((e = this.elapsedMS = t - this.lastTime) > this._maxElapsedMS &&
  19559. (e = this._maxElapsedMS),
  19560. (e *= this.speed),
  19561. this._minElapsedMS)
  19562. ) {
  19563. var r = (t - this._lastFrame) | 0;
  19564. if (r < this._minElapsedMS) return;
  19565. this._lastFrame = t - (r % this._minElapsedMS);
  19566. }
  19567. (this.deltaMS = e),
  19568. (this.deltaTime = this.deltaMS * vA.TARGET_FPMS);
  19569. for (var n = this._head, i = n.next; i; )
  19570. i = i.emit(this.deltaTime);
  19571. n.next || this._cancelIfNeeded();
  19572. } else this.deltaTime = this.deltaMS = this.elapsedMS = 0;
  19573. this.lastTime = t;
  19574. }),
  19575. Object.defineProperty(t.prototype, 'FPS', {
  19576. get: function () {
  19577. return 1e3 / this.elapsedMS;
  19578. },
  19579. enumerable: !1,
  19580. configurable: !0,
  19581. }),
  19582. Object.defineProperty(t.prototype, 'minFPS', {
  19583. get: function () {
  19584. return 1e3 / this._maxElapsedMS;
  19585. },
  19586. set: function (t) {
  19587. var e = Math.min(this.maxFPS, t),
  19588. r = Math.min(Math.max(0, e) / 1e3, vA.TARGET_FPMS);
  19589. this._maxElapsedMS = 1 / r;
  19590. },
  19591. enumerable: !1,
  19592. configurable: !0,
  19593. }),
  19594. Object.defineProperty(t.prototype, 'maxFPS', {
  19595. get: function () {
  19596. return this._minElapsedMS
  19597. ? Math.round(1e3 / this._minElapsedMS)
  19598. : 0;
  19599. },
  19600. set: function (t) {
  19601. if (0 === t) this._minElapsedMS = 0;
  19602. else {
  19603. var e = Math.max(this.minFPS, t);
  19604. this._minElapsedMS = 1 / (e / 1e3);
  19605. }
  19606. },
  19607. enumerable: !1,
  19608. configurable: !0,
  19609. }),
  19610. Object.defineProperty(t, 'shared', {
  19611. get: function () {
  19612. if (!t._shared) {
  19613. var e = (t._shared = new t());
  19614. (e.autoStart = !0), (e._protected = !0);
  19615. }
  19616. return t._shared;
  19617. },
  19618. enumerable: !1,
  19619. configurable: !0,
  19620. }),
  19621. Object.defineProperty(t, 'system', {
  19622. get: function () {
  19623. if (!t._system) {
  19624. var e = (t._system = new t());
  19625. (e.autoStart = !0), (e._protected = !0);
  19626. }
  19627. return t._system;
  19628. },
  19629. enumerable: !1,
  19630. configurable: !0,
  19631. }),
  19632. t
  19633. );
  19634. })(),
  19635. QD = (function () {
  19636. function t() {}
  19637. return (
  19638. (t.init = function (t) {
  19639. var e = this;
  19640. (t = Object.assign({ autoStart: !0, sharedTicker: !1 }, t)),
  19641. Object.defineProperty(this, 'ticker', {
  19642. set: function (t) {
  19643. this._ticker && this._ticker.remove(this.render, this),
  19644. (this._ticker = t),
  19645. t && t.add(this.render, this, YD.LOW);
  19646. },
  19647. get: function () {
  19648. return this._ticker;
  19649. },
  19650. }),
  19651. (this.stop = function () {
  19652. e._ticker.stop();
  19653. }),
  19654. (this.start = function () {
  19655. e._ticker.start();
  19656. }),
  19657. (this._ticker = null),
  19658. (this.ticker = t.sharedTicker ? qD.shared : new qD()),
  19659. t.autoStart && this.start();
  19660. }),
  19661. (t.destroy = function () {
  19662. if (this._ticker) {
  19663. var t = this._ticker;
  19664. (this.ticker = null), t.destroy();
  19665. }
  19666. }),
  19667. (t.extension = HD.Application),
  19668. t
  19669. );
  19670. })();
  19671. (vA.PREFER_ENV = pA.any ? CP.WEBGL : CP.WEBGL2),
  19672. (vA.STRICT_TEXTURE_CACHE = !1);
  19673. var $D = [];
  19674. function tL(t, e) {
  19675. if (!t) return null;
  19676. var r = '';
  19677. if ('string' == typeof t) {
  19678. var n = /\.(\w{3,4})(?:$|\?|#)/i.exec(t);
  19679. n && (r = n[1].toLowerCase());
  19680. }
  19681. for (var i = $D.length - 1; i >= 0; --i) {
  19682. var o = $D[i];
  19683. if (o.test && o.test(t, r)) return new o(t, e);
  19684. }
  19685. throw new Error('Unrecognized source type to auto-detect Resource');
  19686. }
  19687. var eL = function (t, e) {
  19688. return (
  19689. (eL =
  19690. Object.setPrototypeOf ||
  19691. ({ __proto__: [] } instanceof Array &&
  19692. function (t, e) {
  19693. t.__proto__ = e;
  19694. }) ||
  19695. function (t, e) {
  19696. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  19697. }),
  19698. eL(t, e)
  19699. );
  19700. };
  19701. function rL(t, e) {
  19702. function r() {
  19703. this.constructor = t;
  19704. }
  19705. eL(t, e),
  19706. (t.prototype =
  19707. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  19708. }
  19709. var nL = function () {
  19710. return (
  19711. (nL =
  19712. Object.assign ||
  19713. function (t) {
  19714. for (var e, r = arguments, n = 1, i = arguments.length; n < i; n++)
  19715. for (var o in (e = r[n]))
  19716. Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
  19717. return t;
  19718. }),
  19719. nL.apply(this, arguments)
  19720. );
  19721. };
  19722. var iL = (function () {
  19723. function t(t, e) {
  19724. void 0 === t && (t = 0),
  19725. void 0 === e && (e = 0),
  19726. (this._width = t),
  19727. (this._height = e),
  19728. (this.destroyed = !1),
  19729. (this.internal = !1),
  19730. (this.onResize = new JD('setRealSize')),
  19731. (this.onUpdate = new JD('update')),
  19732. (this.onError = new JD('onError'));
  19733. }
  19734. return (
  19735. (t.prototype.bind = function (t) {
  19736. this.onResize.add(t),
  19737. this.onUpdate.add(t),
  19738. this.onError.add(t),
  19739. (this._width || this._height) &&
  19740. this.onResize.emit(this._width, this._height);
  19741. }),
  19742. (t.prototype.unbind = function (t) {
  19743. this.onResize.remove(t),
  19744. this.onUpdate.remove(t),
  19745. this.onError.remove(t);
  19746. }),
  19747. (t.prototype.resize = function (t, e) {
  19748. (t === this._width && e === this._height) ||
  19749. ((this._width = t), (this._height = e), this.onResize.emit(t, e));
  19750. }),
  19751. Object.defineProperty(t.prototype, 'valid', {
  19752. get: function () {
  19753. return !!this._width && !!this._height;
  19754. },
  19755. enumerable: !1,
  19756. configurable: !0,
  19757. }),
  19758. (t.prototype.update = function () {
  19759. this.destroyed || this.onUpdate.emit();
  19760. }),
  19761. (t.prototype.load = function () {
  19762. return Promise.resolve(this);
  19763. }),
  19764. Object.defineProperty(t.prototype, 'width', {
  19765. get: function () {
  19766. return this._width;
  19767. },
  19768. enumerable: !1,
  19769. configurable: !0,
  19770. }),
  19771. Object.defineProperty(t.prototype, 'height', {
  19772. get: function () {
  19773. return this._height;
  19774. },
  19775. enumerable: !1,
  19776. configurable: !0,
  19777. }),
  19778. (t.prototype.style = function (t, e, r) {
  19779. return !1;
  19780. }),
  19781. (t.prototype.dispose = function () {}),
  19782. (t.prototype.destroy = function () {
  19783. this.destroyed ||
  19784. ((this.destroyed = !0),
  19785. this.dispose(),
  19786. this.onError.removeAll(),
  19787. (this.onError = null),
  19788. this.onResize.removeAll(),
  19789. (this.onResize = null),
  19790. this.onUpdate.removeAll(),
  19791. (this.onUpdate = null));
  19792. }),
  19793. (t.test = function (t, e) {
  19794. return !1;
  19795. }),
  19796. t
  19797. );
  19798. })(),
  19799. oL = (function (t) {
  19800. function e(e, r) {
  19801. var n = this,
  19802. i = r || {},
  19803. o = i.width,
  19804. s = i.height;
  19805. if (!o || !s) throw new Error('BufferResource width or height invalid');
  19806. return ((n = t.call(this, o, s) || this).data = e), n;
  19807. }
  19808. return (
  19809. rL(e, t),
  19810. (e.prototype.upload = function (t, e, r) {
  19811. var n = t.gl;
  19812. n.pixelStorei(
  19813. n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
  19814. e.alphaMode === GP.UNPACK
  19815. );
  19816. var i = e.realWidth,
  19817. o = e.realHeight;
  19818. return (
  19819. r.width === i && r.height === o
  19820. ? n.texSubImage2D(
  19821. e.target,
  19822. 0,
  19823. 0,
  19824. 0,
  19825. i,
  19826. o,
  19827. e.format,
  19828. r.type,
  19829. this.data
  19830. )
  19831. : ((r.width = i),
  19832. (r.height = o),
  19833. n.texImage2D(
  19834. e.target,
  19835. 0,
  19836. r.internalFormat,
  19837. i,
  19838. o,
  19839. 0,
  19840. e.format,
  19841. r.type,
  19842. this.data
  19843. )),
  19844. !0
  19845. );
  19846. }),
  19847. (e.prototype.dispose = function () {
  19848. this.data = null;
  19849. }),
  19850. (e.test = function (t) {
  19851. return (
  19852. t instanceof Float32Array ||
  19853. t instanceof Uint8Array ||
  19854. t instanceof Uint32Array
  19855. );
  19856. }),
  19857. e
  19858. );
  19859. })(iL),
  19860. sL = { scaleMode: NP.NEAREST, format: MP.RGBA, alphaMode: GP.NPM },
  19861. aL = (function (t) {
  19862. function e(e, r) {
  19863. void 0 === e && (e = null), void 0 === r && (r = null);
  19864. var n = t.call(this) || this,
  19865. i = (r = r || {}).alphaMode,
  19866. o = r.mipmap,
  19867. s = r.anisotropicLevel,
  19868. a = r.scaleMode,
  19869. u = r.width,
  19870. c = r.height,
  19871. h = r.wrapMode,
  19872. l = r.format,
  19873. d = r.type,
  19874. f = r.target,
  19875. p = r.resolution,
  19876. v = r.resourceOptions;
  19877. return (
  19878. !e || e instanceof iL || ((e = tL(e, v)).internal = !0),
  19879. (n.resolution = p || vA.RESOLUTION),
  19880. (n.width = Math.round((u || 0) * n.resolution) / n.resolution),
  19881. (n.height = Math.round((c || 0) * n.resolution) / n.resolution),
  19882. (n._mipmap = void 0 !== o ? o : vA.MIPMAP_TEXTURES),
  19883. (n.anisotropicLevel = void 0 !== s ? s : vA.ANISOTROPIC_LEVEL),
  19884. (n._wrapMode = h || vA.WRAP_MODE),
  19885. (n._scaleMode = void 0 !== a ? a : vA.SCALE_MODE),
  19886. (n.format = l || MP.RGBA),
  19887. (n.type = d || LP.UNSIGNED_BYTE),
  19888. (n.target = f || DP.TEXTURE_2D),
  19889. (n.alphaMode = void 0 !== i ? i : GP.UNPACK),
  19890. (n.uid = oD()),
  19891. (n.touched = 0),
  19892. (n.isPowerOfTwo = !1),
  19893. n._refreshPOT(),
  19894. (n._glTextures = {}),
  19895. (n.dirtyId = 0),
  19896. (n.dirtyStyleId = 0),
  19897. (n.cacheId = null),
  19898. (n.valid = u > 0 && c > 0),
  19899. (n.textureCacheIds = []),
  19900. (n.destroyed = !1),
  19901. (n.resource = null),
  19902. (n._batchEnabled = 0),
  19903. (n._batchLocation = 0),
  19904. (n.parentTextureArray = null),
  19905. n.setResource(e),
  19906. n
  19907. );
  19908. }
  19909. return (
  19910. rL(e, t),
  19911. Object.defineProperty(e.prototype, 'realWidth', {
  19912. get: function () {
  19913. return Math.round(this.width * this.resolution);
  19914. },
  19915. enumerable: !1,
  19916. configurable: !0,
  19917. }),
  19918. Object.defineProperty(e.prototype, 'realHeight', {
  19919. get: function () {
  19920. return Math.round(this.height * this.resolution);
  19921. },
  19922. enumerable: !1,
  19923. configurable: !0,
  19924. }),
  19925. Object.defineProperty(e.prototype, 'mipmap', {
  19926. get: function () {
  19927. return this._mipmap;
  19928. },
  19929. set: function (t) {
  19930. this._mipmap !== t && ((this._mipmap = t), this.dirtyStyleId++);
  19931. },
  19932. enumerable: !1,
  19933. configurable: !0,
  19934. }),
  19935. Object.defineProperty(e.prototype, 'scaleMode', {
  19936. get: function () {
  19937. return this._scaleMode;
  19938. },
  19939. set: function (t) {
  19940. this._scaleMode !== t &&
  19941. ((this._scaleMode = t), this.dirtyStyleId++);
  19942. },
  19943. enumerable: !1,
  19944. configurable: !0,
  19945. }),
  19946. Object.defineProperty(e.prototype, 'wrapMode', {
  19947. get: function () {
  19948. return this._wrapMode;
  19949. },
  19950. set: function (t) {
  19951. this._wrapMode !== t && ((this._wrapMode = t), this.dirtyStyleId++);
  19952. },
  19953. enumerable: !1,
  19954. configurable: !0,
  19955. }),
  19956. (e.prototype.setStyle = function (t, e) {
  19957. var r;
  19958. return (
  19959. void 0 !== t &&
  19960. t !== this.scaleMode &&
  19961. ((this.scaleMode = t), (r = !0)),
  19962. void 0 !== e && e !== this.mipmap && ((this.mipmap = e), (r = !0)),
  19963. r && this.dirtyStyleId++,
  19964. this
  19965. );
  19966. }),
  19967. (e.prototype.setSize = function (t, e, r) {
  19968. return (r = r || this.resolution), this.setRealSize(t * r, e * r, r);
  19969. }),
  19970. (e.prototype.setRealSize = function (t, e, r) {
  19971. return (
  19972. (this.resolution = r || this.resolution),
  19973. (this.width = Math.round(t) / this.resolution),
  19974. (this.height = Math.round(e) / this.resolution),
  19975. this._refreshPOT(),
  19976. this.update(),
  19977. this
  19978. );
  19979. }),
  19980. (e.prototype._refreshPOT = function () {
  19981. this.isPowerOfTwo = tD(this.realWidth) && tD(this.realHeight);
  19982. }),
  19983. (e.prototype.setResolution = function (t) {
  19984. var e = this.resolution;
  19985. return (
  19986. e === t ||
  19987. ((this.resolution = t),
  19988. this.valid &&
  19989. ((this.width = Math.round(this.width * e) / t),
  19990. (this.height = Math.round(this.height * e) / t),
  19991. this.emit('update', this)),
  19992. this._refreshPOT()),
  19993. this
  19994. );
  19995. }),
  19996. (e.prototype.setResource = function (t) {
  19997. if (this.resource === t) return this;
  19998. if (this.resource) throw new Error('Resource can be set only once');
  19999. return t.bind(this), (this.resource = t), this;
  20000. }),
  20001. (e.prototype.update = function () {
  20002. this.valid
  20003. ? (this.dirtyId++, this.dirtyStyleId++, this.emit('update', this))
  20004. : this.width > 0 &&
  20005. this.height > 0 &&
  20006. ((this.valid = !0),
  20007. this.emit('loaded', this),
  20008. this.emit('update', this));
  20009. }),
  20010. (e.prototype.onError = function (t) {
  20011. this.emit('error', this, t);
  20012. }),
  20013. (e.prototype.destroy = function () {
  20014. this.resource &&
  20015. (this.resource.unbind(this),
  20016. this.resource.internal && this.resource.destroy(),
  20017. (this.resource = null)),
  20018. this.cacheId &&
  20019. (delete lD[this.cacheId],
  20020. delete hD[this.cacheId],
  20021. (this.cacheId = null)),
  20022. this.dispose(),
  20023. e.removeFromCache(this),
  20024. (this.textureCacheIds = null),
  20025. (this.destroyed = !0);
  20026. }),
  20027. (e.prototype.dispose = function () {
  20028. this.emit('dispose', this);
  20029. }),
  20030. (e.prototype.castToBaseTexture = function () {
  20031. return this;
  20032. }),
  20033. (e.from = function (t, r, n) {
  20034. void 0 === n && (n = vA.STRICT_TEXTURE_CACHE);
  20035. var i = 'string' == typeof t,
  20036. o = null;
  20037. if (i) o = t;
  20038. else {
  20039. if (!t._pixiId) {
  20040. var s = (r && r.pixiIdPrefix) || 'pixiid';
  20041. t._pixiId = s + '_' + oD();
  20042. }
  20043. o = t._pixiId;
  20044. }
  20045. var a = lD[o];
  20046. if (i && n && !a)
  20047. throw new Error(
  20048. 'The cacheId "' + o + '" does not exist in BaseTextureCache.'
  20049. );
  20050. return a || (((a = new e(t, r)).cacheId = o), e.addToCache(a, o)), a;
  20051. }),
  20052. (e.fromBuffer = function (t, r, n, i) {
  20053. t = t || new Float32Array(r * n * 4);
  20054. var o = new oL(t, { width: r, height: n }),
  20055. s = t instanceof Float32Array ? LP.FLOAT : LP.UNSIGNED_BYTE;
  20056. return new e(
  20057. o,
  20058. Object.assign({}, sL, i || { width: r, height: n, type: s })
  20059. );
  20060. }),
  20061. (e.addToCache = function (t, e) {
  20062. e &&
  20063. (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e),
  20064. lD[e] &&
  20065. console.warn(
  20066. 'BaseTexture added to the cache with an id [' +
  20067. e +
  20068. '] that already had an entry'
  20069. ),
  20070. (lD[e] = t));
  20071. }),
  20072. (e.removeFromCache = function (t) {
  20073. if ('string' == typeof t) {
  20074. var e = lD[t];
  20075. if (e) {
  20076. var r = e.textureCacheIds.indexOf(t);
  20077. return r > -1 && e.textureCacheIds.splice(r, 1), delete lD[t], e;
  20078. }
  20079. } else if (t && t.textureCacheIds) {
  20080. for (var n = 0; n < t.textureCacheIds.length; ++n)
  20081. delete lD[t.textureCacheIds[n]];
  20082. return (t.textureCacheIds.length = 0), t;
  20083. }
  20084. return null;
  20085. }),
  20086. (e._globalBatch = 0),
  20087. e
  20088. );
  20089. })(yA),
  20090. uL = (function (t) {
  20091. function e(e, r) {
  20092. var n = this,
  20093. i = r || {},
  20094. o = i.width,
  20095. s = i.height;
  20096. ((n = t.call(this, o, s) || this).items = []), (n.itemDirtyIds = []);
  20097. for (var a = 0; a < e; a++) {
  20098. var u = new aL();
  20099. n.items.push(u), n.itemDirtyIds.push(-2);
  20100. }
  20101. return (n.length = e), (n._load = null), (n.baseTexture = null), n;
  20102. }
  20103. return (
  20104. rL(e, t),
  20105. (e.prototype.initFromArray = function (t, e) {
  20106. for (var r = 0; r < this.length; r++)
  20107. t[r] &&
  20108. (t[r].castToBaseTexture
  20109. ? this.addBaseTextureAt(t[r].castToBaseTexture(), r)
  20110. : t[r] instanceof iL
  20111. ? this.addResourceAt(t[r], r)
  20112. : this.addResourceAt(tL(t[r], e), r));
  20113. }),
  20114. (e.prototype.dispose = function () {
  20115. for (var t = 0, e = this.length; t < e; t++) this.items[t].destroy();
  20116. (this.items = null), (this.itemDirtyIds = null), (this._load = null);
  20117. }),
  20118. (e.prototype.addResourceAt = function (t, e) {
  20119. if (!this.items[e])
  20120. throw new Error('Index ' + e + ' is out of bounds');
  20121. return (
  20122. t.valid && !this.valid && this.resize(t.width, t.height),
  20123. this.items[e].setResource(t),
  20124. this
  20125. );
  20126. }),
  20127. (e.prototype.bind = function (e) {
  20128. if (null !== this.baseTexture)
  20129. throw new Error(
  20130. 'Only one base texture per TextureArray is allowed'
  20131. );
  20132. t.prototype.bind.call(this, e);
  20133. for (var r = 0; r < this.length; r++)
  20134. (this.items[r].parentTextureArray = e),
  20135. this.items[r].on('update', e.update, e);
  20136. }),
  20137. (e.prototype.unbind = function (e) {
  20138. t.prototype.unbind.call(this, e);
  20139. for (var r = 0; r < this.length; r++)
  20140. (this.items[r].parentTextureArray = null),
  20141. this.items[r].off('update', e.update, e);
  20142. }),
  20143. (e.prototype.load = function () {
  20144. var t = this;
  20145. if (this._load) return this._load;
  20146. var e = this.items
  20147. .map(function (t) {
  20148. return t.resource;
  20149. })
  20150. .filter(function (t) {
  20151. return t;
  20152. })
  20153. .map(function (t) {
  20154. return t.load();
  20155. });
  20156. return (
  20157. (this._load = Promise.all(e).then(function () {
  20158. var e = t.items[0],
  20159. r = e.realWidth,
  20160. n = e.realHeight;
  20161. return t.resize(r, n), Promise.resolve(t);
  20162. })),
  20163. this._load
  20164. );
  20165. }),
  20166. e
  20167. );
  20168. })(iL),
  20169. cL = (function (t) {
  20170. function e(e, r) {
  20171. var n,
  20172. i,
  20173. o = this,
  20174. s = r || {},
  20175. a = s.width,
  20176. u = s.height;
  20177. return (
  20178. Array.isArray(e) ? ((n = e), (i = e.length)) : (i = e),
  20179. (o = t.call(this, i, { width: a, height: u }) || this),
  20180. n && o.initFromArray(n, r),
  20181. o
  20182. );
  20183. }
  20184. return (
  20185. rL(e, t),
  20186. (e.prototype.addBaseTextureAt = function (t, e) {
  20187. if (!t.resource)
  20188. throw new Error('ArrayResource does not support RenderTexture');
  20189. return this.addResourceAt(t.resource, e), this;
  20190. }),
  20191. (e.prototype.bind = function (e) {
  20192. t.prototype.bind.call(this, e), (e.target = DP.TEXTURE_2D_ARRAY);
  20193. }),
  20194. (e.prototype.upload = function (t, e, r) {
  20195. var n = this,
  20196. i = n.length,
  20197. o = n.itemDirtyIds,
  20198. s = n.items,
  20199. a = t.gl;
  20200. r.dirtyId < 0 &&
  20201. a.texImage3D(
  20202. a.TEXTURE_2D_ARRAY,
  20203. 0,
  20204. r.internalFormat,
  20205. this._width,
  20206. this._height,
  20207. i,
  20208. 0,
  20209. e.format,
  20210. r.type,
  20211. null
  20212. );
  20213. for (var u = 0; u < i; u++) {
  20214. var c = s[u];
  20215. o[u] < c.dirtyId &&
  20216. ((o[u] = c.dirtyId),
  20217. c.valid &&
  20218. a.texSubImage3D(
  20219. a.TEXTURE_2D_ARRAY,
  20220. 0,
  20221. 0,
  20222. 0,
  20223. u,
  20224. c.resource.width,
  20225. c.resource.height,
  20226. 1,
  20227. e.format,
  20228. r.type,
  20229. c.resource.source
  20230. ));
  20231. }
  20232. return !0;
  20233. }),
  20234. e
  20235. );
  20236. })(uL),
  20237. hL = (function (t) {
  20238. function e(e) {
  20239. var r = this,
  20240. n = e,
  20241. i = n.naturalWidth || n.videoWidth || n.width,
  20242. o = n.naturalHeight || n.videoHeight || n.height;
  20243. return (
  20244. ((r = t.call(this, i, o) || this).source = e), (r.noSubImage = !1), r
  20245. );
  20246. }
  20247. return (
  20248. rL(e, t),
  20249. (e.crossOrigin = function (t, e, r) {
  20250. void 0 === r && 0 !== e.indexOf('data:')
  20251. ? (t.crossOrigin = fD(e))
  20252. : !1 !== r &&
  20253. (t.crossOrigin = 'string' == typeof r ? r : 'anonymous');
  20254. }),
  20255. (e.prototype.upload = function (t, e, r, n) {
  20256. var i = t.gl,
  20257. o = e.realWidth,
  20258. s = e.realHeight;
  20259. if ((n = n || this.source) instanceof HTMLImageElement) {
  20260. if (!n.complete || 0 === n.naturalWidth) return !1;
  20261. } else if (n instanceof HTMLVideoElement && n.readyState <= 1)
  20262. return !1;
  20263. return (
  20264. i.pixelStorei(
  20265. i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
  20266. e.alphaMode === GP.UNPACK
  20267. ),
  20268. this.noSubImage ||
  20269. e.target !== i.TEXTURE_2D ||
  20270. r.width !== o ||
  20271. r.height !== s
  20272. ? ((r.width = o),
  20273. (r.height = s),
  20274. i.texImage2D(
  20275. e.target,
  20276. 0,
  20277. r.internalFormat,
  20278. e.format,
  20279. r.type,
  20280. n
  20281. ))
  20282. : i.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, e.format, r.type, n),
  20283. !0
  20284. );
  20285. }),
  20286. (e.prototype.update = function () {
  20287. if (!this.destroyed) {
  20288. var e = this.source,
  20289. r = e.naturalWidth || e.videoWidth || e.width,
  20290. n = e.naturalHeight || e.videoHeight || e.height;
  20291. this.resize(r, n), t.prototype.update.call(this);
  20292. }
  20293. }),
  20294. (e.prototype.dispose = function () {
  20295. this.source = null;
  20296. }),
  20297. e
  20298. );
  20299. })(iL),
  20300. lL = (function (t) {
  20301. function e(e) {
  20302. return t.call(this, e) || this;
  20303. }
  20304. return (
  20305. rL(e, t),
  20306. (e.test = function (t) {
  20307. var e = globalThis.OffscreenCanvas;
  20308. return (
  20309. !!(e && t instanceof e) ||
  20310. (globalThis.HTMLCanvasElement && t instanceof HTMLCanvasElement)
  20311. );
  20312. }),
  20313. e
  20314. );
  20315. })(hL),
  20316. dL = (function (t) {
  20317. function e(r, n) {
  20318. var i = this,
  20319. o = n || {},
  20320. s = o.width,
  20321. a = o.height,
  20322. u = o.autoLoad,
  20323. c = o.linkBaseTexture;
  20324. if (r && r.length !== e.SIDES)
  20325. throw new Error('Invalid length. Got ' + r.length + ', expected 6');
  20326. i = t.call(this, 6, { width: s, height: a }) || this;
  20327. for (var h = 0; h < e.SIDES; h++)
  20328. i.items[h].target = DP.TEXTURE_CUBE_MAP_POSITIVE_X + h;
  20329. return (
  20330. (i.linkBaseTexture = !1 !== c),
  20331. r && i.initFromArray(r, n),
  20332. !1 !== u && i.load(),
  20333. i
  20334. );
  20335. }
  20336. return (
  20337. rL(e, t),
  20338. (e.prototype.bind = function (e) {
  20339. t.prototype.bind.call(this, e), (e.target = DP.TEXTURE_CUBE_MAP);
  20340. }),
  20341. (e.prototype.addBaseTextureAt = function (t, e, r) {
  20342. if (!this.items[e])
  20343. throw new Error('Index ' + e + ' is out of bounds');
  20344. if (
  20345. !this.linkBaseTexture ||
  20346. t.parentTextureArray ||
  20347. Object.keys(t._glTextures).length > 0
  20348. ) {
  20349. if (!t.resource)
  20350. throw new Error(
  20351. 'CubeResource does not support copying of renderTexture.'
  20352. );
  20353. this.addResourceAt(t.resource, e);
  20354. } else
  20355. (t.target = DP.TEXTURE_CUBE_MAP_POSITIVE_X + e),
  20356. (t.parentTextureArray = this.baseTexture),
  20357. (this.items[e] = t);
  20358. return (
  20359. t.valid && !this.valid && this.resize(t.realWidth, t.realHeight),
  20360. (this.items[e] = t),
  20361. this
  20362. );
  20363. }),
  20364. (e.prototype.upload = function (t, r, n) {
  20365. for (var i = this.itemDirtyIds, o = 0; o < e.SIDES; o++) {
  20366. var s = this.items[o];
  20367. (i[o] < s.dirtyId || n.dirtyId < r.dirtyId) &&
  20368. (s.valid && s.resource
  20369. ? (s.resource.upload(t, s, n), (i[o] = s.dirtyId))
  20370. : i[o] < -1 &&
  20371. (t.gl.texImage2D(
  20372. s.target,
  20373. 0,
  20374. n.internalFormat,
  20375. r.realWidth,
  20376. r.realHeight,
  20377. 0,
  20378. r.format,
  20379. n.type,
  20380. null
  20381. ),
  20382. (i[o] = -1)));
  20383. }
  20384. return !0;
  20385. }),
  20386. (e.test = function (t) {
  20387. return Array.isArray(t) && t.length === e.SIDES;
  20388. }),
  20389. (e.SIDES = 6),
  20390. e
  20391. );
  20392. })(uL),
  20393. fL = (function (t) {
  20394. function e(e, r) {
  20395. var n = this;
  20396. if (((r = r || {}), !(e instanceof HTMLImageElement))) {
  20397. var i = new Image();
  20398. hL.crossOrigin(i, e, r.crossorigin), (i.src = e), (e = i);
  20399. }
  20400. return (
  20401. (n = t.call(this, e) || this),
  20402. !e.complete &&
  20403. n._width &&
  20404. n._height &&
  20405. ((n._width = 0), (n._height = 0)),
  20406. (n.url = e.src),
  20407. (n._process = null),
  20408. (n.preserveBitmap = !1),
  20409. (n.createBitmap =
  20410. (void 0 !== r.createBitmap
  20411. ? r.createBitmap
  20412. : vA.CREATE_IMAGE_BITMAP) && !!globalThis.createImageBitmap),
  20413. (n.alphaMode = 'number' == typeof r.alphaMode ? r.alphaMode : null),
  20414. (n.bitmap = null),
  20415. (n._load = null),
  20416. !1 !== r.autoLoad && n.load(),
  20417. n
  20418. );
  20419. }
  20420. return (
  20421. rL(e, t),
  20422. (e.prototype.load = function (t) {
  20423. var e = this;
  20424. return (
  20425. this._load ||
  20426. (void 0 !== t && (this.createBitmap = t),
  20427. (this._load = new Promise(function (t, r) {
  20428. var n = e.source;
  20429. e.url = n.src;
  20430. var i = function () {
  20431. e.destroyed ||
  20432. ((n.onload = null),
  20433. (n.onerror = null),
  20434. e.resize(n.width, n.height),
  20435. (e._load = null),
  20436. e.createBitmap ? t(e.process()) : t(e));
  20437. };
  20438. n.complete && n.src
  20439. ? i()
  20440. : ((n.onload = i),
  20441. (n.onerror = function (t) {
  20442. r(t), e.onError.emit(t);
  20443. }));
  20444. }))),
  20445. this._load
  20446. );
  20447. }),
  20448. (e.prototype.process = function () {
  20449. var t = this,
  20450. e = this.source;
  20451. if (null !== this._process) return this._process;
  20452. if (null !== this.bitmap || !globalThis.createImageBitmap)
  20453. return Promise.resolve(this);
  20454. var r = globalThis.createImageBitmap,
  20455. n = !e.crossOrigin || 'anonymous' === e.crossOrigin;
  20456. return (
  20457. (this._process = fetch(e.src, { mode: n ? 'cors' : 'no-cors' })
  20458. .then(function (t) {
  20459. return t.blob();
  20460. })
  20461. .then(function (n) {
  20462. return r(n, 0, 0, e.width, e.height, {
  20463. premultiplyAlpha:
  20464. null === t.alphaMode || t.alphaMode === GP.UNPACK
  20465. ? 'premultiply'
  20466. : 'none',
  20467. });
  20468. })
  20469. .then(function (e) {
  20470. return t.destroyed
  20471. ? Promise.reject()
  20472. : ((t.bitmap = e),
  20473. t.update(),
  20474. (t._process = null),
  20475. Promise.resolve(t));
  20476. })),
  20477. this._process
  20478. );
  20479. }),
  20480. (e.prototype.upload = function (e, r, n) {
  20481. if (
  20482. ('number' == typeof this.alphaMode &&
  20483. (r.alphaMode = this.alphaMode),
  20484. !this.createBitmap)
  20485. )
  20486. return t.prototype.upload.call(this, e, r, n);
  20487. if (!this.bitmap && (this.process(), !this.bitmap)) return !1;
  20488. if (
  20489. (t.prototype.upload.call(this, e, r, n, this.bitmap),
  20490. !this.preserveBitmap)
  20491. ) {
  20492. var i = !0,
  20493. o = r._glTextures;
  20494. for (var s in o) {
  20495. var a = o[s];
  20496. if (a !== n && a.dirtyId !== r.dirtyId) {
  20497. i = !1;
  20498. break;
  20499. }
  20500. }
  20501. i &&
  20502. (this.bitmap.close && this.bitmap.close(), (this.bitmap = null));
  20503. }
  20504. return !0;
  20505. }),
  20506. (e.prototype.dispose = function () {
  20507. (this.source.onload = null),
  20508. (this.source.onerror = null),
  20509. t.prototype.dispose.call(this),
  20510. this.bitmap && (this.bitmap.close(), (this.bitmap = null)),
  20511. (this._process = null),
  20512. (this._load = null);
  20513. }),
  20514. (e.test = function (t) {
  20515. return 'string' == typeof t || t instanceof HTMLImageElement;
  20516. }),
  20517. e
  20518. );
  20519. })(hL),
  20520. pL = (function (t) {
  20521. function e(e, r) {
  20522. var n = this;
  20523. return (
  20524. (r = r || {}),
  20525. ((n = t.call(this, vA.ADAPTER.createCanvas()) || this)._width = 0),
  20526. (n._height = 0),
  20527. (n.svg = e),
  20528. (n.scale = r.scale || 1),
  20529. (n._overrideWidth = r.width),
  20530. (n._overrideHeight = r.height),
  20531. (n._resolve = null),
  20532. (n._crossorigin = r.crossorigin),
  20533. (n._load = null),
  20534. !1 !== r.autoLoad && n.load(),
  20535. n
  20536. );
  20537. }
  20538. return (
  20539. rL(e, t),
  20540. (e.prototype.load = function () {
  20541. var t = this;
  20542. return (
  20543. this._load ||
  20544. (this._load = new Promise(function (r) {
  20545. if (
  20546. ((t._resolve = function () {
  20547. t.resize(t.source.width, t.source.height), r(t);
  20548. }),
  20549. e.SVG_XML.test(t.svg.trim()))
  20550. ) {
  20551. if (!btoa)
  20552. throw new Error(
  20553. "Your browser doesn't support base64 conversions."
  20554. );
  20555. t.svg =
  20556. 'data:image/svg+xml;base64,' +
  20557. btoa(unescape(encodeURIComponent(t.svg)));
  20558. }
  20559. t._loadSvg();
  20560. })),
  20561. this._load
  20562. );
  20563. }),
  20564. (e.prototype._loadSvg = function () {
  20565. var t = this,
  20566. e = new Image();
  20567. hL.crossOrigin(e, this.svg, this._crossorigin),
  20568. (e.src = this.svg),
  20569. (e.onerror = function (r) {
  20570. t._resolve && ((e.onerror = null), t.onError.emit(r));
  20571. }),
  20572. (e.onload = function () {
  20573. if (t._resolve) {
  20574. var r = e.width,
  20575. n = e.height;
  20576. if (!r || !n)
  20577. throw new Error(
  20578. 'The SVG image must have width and height defined (in pixels), canvas API needs them.'
  20579. );
  20580. var i = r * t.scale,
  20581. o = n * t.scale;
  20582. (t._overrideWidth || t._overrideHeight) &&
  20583. ((i = t._overrideWidth || (t._overrideHeight / n) * r),
  20584. (o = t._overrideHeight || (t._overrideWidth / r) * n)),
  20585. (i = Math.round(i)),
  20586. (o = Math.round(o));
  20587. var s = t.source;
  20588. (s.width = i),
  20589. (s.height = o),
  20590. (s._pixiId = 'canvas_' + oD()),
  20591. s.getContext('2d').drawImage(e, 0, 0, r, n, 0, 0, i, o),
  20592. t._resolve(),
  20593. (t._resolve = null);
  20594. }
  20595. });
  20596. }),
  20597. (e.getSize = function (t) {
  20598. var r = e.SVG_SIZE.exec(t),
  20599. n = {};
  20600. return (
  20601. r &&
  20602. ((n[r[1]] = Math.round(parseFloat(r[3]))),
  20603. (n[r[5]] = Math.round(parseFloat(r[7])))),
  20604. n
  20605. );
  20606. }),
  20607. (e.prototype.dispose = function () {
  20608. t.prototype.dispose.call(this),
  20609. (this._resolve = null),
  20610. (this._crossorigin = null);
  20611. }),
  20612. (e.test = function (t, r) {
  20613. return (
  20614. 'svg' === r ||
  20615. ('string' == typeof t && t.startsWith('data:image/svg+xml')) ||
  20616. ('string' == typeof t && e.SVG_XML.test(t))
  20617. );
  20618. }),
  20619. (e.SVG_XML = /^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m),
  20620. (e.SVG_SIZE =
  20621. /<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i),
  20622. e
  20623. );
  20624. })(hL),
  20625. vL = (function (t) {
  20626. function e(r, n) {
  20627. var i = this;
  20628. if (((n = n || {}), !(r instanceof HTMLVideoElement))) {
  20629. var o = document.createElement('video');
  20630. o.setAttribute('preload', 'auto'),
  20631. o.setAttribute('webkit-playsinline', ''),
  20632. o.setAttribute('playsinline', ''),
  20633. 'string' == typeof r && (r = [r]);
  20634. var s = r[0].src || r[0];
  20635. hL.crossOrigin(o, s, n.crossorigin);
  20636. for (var a = 0; a < r.length; ++a) {
  20637. var u = document.createElement('source'),
  20638. c = r[a],
  20639. h = c.src,
  20640. l = c.mime,
  20641. d = (h = h || r[a]).split('?').shift().toLowerCase(),
  20642. f = d.slice(d.lastIndexOf('.') + 1);
  20643. (l = l || e.MIME_TYPES[f] || 'video/' + f),
  20644. (u.src = h),
  20645. (u.type = l),
  20646. o.appendChild(u);
  20647. }
  20648. r = o;
  20649. }
  20650. return (
  20651. ((i = t.call(this, r) || this).noSubImage = !0),
  20652. (i._autoUpdate = !0),
  20653. (i._isConnectedToTicker = !1),
  20654. (i._updateFPS = n.updateFPS || 0),
  20655. (i._msToNextUpdate = 0),
  20656. (i.autoPlay = !1 !== n.autoPlay),
  20657. (i._load = null),
  20658. (i._resolve = null),
  20659. (i._onCanPlay = i._onCanPlay.bind(i)),
  20660. (i._onError = i._onError.bind(i)),
  20661. !1 !== n.autoLoad && i.load(),
  20662. i
  20663. );
  20664. }
  20665. return (
  20666. rL(e, t),
  20667. (e.prototype.update = function (e) {
  20668. if (!this.destroyed) {
  20669. var r = qD.shared.elapsedMS * this.source.playbackRate;
  20670. (this._msToNextUpdate = Math.floor(this._msToNextUpdate - r)),
  20671. (!this._updateFPS || this._msToNextUpdate <= 0) &&
  20672. (t.prototype.update.call(this),
  20673. (this._msToNextUpdate = this._updateFPS
  20674. ? Math.floor(1e3 / this._updateFPS)
  20675. : 0));
  20676. }
  20677. }),
  20678. (e.prototype.load = function () {
  20679. var t = this;
  20680. if (this._load) return this._load;
  20681. var e = this.source;
  20682. return (
  20683. (e.readyState === e.HAVE_ENOUGH_DATA ||
  20684. e.readyState === e.HAVE_FUTURE_DATA) &&
  20685. e.width &&
  20686. e.height &&
  20687. (e.complete = !0),
  20688. e.addEventListener('play', this._onPlayStart.bind(this)),
  20689. e.addEventListener('pause', this._onPlayStop.bind(this)),
  20690. this._isSourceReady()
  20691. ? this._onCanPlay()
  20692. : (e.addEventListener('canplay', this._onCanPlay),
  20693. e.addEventListener('canplaythrough', this._onCanPlay),
  20694. e.addEventListener('error', this._onError, !0)),
  20695. (this._load = new Promise(function (r) {
  20696. t.valid ? r(t) : ((t._resolve = r), e.load());
  20697. })),
  20698. this._load
  20699. );
  20700. }),
  20701. (e.prototype._onError = function (t) {
  20702. this.source.removeEventListener('error', this._onError, !0),
  20703. this.onError.emit(t);
  20704. }),
  20705. (e.prototype._isSourcePlaying = function () {
  20706. var t = this.source;
  20707. return !t.paused && !t.ended && this._isSourceReady();
  20708. }),
  20709. (e.prototype._isSourceReady = function () {
  20710. return this.source.readyState > 2;
  20711. }),
  20712. (e.prototype._onPlayStart = function () {
  20713. this.valid || this._onCanPlay(),
  20714. this.autoUpdate &&
  20715. !this._isConnectedToTicker &&
  20716. (qD.shared.add(this.update, this),
  20717. (this._isConnectedToTicker = !0));
  20718. }),
  20719. (e.prototype._onPlayStop = function () {
  20720. this._isConnectedToTicker &&
  20721. (qD.shared.remove(this.update, this),
  20722. (this._isConnectedToTicker = !1));
  20723. }),
  20724. (e.prototype._onCanPlay = function () {
  20725. var t = this.source;
  20726. t.removeEventListener('canplay', this._onCanPlay),
  20727. t.removeEventListener('canplaythrough', this._onCanPlay);
  20728. var e = this.valid;
  20729. this.resize(t.videoWidth, t.videoHeight),
  20730. !e &&
  20731. this._resolve &&
  20732. (this._resolve(this), (this._resolve = null)),
  20733. this._isSourcePlaying()
  20734. ? this._onPlayStart()
  20735. : this.autoPlay && t.play();
  20736. }),
  20737. (e.prototype.dispose = function () {
  20738. this._isConnectedToTicker &&
  20739. (qD.shared.remove(this.update, this),
  20740. (this._isConnectedToTicker = !1));
  20741. var e = this.source;
  20742. e &&
  20743. (e.removeEventListener('error', this._onError, !0),
  20744. e.pause(),
  20745. (e.src = ''),
  20746. e.load()),
  20747. t.prototype.dispose.call(this);
  20748. }),
  20749. Object.defineProperty(e.prototype, 'autoUpdate', {
  20750. get: function () {
  20751. return this._autoUpdate;
  20752. },
  20753. set: function (t) {
  20754. t !== this._autoUpdate &&
  20755. ((this._autoUpdate = t),
  20756. !this._autoUpdate && this._isConnectedToTicker
  20757. ? (qD.shared.remove(this.update, this),
  20758. (this._isConnectedToTicker = !1))
  20759. : this._autoUpdate &&
  20760. !this._isConnectedToTicker &&
  20761. this._isSourcePlaying() &&
  20762. (qD.shared.add(this.update, this),
  20763. (this._isConnectedToTicker = !0)));
  20764. },
  20765. enumerable: !1,
  20766. configurable: !0,
  20767. }),
  20768. Object.defineProperty(e.prototype, 'updateFPS', {
  20769. get: function () {
  20770. return this._updateFPS;
  20771. },
  20772. set: function (t) {
  20773. t !== this._updateFPS && (this._updateFPS = t);
  20774. },
  20775. enumerable: !1,
  20776. configurable: !0,
  20777. }),
  20778. (e.test = function (t, r) {
  20779. return (
  20780. (globalThis.HTMLVideoElement && t instanceof HTMLVideoElement) ||
  20781. e.TYPES.indexOf(r) > -1
  20782. );
  20783. }),
  20784. (e.TYPES = ['mp4', 'm4v', 'webm', 'ogg', 'ogv', 'h264', 'avi', 'mov']),
  20785. (e.MIME_TYPES = {
  20786. ogv: 'video/ogg',
  20787. mov: 'video/quicktime',
  20788. m4v: 'video/mp4',
  20789. }),
  20790. e
  20791. );
  20792. })(hL),
  20793. mL = (function (t) {
  20794. function e(e) {
  20795. return t.call(this, e) || this;
  20796. }
  20797. return (
  20798. rL(e, t),
  20799. (e.test = function (t) {
  20800. return (
  20801. !!globalThis.createImageBitmap &&
  20802. 'undefined' != typeof ImageBitmap &&
  20803. t instanceof ImageBitmap
  20804. );
  20805. }),
  20806. e
  20807. );
  20808. })(hL);
  20809. $D.push(fL, mL, lL, vL, pL, oL, dL, cL);
  20810. var yL = (function (t) {
  20811. function e() {
  20812. return (null !== t && t.apply(this, arguments)) || this;
  20813. }
  20814. return (
  20815. rL(e, t),
  20816. (e.prototype.upload = function (t, e, r) {
  20817. var n = t.gl;
  20818. n.pixelStorei(
  20819. n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
  20820. e.alphaMode === GP.UNPACK
  20821. );
  20822. var i = e.realWidth,
  20823. o = e.realHeight;
  20824. return (
  20825. r.width === i && r.height === o
  20826. ? n.texSubImage2D(
  20827. e.target,
  20828. 0,
  20829. 0,
  20830. 0,
  20831. i,
  20832. o,
  20833. e.format,
  20834. r.type,
  20835. this.data
  20836. )
  20837. : ((r.width = i),
  20838. (r.height = o),
  20839. n.texImage2D(
  20840. e.target,
  20841. 0,
  20842. r.internalFormat,
  20843. i,
  20844. o,
  20845. 0,
  20846. e.format,
  20847. r.type,
  20848. this.data
  20849. )),
  20850. !0
  20851. );
  20852. }),
  20853. e
  20854. );
  20855. })(oL),
  20856. gL = (function () {
  20857. function t(t, e) {
  20858. (this.width = Math.round(t || 100)),
  20859. (this.height = Math.round(e || 100)),
  20860. (this.stencil = !1),
  20861. (this.depth = !1),
  20862. (this.dirtyId = 0),
  20863. (this.dirtyFormat = 0),
  20864. (this.dirtySize = 0),
  20865. (this.depthTexture = null),
  20866. (this.colorTextures = []),
  20867. (this.glFramebuffers = {}),
  20868. (this.disposeRunner = new JD('disposeFramebuffer')),
  20869. (this.multisample = WP.NONE);
  20870. }
  20871. return (
  20872. Object.defineProperty(t.prototype, 'colorTexture', {
  20873. get: function () {
  20874. return this.colorTextures[0];
  20875. },
  20876. enumerable: !1,
  20877. configurable: !0,
  20878. }),
  20879. (t.prototype.addColorTexture = function (t, e) {
  20880. return (
  20881. void 0 === t && (t = 0),
  20882. (this.colorTextures[t] =
  20883. e ||
  20884. new aL(null, {
  20885. scaleMode: NP.NEAREST,
  20886. resolution: 1,
  20887. mipmap: BP.OFF,
  20888. width: this.width,
  20889. height: this.height,
  20890. })),
  20891. this.dirtyId++,
  20892. this.dirtyFormat++,
  20893. this
  20894. );
  20895. }),
  20896. (t.prototype.addDepthTexture = function (t) {
  20897. return (
  20898. (this.depthTexture =
  20899. t ||
  20900. new aL(new yL(null, { width: this.width, height: this.height }), {
  20901. scaleMode: NP.NEAREST,
  20902. resolution: 1,
  20903. width: this.width,
  20904. height: this.height,
  20905. mipmap: BP.OFF,
  20906. format: MP.DEPTH_COMPONENT,
  20907. type: LP.UNSIGNED_SHORT,
  20908. })),
  20909. this.dirtyId++,
  20910. this.dirtyFormat++,
  20911. this
  20912. );
  20913. }),
  20914. (t.prototype.enableDepth = function () {
  20915. return (this.depth = !0), this.dirtyId++, this.dirtyFormat++, this;
  20916. }),
  20917. (t.prototype.enableStencil = function () {
  20918. return (this.stencil = !0), this.dirtyId++, this.dirtyFormat++, this;
  20919. }),
  20920. (t.prototype.resize = function (t, e) {
  20921. if (
  20922. ((t = Math.round(t)),
  20923. (e = Math.round(e)),
  20924. t !== this.width || e !== this.height)
  20925. ) {
  20926. (this.width = t),
  20927. (this.height = e),
  20928. this.dirtyId++,
  20929. this.dirtySize++;
  20930. for (var r = 0; r < this.colorTextures.length; r++) {
  20931. var n = this.colorTextures[r],
  20932. i = n.resolution;
  20933. n.setSize(t / i, e / i);
  20934. }
  20935. if (this.depthTexture) {
  20936. i = this.depthTexture.resolution;
  20937. this.depthTexture.setSize(t / i, e / i);
  20938. }
  20939. }
  20940. }),
  20941. (t.prototype.dispose = function () {
  20942. this.disposeRunner.emit(this, !1);
  20943. }),
  20944. (t.prototype.destroyDepthTexture = function () {
  20945. this.depthTexture &&
  20946. (this.depthTexture.destroy(),
  20947. (this.depthTexture = null),
  20948. ++this.dirtyId,
  20949. ++this.dirtyFormat);
  20950. }),
  20951. t
  20952. );
  20953. })(),
  20954. _L = (function (t) {
  20955. function e(e) {
  20956. void 0 === e && (e = {});
  20957. var r = this;
  20958. if ('number' == typeof e) {
  20959. var n = arguments[0],
  20960. i = arguments[1],
  20961. o = arguments[2],
  20962. s = arguments[3];
  20963. e = { width: n, height: i, scaleMode: o, resolution: s };
  20964. }
  20965. return (
  20966. (e.width = e.width || 100),
  20967. (e.height = e.height || 100),
  20968. (e.multisample = void 0 !== e.multisample ? e.multisample : WP.NONE),
  20969. ((r = t.call(this, null, e) || this).mipmap = BP.OFF),
  20970. (r.valid = !0),
  20971. (r.clearColor = [0, 0, 0, 0]),
  20972. (r.framebuffer = new gL(r.realWidth, r.realHeight).addColorTexture(
  20973. 0,
  20974. r
  20975. )),
  20976. (r.framebuffer.multisample = e.multisample),
  20977. (r.maskStack = []),
  20978. (r.filterStack = [{}]),
  20979. r
  20980. );
  20981. }
  20982. return (
  20983. rL(e, t),
  20984. (e.prototype.resize = function (t, e) {
  20985. this.framebuffer.resize(t * this.resolution, e * this.resolution),
  20986. this.setRealSize(this.framebuffer.width, this.framebuffer.height);
  20987. }),
  20988. (e.prototype.dispose = function () {
  20989. this.framebuffer.dispose(), t.prototype.dispose.call(this);
  20990. }),
  20991. (e.prototype.destroy = function () {
  20992. t.prototype.destroy.call(this),
  20993. this.framebuffer.destroyDepthTexture(),
  20994. (this.framebuffer = null);
  20995. }),
  20996. e
  20997. );
  20998. })(aL),
  20999. bL = (function () {
  21000. function t() {
  21001. (this.x0 = 0),
  21002. (this.y0 = 0),
  21003. (this.x1 = 1),
  21004. (this.y1 = 0),
  21005. (this.x2 = 1),
  21006. (this.y2 = 1),
  21007. (this.x3 = 0),
  21008. (this.y3 = 1),
  21009. (this.uvsFloat32 = new Float32Array(8));
  21010. }
  21011. return (
  21012. (t.prototype.set = function (t, e, r) {
  21013. var n = e.width,
  21014. i = e.height;
  21015. if (r) {
  21016. var o = t.width / 2 / n,
  21017. s = t.height / 2 / i,
  21018. a = t.x / n + o,
  21019. u = t.y / i + s;
  21020. (r = FD.add(r, FD.NW)),
  21021. (this.x0 = a + o * FD.uX(r)),
  21022. (this.y0 = u + s * FD.uY(r)),
  21023. (r = FD.add(r, 2)),
  21024. (this.x1 = a + o * FD.uX(r)),
  21025. (this.y1 = u + s * FD.uY(r)),
  21026. (r = FD.add(r, 2)),
  21027. (this.x2 = a + o * FD.uX(r)),
  21028. (this.y2 = u + s * FD.uY(r)),
  21029. (r = FD.add(r, 2)),
  21030. (this.x3 = a + o * FD.uX(r)),
  21031. (this.y3 = u + s * FD.uY(r));
  21032. } else
  21033. (this.x0 = t.x / n),
  21034. (this.y0 = t.y / i),
  21035. (this.x1 = (t.x + t.width) / n),
  21036. (this.y1 = t.y / i),
  21037. (this.x2 = (t.x + t.width) / n),
  21038. (this.y2 = (t.y + t.height) / i),
  21039. (this.x3 = t.x / n),
  21040. (this.y3 = (t.y + t.height) / i);
  21041. (this.uvsFloat32[0] = this.x0),
  21042. (this.uvsFloat32[1] = this.y0),
  21043. (this.uvsFloat32[2] = this.x1),
  21044. (this.uvsFloat32[3] = this.y1),
  21045. (this.uvsFloat32[4] = this.x2),
  21046. (this.uvsFloat32[5] = this.y2),
  21047. (this.uvsFloat32[6] = this.x3),
  21048. (this.uvsFloat32[7] = this.y3);
  21049. }),
  21050. (t.prototype.toString = function () {
  21051. return (
  21052. '[@pixi/core:TextureUvs x0=' +
  21053. this.x0 +
  21054. ' y0=' +
  21055. this.y0 +
  21056. ' x1=' +
  21057. this.x1 +
  21058. ' y1=' +
  21059. this.y1 +
  21060. ' x2=' +
  21061. this.x2 +
  21062. ' y2=' +
  21063. this.y2 +
  21064. ' x3=' +
  21065. this.x3 +
  21066. ' y3=' +
  21067. this.y3 +
  21068. ']'
  21069. );
  21070. }),
  21071. t
  21072. );
  21073. })(),
  21074. TL = new bL();
  21075. function xL(t) {
  21076. (t.destroy = function () {}),
  21077. (t.on = function () {}),
  21078. (t.once = function () {}),
  21079. (t.emit = function () {});
  21080. }
  21081. var EL = (function (t) {
  21082. function e(r, n, i, o, s, a) {
  21083. var u = t.call(this) || this;
  21084. if (
  21085. ((u.noFrame = !1),
  21086. n || ((u.noFrame = !0), (n = new TD(0, 0, 1, 1))),
  21087. r instanceof e && (r = r.baseTexture),
  21088. (u.baseTexture = r),
  21089. (u._frame = n),
  21090. (u.trim = o),
  21091. (u.valid = !1),
  21092. (u._uvs = TL),
  21093. (u.uvMatrix = null),
  21094. (u.orig = i || n),
  21095. (u._rotate = Number(s || 0)),
  21096. !0 === s)
  21097. )
  21098. u._rotate = 2;
  21099. else if (u._rotate % 2 != 0)
  21100. throw new Error(
  21101. 'attempt to use diamond-shaped UVs. If you are sure, set rotation manually'
  21102. );
  21103. return (
  21104. (u.defaultAnchor = a ? new _D(a.x, a.y) : new _D(0, 0)),
  21105. (u._updateID = 0),
  21106. (u.textureCacheIds = []),
  21107. r.valid
  21108. ? u.noFrame
  21109. ? r.valid && u.onBaseTextureUpdated(r)
  21110. : (u.frame = n)
  21111. : r.once('loaded', u.onBaseTextureUpdated, u),
  21112. u.noFrame && r.on('update', u.onBaseTextureUpdated, u),
  21113. u
  21114. );
  21115. }
  21116. return (
  21117. rL(e, t),
  21118. (e.prototype.update = function () {
  21119. this.baseTexture.resource && this.baseTexture.resource.update();
  21120. }),
  21121. (e.prototype.onBaseTextureUpdated = function (t) {
  21122. if (this.noFrame) {
  21123. if (!this.baseTexture.valid) return;
  21124. (this._frame.width = t.width),
  21125. (this._frame.height = t.height),
  21126. (this.valid = !0),
  21127. this.updateUvs();
  21128. } else this.frame = this._frame;
  21129. this.emit('update', this);
  21130. }),
  21131. (e.prototype.destroy = function (t) {
  21132. if (this.baseTexture) {
  21133. if (t) {
  21134. var r = this.baseTexture.resource;
  21135. r && r.url && hD[r.url] && e.removeFromCache(r.url),
  21136. this.baseTexture.destroy();
  21137. }
  21138. this.baseTexture.off('loaded', this.onBaseTextureUpdated, this),
  21139. this.baseTexture.off('update', this.onBaseTextureUpdated, this),
  21140. (this.baseTexture = null);
  21141. }
  21142. (this._frame = null),
  21143. (this._uvs = null),
  21144. (this.trim = null),
  21145. (this.orig = null),
  21146. (this.valid = !1),
  21147. e.removeFromCache(this),
  21148. (this.textureCacheIds = null);
  21149. }),
  21150. (e.prototype.clone = function () {
  21151. var t = this._frame.clone(),
  21152. r = this._frame === this.orig ? t : this.orig.clone(),
  21153. n = new e(
  21154. this.baseTexture,
  21155. !this.noFrame && t,
  21156. r,
  21157. this.trim && this.trim.clone(),
  21158. this.rotate,
  21159. this.defaultAnchor
  21160. );
  21161. return this.noFrame && (n._frame = t), n;
  21162. }),
  21163. (e.prototype.updateUvs = function () {
  21164. this._uvs === TL && (this._uvs = new bL()),
  21165. this._uvs.set(this._frame, this.baseTexture, this.rotate),
  21166. this._updateID++;
  21167. }),
  21168. (e.from = function (t, r, n) {
  21169. void 0 === r && (r = {}),
  21170. void 0 === n && (n = vA.STRICT_TEXTURE_CACHE);
  21171. var i = 'string' == typeof t,
  21172. o = null;
  21173. if (i) o = t;
  21174. else if (t instanceof aL) {
  21175. if (!t.cacheId) {
  21176. var s = (r && r.pixiIdPrefix) || 'pixiid';
  21177. (t.cacheId = s + '-' + oD()), aL.addToCache(t, t.cacheId);
  21178. }
  21179. o = t.cacheId;
  21180. } else {
  21181. if (!t._pixiId) {
  21182. s = (r && r.pixiIdPrefix) || 'pixiid';
  21183. t._pixiId = s + '_' + oD();
  21184. }
  21185. o = t._pixiId;
  21186. }
  21187. var a = hD[o];
  21188. if (i && n && !a)
  21189. throw new Error(
  21190. 'The cacheId "' + o + '" does not exist in TextureCache.'
  21191. );
  21192. return (
  21193. a || t instanceof aL
  21194. ? !a && t instanceof aL && ((a = new e(t)), e.addToCache(a, o))
  21195. : (r.resolution || (r.resolution = pD(t)),
  21196. ((a = new e(new aL(t, r))).baseTexture.cacheId = o),
  21197. aL.addToCache(a.baseTexture, o),
  21198. e.addToCache(a, o)),
  21199. a
  21200. );
  21201. }),
  21202. (e.fromURL = function (t, r) {
  21203. var n = Object.assign(
  21204. { autoLoad: !1 },
  21205. null == r ? void 0 : r.resourceOptions
  21206. ),
  21207. i = e.from(t, Object.assign({ resourceOptions: n }, r), !1),
  21208. o = i.baseTexture.resource;
  21209. return i.baseTexture.valid
  21210. ? Promise.resolve(i)
  21211. : o.load().then(function () {
  21212. return Promise.resolve(i);
  21213. });
  21214. }),
  21215. (e.fromBuffer = function (t, r, n, i) {
  21216. return new e(aL.fromBuffer(t, r, n, i));
  21217. }),
  21218. (e.fromLoader = function (t, r, n, i) {
  21219. var o = new aL(
  21220. t,
  21221. Object.assign({ scaleMode: vA.SCALE_MODE, resolution: pD(r) }, i)
  21222. ),
  21223. s = o.resource;
  21224. s instanceof fL && (s.url = r);
  21225. var a = new e(o);
  21226. return (
  21227. n || (n = r),
  21228. aL.addToCache(a.baseTexture, n),
  21229. e.addToCache(a, n),
  21230. n !== r && (aL.addToCache(a.baseTexture, r), e.addToCache(a, r)),
  21231. a.baseTexture.valid
  21232. ? Promise.resolve(a)
  21233. : new Promise(function (t) {
  21234. a.baseTexture.once('loaded', function () {
  21235. return t(a);
  21236. });
  21237. })
  21238. );
  21239. }),
  21240. (e.addToCache = function (t, e) {
  21241. e &&
  21242. (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e),
  21243. hD[e] &&
  21244. console.warn(
  21245. 'Texture added to the cache with an id [' +
  21246. e +
  21247. '] that already had an entry'
  21248. ),
  21249. (hD[e] = t));
  21250. }),
  21251. (e.removeFromCache = function (t) {
  21252. if ('string' == typeof t) {
  21253. var e = hD[t];
  21254. if (e) {
  21255. var r = e.textureCacheIds.indexOf(t);
  21256. return r > -1 && e.textureCacheIds.splice(r, 1), delete hD[t], e;
  21257. }
  21258. } else if (t && t.textureCacheIds) {
  21259. for (var n = 0; n < t.textureCacheIds.length; ++n)
  21260. hD[t.textureCacheIds[n]] === t && delete hD[t.textureCacheIds[n]];
  21261. return (t.textureCacheIds.length = 0), t;
  21262. }
  21263. return null;
  21264. }),
  21265. Object.defineProperty(e.prototype, 'resolution', {
  21266. get: function () {
  21267. return this.baseTexture.resolution;
  21268. },
  21269. enumerable: !1,
  21270. configurable: !0,
  21271. }),
  21272. Object.defineProperty(e.prototype, 'frame', {
  21273. get: function () {
  21274. return this._frame;
  21275. },
  21276. set: function (t) {
  21277. (this._frame = t), (this.noFrame = !1);
  21278. var e = t.x,
  21279. r = t.y,
  21280. n = t.width,
  21281. i = t.height,
  21282. o = e + n > this.baseTexture.width,
  21283. s = r + i > this.baseTexture.height;
  21284. if (o || s) {
  21285. var a = o && s ? 'and' : 'or',
  21286. u =
  21287. 'X: ' +
  21288. e +
  21289. ' + ' +
  21290. n +
  21291. ' = ' +
  21292. (e + n) +
  21293. ' > ' +
  21294. this.baseTexture.width,
  21295. c =
  21296. 'Y: ' +
  21297. r +
  21298. ' + ' +
  21299. i +
  21300. ' = ' +
  21301. (r + i) +
  21302. ' > ' +
  21303. this.baseTexture.height;
  21304. throw new Error(
  21305. 'Texture Error: frame does not fit inside the base Texture dimensions: ' +
  21306. u +
  21307. ' ' +
  21308. a +
  21309. ' ' +
  21310. c
  21311. );
  21312. }
  21313. (this.valid = n && i && this.baseTexture.valid),
  21314. this.trim || this.rotate || (this.orig = t),
  21315. this.valid && this.updateUvs();
  21316. },
  21317. enumerable: !1,
  21318. configurable: !0,
  21319. }),
  21320. Object.defineProperty(e.prototype, 'rotate', {
  21321. get: function () {
  21322. return this._rotate;
  21323. },
  21324. set: function (t) {
  21325. (this._rotate = t), this.valid && this.updateUvs();
  21326. },
  21327. enumerable: !1,
  21328. configurable: !0,
  21329. }),
  21330. Object.defineProperty(e.prototype, 'width', {
  21331. get: function () {
  21332. return this.orig.width;
  21333. },
  21334. enumerable: !1,
  21335. configurable: !0,
  21336. }),
  21337. Object.defineProperty(e.prototype, 'height', {
  21338. get: function () {
  21339. return this.orig.height;
  21340. },
  21341. enumerable: !1,
  21342. configurable: !0,
  21343. }),
  21344. (e.prototype.castToBaseTexture = function () {
  21345. return this.baseTexture;
  21346. }),
  21347. Object.defineProperty(e, 'EMPTY', {
  21348. get: function () {
  21349. return (
  21350. e._EMPTY ||
  21351. ((e._EMPTY = new e(new aL())),
  21352. xL(e._EMPTY),
  21353. xL(e._EMPTY.baseTexture)),
  21354. e._EMPTY
  21355. );
  21356. },
  21357. enumerable: !1,
  21358. configurable: !0,
  21359. }),
  21360. Object.defineProperty(e, 'WHITE', {
  21361. get: function () {
  21362. if (!e._WHITE) {
  21363. var t = vA.ADAPTER.createCanvas(16, 16),
  21364. r = t.getContext('2d');
  21365. (t.width = 16),
  21366. (t.height = 16),
  21367. (r.fillStyle = 'white'),
  21368. r.fillRect(0, 0, 16, 16),
  21369. (e._WHITE = new e(aL.from(t))),
  21370. xL(e._WHITE),
  21371. xL(e._WHITE.baseTexture);
  21372. }
  21373. return e._WHITE;
  21374. },
  21375. enumerable: !1,
  21376. configurable: !0,
  21377. }),
  21378. e
  21379. );
  21380. })(yA),
  21381. SL = (function (t) {
  21382. function e(e, r) {
  21383. var n = t.call(this, e, r) || this;
  21384. return (
  21385. (n.valid = !0),
  21386. (n.filterFrame = null),
  21387. (n.filterPoolKey = null),
  21388. n.updateUvs(),
  21389. n
  21390. );
  21391. }
  21392. return (
  21393. rL(e, t),
  21394. Object.defineProperty(e.prototype, 'framebuffer', {
  21395. get: function () {
  21396. return this.baseTexture.framebuffer;
  21397. },
  21398. enumerable: !1,
  21399. configurable: !0,
  21400. }),
  21401. Object.defineProperty(e.prototype, 'multisample', {
  21402. get: function () {
  21403. return this.framebuffer.multisample;
  21404. },
  21405. set: function (t) {
  21406. this.framebuffer.multisample = t;
  21407. },
  21408. enumerable: !1,
  21409. configurable: !0,
  21410. }),
  21411. (e.prototype.resize = function (t, e, r) {
  21412. void 0 === r && (r = !0);
  21413. var n = this.baseTexture.resolution,
  21414. i = Math.round(t * n) / n,
  21415. o = Math.round(e * n) / n;
  21416. (this.valid = i > 0 && o > 0),
  21417. (this._frame.width = this.orig.width = i),
  21418. (this._frame.height = this.orig.height = o),
  21419. r && this.baseTexture.resize(i, o),
  21420. this.updateUvs();
  21421. }),
  21422. (e.prototype.setResolution = function (t) {
  21423. var e = this.baseTexture;
  21424. e.resolution !== t &&
  21425. (e.setResolution(t), this.resize(e.width, e.height, !1));
  21426. }),
  21427. (e.create = function (t) {
  21428. for (var r = arguments, n = [], i = 1; i < arguments.length; i++)
  21429. n[i - 1] = r[i];
  21430. return (
  21431. 'number' == typeof t &&
  21432. (aD(
  21433. '6.0.0',
  21434. 'Arguments (width, height, scaleMode, resolution) have been deprecated.'
  21435. ),
  21436. (t = {
  21437. width: t,
  21438. height: n[0],
  21439. scaleMode: n[1],
  21440. resolution: n[2],
  21441. })),
  21442. new e(new _L(t))
  21443. );
  21444. }),
  21445. e
  21446. );
  21447. })(EL),
  21448. wL = (function () {
  21449. function t(t) {
  21450. (this.texturePool = {}),
  21451. (this.textureOptions = t || {}),
  21452. (this.enableFullScreen = !1),
  21453. (this._pixelsWidth = 0),
  21454. (this._pixelsHeight = 0);
  21455. }
  21456. return (
  21457. (t.prototype.createTexture = function (t, e, r) {
  21458. void 0 === r && (r = WP.NONE);
  21459. var n = new _L(
  21460. Object.assign(
  21461. { width: t, height: e, resolution: 1, multisample: r },
  21462. this.textureOptions
  21463. )
  21464. );
  21465. return new SL(n);
  21466. }),
  21467. (t.prototype.getOptimalTexture = function (t, e, r, n) {
  21468. var i;
  21469. void 0 === r && (r = 1),
  21470. void 0 === n && (n = WP.NONE),
  21471. (t = Math.ceil(t * r - 1e-6)),
  21472. (e = Math.ceil(e * r - 1e-6)),
  21473. this.enableFullScreen &&
  21474. t === this._pixelsWidth &&
  21475. e === this._pixelsHeight
  21476. ? (i = n > 1 ? -n : -1)
  21477. : ((i =
  21478. (((65535 & (t = $M(t))) << 16) | (65535 & (e = $M(e)))) >>>
  21479. 0),
  21480. n > 1 && (i += 4294967296 * n)),
  21481. this.texturePool[i] || (this.texturePool[i] = []);
  21482. var o = this.texturePool[i].pop();
  21483. return (
  21484. o || (o = this.createTexture(t, e, n)),
  21485. (o.filterPoolKey = i),
  21486. o.setResolution(r),
  21487. o
  21488. );
  21489. }),
  21490. (t.prototype.getFilterTexture = function (t, e, r) {
  21491. var n = this.getOptimalTexture(
  21492. t.width,
  21493. t.height,
  21494. e || t.resolution,
  21495. r || WP.NONE
  21496. );
  21497. return (n.filterFrame = t.filterFrame), n;
  21498. }),
  21499. (t.prototype.returnTexture = function (t) {
  21500. var e = t.filterPoolKey;
  21501. (t.filterFrame = null), this.texturePool[e].push(t);
  21502. }),
  21503. (t.prototype.returnFilterTexture = function (t) {
  21504. this.returnTexture(t);
  21505. }),
  21506. (t.prototype.clear = function (t) {
  21507. if ((t = !1 !== t))
  21508. for (var e in this.texturePool) {
  21509. var r = this.texturePool[e];
  21510. if (r) for (var n = 0; n < r.length; n++) r[n].destroy(!0);
  21511. }
  21512. this.texturePool = {};
  21513. }),
  21514. (t.prototype.setScreenSize = function (t) {
  21515. if (
  21516. t.width !== this._pixelsWidth ||
  21517. t.height !== this._pixelsHeight
  21518. ) {
  21519. for (var e in ((this.enableFullScreen =
  21520. t.width > 0 && t.height > 0),
  21521. this.texturePool))
  21522. if (Number(e) < 0) {
  21523. var r = this.texturePool[e];
  21524. if (r) for (var n = 0; n < r.length; n++) r[n].destroy(!0);
  21525. this.texturePool[e] = [];
  21526. }
  21527. (this._pixelsWidth = t.width), (this._pixelsHeight = t.height);
  21528. }
  21529. }),
  21530. (t.SCREEN_KEY = -1),
  21531. t
  21532. );
  21533. })(),
  21534. RL = (function () {
  21535. function t(t, e, r, n, i, o, s) {
  21536. void 0 === e && (e = 0),
  21537. void 0 === r && (r = !1),
  21538. void 0 === n && (n = LP.FLOAT),
  21539. (this.buffer = t),
  21540. (this.size = e),
  21541. (this.normalized = r),
  21542. (this.type = n),
  21543. (this.stride = i),
  21544. (this.start = o),
  21545. (this.instance = s);
  21546. }
  21547. return (
  21548. (t.prototype.destroy = function () {
  21549. this.buffer = null;
  21550. }),
  21551. (t.from = function (e, r, n, i, o) {
  21552. return new t(e, r, n, i, o);
  21553. }),
  21554. t
  21555. );
  21556. })(),
  21557. CL = 0,
  21558. PL = (function () {
  21559. function t(t, e, r) {
  21560. void 0 === e && (e = !0),
  21561. void 0 === r && (r = !1),
  21562. (this.data = t || new Float32Array(1)),
  21563. (this._glBuffers = {}),
  21564. (this._updateID = 0),
  21565. (this.index = r),
  21566. (this.static = e),
  21567. (this.id = CL++),
  21568. (this.disposeRunner = new JD('disposeBuffer'));
  21569. }
  21570. return (
  21571. (t.prototype.update = function (t) {
  21572. t instanceof Array && (t = new Float32Array(t)),
  21573. (this.data = t || this.data),
  21574. this._updateID++;
  21575. }),
  21576. (t.prototype.dispose = function () {
  21577. this.disposeRunner.emit(this, !1);
  21578. }),
  21579. (t.prototype.destroy = function () {
  21580. this.dispose(), (this.data = null);
  21581. }),
  21582. Object.defineProperty(t.prototype, 'index', {
  21583. get: function () {
  21584. return this.type === YP.ELEMENT_ARRAY_BUFFER;
  21585. },
  21586. set: function (t) {
  21587. this.type = t ? YP.ELEMENT_ARRAY_BUFFER : YP.ARRAY_BUFFER;
  21588. },
  21589. enumerable: !1,
  21590. configurable: !0,
  21591. }),
  21592. (t.from = function (e) {
  21593. return e instanceof Array && (e = new Float32Array(e)), new t(e);
  21594. }),
  21595. t
  21596. );
  21597. })(),
  21598. AL = {
  21599. Float32Array: Float32Array,
  21600. Uint32Array: Uint32Array,
  21601. Int32Array: Int32Array,
  21602. Uint8Array: Uint8Array,
  21603. };
  21604. var OL = { 5126: 4, 5123: 2, 5121: 1 },
  21605. IL = 0,
  21606. ML = {
  21607. Float32Array: Float32Array,
  21608. Uint32Array: Uint32Array,
  21609. Int32Array: Int32Array,
  21610. Uint8Array: Uint8Array,
  21611. Uint16Array: Uint16Array,
  21612. },
  21613. DL = (function () {
  21614. function t(t, e) {
  21615. void 0 === t && (t = []),
  21616. void 0 === e && (e = {}),
  21617. (this.buffers = t),
  21618. (this.indexBuffer = null),
  21619. (this.attributes = e),
  21620. (this.glVertexArrayObjects = {}),
  21621. (this.id = IL++),
  21622. (this.instanced = !1),
  21623. (this.instanceCount = 1),
  21624. (this.disposeRunner = new JD('disposeGeometry')),
  21625. (this.refCount = 0);
  21626. }
  21627. return (
  21628. (t.prototype.addAttribute = function (t, e, r, n, i, o, s, a) {
  21629. if (
  21630. (void 0 === r && (r = 0),
  21631. void 0 === n && (n = !1),
  21632. void 0 === a && (a = !1),
  21633. !e)
  21634. )
  21635. throw new Error(
  21636. 'You must pass a buffer when creating an attribute'
  21637. );
  21638. e instanceof PL ||
  21639. (e instanceof Array && (e = new Float32Array(e)), (e = new PL(e)));
  21640. var u = t.split('|');
  21641. if (u.length > 1) {
  21642. for (var c = 0; c < u.length; c++)
  21643. this.addAttribute(u[c], e, r, n, i);
  21644. return this;
  21645. }
  21646. var h = this.buffers.indexOf(e);
  21647. return (
  21648. -1 === h && (this.buffers.push(e), (h = this.buffers.length - 1)),
  21649. (this.attributes[t] = new RL(h, r, n, i, o, s, a)),
  21650. (this.instanced = this.instanced || a),
  21651. this
  21652. );
  21653. }),
  21654. (t.prototype.getAttribute = function (t) {
  21655. return this.attributes[t];
  21656. }),
  21657. (t.prototype.getBuffer = function (t) {
  21658. return this.buffers[this.getAttribute(t).buffer];
  21659. }),
  21660. (t.prototype.addIndex = function (t) {
  21661. return (
  21662. t instanceof PL ||
  21663. (t instanceof Array && (t = new Uint16Array(t)), (t = new PL(t))),
  21664. (t.type = YP.ELEMENT_ARRAY_BUFFER),
  21665. (this.indexBuffer = t),
  21666. -1 === this.buffers.indexOf(t) && this.buffers.push(t),
  21667. this
  21668. );
  21669. }),
  21670. (t.prototype.getIndex = function () {
  21671. return this.indexBuffer;
  21672. }),
  21673. (t.prototype.interleave = function () {
  21674. if (
  21675. 1 === this.buffers.length ||
  21676. (2 === this.buffers.length && this.indexBuffer)
  21677. )
  21678. return this;
  21679. var t,
  21680. e = [],
  21681. r = [],
  21682. n = new PL();
  21683. for (t in this.attributes) {
  21684. var i = this.attributes[t],
  21685. o = this.buffers[i.buffer];
  21686. e.push(o.data), r.push((i.size * OL[i.type]) / 4), (i.buffer = 0);
  21687. }
  21688. for (
  21689. n.data = (function (t, e) {
  21690. for (var r = 0, n = 0, i = {}, o = 0; o < t.length; o++)
  21691. (n += e[o]), (r += t[o].length);
  21692. var s = new ArrayBuffer(4 * r),
  21693. a = null,
  21694. u = 0;
  21695. for (o = 0; o < t.length; o++) {
  21696. var c = e[o],
  21697. h = t[o],
  21698. l = QM(h);
  21699. i[l] || (i[l] = new AL[l](s)), (a = i[l]);
  21700. for (var d = 0; d < h.length; d++)
  21701. a[((d / c) | 0) * n + u + (d % c)] = h[d];
  21702. u += c;
  21703. }
  21704. return new Float32Array(s);
  21705. })(e, r),
  21706. t = 0;
  21707. t < this.buffers.length;
  21708. t++
  21709. )
  21710. this.buffers[t] !== this.indexBuffer && this.buffers[t].destroy();
  21711. return (
  21712. (this.buffers = [n]),
  21713. this.indexBuffer && this.buffers.push(this.indexBuffer),
  21714. this
  21715. );
  21716. }),
  21717. (t.prototype.getSize = function () {
  21718. for (var t in this.attributes) {
  21719. var e = this.attributes[t];
  21720. return (
  21721. this.buffers[e.buffer].data.length / (e.stride / 4 || e.size)
  21722. );
  21723. }
  21724. return 0;
  21725. }),
  21726. (t.prototype.dispose = function () {
  21727. this.disposeRunner.emit(this, !1);
  21728. }),
  21729. (t.prototype.destroy = function () {
  21730. this.dispose(),
  21731. (this.buffers = null),
  21732. (this.indexBuffer = null),
  21733. (this.attributes = null);
  21734. }),
  21735. (t.prototype.clone = function () {
  21736. for (var e = new t(), r = 0; r < this.buffers.length; r++)
  21737. e.buffers[r] = new PL(this.buffers[r].data.slice(0));
  21738. for (var r in this.attributes) {
  21739. var n = this.attributes[r];
  21740. e.attributes[r] = new RL(
  21741. n.buffer,
  21742. n.size,
  21743. n.normalized,
  21744. n.type,
  21745. n.stride,
  21746. n.start,
  21747. n.instance
  21748. );
  21749. }
  21750. return (
  21751. this.indexBuffer &&
  21752. ((e.indexBuffer =
  21753. e.buffers[this.buffers.indexOf(this.indexBuffer)]),
  21754. (e.indexBuffer.type = YP.ELEMENT_ARRAY_BUFFER)),
  21755. e
  21756. );
  21757. }),
  21758. (t.merge = function (e) {
  21759. for (
  21760. var r, n = new t(), i = [], o = [], s = [], a = 0;
  21761. a < e.length;
  21762. a++
  21763. ) {
  21764. r = e[a];
  21765. for (var u = 0; u < r.buffers.length; u++)
  21766. (o[u] = o[u] || 0),
  21767. (o[u] += r.buffers[u].data.length),
  21768. (s[u] = 0);
  21769. }
  21770. for (a = 0; a < r.buffers.length; a++)
  21771. (i[a] = new ML[QM(r.buffers[a].data)](o[a])),
  21772. (n.buffers[a] = new PL(i[a]));
  21773. for (a = 0; a < e.length; a++) {
  21774. r = e[a];
  21775. for (u = 0; u < r.buffers.length; u++)
  21776. i[u].set(r.buffers[u].data, s[u]),
  21777. (s[u] += r.buffers[u].data.length);
  21778. }
  21779. if (((n.attributes = r.attributes), r.indexBuffer)) {
  21780. (n.indexBuffer = n.buffers[r.buffers.indexOf(r.indexBuffer)]),
  21781. (n.indexBuffer.type = YP.ELEMENT_ARRAY_BUFFER);
  21782. var c = 0,
  21783. h = 0,
  21784. l = 0,
  21785. d = 0;
  21786. for (a = 0; a < r.buffers.length; a++)
  21787. if (r.buffers[a] !== r.indexBuffer) {
  21788. d = a;
  21789. break;
  21790. }
  21791. for (var a in r.attributes) {
  21792. var f = r.attributes[a];
  21793. (0 | f.buffer) === d && (h += (f.size * OL[f.type]) / 4);
  21794. }
  21795. for (a = 0; a < e.length; a++) {
  21796. var p = e[a].indexBuffer.data;
  21797. for (u = 0; u < p.length; u++) n.indexBuffer.data[u + l] += c;
  21798. (c += e[a].buffers[d].data.length / h), (l += p.length);
  21799. }
  21800. }
  21801. return n;
  21802. }),
  21803. t
  21804. );
  21805. })(),
  21806. LL = (function (t) {
  21807. function e() {
  21808. var e = t.call(this) || this;
  21809. return (
  21810. e
  21811. .addAttribute(
  21812. 'aVertexPosition',
  21813. new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  21814. )
  21815. .addIndex([0, 1, 3, 2]),
  21816. e
  21817. );
  21818. }
  21819. return rL(e, t), e;
  21820. })(DL),
  21821. FL = (function (t) {
  21822. function e() {
  21823. var e = t.call(this) || this;
  21824. return (
  21825. (e.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1])),
  21826. (e.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])),
  21827. (e.vertexBuffer = new PL(e.vertices)),
  21828. (e.uvBuffer = new PL(e.uvs)),
  21829. e
  21830. .addAttribute('aVertexPosition', e.vertexBuffer)
  21831. .addAttribute('aTextureCoord', e.uvBuffer)
  21832. .addIndex([0, 1, 2, 0, 2, 3]),
  21833. e
  21834. );
  21835. }
  21836. return (
  21837. rL(e, t),
  21838. (e.prototype.map = function (t, e) {
  21839. var r = 0,
  21840. n = 0;
  21841. return (
  21842. (this.uvs[0] = r),
  21843. (this.uvs[1] = n),
  21844. (this.uvs[2] = r + e.width / t.width),
  21845. (this.uvs[3] = n),
  21846. (this.uvs[4] = r + e.width / t.width),
  21847. (this.uvs[5] = n + e.height / t.height),
  21848. (this.uvs[6] = r),
  21849. (this.uvs[7] = n + e.height / t.height),
  21850. (r = e.x),
  21851. (n = e.y),
  21852. (this.vertices[0] = r),
  21853. (this.vertices[1] = n),
  21854. (this.vertices[2] = r + e.width),
  21855. (this.vertices[3] = n),
  21856. (this.vertices[4] = r + e.width),
  21857. (this.vertices[5] = n + e.height),
  21858. (this.vertices[6] = r),
  21859. (this.vertices[7] = n + e.height),
  21860. this.invalidate(),
  21861. this
  21862. );
  21863. }),
  21864. (e.prototype.invalidate = function () {
  21865. return this.vertexBuffer._updateID++, this.uvBuffer._updateID++, this;
  21866. }),
  21867. e
  21868. );
  21869. })(DL),
  21870. NL = 0,
  21871. kL = (function () {
  21872. function t(t, e, r) {
  21873. (this.group = !0),
  21874. (this.syncUniforms = {}),
  21875. (this.dirtyId = 0),
  21876. (this.id = NL++),
  21877. (this.static = !!e),
  21878. (this.ubo = !!r),
  21879. t instanceof PL
  21880. ? ((this.buffer = t),
  21881. (this.buffer.type = YP.UNIFORM_BUFFER),
  21882. (this.autoManage = !1),
  21883. (this.ubo = !0))
  21884. : ((this.uniforms = t),
  21885. this.ubo &&
  21886. ((this.buffer = new PL(new Float32Array(1))),
  21887. (this.buffer.type = YP.UNIFORM_BUFFER),
  21888. (this.autoManage = !0)));
  21889. }
  21890. return (
  21891. (t.prototype.update = function () {
  21892. this.dirtyId++,
  21893. !this.autoManage && this.buffer && this.buffer.update();
  21894. }),
  21895. (t.prototype.add = function (e, r, n) {
  21896. if (this.ubo)
  21897. throw new Error(
  21898. '[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them'
  21899. );
  21900. this.uniforms[e] = new t(r, n);
  21901. }),
  21902. (t.from = function (e, r, n) {
  21903. return new t(e, r, n);
  21904. }),
  21905. (t.uboFrom = function (e, r) {
  21906. return new t(e, null == r || r, !0);
  21907. }),
  21908. t
  21909. );
  21910. })(),
  21911. BL = (function () {
  21912. function t() {
  21913. (this.renderTexture = null),
  21914. (this.target = null),
  21915. (this.legacy = !1),
  21916. (this.resolution = 1),
  21917. (this.multisample = WP.NONE),
  21918. (this.sourceFrame = new TD()),
  21919. (this.destinationFrame = new TD()),
  21920. (this.bindingSourceFrame = new TD()),
  21921. (this.bindingDestinationFrame = new TD()),
  21922. (this.filters = []),
  21923. (this.transform = null);
  21924. }
  21925. return (
  21926. (t.prototype.clear = function () {
  21927. (this.target = null),
  21928. (this.filters = null),
  21929. (this.renderTexture = null);
  21930. }),
  21931. t
  21932. );
  21933. })(),
  21934. GL = [new _D(), new _D(), new _D(), new _D()],
  21935. UL = new CD(),
  21936. jL = (function () {
  21937. function t(t) {
  21938. (this.renderer = t),
  21939. (this.defaultFilterStack = [{}]),
  21940. (this.texturePool = new wL()),
  21941. this.texturePool.setScreenSize(t.view),
  21942. (this.statePool = []),
  21943. (this.quad = new LL()),
  21944. (this.quadUv = new FL()),
  21945. (this.tempRect = new TD()),
  21946. (this.activeState = {}),
  21947. (this.globalUniforms = new kL(
  21948. {
  21949. outputFrame: new TD(),
  21950. inputSize: new Float32Array(4),
  21951. inputPixel: new Float32Array(4),
  21952. inputClamp: new Float32Array(4),
  21953. resolution: 1,
  21954. filterArea: new Float32Array(4),
  21955. filterClamp: new Float32Array(4),
  21956. },
  21957. !0
  21958. )),
  21959. (this.forceClear = !1),
  21960. (this.useMaxPadding = !1);
  21961. }
  21962. return (
  21963. (t.prototype.push = function (t, e) {
  21964. for (
  21965. var r,
  21966. n,
  21967. i = this.renderer,
  21968. o = this.defaultFilterStack,
  21969. s = this.statePool.pop() || new BL(),
  21970. a = this.renderer.renderTexture,
  21971. u = e[0].resolution,
  21972. c = e[0].multisample,
  21973. h = e[0].padding,
  21974. l = e[0].autoFit,
  21975. d = null === (r = e[0].legacy) || void 0 === r || r,
  21976. f = 1;
  21977. f < e.length;
  21978. f++
  21979. ) {
  21980. var p = e[f];
  21981. (u = Math.min(u, p.resolution)),
  21982. (c = Math.min(c, p.multisample)),
  21983. (h = this.useMaxPadding ? Math.max(h, p.padding) : h + p.padding),
  21984. (l = l && p.autoFit),
  21985. (d = d || null === (n = p.legacy) || void 0 === n || n);
  21986. }
  21987. 1 === o.length &&
  21988. (this.defaultFilterStack[0].renderTexture = a.current),
  21989. o.push(s),
  21990. (s.resolution = u),
  21991. (s.multisample = c),
  21992. (s.legacy = d),
  21993. (s.target = t),
  21994. s.sourceFrame.copyFrom(t.filterArea || t.getBounds(!0)),
  21995. s.sourceFrame.pad(h);
  21996. var v = this.tempRect.copyFrom(a.sourceFrame);
  21997. i.projection.transform &&
  21998. this.transformAABB(UL.copyFrom(i.projection.transform).invert(), v),
  21999. l
  22000. ? (s.sourceFrame.fit(v),
  22001. (s.sourceFrame.width <= 0 || s.sourceFrame.height <= 0) &&
  22002. ((s.sourceFrame.width = 0), (s.sourceFrame.height = 0)))
  22003. : s.sourceFrame.intersects(v) ||
  22004. ((s.sourceFrame.width = 0), (s.sourceFrame.height = 0)),
  22005. this.roundFrame(
  22006. s.sourceFrame,
  22007. a.current ? a.current.resolution : i.resolution,
  22008. a.sourceFrame,
  22009. a.destinationFrame,
  22010. i.projection.transform
  22011. ),
  22012. (s.renderTexture = this.getOptimalFilterTexture(
  22013. s.sourceFrame.width,
  22014. s.sourceFrame.height,
  22015. u,
  22016. c
  22017. )),
  22018. (s.filters = e),
  22019. (s.destinationFrame.width = s.renderTexture.width),
  22020. (s.destinationFrame.height = s.renderTexture.height);
  22021. var m = this.tempRect;
  22022. (m.x = 0),
  22023. (m.y = 0),
  22024. (m.width = s.sourceFrame.width),
  22025. (m.height = s.sourceFrame.height),
  22026. (s.renderTexture.filterFrame = s.sourceFrame),
  22027. s.bindingSourceFrame.copyFrom(a.sourceFrame),
  22028. s.bindingDestinationFrame.copyFrom(a.destinationFrame),
  22029. (s.transform = i.projection.transform),
  22030. (i.projection.transform = null),
  22031. a.bind(s.renderTexture, s.sourceFrame, m),
  22032. i.framebuffer.clear(0, 0, 0, 0);
  22033. }),
  22034. (t.prototype.pop = function () {
  22035. var t = this.defaultFilterStack,
  22036. e = t.pop(),
  22037. r = e.filters;
  22038. this.activeState = e;
  22039. var n = this.globalUniforms.uniforms;
  22040. (n.outputFrame = e.sourceFrame), (n.resolution = e.resolution);
  22041. var i = n.inputSize,
  22042. o = n.inputPixel,
  22043. s = n.inputClamp;
  22044. if (
  22045. ((i[0] = e.destinationFrame.width),
  22046. (i[1] = e.destinationFrame.height),
  22047. (i[2] = 1 / i[0]),
  22048. (i[3] = 1 / i[1]),
  22049. (o[0] = Math.round(i[0] * e.resolution)),
  22050. (o[1] = Math.round(i[1] * e.resolution)),
  22051. (o[2] = 1 / o[0]),
  22052. (o[3] = 1 / o[1]),
  22053. (s[0] = 0.5 * o[2]),
  22054. (s[1] = 0.5 * o[3]),
  22055. (s[2] = e.sourceFrame.width * i[2] - 0.5 * o[2]),
  22056. (s[3] = e.sourceFrame.height * i[3] - 0.5 * o[3]),
  22057. e.legacy)
  22058. ) {
  22059. var a = n.filterArea;
  22060. (a[0] = e.destinationFrame.width),
  22061. (a[1] = e.destinationFrame.height),
  22062. (a[2] = e.sourceFrame.x),
  22063. (a[3] = e.sourceFrame.y),
  22064. (n.filterClamp = n.inputClamp);
  22065. }
  22066. this.globalUniforms.update();
  22067. var u = t[t.length - 1];
  22068. if ((this.renderer.framebuffer.blit(), 1 === r.length))
  22069. r[0].apply(this, e.renderTexture, u.renderTexture, UP.BLEND, e),
  22070. this.returnFilterTexture(e.renderTexture);
  22071. else {
  22072. var c = e.renderTexture,
  22073. h = this.getOptimalFilterTexture(c.width, c.height, e.resolution);
  22074. h.filterFrame = c.filterFrame;
  22075. var l = 0;
  22076. for (l = 0; l < r.length - 1; ++l) {
  22077. 1 === l &&
  22078. e.multisample > 1 &&
  22079. ((h = this.getOptimalFilterTexture(
  22080. c.width,
  22081. c.height,
  22082. e.resolution
  22083. )).filterFrame = c.filterFrame),
  22084. r[l].apply(this, c, h, UP.CLEAR, e);
  22085. var d = c;
  22086. (c = h), (h = d);
  22087. }
  22088. r[l].apply(this, c, u.renderTexture, UP.BLEND, e),
  22089. l > 1 &&
  22090. e.multisample > 1 &&
  22091. this.returnFilterTexture(e.renderTexture),
  22092. this.returnFilterTexture(c),
  22093. this.returnFilterTexture(h);
  22094. }
  22095. e.clear(), this.statePool.push(e);
  22096. }),
  22097. (t.prototype.bindAndClear = function (t, e) {
  22098. void 0 === e && (e = UP.CLEAR);
  22099. var r = this.renderer,
  22100. n = r.renderTexture,
  22101. i = r.state;
  22102. if (
  22103. (t ===
  22104. this.defaultFilterStack[this.defaultFilterStack.length - 1]
  22105. .renderTexture
  22106. ? (this.renderer.projection.transform =
  22107. this.activeState.transform)
  22108. : (this.renderer.projection.transform = null),
  22109. t && t.filterFrame)
  22110. ) {
  22111. var o = this.tempRect;
  22112. (o.x = 0),
  22113. (o.y = 0),
  22114. (o.width = t.filterFrame.width),
  22115. (o.height = t.filterFrame.height),
  22116. n.bind(t, t.filterFrame, o);
  22117. } else
  22118. t !==
  22119. this.defaultFilterStack[this.defaultFilterStack.length - 1]
  22120. .renderTexture
  22121. ? n.bind(t)
  22122. : this.renderer.renderTexture.bind(
  22123. t,
  22124. this.activeState.bindingSourceFrame,
  22125. this.activeState.bindingDestinationFrame
  22126. );
  22127. var s = 1 & i.stateId || this.forceClear;
  22128. (e === UP.CLEAR || (e === UP.BLIT && s)) &&
  22129. this.renderer.framebuffer.clear(0, 0, 0, 0);
  22130. }),
  22131. (t.prototype.applyFilter = function (t, e, r, n) {
  22132. var i = this.renderer;
  22133. i.state.set(t.state),
  22134. this.bindAndClear(r, n),
  22135. (t.uniforms.uSampler = e),
  22136. (t.uniforms.filterGlobals = this.globalUniforms),
  22137. i.shader.bind(t),
  22138. (t.legacy = !!t.program.attributeData.aTextureCoord),
  22139. t.legacy
  22140. ? (this.quadUv.map(e._frame, e.filterFrame),
  22141. i.geometry.bind(this.quadUv),
  22142. i.geometry.draw(IP.TRIANGLES))
  22143. : (i.geometry.bind(this.quad),
  22144. i.geometry.draw(IP.TRIANGLE_STRIP));
  22145. }),
  22146. (t.prototype.calculateSpriteMatrix = function (t, e) {
  22147. var r = this.activeState,
  22148. n = r.sourceFrame,
  22149. i = r.destinationFrame,
  22150. o = e._texture.orig,
  22151. s = t.set(i.width, 0, 0, i.height, n.x, n.y),
  22152. a = e.worldTransform.copyTo(CD.TEMP_MATRIX);
  22153. return (
  22154. a.invert(),
  22155. s.prepend(a),
  22156. s.scale(1 / o.width, 1 / o.height),
  22157. s.translate(e.anchor.x, e.anchor.y),
  22158. s
  22159. );
  22160. }),
  22161. (t.prototype.destroy = function () {
  22162. (this.renderer = null), this.texturePool.clear(!1);
  22163. }),
  22164. (t.prototype.getOptimalFilterTexture = function (t, e, r, n) {
  22165. return (
  22166. void 0 === r && (r = 1),
  22167. void 0 === n && (n = WP.NONE),
  22168. this.texturePool.getOptimalTexture(t, e, r, n)
  22169. );
  22170. }),
  22171. (t.prototype.getFilterTexture = function (t, e, r) {
  22172. if ('number' == typeof t) {
  22173. var n = t;
  22174. (t = e), (e = n);
  22175. }
  22176. t = t || this.activeState.renderTexture;
  22177. var i = this.texturePool.getOptimalTexture(
  22178. t.width,
  22179. t.height,
  22180. e || t.resolution,
  22181. r || WP.NONE
  22182. );
  22183. return (i.filterFrame = t.filterFrame), i;
  22184. }),
  22185. (t.prototype.returnFilterTexture = function (t) {
  22186. this.texturePool.returnTexture(t);
  22187. }),
  22188. (t.prototype.emptyPool = function () {
  22189. this.texturePool.clear(!0);
  22190. }),
  22191. (t.prototype.resize = function () {
  22192. this.texturePool.setScreenSize(this.renderer.view);
  22193. }),
  22194. (t.prototype.transformAABB = function (t, e) {
  22195. var r = GL[0],
  22196. n = GL[1],
  22197. i = GL[2],
  22198. o = GL[3];
  22199. r.set(e.left, e.top),
  22200. n.set(e.left, e.bottom),
  22201. i.set(e.right, e.top),
  22202. o.set(e.right, e.bottom),
  22203. t.apply(r, r),
  22204. t.apply(n, n),
  22205. t.apply(i, i),
  22206. t.apply(o, o);
  22207. var s = Math.min(r.x, n.x, i.x, o.x),
  22208. a = Math.min(r.y, n.y, i.y, o.y),
  22209. u = Math.max(r.x, n.x, i.x, o.x),
  22210. c = Math.max(r.y, n.y, i.y, o.y);
  22211. (e.x = s), (e.y = a), (e.width = u - s), (e.height = c - a);
  22212. }),
  22213. (t.prototype.roundFrame = function (t, e, r, n, i) {
  22214. if (
  22215. !(t.width <= 0 || t.height <= 0 || r.width <= 0 || r.height <= 0)
  22216. ) {
  22217. if (i) {
  22218. var o = i.a,
  22219. s = i.b,
  22220. a = i.c,
  22221. u = i.d;
  22222. if (
  22223. (Math.abs(s) > 1e-4 || Math.abs(a) > 1e-4) &&
  22224. (Math.abs(o) > 1e-4 || Math.abs(u) > 1e-4)
  22225. )
  22226. return;
  22227. }
  22228. (i = i ? UL.copyFrom(i) : UL.identity())
  22229. .translate(-r.x, -r.y)
  22230. .scale(n.width / r.width, n.height / r.height)
  22231. .translate(n.x, n.y),
  22232. this.transformAABB(i, t),
  22233. t.ceil(e),
  22234. this.transformAABB(i.invert(), t);
  22235. }
  22236. }),
  22237. t
  22238. );
  22239. })(),
  22240. XL = (function () {
  22241. function t(t) {
  22242. this.renderer = t;
  22243. }
  22244. return (
  22245. (t.prototype.flush = function () {}),
  22246. (t.prototype.destroy = function () {
  22247. this.renderer = null;
  22248. }),
  22249. (t.prototype.start = function () {}),
  22250. (t.prototype.stop = function () {
  22251. this.flush();
  22252. }),
  22253. (t.prototype.render = function (t) {}),
  22254. t
  22255. );
  22256. })(),
  22257. VL = (function () {
  22258. function t(t) {
  22259. (this.renderer = t),
  22260. (this.emptyRenderer = new XL(t)),
  22261. (this.currentRenderer = this.emptyRenderer);
  22262. }
  22263. return (
  22264. (t.prototype.setObjectRenderer = function (t) {
  22265. this.currentRenderer !== t &&
  22266. (this.currentRenderer.stop(),
  22267. (this.currentRenderer = t),
  22268. this.currentRenderer.start());
  22269. }),
  22270. (t.prototype.flush = function () {
  22271. this.setObjectRenderer(this.emptyRenderer);
  22272. }),
  22273. (t.prototype.reset = function () {
  22274. this.setObjectRenderer(this.emptyRenderer);
  22275. }),
  22276. (t.prototype.copyBoundTextures = function (t, e) {
  22277. for (
  22278. var r = this.renderer.texture.boundTextures, n = e - 1;
  22279. n >= 0;
  22280. --n
  22281. )
  22282. (t[n] = r[n] || null), t[n] && (t[n]._batchLocation = n);
  22283. }),
  22284. (t.prototype.boundArray = function (t, e, r, n) {
  22285. for (
  22286. var i = t.elements, o = t.ids, s = t.count, a = 0, u = 0;
  22287. u < s;
  22288. u++
  22289. ) {
  22290. var c = i[u],
  22291. h = c._batchLocation;
  22292. if (h >= 0 && h < n && e[h] === c) o[u] = h;
  22293. else
  22294. for (; a < n; ) {
  22295. var l = e[a];
  22296. if (!l || l._batchEnabled !== r || l._batchLocation !== a) {
  22297. (o[u] = a), (c._batchLocation = a), (e[a] = c);
  22298. break;
  22299. }
  22300. a++;
  22301. }
  22302. }
  22303. }),
  22304. (t.prototype.destroy = function () {
  22305. this.renderer = null;
  22306. }),
  22307. t
  22308. );
  22309. })(),
  22310. HL = 0,
  22311. WL = (function () {
  22312. function t(t) {
  22313. (this.renderer = t),
  22314. (this.webGLVersion = 1),
  22315. (this.extensions = {}),
  22316. (this.supports = { uint32Indices: !1 }),
  22317. (this.handleContextLost = this.handleContextLost.bind(this)),
  22318. (this.handleContextRestored = this.handleContextRestored.bind(this)),
  22319. t.view.addEventListener(
  22320. 'webglcontextlost',
  22321. this.handleContextLost,
  22322. !1
  22323. ),
  22324. t.view.addEventListener(
  22325. 'webglcontextrestored',
  22326. this.handleContextRestored,
  22327. !1
  22328. );
  22329. }
  22330. return (
  22331. Object.defineProperty(t.prototype, 'isLost', {
  22332. get: function () {
  22333. return !this.gl || this.gl.isContextLost();
  22334. },
  22335. enumerable: !1,
  22336. configurable: !0,
  22337. }),
  22338. (t.prototype.contextChange = function (t) {
  22339. (this.gl = t),
  22340. (this.renderer.gl = t),
  22341. (this.renderer.CONTEXT_UID = HL++);
  22342. }),
  22343. (t.prototype.initFromContext = function (t) {
  22344. (this.gl = t),
  22345. this.validateContext(t),
  22346. (this.renderer.gl = t),
  22347. (this.renderer.CONTEXT_UID = HL++),
  22348. this.renderer.runners.contextChange.emit(t);
  22349. }),
  22350. (t.prototype.initFromOptions = function (t) {
  22351. var e = this.createContext(this.renderer.view, t);
  22352. this.initFromContext(e);
  22353. }),
  22354. (t.prototype.createContext = function (t, e) {
  22355. var r;
  22356. if (
  22357. (vA.PREFER_ENV >= CP.WEBGL2 && (r = t.getContext('webgl2', e)), r)
  22358. )
  22359. this.webGLVersion = 2;
  22360. else if (
  22361. ((this.webGLVersion = 1),
  22362. !(r =
  22363. t.getContext('webgl', e) ||
  22364. t.getContext('experimental-webgl', e)))
  22365. )
  22366. throw new Error(
  22367. 'This browser does not support WebGL. Try using the canvas renderer'
  22368. );
  22369. return (this.gl = r), this.getExtensions(), this.gl;
  22370. }),
  22371. (t.prototype.getExtensions = function () {
  22372. var t = this.gl,
  22373. e = {
  22374. loseContext: t.getExtension('WEBGL_lose_context'),
  22375. anisotropicFiltering: t.getExtension(
  22376. 'EXT_texture_filter_anisotropic'
  22377. ),
  22378. floatTextureLinear: t.getExtension('OES_texture_float_linear'),
  22379. s3tc: t.getExtension('WEBGL_compressed_texture_s3tc'),
  22380. s3tc_sRGB: t.getExtension('WEBGL_compressed_texture_s3tc_srgb'),
  22381. etc: t.getExtension('WEBGL_compressed_texture_etc'),
  22382. etc1: t.getExtension('WEBGL_compressed_texture_etc1'),
  22383. pvrtc:
  22384. t.getExtension('WEBGL_compressed_texture_pvrtc') ||
  22385. t.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),
  22386. atc: t.getExtension('WEBGL_compressed_texture_atc'),
  22387. astc: t.getExtension('WEBGL_compressed_texture_astc'),
  22388. };
  22389. 1 === this.webGLVersion
  22390. ? Object.assign(this.extensions, e, {
  22391. drawBuffers: t.getExtension('WEBGL_draw_buffers'),
  22392. depthTexture: t.getExtension('WEBGL_depth_texture'),
  22393. vertexArrayObject:
  22394. t.getExtension('OES_vertex_array_object') ||
  22395. t.getExtension('MOZ_OES_vertex_array_object') ||
  22396. t.getExtension('WEBKIT_OES_vertex_array_object'),
  22397. uint32ElementIndex: t.getExtension('OES_element_index_uint'),
  22398. floatTexture: t.getExtension('OES_texture_float'),
  22399. floatTextureLinear: t.getExtension('OES_texture_float_linear'),
  22400. textureHalfFloat: t.getExtension('OES_texture_half_float'),
  22401. textureHalfFloatLinear: t.getExtension(
  22402. 'OES_texture_half_float_linear'
  22403. ),
  22404. })
  22405. : 2 === this.webGLVersion &&
  22406. Object.assign(this.extensions, e, {
  22407. colorBufferFloat: t.getExtension('EXT_color_buffer_float'),
  22408. });
  22409. }),
  22410. (t.prototype.handleContextLost = function (t) {
  22411. var e = this;
  22412. t.preventDefault(),
  22413. setTimeout(function () {
  22414. e.gl.isContextLost() &&
  22415. e.extensions.loseContext &&
  22416. e.extensions.loseContext.restoreContext();
  22417. }, 0);
  22418. }),
  22419. (t.prototype.handleContextRestored = function () {
  22420. this.renderer.runners.contextChange.emit(this.gl);
  22421. }),
  22422. (t.prototype.destroy = function () {
  22423. var t = this.renderer.view;
  22424. (this.renderer = null),
  22425. t.removeEventListener('webglcontextlost', this.handleContextLost),
  22426. t.removeEventListener(
  22427. 'webglcontextrestored',
  22428. this.handleContextRestored
  22429. ),
  22430. this.gl.useProgram(null),
  22431. this.extensions.loseContext &&
  22432. this.extensions.loseContext.loseContext();
  22433. }),
  22434. (t.prototype.postrender = function () {
  22435. this.renderer.renderingToScreen && this.gl.flush();
  22436. }),
  22437. (t.prototype.validateContext = function (t) {
  22438. var e = t.getContextAttributes(),
  22439. r =
  22440. 'WebGL2RenderingContext' in globalThis &&
  22441. t instanceof globalThis.WebGL2RenderingContext;
  22442. r && (this.webGLVersion = 2),
  22443. e &&
  22444. !e.stencil &&
  22445. console.warn(
  22446. 'Provided WebGL context does not have a stencil buffer, masks may not render correctly'
  22447. );
  22448. var n = r || !!t.getExtension('OES_element_index_uint');
  22449. (this.supports.uint32Indices = n),
  22450. n ||
  22451. console.warn(
  22452. 'Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly'
  22453. );
  22454. }),
  22455. t
  22456. );
  22457. })(),
  22458. YL = function (t) {
  22459. (this.framebuffer = t),
  22460. (this.stencil = null),
  22461. (this.dirtyId = -1),
  22462. (this.dirtyFormat = -1),
  22463. (this.dirtySize = -1),
  22464. (this.multisample = WP.NONE),
  22465. (this.msaaBuffer = null),
  22466. (this.blitFramebuffer = null),
  22467. (this.mipLevel = 0);
  22468. },
  22469. zL = new TD(),
  22470. ZL = (function () {
  22471. function t(t) {
  22472. (this.renderer = t),
  22473. (this.managedFramebuffers = []),
  22474. (this.unknownFramebuffer = new gL(10, 10)),
  22475. (this.msaaSamples = null);
  22476. }
  22477. return (
  22478. (t.prototype.contextChange = function () {
  22479. this.disposeAll(!0);
  22480. var t = (this.gl = this.renderer.gl);
  22481. if (
  22482. ((this.CONTEXT_UID = this.renderer.CONTEXT_UID),
  22483. (this.current = this.unknownFramebuffer),
  22484. (this.viewport = new TD()),
  22485. (this.hasMRT = !0),
  22486. (this.writeDepthTexture = !0),
  22487. 1 === this.renderer.context.webGLVersion)
  22488. ) {
  22489. var e = this.renderer.context.extensions.drawBuffers,
  22490. r = this.renderer.context.extensions.depthTexture;
  22491. vA.PREFER_ENV === CP.WEBGL_LEGACY && ((e = null), (r = null)),
  22492. e
  22493. ? (t.drawBuffers = function (t) {
  22494. return e.drawBuffersWEBGL(t);
  22495. })
  22496. : ((this.hasMRT = !1), (t.drawBuffers = function () {})),
  22497. r || (this.writeDepthTexture = !1);
  22498. } else
  22499. this.msaaSamples = t.getInternalformatParameter(
  22500. t.RENDERBUFFER,
  22501. t.RGBA8,
  22502. t.SAMPLES
  22503. );
  22504. }),
  22505. (t.prototype.bind = function (t, e, r) {
  22506. void 0 === r && (r = 0);
  22507. var n = this.gl;
  22508. if (t) {
  22509. var i =
  22510. t.glFramebuffers[this.CONTEXT_UID] || this.initFramebuffer(t);
  22511. this.current !== t &&
  22512. ((this.current = t),
  22513. n.bindFramebuffer(n.FRAMEBUFFER, i.framebuffer)),
  22514. i.mipLevel !== r &&
  22515. (t.dirtyId++, t.dirtyFormat++, (i.mipLevel = r)),
  22516. i.dirtyId !== t.dirtyId &&
  22517. ((i.dirtyId = t.dirtyId),
  22518. i.dirtyFormat !== t.dirtyFormat
  22519. ? ((i.dirtyFormat = t.dirtyFormat),
  22520. (i.dirtySize = t.dirtySize),
  22521. this.updateFramebuffer(t, r))
  22522. : i.dirtySize !== t.dirtySize &&
  22523. ((i.dirtySize = t.dirtySize), this.resizeFramebuffer(t)));
  22524. for (var o = 0; o < t.colorTextures.length; o++) {
  22525. var s = t.colorTextures[o];
  22526. this.renderer.texture.unbind(s.parentTextureArray || s);
  22527. }
  22528. if (
  22529. (t.depthTexture && this.renderer.texture.unbind(t.depthTexture),
  22530. e)
  22531. ) {
  22532. var a = e.width >> r,
  22533. u = e.height >> r,
  22534. c = a / e.width;
  22535. this.setViewport(e.x * c, e.y * c, a, u);
  22536. } else {
  22537. (a = t.width >> r), (u = t.height >> r);
  22538. this.setViewport(0, 0, a, u);
  22539. }
  22540. } else
  22541. this.current &&
  22542. ((this.current = null), n.bindFramebuffer(n.FRAMEBUFFER, null)),
  22543. e
  22544. ? this.setViewport(e.x, e.y, e.width, e.height)
  22545. : this.setViewport(
  22546. 0,
  22547. 0,
  22548. this.renderer.width,
  22549. this.renderer.height
  22550. );
  22551. }),
  22552. (t.prototype.setViewport = function (t, e, r, n) {
  22553. var i = this.viewport;
  22554. (t = Math.round(t)),
  22555. (e = Math.round(e)),
  22556. (r = Math.round(r)),
  22557. (n = Math.round(n)),
  22558. (i.width === r && i.height === n && i.x === t && i.y === e) ||
  22559. ((i.x = t),
  22560. (i.y = e),
  22561. (i.width = r),
  22562. (i.height = n),
  22563. this.gl.viewport(t, e, r, n));
  22564. }),
  22565. Object.defineProperty(t.prototype, 'size', {
  22566. get: function () {
  22567. return this.current
  22568. ? {
  22569. x: 0,
  22570. y: 0,
  22571. width: this.current.width,
  22572. height: this.current.height,
  22573. }
  22574. : {
  22575. x: 0,
  22576. y: 0,
  22577. width: this.renderer.width,
  22578. height: this.renderer.height,
  22579. };
  22580. },
  22581. enumerable: !1,
  22582. configurable: !0,
  22583. }),
  22584. (t.prototype.clear = function (t, e, r, n, i) {
  22585. void 0 === i && (i = AP.COLOR | AP.DEPTH);
  22586. var o = this.gl;
  22587. o.clearColor(t, e, r, n), o.clear(i);
  22588. }),
  22589. (t.prototype.initFramebuffer = function (t) {
  22590. var e = this.gl,
  22591. r = new YL(e.createFramebuffer());
  22592. return (
  22593. (r.multisample = this.detectSamples(t.multisample)),
  22594. (t.glFramebuffers[this.CONTEXT_UID] = r),
  22595. this.managedFramebuffers.push(t),
  22596. t.disposeRunner.add(this),
  22597. r
  22598. );
  22599. }),
  22600. (t.prototype.resizeFramebuffer = function (t) {
  22601. var e = this.gl,
  22602. r = t.glFramebuffers[this.CONTEXT_UID];
  22603. r.msaaBuffer &&
  22604. (e.bindRenderbuffer(e.RENDERBUFFER, r.msaaBuffer),
  22605. e.renderbufferStorageMultisample(
  22606. e.RENDERBUFFER,
  22607. r.multisample,
  22608. e.RGBA8,
  22609. t.width,
  22610. t.height
  22611. )),
  22612. r.stencil &&
  22613. (e.bindRenderbuffer(e.RENDERBUFFER, r.stencil),
  22614. r.msaaBuffer
  22615. ? e.renderbufferStorageMultisample(
  22616. e.RENDERBUFFER,
  22617. r.multisample,
  22618. e.DEPTH24_STENCIL8,
  22619. t.width,
  22620. t.height
  22621. )
  22622. : e.renderbufferStorage(
  22623. e.RENDERBUFFER,
  22624. e.DEPTH_STENCIL,
  22625. t.width,
  22626. t.height
  22627. ));
  22628. var n = t.colorTextures,
  22629. i = n.length;
  22630. e.drawBuffers || (i = Math.min(i, 1));
  22631. for (var o = 0; o < i; o++) {
  22632. var s = n[o],
  22633. a = s.parentTextureArray || s;
  22634. this.renderer.texture.bind(a, 0);
  22635. }
  22636. t.depthTexture &&
  22637. this.writeDepthTexture &&
  22638. this.renderer.texture.bind(t.depthTexture, 0);
  22639. }),
  22640. (t.prototype.updateFramebuffer = function (t, e) {
  22641. var r = this.gl,
  22642. n = t.glFramebuffers[this.CONTEXT_UID],
  22643. i = t.colorTextures,
  22644. o = i.length;
  22645. r.drawBuffers || (o = Math.min(o, 1)),
  22646. n.multisample > 1 && this.canMultisampleFramebuffer(t)
  22647. ? ((n.msaaBuffer = n.msaaBuffer || r.createRenderbuffer()),
  22648. r.bindRenderbuffer(r.RENDERBUFFER, n.msaaBuffer),
  22649. r.renderbufferStorageMultisample(
  22650. r.RENDERBUFFER,
  22651. n.multisample,
  22652. r.RGBA8,
  22653. t.width,
  22654. t.height
  22655. ),
  22656. r.framebufferRenderbuffer(
  22657. r.FRAMEBUFFER,
  22658. r.COLOR_ATTACHMENT0,
  22659. r.RENDERBUFFER,
  22660. n.msaaBuffer
  22661. ))
  22662. : n.msaaBuffer &&
  22663. (r.deleteRenderbuffer(n.msaaBuffer),
  22664. (n.msaaBuffer = null),
  22665. n.blitFramebuffer &&
  22666. (n.blitFramebuffer.dispose(), (n.blitFramebuffer = null)));
  22667. for (var s = [], a = 0; a < o; a++) {
  22668. var u = i[a],
  22669. c = u.parentTextureArray || u;
  22670. this.renderer.texture.bind(c, 0),
  22671. (0 === a && n.msaaBuffer) ||
  22672. (r.framebufferTexture2D(
  22673. r.FRAMEBUFFER,
  22674. r.COLOR_ATTACHMENT0 + a,
  22675. u.target,
  22676. c._glTextures[this.CONTEXT_UID].texture,
  22677. e
  22678. ),
  22679. s.push(r.COLOR_ATTACHMENT0 + a));
  22680. }
  22681. if (
  22682. (s.length > 1 && r.drawBuffers(s), t.depthTexture) &&
  22683. this.writeDepthTexture
  22684. ) {
  22685. var h = t.depthTexture;
  22686. this.renderer.texture.bind(h, 0),
  22687. r.framebufferTexture2D(
  22688. r.FRAMEBUFFER,
  22689. r.DEPTH_ATTACHMENT,
  22690. r.TEXTURE_2D,
  22691. h._glTextures[this.CONTEXT_UID].texture,
  22692. e
  22693. );
  22694. }
  22695. (!t.stencil && !t.depth) || (t.depthTexture && this.writeDepthTexture)
  22696. ? n.stencil && (r.deleteRenderbuffer(n.stencil), (n.stencil = null))
  22697. : ((n.stencil = n.stencil || r.createRenderbuffer()),
  22698. r.bindRenderbuffer(r.RENDERBUFFER, n.stencil),
  22699. n.msaaBuffer
  22700. ? r.renderbufferStorageMultisample(
  22701. r.RENDERBUFFER,
  22702. n.multisample,
  22703. r.DEPTH24_STENCIL8,
  22704. t.width,
  22705. t.height
  22706. )
  22707. : r.renderbufferStorage(
  22708. r.RENDERBUFFER,
  22709. r.DEPTH_STENCIL,
  22710. t.width,
  22711. t.height
  22712. ),
  22713. r.framebufferRenderbuffer(
  22714. r.FRAMEBUFFER,
  22715. r.DEPTH_STENCIL_ATTACHMENT,
  22716. r.RENDERBUFFER,
  22717. n.stencil
  22718. ));
  22719. }),
  22720. (t.prototype.canMultisampleFramebuffer = function (t) {
  22721. return (
  22722. 1 !== this.renderer.context.webGLVersion &&
  22723. t.colorTextures.length <= 1 &&
  22724. !t.depthTexture
  22725. );
  22726. }),
  22727. (t.prototype.detectSamples = function (t) {
  22728. var e = this.msaaSamples,
  22729. r = WP.NONE;
  22730. if (t <= 1 || null === e) return r;
  22731. for (var n = 0; n < e.length; n++)
  22732. if (e[n] <= t) {
  22733. r = e[n];
  22734. break;
  22735. }
  22736. return 1 === r && (r = WP.NONE), r;
  22737. }),
  22738. (t.prototype.blit = function (t, e, r) {
  22739. var n = this,
  22740. i = n.current,
  22741. o = n.renderer,
  22742. s = n.gl,
  22743. a = n.CONTEXT_UID;
  22744. if (2 === o.context.webGLVersion && i) {
  22745. var u = i.glFramebuffers[a];
  22746. if (u) {
  22747. if (!t) {
  22748. if (!u.msaaBuffer) return;
  22749. var c = i.colorTextures[0];
  22750. if (!c) return;
  22751. u.blitFramebuffer ||
  22752. ((u.blitFramebuffer = new gL(i.width, i.height)),
  22753. u.blitFramebuffer.addColorTexture(0, c)),
  22754. (t = u.blitFramebuffer).colorTextures[0] !== c &&
  22755. ((t.colorTextures[0] = c), t.dirtyId++, t.dirtyFormat++),
  22756. (t.width === i.width && t.height === i.height) ||
  22757. ((t.width = i.width),
  22758. (t.height = i.height),
  22759. t.dirtyId++,
  22760. t.dirtySize++);
  22761. }
  22762. e || (((e = zL).width = i.width), (e.height = i.height)),
  22763. r || (r = e);
  22764. var h = e.width === r.width && e.height === r.height;
  22765. this.bind(t),
  22766. s.bindFramebuffer(s.READ_FRAMEBUFFER, u.framebuffer),
  22767. s.blitFramebuffer(
  22768. e.left,
  22769. e.top,
  22770. e.right,
  22771. e.bottom,
  22772. r.left,
  22773. r.top,
  22774. r.right,
  22775. r.bottom,
  22776. s.COLOR_BUFFER_BIT,
  22777. h ? s.NEAREST : s.LINEAR
  22778. );
  22779. }
  22780. }
  22781. }),
  22782. (t.prototype.disposeFramebuffer = function (t, e) {
  22783. var r = t.glFramebuffers[this.CONTEXT_UID],
  22784. n = this.gl;
  22785. if (r) {
  22786. delete t.glFramebuffers[this.CONTEXT_UID];
  22787. var i = this.managedFramebuffers.indexOf(t);
  22788. i >= 0 && this.managedFramebuffers.splice(i, 1),
  22789. t.disposeRunner.remove(this),
  22790. e ||
  22791. (n.deleteFramebuffer(r.framebuffer),
  22792. r.msaaBuffer && n.deleteRenderbuffer(r.msaaBuffer),
  22793. r.stencil && n.deleteRenderbuffer(r.stencil)),
  22794. r.blitFramebuffer && r.blitFramebuffer.dispose();
  22795. }
  22796. }),
  22797. (t.prototype.disposeAll = function (t) {
  22798. var e = this.managedFramebuffers;
  22799. this.managedFramebuffers = [];
  22800. for (var r = 0; r < e.length; r++) this.disposeFramebuffer(e[r], t);
  22801. }),
  22802. (t.prototype.forceStencil = function () {
  22803. var t = this.current;
  22804. if (t) {
  22805. var e = t.glFramebuffers[this.CONTEXT_UID];
  22806. if (e && !e.stencil) {
  22807. t.stencil = !0;
  22808. var r = t.width,
  22809. n = t.height,
  22810. i = this.gl,
  22811. o = i.createRenderbuffer();
  22812. i.bindRenderbuffer(i.RENDERBUFFER, o),
  22813. e.msaaBuffer
  22814. ? i.renderbufferStorageMultisample(
  22815. i.RENDERBUFFER,
  22816. e.multisample,
  22817. i.DEPTH24_STENCIL8,
  22818. r,
  22819. n
  22820. )
  22821. : i.renderbufferStorage(
  22822. i.RENDERBUFFER,
  22823. i.DEPTH_STENCIL,
  22824. r,
  22825. n
  22826. ),
  22827. (e.stencil = o),
  22828. i.framebufferRenderbuffer(
  22829. i.FRAMEBUFFER,
  22830. i.DEPTH_STENCIL_ATTACHMENT,
  22831. i.RENDERBUFFER,
  22832. o
  22833. );
  22834. }
  22835. }
  22836. }),
  22837. (t.prototype.reset = function () {
  22838. (this.current = this.unknownFramebuffer), (this.viewport = new TD());
  22839. }),
  22840. (t.prototype.destroy = function () {
  22841. this.renderer = null;
  22842. }),
  22843. t
  22844. );
  22845. })(),
  22846. JL = { 5126: 4, 5123: 2, 5121: 1 },
  22847. KL = (function () {
  22848. function t(t) {
  22849. (this.renderer = t),
  22850. (this._activeGeometry = null),
  22851. (this._activeVao = null),
  22852. (this.hasVao = !0),
  22853. (this.hasInstance = !0),
  22854. (this.canUseUInt32ElementIndex = !1),
  22855. (this.managedGeometries = {});
  22856. }
  22857. return (
  22858. (t.prototype.contextChange = function () {
  22859. this.disposeAll(!0);
  22860. var t = (this.gl = this.renderer.gl),
  22861. e = this.renderer.context;
  22862. if (
  22863. ((this.CONTEXT_UID = this.renderer.CONTEXT_UID),
  22864. 2 !== e.webGLVersion)
  22865. ) {
  22866. var r = this.renderer.context.extensions.vertexArrayObject;
  22867. vA.PREFER_ENV === CP.WEBGL_LEGACY && (r = null),
  22868. r
  22869. ? ((t.createVertexArray = function () {
  22870. return r.createVertexArrayOES();
  22871. }),
  22872. (t.bindVertexArray = function (t) {
  22873. return r.bindVertexArrayOES(t);
  22874. }),
  22875. (t.deleteVertexArray = function (t) {
  22876. return r.deleteVertexArrayOES(t);
  22877. }))
  22878. : ((this.hasVao = !1),
  22879. (t.createVertexArray = function () {
  22880. return null;
  22881. }),
  22882. (t.bindVertexArray = function () {
  22883. return null;
  22884. }),
  22885. (t.deleteVertexArray = function () {
  22886. return null;
  22887. }));
  22888. }
  22889. if (2 !== e.webGLVersion) {
  22890. var n = t.getExtension('ANGLE_instanced_arrays');
  22891. n
  22892. ? ((t.vertexAttribDivisor = function (t, e) {
  22893. return n.vertexAttribDivisorANGLE(t, e);
  22894. }),
  22895. (t.drawElementsInstanced = function (t, e, r, i, o) {
  22896. return n.drawElementsInstancedANGLE(t, e, r, i, o);
  22897. }),
  22898. (t.drawArraysInstanced = function (t, e, r, i) {
  22899. return n.drawArraysInstancedANGLE(t, e, r, i);
  22900. }))
  22901. : (this.hasInstance = !1);
  22902. }
  22903. this.canUseUInt32ElementIndex =
  22904. 2 === e.webGLVersion || !!e.extensions.uint32ElementIndex;
  22905. }),
  22906. (t.prototype.bind = function (t, e) {
  22907. e = e || this.renderer.shader.shader;
  22908. var r = this.gl,
  22909. n = t.glVertexArrayObjects[this.CONTEXT_UID],
  22910. i = !1;
  22911. n ||
  22912. ((this.managedGeometries[t.id] = t),
  22913. t.disposeRunner.add(this),
  22914. (t.glVertexArrayObjects[this.CONTEXT_UID] = n = {}),
  22915. (i = !0));
  22916. var o = n[e.program.id] || this.initGeometryVao(t, e, i);
  22917. (this._activeGeometry = t),
  22918. this._activeVao !== o &&
  22919. ((this._activeVao = o),
  22920. this.hasVao
  22921. ? r.bindVertexArray(o)
  22922. : this.activateVao(t, e.program)),
  22923. this.updateBuffers();
  22924. }),
  22925. (t.prototype.reset = function () {
  22926. this.unbind();
  22927. }),
  22928. (t.prototype.updateBuffers = function () {
  22929. for (
  22930. var t = this._activeGeometry, e = this.renderer.buffer, r = 0;
  22931. r < t.buffers.length;
  22932. r++
  22933. ) {
  22934. var n = t.buffers[r];
  22935. e.update(n);
  22936. }
  22937. }),
  22938. (t.prototype.checkCompatibility = function (t, e) {
  22939. var r = t.attributes,
  22940. n = e.attributeData;
  22941. for (var i in n)
  22942. if (!r[i])
  22943. throw new Error(
  22944. 'shader and geometry incompatible, geometry missing the "' +
  22945. i +
  22946. '" attribute'
  22947. );
  22948. }),
  22949. (t.prototype.getSignature = function (t, e) {
  22950. var r = t.attributes,
  22951. n = e.attributeData,
  22952. i = ['g', t.id];
  22953. for (var o in r) n[o] && i.push(o, n[o].location);
  22954. return i.join('-');
  22955. }),
  22956. (t.prototype.initGeometryVao = function (t, e, r) {
  22957. void 0 === r && (r = !0);
  22958. var n = this.gl,
  22959. i = this.CONTEXT_UID,
  22960. o = this.renderer.buffer,
  22961. s = e.program;
  22962. s.glPrograms[i] || this.renderer.shader.generateProgram(e),
  22963. this.checkCompatibility(t, s);
  22964. var a = this.getSignature(t, s),
  22965. u = t.glVertexArrayObjects[this.CONTEXT_UID],
  22966. c = u[a];
  22967. if (c) return (u[s.id] = c), c;
  22968. var h = t.buffers,
  22969. l = t.attributes,
  22970. d = {},
  22971. f = {};
  22972. for (var p in h) (d[p] = 0), (f[p] = 0);
  22973. for (var p in l)
  22974. !l[p].size && s.attributeData[p]
  22975. ? (l[p].size = s.attributeData[p].size)
  22976. : l[p].size ||
  22977. console.warn(
  22978. "PIXI Geometry attribute '" +
  22979. p +
  22980. "' size cannot be determined (likely the bound shader does not have the attribute)"
  22981. ),
  22982. (d[l[p].buffer] += l[p].size * JL[l[p].type]);
  22983. for (var p in l) {
  22984. var v = l[p],
  22985. m = v.size;
  22986. void 0 === v.stride &&
  22987. (d[v.buffer] === m * JL[v.type]
  22988. ? (v.stride = 0)
  22989. : (v.stride = d[v.buffer])),
  22990. void 0 === v.start &&
  22991. ((v.start = f[v.buffer]), (f[v.buffer] += m * JL[v.type]));
  22992. }
  22993. (c = n.createVertexArray()), n.bindVertexArray(c);
  22994. for (var y = 0; y < h.length; y++) {
  22995. var g = h[y];
  22996. o.bind(g), r && g._glBuffers[i].refCount++;
  22997. }
  22998. return (
  22999. this.activateVao(t, s),
  23000. (this._activeVao = c),
  23001. (u[s.id] = c),
  23002. (u[a] = c),
  23003. c
  23004. );
  23005. }),
  23006. (t.prototype.disposeGeometry = function (t, e) {
  23007. var r;
  23008. if (this.managedGeometries[t.id]) {
  23009. delete this.managedGeometries[t.id];
  23010. var n = t.glVertexArrayObjects[this.CONTEXT_UID],
  23011. i = this.gl,
  23012. o = t.buffers,
  23013. s =
  23014. null === (r = this.renderer) || void 0 === r
  23015. ? void 0
  23016. : r.buffer;
  23017. if ((t.disposeRunner.remove(this), n)) {
  23018. if (s)
  23019. for (var a = 0; a < o.length; a++) {
  23020. var u = o[a]._glBuffers[this.CONTEXT_UID];
  23021. u &&
  23022. (u.refCount--, 0 !== u.refCount || e || s.dispose(o[a], e));
  23023. }
  23024. if (!e)
  23025. for (var c in n)
  23026. if ('g' === c[0]) {
  23027. var h = n[c];
  23028. this._activeVao === h && this.unbind(),
  23029. i.deleteVertexArray(h);
  23030. }
  23031. delete t.glVertexArrayObjects[this.CONTEXT_UID];
  23032. }
  23033. }
  23034. }),
  23035. (t.prototype.disposeAll = function (t) {
  23036. for (
  23037. var e = Object.keys(this.managedGeometries), r = 0;
  23038. r < e.length;
  23039. r++
  23040. )
  23041. this.disposeGeometry(this.managedGeometries[e[r]], t);
  23042. }),
  23043. (t.prototype.activateVao = function (t, e) {
  23044. var r = this.gl,
  23045. n = this.CONTEXT_UID,
  23046. i = this.renderer.buffer,
  23047. o = t.buffers,
  23048. s = t.attributes;
  23049. t.indexBuffer && i.bind(t.indexBuffer);
  23050. var a = null;
  23051. for (var u in s) {
  23052. var c = s[u],
  23053. h = o[c.buffer],
  23054. l = h._glBuffers[n];
  23055. if (e.attributeData[u]) {
  23056. a !== l && (i.bind(h), (a = l));
  23057. var d = e.attributeData[u].location;
  23058. if (
  23059. (r.enableVertexAttribArray(d),
  23060. r.vertexAttribPointer(
  23061. d,
  23062. c.size,
  23063. c.type || r.FLOAT,
  23064. c.normalized,
  23065. c.stride,
  23066. c.start
  23067. ),
  23068. c.instance)
  23069. ) {
  23070. if (!this.hasInstance)
  23071. throw new Error(
  23072. 'geometry error, GPU Instancing is not supported on this device'
  23073. );
  23074. r.vertexAttribDivisor(d, 1);
  23075. }
  23076. }
  23077. }
  23078. }),
  23079. (t.prototype.draw = function (t, e, r, n) {
  23080. var i = this.gl,
  23081. o = this._activeGeometry;
  23082. if (o.indexBuffer) {
  23083. var s = o.indexBuffer.data.BYTES_PER_ELEMENT,
  23084. a = 2 === s ? i.UNSIGNED_SHORT : i.UNSIGNED_INT;
  23085. 2 === s || (4 === s && this.canUseUInt32ElementIndex)
  23086. ? o.instanced
  23087. ? i.drawElementsInstanced(
  23088. t,
  23089. e || o.indexBuffer.data.length,
  23090. a,
  23091. (r || 0) * s,
  23092. n || 1
  23093. )
  23094. : i.drawElements(
  23095. t,
  23096. e || o.indexBuffer.data.length,
  23097. a,
  23098. (r || 0) * s
  23099. )
  23100. : console.warn('unsupported index buffer type: uint32');
  23101. } else
  23102. o.instanced
  23103. ? i.drawArraysInstanced(t, r, e || o.getSize(), n || 1)
  23104. : i.drawArrays(t, r, e || o.getSize());
  23105. return this;
  23106. }),
  23107. (t.prototype.unbind = function () {
  23108. this.gl.bindVertexArray(null),
  23109. (this._activeVao = null),
  23110. (this._activeGeometry = null);
  23111. }),
  23112. (t.prototype.destroy = function () {
  23113. this.renderer = null;
  23114. }),
  23115. t
  23116. );
  23117. })(),
  23118. qL = (function () {
  23119. function t(t) {
  23120. void 0 === t && (t = null),
  23121. (this.type = VP.NONE),
  23122. (this.autoDetect = !0),
  23123. (this.maskObject = t || null),
  23124. (this.pooled = !1),
  23125. (this.isMaskData = !0),
  23126. (this.resolution = null),
  23127. (this.multisample = vA.FILTER_MULTISAMPLE),
  23128. (this.enabled = !0),
  23129. (this.colorMask = 15),
  23130. (this._filters = null),
  23131. (this._stencilCounter = 0),
  23132. (this._scissorCounter = 0),
  23133. (this._scissorRect = null),
  23134. (this._scissorRectLocal = null),
  23135. (this._colorMask = 15),
  23136. (this._target = null);
  23137. }
  23138. return (
  23139. Object.defineProperty(t.prototype, 'filter', {
  23140. get: function () {
  23141. return this._filters ? this._filters[0] : null;
  23142. },
  23143. set: function (t) {
  23144. t
  23145. ? this._filters
  23146. ? (this._filters[0] = t)
  23147. : (this._filters = [t])
  23148. : (this._filters = null);
  23149. },
  23150. enumerable: !1,
  23151. configurable: !0,
  23152. }),
  23153. (t.prototype.reset = function () {
  23154. this.pooled &&
  23155. ((this.maskObject = null),
  23156. (this.type = VP.NONE),
  23157. (this.autoDetect = !0)),
  23158. (this._target = null),
  23159. (this._scissorRectLocal = null);
  23160. }),
  23161. (t.prototype.copyCountersOrReset = function (t) {
  23162. t
  23163. ? ((this._stencilCounter = t._stencilCounter),
  23164. (this._scissorCounter = t._scissorCounter),
  23165. (this._scissorRect = t._scissorRect))
  23166. : ((this._stencilCounter = 0),
  23167. (this._scissorCounter = 0),
  23168. (this._scissorRect = null));
  23169. }),
  23170. t
  23171. );
  23172. })();
  23173. function QL(t, e, r) {
  23174. var n = t.createShader(e);
  23175. return t.shaderSource(n, r), t.compileShader(n), n;
  23176. }
  23177. function $L(t, e) {
  23178. var r = t
  23179. .getShaderSource(e)
  23180. .split('\n')
  23181. .map(function (t, e) {
  23182. return e + ': ' + t;
  23183. }),
  23184. n = t.getShaderInfoLog(e),
  23185. i = n.split('\n'),
  23186. o = {},
  23187. s = i
  23188. .map(function (t) {
  23189. return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/, '$1'));
  23190. })
  23191. .filter(function (t) {
  23192. return !(!t || o[t]) && ((o[t] = !0), !0);
  23193. }),
  23194. a = [''];
  23195. s.forEach(function (t) {
  23196. (r[t - 1] = '%c' + r[t - 1] + '%c'),
  23197. a.push(
  23198. 'background: #FF0000; color:#FFFFFF; font-size: 10px',
  23199. 'font-size: 10px'
  23200. );
  23201. });
  23202. var u = r.join('\n');
  23203. (a[0] = u),
  23204. console.error(n),
  23205. console.groupCollapsed('click to view full shader code'),
  23206. console.warn.apply(console, a),
  23207. console.groupEnd();
  23208. }
  23209. function tF(t) {
  23210. for (var e = new Array(t), r = 0; r < e.length; r++) e[r] = !1;
  23211. return e;
  23212. }
  23213. function eF(t, e) {
  23214. switch (t) {
  23215. case 'float':
  23216. case 'int':
  23217. case 'uint':
  23218. case 'sampler2D':
  23219. case 'sampler2DArray':
  23220. return 0;
  23221. case 'vec2':
  23222. return new Float32Array(2 * e);
  23223. case 'vec3':
  23224. return new Float32Array(3 * e);
  23225. case 'vec4':
  23226. return new Float32Array(4 * e);
  23227. case 'ivec2':
  23228. return new Int32Array(2 * e);
  23229. case 'ivec3':
  23230. return new Int32Array(3 * e);
  23231. case 'ivec4':
  23232. return new Int32Array(4 * e);
  23233. case 'uvec2':
  23234. return new Uint32Array(2 * e);
  23235. case 'uvec3':
  23236. return new Uint32Array(3 * e);
  23237. case 'uvec4':
  23238. return new Uint32Array(4 * e);
  23239. case 'bool':
  23240. return !1;
  23241. case 'bvec2':
  23242. return tF(2 * e);
  23243. case 'bvec3':
  23244. return tF(3 * e);
  23245. case 'bvec4':
  23246. return tF(4 * e);
  23247. case 'mat2':
  23248. return new Float32Array([1, 0, 0, 1]);
  23249. case 'mat3':
  23250. return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
  23251. case 'mat4':
  23252. return new Float32Array([
  23253. 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
  23254. ]);
  23255. }
  23256. return null;
  23257. }
  23258. var rF,
  23259. nF = {},
  23260. iF = nF;
  23261. function oF() {
  23262. if (!rF) {
  23263. rF = XP.MEDIUM;
  23264. var t = (function () {
  23265. if (iF === nF || (iF && iF.isContextLost())) {
  23266. var t = vA.ADAPTER.createCanvas(),
  23267. e = void 0;
  23268. vA.PREFER_ENV >= CP.WEBGL2 && (e = t.getContext('webgl2', {})),
  23269. e ||
  23270. ((e =
  23271. t.getContext('webgl', {}) ||
  23272. t.getContext('experimental-webgl', {}))
  23273. ? e.getExtension('WEBGL_draw_buffers')
  23274. : (e = null)),
  23275. (iF = e);
  23276. }
  23277. return iF;
  23278. })();
  23279. if (t && t.getShaderPrecisionFormat) {
  23280. var e = t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT);
  23281. rF = e.precision ? XP.HIGH : XP.MEDIUM;
  23282. }
  23283. }
  23284. return rF;
  23285. }
  23286. function sF(t, e, r) {
  23287. if ('precision' !== t.substring(0, 9)) {
  23288. var n = e;
  23289. return (
  23290. e === XP.HIGH && r !== XP.HIGH && (n = XP.MEDIUM),
  23291. 'precision ' + n + ' float;\n' + t
  23292. );
  23293. }
  23294. return r !== XP.HIGH && 'precision highp' === t.substring(0, 15)
  23295. ? t.replace('precision highp', 'precision mediump')
  23296. : t;
  23297. }
  23298. var aF = {
  23299. float: 1,
  23300. vec2: 2,
  23301. vec3: 3,
  23302. vec4: 4,
  23303. int: 1,
  23304. ivec2: 2,
  23305. ivec3: 3,
  23306. ivec4: 4,
  23307. uint: 1,
  23308. uvec2: 2,
  23309. uvec3: 3,
  23310. uvec4: 4,
  23311. bool: 1,
  23312. bvec2: 2,
  23313. bvec3: 3,
  23314. bvec4: 4,
  23315. mat2: 4,
  23316. mat3: 9,
  23317. mat4: 16,
  23318. sampler2D: 1,
  23319. };
  23320. function uF(t) {
  23321. return aF[t];
  23322. }
  23323. var cF = null,
  23324. hF = {
  23325. FLOAT: 'float',
  23326. FLOAT_VEC2: 'vec2',
  23327. FLOAT_VEC3: 'vec3',
  23328. FLOAT_VEC4: 'vec4',
  23329. INT: 'int',
  23330. INT_VEC2: 'ivec2',
  23331. INT_VEC3: 'ivec3',
  23332. INT_VEC4: 'ivec4',
  23333. UNSIGNED_INT: 'uint',
  23334. UNSIGNED_INT_VEC2: 'uvec2',
  23335. UNSIGNED_INT_VEC3: 'uvec3',
  23336. UNSIGNED_INT_VEC4: 'uvec4',
  23337. BOOL: 'bool',
  23338. BOOL_VEC2: 'bvec2',
  23339. BOOL_VEC3: 'bvec3',
  23340. BOOL_VEC4: 'bvec4',
  23341. FLOAT_MAT2: 'mat2',
  23342. FLOAT_MAT3: 'mat3',
  23343. FLOAT_MAT4: 'mat4',
  23344. SAMPLER_2D: 'sampler2D',
  23345. INT_SAMPLER_2D: 'sampler2D',
  23346. UNSIGNED_INT_SAMPLER_2D: 'sampler2D',
  23347. SAMPLER_CUBE: 'samplerCube',
  23348. INT_SAMPLER_CUBE: 'samplerCube',
  23349. UNSIGNED_INT_SAMPLER_CUBE: 'samplerCube',
  23350. SAMPLER_2D_ARRAY: 'sampler2DArray',
  23351. INT_SAMPLER_2D_ARRAY: 'sampler2DArray',
  23352. UNSIGNED_INT_SAMPLER_2D_ARRAY: 'sampler2DArray',
  23353. };
  23354. function lF(t, e) {
  23355. if (!cF) {
  23356. var r = Object.keys(hF);
  23357. cF = {};
  23358. for (var n = 0; n < r.length; ++n) {
  23359. var i = r[n];
  23360. cF[t[i]] = hF[i];
  23361. }
  23362. }
  23363. return cF[e];
  23364. }
  23365. var dF = [
  23366. {
  23367. test: function (t) {
  23368. return 'float' === t.type && 1 === t.size && !t.isArray;
  23369. },
  23370. code: function (t) {
  23371. return (
  23372. '\n if(uv["' +
  23373. t +
  23374. '"] !== ud["' +
  23375. t +
  23376. '"].value)\n {\n ud["' +
  23377. t +
  23378. '"].value = uv["' +
  23379. t +
  23380. '"]\n gl.uniform1f(ud["' +
  23381. t +
  23382. '"].location, uv["' +
  23383. t +
  23384. '"])\n }\n '
  23385. );
  23386. },
  23387. },
  23388. {
  23389. test: function (t, e) {
  23390. return !(
  23391. ('sampler2D' !== t.type &&
  23392. 'samplerCube' !== t.type &&
  23393. 'sampler2DArray' !== t.type) ||
  23394. 1 !== t.size ||
  23395. t.isArray ||
  23396. (null != e && void 0 === e.castToBaseTexture)
  23397. );
  23398. },
  23399. code: function (t) {
  23400. return (
  23401. 't = syncData.textureCount++;\n\n renderer.texture.bind(uv["' +
  23402. t +
  23403. '"], t);\n\n if(ud["' +
  23404. t +
  23405. '"].value !== t)\n {\n ud["' +
  23406. t +
  23407. '"].value = t;\n gl.uniform1i(ud["' +
  23408. t +
  23409. '"].location, t);\n; // eslint-disable-line max-len\n }'
  23410. );
  23411. },
  23412. },
  23413. {
  23414. test: function (t, e) {
  23415. return (
  23416. 'mat3' === t.type && 1 === t.size && !t.isArray && void 0 !== e.a
  23417. );
  23418. },
  23419. code: function (t) {
  23420. return (
  23421. '\n gl.uniformMatrix3fv(ud["' +
  23422. t +
  23423. '"].location, false, uv["' +
  23424. t +
  23425. '"].toArray(true));\n '
  23426. );
  23427. },
  23428. codeUbo: function (t) {
  23429. return (
  23430. '\n var ' +
  23431. t +
  23432. '_matrix = uv.' +
  23433. t +
  23434. '.toArray(true);\n\n data[offset] = ' +
  23435. t +
  23436. '_matrix[0];\n data[offset+1] = ' +
  23437. t +
  23438. '_matrix[1];\n data[offset+2] = ' +
  23439. t +
  23440. '_matrix[2];\n \n data[offset + 4] = ' +
  23441. t +
  23442. '_matrix[3];\n data[offset + 5] = ' +
  23443. t +
  23444. '_matrix[4];\n data[offset + 6] = ' +
  23445. t +
  23446. '_matrix[5];\n \n data[offset + 8] = ' +
  23447. t +
  23448. '_matrix[6];\n data[offset + 9] = ' +
  23449. t +
  23450. '_matrix[7];\n data[offset + 10] = ' +
  23451. t +
  23452. '_matrix[8];\n '
  23453. );
  23454. },
  23455. },
  23456. {
  23457. test: function (t, e) {
  23458. return (
  23459. 'vec2' === t.type && 1 === t.size && !t.isArray && void 0 !== e.x
  23460. );
  23461. },
  23462. code: function (t) {
  23463. return (
  23464. '\n cv = ud["' +
  23465. t +
  23466. '"].value;\n v = uv["' +
  23467. t +
  23468. '"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["' +
  23469. t +
  23470. '"].location, v.x, v.y);\n }'
  23471. );
  23472. },
  23473. codeUbo: function (t) {
  23474. return (
  23475. '\n v = uv.' +
  23476. t +
  23477. ';\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n '
  23478. );
  23479. },
  23480. },
  23481. {
  23482. test: function (t) {
  23483. return 'vec2' === t.type && 1 === t.size && !t.isArray;
  23484. },
  23485. code: function (t) {
  23486. return (
  23487. '\n cv = ud["' +
  23488. t +
  23489. '"].value;\n v = uv["' +
  23490. t +
  23491. '"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["' +
  23492. t +
  23493. '"].location, v[0], v[1]);\n }\n '
  23494. );
  23495. },
  23496. },
  23497. {
  23498. test: function (t, e) {
  23499. return (
  23500. 'vec4' === t.type &&
  23501. 1 === t.size &&
  23502. !t.isArray &&
  23503. void 0 !== e.width
  23504. );
  23505. },
  23506. code: function (t) {
  23507. return (
  23508. '\n cv = ud["' +
  23509. t +
  23510. '"].value;\n v = uv["' +
  23511. t +
  23512. '"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["' +
  23513. t +
  23514. '"].location, v.x, v.y, v.width, v.height)\n }'
  23515. );
  23516. },
  23517. codeUbo: function (t) {
  23518. return (
  23519. '\n v = uv.' +
  23520. t +
  23521. ';\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n '
  23522. );
  23523. },
  23524. },
  23525. {
  23526. test: function (t) {
  23527. return 'vec4' === t.type && 1 === t.size && !t.isArray;
  23528. },
  23529. code: function (t) {
  23530. return (
  23531. '\n cv = ud["' +
  23532. t +
  23533. '"].value;\n v = uv["' +
  23534. t +
  23535. '"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["' +
  23536. t +
  23537. '"].location, v[0], v[1], v[2], v[3])\n }'
  23538. );
  23539. },
  23540. },
  23541. ],
  23542. fF = {
  23543. float:
  23544. '\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }',
  23545. vec2: '\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }',
  23546. vec3: '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }',
  23547. vec4: '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }',
  23548. int: '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
  23549. ivec2:
  23550. '\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }',
  23551. ivec3:
  23552. '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }',
  23553. ivec4:
  23554. '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }',
  23555. uint: '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }',
  23556. uvec2:
  23557. '\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }',
  23558. uvec3:
  23559. '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }',
  23560. uvec4:
  23561. '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }',
  23562. bool: '\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }',
  23563. bvec2:
  23564. '\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }',
  23565. bvec3:
  23566. '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }',
  23567. bvec4:
  23568. '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }',
  23569. mat2: 'gl.uniformMatrix2fv(location, false, v)',
  23570. mat3: 'gl.uniformMatrix3fv(location, false, v)',
  23571. mat4: 'gl.uniformMatrix4fv(location, false, v)',
  23572. sampler2D:
  23573. '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
  23574. samplerCube:
  23575. '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
  23576. sampler2DArray:
  23577. '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
  23578. },
  23579. pF = {
  23580. float: 'gl.uniform1fv(location, v)',
  23581. vec2: 'gl.uniform2fv(location, v)',
  23582. vec3: 'gl.uniform3fv(location, v)',
  23583. vec4: 'gl.uniform4fv(location, v)',
  23584. mat4: 'gl.uniformMatrix4fv(location, false, v)',
  23585. mat3: 'gl.uniformMatrix3fv(location, false, v)',
  23586. mat2: 'gl.uniformMatrix2fv(location, false, v)',
  23587. int: 'gl.uniform1iv(location, v)',
  23588. ivec2: 'gl.uniform2iv(location, v)',
  23589. ivec3: 'gl.uniform3iv(location, v)',
  23590. ivec4: 'gl.uniform4iv(location, v)',
  23591. uint: 'gl.uniform1uiv(location, v)',
  23592. uvec2: 'gl.uniform2uiv(location, v)',
  23593. uvec3: 'gl.uniform3uiv(location, v)',
  23594. uvec4: 'gl.uniform4uiv(location, v)',
  23595. bool: 'gl.uniform1iv(location, v)',
  23596. bvec2: 'gl.uniform2iv(location, v)',
  23597. bvec3: 'gl.uniform3iv(location, v)',
  23598. bvec4: 'gl.uniform4iv(location, v)',
  23599. sampler2D: 'gl.uniform1iv(location, v)',
  23600. samplerCube: 'gl.uniform1iv(location, v)',
  23601. sampler2DArray: 'gl.uniform1iv(location, v)',
  23602. };
  23603. var vF,
  23604. mF = [
  23605. 'precision mediump float;',
  23606. 'void main(void){',
  23607. 'float test = 0.1;',
  23608. '%forloop%',
  23609. 'gl_FragColor = vec4(0.0);',
  23610. '}',
  23611. ].join('\n');
  23612. function yF(t) {
  23613. for (var e = '', r = 0; r < t; ++r)
  23614. r > 0 && (e += '\nelse '),
  23615. r < t - 1 && (e += 'if(test == ' + r + '.0){}');
  23616. return e;
  23617. }
  23618. var gF = 0,
  23619. _F = {},
  23620. bF = (function () {
  23621. function t(e, r, n) {
  23622. void 0 === n && (n = 'pixi-shader'),
  23623. (this.id = gF++),
  23624. (this.vertexSrc = e || t.defaultVertexSrc),
  23625. (this.fragmentSrc = r || t.defaultFragmentSrc),
  23626. (this.vertexSrc = this.vertexSrc.trim()),
  23627. (this.fragmentSrc = this.fragmentSrc.trim()),
  23628. '#version' !== this.vertexSrc.substring(0, 8) &&
  23629. ((n = n.replace(/\s+/g, '-')),
  23630. _F[n] ? (_F[n]++, (n += '-' + _F[n])) : (_F[n] = 1),
  23631. (this.vertexSrc =
  23632. '#define SHADER_NAME ' + n + '\n' + this.vertexSrc),
  23633. (this.fragmentSrc =
  23634. '#define SHADER_NAME ' + n + '\n' + this.fragmentSrc),
  23635. (this.vertexSrc = sF(this.vertexSrc, vA.PRECISION_VERTEX, XP.HIGH)),
  23636. (this.fragmentSrc = sF(
  23637. this.fragmentSrc,
  23638. vA.PRECISION_FRAGMENT,
  23639. oF()
  23640. ))),
  23641. (this.glPrograms = {}),
  23642. (this.syncUniforms = null);
  23643. }
  23644. return (
  23645. Object.defineProperty(t, 'defaultVertexSrc', {
  23646. get: function () {
  23647. return 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n';
  23648. },
  23649. enumerable: !1,
  23650. configurable: !0,
  23651. }),
  23652. Object.defineProperty(t, 'defaultFragmentSrc', {
  23653. get: function () {
  23654. return 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}';
  23655. },
  23656. enumerable: !1,
  23657. configurable: !0,
  23658. }),
  23659. (t.from = function (e, r, n) {
  23660. var i = e + r,
  23661. o = cD[i];
  23662. return o || (cD[i] = o = new t(e, r, n)), o;
  23663. }),
  23664. t
  23665. );
  23666. })(),
  23667. TF = (function () {
  23668. function t(t, e) {
  23669. (this.uniformBindCount = 0),
  23670. (this.program = t),
  23671. (this.uniformGroup = e
  23672. ? e instanceof kL
  23673. ? e
  23674. : new kL(e)
  23675. : new kL({})),
  23676. (this.disposeRunner = new JD('disposeShader'));
  23677. }
  23678. return (
  23679. (t.prototype.checkUniformExists = function (t, e) {
  23680. if (e.uniforms[t]) return !0;
  23681. for (var r in e.uniforms) {
  23682. var n = e.uniforms[r];
  23683. if (n.group && this.checkUniformExists(t, n)) return !0;
  23684. }
  23685. return !1;
  23686. }),
  23687. (t.prototype.destroy = function () {
  23688. (this.uniformGroup = null),
  23689. this.disposeRunner.emit(this),
  23690. this.disposeRunner.destroy();
  23691. }),
  23692. Object.defineProperty(t.prototype, 'uniforms', {
  23693. get: function () {
  23694. return this.uniformGroup.uniforms;
  23695. },
  23696. enumerable: !1,
  23697. configurable: !0,
  23698. }),
  23699. (t.from = function (e, r, n) {
  23700. return new t(bF.from(e, r), n);
  23701. }),
  23702. t
  23703. );
  23704. })(),
  23705. xF = (function () {
  23706. function t() {
  23707. (this.data = 0),
  23708. (this.blendMode = OP.NORMAL),
  23709. (this.polygonOffset = 0),
  23710. (this.blend = !0),
  23711. (this.depthMask = !0);
  23712. }
  23713. return (
  23714. Object.defineProperty(t.prototype, 'blend', {
  23715. get: function () {
  23716. return !!(1 & this.data);
  23717. },
  23718. set: function (t) {
  23719. !!(1 & this.data) !== t && (this.data ^= 1);
  23720. },
  23721. enumerable: !1,
  23722. configurable: !0,
  23723. }),
  23724. Object.defineProperty(t.prototype, 'offsets', {
  23725. get: function () {
  23726. return !!(2 & this.data);
  23727. },
  23728. set: function (t) {
  23729. !!(2 & this.data) !== t && (this.data ^= 2);
  23730. },
  23731. enumerable: !1,
  23732. configurable: !0,
  23733. }),
  23734. Object.defineProperty(t.prototype, 'culling', {
  23735. get: function () {
  23736. return !!(4 & this.data);
  23737. },
  23738. set: function (t) {
  23739. !!(4 & this.data) !== t && (this.data ^= 4);
  23740. },
  23741. enumerable: !1,
  23742. configurable: !0,
  23743. }),
  23744. Object.defineProperty(t.prototype, 'depthTest', {
  23745. get: function () {
  23746. return !!(8 & this.data);
  23747. },
  23748. set: function (t) {
  23749. !!(8 & this.data) !== t && (this.data ^= 8);
  23750. },
  23751. enumerable: !1,
  23752. configurable: !0,
  23753. }),
  23754. Object.defineProperty(t.prototype, 'depthMask', {
  23755. get: function () {
  23756. return !!(32 & this.data);
  23757. },
  23758. set: function (t) {
  23759. !!(32 & this.data) !== t && (this.data ^= 32);
  23760. },
  23761. enumerable: !1,
  23762. configurable: !0,
  23763. }),
  23764. Object.defineProperty(t.prototype, 'clockwiseFrontFace', {
  23765. get: function () {
  23766. return !!(16 & this.data);
  23767. },
  23768. set: function (t) {
  23769. !!(16 & this.data) !== t && (this.data ^= 16);
  23770. },
  23771. enumerable: !1,
  23772. configurable: !0,
  23773. }),
  23774. Object.defineProperty(t.prototype, 'blendMode', {
  23775. get: function () {
  23776. return this._blendMode;
  23777. },
  23778. set: function (t) {
  23779. (this.blend = t !== OP.NONE), (this._blendMode = t);
  23780. },
  23781. enumerable: !1,
  23782. configurable: !0,
  23783. }),
  23784. Object.defineProperty(t.prototype, 'polygonOffset', {
  23785. get: function () {
  23786. return this._polygonOffset;
  23787. },
  23788. set: function (t) {
  23789. (this.offsets = !!t), (this._polygonOffset = t);
  23790. },
  23791. enumerable: !1,
  23792. configurable: !0,
  23793. }),
  23794. (t.prototype.toString = function () {
  23795. return (
  23796. '[@pixi/core:State blendMode=' +
  23797. this.blendMode +
  23798. ' clockwiseFrontFace=' +
  23799. this.clockwiseFrontFace +
  23800. ' culling=' +
  23801. this.culling +
  23802. ' depthMask=' +
  23803. this.depthMask +
  23804. ' polygonOffset=' +
  23805. this.polygonOffset +
  23806. ']'
  23807. );
  23808. }),
  23809. (t.for2d = function () {
  23810. var e = new t();
  23811. return (e.depthTest = !1), (e.blend = !0), e;
  23812. }),
  23813. t
  23814. );
  23815. })(),
  23816. EF = (function (t) {
  23817. function e(r, n, i) {
  23818. var o = this,
  23819. s = bF.from(r || e.defaultVertexSrc, n || e.defaultFragmentSrc);
  23820. return (
  23821. ((o = t.call(this, s, i) || this).padding = 0),
  23822. (o.resolution = vA.FILTER_RESOLUTION),
  23823. (o.multisample = vA.FILTER_MULTISAMPLE),
  23824. (o.enabled = !0),
  23825. (o.autoFit = !0),
  23826. (o.state = new xF()),
  23827. o
  23828. );
  23829. }
  23830. return (
  23831. rL(e, t),
  23832. (e.prototype.apply = function (t, e, r, n, i) {
  23833. t.applyFilter(this, e, r, n);
  23834. }),
  23835. Object.defineProperty(e.prototype, 'blendMode', {
  23836. get: function () {
  23837. return this.state.blendMode;
  23838. },
  23839. set: function (t) {
  23840. this.state.blendMode = t;
  23841. },
  23842. enumerable: !1,
  23843. configurable: !0,
  23844. }),
  23845. Object.defineProperty(e.prototype, 'resolution', {
  23846. get: function () {
  23847. return this._resolution;
  23848. },
  23849. set: function (t) {
  23850. this._resolution = t;
  23851. },
  23852. enumerable: !1,
  23853. configurable: !0,
  23854. }),
  23855. Object.defineProperty(e, 'defaultVertexSrc', {
  23856. get: function () {
  23857. return 'attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n';
  23858. },
  23859. enumerable: !1,
  23860. configurable: !0,
  23861. }),
  23862. Object.defineProperty(e, 'defaultFragmentSrc', {
  23863. get: function () {
  23864. return 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n';
  23865. },
  23866. enumerable: !1,
  23867. configurable: !0,
  23868. }),
  23869. e
  23870. );
  23871. })(TF),
  23872. SF = new CD(),
  23873. wF = (function () {
  23874. function t(t, e) {
  23875. (this._texture = t),
  23876. (this.mapCoord = new CD()),
  23877. (this.uClampFrame = new Float32Array(4)),
  23878. (this.uClampOffset = new Float32Array(2)),
  23879. (this._textureID = -1),
  23880. (this._updateID = 0),
  23881. (this.clampOffset = 0),
  23882. (this.clampMargin = void 0 === e ? 0.5 : e),
  23883. (this.isSimple = !1);
  23884. }
  23885. return (
  23886. Object.defineProperty(t.prototype, 'texture', {
  23887. get: function () {
  23888. return this._texture;
  23889. },
  23890. set: function (t) {
  23891. (this._texture = t), (this._textureID = -1);
  23892. },
  23893. enumerable: !1,
  23894. configurable: !0,
  23895. }),
  23896. (t.prototype.multiplyUvs = function (t, e) {
  23897. void 0 === e && (e = t);
  23898. for (var r = this.mapCoord, n = 0; n < t.length; n += 2) {
  23899. var i = t[n],
  23900. o = t[n + 1];
  23901. (e[n] = i * r.a + o * r.c + r.tx),
  23902. (e[n + 1] = i * r.b + o * r.d + r.ty);
  23903. }
  23904. return e;
  23905. }),
  23906. (t.prototype.update = function (t) {
  23907. var e = this._texture;
  23908. if (!e || !e.valid) return !1;
  23909. if (!t && this._textureID === e._updateID) return !1;
  23910. (this._textureID = e._updateID), this._updateID++;
  23911. var r = e._uvs;
  23912. this.mapCoord.set(
  23913. r.x1 - r.x0,
  23914. r.y1 - r.y0,
  23915. r.x3 - r.x0,
  23916. r.y3 - r.y0,
  23917. r.x0,
  23918. r.y0
  23919. );
  23920. var n = e.orig,
  23921. i = e.trim;
  23922. i &&
  23923. (SF.set(
  23924. n.width / i.width,
  23925. 0,
  23926. 0,
  23927. n.height / i.height,
  23928. -i.x / i.width,
  23929. -i.y / i.height
  23930. ),
  23931. this.mapCoord.append(SF));
  23932. var o = e.baseTexture,
  23933. s = this.uClampFrame,
  23934. a = this.clampMargin / o.resolution,
  23935. u = this.clampOffset;
  23936. return (
  23937. (s[0] = (e._frame.x + a + u) / o.width),
  23938. (s[1] = (e._frame.y + a + u) / o.height),
  23939. (s[2] = (e._frame.x + e._frame.width - a + u) / o.width),
  23940. (s[3] = (e._frame.y + e._frame.height - a + u) / o.height),
  23941. (this.uClampOffset[0] = u / o.realWidth),
  23942. (this.uClampOffset[1] = u / o.realHeight),
  23943. (this.isSimple =
  23944. e._frame.width === o.width &&
  23945. e._frame.height === o.height &&
  23946. 0 === e.rotate),
  23947. !0
  23948. );
  23949. }),
  23950. t
  23951. );
  23952. })(),
  23953. RF = (function (t) {
  23954. function e(e, r, n) {
  23955. var i = this,
  23956. o = null;
  23957. return (
  23958. 'string' != typeof e &&
  23959. void 0 === r &&
  23960. void 0 === n &&
  23961. ((o = e), (e = void 0), (r = void 0), (n = void 0)),
  23962. ((i =
  23963. t.call(
  23964. this,
  23965. e ||
  23966. 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n',
  23967. r ||
  23968. 'varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n',
  23969. n
  23970. ) || this).maskSprite = o),
  23971. (i.maskMatrix = new CD()),
  23972. i
  23973. );
  23974. }
  23975. return (
  23976. rL(e, t),
  23977. Object.defineProperty(e.prototype, 'maskSprite', {
  23978. get: function () {
  23979. return this._maskSprite;
  23980. },
  23981. set: function (t) {
  23982. (this._maskSprite = t),
  23983. this._maskSprite && (this._maskSprite.renderable = !1);
  23984. },
  23985. enumerable: !1,
  23986. configurable: !0,
  23987. }),
  23988. (e.prototype.apply = function (t, e, r, n) {
  23989. var i = this._maskSprite,
  23990. o = i._texture;
  23991. o.valid &&
  23992. (o.uvMatrix || (o.uvMatrix = new wF(o, 0)),
  23993. o.uvMatrix.update(),
  23994. (this.uniforms.npmAlpha = o.baseTexture.alphaMode ? 0 : 1),
  23995. (this.uniforms.mask = o),
  23996. (this.uniforms.otherMatrix = t
  23997. .calculateSpriteMatrix(this.maskMatrix, i)
  23998. .prepend(o.uvMatrix.mapCoord)),
  23999. (this.uniforms.alpha = i.worldAlpha),
  24000. (this.uniforms.maskClamp = o.uvMatrix.uClampFrame),
  24001. t.applyFilter(this, e, r, n));
  24002. }),
  24003. e
  24004. );
  24005. })(EF),
  24006. CF = (function () {
  24007. function t(t) {
  24008. (this.renderer = t),
  24009. (this.enableScissor = !0),
  24010. (this.alphaMaskPool = []),
  24011. (this.maskDataPool = []),
  24012. (this.maskStack = []),
  24013. (this.alphaMaskIndex = 0);
  24014. }
  24015. return (
  24016. (t.prototype.setMaskStack = function (t) {
  24017. (this.maskStack = t),
  24018. this.renderer.scissor.setMaskStack(t),
  24019. this.renderer.stencil.setMaskStack(t);
  24020. }),
  24021. (t.prototype.push = function (t, e) {
  24022. var r = e;
  24023. if (!r.isMaskData) {
  24024. var n = this.maskDataPool.pop() || new qL();
  24025. (n.pooled = !0), (n.maskObject = e), (r = n);
  24026. }
  24027. var i =
  24028. 0 !== this.maskStack.length
  24029. ? this.maskStack[this.maskStack.length - 1]
  24030. : null;
  24031. if (
  24032. (r.copyCountersOrReset(i),
  24033. (r._colorMask = i ? i._colorMask : 15),
  24034. r.autoDetect && this.detect(r),
  24035. (r._target = t),
  24036. r.type !== VP.SPRITE && this.maskStack.push(r),
  24037. r.enabled)
  24038. )
  24039. switch (r.type) {
  24040. case VP.SCISSOR:
  24041. this.renderer.scissor.push(r);
  24042. break;
  24043. case VP.STENCIL:
  24044. this.renderer.stencil.push(r);
  24045. break;
  24046. case VP.SPRITE:
  24047. r.copyCountersOrReset(null), this.pushSpriteMask(r);
  24048. break;
  24049. case VP.COLOR:
  24050. this.pushColorMask(r);
  24051. }
  24052. r.type === VP.SPRITE && this.maskStack.push(r);
  24053. }),
  24054. (t.prototype.pop = function (t) {
  24055. var e = this.maskStack.pop();
  24056. if (e && e._target === t) {
  24057. if (e.enabled)
  24058. switch (e.type) {
  24059. case VP.SCISSOR:
  24060. this.renderer.scissor.pop(e);
  24061. break;
  24062. case VP.STENCIL:
  24063. this.renderer.stencil.pop(e.maskObject);
  24064. break;
  24065. case VP.SPRITE:
  24066. this.popSpriteMask(e);
  24067. break;
  24068. case VP.COLOR:
  24069. this.popColorMask(e);
  24070. }
  24071. if (
  24072. (e.reset(),
  24073. e.pooled && this.maskDataPool.push(e),
  24074. 0 !== this.maskStack.length)
  24075. ) {
  24076. var r = this.maskStack[this.maskStack.length - 1];
  24077. r.type === VP.SPRITE &&
  24078. r._filters &&
  24079. (r._filters[0].maskSprite = r.maskObject);
  24080. }
  24081. }
  24082. }),
  24083. (t.prototype.detect = function (t) {
  24084. var e = t.maskObject;
  24085. e
  24086. ? e.isSprite
  24087. ? (t.type = VP.SPRITE)
  24088. : this.enableScissor && this.renderer.scissor.testScissor(t)
  24089. ? (t.type = VP.SCISSOR)
  24090. : (t.type = VP.STENCIL)
  24091. : (t.type = VP.COLOR);
  24092. }),
  24093. (t.prototype.pushSpriteMask = function (t) {
  24094. var e,
  24095. r,
  24096. n = t.maskObject,
  24097. i = t._target,
  24098. o = t._filters;
  24099. o ||
  24100. (o = this.alphaMaskPool[this.alphaMaskIndex]) ||
  24101. (o = this.alphaMaskPool[this.alphaMaskIndex] = [new RF()]);
  24102. var s,
  24103. a,
  24104. u = this.renderer,
  24105. c = u.renderTexture;
  24106. if (c.current) {
  24107. var h = c.current;
  24108. (s = t.resolution || h.resolution),
  24109. (a =
  24110. null !== (e = t.multisample) && void 0 !== e
  24111. ? e
  24112. : h.multisample);
  24113. } else
  24114. (s = t.resolution || u.resolution),
  24115. (a =
  24116. null !== (r = t.multisample) && void 0 !== r
  24117. ? r
  24118. : u.multisample);
  24119. (o[0].resolution = s), (o[0].multisample = a), (o[0].maskSprite = n);
  24120. var l = i.filterArea;
  24121. (i.filterArea = n.getBounds(!0)),
  24122. u.filter.push(i, o),
  24123. (i.filterArea = l),
  24124. t._filters || this.alphaMaskIndex++;
  24125. }),
  24126. (t.prototype.popSpriteMask = function (t) {
  24127. this.renderer.filter.pop(),
  24128. t._filters
  24129. ? (t._filters[0].maskSprite = null)
  24130. : (this.alphaMaskIndex--,
  24131. (this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite = null));
  24132. }),
  24133. (t.prototype.pushColorMask = function (t) {
  24134. var e = t._colorMask,
  24135. r = (t._colorMask = e & t.colorMask);
  24136. r !== e &&
  24137. this.renderer.gl.colorMask(
  24138. 0 != (1 & r),
  24139. 0 != (2 & r),
  24140. 0 != (4 & r),
  24141. 0 != (8 & r)
  24142. );
  24143. }),
  24144. (t.prototype.popColorMask = function (t) {
  24145. var e = t._colorMask,
  24146. r =
  24147. this.maskStack.length > 0
  24148. ? this.maskStack[this.maskStack.length - 1]._colorMask
  24149. : 15;
  24150. r !== e &&
  24151. this.renderer.gl.colorMask(
  24152. 0 != (1 & r),
  24153. 0 != (2 & r),
  24154. 0 != (4 & r),
  24155. 0 != (8 & r)
  24156. );
  24157. }),
  24158. (t.prototype.destroy = function () {
  24159. this.renderer = null;
  24160. }),
  24161. t
  24162. );
  24163. })(),
  24164. PF = (function () {
  24165. function t(t) {
  24166. (this.renderer = t), (this.maskStack = []), (this.glConst = 0);
  24167. }
  24168. return (
  24169. (t.prototype.getStackLength = function () {
  24170. return this.maskStack.length;
  24171. }),
  24172. (t.prototype.setMaskStack = function (t) {
  24173. var e = this.renderer.gl,
  24174. r = this.getStackLength();
  24175. this.maskStack = t;
  24176. var n = this.getStackLength();
  24177. n !== r &&
  24178. (0 === n
  24179. ? e.disable(this.glConst)
  24180. : (e.enable(this.glConst), this._useCurrent()));
  24181. }),
  24182. (t.prototype._useCurrent = function () {}),
  24183. (t.prototype.destroy = function () {
  24184. (this.renderer = null), (this.maskStack = null);
  24185. }),
  24186. t
  24187. );
  24188. })(),
  24189. AF = new CD(),
  24190. OF = [],
  24191. IF = (function (t) {
  24192. function e(e) {
  24193. var r = t.call(this, e) || this;
  24194. return (
  24195. (r.glConst = vA.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST), r
  24196. );
  24197. }
  24198. return (
  24199. rL(e, t),
  24200. (e.prototype.getStackLength = function () {
  24201. var t = this.maskStack[this.maskStack.length - 1];
  24202. return t ? t._scissorCounter : 0;
  24203. }),
  24204. (e.prototype.calcScissorRect = function (t) {
  24205. var e;
  24206. if (!t._scissorRectLocal) {
  24207. var r = t._scissorRect,
  24208. n = t.maskObject,
  24209. i = this.renderer,
  24210. o = i.renderTexture,
  24211. s = n.getBounds(
  24212. !0,
  24213. null !== (e = OF.pop()) && void 0 !== e ? e : new TD()
  24214. );
  24215. this.roundFrameToPixels(
  24216. s,
  24217. o.current ? o.current.resolution : i.resolution,
  24218. o.sourceFrame,
  24219. o.destinationFrame,
  24220. i.projection.transform
  24221. ),
  24222. r && s.fit(r),
  24223. (t._scissorRectLocal = s);
  24224. }
  24225. }),
  24226. (e.isMatrixRotated = function (t) {
  24227. if (!t) return !1;
  24228. var e = t.a,
  24229. r = t.b,
  24230. n = t.c,
  24231. i = t.d;
  24232. return (
  24233. (Math.abs(r) > 1e-4 || Math.abs(n) > 1e-4) &&
  24234. (Math.abs(e) > 1e-4 || Math.abs(i) > 1e-4)
  24235. );
  24236. }),
  24237. (e.prototype.testScissor = function (t) {
  24238. var r = t.maskObject;
  24239. if (!r.isFastRect || !r.isFastRect()) return !1;
  24240. if (e.isMatrixRotated(r.worldTransform)) return !1;
  24241. if (e.isMatrixRotated(this.renderer.projection.transform)) return !1;
  24242. this.calcScissorRect(t);
  24243. var n = t._scissorRectLocal;
  24244. return n.width > 0 && n.height > 0;
  24245. }),
  24246. (e.prototype.roundFrameToPixels = function (t, r, n, i, o) {
  24247. e.isMatrixRotated(o) ||
  24248. ((o = o ? AF.copyFrom(o) : AF.identity())
  24249. .translate(-n.x, -n.y)
  24250. .scale(i.width / n.width, i.height / n.height)
  24251. .translate(i.x, i.y),
  24252. this.renderer.filter.transformAABB(o, t),
  24253. t.fit(i),
  24254. (t.x = Math.round(t.x * r)),
  24255. (t.y = Math.round(t.y * r)),
  24256. (t.width = Math.round(t.width * r)),
  24257. (t.height = Math.round(t.height * r)));
  24258. }),
  24259. (e.prototype.push = function (t) {
  24260. t._scissorRectLocal || this.calcScissorRect(t);
  24261. var e = this.renderer.gl;
  24262. t._scissorRect || e.enable(e.SCISSOR_TEST),
  24263. t._scissorCounter++,
  24264. (t._scissorRect = t._scissorRectLocal),
  24265. this._useCurrent();
  24266. }),
  24267. (e.prototype.pop = function (t) {
  24268. var e = this.renderer.gl;
  24269. t && OF.push(t._scissorRectLocal),
  24270. this.getStackLength() > 0
  24271. ? this._useCurrent()
  24272. : e.disable(e.SCISSOR_TEST);
  24273. }),
  24274. (e.prototype._useCurrent = function () {
  24275. var t,
  24276. e = this.maskStack[this.maskStack.length - 1]._scissorRect;
  24277. (t = this.renderer.renderTexture.current
  24278. ? e.y
  24279. : this.renderer.height - e.height - e.y),
  24280. this.renderer.gl.scissor(e.x, t, e.width, e.height);
  24281. }),
  24282. e
  24283. );
  24284. })(PF),
  24285. MF = (function (t) {
  24286. function e(e) {
  24287. var r = t.call(this, e) || this;
  24288. return (
  24289. (r.glConst = vA.ADAPTER.getWebGLRenderingContext().STENCIL_TEST), r
  24290. );
  24291. }
  24292. return (
  24293. rL(e, t),
  24294. (e.prototype.getStackLength = function () {
  24295. var t = this.maskStack[this.maskStack.length - 1];
  24296. return t ? t._stencilCounter : 0;
  24297. }),
  24298. (e.prototype.push = function (t) {
  24299. var e = t.maskObject,
  24300. r = this.renderer.gl,
  24301. n = t._stencilCounter;
  24302. 0 === n &&
  24303. (this.renderer.framebuffer.forceStencil(),
  24304. r.clearStencil(0),
  24305. r.clear(r.STENCIL_BUFFER_BIT),
  24306. r.enable(r.STENCIL_TEST)),
  24307. t._stencilCounter++;
  24308. var i = t._colorMask;
  24309. 0 !== i && ((t._colorMask = 0), r.colorMask(!1, !1, !1, !1)),
  24310. r.stencilFunc(r.EQUAL, n, 4294967295),
  24311. r.stencilOp(r.KEEP, r.KEEP, r.INCR),
  24312. (e.renderable = !0),
  24313. e.render(this.renderer),
  24314. this.renderer.batch.flush(),
  24315. (e.renderable = !1),
  24316. 0 !== i &&
  24317. ((t._colorMask = i),
  24318. r.colorMask(
  24319. 0 != (1 & i),
  24320. 0 != (2 & i),
  24321. 0 != (4 & i),
  24322. 0 != (8 & i)
  24323. )),
  24324. this._useCurrent();
  24325. }),
  24326. (e.prototype.pop = function (t) {
  24327. var e = this.renderer.gl;
  24328. if (0 === this.getStackLength()) e.disable(e.STENCIL_TEST);
  24329. else {
  24330. var r =
  24331. 0 !== this.maskStack.length
  24332. ? this.maskStack[this.maskStack.length - 1]
  24333. : null,
  24334. n = r ? r._colorMask : 15;
  24335. 0 !== n && ((r._colorMask = 0), e.colorMask(!1, !1, !1, !1)),
  24336. e.stencilOp(e.KEEP, e.KEEP, e.DECR),
  24337. (t.renderable = !0),
  24338. t.render(this.renderer),
  24339. this.renderer.batch.flush(),
  24340. (t.renderable = !1),
  24341. 0 !== n &&
  24342. ((r._colorMask = n),
  24343. e.colorMask(
  24344. 0 != (1 & n),
  24345. 0 != (2 & n),
  24346. 0 != (4 & n),
  24347. 0 != (8 & n)
  24348. )),
  24349. this._useCurrent();
  24350. }
  24351. }),
  24352. (e.prototype._useCurrent = function () {
  24353. var t = this.renderer.gl;
  24354. t.stencilFunc(t.EQUAL, this.getStackLength(), 4294967295),
  24355. t.stencilOp(t.KEEP, t.KEEP, t.KEEP);
  24356. }),
  24357. e
  24358. );
  24359. })(PF),
  24360. DF = (function () {
  24361. function t(t) {
  24362. (this.renderer = t),
  24363. (this.destinationFrame = null),
  24364. (this.sourceFrame = null),
  24365. (this.defaultFrame = null),
  24366. (this.projectionMatrix = new CD()),
  24367. (this.transform = null);
  24368. }
  24369. return (
  24370. (t.prototype.update = function (t, e, r, n) {
  24371. (this.destinationFrame =
  24372. t || this.destinationFrame || this.defaultFrame),
  24373. (this.sourceFrame = e || this.sourceFrame || t),
  24374. this.calculateProjection(
  24375. this.destinationFrame,
  24376. this.sourceFrame,
  24377. r,
  24378. n
  24379. ),
  24380. this.transform && this.projectionMatrix.append(this.transform);
  24381. var i = this.renderer;
  24382. (i.globalUniforms.uniforms.projectionMatrix = this.projectionMatrix),
  24383. i.globalUniforms.update(),
  24384. i.shader.shader &&
  24385. i.shader.syncUniformGroup(i.shader.shader.uniforms.globals);
  24386. }),
  24387. (t.prototype.calculateProjection = function (t, e, r, n) {
  24388. var i = this.projectionMatrix,
  24389. o = n ? -1 : 1;
  24390. i.identity(),
  24391. (i.a = (1 / e.width) * 2),
  24392. (i.d = o * ((1 / e.height) * 2)),
  24393. (i.tx = -1 - e.x * i.a),
  24394. (i.ty = -o - e.y * i.d);
  24395. }),
  24396. (t.prototype.setTransform = function (t) {}),
  24397. (t.prototype.destroy = function () {
  24398. this.renderer = null;
  24399. }),
  24400. t
  24401. );
  24402. })(),
  24403. LF = new TD(),
  24404. FF = new TD(),
  24405. NF = (function () {
  24406. function t(t) {
  24407. (this.renderer = t),
  24408. (this.clearColor = t._backgroundColorRgba),
  24409. (this.defaultMaskStack = []),
  24410. (this.current = null),
  24411. (this.sourceFrame = new TD()),
  24412. (this.destinationFrame = new TD()),
  24413. (this.viewportFrame = new TD());
  24414. }
  24415. return (
  24416. (t.prototype.bind = function (t, e, r) {
  24417. void 0 === t && (t = null);
  24418. var n,
  24419. i,
  24420. o,
  24421. s = this.renderer;
  24422. (this.current = t),
  24423. t
  24424. ? ((o = (n = t.baseTexture).resolution),
  24425. e ||
  24426. ((LF.width = t.frame.width),
  24427. (LF.height = t.frame.height),
  24428. (e = LF)),
  24429. r ||
  24430. ((FF.x = t.frame.x),
  24431. (FF.y = t.frame.y),
  24432. (FF.width = e.width),
  24433. (FF.height = e.height),
  24434. (r = FF)),
  24435. (i = n.framebuffer))
  24436. : ((o = s.resolution),
  24437. e ||
  24438. ((LF.width = s.screen.width),
  24439. (LF.height = s.screen.height),
  24440. (e = LF)),
  24441. r || (((r = LF).width = e.width), (r.height = e.height)));
  24442. var a = this.viewportFrame;
  24443. (a.x = r.x * o),
  24444. (a.y = r.y * o),
  24445. (a.width = r.width * o),
  24446. (a.height = r.height * o),
  24447. t || (a.y = s.view.height - (a.y + a.height)),
  24448. a.ceil(),
  24449. this.renderer.framebuffer.bind(i, a),
  24450. this.renderer.projection.update(r, e, o, !i),
  24451. t
  24452. ? this.renderer.mask.setMaskStack(n.maskStack)
  24453. : this.renderer.mask.setMaskStack(this.defaultMaskStack),
  24454. this.sourceFrame.copyFrom(e),
  24455. this.destinationFrame.copyFrom(r);
  24456. }),
  24457. (t.prototype.clear = function (t, e) {
  24458. t = this.current
  24459. ? t || this.current.baseTexture.clearColor
  24460. : t || this.clearColor;
  24461. var r = this.destinationFrame,
  24462. n = this.current ? this.current.baseTexture : this.renderer.screen,
  24463. i = r.width !== n.width || r.height !== n.height;
  24464. if (i) {
  24465. var o = this.viewportFrame,
  24466. s = o.x,
  24467. a = o.y,
  24468. u = o.width,
  24469. c = o.height;
  24470. (s = Math.round(s)),
  24471. (a = Math.round(a)),
  24472. (u = Math.round(u)),
  24473. (c = Math.round(c)),
  24474. this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),
  24475. this.renderer.gl.scissor(s, a, u, c);
  24476. }
  24477. this.renderer.framebuffer.clear(t[0], t[1], t[2], t[3], e),
  24478. i && this.renderer.scissor.pop();
  24479. }),
  24480. (t.prototype.resize = function () {
  24481. this.bind(null);
  24482. }),
  24483. (t.prototype.reset = function () {
  24484. this.bind(null);
  24485. }),
  24486. (t.prototype.destroy = function () {
  24487. this.renderer = null;
  24488. }),
  24489. t
  24490. );
  24491. })();
  24492. function kF(t, e, r, n, i) {
  24493. r.buffer.update(i);
  24494. }
  24495. var BF = {
  24496. float: '\n data[offset] = v;\n ',
  24497. vec2: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n ',
  24498. vec3: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ',
  24499. vec4: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ',
  24500. mat2: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ',
  24501. mat3: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ',
  24502. mat4: '\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n ',
  24503. },
  24504. GF = {
  24505. float: 4,
  24506. vec2: 8,
  24507. vec3: 12,
  24508. vec4: 16,
  24509. int: 4,
  24510. ivec2: 8,
  24511. ivec3: 12,
  24512. ivec4: 16,
  24513. uint: 4,
  24514. uvec2: 8,
  24515. uvec3: 12,
  24516. uvec4: 16,
  24517. bool: 4,
  24518. bvec2: 8,
  24519. bvec3: 12,
  24520. bvec4: 16,
  24521. mat2: 32,
  24522. mat3: 48,
  24523. mat4: 64,
  24524. };
  24525. function UF(t, e) {
  24526. if (!t.autoManage) return { size: 0, syncFunc: kF };
  24527. for (
  24528. var r = (function (t, e) {
  24529. var r = [];
  24530. for (var n in t) e[n] && r.push(e[n]);
  24531. return (
  24532. r.sort(function (t, e) {
  24533. return t.index - e.index;
  24534. }),
  24535. r
  24536. );
  24537. })(t.uniforms, e),
  24538. n = (function (t) {
  24539. for (
  24540. var e = t.map(function (t) {
  24541. return { data: t, offset: 0, dataLen: 0, dirty: 0 };
  24542. }),
  24543. r = 0,
  24544. n = 0,
  24545. i = 0,
  24546. o = 0;
  24547. o < e.length;
  24548. o++
  24549. ) {
  24550. var s = e[o];
  24551. if (
  24552. ((r = GF[s.data.type]),
  24553. s.data.size > 1 && (r = Math.max(r, 16) * s.data.size),
  24554. (s.dataLen = r),
  24555. n % r != 0 && n < 16)
  24556. ) {
  24557. var a = (n % r) % 16;
  24558. (n += a), (i += a);
  24559. }
  24560. n + r > 16
  24561. ? ((i = 16 * Math.ceil(i / 16)),
  24562. (s.offset = i),
  24563. (i += r),
  24564. (n = r))
  24565. : ((s.offset = i), (n += r), (i += r));
  24566. }
  24567. return { uboElements: e, size: (i = 16 * Math.ceil(i / 16)) };
  24568. })(r),
  24569. i = n.uboElements,
  24570. o = n.size,
  24571. s = [
  24572. '\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n ',
  24573. ],
  24574. a = 0;
  24575. a < i.length;
  24576. a++
  24577. ) {
  24578. for (
  24579. var u = i[a],
  24580. c = t.uniforms[u.data.name],
  24581. h = u.data.name,
  24582. l = !1,
  24583. d = 0;
  24584. d < dF.length;
  24585. d++
  24586. ) {
  24587. var f = dF[d];
  24588. if (f.codeUbo && f.test(u.data, c)) {
  24589. s.push(
  24590. 'offset = ' + u.offset / 4 + ';',
  24591. dF[d].codeUbo(u.data.name, c)
  24592. ),
  24593. (l = !0);
  24594. break;
  24595. }
  24596. }
  24597. if (!l)
  24598. if (u.data.size > 1) {
  24599. var p = uF(u.data.type),
  24600. v = Math.max(GF[u.data.type] / 16, 1),
  24601. m = p / v,
  24602. y = (4 - (m % 4)) % 4;
  24603. s.push(
  24604. '\n cv = ud.' +
  24605. h +
  24606. '.value;\n v = uv.' +
  24607. h +
  24608. ';\n offset = ' +
  24609. u.offset / 4 +
  24610. ';\n\n t = 0;\n\n for(var i=0; i < ' +
  24611. u.data.size * v +
  24612. '; i++)\n {\n for(var j = 0; j < ' +
  24613. m +
  24614. '; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ' +
  24615. y +
  24616. ';\n }\n\n '
  24617. );
  24618. } else {
  24619. var g = BF[u.data.type];
  24620. s.push(
  24621. '\n cv = ud.' +
  24622. h +
  24623. '.value;\n v = uv.' +
  24624. h +
  24625. ';\n offset = ' +
  24626. u.offset / 4 +
  24627. ';\n ' +
  24628. g +
  24629. ';\n '
  24630. );
  24631. }
  24632. }
  24633. return (
  24634. s.push('\n renderer.buffer.update(buffer);\n '),
  24635. {
  24636. size: o,
  24637. syncFunc: new Function(
  24638. 'ud',
  24639. 'uv',
  24640. 'renderer',
  24641. 'syncData',
  24642. 'buffer',
  24643. s.join('\n')
  24644. ),
  24645. }
  24646. );
  24647. }
  24648. var jF = (function () {
  24649. function t(t, e) {
  24650. (this.program = t),
  24651. (this.uniformData = e),
  24652. (this.uniformGroups = {}),
  24653. (this.uniformDirtyGroups = {}),
  24654. (this.uniformBufferBindings = {});
  24655. }
  24656. return (
  24657. (t.prototype.destroy = function () {
  24658. (this.uniformData = null),
  24659. (this.uniformGroups = null),
  24660. (this.uniformDirtyGroups = null),
  24661. (this.uniformBufferBindings = null),
  24662. (this.program = null);
  24663. }),
  24664. t
  24665. );
  24666. })();
  24667. function XF(t, e) {
  24668. var r = QL(t, t.VERTEX_SHADER, e.vertexSrc),
  24669. n = QL(t, t.FRAGMENT_SHADER, e.fragmentSrc),
  24670. i = t.createProgram();
  24671. if (
  24672. (t.attachShader(i, r),
  24673. t.attachShader(i, n),
  24674. t.linkProgram(i),
  24675. t.getProgramParameter(i, t.LINK_STATUS) ||
  24676. (function (t, e, r, n) {
  24677. t.getProgramParameter(e, t.LINK_STATUS) ||
  24678. (t.getShaderParameter(r, t.COMPILE_STATUS) || $L(t, r),
  24679. t.getShaderParameter(n, t.COMPILE_STATUS) || $L(t, n),
  24680. console.error('PixiJS Error: Could not initialize shader.'),
  24681. '' !== t.getProgramInfoLog(e) &&
  24682. console.warn(
  24683. 'PixiJS Warning: gl.getProgramInfoLog()',
  24684. t.getProgramInfoLog(e)
  24685. ));
  24686. })(t, i, r, n),
  24687. (e.attributeData = (function (t, e) {
  24688. for (
  24689. var r = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), i = 0;
  24690. i < n;
  24691. i++
  24692. ) {
  24693. var o = e.getActiveAttrib(t, i);
  24694. if (0 !== o.name.indexOf('gl_')) {
  24695. var s = lF(e, o.type),
  24696. a = {
  24697. type: s,
  24698. name: o.name,
  24699. size: uF(s),
  24700. location: e.getAttribLocation(t, o.name),
  24701. };
  24702. r[o.name] = a;
  24703. }
  24704. }
  24705. return r;
  24706. })(i, t)),
  24707. (e.uniformData = (function (t, e) {
  24708. for (
  24709. var r = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), i = 0;
  24710. i < n;
  24711. i++
  24712. ) {
  24713. var o = e.getActiveUniform(t, i),
  24714. s = o.name.replace(/\[.*?\]$/, ''),
  24715. a = !!o.name.match(/\[.*?\]$/),
  24716. u = lF(e, o.type);
  24717. r[s] = {
  24718. name: s,
  24719. index: i,
  24720. type: u,
  24721. size: o.size,
  24722. isArray: a,
  24723. value: eF(u, o.size),
  24724. };
  24725. }
  24726. return r;
  24727. })(i, t)),
  24728. !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc))
  24729. ) {
  24730. var o = Object.keys(e.attributeData);
  24731. o.sort(function (t, e) {
  24732. return t > e ? 1 : -1;
  24733. });
  24734. for (var s = 0; s < o.length; s++)
  24735. (e.attributeData[o[s]].location = s), t.bindAttribLocation(i, s, o[s]);
  24736. t.linkProgram(i);
  24737. }
  24738. t.deleteShader(r), t.deleteShader(n);
  24739. var a = {};
  24740. for (var s in e.uniformData) {
  24741. var u = e.uniformData[s];
  24742. a[s] = {
  24743. location: t.getUniformLocation(i, s),
  24744. value: eF(u.type, u.size),
  24745. };
  24746. }
  24747. return new jF(i, a);
  24748. }
  24749. var VF = 0,
  24750. HF = { textureCount: 0, uboCount: 0 },
  24751. WF = (function () {
  24752. function t(t) {
  24753. (this.destroyed = !1),
  24754. (this.renderer = t),
  24755. this.systemCheck(),
  24756. (this.gl = null),
  24757. (this.shader = null),
  24758. (this.program = null),
  24759. (this.cache = {}),
  24760. (this._uboCache = {}),
  24761. (this.id = VF++);
  24762. }
  24763. return (
  24764. (t.prototype.systemCheck = function () {
  24765. if (
  24766. !(function () {
  24767. if ('boolean' == typeof vF) return vF;
  24768. try {
  24769. var t = new Function(
  24770. 'param1',
  24771. 'param2',
  24772. 'param3',
  24773. 'return param1[param2] === param3;'
  24774. );
  24775. vF = !0 === t({ a: 'b' }, 'a', 'b');
  24776. } catch (t) {
  24777. vF = !1;
  24778. }
  24779. return vF;
  24780. })()
  24781. )
  24782. throw new Error(
  24783. 'Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.'
  24784. );
  24785. }),
  24786. (t.prototype.contextChange = function (t) {
  24787. (this.gl = t), this.reset();
  24788. }),
  24789. (t.prototype.bind = function (t, e) {
  24790. t.disposeRunner.add(this),
  24791. (t.uniforms.globals = this.renderer.globalUniforms);
  24792. var r = t.program,
  24793. n =
  24794. r.glPrograms[this.renderer.CONTEXT_UID] ||
  24795. this.generateProgram(t);
  24796. return (
  24797. (this.shader = t),
  24798. this.program !== r &&
  24799. ((this.program = r), this.gl.useProgram(n.program)),
  24800. e ||
  24801. ((HF.textureCount = 0),
  24802. (HF.uboCount = 0),
  24803. this.syncUniformGroup(t.uniformGroup, HF)),
  24804. n
  24805. );
  24806. }),
  24807. (t.prototype.setUniforms = function (t) {
  24808. var e = this.shader.program,
  24809. r = e.glPrograms[this.renderer.CONTEXT_UID];
  24810. e.syncUniforms(r.uniformData, t, this.renderer);
  24811. }),
  24812. (t.prototype.syncUniformGroup = function (t, e) {
  24813. var r = this.getGlProgram();
  24814. (t.static && t.dirtyId === r.uniformDirtyGroups[t.id]) ||
  24815. ((r.uniformDirtyGroups[t.id] = t.dirtyId),
  24816. this.syncUniforms(t, r, e));
  24817. }),
  24818. (t.prototype.syncUniforms = function (t, e, r) {
  24819. (t.syncUniforms[this.shader.program.id] || this.createSyncGroups(t))(
  24820. e.uniformData,
  24821. t.uniforms,
  24822. this.renderer,
  24823. r
  24824. );
  24825. }),
  24826. (t.prototype.createSyncGroups = function (t) {
  24827. var e = this.getSignature(t, this.shader.program.uniformData, 'u');
  24828. return (
  24829. this.cache[e] ||
  24830. (this.cache[e] = (function (t, e) {
  24831. var r,
  24832. n = [
  24833. '\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n ',
  24834. ];
  24835. for (var i in t.uniforms) {
  24836. var o = e[i];
  24837. if (o) {
  24838. for (
  24839. var s = t.uniforms[i], a = !1, u = 0;
  24840. u < dF.length;
  24841. u++
  24842. )
  24843. if (dF[u].test(o, s)) {
  24844. n.push(dF[u].code(i, s)), (a = !0);
  24845. break;
  24846. }
  24847. if (!a) {
  24848. var c = (1 !== o.size || o.isArray ? pF : fF)[
  24849. o.type
  24850. ].replace('location', 'ud["' + i + '"].location');
  24851. n.push(
  24852. '\n cu = ud["' +
  24853. i +
  24854. '"];\n cv = cu.value;\n v = uv["' +
  24855. i +
  24856. '"];\n ' +
  24857. c +
  24858. ';'
  24859. );
  24860. }
  24861. } else
  24862. (null === (r = t.uniforms[i]) || void 0 === r
  24863. ? void 0
  24864. : r.group) &&
  24865. (t.uniforms[i].ubo
  24866. ? n.push(
  24867. '\n renderer.shader.syncUniformBufferGroup(uv.' +
  24868. i +
  24869. ", '" +
  24870. i +
  24871. "');\n "
  24872. )
  24873. : n.push(
  24874. '\n renderer.shader.syncUniformGroup(uv.' +
  24875. i +
  24876. ', syncData);\n '
  24877. ));
  24878. }
  24879. return new Function(
  24880. 'ud',
  24881. 'uv',
  24882. 'renderer',
  24883. 'syncData',
  24884. n.join('\n')
  24885. );
  24886. })(t, this.shader.program.uniformData)),
  24887. (t.syncUniforms[this.shader.program.id] = this.cache[e]),
  24888. t.syncUniforms[this.shader.program.id]
  24889. );
  24890. }),
  24891. (t.prototype.syncUniformBufferGroup = function (t, e) {
  24892. var r = this.getGlProgram();
  24893. if (!t.static || 0 !== t.dirtyId || !r.uniformGroups[t.id]) {
  24894. t.dirtyId = 0;
  24895. var n =
  24896. r.uniformGroups[t.id] || this.createSyncBufferGroup(t, r, e);
  24897. t.buffer.update(),
  24898. n(r.uniformData, t.uniforms, this.renderer, HF, t.buffer);
  24899. }
  24900. this.renderer.buffer.bindBufferBase(
  24901. t.buffer,
  24902. r.uniformBufferBindings[e]
  24903. );
  24904. }),
  24905. (t.prototype.createSyncBufferGroup = function (t, e, r) {
  24906. var n = this.renderer.gl;
  24907. this.renderer.buffer.bind(t.buffer);
  24908. var i = this.gl.getUniformBlockIndex(e.program, r);
  24909. (e.uniformBufferBindings[r] = this.shader.uniformBindCount),
  24910. n.uniformBlockBinding(e.program, i, this.shader.uniformBindCount),
  24911. this.shader.uniformBindCount++;
  24912. var o = this.getSignature(t, this.shader.program.uniformData, 'ubo'),
  24913. s = this._uboCache[o];
  24914. if (
  24915. (s ||
  24916. (s = this._uboCache[o] = UF(t, this.shader.program.uniformData)),
  24917. t.autoManage)
  24918. ) {
  24919. var a = new Float32Array(s.size / 4);
  24920. t.buffer.update(a);
  24921. }
  24922. return (e.uniformGroups[t.id] = s.syncFunc), e.uniformGroups[t.id];
  24923. }),
  24924. (t.prototype.getSignature = function (t, e, r) {
  24925. var n = t.uniforms,
  24926. i = [r + '-'];
  24927. for (var o in n) i.push(o), e[o] && i.push(e[o].type);
  24928. return i.join('-');
  24929. }),
  24930. (t.prototype.getGlProgram = function () {
  24931. return this.shader
  24932. ? this.shader.program.glPrograms[this.renderer.CONTEXT_UID]
  24933. : null;
  24934. }),
  24935. (t.prototype.generateProgram = function (t) {
  24936. var e = this.gl,
  24937. r = t.program,
  24938. n = XF(e, r);
  24939. return (r.glPrograms[this.renderer.CONTEXT_UID] = n), n;
  24940. }),
  24941. (t.prototype.reset = function () {
  24942. (this.program = null), (this.shader = null);
  24943. }),
  24944. (t.prototype.disposeShader = function (t) {
  24945. this.shader === t && (this.shader = null);
  24946. }),
  24947. (t.prototype.destroy = function () {
  24948. (this.renderer = null), (this.destroyed = !0);
  24949. }),
  24950. t
  24951. );
  24952. })();
  24953. var YF = (function () {
  24954. function t() {
  24955. (this.gl = null),
  24956. (this.stateId = 0),
  24957. (this.polygonOffset = 0),
  24958. (this.blendMode = OP.NONE),
  24959. (this._blendEq = !1),
  24960. (this.map = []),
  24961. (this.map[0] = this.setBlend),
  24962. (this.map[1] = this.setOffset),
  24963. (this.map[2] = this.setCullFace),
  24964. (this.map[3] = this.setDepthTest),
  24965. (this.map[4] = this.setFrontFace),
  24966. (this.map[5] = this.setDepthMask),
  24967. (this.checks = []),
  24968. (this.defaultState = new xF()),
  24969. (this.defaultState.blend = !0);
  24970. }
  24971. return (
  24972. (t.prototype.contextChange = function (t) {
  24973. (this.gl = t),
  24974. (this.blendModes = (function (t, e) {
  24975. return (
  24976. void 0 === e && (e = []),
  24977. (e[OP.NORMAL] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24978. (e[OP.ADD] = [t.ONE, t.ONE]),
  24979. (e[OP.MULTIPLY] = [
  24980. t.DST_COLOR,
  24981. t.ONE_MINUS_SRC_ALPHA,
  24982. t.ONE,
  24983. t.ONE_MINUS_SRC_ALPHA,
  24984. ]),
  24985. (e[OP.SCREEN] = [
  24986. t.ONE,
  24987. t.ONE_MINUS_SRC_COLOR,
  24988. t.ONE,
  24989. t.ONE_MINUS_SRC_ALPHA,
  24990. ]),
  24991. (e[OP.OVERLAY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24992. (e[OP.DARKEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24993. (e[OP.LIGHTEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24994. (e[OP.COLOR_DODGE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24995. (e[OP.COLOR_BURN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24996. (e[OP.HARD_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24997. (e[OP.SOFT_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24998. (e[OP.DIFFERENCE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  24999. (e[OP.EXCLUSION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  25000. (e[OP.HUE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  25001. (e[OP.SATURATION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  25002. (e[OP.COLOR] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  25003. (e[OP.LUMINOSITY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
  25004. (e[OP.NONE] = [0, 0]),
  25005. (e[OP.NORMAL_NPM] = [
  25006. t.SRC_ALPHA,
  25007. t.ONE_MINUS_SRC_ALPHA,
  25008. t.ONE,
  25009. t.ONE_MINUS_SRC_ALPHA,
  25010. ]),
  25011. (e[OP.ADD_NPM] = [t.SRC_ALPHA, t.ONE, t.ONE, t.ONE]),
  25012. (e[OP.SCREEN_NPM] = [
  25013. t.SRC_ALPHA,
  25014. t.ONE_MINUS_SRC_COLOR,
  25015. t.ONE,
  25016. t.ONE_MINUS_SRC_ALPHA,
  25017. ]),
  25018. (e[OP.SRC_IN] = [t.DST_ALPHA, t.ZERO]),
  25019. (e[OP.SRC_OUT] = [t.ONE_MINUS_DST_ALPHA, t.ZERO]),
  25020. (e[OP.SRC_ATOP] = [t.DST_ALPHA, t.ONE_MINUS_SRC_ALPHA]),
  25021. (e[OP.DST_OVER] = [t.ONE_MINUS_DST_ALPHA, t.ONE]),
  25022. (e[OP.DST_IN] = [t.ZERO, t.SRC_ALPHA]),
  25023. (e[OP.DST_OUT] = [t.ZERO, t.ONE_MINUS_SRC_ALPHA]),
  25024. (e[OP.DST_ATOP] = [t.ONE_MINUS_DST_ALPHA, t.SRC_ALPHA]),
  25025. (e[OP.XOR] = [t.ONE_MINUS_DST_ALPHA, t.ONE_MINUS_SRC_ALPHA]),
  25026. (e[OP.SUBTRACT] = [
  25027. t.ONE,
  25028. t.ONE,
  25029. t.ONE,
  25030. t.ONE,
  25031. t.FUNC_REVERSE_SUBTRACT,
  25032. t.FUNC_ADD,
  25033. ]),
  25034. e
  25035. );
  25036. })(t)),
  25037. this.set(this.defaultState),
  25038. this.reset();
  25039. }),
  25040. (t.prototype.set = function (t) {
  25041. if (((t = t || this.defaultState), this.stateId !== t.data)) {
  25042. for (var e = this.stateId ^ t.data, r = 0; e; )
  25043. 1 & e && this.map[r].call(this, !!(t.data & (1 << r))),
  25044. (e >>= 1),
  25045. r++;
  25046. this.stateId = t.data;
  25047. }
  25048. for (r = 0; r < this.checks.length; r++) this.checks[r](this, t);
  25049. }),
  25050. (t.prototype.forceState = function (t) {
  25051. t = t || this.defaultState;
  25052. for (var e = 0; e < this.map.length; e++)
  25053. this.map[e].call(this, !!(t.data & (1 << e)));
  25054. for (e = 0; e < this.checks.length; e++) this.checks[e](this, t);
  25055. this.stateId = t.data;
  25056. }),
  25057. (t.prototype.setBlend = function (e) {
  25058. this.updateCheck(t.checkBlendMode, e),
  25059. this.gl[e ? 'enable' : 'disable'](this.gl.BLEND);
  25060. }),
  25061. (t.prototype.setOffset = function (e) {
  25062. this.updateCheck(t.checkPolygonOffset, e),
  25063. this.gl[e ? 'enable' : 'disable'](this.gl.POLYGON_OFFSET_FILL);
  25064. }),
  25065. (t.prototype.setDepthTest = function (t) {
  25066. this.gl[t ? 'enable' : 'disable'](this.gl.DEPTH_TEST);
  25067. }),
  25068. (t.prototype.setDepthMask = function (t) {
  25069. this.gl.depthMask(t);
  25070. }),
  25071. (t.prototype.setCullFace = function (t) {
  25072. this.gl[t ? 'enable' : 'disable'](this.gl.CULL_FACE);
  25073. }),
  25074. (t.prototype.setFrontFace = function (t) {
  25075. this.gl.frontFace(this.gl[t ? 'CW' : 'CCW']);
  25076. }),
  25077. (t.prototype.setBlendMode = function (t) {
  25078. if (t !== this.blendMode) {
  25079. this.blendMode = t;
  25080. var e = this.blendModes[t],
  25081. r = this.gl;
  25082. 2 === e.length
  25083. ? r.blendFunc(e[0], e[1])
  25084. : r.blendFuncSeparate(e[0], e[1], e[2], e[3]),
  25085. 6 === e.length
  25086. ? ((this._blendEq = !0), r.blendEquationSeparate(e[4], e[5]))
  25087. : this._blendEq &&
  25088. ((this._blendEq = !1),
  25089. r.blendEquationSeparate(r.FUNC_ADD, r.FUNC_ADD));
  25090. }
  25091. }),
  25092. (t.prototype.setPolygonOffset = function (t, e) {
  25093. this.gl.polygonOffset(t, e);
  25094. }),
  25095. (t.prototype.reset = function () {
  25096. this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1),
  25097. this.forceState(this.defaultState),
  25098. (this._blendEq = !0),
  25099. (this.blendMode = -1),
  25100. this.setBlendMode(0);
  25101. }),
  25102. (t.prototype.updateCheck = function (t, e) {
  25103. var r = this.checks.indexOf(t);
  25104. e && -1 === r
  25105. ? this.checks.push(t)
  25106. : e || -1 === r || this.checks.splice(r, 1);
  25107. }),
  25108. (t.checkBlendMode = function (t, e) {
  25109. t.setBlendMode(e.blendMode);
  25110. }),
  25111. (t.checkPolygonOffset = function (t, e) {
  25112. t.setPolygonOffset(1, e.polygonOffset);
  25113. }),
  25114. (t.prototype.destroy = function () {
  25115. this.gl = null;
  25116. }),
  25117. t
  25118. );
  25119. })(),
  25120. zF = (function () {
  25121. function t(t) {
  25122. (this.renderer = t),
  25123. (this.count = 0),
  25124. (this.checkCount = 0),
  25125. (this.maxIdle = vA.GC_MAX_IDLE),
  25126. (this.checkCountMax = vA.GC_MAX_CHECK_COUNT),
  25127. (this.mode = vA.GC_MODE);
  25128. }
  25129. return (
  25130. (t.prototype.postrender = function () {
  25131. this.renderer.renderingToScreen &&
  25132. (this.count++,
  25133. this.mode !== jP.MANUAL &&
  25134. (this.checkCount++,
  25135. this.checkCount > this.checkCountMax &&
  25136. ((this.checkCount = 0), this.run())));
  25137. }),
  25138. (t.prototype.run = function () {
  25139. for (
  25140. var t = this.renderer.texture, e = t.managedTextures, r = !1, n = 0;
  25141. n < e.length;
  25142. n++
  25143. ) {
  25144. var i = e[n];
  25145. !i.framebuffer &&
  25146. this.count - i.touched > this.maxIdle &&
  25147. (t.destroyTexture(i, !0), (e[n] = null), (r = !0));
  25148. }
  25149. if (r) {
  25150. var o = 0;
  25151. for (n = 0; n < e.length; n++) null !== e[n] && (e[o++] = e[n]);
  25152. e.length = o;
  25153. }
  25154. }),
  25155. (t.prototype.unload = function (t) {
  25156. var e = this.renderer.texture,
  25157. r = t._texture;
  25158. r && !r.framebuffer && e.destroyTexture(r);
  25159. for (var n = t.children.length - 1; n >= 0; n--)
  25160. this.unload(t.children[n]);
  25161. }),
  25162. (t.prototype.destroy = function () {
  25163. this.renderer = null;
  25164. }),
  25165. t
  25166. );
  25167. })();
  25168. var ZF = function (t) {
  25169. (this.texture = t),
  25170. (this.width = -1),
  25171. (this.height = -1),
  25172. (this.dirtyId = -1),
  25173. (this.dirtyStyleId = -1),
  25174. (this.mipmap = !1),
  25175. (this.wrapMode = 33071),
  25176. (this.type = LP.UNSIGNED_BYTE),
  25177. (this.internalFormat = MP.RGBA),
  25178. (this.samplerType = 0);
  25179. },
  25180. JF = (function () {
  25181. function t(t) {
  25182. (this.renderer = t),
  25183. (this.boundTextures = []),
  25184. (this.currentLocation = -1),
  25185. (this.managedTextures = []),
  25186. (this._unknownBoundTextures = !1),
  25187. (this.unknownTexture = new aL()),
  25188. (this.hasIntegerTextures = !1);
  25189. }
  25190. return (
  25191. (t.prototype.contextChange = function () {
  25192. var t = (this.gl = this.renderer.gl);
  25193. (this.CONTEXT_UID = this.renderer.CONTEXT_UID),
  25194. (this.webGLVersion = this.renderer.context.webGLVersion),
  25195. (this.internalFormats = (function (t) {
  25196. var e,
  25197. r,
  25198. n,
  25199. i,
  25200. o,
  25201. s,
  25202. a,
  25203. u,
  25204. c,
  25205. h,
  25206. l,
  25207. d,
  25208. f,
  25209. p,
  25210. v,
  25211. m,
  25212. y,
  25213. g,
  25214. _,
  25215. b,
  25216. T,
  25217. x,
  25218. E;
  25219. return (
  25220. 'WebGL2RenderingContext' in globalThis &&
  25221. t instanceof globalThis.WebGL2RenderingContext
  25222. ? (((e = {})[LP.UNSIGNED_BYTE] =
  25223. (((r = {})[MP.RGBA] = t.RGBA8),
  25224. (r[MP.RGB] = t.RGB8),
  25225. (r[MP.RG] = t.RG8),
  25226. (r[MP.RED] = t.R8),
  25227. (r[MP.RGBA_INTEGER] = t.RGBA8UI),
  25228. (r[MP.RGB_INTEGER] = t.RGB8UI),
  25229. (r[MP.RG_INTEGER] = t.RG8UI),
  25230. (r[MP.RED_INTEGER] = t.R8UI),
  25231. (r[MP.ALPHA] = t.ALPHA),
  25232. (r[MP.LUMINANCE] = t.LUMINANCE),
  25233. (r[MP.LUMINANCE_ALPHA] = t.LUMINANCE_ALPHA),
  25234. r)),
  25235. (e[LP.BYTE] =
  25236. (((n = {})[MP.RGBA] = t.RGBA8_SNORM),
  25237. (n[MP.RGB] = t.RGB8_SNORM),
  25238. (n[MP.RG] = t.RG8_SNORM),
  25239. (n[MP.RED] = t.R8_SNORM),
  25240. (n[MP.RGBA_INTEGER] = t.RGBA8I),
  25241. (n[MP.RGB_INTEGER] = t.RGB8I),
  25242. (n[MP.RG_INTEGER] = t.RG8I),
  25243. (n[MP.RED_INTEGER] = t.R8I),
  25244. n)),
  25245. (e[LP.UNSIGNED_SHORT] =
  25246. (((i = {})[MP.RGBA_INTEGER] = t.RGBA16UI),
  25247. (i[MP.RGB_INTEGER] = t.RGB16UI),
  25248. (i[MP.RG_INTEGER] = t.RG16UI),
  25249. (i[MP.RED_INTEGER] = t.R16UI),
  25250. (i[MP.DEPTH_COMPONENT] = t.DEPTH_COMPONENT16),
  25251. i)),
  25252. (e[LP.SHORT] =
  25253. (((o = {})[MP.RGBA_INTEGER] = t.RGBA16I),
  25254. (o[MP.RGB_INTEGER] = t.RGB16I),
  25255. (o[MP.RG_INTEGER] = t.RG16I),
  25256. (o[MP.RED_INTEGER] = t.R16I),
  25257. o)),
  25258. (e[LP.UNSIGNED_INT] =
  25259. (((s = {})[MP.RGBA_INTEGER] = t.RGBA32UI),
  25260. (s[MP.RGB_INTEGER] = t.RGB32UI),
  25261. (s[MP.RG_INTEGER] = t.RG32UI),
  25262. (s[MP.RED_INTEGER] = t.R32UI),
  25263. (s[MP.DEPTH_COMPONENT] = t.DEPTH_COMPONENT24),
  25264. s)),
  25265. (e[LP.INT] =
  25266. (((a = {})[MP.RGBA_INTEGER] = t.RGBA32I),
  25267. (a[MP.RGB_INTEGER] = t.RGB32I),
  25268. (a[MP.RG_INTEGER] = t.RG32I),
  25269. (a[MP.RED_INTEGER] = t.R32I),
  25270. a)),
  25271. (e[LP.FLOAT] =
  25272. (((u = {})[MP.RGBA] = t.RGBA32F),
  25273. (u[MP.RGB] = t.RGB32F),
  25274. (u[MP.RG] = t.RG32F),
  25275. (u[MP.RED] = t.R32F),
  25276. (u[MP.DEPTH_COMPONENT] = t.DEPTH_COMPONENT32F),
  25277. u)),
  25278. (e[LP.HALF_FLOAT] =
  25279. (((c = {})[MP.RGBA] = t.RGBA16F),
  25280. (c[MP.RGB] = t.RGB16F),
  25281. (c[MP.RG] = t.RG16F),
  25282. (c[MP.RED] = t.R16F),
  25283. c)),
  25284. (e[LP.UNSIGNED_SHORT_5_6_5] =
  25285. (((h = {})[MP.RGB] = t.RGB565), h)),
  25286. (e[LP.UNSIGNED_SHORT_4_4_4_4] =
  25287. (((l = {})[MP.RGBA] = t.RGBA4), l)),
  25288. (e[LP.UNSIGNED_SHORT_5_5_5_1] =
  25289. (((d = {})[MP.RGBA] = t.RGB5_A1), d)),
  25290. (e[LP.UNSIGNED_INT_2_10_10_10_REV] =
  25291. (((f = {})[MP.RGBA] = t.RGB10_A2),
  25292. (f[MP.RGBA_INTEGER] = t.RGB10_A2UI),
  25293. f)),
  25294. (e[LP.UNSIGNED_INT_10F_11F_11F_REV] =
  25295. (((p = {})[MP.RGB] = t.R11F_G11F_B10F), p)),
  25296. (e[LP.UNSIGNED_INT_5_9_9_9_REV] =
  25297. (((v = {})[MP.RGB] = t.RGB9_E5), v)),
  25298. (e[LP.UNSIGNED_INT_24_8] =
  25299. (((m = {})[MP.DEPTH_STENCIL] = t.DEPTH24_STENCIL8), m)),
  25300. (e[LP.FLOAT_32_UNSIGNED_INT_24_8_REV] =
  25301. (((y = {})[MP.DEPTH_STENCIL] = t.DEPTH32F_STENCIL8), y)),
  25302. (E = e))
  25303. : (((g = {})[LP.UNSIGNED_BYTE] =
  25304. (((_ = {})[MP.RGBA] = t.RGBA),
  25305. (_[MP.RGB] = t.RGB),
  25306. (_[MP.ALPHA] = t.ALPHA),
  25307. (_[MP.LUMINANCE] = t.LUMINANCE),
  25308. (_[MP.LUMINANCE_ALPHA] = t.LUMINANCE_ALPHA),
  25309. _)),
  25310. (g[LP.UNSIGNED_SHORT_5_6_5] =
  25311. (((b = {})[MP.RGB] = t.RGB), b)),
  25312. (g[LP.UNSIGNED_SHORT_4_4_4_4] =
  25313. (((T = {})[MP.RGBA] = t.RGBA), T)),
  25314. (g[LP.UNSIGNED_SHORT_5_5_5_1] =
  25315. (((x = {})[MP.RGBA] = t.RGBA), x)),
  25316. (E = g)),
  25317. E
  25318. );
  25319. })(t));
  25320. var e = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);
  25321. this.boundTextures.length = e;
  25322. for (var r = 0; r < e; r++) this.boundTextures[r] = null;
  25323. this.emptyTextures = {};
  25324. var n = new ZF(t.createTexture());
  25325. t.bindTexture(t.TEXTURE_2D, n.texture),
  25326. t.texImage2D(
  25327. t.TEXTURE_2D,
  25328. 0,
  25329. t.RGBA,
  25330. 1,
  25331. 1,
  25332. 0,
  25333. t.RGBA,
  25334. t.UNSIGNED_BYTE,
  25335. new Uint8Array(4)
  25336. ),
  25337. (this.emptyTextures[t.TEXTURE_2D] = n),
  25338. (this.emptyTextures[t.TEXTURE_CUBE_MAP] = new ZF(
  25339. t.createTexture()
  25340. )),
  25341. t.bindTexture(
  25342. t.TEXTURE_CUBE_MAP,
  25343. this.emptyTextures[t.TEXTURE_CUBE_MAP].texture
  25344. );
  25345. for (r = 0; r < 6; r++)
  25346. t.texImage2D(
  25347. t.TEXTURE_CUBE_MAP_POSITIVE_X + r,
  25348. 0,
  25349. t.RGBA,
  25350. 1,
  25351. 1,
  25352. 0,
  25353. t.RGBA,
  25354. t.UNSIGNED_BYTE,
  25355. null
  25356. );
  25357. t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MAG_FILTER, t.LINEAR),
  25358. t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MIN_FILTER, t.LINEAR);
  25359. for (r = 0; r < this.boundTextures.length; r++) this.bind(null, r);
  25360. }),
  25361. (t.prototype.bind = function (t, e) {
  25362. void 0 === e && (e = 0);
  25363. var r = this.gl;
  25364. if (
  25365. (t = null == t ? void 0 : t.castToBaseTexture()) &&
  25366. t.valid &&
  25367. !t.parentTextureArray
  25368. ) {
  25369. t.touched = this.renderer.textureGC.count;
  25370. var n = t._glTextures[this.CONTEXT_UID] || this.initTexture(t);
  25371. this.boundTextures[e] !== t &&
  25372. (this.currentLocation !== e &&
  25373. ((this.currentLocation = e), r.activeTexture(r.TEXTURE0 + e)),
  25374. r.bindTexture(t.target, n.texture)),
  25375. n.dirtyId !== t.dirtyId
  25376. ? (this.currentLocation !== e &&
  25377. ((this.currentLocation = e),
  25378. r.activeTexture(r.TEXTURE0 + e)),
  25379. this.updateTexture(t))
  25380. : n.dirtyStyleId !== t.dirtyStyleId &&
  25381. this.updateTextureStyle(t),
  25382. (this.boundTextures[e] = t);
  25383. } else
  25384. this.currentLocation !== e &&
  25385. ((this.currentLocation = e), r.activeTexture(r.TEXTURE0 + e)),
  25386. r.bindTexture(
  25387. r.TEXTURE_2D,
  25388. this.emptyTextures[r.TEXTURE_2D].texture
  25389. ),
  25390. (this.boundTextures[e] = null);
  25391. }),
  25392. (t.prototype.reset = function () {
  25393. (this._unknownBoundTextures = !0),
  25394. (this.hasIntegerTextures = !1),
  25395. (this.currentLocation = -1);
  25396. for (var t = 0; t < this.boundTextures.length; t++)
  25397. this.boundTextures[t] = this.unknownTexture;
  25398. }),
  25399. (t.prototype.unbind = function (t) {
  25400. var e = this.gl,
  25401. r = this.boundTextures;
  25402. if (this._unknownBoundTextures) {
  25403. this._unknownBoundTextures = !1;
  25404. for (var n = 0; n < r.length; n++)
  25405. r[n] === this.unknownTexture && this.bind(null, n);
  25406. }
  25407. for (n = 0; n < r.length; n++)
  25408. r[n] === t &&
  25409. (this.currentLocation !== n &&
  25410. (e.activeTexture(e.TEXTURE0 + n), (this.currentLocation = n)),
  25411. e.bindTexture(t.target, this.emptyTextures[t.target].texture),
  25412. (r[n] = null));
  25413. }),
  25414. (t.prototype.ensureSamplerType = function (t) {
  25415. var e = this,
  25416. r = e.boundTextures,
  25417. n = e.hasIntegerTextures,
  25418. i = e.CONTEXT_UID;
  25419. if (n)
  25420. for (var o = t - 1; o >= 0; --o) {
  25421. var s = r[o];
  25422. if (s)
  25423. s._glTextures[i].samplerType !== FP.FLOAT &&
  25424. this.renderer.texture.unbind(s);
  25425. }
  25426. }),
  25427. (t.prototype.initTexture = function (t) {
  25428. var e = new ZF(this.gl.createTexture());
  25429. return (
  25430. (e.dirtyId = -1),
  25431. (t._glTextures[this.CONTEXT_UID] = e),
  25432. this.managedTextures.push(t),
  25433. t.on('dispose', this.destroyTexture, this),
  25434. e
  25435. );
  25436. }),
  25437. (t.prototype.initTextureType = function (t, e) {
  25438. var r, n;
  25439. (e.internalFormat =
  25440. null !==
  25441. (n =
  25442. null === (r = this.internalFormats[t.type]) || void 0 === r
  25443. ? void 0
  25444. : r[t.format]) && void 0 !== n
  25445. ? n
  25446. : t.format),
  25447. 2 === this.webGLVersion && t.type === LP.HALF_FLOAT
  25448. ? (e.type = this.gl.HALF_FLOAT)
  25449. : (e.type = t.type);
  25450. }),
  25451. (t.prototype.updateTexture = function (t) {
  25452. var e = t._glTextures[this.CONTEXT_UID];
  25453. if (e) {
  25454. var r = this.renderer;
  25455. if (
  25456. (this.initTextureType(t, e),
  25457. t.resource && t.resource.upload(r, t, e))
  25458. )
  25459. e.samplerType !== FP.FLOAT && (this.hasIntegerTextures = !0);
  25460. else {
  25461. var n = t.realWidth,
  25462. i = t.realHeight,
  25463. o = r.gl;
  25464. (e.width !== n || e.height !== i || e.dirtyId < 0) &&
  25465. ((e.width = n),
  25466. (e.height = i),
  25467. o.texImage2D(
  25468. t.target,
  25469. 0,
  25470. e.internalFormat,
  25471. n,
  25472. i,
  25473. 0,
  25474. t.format,
  25475. e.type,
  25476. null
  25477. ));
  25478. }
  25479. t.dirtyStyleId !== e.dirtyStyleId && this.updateTextureStyle(t),
  25480. (e.dirtyId = t.dirtyId);
  25481. }
  25482. }),
  25483. (t.prototype.destroyTexture = function (t, e) {
  25484. var r = this.gl;
  25485. if (
  25486. (t = t.castToBaseTexture())._glTextures[this.CONTEXT_UID] &&
  25487. (this.unbind(t),
  25488. r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),
  25489. t.off('dispose', this.destroyTexture, this),
  25490. delete t._glTextures[this.CONTEXT_UID],
  25491. !e)
  25492. ) {
  25493. var n = this.managedTextures.indexOf(t);
  25494. -1 !== n && rD(this.managedTextures, n, 1);
  25495. }
  25496. }),
  25497. (t.prototype.updateTextureStyle = function (t) {
  25498. var e = t._glTextures[this.CONTEXT_UID];
  25499. e &&
  25500. ((t.mipmap !== BP.POW2 && 2 === this.webGLVersion) || t.isPowerOfTwo
  25501. ? (e.mipmap = t.mipmap >= 1)
  25502. : (e.mipmap = !1),
  25503. 2 === this.webGLVersion || t.isPowerOfTwo
  25504. ? (e.wrapMode = t.wrapMode)
  25505. : (e.wrapMode = kP.CLAMP),
  25506. (t.resource && t.resource.style(this.renderer, t, e)) ||
  25507. this.setStyle(t, e),
  25508. (e.dirtyStyleId = t.dirtyStyleId));
  25509. }),
  25510. (t.prototype.setStyle = function (t, e) {
  25511. var r = this.gl;
  25512. if (
  25513. (e.mipmap &&
  25514. t.mipmap !== BP.ON_MANUAL &&
  25515. r.generateMipmap(t.target),
  25516. r.texParameteri(t.target, r.TEXTURE_WRAP_S, e.wrapMode),
  25517. r.texParameteri(t.target, r.TEXTURE_WRAP_T, e.wrapMode),
  25518. e.mipmap)
  25519. ) {
  25520. r.texParameteri(
  25521. t.target,
  25522. r.TEXTURE_MIN_FILTER,
  25523. t.scaleMode === NP.LINEAR
  25524. ? r.LINEAR_MIPMAP_LINEAR
  25525. : r.NEAREST_MIPMAP_NEAREST
  25526. );
  25527. var n = this.renderer.context.extensions.anisotropicFiltering;
  25528. if (n && t.anisotropicLevel > 0 && t.scaleMode === NP.LINEAR) {
  25529. var i = Math.min(
  25530. t.anisotropicLevel,
  25531. r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)
  25532. );
  25533. r.texParameterf(t.target, n.TEXTURE_MAX_ANISOTROPY_EXT, i);
  25534. }
  25535. } else
  25536. r.texParameteri(
  25537. t.target,
  25538. r.TEXTURE_MIN_FILTER,
  25539. t.scaleMode === NP.LINEAR ? r.LINEAR : r.NEAREST
  25540. );
  25541. r.texParameteri(
  25542. t.target,
  25543. r.TEXTURE_MAG_FILTER,
  25544. t.scaleMode === NP.LINEAR ? r.LINEAR : r.NEAREST
  25545. );
  25546. }),
  25547. (t.prototype.destroy = function () {
  25548. this.renderer = null;
  25549. }),
  25550. t
  25551. );
  25552. })(),
  25553. KF = new CD(),
  25554. qF = (function (t) {
  25555. function e(e, r) {
  25556. void 0 === e && (e = PP.UNKNOWN);
  25557. var n = t.call(this) || this;
  25558. return (
  25559. (r = Object.assign({}, vA.RENDER_OPTIONS, r)),
  25560. (n.options = r),
  25561. (n.type = e),
  25562. (n.screen = new TD(0, 0, r.width, r.height)),
  25563. (n.view = r.view || vA.ADAPTER.createCanvas()),
  25564. (n.resolution = r.resolution || vA.RESOLUTION),
  25565. (n.useContextAlpha = r.useContextAlpha),
  25566. (n.autoDensity = !!r.autoDensity),
  25567. (n.preserveDrawingBuffer = r.preserveDrawingBuffer),
  25568. (n.clearBeforeRender = r.clearBeforeRender),
  25569. (n._backgroundColor = 0),
  25570. (n._backgroundColorRgba = [0, 0, 0, 1]),
  25571. (n._backgroundColorString = '#000000'),
  25572. (n.backgroundColor = r.backgroundColor || n._backgroundColor),
  25573. (n.backgroundAlpha = r.backgroundAlpha),
  25574. void 0 !== r.transparent &&
  25575. (aD(
  25576. '6.0.0',
  25577. 'Option transparent is deprecated, please use backgroundAlpha instead.'
  25578. ),
  25579. (n.useContextAlpha = r.transparent),
  25580. (n.backgroundAlpha = r.transparent ? 0 : 1)),
  25581. (n._lastObjectRendered = null),
  25582. (n.plugins = {}),
  25583. n
  25584. );
  25585. }
  25586. return (
  25587. rL(e, t),
  25588. (e.prototype.initPlugins = function (t) {
  25589. for (var e in t) this.plugins[e] = new t[e](this);
  25590. }),
  25591. Object.defineProperty(e.prototype, 'width', {
  25592. get: function () {
  25593. return this.view.width;
  25594. },
  25595. enumerable: !1,
  25596. configurable: !0,
  25597. }),
  25598. Object.defineProperty(e.prototype, 'height', {
  25599. get: function () {
  25600. return this.view.height;
  25601. },
  25602. enumerable: !1,
  25603. configurable: !0,
  25604. }),
  25605. (e.prototype.resize = function (t, e) {
  25606. (this.view.width = Math.round(t * this.resolution)),
  25607. (this.view.height = Math.round(e * this.resolution));
  25608. var r = this.view.width / this.resolution,
  25609. n = this.view.height / this.resolution;
  25610. (this.screen.width = r),
  25611. (this.screen.height = n),
  25612. this.autoDensity &&
  25613. ((this.view.style.width = r + 'px'),
  25614. (this.view.style.height = n + 'px')),
  25615. this.emit('resize', r, n);
  25616. }),
  25617. (e.prototype.generateTexture = function (t, e, r, n) {
  25618. void 0 === e && (e = {}),
  25619. 'number' == typeof e &&
  25620. (aD(
  25621. '6.1.0',
  25622. 'generateTexture options (scaleMode, resolution, region) are now object options.'
  25623. ),
  25624. (e = { scaleMode: e, resolution: r, region: n }));
  25625. var i = e.region,
  25626. o = (function (t, e) {
  25627. var r = {};
  25628. for (var n in t)
  25629. Object.prototype.hasOwnProperty.call(t, n) &&
  25630. e.indexOf(n) < 0 &&
  25631. (r[n] = t[n]);
  25632. if (
  25633. null != t &&
  25634. 'function' == typeof Object.getOwnPropertySymbols
  25635. ) {
  25636. var i = 0;
  25637. for (n = Object.getOwnPropertySymbols(t); i < n.length; i++)
  25638. e.indexOf(n[i]) < 0 &&
  25639. Object.prototype.propertyIsEnumerable.call(t, n[i]) &&
  25640. (r[n[i]] = t[n[i]]);
  25641. }
  25642. return r;
  25643. })(e, ['region']);
  25644. 0 === (n = i || t.getLocalBounds(null, !0)).width && (n.width = 1),
  25645. 0 === n.height && (n.height = 1);
  25646. var s = SL.create(nL({ width: n.width, height: n.height }, o));
  25647. return (
  25648. (KF.tx = -n.x),
  25649. (KF.ty = -n.y),
  25650. this.render(t, {
  25651. renderTexture: s,
  25652. clear: !1,
  25653. transform: KF,
  25654. skipUpdateTransform: !!t.parent,
  25655. }),
  25656. s
  25657. );
  25658. }),
  25659. (e.prototype.destroy = function (t) {
  25660. for (var e in this.plugins)
  25661. this.plugins[e].destroy(), (this.plugins[e] = null);
  25662. t &&
  25663. this.view.parentNode &&
  25664. this.view.parentNode.removeChild(this.view);
  25665. var r = this;
  25666. (r.plugins = null),
  25667. (r.type = PP.UNKNOWN),
  25668. (r.view = null),
  25669. (r.screen = null),
  25670. (r._tempDisplayObjectParent = null),
  25671. (r.options = null),
  25672. (this._backgroundColorRgba = null),
  25673. (this._backgroundColorString = null),
  25674. (this._lastObjectRendered = null);
  25675. }),
  25676. Object.defineProperty(e.prototype, 'backgroundColor', {
  25677. get: function () {
  25678. return this._backgroundColor;
  25679. },
  25680. set: function (t) {
  25681. (this._backgroundColor = t),
  25682. (this._backgroundColorString = WM(t)),
  25683. HM(t, this._backgroundColorRgba);
  25684. },
  25685. enumerable: !1,
  25686. configurable: !0,
  25687. }),
  25688. Object.defineProperty(e.prototype, 'backgroundAlpha', {
  25689. get: function () {
  25690. return this._backgroundColorRgba[3];
  25691. },
  25692. set: function (t) {
  25693. this._backgroundColorRgba[3] = t;
  25694. },
  25695. enumerable: !1,
  25696. configurable: !0,
  25697. }),
  25698. e
  25699. );
  25700. })(yA),
  25701. QF = function (t) {
  25702. (this.buffer = t || null),
  25703. (this.updateID = -1),
  25704. (this.byteLength = -1),
  25705. (this.refCount = 0);
  25706. },
  25707. $F = (function () {
  25708. function t(t) {
  25709. (this.renderer = t),
  25710. (this.managedBuffers = {}),
  25711. (this.boundBufferBases = {});
  25712. }
  25713. return (
  25714. (t.prototype.destroy = function () {
  25715. this.renderer = null;
  25716. }),
  25717. (t.prototype.contextChange = function () {
  25718. this.disposeAll(!0),
  25719. (this.gl = this.renderer.gl),
  25720. (this.CONTEXT_UID = this.renderer.CONTEXT_UID);
  25721. }),
  25722. (t.prototype.bind = function (t) {
  25723. var e = this.gl,
  25724. r = this.CONTEXT_UID,
  25725. n = t._glBuffers[r] || this.createGLBuffer(t);
  25726. e.bindBuffer(t.type, n.buffer);
  25727. }),
  25728. (t.prototype.bindBufferBase = function (t, e) {
  25729. var r = this.gl,
  25730. n = this.CONTEXT_UID;
  25731. if (this.boundBufferBases[e] !== t) {
  25732. var i = t._glBuffers[n] || this.createGLBuffer(t);
  25733. (this.boundBufferBases[e] = t),
  25734. r.bindBufferBase(r.UNIFORM_BUFFER, e, i.buffer);
  25735. }
  25736. }),
  25737. (t.prototype.bindBufferRange = function (t, e, r) {
  25738. var n = this.gl,
  25739. i = this.CONTEXT_UID;
  25740. r = r || 0;
  25741. var o = t._glBuffers[i] || this.createGLBuffer(t);
  25742. n.bindBufferRange(n.UNIFORM_BUFFER, e || 0, o.buffer, 256 * r, 256);
  25743. }),
  25744. (t.prototype.update = function (t) {
  25745. var e = this.gl,
  25746. r = this.CONTEXT_UID,
  25747. n = t._glBuffers[r];
  25748. if (t._updateID !== n.updateID)
  25749. if (
  25750. ((n.updateID = t._updateID),
  25751. e.bindBuffer(t.type, n.buffer),
  25752. n.byteLength >= t.data.byteLength)
  25753. )
  25754. e.bufferSubData(t.type, 0, t.data);
  25755. else {
  25756. var i = t.static ? e.STATIC_DRAW : e.DYNAMIC_DRAW;
  25757. (n.byteLength = t.data.byteLength),
  25758. e.bufferData(t.type, t.data, i);
  25759. }
  25760. }),
  25761. (t.prototype.dispose = function (t, e) {
  25762. if (this.managedBuffers[t.id]) {
  25763. delete this.managedBuffers[t.id];
  25764. var r = t._glBuffers[this.CONTEXT_UID],
  25765. n = this.gl;
  25766. t.disposeRunner.remove(this),
  25767. r &&
  25768. (e || n.deleteBuffer(r.buffer),
  25769. delete t._glBuffers[this.CONTEXT_UID]);
  25770. }
  25771. }),
  25772. (t.prototype.disposeAll = function (t) {
  25773. for (
  25774. var e = Object.keys(this.managedBuffers), r = 0;
  25775. r < e.length;
  25776. r++
  25777. )
  25778. this.dispose(this.managedBuffers[e[r]], t);
  25779. }),
  25780. (t.prototype.createGLBuffer = function (t) {
  25781. var e = this.CONTEXT_UID,
  25782. r = this.gl;
  25783. return (
  25784. (t._glBuffers[e] = new QF(r.createBuffer())),
  25785. (this.managedBuffers[t.id] = t),
  25786. t.disposeRunner.add(this),
  25787. t._glBuffers[e]
  25788. );
  25789. }),
  25790. t
  25791. );
  25792. })(),
  25793. tN = (function (t) {
  25794. function e(r) {
  25795. var n = t.call(this, PP.WEBGL, r) || this;
  25796. return (
  25797. (r = n.options),
  25798. (n.gl = null),
  25799. (n.CONTEXT_UID = 0),
  25800. (n.runners = {
  25801. destroy: new JD('destroy'),
  25802. contextChange: new JD('contextChange'),
  25803. reset: new JD('reset'),
  25804. update: new JD('update'),
  25805. postrender: new JD('postrender'),
  25806. prerender: new JD('prerender'),
  25807. resize: new JD('resize'),
  25808. }),
  25809. n.runners.contextChange.add(n),
  25810. (n.globalUniforms = new kL({ projectionMatrix: new CD() }, !0)),
  25811. n
  25812. .addSystem(CF, 'mask')
  25813. .addSystem(WL, 'context')
  25814. .addSystem(YF, 'state')
  25815. .addSystem(WF, 'shader')
  25816. .addSystem(JF, 'texture')
  25817. .addSystem($F, 'buffer')
  25818. .addSystem(KL, 'geometry')
  25819. .addSystem(ZL, 'framebuffer')
  25820. .addSystem(IF, 'scissor')
  25821. .addSystem(MF, 'stencil')
  25822. .addSystem(DF, 'projection')
  25823. .addSystem(zF, 'textureGC')
  25824. .addSystem(jL, 'filter')
  25825. .addSystem(NF, 'renderTexture')
  25826. .addSystem(VL, 'batch'),
  25827. n.initPlugins(e.__plugins),
  25828. (n.multisample = void 0),
  25829. r.context
  25830. ? n.context.initFromContext(r.context)
  25831. : n.context.initFromOptions({
  25832. alpha: !!n.useContextAlpha,
  25833. antialias: r.antialias,
  25834. premultipliedAlpha:
  25835. n.useContextAlpha && 'notMultiplied' !== n.useContextAlpha,
  25836. stencil: !0,
  25837. preserveDrawingBuffer: r.preserveDrawingBuffer,
  25838. powerPreference: n.options.powerPreference,
  25839. }),
  25840. (n.renderingToScreen = !0),
  25841. XM(2 === n.context.webGLVersion ? 'WebGL 2' : 'WebGL 1'),
  25842. n.resize(n.options.width, n.options.height),
  25843. n
  25844. );
  25845. }
  25846. return (
  25847. rL(e, t),
  25848. (e.create = function (t) {
  25849. if (
  25850. (void 0 === UM &&
  25851. (UM = (function () {
  25852. var t = {
  25853. stencil: !0,
  25854. failIfMajorPerformanceCaveat:
  25855. vA.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT,
  25856. };
  25857. try {
  25858. if (!vA.ADAPTER.getWebGLRenderingContext()) return !1;
  25859. var e = vA.ADAPTER.createCanvas(),
  25860. r =
  25861. e.getContext('webgl', t) ||
  25862. e.getContext('experimental-webgl', t),
  25863. n = !(!r || !r.getContextAttributes().stencil);
  25864. if (r) {
  25865. var i = r.getExtension('WEBGL_lose_context');
  25866. i && i.loseContext();
  25867. }
  25868. return (r = null), n;
  25869. } catch (t) {
  25870. return !1;
  25871. }
  25872. })()),
  25873. UM)
  25874. )
  25875. return new e(t);
  25876. throw new Error(
  25877. 'WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.'
  25878. );
  25879. }),
  25880. (e.prototype.contextChange = function () {
  25881. var t,
  25882. e = this.gl;
  25883. if (1 === this.context.webGLVersion) {
  25884. var r = e.getParameter(e.FRAMEBUFFER_BINDING);
  25885. e.bindFramebuffer(e.FRAMEBUFFER, null),
  25886. (t = e.getParameter(e.SAMPLES)),
  25887. e.bindFramebuffer(e.FRAMEBUFFER, r);
  25888. } else {
  25889. r = e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);
  25890. e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null),
  25891. (t = e.getParameter(e.SAMPLES)),
  25892. e.bindFramebuffer(e.DRAW_FRAMEBUFFER, r);
  25893. }
  25894. t >= WP.HIGH
  25895. ? (this.multisample = WP.HIGH)
  25896. : t >= WP.MEDIUM
  25897. ? (this.multisample = WP.MEDIUM)
  25898. : t >= WP.LOW
  25899. ? (this.multisample = WP.LOW)
  25900. : (this.multisample = WP.NONE);
  25901. }),
  25902. (e.prototype.addSystem = function (t, e) {
  25903. var r = new t(this);
  25904. if (this[e])
  25905. throw new Error('Whoops! The name "' + e + '" is already in use');
  25906. for (var n in ((this[e] = r), this.runners)) this.runners[n].add(r);
  25907. return this;
  25908. }),
  25909. (e.prototype.render = function (t, e) {
  25910. var r, n, i, o;
  25911. if (
  25912. (e &&
  25913. (e instanceof SL
  25914. ? (aD(
  25915. '6.0.0',
  25916. 'Renderer#render arguments changed, use options instead.'
  25917. ),
  25918. (r = e),
  25919. (n = arguments[2]),
  25920. (i = arguments[3]),
  25921. (o = arguments[4]))
  25922. : ((r = e.renderTexture),
  25923. (n = e.clear),
  25924. (i = e.transform),
  25925. (o = e.skipUpdateTransform))),
  25926. (this.renderingToScreen = !r),
  25927. this.runners.prerender.emit(),
  25928. this.emit('prerender'),
  25929. (this.projection.transform = i),
  25930. !this.context.isLost)
  25931. ) {
  25932. if ((r || (this._lastObjectRendered = t), !o)) {
  25933. var s = t.enableTempParent();
  25934. t.updateTransform(), t.disableTempParent(s);
  25935. }
  25936. this.renderTexture.bind(r),
  25937. this.batch.currentRenderer.start(),
  25938. (void 0 !== n ? n : this.clearBeforeRender) &&
  25939. this.renderTexture.clear(),
  25940. t.render(this),
  25941. this.batch.currentRenderer.flush(),
  25942. r && r.baseTexture.update(),
  25943. this.runners.postrender.emit(),
  25944. (this.projection.transform = null),
  25945. this.emit('postrender');
  25946. }
  25947. }),
  25948. (e.prototype.generateTexture = function (e, r, n, i) {
  25949. void 0 === r && (r = {});
  25950. var o = t.prototype.generateTexture.call(this, e, r, n, i);
  25951. return this.framebuffer.blit(), o;
  25952. }),
  25953. (e.prototype.resize = function (e, r) {
  25954. t.prototype.resize.call(this, e, r),
  25955. this.runners.resize.emit(this.screen.height, this.screen.width);
  25956. }),
  25957. (e.prototype.reset = function () {
  25958. return this.runners.reset.emit(), this;
  25959. }),
  25960. (e.prototype.clear = function () {
  25961. this.renderTexture.bind(), this.renderTexture.clear();
  25962. }),
  25963. (e.prototype.destroy = function (e) {
  25964. for (var r in (this.runners.destroy.emit(), this.runners))
  25965. this.runners[r].destroy();
  25966. t.prototype.destroy.call(this, e), (this.gl = null);
  25967. }),
  25968. Object.defineProperty(e.prototype, 'extract', {
  25969. get: function () {
  25970. return (
  25971. aD(
  25972. '6.0.0',
  25973. 'Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.'
  25974. ),
  25975. this.plugins.extract
  25976. );
  25977. },
  25978. enumerable: !1,
  25979. configurable: !0,
  25980. }),
  25981. (e.registerPlugin = function (t, e) {
  25982. aD(
  25983. '6.5.0',
  25984. 'Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.'
  25985. ),
  25986. ZD.add({ name: t, type: HD.RendererPlugin, ref: e });
  25987. }),
  25988. (e.__plugins = {}),
  25989. e
  25990. );
  25991. })(qF);
  25992. function eN(t) {
  25993. return tN.create(t);
  25994. }
  25995. ZD.handleByMap(HD.RendererPlugin, tN.__plugins);
  25996. var rN =
  25997. 'attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n',
  25998. nN = function () {
  25999. (this.texArray = null),
  26000. (this.blend = 0),
  26001. (this.type = IP.TRIANGLES),
  26002. (this.start = 0),
  26003. (this.size = 0),
  26004. (this.data = null);
  26005. },
  26006. iN = (function () {
  26007. function t() {
  26008. (this.elements = []), (this.ids = []), (this.count = 0);
  26009. }
  26010. return (
  26011. (t.prototype.clear = function () {
  26012. for (var t = 0; t < this.count; t++) this.elements[t] = null;
  26013. this.count = 0;
  26014. }),
  26015. t
  26016. );
  26017. })(),
  26018. oN = (function () {
  26019. function t(t) {
  26020. 'number' == typeof t
  26021. ? (this.rawBinaryData = new ArrayBuffer(t))
  26022. : t instanceof Uint8Array
  26023. ? (this.rawBinaryData = t.buffer)
  26024. : (this.rawBinaryData = t),
  26025. (this.uint32View = new Uint32Array(this.rawBinaryData)),
  26026. (this.float32View = new Float32Array(this.rawBinaryData));
  26027. }
  26028. return (
  26029. Object.defineProperty(t.prototype, 'int8View', {
  26030. get: function () {
  26031. return (
  26032. this._int8View ||
  26033. (this._int8View = new Int8Array(this.rawBinaryData)),
  26034. this._int8View
  26035. );
  26036. },
  26037. enumerable: !1,
  26038. configurable: !0,
  26039. }),
  26040. Object.defineProperty(t.prototype, 'uint8View', {
  26041. get: function () {
  26042. return (
  26043. this._uint8View ||
  26044. (this._uint8View = new Uint8Array(this.rawBinaryData)),
  26045. this._uint8View
  26046. );
  26047. },
  26048. enumerable: !1,
  26049. configurable: !0,
  26050. }),
  26051. Object.defineProperty(t.prototype, 'int16View', {
  26052. get: function () {
  26053. return (
  26054. this._int16View ||
  26055. (this._int16View = new Int16Array(this.rawBinaryData)),
  26056. this._int16View
  26057. );
  26058. },
  26059. enumerable: !1,
  26060. configurable: !0,
  26061. }),
  26062. Object.defineProperty(t.prototype, 'uint16View', {
  26063. get: function () {
  26064. return (
  26065. this._uint16View ||
  26066. (this._uint16View = new Uint16Array(this.rawBinaryData)),
  26067. this._uint16View
  26068. );
  26069. },
  26070. enumerable: !1,
  26071. configurable: !0,
  26072. }),
  26073. Object.defineProperty(t.prototype, 'int32View', {
  26074. get: function () {
  26075. return (
  26076. this._int32View ||
  26077. (this._int32View = new Int32Array(this.rawBinaryData)),
  26078. this._int32View
  26079. );
  26080. },
  26081. enumerable: !1,
  26082. configurable: !0,
  26083. }),
  26084. (t.prototype.view = function (t) {
  26085. return this[t + 'View'];
  26086. }),
  26087. (t.prototype.destroy = function () {
  26088. (this.rawBinaryData = null),
  26089. (this._int8View = null),
  26090. (this._uint8View = null),
  26091. (this._int16View = null),
  26092. (this._uint16View = null),
  26093. (this._int32View = null),
  26094. (this.uint32View = null),
  26095. (this.float32View = null);
  26096. }),
  26097. (t.sizeOf = function (t) {
  26098. switch (t) {
  26099. case 'int8':
  26100. case 'uint8':
  26101. return 1;
  26102. case 'int16':
  26103. case 'uint16':
  26104. return 2;
  26105. case 'int32':
  26106. case 'uint32':
  26107. case 'float32':
  26108. return 4;
  26109. default:
  26110. throw new Error(t + " isn't a valid view type");
  26111. }
  26112. }),
  26113. t
  26114. );
  26115. })(),
  26116. sN = (function (t) {
  26117. function e(e) {
  26118. var r = t.call(this, e) || this;
  26119. return (
  26120. (r.shaderGenerator = null),
  26121. (r.geometryClass = null),
  26122. (r.vertexSize = null),
  26123. (r.state = xF.for2d()),
  26124. (r.size = 4 * vA.SPRITE_BATCH_SIZE),
  26125. (r._vertexCount = 0),
  26126. (r._indexCount = 0),
  26127. (r._bufferedElements = []),
  26128. (r._bufferedTextures = []),
  26129. (r._bufferSize = 0),
  26130. (r._shader = null),
  26131. (r._packedGeometries = []),
  26132. (r._packedGeometryPoolSize = 2),
  26133. (r._flushId = 0),
  26134. (r._aBuffers = {}),
  26135. (r._iBuffers = {}),
  26136. (r.MAX_TEXTURES = 1),
  26137. r.renderer.on('prerender', r.onPrerender, r),
  26138. e.runners.contextChange.add(r),
  26139. (r._dcIndex = 0),
  26140. (r._aIndex = 0),
  26141. (r._iIndex = 0),
  26142. (r._attributeBuffer = null),
  26143. (r._indexBuffer = null),
  26144. (r._tempBoundTextures = []),
  26145. r
  26146. );
  26147. }
  26148. return (
  26149. rL(e, t),
  26150. (e.prototype.contextChange = function () {
  26151. var t = this.renderer.gl;
  26152. vA.PREFER_ENV === CP.WEBGL_LEGACY
  26153. ? (this.MAX_TEXTURES = 1)
  26154. : ((this.MAX_TEXTURES = Math.min(
  26155. t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  26156. vA.SPRITE_MAX_TEXTURES
  26157. )),
  26158. (this.MAX_TEXTURES = (function (t, e) {
  26159. if (0 === t)
  26160. throw new Error(
  26161. 'Invalid value of `0` passed to `checkMaxIfStatementsInShader`'
  26162. );
  26163. for (var r = e.createShader(e.FRAGMENT_SHADER); ; ) {
  26164. var n = mF.replace(/%forloop%/gi, yF(t));
  26165. if (
  26166. (e.shaderSource(r, n),
  26167. e.compileShader(r),
  26168. e.getShaderParameter(r, e.COMPILE_STATUS))
  26169. )
  26170. break;
  26171. t = (t / 2) | 0;
  26172. }
  26173. return t;
  26174. })(this.MAX_TEXTURES, t))),
  26175. (this._shader = this.shaderGenerator.generateShader(
  26176. this.MAX_TEXTURES
  26177. ));
  26178. for (var e = 0; e < this._packedGeometryPoolSize; e++)
  26179. this._packedGeometries[e] = new this.geometryClass();
  26180. this.initFlushBuffers();
  26181. }),
  26182. (e.prototype.initFlushBuffers = function () {
  26183. for (
  26184. var t = e._drawCallPool,
  26185. r = e._textureArrayPool,
  26186. n = this.size / 4,
  26187. i = Math.floor(n / this.MAX_TEXTURES) + 1;
  26188. t.length < n;
  26189. )
  26190. t.push(new nN());
  26191. for (; r.length < i; ) r.push(new iN());
  26192. for (var o = 0; o < this.MAX_TEXTURES; o++)
  26193. this._tempBoundTextures[o] = null;
  26194. }),
  26195. (e.prototype.onPrerender = function () {
  26196. this._flushId = 0;
  26197. }),
  26198. (e.prototype.render = function (t) {
  26199. t._texture.valid &&
  26200. (this._vertexCount + t.vertexData.length / 2 > this.size &&
  26201. this.flush(),
  26202. (this._vertexCount += t.vertexData.length / 2),
  26203. (this._indexCount += t.indices.length),
  26204. (this._bufferedTextures[this._bufferSize] = t._texture.baseTexture),
  26205. (this._bufferedElements[this._bufferSize++] = t));
  26206. }),
  26207. (e.prototype.buildTexturesAndDrawCalls = function () {
  26208. var t = this._bufferedTextures,
  26209. r = this.MAX_TEXTURES,
  26210. n = e._textureArrayPool,
  26211. i = this.renderer.batch,
  26212. o = this._tempBoundTextures,
  26213. s = this.renderer.textureGC.count,
  26214. a = ++aL._globalBatch,
  26215. u = 0,
  26216. c = n[0],
  26217. h = 0;
  26218. i.copyBoundTextures(o, r);
  26219. for (var l = 0; l < this._bufferSize; ++l) {
  26220. var d = t[l];
  26221. (t[l] = null),
  26222. d._batchEnabled !== a &&
  26223. (c.count >= r &&
  26224. (i.boundArray(c, o, a, r),
  26225. this.buildDrawCalls(c, h, l),
  26226. (h = l),
  26227. (c = n[++u]),
  26228. ++a),
  26229. (d._batchEnabled = a),
  26230. (d.touched = s),
  26231. (c.elements[c.count++] = d));
  26232. }
  26233. c.count > 0 &&
  26234. (i.boundArray(c, o, a, r),
  26235. this.buildDrawCalls(c, h, this._bufferSize),
  26236. ++u,
  26237. ++a);
  26238. for (l = 0; l < o.length; l++) o[l] = null;
  26239. aL._globalBatch = a;
  26240. }),
  26241. (e.prototype.buildDrawCalls = function (t, r, n) {
  26242. var i = this,
  26243. o = i._bufferedElements,
  26244. s = i._attributeBuffer,
  26245. a = i._indexBuffer,
  26246. u = i.vertexSize,
  26247. c = e._drawCallPool,
  26248. h = this._dcIndex,
  26249. l = this._aIndex,
  26250. d = this._iIndex,
  26251. f = c[h];
  26252. (f.start = this._iIndex), (f.texArray = t);
  26253. for (var p = r; p < n; ++p) {
  26254. var v = o[p],
  26255. m = v._texture.baseTexture,
  26256. y = ZM[m.alphaMode ? 1 : 0][v.blendMode];
  26257. (o[p] = null),
  26258. r < p &&
  26259. f.blend !== y &&
  26260. ((f.size = d - f.start),
  26261. (r = p),
  26262. ((f = c[++h]).texArray = t),
  26263. (f.start = d)),
  26264. this.packInterleavedGeometry(v, s, a, l, d),
  26265. (l += (v.vertexData.length / 2) * u),
  26266. (d += v.indices.length),
  26267. (f.blend = y);
  26268. }
  26269. r < n && ((f.size = d - f.start), ++h),
  26270. (this._dcIndex = h),
  26271. (this._aIndex = l),
  26272. (this._iIndex = d);
  26273. }),
  26274. (e.prototype.bindAndClearTexArray = function (t) {
  26275. for (var e = this.renderer.texture, r = 0; r < t.count; r++)
  26276. e.bind(t.elements[r], t.ids[r]), (t.elements[r] = null);
  26277. t.count = 0;
  26278. }),
  26279. (e.prototype.updateGeometry = function () {
  26280. var t = this,
  26281. e = t._packedGeometries,
  26282. r = t._attributeBuffer,
  26283. n = t._indexBuffer;
  26284. vA.CAN_UPLOAD_SAME_BUFFER
  26285. ? (e[this._flushId]._buffer.update(r.rawBinaryData),
  26286. e[this._flushId]._indexBuffer.update(n),
  26287. this.renderer.geometry.updateBuffers())
  26288. : (this._packedGeometryPoolSize <= this._flushId &&
  26289. (this._packedGeometryPoolSize++,
  26290. (e[this._flushId] = new this.geometryClass())),
  26291. e[this._flushId]._buffer.update(r.rawBinaryData),
  26292. e[this._flushId]._indexBuffer.update(n),
  26293. this.renderer.geometry.bind(e[this._flushId]),
  26294. this.renderer.geometry.updateBuffers(),
  26295. this._flushId++);
  26296. }),
  26297. (e.prototype.drawBatches = function () {
  26298. for (
  26299. var t = this._dcIndex,
  26300. r = this.renderer,
  26301. n = r.gl,
  26302. i = r.state,
  26303. o = e._drawCallPool,
  26304. s = null,
  26305. a = 0;
  26306. a < t;
  26307. a++
  26308. ) {
  26309. var u = o[a],
  26310. c = u.texArray,
  26311. h = u.type,
  26312. l = u.size,
  26313. d = u.start,
  26314. f = u.blend;
  26315. s !== c && ((s = c), this.bindAndClearTexArray(c)),
  26316. (this.state.blendMode = f),
  26317. i.set(this.state),
  26318. n.drawElements(h, l, n.UNSIGNED_SHORT, 2 * d);
  26319. }
  26320. }),
  26321. (e.prototype.flush = function () {
  26322. 0 !== this._vertexCount &&
  26323. ((this._attributeBuffer = this.getAttributeBuffer(
  26324. this._vertexCount
  26325. )),
  26326. (this._indexBuffer = this.getIndexBuffer(this._indexCount)),
  26327. (this._aIndex = 0),
  26328. (this._iIndex = 0),
  26329. (this._dcIndex = 0),
  26330. this.buildTexturesAndDrawCalls(),
  26331. this.updateGeometry(),
  26332. this.drawBatches(),
  26333. (this._bufferSize = 0),
  26334. (this._vertexCount = 0),
  26335. (this._indexCount = 0));
  26336. }),
  26337. (e.prototype.start = function () {
  26338. this.renderer.state.set(this.state),
  26339. this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),
  26340. this.renderer.shader.bind(this._shader),
  26341. vA.CAN_UPLOAD_SAME_BUFFER &&
  26342. this.renderer.geometry.bind(
  26343. this._packedGeometries[this._flushId]
  26344. );
  26345. }),
  26346. (e.prototype.stop = function () {
  26347. this.flush();
  26348. }),
  26349. (e.prototype.destroy = function () {
  26350. for (var e = 0; e < this._packedGeometryPoolSize; e++)
  26351. this._packedGeometries[e] && this._packedGeometries[e].destroy();
  26352. this.renderer.off('prerender', this.onPrerender, this),
  26353. (this._aBuffers = null),
  26354. (this._iBuffers = null),
  26355. (this._packedGeometries = null),
  26356. (this._attributeBuffer = null),
  26357. (this._indexBuffer = null),
  26358. this._shader && (this._shader.destroy(), (this._shader = null)),
  26359. t.prototype.destroy.call(this);
  26360. }),
  26361. (e.prototype.getAttributeBuffer = function (t) {
  26362. var e = $M(Math.ceil(t / 8)),
  26363. r = eD(e),
  26364. n = 8 * e;
  26365. this._aBuffers.length <= r && (this._iBuffers.length = r + 1);
  26366. var i = this._aBuffers[n];
  26367. return (
  26368. i || (this._aBuffers[n] = i = new oN(n * this.vertexSize * 4)), i
  26369. );
  26370. }),
  26371. (e.prototype.getIndexBuffer = function (t) {
  26372. var e = $M(Math.ceil(t / 12)),
  26373. r = eD(e),
  26374. n = 12 * e;
  26375. this._iBuffers.length <= r && (this._iBuffers.length = r + 1);
  26376. var i = this._iBuffers[r];
  26377. return i || (this._iBuffers[r] = i = new Uint16Array(n)), i;
  26378. }),
  26379. (e.prototype.packInterleavedGeometry = function (t, e, r, n, i) {
  26380. for (
  26381. var o = e.uint32View,
  26382. s = e.float32View,
  26383. a = n / this.vertexSize,
  26384. u = t.uvs,
  26385. c = t.indices,
  26386. h = t.vertexData,
  26387. l = t._texture.baseTexture._batchLocation,
  26388. d = Math.min(t.worldAlpha, 1),
  26389. f =
  26390. d < 1 && t._texture.baseTexture.alphaMode
  26391. ? KM(t._tintRGB, d)
  26392. : t._tintRGB + ((255 * d) << 24),
  26393. p = 0;
  26394. p < h.length;
  26395. p += 2
  26396. )
  26397. (s[n++] = h[p]),
  26398. (s[n++] = h[p + 1]),
  26399. (s[n++] = u[p]),
  26400. (s[n++] = u[p + 1]),
  26401. (o[n++] = f),
  26402. (s[n++] = l);
  26403. for (p = 0; p < c.length; p++) r[i++] = a + c[p];
  26404. }),
  26405. (e._drawCallPool = []),
  26406. (e._textureArrayPool = []),
  26407. e
  26408. );
  26409. })(XL),
  26410. aN = (function () {
  26411. function t(t, e) {
  26412. if (
  26413. ((this.vertexSrc = t),
  26414. (this.fragTemplate = e),
  26415. (this.programCache = {}),
  26416. (this.defaultGroupCache = {}),
  26417. e.indexOf('%count%') < 0)
  26418. )
  26419. throw new Error('Fragment template must contain "%count%".');
  26420. if (e.indexOf('%forloop%') < 0)
  26421. throw new Error('Fragment template must contain "%forloop%".');
  26422. }
  26423. return (
  26424. (t.prototype.generateShader = function (t) {
  26425. if (!this.programCache[t]) {
  26426. for (var e = new Int32Array(t), r = 0; r < t; r++) e[r] = r;
  26427. this.defaultGroupCache[t] = kL.from({ uSamplers: e }, !0);
  26428. var n = this.fragTemplate;
  26429. (n = (n = n.replace(/%count%/gi, '' + t)).replace(
  26430. /%forloop%/gi,
  26431. this.generateSampleSrc(t)
  26432. )),
  26433. (this.programCache[t] = new bF(this.vertexSrc, n));
  26434. }
  26435. var i = {
  26436. tint: new Float32Array([1, 1, 1, 1]),
  26437. translationMatrix: new CD(),
  26438. default: this.defaultGroupCache[t],
  26439. };
  26440. return new TF(this.programCache[t], i);
  26441. }),
  26442. (t.prototype.generateSampleSrc = function (t) {
  26443. var e = '';
  26444. (e += '\n'), (e += '\n');
  26445. for (var r = 0; r < t; r++)
  26446. r > 0 && (e += '\nelse '),
  26447. r < t - 1 && (e += 'if(vTextureId < ' + r + '.5)'),
  26448. (e += '\n{'),
  26449. (e +=
  26450. '\n\tcolor = texture2D(uSamplers[' + r + '], vTextureCoord);'),
  26451. (e += '\n}');
  26452. return (e += '\n'), (e += '\n');
  26453. }),
  26454. t
  26455. );
  26456. })(),
  26457. uN = (function (t) {
  26458. function e(e) {
  26459. void 0 === e && (e = !1);
  26460. var r = t.call(this) || this;
  26461. return (
  26462. (r._buffer = new PL(null, e, !1)),
  26463. (r._indexBuffer = new PL(null, e, !0)),
  26464. r
  26465. .addAttribute('aVertexPosition', r._buffer, 2, !1, LP.FLOAT)
  26466. .addAttribute('aTextureCoord', r._buffer, 2, !1, LP.FLOAT)
  26467. .addAttribute('aColor', r._buffer, 4, !0, LP.UNSIGNED_BYTE)
  26468. .addAttribute('aTextureId', r._buffer, 1, !0, LP.FLOAT)
  26469. .addIndex(r._indexBuffer),
  26470. r
  26471. );
  26472. }
  26473. return rL(e, t), e;
  26474. })(DL),
  26475. cN =
  26476. 'precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n',
  26477. hN =
  26478. 'varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n',
  26479. lN = (function () {
  26480. function t() {}
  26481. return (
  26482. (t.create = function (t) {
  26483. var e = Object.assign(
  26484. { vertex: cN, fragment: hN, geometryClass: uN, vertexSize: 6 },
  26485. t
  26486. ),
  26487. r = e.vertex,
  26488. n = e.fragment,
  26489. i = e.vertexSize,
  26490. o = e.geometryClass;
  26491. return (function (t) {
  26492. function e(e) {
  26493. var s = t.call(this, e) || this;
  26494. return (
  26495. (s.shaderGenerator = new aN(r, n)),
  26496. (s.geometryClass = o),
  26497. (s.vertexSize = i),
  26498. s
  26499. );
  26500. }
  26501. return rL(e, t), e;
  26502. })(sN);
  26503. }),
  26504. Object.defineProperty(t, 'defaultVertexSrc', {
  26505. get: function () {
  26506. return cN;
  26507. },
  26508. enumerable: !1,
  26509. configurable: !0,
  26510. }),
  26511. Object.defineProperty(t, 'defaultFragmentTemplate', {
  26512. get: function () {
  26513. return hN;
  26514. },
  26515. enumerable: !1,
  26516. configurable: !0,
  26517. }),
  26518. t
  26519. );
  26520. })(),
  26521. dN = lN.create();
  26522. Object.assign(dN, { extension: { name: 'batch', type: HD.RendererPlugin } });
  26523. UD.mixin({
  26524. accessible: !1,
  26525. accessibleTitle: null,
  26526. accessibleHint: null,
  26527. tabIndex: 0,
  26528. _accessibleActive: !1,
  26529. _accessibleDiv: null,
  26530. accessibleType: 'button',
  26531. accessiblePointerEvents: 'auto',
  26532. accessibleChildren: !0,
  26533. renderId: -1,
  26534. });
  26535. var fN = (function () {
  26536. function t(t) {
  26537. (this.debug = !1),
  26538. (this._isActive = !1),
  26539. (this._isMobileAccessibility = !1),
  26540. (this.pool = []),
  26541. (this.renderId = 0),
  26542. (this.children = []),
  26543. (this.androidUpdateCount = 0),
  26544. (this.androidUpdateFrequency = 500),
  26545. (this._hookDiv = null),
  26546. (pA.tablet || pA.phone) && this.createTouchHook();
  26547. var e = document.createElement('div');
  26548. (e.style.width = '100px'),
  26549. (e.style.height = '100px'),
  26550. (e.style.position = 'absolute'),
  26551. (e.style.top = '0px'),
  26552. (e.style.left = '0px'),
  26553. (e.style.zIndex = (2).toString()),
  26554. (this.div = e),
  26555. (this.renderer = t),
  26556. (this._onKeyDown = this._onKeyDown.bind(this)),
  26557. (this._onMouseMove = this._onMouseMove.bind(this)),
  26558. globalThis.addEventListener('keydown', this._onKeyDown, !1);
  26559. }
  26560. return (
  26561. Object.defineProperty(t.prototype, 'isActive', {
  26562. get: function () {
  26563. return this._isActive;
  26564. },
  26565. enumerable: !1,
  26566. configurable: !0,
  26567. }),
  26568. Object.defineProperty(t.prototype, 'isMobileAccessibility', {
  26569. get: function () {
  26570. return this._isMobileAccessibility;
  26571. },
  26572. enumerable: !1,
  26573. configurable: !0,
  26574. }),
  26575. (t.prototype.createTouchHook = function () {
  26576. var t = this,
  26577. e = document.createElement('button');
  26578. (e.style.width = '1px'),
  26579. (e.style.height = '1px'),
  26580. (e.style.position = 'absolute'),
  26581. (e.style.top = '-1000px'),
  26582. (e.style.left = '-1000px'),
  26583. (e.style.zIndex = (2).toString()),
  26584. (e.style.backgroundColor = '#FF0000'),
  26585. (e.title = 'select to enable accessibility for this content'),
  26586. e.addEventListener('focus', function () {
  26587. (t._isMobileAccessibility = !0),
  26588. t.activate(),
  26589. t.destroyTouchHook();
  26590. }),
  26591. document.body.appendChild(e),
  26592. (this._hookDiv = e);
  26593. }),
  26594. (t.prototype.destroyTouchHook = function () {
  26595. this._hookDiv &&
  26596. (document.body.removeChild(this._hookDiv), (this._hookDiv = null));
  26597. }),
  26598. (t.prototype.activate = function () {
  26599. var t;
  26600. this._isActive ||
  26601. ((this._isActive = !0),
  26602. globalThis.document.addEventListener(
  26603. 'mousemove',
  26604. this._onMouseMove,
  26605. !0
  26606. ),
  26607. globalThis.removeEventListener('keydown', this._onKeyDown, !1),
  26608. this.renderer.on('postrender', this.update, this),
  26609. null === (t = this.renderer.view.parentNode) ||
  26610. void 0 === t ||
  26611. t.appendChild(this.div));
  26612. }),
  26613. (t.prototype.deactivate = function () {
  26614. var t;
  26615. this._isActive &&
  26616. !this._isMobileAccessibility &&
  26617. ((this._isActive = !1),
  26618. globalThis.document.removeEventListener(
  26619. 'mousemove',
  26620. this._onMouseMove,
  26621. !0
  26622. ),
  26623. globalThis.addEventListener('keydown', this._onKeyDown, !1),
  26624. this.renderer.off('postrender', this.update),
  26625. null === (t = this.div.parentNode) ||
  26626. void 0 === t ||
  26627. t.removeChild(this.div));
  26628. }),
  26629. (t.prototype.updateAccessibleObjects = function (t) {
  26630. if (t.visible && t.accessibleChildren) {
  26631. t.accessible &&
  26632. t.interactive &&
  26633. (t._accessibleActive || this.addChild(t),
  26634. (t.renderId = this.renderId));
  26635. var e = t.children;
  26636. if (e)
  26637. for (var r = 0; r < e.length; r++)
  26638. this.updateAccessibleObjects(e[r]);
  26639. }
  26640. }),
  26641. (t.prototype.update = function () {
  26642. var t = performance.now();
  26643. if (
  26644. !(pA.android.device && t < this.androidUpdateCount) &&
  26645. ((this.androidUpdateCount = t + this.androidUpdateFrequency),
  26646. this.renderer.renderingToScreen)
  26647. ) {
  26648. this.renderer._lastObjectRendered &&
  26649. this.updateAccessibleObjects(this.renderer._lastObjectRendered);
  26650. var e = this.renderer.view.getBoundingClientRect(),
  26651. r = e.left,
  26652. n = e.top,
  26653. i = e.width,
  26654. o = e.height,
  26655. s = this.renderer,
  26656. a = s.width,
  26657. u = s.height,
  26658. c = s.resolution,
  26659. h = (i / a) * c,
  26660. l = (o / u) * c,
  26661. d = this.div;
  26662. (d.style.left = r + 'px'),
  26663. (d.style.top = n + 'px'),
  26664. (d.style.width = a + 'px'),
  26665. (d.style.height = u + 'px');
  26666. for (var f = 0; f < this.children.length; f++) {
  26667. var p = this.children[f];
  26668. if (p.renderId !== this.renderId)
  26669. (p._accessibleActive = !1),
  26670. rD(this.children, f, 1),
  26671. this.div.removeChild(p._accessibleDiv),
  26672. this.pool.push(p._accessibleDiv),
  26673. (p._accessibleDiv = null),
  26674. f--;
  26675. else {
  26676. d = p._accessibleDiv;
  26677. var v = p.hitArea,
  26678. m = p.worldTransform;
  26679. p.hitArea
  26680. ? ((d.style.left = (m.tx + v.x * m.a) * h + 'px'),
  26681. (d.style.top = (m.ty + v.y * m.d) * l + 'px'),
  26682. (d.style.width = v.width * m.a * h + 'px'),
  26683. (d.style.height = v.height * m.d * l + 'px'))
  26684. : ((v = p.getBounds()),
  26685. this.capHitArea(v),
  26686. (d.style.left = v.x * h + 'px'),
  26687. (d.style.top = v.y * l + 'px'),
  26688. (d.style.width = v.width * h + 'px'),
  26689. (d.style.height = v.height * l + 'px'),
  26690. d.title !== p.accessibleTitle &&
  26691. null !== p.accessibleTitle &&
  26692. (d.title = p.accessibleTitle),
  26693. d.getAttribute('aria-label') !== p.accessibleHint &&
  26694. null !== p.accessibleHint &&
  26695. d.setAttribute('aria-label', p.accessibleHint)),
  26696. (p.accessibleTitle === d.title &&
  26697. p.tabIndex === d.tabIndex) ||
  26698. ((d.title = p.accessibleTitle),
  26699. (d.tabIndex = p.tabIndex),
  26700. this.debug && this.updateDebugHTML(d));
  26701. }
  26702. }
  26703. this.renderId++;
  26704. }
  26705. }),
  26706. (t.prototype.updateDebugHTML = function (t) {
  26707. t.innerHTML =
  26708. 'type: ' +
  26709. t.type +
  26710. '</br> title : ' +
  26711. t.title +
  26712. '</br> tabIndex: ' +
  26713. t.tabIndex;
  26714. }),
  26715. (t.prototype.capHitArea = function (t) {
  26716. t.x < 0 && ((t.width += t.x), (t.x = 0)),
  26717. t.y < 0 && ((t.height += t.y), (t.y = 0));
  26718. var e = this.renderer,
  26719. r = e.width,
  26720. n = e.height;
  26721. t.x + t.width > r && (t.width = r - t.x),
  26722. t.y + t.height > n && (t.height = n - t.y);
  26723. }),
  26724. (t.prototype.addChild = function (t) {
  26725. var e = this.pool.pop();
  26726. e ||
  26727. (((e = document.createElement('button')).style.width = '100px'),
  26728. (e.style.height = '100px'),
  26729. (e.style.backgroundColor = this.debug
  26730. ? 'rgba(255,255,255,0.5)'
  26731. : 'transparent'),
  26732. (e.style.position = 'absolute'),
  26733. (e.style.zIndex = (2).toString()),
  26734. (e.style.borderStyle = 'none'),
  26735. navigator.userAgent.toLowerCase().indexOf('chrome') > -1
  26736. ? e.setAttribute('aria-live', 'off')
  26737. : e.setAttribute('aria-live', 'polite'),
  26738. navigator.userAgent.match(/rv:.*Gecko\//)
  26739. ? e.setAttribute('aria-relevant', 'additions')
  26740. : e.setAttribute('aria-relevant', 'text'),
  26741. e.addEventListener('click', this._onClick.bind(this)),
  26742. e.addEventListener('focus', this._onFocus.bind(this)),
  26743. e.addEventListener('focusout', this._onFocusOut.bind(this))),
  26744. (e.style.pointerEvents = t.accessiblePointerEvents),
  26745. (e.type = t.accessibleType),
  26746. t.accessibleTitle && null !== t.accessibleTitle
  26747. ? (e.title = t.accessibleTitle)
  26748. : (t.accessibleHint && null !== t.accessibleHint) ||
  26749. (e.title = 'displayObject ' + t.tabIndex),
  26750. t.accessibleHint &&
  26751. null !== t.accessibleHint &&
  26752. e.setAttribute('aria-label', t.accessibleHint),
  26753. this.debug && this.updateDebugHTML(e),
  26754. (t._accessibleActive = !0),
  26755. (t._accessibleDiv = e),
  26756. (e.displayObject = t),
  26757. this.children.push(t),
  26758. this.div.appendChild(t._accessibleDiv),
  26759. (t._accessibleDiv.tabIndex = t.tabIndex);
  26760. }),
  26761. (t.prototype._onClick = function (t) {
  26762. var e = this.renderer.plugins.interaction,
  26763. r = t.target.displayObject,
  26764. n = e.eventData;
  26765. e.dispatchEvent(r, 'click', n),
  26766. e.dispatchEvent(r, 'pointertap', n),
  26767. e.dispatchEvent(r, 'tap', n);
  26768. }),
  26769. (t.prototype._onFocus = function (t) {
  26770. t.target.getAttribute('aria-live') ||
  26771. t.target.setAttribute('aria-live', 'assertive');
  26772. var e = this.renderer.plugins.interaction,
  26773. r = t.target.displayObject,
  26774. n = e.eventData;
  26775. e.dispatchEvent(r, 'mouseover', n);
  26776. }),
  26777. (t.prototype._onFocusOut = function (t) {
  26778. t.target.getAttribute('aria-live') ||
  26779. t.target.setAttribute('aria-live', 'polite');
  26780. var e = this.renderer.plugins.interaction,
  26781. r = t.target.displayObject,
  26782. n = e.eventData;
  26783. e.dispatchEvent(r, 'mouseout', n);
  26784. }),
  26785. (t.prototype._onKeyDown = function (t) {
  26786. 9 === t.keyCode && this.activate();
  26787. }),
  26788. (t.prototype._onMouseMove = function (t) {
  26789. (0 === t.movementX && 0 === t.movementY) || this.deactivate();
  26790. }),
  26791. (t.prototype.destroy = function () {
  26792. this.destroyTouchHook(),
  26793. (this.div = null),
  26794. globalThis.document.removeEventListener(
  26795. 'mousemove',
  26796. this._onMouseMove,
  26797. !0
  26798. ),
  26799. globalThis.removeEventListener('keydown', this._onKeyDown),
  26800. (this.pool = null),
  26801. (this.children = null),
  26802. (this.renderer = null);
  26803. }),
  26804. (t.extension = {
  26805. name: 'accessibility',
  26806. type: [HD.RendererPlugin, HD.CanvasRendererPlugin],
  26807. }),
  26808. t
  26809. );
  26810. })(),
  26811. pN = (function () {
  26812. function t() {
  26813. (this.pressure = 0),
  26814. (this.rotationAngle = 0),
  26815. (this.twist = 0),
  26816. (this.tangentialPressure = 0),
  26817. (this.global = new _D()),
  26818. (this.target = null),
  26819. (this.originalEvent = null),
  26820. (this.identifier = null),
  26821. (this.isPrimary = !1),
  26822. (this.button = 0),
  26823. (this.buttons = 0),
  26824. (this.width = 0),
  26825. (this.height = 0),
  26826. (this.tiltX = 0),
  26827. (this.tiltY = 0),
  26828. (this.pointerType = null),
  26829. (this.pressure = 0),
  26830. (this.rotationAngle = 0),
  26831. (this.twist = 0),
  26832. (this.tangentialPressure = 0);
  26833. }
  26834. return (
  26835. Object.defineProperty(t.prototype, 'pointerId', {
  26836. get: function () {
  26837. return this.identifier;
  26838. },
  26839. enumerable: !1,
  26840. configurable: !0,
  26841. }),
  26842. (t.prototype.getLocalPosition = function (t, e, r) {
  26843. return t.worldTransform.applyInverse(r || this.global, e);
  26844. }),
  26845. (t.prototype.copyEvent = function (t) {
  26846. 'isPrimary' in t && t.isPrimary && (this.isPrimary = !0),
  26847. (this.button = 'button' in t && t.button);
  26848. var e = 'buttons' in t && t.buttons;
  26849. (this.buttons = Number.isInteger(e) ? e : 'which' in t && t.which),
  26850. (this.width = 'width' in t && t.width),
  26851. (this.height = 'height' in t && t.height),
  26852. (this.tiltX = 'tiltX' in t && t.tiltX),
  26853. (this.tiltY = 'tiltY' in t && t.tiltY),
  26854. (this.pointerType = 'pointerType' in t && t.pointerType),
  26855. (this.pressure = 'pressure' in t && t.pressure),
  26856. (this.rotationAngle = 'rotationAngle' in t && t.rotationAngle),
  26857. (this.twist = ('twist' in t && t.twist) || 0),
  26858. (this.tangentialPressure =
  26859. ('tangentialPressure' in t && t.tangentialPressure) || 0);
  26860. }),
  26861. (t.prototype.reset = function () {
  26862. this.isPrimary = !1;
  26863. }),
  26864. t
  26865. );
  26866. })(),
  26867. vN = function (t, e) {
  26868. return (
  26869. (vN =
  26870. Object.setPrototypeOf ||
  26871. ({ __proto__: [] } instanceof Array &&
  26872. function (t, e) {
  26873. t.__proto__ = e;
  26874. }) ||
  26875. function (t, e) {
  26876. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  26877. }),
  26878. vN(t, e)
  26879. );
  26880. };
  26881. var mN = (function () {
  26882. function t() {
  26883. (this.stopped = !1),
  26884. (this.stopsPropagatingAt = null),
  26885. (this.stopPropagationHint = !1),
  26886. (this.target = null),
  26887. (this.currentTarget = null),
  26888. (this.type = null),
  26889. (this.data = null);
  26890. }
  26891. return (
  26892. (t.prototype.stopPropagation = function () {
  26893. (this.stopped = !0),
  26894. (this.stopPropagationHint = !0),
  26895. (this.stopsPropagatingAt = this.currentTarget);
  26896. }),
  26897. (t.prototype.reset = function () {
  26898. (this.stopped = !1),
  26899. (this.stopsPropagatingAt = null),
  26900. (this.stopPropagationHint = !1),
  26901. (this.currentTarget = null),
  26902. (this.target = null);
  26903. }),
  26904. t
  26905. );
  26906. })(),
  26907. yN = (function () {
  26908. function t(e) {
  26909. (this._pointerId = e), (this._flags = t.FLAGS.NONE);
  26910. }
  26911. return (
  26912. (t.prototype._doSet = function (t, e) {
  26913. this._flags = e ? this._flags | t : this._flags & ~t;
  26914. }),
  26915. Object.defineProperty(t.prototype, 'pointerId', {
  26916. get: function () {
  26917. return this._pointerId;
  26918. },
  26919. enumerable: !1,
  26920. configurable: !0,
  26921. }),
  26922. Object.defineProperty(t.prototype, 'flags', {
  26923. get: function () {
  26924. return this._flags;
  26925. },
  26926. set: function (t) {
  26927. this._flags = t;
  26928. },
  26929. enumerable: !1,
  26930. configurable: !0,
  26931. }),
  26932. Object.defineProperty(t.prototype, 'none', {
  26933. get: function () {
  26934. return this._flags === t.FLAGS.NONE;
  26935. },
  26936. enumerable: !1,
  26937. configurable: !0,
  26938. }),
  26939. Object.defineProperty(t.prototype, 'over', {
  26940. get: function () {
  26941. return 0 != (this._flags & t.FLAGS.OVER);
  26942. },
  26943. set: function (e) {
  26944. this._doSet(t.FLAGS.OVER, e);
  26945. },
  26946. enumerable: !1,
  26947. configurable: !0,
  26948. }),
  26949. Object.defineProperty(t.prototype, 'rightDown', {
  26950. get: function () {
  26951. return 0 != (this._flags & t.FLAGS.RIGHT_DOWN);
  26952. },
  26953. set: function (e) {
  26954. this._doSet(t.FLAGS.RIGHT_DOWN, e);
  26955. },
  26956. enumerable: !1,
  26957. configurable: !0,
  26958. }),
  26959. Object.defineProperty(t.prototype, 'leftDown', {
  26960. get: function () {
  26961. return 0 != (this._flags & t.FLAGS.LEFT_DOWN);
  26962. },
  26963. set: function (e) {
  26964. this._doSet(t.FLAGS.LEFT_DOWN, e);
  26965. },
  26966. enumerable: !1,
  26967. configurable: !0,
  26968. }),
  26969. (t.FLAGS = Object.freeze({
  26970. NONE: 0,
  26971. OVER: 1,
  26972. LEFT_DOWN: 2,
  26973. RIGHT_DOWN: 4,
  26974. })),
  26975. t
  26976. );
  26977. })(),
  26978. gN = (function () {
  26979. function t() {
  26980. this._tempPoint = new _D();
  26981. }
  26982. return (
  26983. (t.prototype.recursiveFindHit = function (t, e, r, n, i) {
  26984. var o;
  26985. if (!e || !e.visible) return !1;
  26986. var s = t.data.global,
  26987. a = !1,
  26988. u = (i = e.interactive || i),
  26989. c = !0;
  26990. if (e.hitArea)
  26991. n &&
  26992. (e.worldTransform.applyInverse(s, this._tempPoint),
  26993. e.hitArea.contains(this._tempPoint.x, this._tempPoint.y)
  26994. ? (a = !0)
  26995. : ((n = !1), (c = !1))),
  26996. (u = !1);
  26997. else if (e._mask && n) {
  26998. var h = e._mask.isMaskData ? e._mask.maskObject : e._mask;
  26999. h &&
  27000. !(null === (o = h.containsPoint) || void 0 === o
  27001. ? void 0
  27002. : o.call(h, s)) &&
  27003. (n = !1);
  27004. }
  27005. if (c && e.interactiveChildren && e.children)
  27006. for (var l = e.children, d = l.length - 1; d >= 0; d--) {
  27007. var f = l[d],
  27008. p = this.recursiveFindHit(t, f, r, n, u);
  27009. if (p) {
  27010. if (!f.parent) continue;
  27011. (u = !1), p && (t.target && (n = !1), (a = !0));
  27012. }
  27013. }
  27014. return (
  27015. i &&
  27016. (n &&
  27017. !t.target &&
  27018. !e.hitArea &&
  27019. e.containsPoint &&
  27020. e.containsPoint(s) &&
  27021. (a = !0),
  27022. e.interactive &&
  27023. (a && !t.target && (t.target = e), r && r(t, e, !!a))),
  27024. a
  27025. );
  27026. }),
  27027. (t.prototype.findHit = function (t, e, r, n) {
  27028. this.recursiveFindHit(t, e, r, n, !1);
  27029. }),
  27030. t
  27031. );
  27032. })(),
  27033. _N = {
  27034. interactive: !1,
  27035. interactiveChildren: !0,
  27036. hitArea: null,
  27037. get buttonMode() {
  27038. return 'pointer' === this.cursor;
  27039. },
  27040. set buttonMode(t) {
  27041. t
  27042. ? (this.cursor = 'pointer')
  27043. : 'pointer' === this.cursor && (this.cursor = null);
  27044. },
  27045. cursor: null,
  27046. get trackedPointers() {
  27047. return (
  27048. void 0 === this._trackedPointers && (this._trackedPointers = {}),
  27049. this._trackedPointers
  27050. );
  27051. },
  27052. _trackedPointers: void 0,
  27053. };
  27054. UD.mixin(_N);
  27055. var bN = { target: null, data: { global: null } },
  27056. TN = (function (t) {
  27057. function e(e, r) {
  27058. var n = t.call(this) || this;
  27059. return (
  27060. (r = r || {}),
  27061. (n.renderer = e),
  27062. (n.autoPreventDefault =
  27063. void 0 === r.autoPreventDefault || r.autoPreventDefault),
  27064. (n.interactionFrequency = r.interactionFrequency || 10),
  27065. (n.mouse = new pN()),
  27066. (n.mouse.identifier = 1),
  27067. n.mouse.global.set(-999999),
  27068. (n.activeInteractionData = {}),
  27069. (n.activeInteractionData[1] = n.mouse),
  27070. (n.interactionDataPool = []),
  27071. (n.eventData = new mN()),
  27072. (n.interactionDOMElement = null),
  27073. (n.moveWhenInside = !1),
  27074. (n.eventsAdded = !1),
  27075. (n.tickerAdded = !1),
  27076. (n.mouseOverRenderer = !('PointerEvent' in globalThis)),
  27077. (n.supportsTouchEvents = 'ontouchstart' in globalThis),
  27078. (n.supportsPointerEvents = !!globalThis.PointerEvent),
  27079. (n.onPointerUp = n.onPointerUp.bind(n)),
  27080. (n.processPointerUp = n.processPointerUp.bind(n)),
  27081. (n.onPointerCancel = n.onPointerCancel.bind(n)),
  27082. (n.processPointerCancel = n.processPointerCancel.bind(n)),
  27083. (n.onPointerDown = n.onPointerDown.bind(n)),
  27084. (n.processPointerDown = n.processPointerDown.bind(n)),
  27085. (n.onPointerMove = n.onPointerMove.bind(n)),
  27086. (n.processPointerMove = n.processPointerMove.bind(n)),
  27087. (n.onPointerOut = n.onPointerOut.bind(n)),
  27088. (n.processPointerOverOut = n.processPointerOverOut.bind(n)),
  27089. (n.onPointerOver = n.onPointerOver.bind(n)),
  27090. (n.cursorStyles = { default: 'inherit', pointer: 'pointer' }),
  27091. (n.currentCursorMode = null),
  27092. (n.cursor = null),
  27093. (n.resolution = 1),
  27094. (n.delayedEvents = []),
  27095. (n.search = new gN()),
  27096. (n._tempDisplayObject = new jD()),
  27097. (n._eventListenerOptions = { capture: !0, passive: !1 }),
  27098. (n._useSystemTicker =
  27099. void 0 === r.useSystemTicker || r.useSystemTicker),
  27100. n.setTargetElement(n.renderer.view, n.renderer.resolution),
  27101. n
  27102. );
  27103. }
  27104. return (
  27105. (function (t, e) {
  27106. function r() {
  27107. this.constructor = t;
  27108. }
  27109. vN(t, e),
  27110. (t.prototype =
  27111. null === e
  27112. ? Object.create(e)
  27113. : ((r.prototype = e.prototype), new r()));
  27114. })(e, t),
  27115. Object.defineProperty(e.prototype, 'useSystemTicker', {
  27116. get: function () {
  27117. return this._useSystemTicker;
  27118. },
  27119. set: function (t) {
  27120. (this._useSystemTicker = t),
  27121. t ? this.addTickerListener() : this.removeTickerListener();
  27122. },
  27123. enumerable: !1,
  27124. configurable: !0,
  27125. }),
  27126. Object.defineProperty(e.prototype, 'lastObjectRendered', {
  27127. get: function () {
  27128. return this.renderer._lastObjectRendered || this._tempDisplayObject;
  27129. },
  27130. enumerable: !1,
  27131. configurable: !0,
  27132. }),
  27133. (e.prototype.hitTest = function (t, e) {
  27134. return (
  27135. (bN.target = null),
  27136. (bN.data.global = t),
  27137. e || (e = this.lastObjectRendered),
  27138. this.processInteractive(bN, e, null, !0),
  27139. bN.target
  27140. );
  27141. }),
  27142. (e.prototype.setTargetElement = function (t, e) {
  27143. void 0 === e && (e = 1),
  27144. this.removeTickerListener(),
  27145. this.removeEvents(),
  27146. (this.interactionDOMElement = t),
  27147. (this.resolution = e),
  27148. this.addEvents(),
  27149. this.addTickerListener();
  27150. }),
  27151. (e.prototype.addTickerListener = function () {
  27152. !this.tickerAdded &&
  27153. this.interactionDOMElement &&
  27154. this._useSystemTicker &&
  27155. (qD.system.add(this.tickerUpdate, this, YD.INTERACTION),
  27156. (this.tickerAdded = !0));
  27157. }),
  27158. (e.prototype.removeTickerListener = function () {
  27159. this.tickerAdded &&
  27160. (qD.system.remove(this.tickerUpdate, this),
  27161. (this.tickerAdded = !1));
  27162. }),
  27163. (e.prototype.addEvents = function () {
  27164. if (!this.eventsAdded && this.interactionDOMElement) {
  27165. var t = this.interactionDOMElement.style;
  27166. globalThis.navigator.msPointerEnabled
  27167. ? ((t.msContentZooming = 'none'), (t.msTouchAction = 'none'))
  27168. : this.supportsPointerEvents && (t.touchAction = 'none'),
  27169. this.supportsPointerEvents
  27170. ? (globalThis.document.addEventListener(
  27171. 'pointermove',
  27172. this.onPointerMove,
  27173. this._eventListenerOptions
  27174. ),
  27175. this.interactionDOMElement.addEventListener(
  27176. 'pointerdown',
  27177. this.onPointerDown,
  27178. this._eventListenerOptions
  27179. ),
  27180. this.interactionDOMElement.addEventListener(
  27181. 'pointerleave',
  27182. this.onPointerOut,
  27183. this._eventListenerOptions
  27184. ),
  27185. this.interactionDOMElement.addEventListener(
  27186. 'pointerover',
  27187. this.onPointerOver,
  27188. this._eventListenerOptions
  27189. ),
  27190. globalThis.addEventListener(
  27191. 'pointercancel',
  27192. this.onPointerCancel,
  27193. this._eventListenerOptions
  27194. ),
  27195. globalThis.addEventListener(
  27196. 'pointerup',
  27197. this.onPointerUp,
  27198. this._eventListenerOptions
  27199. ))
  27200. : (globalThis.document.addEventListener(
  27201. 'mousemove',
  27202. this.onPointerMove,
  27203. this._eventListenerOptions
  27204. ),
  27205. this.interactionDOMElement.addEventListener(
  27206. 'mousedown',
  27207. this.onPointerDown,
  27208. this._eventListenerOptions
  27209. ),
  27210. this.interactionDOMElement.addEventListener(
  27211. 'mouseout',
  27212. this.onPointerOut,
  27213. this._eventListenerOptions
  27214. ),
  27215. this.interactionDOMElement.addEventListener(
  27216. 'mouseover',
  27217. this.onPointerOver,
  27218. this._eventListenerOptions
  27219. ),
  27220. globalThis.addEventListener(
  27221. 'mouseup',
  27222. this.onPointerUp,
  27223. this._eventListenerOptions
  27224. )),
  27225. this.supportsTouchEvents &&
  27226. (this.interactionDOMElement.addEventListener(
  27227. 'touchstart',
  27228. this.onPointerDown,
  27229. this._eventListenerOptions
  27230. ),
  27231. this.interactionDOMElement.addEventListener(
  27232. 'touchcancel',
  27233. this.onPointerCancel,
  27234. this._eventListenerOptions
  27235. ),
  27236. this.interactionDOMElement.addEventListener(
  27237. 'touchend',
  27238. this.onPointerUp,
  27239. this._eventListenerOptions
  27240. ),
  27241. this.interactionDOMElement.addEventListener(
  27242. 'touchmove',
  27243. this.onPointerMove,
  27244. this._eventListenerOptions
  27245. )),
  27246. (this.eventsAdded = !0);
  27247. }
  27248. }),
  27249. (e.prototype.removeEvents = function () {
  27250. if (this.eventsAdded && this.interactionDOMElement) {
  27251. var t = this.interactionDOMElement.style;
  27252. globalThis.navigator.msPointerEnabled
  27253. ? ((t.msContentZooming = ''), (t.msTouchAction = ''))
  27254. : this.supportsPointerEvents && (t.touchAction = ''),
  27255. this.supportsPointerEvents
  27256. ? (globalThis.document.removeEventListener(
  27257. 'pointermove',
  27258. this.onPointerMove,
  27259. this._eventListenerOptions
  27260. ),
  27261. this.interactionDOMElement.removeEventListener(
  27262. 'pointerdown',
  27263. this.onPointerDown,
  27264. this._eventListenerOptions
  27265. ),
  27266. this.interactionDOMElement.removeEventListener(
  27267. 'pointerleave',
  27268. this.onPointerOut,
  27269. this._eventListenerOptions
  27270. ),
  27271. this.interactionDOMElement.removeEventListener(
  27272. 'pointerover',
  27273. this.onPointerOver,
  27274. this._eventListenerOptions
  27275. ),
  27276. globalThis.removeEventListener(
  27277. 'pointercancel',
  27278. this.onPointerCancel,
  27279. this._eventListenerOptions
  27280. ),
  27281. globalThis.removeEventListener(
  27282. 'pointerup',
  27283. this.onPointerUp,
  27284. this._eventListenerOptions
  27285. ))
  27286. : (globalThis.document.removeEventListener(
  27287. 'mousemove',
  27288. this.onPointerMove,
  27289. this._eventListenerOptions
  27290. ),
  27291. this.interactionDOMElement.removeEventListener(
  27292. 'mousedown',
  27293. this.onPointerDown,
  27294. this._eventListenerOptions
  27295. ),
  27296. this.interactionDOMElement.removeEventListener(
  27297. 'mouseout',
  27298. this.onPointerOut,
  27299. this._eventListenerOptions
  27300. ),
  27301. this.interactionDOMElement.removeEventListener(
  27302. 'mouseover',
  27303. this.onPointerOver,
  27304. this._eventListenerOptions
  27305. ),
  27306. globalThis.removeEventListener(
  27307. 'mouseup',
  27308. this.onPointerUp,
  27309. this._eventListenerOptions
  27310. )),
  27311. this.supportsTouchEvents &&
  27312. (this.interactionDOMElement.removeEventListener(
  27313. 'touchstart',
  27314. this.onPointerDown,
  27315. this._eventListenerOptions
  27316. ),
  27317. this.interactionDOMElement.removeEventListener(
  27318. 'touchcancel',
  27319. this.onPointerCancel,
  27320. this._eventListenerOptions
  27321. ),
  27322. this.interactionDOMElement.removeEventListener(
  27323. 'touchend',
  27324. this.onPointerUp,
  27325. this._eventListenerOptions
  27326. ),
  27327. this.interactionDOMElement.removeEventListener(
  27328. 'touchmove',
  27329. this.onPointerMove,
  27330. this._eventListenerOptions
  27331. )),
  27332. (this.interactionDOMElement = null),
  27333. (this.eventsAdded = !1);
  27334. }
  27335. }),
  27336. (e.prototype.tickerUpdate = function (t) {
  27337. (this._deltaTime += t),
  27338. this._deltaTime < this.interactionFrequency ||
  27339. ((this._deltaTime = 0), this.update());
  27340. }),
  27341. (e.prototype.update = function () {
  27342. if (this.interactionDOMElement)
  27343. if (this._didMove) this._didMove = !1;
  27344. else {
  27345. for (var t in ((this.cursor = null), this.activeInteractionData))
  27346. if (this.activeInteractionData.hasOwnProperty(t)) {
  27347. var e = this.activeInteractionData[t];
  27348. if (e.originalEvent && 'touch' !== e.pointerType) {
  27349. var r = this.configureInteractionEventForDOMEvent(
  27350. this.eventData,
  27351. e.originalEvent,
  27352. e
  27353. );
  27354. this.processInteractive(
  27355. r,
  27356. this.lastObjectRendered,
  27357. this.processPointerOverOut,
  27358. !0
  27359. );
  27360. }
  27361. }
  27362. this.setCursorMode(this.cursor);
  27363. }
  27364. }),
  27365. (e.prototype.setCursorMode = function (t) {
  27366. t = t || 'default';
  27367. var e = !0;
  27368. if (
  27369. (globalThis.OffscreenCanvas &&
  27370. this.interactionDOMElement instanceof OffscreenCanvas &&
  27371. (e = !1),
  27372. this.currentCursorMode !== t)
  27373. ) {
  27374. this.currentCursorMode = t;
  27375. var r = this.cursorStyles[t];
  27376. if (r)
  27377. switch (typeof r) {
  27378. case 'string':
  27379. e && (this.interactionDOMElement.style.cursor = r);
  27380. break;
  27381. case 'function':
  27382. r(t);
  27383. break;
  27384. case 'object':
  27385. e && Object.assign(this.interactionDOMElement.style, r);
  27386. }
  27387. else
  27388. e &&
  27389. 'string' == typeof t &&
  27390. !Object.prototype.hasOwnProperty.call(this.cursorStyles, t) &&
  27391. (this.interactionDOMElement.style.cursor = t);
  27392. }
  27393. }),
  27394. (e.prototype.dispatchEvent = function (t, e, r) {
  27395. (r.stopPropagationHint && t !== r.stopsPropagatingAt) ||
  27396. ((r.currentTarget = t),
  27397. (r.type = e),
  27398. t.emit(e, r),
  27399. t[e] && t[e](r));
  27400. }),
  27401. (e.prototype.delayDispatchEvent = function (t, e, r) {
  27402. this.delayedEvents.push({
  27403. displayObject: t,
  27404. eventString: e,
  27405. eventData: r,
  27406. });
  27407. }),
  27408. (e.prototype.mapPositionToPoint = function (t, e, r) {
  27409. var n;
  27410. n = this.interactionDOMElement.parentElement
  27411. ? this.interactionDOMElement.getBoundingClientRect()
  27412. : {
  27413. x: 0,
  27414. y: 0,
  27415. width: this.interactionDOMElement.width,
  27416. height: this.interactionDOMElement.height,
  27417. left: 0,
  27418. top: 0,
  27419. };
  27420. var i = 1 / this.resolution;
  27421. (t.x =
  27422. (e - n.left) * (this.interactionDOMElement.width / n.width) * i),
  27423. (t.y =
  27424. (r - n.top) * (this.interactionDOMElement.height / n.height) * i);
  27425. }),
  27426. (e.prototype.processInteractive = function (t, e, r, n) {
  27427. var i = this.search.findHit(t, e, r, n),
  27428. o = this.delayedEvents;
  27429. if (!o.length) return i;
  27430. t.stopPropagationHint = !1;
  27431. var s = o.length;
  27432. this.delayedEvents = [];
  27433. for (var a = 0; a < s; a++) {
  27434. var u = o[a],
  27435. c = u.displayObject,
  27436. h = u.eventString,
  27437. l = u.eventData;
  27438. l.stopsPropagatingAt === c && (l.stopPropagationHint = !0),
  27439. this.dispatchEvent(c, h, l);
  27440. }
  27441. return i;
  27442. }),
  27443. (e.prototype.onPointerDown = function (t) {
  27444. if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
  27445. var e = this.normalizeToPointerData(t);
  27446. if (this.autoPreventDefault && e[0].isNormalized)
  27447. (t.cancelable || !('cancelable' in t)) && t.preventDefault();
  27448. for (var r = e.length, n = 0; n < r; n++) {
  27449. var i = e[n],
  27450. o = this.getInteractionDataForPointerId(i),
  27451. s = this.configureInteractionEventForDOMEvent(
  27452. this.eventData,
  27453. i,
  27454. o
  27455. );
  27456. if (
  27457. ((s.data.originalEvent = t),
  27458. this.processInteractive(
  27459. s,
  27460. this.lastObjectRendered,
  27461. this.processPointerDown,
  27462. !0
  27463. ),
  27464. this.emit('pointerdown', s),
  27465. 'touch' === i.pointerType)
  27466. )
  27467. this.emit('touchstart', s);
  27468. else if ('mouse' === i.pointerType || 'pen' === i.pointerType) {
  27469. var a = 2 === i.button;
  27470. this.emit(a ? 'rightdown' : 'mousedown', this.eventData);
  27471. }
  27472. }
  27473. }
  27474. }),
  27475. (e.prototype.processPointerDown = function (t, e, r) {
  27476. var n = t.data,
  27477. i = t.data.identifier;
  27478. if (r)
  27479. if (
  27480. (e.trackedPointers[i] || (e.trackedPointers[i] = new yN(i)),
  27481. this.dispatchEvent(e, 'pointerdown', t),
  27482. 'touch' === n.pointerType)
  27483. )
  27484. this.dispatchEvent(e, 'touchstart', t);
  27485. else if ('mouse' === n.pointerType || 'pen' === n.pointerType) {
  27486. var o = 2 === n.button;
  27487. o
  27488. ? (e.trackedPointers[i].rightDown = !0)
  27489. : (e.trackedPointers[i].leftDown = !0),
  27490. this.dispatchEvent(e, o ? 'rightdown' : 'mousedown', t);
  27491. }
  27492. }),
  27493. (e.prototype.onPointerComplete = function (t, e, r) {
  27494. var n = this.normalizeToPointerData(t),
  27495. i = n.length,
  27496. o = t.target;
  27497. t.composedPath &&
  27498. t.composedPath().length > 0 &&
  27499. (o = t.composedPath()[0]);
  27500. for (
  27501. var s = o !== this.interactionDOMElement ? 'outside' : '', a = 0;
  27502. a < i;
  27503. a++
  27504. ) {
  27505. var u = n[a],
  27506. c = this.getInteractionDataForPointerId(u),
  27507. h = this.configureInteractionEventForDOMEvent(
  27508. this.eventData,
  27509. u,
  27510. c
  27511. );
  27512. if (
  27513. ((h.data.originalEvent = t),
  27514. this.processInteractive(h, this.lastObjectRendered, r, e || !s),
  27515. this.emit(e ? 'pointercancel' : 'pointerup' + s, h),
  27516. 'mouse' === u.pointerType || 'pen' === u.pointerType)
  27517. ) {
  27518. var l = 2 === u.button;
  27519. this.emit(l ? 'rightup' + s : 'mouseup' + s, h);
  27520. } else
  27521. 'touch' === u.pointerType &&
  27522. (this.emit(e ? 'touchcancel' : 'touchend' + s, h),
  27523. this.releaseInteractionDataForPointerId(u.pointerId));
  27524. }
  27525. }),
  27526. (e.prototype.onPointerCancel = function (t) {
  27527. (this.supportsTouchEvents && 'touch' === t.pointerType) ||
  27528. this.onPointerComplete(t, !0, this.processPointerCancel);
  27529. }),
  27530. (e.prototype.processPointerCancel = function (t, e) {
  27531. var r = t.data,
  27532. n = t.data.identifier;
  27533. void 0 !== e.trackedPointers[n] &&
  27534. (delete e.trackedPointers[n],
  27535. this.dispatchEvent(e, 'pointercancel', t),
  27536. 'touch' === r.pointerType &&
  27537. this.dispatchEvent(e, 'touchcancel', t));
  27538. }),
  27539. (e.prototype.onPointerUp = function (t) {
  27540. (this.supportsTouchEvents && 'touch' === t.pointerType) ||
  27541. this.onPointerComplete(t, !1, this.processPointerUp);
  27542. }),
  27543. (e.prototype.processPointerUp = function (t, e, r) {
  27544. var n = t.data,
  27545. i = t.data.identifier,
  27546. o = e.trackedPointers[i],
  27547. s = 'touch' === n.pointerType,
  27548. a = 'mouse' === n.pointerType || 'pen' === n.pointerType,
  27549. u = !1;
  27550. if (a) {
  27551. var c = 2 === n.button,
  27552. h = yN.FLAGS,
  27553. l = c ? h.RIGHT_DOWN : h.LEFT_DOWN,
  27554. d = void 0 !== o && o.flags & l;
  27555. r
  27556. ? (this.dispatchEvent(e, c ? 'rightup' : 'mouseup', t),
  27557. d &&
  27558. (this.dispatchEvent(e, c ? 'rightclick' : 'click', t),
  27559. (u = !0)))
  27560. : d &&
  27561. this.dispatchEvent(
  27562. e,
  27563. c ? 'rightupoutside' : 'mouseupoutside',
  27564. t
  27565. ),
  27566. o && (c ? (o.rightDown = !1) : (o.leftDown = !1));
  27567. }
  27568. r
  27569. ? (this.dispatchEvent(e, 'pointerup', t),
  27570. s && this.dispatchEvent(e, 'touchend', t),
  27571. o &&
  27572. ((a && !u) || this.dispatchEvent(e, 'pointertap', t),
  27573. s && (this.dispatchEvent(e, 'tap', t), (o.over = !1))))
  27574. : o &&
  27575. (this.dispatchEvent(e, 'pointerupoutside', t),
  27576. s && this.dispatchEvent(e, 'touchendoutside', t)),
  27577. o && o.none && delete e.trackedPointers[i];
  27578. }),
  27579. (e.prototype.onPointerMove = function (t) {
  27580. if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
  27581. var e = this.normalizeToPointerData(t);
  27582. ('mouse' !== e[0].pointerType && 'pen' !== e[0].pointerType) ||
  27583. ((this._didMove = !0), (this.cursor = null));
  27584. for (var r = e.length, n = 0; n < r; n++) {
  27585. var i = e[n],
  27586. o = this.getInteractionDataForPointerId(i),
  27587. s = this.configureInteractionEventForDOMEvent(
  27588. this.eventData,
  27589. i,
  27590. o
  27591. );
  27592. (s.data.originalEvent = t),
  27593. this.processInteractive(
  27594. s,
  27595. this.lastObjectRendered,
  27596. this.processPointerMove,
  27597. !0
  27598. ),
  27599. this.emit('pointermove', s),
  27600. 'touch' === i.pointerType && this.emit('touchmove', s),
  27601. ('mouse' !== i.pointerType && 'pen' !== i.pointerType) ||
  27602. this.emit('mousemove', s);
  27603. }
  27604. 'mouse' === e[0].pointerType && this.setCursorMode(this.cursor);
  27605. }
  27606. }),
  27607. (e.prototype.processPointerMove = function (t, e, r) {
  27608. var n = t.data,
  27609. i = 'touch' === n.pointerType,
  27610. o = 'mouse' === n.pointerType || 'pen' === n.pointerType;
  27611. o && this.processPointerOverOut(t, e, r),
  27612. (this.moveWhenInside && !r) ||
  27613. (this.dispatchEvent(e, 'pointermove', t),
  27614. i && this.dispatchEvent(e, 'touchmove', t),
  27615. o && this.dispatchEvent(e, 'mousemove', t));
  27616. }),
  27617. (e.prototype.onPointerOut = function (t) {
  27618. if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
  27619. var e = this.normalizeToPointerData(t)[0];
  27620. 'mouse' === e.pointerType &&
  27621. ((this.mouseOverRenderer = !1), this.setCursorMode(null));
  27622. var r = this.getInteractionDataForPointerId(e),
  27623. n = this.configureInteractionEventForDOMEvent(
  27624. this.eventData,
  27625. e,
  27626. r
  27627. );
  27628. (n.data.originalEvent = e),
  27629. this.processInteractive(
  27630. n,
  27631. this.lastObjectRendered,
  27632. this.processPointerOverOut,
  27633. !1
  27634. ),
  27635. this.emit('pointerout', n),
  27636. 'mouse' === e.pointerType || 'pen' === e.pointerType
  27637. ? this.emit('mouseout', n)
  27638. : this.releaseInteractionDataForPointerId(r.identifier);
  27639. }
  27640. }),
  27641. (e.prototype.processPointerOverOut = function (t, e, r) {
  27642. var n = t.data,
  27643. i = t.data.identifier,
  27644. o = 'mouse' === n.pointerType || 'pen' === n.pointerType,
  27645. s = e.trackedPointers[i];
  27646. r && !s && (s = e.trackedPointers[i] = new yN(i)),
  27647. void 0 !== s &&
  27648. (r && this.mouseOverRenderer
  27649. ? (s.over ||
  27650. ((s.over = !0),
  27651. this.delayDispatchEvent(e, 'pointerover', t),
  27652. o && this.delayDispatchEvent(e, 'mouseover', t)),
  27653. o && null === this.cursor && (this.cursor = e.cursor))
  27654. : s.over &&
  27655. ((s.over = !1),
  27656. this.dispatchEvent(e, 'pointerout', this.eventData),
  27657. o && this.dispatchEvent(e, 'mouseout', t),
  27658. s.none && delete e.trackedPointers[i]));
  27659. }),
  27660. (e.prototype.onPointerOver = function (t) {
  27661. if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
  27662. var e = this.normalizeToPointerData(t)[0],
  27663. r = this.getInteractionDataForPointerId(e),
  27664. n = this.configureInteractionEventForDOMEvent(
  27665. this.eventData,
  27666. e,
  27667. r
  27668. );
  27669. (n.data.originalEvent = e),
  27670. 'mouse' === e.pointerType && (this.mouseOverRenderer = !0),
  27671. this.emit('pointerover', n),
  27672. ('mouse' !== e.pointerType && 'pen' !== e.pointerType) ||
  27673. this.emit('mouseover', n);
  27674. }
  27675. }),
  27676. (e.prototype.getInteractionDataForPointerId = function (t) {
  27677. var e,
  27678. r = t.pointerId;
  27679. return (
  27680. 1 === r || 'mouse' === t.pointerType
  27681. ? (e = this.mouse)
  27682. : this.activeInteractionData[r]
  27683. ? (e = this.activeInteractionData[r])
  27684. : (((e = this.interactionDataPool.pop() || new pN()).identifier =
  27685. r),
  27686. (this.activeInteractionData[r] = e)),
  27687. e.copyEvent(t),
  27688. e
  27689. );
  27690. }),
  27691. (e.prototype.releaseInteractionDataForPointerId = function (t) {
  27692. var e = this.activeInteractionData[t];
  27693. e &&
  27694. (delete this.activeInteractionData[t],
  27695. e.reset(),
  27696. this.interactionDataPool.push(e));
  27697. }),
  27698. (e.prototype.configureInteractionEventForDOMEvent = function (t, e, r) {
  27699. return (
  27700. (t.data = r),
  27701. this.mapPositionToPoint(r.global, e.clientX, e.clientY),
  27702. 'touch' === e.pointerType &&
  27703. ((e.globalX = r.global.x), (e.globalY = r.global.y)),
  27704. (r.originalEvent = e),
  27705. t.reset(),
  27706. t
  27707. );
  27708. }),
  27709. (e.prototype.normalizeToPointerData = function (t) {
  27710. var e = [];
  27711. if (this.supportsTouchEvents && t instanceof TouchEvent)
  27712. for (var r = 0, n = t.changedTouches.length; r < n; r++) {
  27713. var i = t.changedTouches[r];
  27714. void 0 === i.button && (i.button = t.touches.length ? 1 : 0),
  27715. void 0 === i.buttons && (i.buttons = t.touches.length ? 1 : 0),
  27716. void 0 === i.isPrimary &&
  27717. (i.isPrimary =
  27718. 1 === t.touches.length && 'touchstart' === t.type),
  27719. void 0 === i.width && (i.width = i.radiusX || 1),
  27720. void 0 === i.height && (i.height = i.radiusY || 1),
  27721. void 0 === i.tiltX && (i.tiltX = 0),
  27722. void 0 === i.tiltY && (i.tiltY = 0),
  27723. void 0 === i.pointerType && (i.pointerType = 'touch'),
  27724. void 0 === i.pointerId && (i.pointerId = i.identifier || 0),
  27725. void 0 === i.pressure && (i.pressure = i.force || 0.5),
  27726. void 0 === i.twist && (i.twist = 0),
  27727. void 0 === i.tangentialPressure && (i.tangentialPressure = 0),
  27728. void 0 === i.layerX && (i.layerX = i.offsetX = i.clientX),
  27729. void 0 === i.layerY && (i.layerY = i.offsetY = i.clientY),
  27730. (i.isNormalized = !0),
  27731. e.push(i);
  27732. }
  27733. else if (
  27734. globalThis.MouseEvent &&
  27735. (!(t instanceof MouseEvent) ||
  27736. (this.supportsPointerEvents &&
  27737. t instanceof globalThis.PointerEvent))
  27738. )
  27739. e.push(t);
  27740. else {
  27741. var o = t;
  27742. void 0 === o.isPrimary && (o.isPrimary = !0),
  27743. void 0 === o.width && (o.width = 1),
  27744. void 0 === o.height && (o.height = 1),
  27745. void 0 === o.tiltX && (o.tiltX = 0),
  27746. void 0 === o.tiltY && (o.tiltY = 0),
  27747. void 0 === o.pointerType && (o.pointerType = 'mouse'),
  27748. void 0 === o.pointerId && (o.pointerId = 1),
  27749. void 0 === o.pressure && (o.pressure = 0.5),
  27750. void 0 === o.twist && (o.twist = 0),
  27751. void 0 === o.tangentialPressure && (o.tangentialPressure = 0),
  27752. (o.isNormalized = !0),
  27753. e.push(o);
  27754. }
  27755. return e;
  27756. }),
  27757. (e.prototype.destroy = function () {
  27758. this.removeEvents(),
  27759. this.removeTickerListener(),
  27760. this.removeAllListeners(),
  27761. (this.renderer = null),
  27762. (this.mouse = null),
  27763. (this.eventData = null),
  27764. (this.interactionDOMElement = null),
  27765. (this.onPointerDown = null),
  27766. (this.processPointerDown = null),
  27767. (this.onPointerUp = null),
  27768. (this.processPointerUp = null),
  27769. (this.onPointerCancel = null),
  27770. (this.processPointerCancel = null),
  27771. (this.onPointerMove = null),
  27772. (this.processPointerMove = null),
  27773. (this.onPointerOut = null),
  27774. (this.processPointerOverOut = null),
  27775. (this.onPointerOver = null),
  27776. (this.search = null);
  27777. }),
  27778. (e.extension = {
  27779. name: 'interaction',
  27780. type: [HD.RendererPlugin, HD.CanvasRendererPlugin],
  27781. }),
  27782. e
  27783. );
  27784. })(yA),
  27785. xN = new TD(),
  27786. EN = (function () {
  27787. function t(t) {
  27788. this.renderer = t;
  27789. }
  27790. return (
  27791. (t.prototype.image = function (t, e, r) {
  27792. var n = new Image();
  27793. return (n.src = this.base64(t, e, r)), n;
  27794. }),
  27795. (t.prototype.base64 = function (t, e, r) {
  27796. return this.canvas(t).toDataURL(e, r);
  27797. }),
  27798. (t.prototype.canvas = function (e, r) {
  27799. var n = this._rawPixels(e, r),
  27800. i = n.pixels,
  27801. o = n.width,
  27802. s = n.height,
  27803. a = n.flipY,
  27804. u = new dD(o, s, 1),
  27805. c = u.context.getImageData(0, 0, o, s);
  27806. if (
  27807. (t.arrayPostDivide(i, c.data), u.context.putImageData(c, 0, 0), a)
  27808. ) {
  27809. var h = new dD(u.width, u.height, 1);
  27810. h.context.scale(1, -1),
  27811. h.context.drawImage(u.canvas, 0, -s),
  27812. u.destroy(),
  27813. (u = h);
  27814. }
  27815. return u.canvas;
  27816. }),
  27817. (t.prototype.pixels = function (e, r) {
  27818. var n = this._rawPixels(e, r).pixels;
  27819. return t.arrayPostDivide(n, n), n;
  27820. }),
  27821. (t.prototype._rawPixels = function (t, e) {
  27822. var r,
  27823. n,
  27824. i = this.renderer,
  27825. o = !1,
  27826. s = !1;
  27827. if (t)
  27828. if (t instanceof SL) n = t;
  27829. else {
  27830. var a = i.context.webGLVersion >= 2 ? i.multisample : WP.NONE;
  27831. if (
  27832. ((n = this.renderer.generateTexture(t, { multisample: a })),
  27833. a !== WP.NONE)
  27834. ) {
  27835. var u = SL.create({ width: n.width, height: n.height });
  27836. i.framebuffer.bind(n.framebuffer),
  27837. i.framebuffer.blit(u.framebuffer),
  27838. i.framebuffer.bind(null),
  27839. n.destroy(!0),
  27840. (n = u);
  27841. }
  27842. s = !0;
  27843. }
  27844. n
  27845. ? ((r = n.baseTexture.resolution),
  27846. (e = null != e ? e : n.frame),
  27847. (o = !1),
  27848. i.renderTexture.bind(n))
  27849. : ((r = i.resolution),
  27850. e || (((e = xN).width = i.width), (e.height = i.height)),
  27851. (o = !0),
  27852. i.renderTexture.bind(null));
  27853. var c = Math.round(e.width * r),
  27854. h = Math.round(e.height * r),
  27855. l = new Uint8Array(4 * c * h),
  27856. d = i.gl;
  27857. return (
  27858. d.readPixels(
  27859. Math.round(e.x * r),
  27860. Math.round(e.y * r),
  27861. c,
  27862. h,
  27863. d.RGBA,
  27864. d.UNSIGNED_BYTE,
  27865. l
  27866. ),
  27867. s && n.destroy(!0),
  27868. { pixels: l, width: c, height: h, flipY: o }
  27869. );
  27870. }),
  27871. (t.prototype.destroy = function () {
  27872. this.renderer = null;
  27873. }),
  27874. (t.arrayPostDivide = function (t, e) {
  27875. for (var r = 0; r < t.length; r += 4) {
  27876. var n = (e[r + 3] = t[r + 3]);
  27877. 0 !== n
  27878. ? ((e[r] = Math.round(Math.min((255 * t[r]) / n, 255))),
  27879. (e[r + 1] = Math.round(Math.min((255 * t[r + 1]) / n, 255))),
  27880. (e[r + 2] = Math.round(Math.min((255 * t[r + 2]) / n, 255))))
  27881. : ((e[r] = t[r]), (e[r + 1] = t[r + 1]), (e[r + 2] = t[r + 2]));
  27882. }
  27883. }),
  27884. (t.extension = { name: 'extract', type: HD.RendererPlugin }),
  27885. t
  27886. );
  27887. })(),
  27888. SN = (function () {
  27889. function t(t, e, r) {
  27890. void 0 === e && (e = !1),
  27891. (this._fn = t),
  27892. (this._once = e),
  27893. (this._thisArg = r),
  27894. (this._next = this._prev = this._owner = null);
  27895. }
  27896. return (
  27897. (t.prototype.detach = function () {
  27898. return null !== this._owner && (this._owner.detach(this), !0);
  27899. }),
  27900. t
  27901. );
  27902. })();
  27903. function wN(t, e) {
  27904. return (
  27905. t._head
  27906. ? ((t._tail._next = e), (e._prev = t._tail), (t._tail = e))
  27907. : ((t._head = e), (t._tail = e)),
  27908. (e._owner = t),
  27909. e
  27910. );
  27911. }
  27912. var RN,
  27913. CN = (function () {
  27914. function t() {
  27915. this._head = this._tail = void 0;
  27916. }
  27917. return (
  27918. (t.prototype.handlers = function (t) {
  27919. void 0 === t && (t = !1);
  27920. var e = this._head;
  27921. if (t) return !!e;
  27922. for (var r = []; e; ) r.push(e), (e = e._next);
  27923. return r;
  27924. }),
  27925. (t.prototype.has = function (t) {
  27926. if (!(t instanceof SN))
  27927. throw new Error(
  27928. 'MiniSignal#has(): First arg must be a SignalBinding object.'
  27929. );
  27930. return t._owner === this;
  27931. }),
  27932. (t.prototype.dispatch = function () {
  27933. for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
  27934. e[r] = t[r];
  27935. var n = this._head;
  27936. if (!n) return !1;
  27937. for (; n; )
  27938. n._once && this.detach(n),
  27939. n._fn.apply(n._thisArg, e),
  27940. (n = n._next);
  27941. return !0;
  27942. }),
  27943. (t.prototype.add = function (t, e) {
  27944. if ((void 0 === e && (e = null), 'function' != typeof t))
  27945. throw new Error('MiniSignal#add(): First arg must be a Function.');
  27946. return wN(this, new SN(t, !1, e));
  27947. }),
  27948. (t.prototype.once = function (t, e) {
  27949. if ((void 0 === e && (e = null), 'function' != typeof t))
  27950. throw new Error('MiniSignal#once(): First arg must be a Function.');
  27951. return wN(this, new SN(t, !0, e));
  27952. }),
  27953. (t.prototype.detach = function (t) {
  27954. if (!(t instanceof SN))
  27955. throw new Error(
  27956. 'MiniSignal#detach(): First arg must be a SignalBinding object.'
  27957. );
  27958. return (
  27959. t._owner !== this ||
  27960. (t._prev && (t._prev._next = t._next),
  27961. t._next && (t._next._prev = t._prev),
  27962. t === this._head
  27963. ? ((this._head = t._next),
  27964. null === t._next && (this._tail = null))
  27965. : t === this._tail &&
  27966. ((this._tail = t._prev), (this._tail._next = null)),
  27967. (t._owner = null)),
  27968. this
  27969. );
  27970. }),
  27971. (t.prototype.detachAll = function () {
  27972. var t = this._head;
  27973. if (!t) return this;
  27974. for (this._head = this._tail = null; t; )
  27975. (t._owner = null), (t = t._next);
  27976. return this;
  27977. }),
  27978. t
  27979. );
  27980. })();
  27981. function PN(t, e) {
  27982. e = e || {};
  27983. for (
  27984. var r = {
  27985. key: [
  27986. 'source',
  27987. 'protocol',
  27988. 'authority',
  27989. 'userInfo',
  27990. 'user',
  27991. 'password',
  27992. 'host',
  27993. 'port',
  27994. 'relative',
  27995. 'path',
  27996. 'directory',
  27997. 'file',
  27998. 'query',
  27999. 'anchor',
  28000. ],
  28001. q: { name: 'queryKey', parser: /(?:^|&)([^&=]*)=?([^&]*)/g },
  28002. parser: {
  28003. strict:
  28004. /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
  28005. loose:
  28006. /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
  28007. },
  28008. },
  28009. n = r.parser[e.strictMode ? 'strict' : 'loose'].exec(t),
  28010. i = {},
  28011. o = 14;
  28012. o--;
  28013. )
  28014. i[r.key[o]] = n[o] || '';
  28015. return (
  28016. (i[r.q.name] = {}),
  28017. i[r.key[12]].replace(r.q.parser, function (t, e, n) {
  28018. e && (i[r.q.name][e] = n);
  28019. }),
  28020. i
  28021. );
  28022. }
  28023. var AN = null;
  28024. function ON() {}
  28025. function IN(t, e, r) {
  28026. e && 0 === e.indexOf('.') && (e = e.substring(1)), e && (t[e] = r);
  28027. }
  28028. function MN(t) {
  28029. return t.toString().replace('object ', '');
  28030. }
  28031. var DN = (function () {
  28032. function t(e, r, n) {
  28033. if (
  28034. ((this._dequeue = ON),
  28035. (this._onLoadBinding = null),
  28036. (this._elementTimer = 0),
  28037. (this._boundComplete = null),
  28038. (this._boundOnError = null),
  28039. (this._boundOnProgress = null),
  28040. (this._boundOnTimeout = null),
  28041. (this._boundXhrOnError = null),
  28042. (this._boundXhrOnTimeout = null),
  28043. (this._boundXhrOnAbort = null),
  28044. (this._boundXhrOnLoad = null),
  28045. 'string' != typeof e || 'string' != typeof r)
  28046. )
  28047. throw new Error(
  28048. 'Both name and url are required for constructing a resource.'
  28049. );
  28050. (n = n || {}),
  28051. (this._flags = 0),
  28052. this._setFlag(t.STATUS_FLAGS.DATA_URL, 0 === r.indexOf('data:')),
  28053. (this.name = e),
  28054. (this.url = r),
  28055. (this.extension = this._getExtension()),
  28056. (this.data = null),
  28057. (this.crossOrigin = !0 === n.crossOrigin ? 'anonymous' : n.crossOrigin),
  28058. (this.timeout = n.timeout || 0),
  28059. (this.loadType = n.loadType || this._determineLoadType()),
  28060. (this.xhrType = n.xhrType),
  28061. (this.metadata = n.metadata || {}),
  28062. (this.error = null),
  28063. (this.xhr = null),
  28064. (this.children = []),
  28065. (this.type = t.TYPE.UNKNOWN),
  28066. (this.progressChunk = 0),
  28067. (this._dequeue = ON),
  28068. (this._onLoadBinding = null),
  28069. (this._elementTimer = 0),
  28070. (this._boundComplete = this.complete.bind(this)),
  28071. (this._boundOnError = this._onError.bind(this)),
  28072. (this._boundOnProgress = this._onProgress.bind(this)),
  28073. (this._boundOnTimeout = this._onTimeout.bind(this)),
  28074. (this._boundXhrOnError = this._xhrOnError.bind(this)),
  28075. (this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this)),
  28076. (this._boundXhrOnAbort = this._xhrOnAbort.bind(this)),
  28077. (this._boundXhrOnLoad = this._xhrOnLoad.bind(this)),
  28078. (this.onStart = new CN()),
  28079. (this.onProgress = new CN()),
  28080. (this.onComplete = new CN()),
  28081. (this.onAfterMiddleware = new CN());
  28082. }
  28083. return (
  28084. (t.setExtensionLoadType = function (e, r) {
  28085. IN(t._loadTypeMap, e, r);
  28086. }),
  28087. (t.setExtensionXhrType = function (e, r) {
  28088. IN(t._xhrTypeMap, e, r);
  28089. }),
  28090. Object.defineProperty(t.prototype, 'isDataUrl', {
  28091. get: function () {
  28092. return this._hasFlag(t.STATUS_FLAGS.DATA_URL);
  28093. },
  28094. enumerable: !1,
  28095. configurable: !0,
  28096. }),
  28097. Object.defineProperty(t.prototype, 'isComplete', {
  28098. get: function () {
  28099. return this._hasFlag(t.STATUS_FLAGS.COMPLETE);
  28100. },
  28101. enumerable: !1,
  28102. configurable: !0,
  28103. }),
  28104. Object.defineProperty(t.prototype, 'isLoading', {
  28105. get: function () {
  28106. return this._hasFlag(t.STATUS_FLAGS.LOADING);
  28107. },
  28108. enumerable: !1,
  28109. configurable: !0,
  28110. }),
  28111. (t.prototype.complete = function () {
  28112. this._clearEvents(), this._finish();
  28113. }),
  28114. (t.prototype.abort = function (e) {
  28115. if (!this.error) {
  28116. if (((this.error = new Error(e)), this._clearEvents(), this.xhr))
  28117. this.xhr.abort();
  28118. else if (this.xdr) this.xdr.abort();
  28119. else if (this.data)
  28120. if (this.data.src) this.data.src = t.EMPTY_GIF;
  28121. else
  28122. for (; this.data.firstChild; )
  28123. this.data.removeChild(this.data.firstChild);
  28124. this._finish();
  28125. }
  28126. }),
  28127. (t.prototype.load = function (e) {
  28128. var r = this;
  28129. if (!this.isLoading)
  28130. if (this.isComplete)
  28131. e &&
  28132. setTimeout(function () {
  28133. return e(r);
  28134. }, 1);
  28135. else
  28136. switch (
  28137. (e && this.onComplete.once(e),
  28138. this._setFlag(t.STATUS_FLAGS.LOADING, !0),
  28139. this.onStart.dispatch(this),
  28140. (!1 !== this.crossOrigin &&
  28141. 'string' == typeof this.crossOrigin) ||
  28142. (this.crossOrigin = this._determineCrossOrigin(this.url)),
  28143. this.loadType)
  28144. ) {
  28145. case t.LOAD_TYPE.IMAGE:
  28146. (this.type = t.TYPE.IMAGE), this._loadElement('image');
  28147. break;
  28148. case t.LOAD_TYPE.AUDIO:
  28149. (this.type = t.TYPE.AUDIO), this._loadSourceElement('audio');
  28150. break;
  28151. case t.LOAD_TYPE.VIDEO:
  28152. (this.type = t.TYPE.VIDEO), this._loadSourceElement('video');
  28153. break;
  28154. case t.LOAD_TYPE.XHR:
  28155. default:
  28156. void 0 === RN &&
  28157. (RN = !(
  28158. !globalThis.XDomainRequest ||
  28159. 'withCredentials' in new XMLHttpRequest()
  28160. )),
  28161. RN && this.crossOrigin ? this._loadXdr() : this._loadXhr();
  28162. }
  28163. }),
  28164. (t.prototype._hasFlag = function (t) {
  28165. return 0 != (this._flags & t);
  28166. }),
  28167. (t.prototype._setFlag = function (t, e) {
  28168. this._flags = e ? this._flags | t : this._flags & ~t;
  28169. }),
  28170. (t.prototype._clearEvents = function () {
  28171. clearTimeout(this._elementTimer),
  28172. this.data &&
  28173. this.data.removeEventListener &&
  28174. (this.data.removeEventListener('error', this._boundOnError, !1),
  28175. this.data.removeEventListener('load', this._boundComplete, !1),
  28176. this.data.removeEventListener(
  28177. 'progress',
  28178. this._boundOnProgress,
  28179. !1
  28180. ),
  28181. this.data.removeEventListener(
  28182. 'canplaythrough',
  28183. this._boundComplete,
  28184. !1
  28185. )),
  28186. this.xhr &&
  28187. (this.xhr.removeEventListener
  28188. ? (this.xhr.removeEventListener(
  28189. 'error',
  28190. this._boundXhrOnError,
  28191. !1
  28192. ),
  28193. this.xhr.removeEventListener(
  28194. 'timeout',
  28195. this._boundXhrOnTimeout,
  28196. !1
  28197. ),
  28198. this.xhr.removeEventListener(
  28199. 'abort',
  28200. this._boundXhrOnAbort,
  28201. !1
  28202. ),
  28203. this.xhr.removeEventListener(
  28204. 'progress',
  28205. this._boundOnProgress,
  28206. !1
  28207. ),
  28208. this.xhr.removeEventListener('load', this._boundXhrOnLoad, !1))
  28209. : ((this.xhr.onerror = null),
  28210. (this.xhr.ontimeout = null),
  28211. (this.xhr.onprogress = null),
  28212. (this.xhr.onload = null)));
  28213. }),
  28214. (t.prototype._finish = function () {
  28215. if (this.isComplete)
  28216. throw new Error(
  28217. 'Complete called again for an already completed resource.'
  28218. );
  28219. this._setFlag(t.STATUS_FLAGS.COMPLETE, !0),
  28220. this._setFlag(t.STATUS_FLAGS.LOADING, !1),
  28221. this.onComplete.dispatch(this);
  28222. }),
  28223. (t.prototype._loadElement = function (t) {
  28224. this.metadata.loadElement
  28225. ? (this.data = this.metadata.loadElement)
  28226. : 'image' === t && void 0 !== globalThis.Image
  28227. ? (this.data = new Image())
  28228. : (this.data = document.createElement(t)),
  28229. this.crossOrigin && (this.data.crossOrigin = this.crossOrigin),
  28230. this.metadata.skipSource || (this.data.src = this.url),
  28231. this.data.addEventListener('error', this._boundOnError, !1),
  28232. this.data.addEventListener('load', this._boundComplete, !1),
  28233. this.data.addEventListener('progress', this._boundOnProgress, !1),
  28234. this.timeout &&
  28235. (this._elementTimer = setTimeout(
  28236. this._boundOnTimeout,
  28237. this.timeout
  28238. ));
  28239. }),
  28240. (t.prototype._loadSourceElement = function (t) {
  28241. if (
  28242. (this.metadata.loadElement
  28243. ? (this.data = this.metadata.loadElement)
  28244. : 'audio' === t && void 0 !== globalThis.Audio
  28245. ? (this.data = new Audio())
  28246. : (this.data = document.createElement(t)),
  28247. null !== this.data)
  28248. ) {
  28249. if (
  28250. (this.crossOrigin && (this.data.crossOrigin = this.crossOrigin),
  28251. !this.metadata.skipSource)
  28252. )
  28253. if (navigator.isCocoonJS)
  28254. this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;
  28255. else if (Array.isArray(this.url))
  28256. for (
  28257. var e = this.metadata.mimeType, r = 0;
  28258. r < this.url.length;
  28259. ++r
  28260. )
  28261. this.data.appendChild(
  28262. this._createSource(
  28263. t,
  28264. this.url[r],
  28265. Array.isArray(e) ? e[r] : e
  28266. )
  28267. );
  28268. else {
  28269. e = this.metadata.mimeType;
  28270. this.data.appendChild(
  28271. this._createSource(t, this.url, Array.isArray(e) ? e[0] : e)
  28272. );
  28273. }
  28274. this.data.addEventListener('error', this._boundOnError, !1),
  28275. this.data.addEventListener('load', this._boundComplete, !1),
  28276. this.data.addEventListener('progress', this._boundOnProgress, !1),
  28277. this.data.addEventListener(
  28278. 'canplaythrough',
  28279. this._boundComplete,
  28280. !1
  28281. ),
  28282. this.data.load(),
  28283. this.timeout &&
  28284. (this._elementTimer = setTimeout(
  28285. this._boundOnTimeout,
  28286. this.timeout
  28287. ));
  28288. } else this.abort('Unsupported element: ' + t);
  28289. }),
  28290. (t.prototype._loadXhr = function () {
  28291. 'string' != typeof this.xhrType &&
  28292. (this.xhrType = this._determineXhrType());
  28293. var e = (this.xhr = new XMLHttpRequest());
  28294. 'use-credentials' === this.crossOrigin && (e.withCredentials = !0),
  28295. e.open('GET', this.url, !0),
  28296. (e.timeout = this.timeout),
  28297. this.xhrType === t.XHR_RESPONSE_TYPE.JSON ||
  28298. this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT
  28299. ? (e.responseType = t.XHR_RESPONSE_TYPE.TEXT)
  28300. : (e.responseType = this.xhrType),
  28301. e.addEventListener('error', this._boundXhrOnError, !1),
  28302. e.addEventListener('timeout', this._boundXhrOnTimeout, !1),
  28303. e.addEventListener('abort', this._boundXhrOnAbort, !1),
  28304. e.addEventListener('progress', this._boundOnProgress, !1),
  28305. e.addEventListener('load', this._boundXhrOnLoad, !1),
  28306. e.send();
  28307. }),
  28308. (t.prototype._loadXdr = function () {
  28309. 'string' != typeof this.xhrType &&
  28310. (this.xhrType = this._determineXhrType());
  28311. var t = (this.xhr = new globalThis.XDomainRequest());
  28312. (t.timeout = this.timeout || 5e3),
  28313. (t.onerror = this._boundXhrOnError),
  28314. (t.ontimeout = this._boundXhrOnTimeout),
  28315. (t.onprogress = this._boundOnProgress),
  28316. (t.onload = this._boundXhrOnLoad),
  28317. t.open('GET', this.url, !0),
  28318. setTimeout(function () {
  28319. return t.send();
  28320. }, 1);
  28321. }),
  28322. (t.prototype._createSource = function (t, e, r) {
  28323. r || (r = t + '/' + this._getExtension(e));
  28324. var n = document.createElement('source');
  28325. return (n.src = e), (n.type = r), n;
  28326. }),
  28327. (t.prototype._onError = function (t) {
  28328. this.abort('Failed to load element using: ' + t.target.nodeName);
  28329. }),
  28330. (t.prototype._onProgress = function (t) {
  28331. t &&
  28332. t.lengthComputable &&
  28333. this.onProgress.dispatch(this, t.loaded / t.total);
  28334. }),
  28335. (t.prototype._onTimeout = function () {
  28336. this.abort('Load timed out.');
  28337. }),
  28338. (t.prototype._xhrOnError = function () {
  28339. var t = this.xhr;
  28340. this.abort(
  28341. MN(t) +
  28342. ' Request failed. Status: ' +
  28343. t.status +
  28344. ', text: "' +
  28345. t.statusText +
  28346. '"'
  28347. );
  28348. }),
  28349. (t.prototype._xhrOnTimeout = function () {
  28350. var t = this.xhr;
  28351. this.abort(MN(t) + ' Request timed out.');
  28352. }),
  28353. (t.prototype._xhrOnAbort = function () {
  28354. var t = this.xhr;
  28355. this.abort(MN(t) + ' Request was aborted by the user.');
  28356. }),
  28357. (t.prototype._xhrOnLoad = function () {
  28358. var e = this.xhr,
  28359. r = '',
  28360. n = void 0 === e.status ? 200 : e.status;
  28361. if (
  28362. (('' !== e.responseType &&
  28363. 'text' !== e.responseType &&
  28364. void 0 !== e.responseType) ||
  28365. (r = e.responseText),
  28366. 0 === n &&
  28367. (r.length > 0 || e.responseType === t.XHR_RESPONSE_TYPE.BUFFER)
  28368. ? (n = 200)
  28369. : 1223 === n && (n = 204),
  28370. 2 === ((n / 100) | 0))
  28371. ) {
  28372. if (this.xhrType === t.XHR_RESPONSE_TYPE.TEXT)
  28373. (this.data = r), (this.type = t.TYPE.TEXT);
  28374. else if (this.xhrType === t.XHR_RESPONSE_TYPE.JSON)
  28375. try {
  28376. (this.data = JSON.parse(r)), (this.type = t.TYPE.JSON);
  28377. } catch (t) {
  28378. return void this.abort('Error trying to parse loaded json: ' + t);
  28379. }
  28380. else if (this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT)
  28381. try {
  28382. if (globalThis.DOMParser) {
  28383. var i = new DOMParser();
  28384. this.data = i.parseFromString(r, 'text/xml');
  28385. } else {
  28386. var o = document.createElement('div');
  28387. (o.innerHTML = r), (this.data = o);
  28388. }
  28389. this.type = t.TYPE.XML;
  28390. } catch (t) {
  28391. return void this.abort('Error trying to parse loaded xml: ' + t);
  28392. }
  28393. else this.data = e.response || r;
  28394. this.complete();
  28395. } else
  28396. this.abort(
  28397. '[' + e.status + '] ' + e.statusText + ': ' + e.responseURL
  28398. );
  28399. }),
  28400. (t.prototype._determineCrossOrigin = function (t, e) {
  28401. if (0 === t.indexOf('data:')) return '';
  28402. if (globalThis.origin !== globalThis.location.origin)
  28403. return 'anonymous';
  28404. (e = e || globalThis.location),
  28405. AN || (AN = document.createElement('a')),
  28406. (AN.href = t);
  28407. var r = PN(AN.href, { strictMode: !0 }),
  28408. n = (!r.port && '' === e.port) || r.port === e.port,
  28409. i = r.protocol ? r.protocol + ':' : '';
  28410. return r.host === e.hostname && n && i === e.protocol
  28411. ? ''
  28412. : 'anonymous';
  28413. }),
  28414. (t.prototype._determineXhrType = function () {
  28415. return t._xhrTypeMap[this.extension] || t.XHR_RESPONSE_TYPE.TEXT;
  28416. }),
  28417. (t.prototype._determineLoadType = function () {
  28418. return t._loadTypeMap[this.extension] || t.LOAD_TYPE.XHR;
  28419. }),
  28420. (t.prototype._getExtension = function (t) {
  28421. void 0 === t && (t = this.url);
  28422. var e = '';
  28423. if (this.isDataUrl) {
  28424. var r = t.indexOf('/');
  28425. e = t.substring(r + 1, t.indexOf(';', r));
  28426. } else {
  28427. var n = t.indexOf('?'),
  28428. i = t.indexOf('#'),
  28429. o = Math.min(n > -1 ? n : t.length, i > -1 ? i : t.length);
  28430. e = (t = t.substring(0, o)).substring(t.lastIndexOf('.') + 1);
  28431. }
  28432. return e.toLowerCase();
  28433. }),
  28434. (t.prototype._getMimeFromXhrType = function (e) {
  28435. switch (e) {
  28436. case t.XHR_RESPONSE_TYPE.BUFFER:
  28437. return 'application/octet-binary';
  28438. case t.XHR_RESPONSE_TYPE.BLOB:
  28439. return 'application/blob';
  28440. case t.XHR_RESPONSE_TYPE.DOCUMENT:
  28441. return 'application/xml';
  28442. case t.XHR_RESPONSE_TYPE.JSON:
  28443. return 'application/json';
  28444. case t.XHR_RESPONSE_TYPE.DEFAULT:
  28445. case t.XHR_RESPONSE_TYPE.TEXT:
  28446. default:
  28447. return 'text/plain';
  28448. }
  28449. }),
  28450. t
  28451. );
  28452. })();
  28453. function LN() {}
  28454. function FN(t) {
  28455. return function () {
  28456. for (var e = arguments, r = [], n = 0; n < arguments.length; n++)
  28457. r[n] = e[n];
  28458. if (null === t) throw new Error('Callback was already called.');
  28459. var i = t;
  28460. (t = null), i.apply(this, r);
  28461. };
  28462. }
  28463. !(function (t) {
  28464. var e, r, n, i;
  28465. ((e = t.STATUS_FLAGS || (t.STATUS_FLAGS = {}))[(e.NONE = 0)] = 'NONE'),
  28466. (e[(e.DATA_URL = 1)] = 'DATA_URL'),
  28467. (e[(e.COMPLETE = 2)] = 'COMPLETE'),
  28468. (e[(e.LOADING = 4)] = 'LOADING'),
  28469. ((r = t.TYPE || (t.TYPE = {}))[(r.UNKNOWN = 0)] = 'UNKNOWN'),
  28470. (r[(r.JSON = 1)] = 'JSON'),
  28471. (r[(r.XML = 2)] = 'XML'),
  28472. (r[(r.IMAGE = 3)] = 'IMAGE'),
  28473. (r[(r.AUDIO = 4)] = 'AUDIO'),
  28474. (r[(r.VIDEO = 5)] = 'VIDEO'),
  28475. (r[(r.TEXT = 6)] = 'TEXT'),
  28476. ((n = t.LOAD_TYPE || (t.LOAD_TYPE = {}))[(n.XHR = 1)] = 'XHR'),
  28477. (n[(n.IMAGE = 2)] = 'IMAGE'),
  28478. (n[(n.AUDIO = 3)] = 'AUDIO'),
  28479. (n[(n.VIDEO = 4)] = 'VIDEO'),
  28480. ((i = t.XHR_RESPONSE_TYPE || (t.XHR_RESPONSE_TYPE = {})).DEFAULT =
  28481. 'text'),
  28482. (i.BUFFER = 'arraybuffer'),
  28483. (i.BLOB = 'blob'),
  28484. (i.DOCUMENT = 'document'),
  28485. (i.JSON = 'json'),
  28486. (i.TEXT = 'text'),
  28487. (t._loadTypeMap = {
  28488. gif: t.LOAD_TYPE.IMAGE,
  28489. png: t.LOAD_TYPE.IMAGE,
  28490. bmp: t.LOAD_TYPE.IMAGE,
  28491. jpg: t.LOAD_TYPE.IMAGE,
  28492. jpeg: t.LOAD_TYPE.IMAGE,
  28493. tif: t.LOAD_TYPE.IMAGE,
  28494. tiff: t.LOAD_TYPE.IMAGE,
  28495. webp: t.LOAD_TYPE.IMAGE,
  28496. tga: t.LOAD_TYPE.IMAGE,
  28497. avif: t.LOAD_TYPE.IMAGE,
  28498. svg: t.LOAD_TYPE.IMAGE,
  28499. 'svg+xml': t.LOAD_TYPE.IMAGE,
  28500. mp3: t.LOAD_TYPE.AUDIO,
  28501. ogg: t.LOAD_TYPE.AUDIO,
  28502. wav: t.LOAD_TYPE.AUDIO,
  28503. mp4: t.LOAD_TYPE.VIDEO,
  28504. webm: t.LOAD_TYPE.VIDEO,
  28505. }),
  28506. (t._xhrTypeMap = {
  28507. xhtml: t.XHR_RESPONSE_TYPE.DOCUMENT,
  28508. html: t.XHR_RESPONSE_TYPE.DOCUMENT,
  28509. htm: t.XHR_RESPONSE_TYPE.DOCUMENT,
  28510. xml: t.XHR_RESPONSE_TYPE.DOCUMENT,
  28511. tmx: t.XHR_RESPONSE_TYPE.DOCUMENT,
  28512. svg: t.XHR_RESPONSE_TYPE.DOCUMENT,
  28513. tsx: t.XHR_RESPONSE_TYPE.DOCUMENT,
  28514. gif: t.XHR_RESPONSE_TYPE.BLOB,
  28515. png: t.XHR_RESPONSE_TYPE.BLOB,
  28516. bmp: t.XHR_RESPONSE_TYPE.BLOB,
  28517. jpg: t.XHR_RESPONSE_TYPE.BLOB,
  28518. jpeg: t.XHR_RESPONSE_TYPE.BLOB,
  28519. tif: t.XHR_RESPONSE_TYPE.BLOB,
  28520. tiff: t.XHR_RESPONSE_TYPE.BLOB,
  28521. webp: t.XHR_RESPONSE_TYPE.BLOB,
  28522. tga: t.XHR_RESPONSE_TYPE.BLOB,
  28523. avif: t.XHR_RESPONSE_TYPE.BLOB,
  28524. json: t.XHR_RESPONSE_TYPE.JSON,
  28525. text: t.XHR_RESPONSE_TYPE.TEXT,
  28526. txt: t.XHR_RESPONSE_TYPE.TEXT,
  28527. ttf: t.XHR_RESPONSE_TYPE.BUFFER,
  28528. otf: t.XHR_RESPONSE_TYPE.BUFFER,
  28529. }),
  28530. (t.EMPTY_GIF =
  28531. 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
  28532. })(DN || (DN = {}));
  28533. var NN = function (t, e) {
  28534. (this.data = t), (this.callback = e);
  28535. },
  28536. kN = (function () {
  28537. function t(t, e) {
  28538. var r = this;
  28539. if (
  28540. (void 0 === e && (e = 1),
  28541. (this.workers = 0),
  28542. (this.saturated = LN),
  28543. (this.unsaturated = LN),
  28544. (this.empty = LN),
  28545. (this.drain = LN),
  28546. (this.error = LN),
  28547. (this.started = !1),
  28548. (this.paused = !1),
  28549. (this._tasks = []),
  28550. (this._insert = function (t, e, n) {
  28551. if (n && 'function' != typeof n)
  28552. throw new Error('task callback must be a function');
  28553. if (((r.started = !0), null == t && r.idle()))
  28554. setTimeout(function () {
  28555. return r.drain();
  28556. }, 1);
  28557. else {
  28558. var i = new NN(t, 'function' == typeof n ? n : LN);
  28559. e ? r._tasks.unshift(i) : r._tasks.push(i),
  28560. setTimeout(r.process, 1);
  28561. }
  28562. }),
  28563. (this.process = function () {
  28564. for (
  28565. ;
  28566. !r.paused && r.workers < r.concurrency && r._tasks.length;
  28567. ) {
  28568. var t = r._tasks.shift();
  28569. 0 === r._tasks.length && r.empty(),
  28570. (r.workers += 1),
  28571. r.workers === r.concurrency && r.saturated(),
  28572. r._worker(t.data, FN(r._next(t)));
  28573. }
  28574. }),
  28575. (this._worker = t),
  28576. 0 === e)
  28577. )
  28578. throw new Error('Concurrency must not be zero');
  28579. (this.concurrency = e), (this.buffer = e / 4);
  28580. }
  28581. return (
  28582. (t.prototype._next = function (t) {
  28583. var e = this;
  28584. return function () {
  28585. for (var r = arguments, n = [], i = 0; i < arguments.length; i++)
  28586. n[i] = r[i];
  28587. (e.workers -= 1),
  28588. t.callback.apply(t, n),
  28589. null != n[0] && e.error(n[0], t.data),
  28590. e.workers <= e.concurrency - e.buffer && e.unsaturated(),
  28591. e.idle() && e.drain(),
  28592. e.process();
  28593. };
  28594. }),
  28595. (t.prototype.push = function (t, e) {
  28596. this._insert(t, !1, e);
  28597. }),
  28598. (t.prototype.kill = function () {
  28599. (this.workers = 0),
  28600. (this.drain = LN),
  28601. (this.started = !1),
  28602. (this._tasks = []);
  28603. }),
  28604. (t.prototype.unshift = function (t, e) {
  28605. this._insert(t, !0, e);
  28606. }),
  28607. (t.prototype.length = function () {
  28608. return this._tasks.length;
  28609. }),
  28610. (t.prototype.running = function () {
  28611. return this.workers;
  28612. }),
  28613. (t.prototype.idle = function () {
  28614. return this._tasks.length + this.workers === 0;
  28615. }),
  28616. (t.prototype.pause = function () {
  28617. !0 !== this.paused && (this.paused = !0);
  28618. }),
  28619. (t.prototype.resume = function () {
  28620. if (!1 !== this.paused) {
  28621. this.paused = !1;
  28622. for (var t = 1; t <= this.concurrency; t++) this.process();
  28623. }
  28624. }),
  28625. (t.eachSeries = function (t, e, r, n) {
  28626. var i = 0,
  28627. o = t.length;
  28628. !(function s(a) {
  28629. a || i === o
  28630. ? r && r(a)
  28631. : n
  28632. ? setTimeout(function () {
  28633. e(t[i++], s);
  28634. }, 1)
  28635. : e(t[i++], s);
  28636. })();
  28637. }),
  28638. (t.queue = function (e, r) {
  28639. return new t(e, r);
  28640. }),
  28641. t
  28642. );
  28643. })(),
  28644. BN = /(#[\w-]+)?$/,
  28645. GN = (function () {
  28646. function t(e, r) {
  28647. var n = this;
  28648. void 0 === e && (e = ''),
  28649. void 0 === r && (r = 10),
  28650. (this.progress = 0),
  28651. (this.loading = !1),
  28652. (this.defaultQueryString = ''),
  28653. (this._beforeMiddleware = []),
  28654. (this._afterMiddleware = []),
  28655. (this._resourcesParsing = []),
  28656. (this._boundLoadResource = function (t, e) {
  28657. return n._loadResource(t, e);
  28658. }),
  28659. (this.resources = {}),
  28660. (this.baseUrl = e),
  28661. (this._beforeMiddleware = []),
  28662. (this._afterMiddleware = []),
  28663. (this._resourcesParsing = []),
  28664. (this._boundLoadResource = function (t, e) {
  28665. return n._loadResource(t, e);
  28666. }),
  28667. (this._queue = kN.queue(this._boundLoadResource, r)),
  28668. this._queue.pause(),
  28669. (this.resources = {}),
  28670. (this.onProgress = new CN()),
  28671. (this.onError = new CN()),
  28672. (this.onLoad = new CN()),
  28673. (this.onStart = new CN()),
  28674. (this.onComplete = new CN());
  28675. for (var i = 0; i < t._plugins.length; ++i) {
  28676. var o = t._plugins[i],
  28677. s = o.pre,
  28678. a = o.use;
  28679. s && this.pre(s), a && this.use(a);
  28680. }
  28681. this._protected = !1;
  28682. }
  28683. return (
  28684. (t.prototype._add = function (t, e, r, n) {
  28685. if (this.loading && (!r || !r.parentResource))
  28686. throw new Error(
  28687. 'Cannot add resources while the loader is running.'
  28688. );
  28689. if (this.resources[t])
  28690. throw new Error('Resource named "' + t + '" already exists.');
  28691. if (
  28692. ((e = this._prepareUrl(e)),
  28693. (this.resources[t] = new DN(t, e, r)),
  28694. 'function' == typeof n &&
  28695. this.resources[t].onAfterMiddleware.once(n),
  28696. this.loading)
  28697. ) {
  28698. for (
  28699. var i = r.parentResource, o = [], s = 0;
  28700. s < i.children.length;
  28701. ++s
  28702. )
  28703. i.children[s].isComplete || o.push(i.children[s]);
  28704. var a = (i.progressChunk * (o.length + 1)) / (o.length + 2);
  28705. i.children.push(this.resources[t]), (i.progressChunk = a);
  28706. for (s = 0; s < o.length; ++s) o[s].progressChunk = a;
  28707. this.resources[t].progressChunk = a;
  28708. }
  28709. return this._queue.push(this.resources[t]), this;
  28710. }),
  28711. (t.prototype.pre = function (t) {
  28712. return this._beforeMiddleware.push(t), this;
  28713. }),
  28714. (t.prototype.use = function (t) {
  28715. return this._afterMiddleware.push(t), this;
  28716. }),
  28717. (t.prototype.reset = function () {
  28718. for (var t in ((this.progress = 0),
  28719. (this.loading = !1),
  28720. this._queue.kill(),
  28721. this._queue.pause(),
  28722. this.resources)) {
  28723. var e = this.resources[t];
  28724. e._onLoadBinding && e._onLoadBinding.detach(),
  28725. e.isLoading && e.abort('loader reset');
  28726. }
  28727. return (this.resources = {}), this;
  28728. }),
  28729. (t.prototype.load = function (t) {
  28730. if (
  28731. (aD(
  28732. '6.5.0',
  28733. '@pixi/loaders is being replaced with @pixi/assets in the next major release.'
  28734. ),
  28735. 'function' == typeof t && this.onComplete.once(t),
  28736. this.loading)
  28737. )
  28738. return this;
  28739. if (this._queue.idle()) this._onStart(), this._onComplete();
  28740. else {
  28741. for (
  28742. var e = 100 / this._queue._tasks.length, r = 0;
  28743. r < this._queue._tasks.length;
  28744. ++r
  28745. )
  28746. this._queue._tasks[r].data.progressChunk = e;
  28747. this._onStart(), this._queue.resume();
  28748. }
  28749. return this;
  28750. }),
  28751. Object.defineProperty(t.prototype, 'concurrency', {
  28752. get: function () {
  28753. return this._queue.concurrency;
  28754. },
  28755. set: function (t) {
  28756. this._queue.concurrency = t;
  28757. },
  28758. enumerable: !1,
  28759. configurable: !0,
  28760. }),
  28761. (t.prototype._prepareUrl = function (t) {
  28762. var e,
  28763. r = PN(t, { strictMode: !0 });
  28764. if (
  28765. ((e =
  28766. r.protocol || !r.path || 0 === t.indexOf('//')
  28767. ? t
  28768. : this.baseUrl.length &&
  28769. this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 &&
  28770. '/' !== t.charAt(0)
  28771. ? this.baseUrl + '/' + t
  28772. : this.baseUrl + t),
  28773. this.defaultQueryString)
  28774. ) {
  28775. var n = BN.exec(e)[0];
  28776. -1 !== (e = e.slice(0, e.length - n.length)).indexOf('?')
  28777. ? (e += '&' + this.defaultQueryString)
  28778. : (e += '?' + this.defaultQueryString),
  28779. (e += n);
  28780. }
  28781. return e;
  28782. }),
  28783. (t.prototype._loadResource = function (t, e) {
  28784. var r = this;
  28785. (t._dequeue = e),
  28786. kN.eachSeries(
  28787. this._beforeMiddleware,
  28788. function (e, n) {
  28789. e.call(r, t, function () {
  28790. n(t.isComplete ? {} : null);
  28791. });
  28792. },
  28793. function () {
  28794. t.isComplete
  28795. ? r._onLoad(t)
  28796. : ((t._onLoadBinding = t.onComplete.once(r._onLoad, r)),
  28797. t.load());
  28798. },
  28799. !0
  28800. );
  28801. }),
  28802. (t.prototype._onStart = function () {
  28803. (this.progress = 0), (this.loading = !0), this.onStart.dispatch(this);
  28804. }),
  28805. (t.prototype._onComplete = function () {
  28806. (this.progress = 100),
  28807. (this.loading = !1),
  28808. this.onComplete.dispatch(this, this.resources);
  28809. }),
  28810. (t.prototype._onLoad = function (t) {
  28811. var e = this;
  28812. (t._onLoadBinding = null),
  28813. this._resourcesParsing.push(t),
  28814. t._dequeue(),
  28815. kN.eachSeries(
  28816. this._afterMiddleware,
  28817. function (r, n) {
  28818. r.call(e, t, n);
  28819. },
  28820. function () {
  28821. t.onAfterMiddleware.dispatch(t),
  28822. (e.progress = Math.min(100, e.progress + t.progressChunk)),
  28823. e.onProgress.dispatch(e, t),
  28824. t.error
  28825. ? e.onError.dispatch(t.error, e, t)
  28826. : e.onLoad.dispatch(e, t),
  28827. e._resourcesParsing.splice(e._resourcesParsing.indexOf(t), 1),
  28828. e._queue.idle() &&
  28829. 0 === e._resourcesParsing.length &&
  28830. e._onComplete();
  28831. },
  28832. !0
  28833. );
  28834. }),
  28835. (t.prototype.destroy = function () {
  28836. this._protected || this.reset();
  28837. }),
  28838. Object.defineProperty(t, 'shared', {
  28839. get: function () {
  28840. var e = t._shared;
  28841. return e || (((e = new t())._protected = !0), (t._shared = e)), e;
  28842. },
  28843. enumerable: !1,
  28844. configurable: !0,
  28845. }),
  28846. (t.registerPlugin = function (e) {
  28847. return (
  28848. aD(
  28849. '6.5.0',
  28850. 'Loader.registerPlugin() is deprecated, use extensions.add() instead.'
  28851. ),
  28852. ZD.add({ type: HD.Loader, ref: e }),
  28853. t
  28854. );
  28855. }),
  28856. (t._plugins = []),
  28857. t
  28858. );
  28859. })();
  28860. ZD.handleByList(HD.Loader, GN._plugins),
  28861. (GN.prototype.add = function (t, e, r, n) {
  28862. if (Array.isArray(t)) {
  28863. for (var i = 0; i < t.length; ++i) this.add(t[i]);
  28864. return this;
  28865. }
  28866. if (
  28867. ('object' == typeof t &&
  28868. ((r = t),
  28869. (n = e || r.callback || r.onComplete),
  28870. (e = r.url),
  28871. (t = r.name || r.key || r.url)),
  28872. 'string' != typeof e && ((n = r), (r = e), (e = t)),
  28873. 'string' != typeof e)
  28874. )
  28875. throw new Error('No url passed to add resource to loader.');
  28876. return (
  28877. 'function' == typeof r && ((n = r), (r = null)), this._add(t, e, r, n)
  28878. );
  28879. });
  28880. var UN = (function () {
  28881. function t() {}
  28882. return (
  28883. (t.init = function (t) {
  28884. (t = Object.assign({ sharedLoader: !1 }, t)),
  28885. (this.loader = t.sharedLoader ? GN.shared : new GN());
  28886. }),
  28887. (t.destroy = function () {
  28888. this.loader && (this.loader.destroy(), (this.loader = null));
  28889. }),
  28890. (t.extension = HD.Application),
  28891. t
  28892. );
  28893. })(),
  28894. jN = (function () {
  28895. function t() {}
  28896. return (
  28897. (t.add = function () {
  28898. DN.setExtensionLoadType('svg', DN.LOAD_TYPE.XHR),
  28899. DN.setExtensionXhrType('svg', DN.XHR_RESPONSE_TYPE.TEXT);
  28900. }),
  28901. (t.use = function (t, e) {
  28902. if (!t.data || (t.type !== DN.TYPE.IMAGE && 'svg' !== t.extension))
  28903. e();
  28904. else {
  28905. var r = t.data,
  28906. n = t.url,
  28907. i = t.name,
  28908. o = t.metadata;
  28909. EL.fromLoader(r, n, i, o)
  28910. .then(function (r) {
  28911. (t.texture = r), e();
  28912. })
  28913. .catch(e);
  28914. }
  28915. }),
  28916. (t.extension = HD.Loader),
  28917. t
  28918. );
  28919. })();
  28920. function XN(t, e) {
  28921. if (t.data) {
  28922. if (t.xhr && t.xhrType === DN.XHR_RESPONSE_TYPE.BLOB)
  28923. if (self.Blob && 'string' != typeof t.data) {
  28924. if (0 === t.data.type.indexOf('image')) {
  28925. var r = globalThis.URL || globalThis.webkitURL,
  28926. n = r.createObjectURL(t.data);
  28927. return (
  28928. (t.blob = t.data),
  28929. (t.data = new Image()),
  28930. (t.data.src = n),
  28931. (t.type = DN.TYPE.IMAGE),
  28932. void (t.data.onload = function () {
  28933. r.revokeObjectURL(n), (t.data.onload = null), e();
  28934. })
  28935. );
  28936. }
  28937. } else {
  28938. var i = t.xhr.getResponseHeader('content-type');
  28939. if (i && 0 === i.indexOf('image'))
  28940. return (
  28941. (t.data = new Image()),
  28942. (t.data.src =
  28943. 'data:' +
  28944. i +
  28945. ';base64,' +
  28946. (function (t) {
  28947. for (var e = '', r = 0; r < t.length; ) {
  28948. for (
  28949. var n = [0, 0, 0], i = [0, 0, 0, 0], o = 0;
  28950. o < n.length;
  28951. ++o
  28952. )
  28953. r < t.length
  28954. ? (n[o] = 255 & t.charCodeAt(r++))
  28955. : (n[o] = 0);
  28956. switch (
  28957. ((i[0] = n[0] >> 2),
  28958. (i[1] = ((3 & n[0]) << 4) | (n[1] >> 4)),
  28959. (i[2] = ((15 & n[1]) << 2) | (n[2] >> 6)),
  28960. (i[3] = 63 & n[2]),
  28961. r - (t.length - 1))
  28962. ) {
  28963. case 2:
  28964. (i[3] = 64), (i[2] = 64);
  28965. break;
  28966. case 1:
  28967. i[3] = 64;
  28968. }
  28969. for (o = 0; o < i.length; ++o)
  28970. e +=
  28971. 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.charAt(
  28972. i[o]
  28973. );
  28974. }
  28975. return e;
  28976. })(t.xhr.responseText)),
  28977. (t.type = DN.TYPE.IMAGE),
  28978. void (t.data.onload = function () {
  28979. (t.data.onload = null), e();
  28980. })
  28981. );
  28982. }
  28983. e();
  28984. } else e();
  28985. }
  28986. var VN,
  28987. HN,
  28988. WN = (function () {
  28989. function t() {}
  28990. return (t.extension = HD.Loader), (t.use = XN), t;
  28991. })();
  28992. ZD.add(jN, WN),
  28993. (function (t) {
  28994. (t[(t.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776)] =
  28995. 'COMPRESSED_RGB_S3TC_DXT1_EXT'),
  28996. (t[(t.COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777)] =
  28997. 'COMPRESSED_RGBA_S3TC_DXT1_EXT'),
  28998. (t[(t.COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778)] =
  28999. 'COMPRESSED_RGBA_S3TC_DXT3_EXT'),
  29000. (t[(t.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779)] =
  29001. 'COMPRESSED_RGBA_S3TC_DXT5_EXT'),
  29002. (t[(t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917)] =
  29003. 'COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT'),
  29004. (t[(t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918)] =
  29005. 'COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT'),
  29006. (t[(t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919)] =
  29007. 'COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT'),
  29008. (t[(t.COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916)] =
  29009. 'COMPRESSED_SRGB_S3TC_DXT1_EXT'),
  29010. (t[(t.COMPRESSED_R11_EAC = 37488)] = 'COMPRESSED_R11_EAC'),
  29011. (t[(t.COMPRESSED_SIGNED_R11_EAC = 37489)] =
  29012. 'COMPRESSED_SIGNED_R11_EAC'),
  29013. (t[(t.COMPRESSED_RG11_EAC = 37490)] = 'COMPRESSED_RG11_EAC'),
  29014. (t[(t.COMPRESSED_SIGNED_RG11_EAC = 37491)] =
  29015. 'COMPRESSED_SIGNED_RG11_EAC'),
  29016. (t[(t.COMPRESSED_RGB8_ETC2 = 37492)] = 'COMPRESSED_RGB8_ETC2'),
  29017. (t[(t.COMPRESSED_RGBA8_ETC2_EAC = 37496)] =
  29018. 'COMPRESSED_RGBA8_ETC2_EAC'),
  29019. (t[(t.COMPRESSED_SRGB8_ETC2 = 37493)] = 'COMPRESSED_SRGB8_ETC2'),
  29020. (t[(t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497)] =
  29021. 'COMPRESSED_SRGB8_ALPHA8_ETC2_EAC'),
  29022. (t[(t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494)] =
  29023. 'COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2'),
  29024. (t[(t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495)] =
  29025. 'COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2'),
  29026. (t[(t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840)] =
  29027. 'COMPRESSED_RGB_PVRTC_4BPPV1_IMG'),
  29028. (t[(t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842)] =
  29029. 'COMPRESSED_RGBA_PVRTC_4BPPV1_IMG'),
  29030. (t[(t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841)] =
  29031. 'COMPRESSED_RGB_PVRTC_2BPPV1_IMG'),
  29032. (t[(t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843)] =
  29033. 'COMPRESSED_RGBA_PVRTC_2BPPV1_IMG'),
  29034. (t[(t.COMPRESSED_RGB_ETC1_WEBGL = 36196)] =
  29035. 'COMPRESSED_RGB_ETC1_WEBGL'),
  29036. (t[(t.COMPRESSED_RGB_ATC_WEBGL = 35986)] = 'COMPRESSED_RGB_ATC_WEBGL'),
  29037. (t[(t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35986)] =
  29038. 'COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL'),
  29039. (t[(t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798)] =
  29040. 'COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL'),
  29041. (t[(t.COMPRESSED_RGBA_ASTC_4x4_KHR = 37808)] =
  29042. 'COMPRESSED_RGBA_ASTC_4x4_KHR');
  29043. })(HN || (HN = {}));
  29044. var YN =
  29045. (((VN = {})[HN.COMPRESSED_RGB_S3TC_DXT1_EXT] = 0.5),
  29046. (VN[HN.COMPRESSED_RGBA_S3TC_DXT1_EXT] = 0.5),
  29047. (VN[HN.COMPRESSED_RGBA_S3TC_DXT3_EXT] = 1),
  29048. (VN[HN.COMPRESSED_RGBA_S3TC_DXT5_EXT] = 1),
  29049. (VN[HN.COMPRESSED_SRGB_S3TC_DXT1_EXT] = 0.5),
  29050. (VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT] = 0.5),
  29051. (VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT] = 1),
  29052. (VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT] = 1),
  29053. (VN[HN.COMPRESSED_R11_EAC] = 0.5),
  29054. (VN[HN.COMPRESSED_SIGNED_R11_EAC] = 0.5),
  29055. (VN[HN.COMPRESSED_RG11_EAC] = 1),
  29056. (VN[HN.COMPRESSED_SIGNED_RG11_EAC] = 1),
  29057. (VN[HN.COMPRESSED_RGB8_ETC2] = 0.5),
  29058. (VN[HN.COMPRESSED_RGBA8_ETC2_EAC] = 1),
  29059. (VN[HN.COMPRESSED_SRGB8_ETC2] = 0.5),
  29060. (VN[HN.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC] = 1),
  29061. (VN[HN.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5),
  29062. (VN[HN.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5),
  29063. (VN[HN.COMPRESSED_RGB_PVRTC_4BPPV1_IMG] = 0.5),
  29064. (VN[HN.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG] = 0.5),
  29065. (VN[HN.COMPRESSED_RGB_PVRTC_2BPPV1_IMG] = 0.25),
  29066. (VN[HN.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG] = 0.25),
  29067. (VN[HN.COMPRESSED_RGB_ETC1_WEBGL] = 0.5),
  29068. (VN[HN.COMPRESSED_RGB_ATC_WEBGL] = 0.5),
  29069. (VN[HN.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL] = 1),
  29070. (VN[HN.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL] = 1),
  29071. (VN[HN.COMPRESSED_RGBA_ASTC_4x4_KHR] = 1),
  29072. VN),
  29073. zN = function (t, e) {
  29074. return (
  29075. (zN =
  29076. Object.setPrototypeOf ||
  29077. ({ __proto__: [] } instanceof Array &&
  29078. function (t, e) {
  29079. t.__proto__ = e;
  29080. }) ||
  29081. function (t, e) {
  29082. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  29083. }),
  29084. zN(t, e)
  29085. );
  29086. };
  29087. function ZN(t, e) {
  29088. function r() {
  29089. this.constructor = t;
  29090. }
  29091. zN(t, e),
  29092. (t.prototype =
  29093. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  29094. }
  29095. function JN(t, e, r, n) {
  29096. return new (r || (r = Promise))(function (i, o) {
  29097. function s(t) {
  29098. try {
  29099. u(n.next(t));
  29100. } catch (t) {
  29101. o(t);
  29102. }
  29103. }
  29104. function a(t) {
  29105. try {
  29106. u(n.throw(t));
  29107. } catch (t) {
  29108. o(t);
  29109. }
  29110. }
  29111. function u(t) {
  29112. var e;
  29113. t.done
  29114. ? i(t.value)
  29115. : ((e = t.value),
  29116. e instanceof r
  29117. ? e
  29118. : new r(function (t) {
  29119. t(e);
  29120. })).then(s, a);
  29121. }
  29122. u((n = n.apply(t, e || [])).next());
  29123. });
  29124. }
  29125. function KN(t, e) {
  29126. var r,
  29127. n,
  29128. i,
  29129. o,
  29130. s = {
  29131. label: 0,
  29132. sent: function () {
  29133. if (1 & i[0]) throw i[1];
  29134. return i[1];
  29135. },
  29136. trys: [],
  29137. ops: [],
  29138. };
  29139. return (
  29140. (o = { next: a(0), throw: a(1), return: a(2) }),
  29141. 'function' == typeof Symbol &&
  29142. (o[Symbol.iterator] = function () {
  29143. return this;
  29144. }),
  29145. o
  29146. );
  29147. function a(o) {
  29148. return function (a) {
  29149. return (function (o) {
  29150. if (r) throw new TypeError('Generator is already executing.');
  29151. for (; s; )
  29152. try {
  29153. if (
  29154. ((r = 1),
  29155. n &&
  29156. (i =
  29157. 2 & o[0]
  29158. ? n.return
  29159. : o[0]
  29160. ? n.throw || ((i = n.return) && i.call(n), 0)
  29161. : n.next) &&
  29162. !(i = i.call(n, o[1])).done)
  29163. )
  29164. return i;
  29165. switch (((n = 0), i && (o = [2 & o[0], i.value]), o[0])) {
  29166. case 0:
  29167. case 1:
  29168. i = o;
  29169. break;
  29170. case 4:
  29171. return s.label++, { value: o[1], done: !1 };
  29172. case 5:
  29173. s.label++, (n = o[1]), (o = [0]);
  29174. continue;
  29175. case 7:
  29176. (o = s.ops.pop()), s.trys.pop();
  29177. continue;
  29178. default:
  29179. if (
  29180. !((i = s.trys),
  29181. (i = i.length > 0 && i[i.length - 1]) ||
  29182. (6 !== o[0] && 2 !== o[0]))
  29183. ) {
  29184. s = 0;
  29185. continue;
  29186. }
  29187. if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) {
  29188. s.label = o[1];
  29189. break;
  29190. }
  29191. if (6 === o[0] && s.label < i[1]) {
  29192. (s.label = i[1]), (i = o);
  29193. break;
  29194. }
  29195. if (i && s.label < i[2]) {
  29196. (s.label = i[2]), s.ops.push(o);
  29197. break;
  29198. }
  29199. i[2] && s.ops.pop(), s.trys.pop();
  29200. continue;
  29201. }
  29202. o = e.call(t, s);
  29203. } catch (t) {
  29204. (o = [6, t]), (n = 0);
  29205. } finally {
  29206. r = i = 0;
  29207. }
  29208. if (5 & o[0]) throw o[1];
  29209. return { value: o[0] ? o[1] : void 0, done: !0 };
  29210. })([o, a]);
  29211. };
  29212. }
  29213. }
  29214. var qN,
  29215. QN,
  29216. $N = (function (t) {
  29217. function e(e, r) {
  29218. void 0 === r && (r = { width: 1, height: 1, autoLoad: !0 });
  29219. var n,
  29220. i,
  29221. o = this;
  29222. return (
  29223. 'string' == typeof e
  29224. ? ((n = e), (i = new Uint8Array()))
  29225. : ((n = null), (i = e)),
  29226. ((o = t.call(this, i, r) || this).origin = n),
  29227. (o.buffer = i ? new oN(i) : null),
  29228. o.origin && !1 !== r.autoLoad && o.load(),
  29229. i &&
  29230. i.length &&
  29231. ((o.loaded = !0), o.onBlobLoaded(o.buffer.rawBinaryData)),
  29232. o
  29233. );
  29234. }
  29235. return (
  29236. ZN(e, t),
  29237. (e.prototype.onBlobLoaded = function (t) {}),
  29238. (e.prototype.load = function () {
  29239. return JN(this, void 0, Promise, function () {
  29240. var t;
  29241. return KN(this, function (e) {
  29242. switch (e.label) {
  29243. case 0:
  29244. return [4, fetch(this.origin)];
  29245. case 1:
  29246. return [4, e.sent().blob()];
  29247. case 2:
  29248. return [4, e.sent().arrayBuffer()];
  29249. case 3:
  29250. return (
  29251. (t = e.sent()),
  29252. (this.data = new Uint32Array(t)),
  29253. (this.buffer = new oN(t)),
  29254. (this.loaded = !0),
  29255. this.onBlobLoaded(t),
  29256. this.update(),
  29257. [2, this]
  29258. );
  29259. }
  29260. });
  29261. });
  29262. }),
  29263. e
  29264. );
  29265. })(oL),
  29266. tk = (function (t) {
  29267. function e(r, n) {
  29268. var i = t.call(this, r, n) || this;
  29269. return (
  29270. (i.format = n.format),
  29271. (i.levels = n.levels || 1),
  29272. (i._width = n.width),
  29273. (i._height = n.height),
  29274. (i._extension = e._formatToExtension(i.format)),
  29275. (n.levelBuffers || i.buffer) &&
  29276. (i._levelBuffers =
  29277. n.levelBuffers ||
  29278. e._createLevelBuffers(
  29279. r instanceof Uint8Array ? r : i.buffer.uint8View,
  29280. i.format,
  29281. i.levels,
  29282. 4,
  29283. 4,
  29284. i.width,
  29285. i.height
  29286. )),
  29287. i
  29288. );
  29289. }
  29290. return (
  29291. ZN(e, t),
  29292. (e.prototype.upload = function (t, e, r) {
  29293. var n = t.gl;
  29294. if (!t.context.extensions[this._extension])
  29295. throw new Error(
  29296. this._extension +
  29297. ' textures are not supported on the current machine'
  29298. );
  29299. if (!this._levelBuffers) return !1;
  29300. for (var i = 0, o = this.levels; i < o; i++) {
  29301. var s = this._levelBuffers[i],
  29302. a = s.levelID,
  29303. u = s.levelWidth,
  29304. c = s.levelHeight,
  29305. h = s.levelBuffer;
  29306. n.compressedTexImage2D(n.TEXTURE_2D, a, this.format, u, c, 0, h);
  29307. }
  29308. return !0;
  29309. }),
  29310. (e.prototype.onBlobLoaded = function () {
  29311. this._levelBuffers = e._createLevelBuffers(
  29312. this.buffer.uint8View,
  29313. this.format,
  29314. this.levels,
  29315. 4,
  29316. 4,
  29317. this.width,
  29318. this.height
  29319. );
  29320. }),
  29321. (e._formatToExtension = function (t) {
  29322. if (t >= 33776 && t <= 33779) return 's3tc';
  29323. if (t >= 37488 && t <= 37497) return 'etc';
  29324. if (t >= 35840 && t <= 35843) return 'pvrtc';
  29325. if (t >= 36196) return 'etc1';
  29326. if (t >= 35986 && t <= 34798) return 'atc';
  29327. throw new Error('Invalid (compressed) texture format given!');
  29328. }),
  29329. (e._createLevelBuffers = function (t, e, r, n, i, o, s) {
  29330. for (
  29331. var a = new Array(r),
  29332. u = t.byteOffset,
  29333. c = o,
  29334. h = s,
  29335. l = (c + n - 1) & ~(n - 1),
  29336. d = (h + i - 1) & ~(i - 1),
  29337. f = l * d * YN[e],
  29338. p = 0;
  29339. p < r;
  29340. p++
  29341. )
  29342. (a[p] = {
  29343. levelID: p,
  29344. levelWidth: r > 1 ? c : l,
  29345. levelHeight: r > 1 ? h : d,
  29346. levelBuffer: new Uint8Array(t.buffer, u, f),
  29347. }),
  29348. (u += f),
  29349. (f =
  29350. (l = ((c = c >> 1 || 1) + n - 1) & ~(n - 1)) *
  29351. (d = ((h = h >> 1 || 1) + i - 1) & ~(i - 1)) *
  29352. YN[e]);
  29353. return a;
  29354. }),
  29355. e
  29356. );
  29357. })($N),
  29358. ek = (function () {
  29359. function t() {}
  29360. return (
  29361. (t.use = function (e, r) {
  29362. var n = e.data;
  29363. if (e.type === DN.TYPE.JSON && n && n.cacheID && n.textures) {
  29364. for (
  29365. var i = n.textures, o = void 0, s = void 0, a = 0, u = i.length;
  29366. a < u;
  29367. a++
  29368. ) {
  29369. var c = i[a],
  29370. h = c.src,
  29371. l = c.format;
  29372. if ((l || (s = h), t.textureFormats[l])) {
  29373. o = h;
  29374. break;
  29375. }
  29376. }
  29377. if (!(o = o || s))
  29378. return void r(
  29379. new Error(
  29380. 'Cannot load compressed-textures in ' +
  29381. e.url +
  29382. ', make sure you provide a fallback'
  29383. )
  29384. );
  29385. if (o === e.url)
  29386. return void r(
  29387. new Error(
  29388. "URL of compressed texture cannot be the same as the manifest's URL"
  29389. )
  29390. );
  29391. var d = {
  29392. crossOrigin: e.crossOrigin,
  29393. metadata: e.metadata.imageMetadata,
  29394. parentResource: e,
  29395. },
  29396. f = GM.resolve(e.url.replace(this.baseUrl, ''), o),
  29397. p = n.cacheID;
  29398. this.add(p, f, d, function (t) {
  29399. if (t.error) r(t.error);
  29400. else {
  29401. var n = t.texture,
  29402. i = void 0 === n ? null : n,
  29403. o = t.textures,
  29404. s = void 0 === o ? {} : o;
  29405. Object.assign(e, { texture: i, textures: s }), r();
  29406. }
  29407. });
  29408. } else r();
  29409. }),
  29410. Object.defineProperty(t, 'textureExtensions', {
  29411. get: function () {
  29412. if (!t._textureExtensions) {
  29413. var e = vA.ADAPTER.createCanvas().getContext('webgl');
  29414. if (!e)
  29415. return (
  29416. console.warn(
  29417. 'WebGL not available for compressed textures. Silently failing.'
  29418. ),
  29419. {}
  29420. );
  29421. var r = {
  29422. s3tc: e.getExtension('WEBGL_compressed_texture_s3tc'),
  29423. s3tc_sRGB: e.getExtension('WEBGL_compressed_texture_s3tc_srgb'),
  29424. etc: e.getExtension('WEBGL_compressed_texture_etc'),
  29425. etc1: e.getExtension('WEBGL_compressed_texture_etc1'),
  29426. pvrtc:
  29427. e.getExtension('WEBGL_compressed_texture_pvrtc') ||
  29428. e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),
  29429. atc: e.getExtension('WEBGL_compressed_texture_atc'),
  29430. astc: e.getExtension('WEBGL_compressed_texture_astc'),
  29431. };
  29432. t._textureExtensions = r;
  29433. }
  29434. return t._textureExtensions;
  29435. },
  29436. enumerable: !1,
  29437. configurable: !0,
  29438. }),
  29439. Object.defineProperty(t, 'textureFormats', {
  29440. get: function () {
  29441. if (!t._textureFormats) {
  29442. var e = t.textureExtensions;
  29443. for (var r in ((t._textureFormats = {}), e)) {
  29444. var n = e[r];
  29445. n && Object.assign(t._textureFormats, Object.getPrototypeOf(n));
  29446. }
  29447. }
  29448. return t._textureFormats;
  29449. },
  29450. enumerable: !1,
  29451. configurable: !0,
  29452. }),
  29453. (t.extension = HD.Loader),
  29454. t
  29455. );
  29456. })();
  29457. function rk(t, e, r) {
  29458. var n = { textures: {}, texture: null };
  29459. return e
  29460. ? (e
  29461. .map(function (t) {
  29462. return new EL(
  29463. new aL(
  29464. t,
  29465. Object.assign(
  29466. { mipmap: BP.OFF, alphaMode: GP.NO_PREMULTIPLIED_ALPHA },
  29467. r
  29468. )
  29469. )
  29470. );
  29471. })
  29472. .forEach(function (e, r) {
  29473. var i = e.baseTexture,
  29474. o = t + '-' + (r + 1);
  29475. aL.addToCache(i, o),
  29476. EL.addToCache(e, o),
  29477. 0 === r &&
  29478. (aL.addToCache(i, t), EL.addToCache(e, t), (n.texture = e)),
  29479. (n.textures[o] = e);
  29480. }),
  29481. n)
  29482. : n;
  29483. }
  29484. var nk,
  29485. ik,
  29486. ok = 124,
  29487. sk = 3,
  29488. ak = 4,
  29489. uk = 7,
  29490. ck = 19,
  29491. hk = 2,
  29492. lk = 0,
  29493. dk = 1,
  29494. fk = 2,
  29495. pk = 3;
  29496. !(function (t) {
  29497. (t[(t.DXGI_FORMAT_UNKNOWN = 0)] = 'DXGI_FORMAT_UNKNOWN'),
  29498. (t[(t.DXGI_FORMAT_R32G32B32A32_TYPELESS = 1)] =
  29499. 'DXGI_FORMAT_R32G32B32A32_TYPELESS'),
  29500. (t[(t.DXGI_FORMAT_R32G32B32A32_FLOAT = 2)] =
  29501. 'DXGI_FORMAT_R32G32B32A32_FLOAT'),
  29502. (t[(t.DXGI_FORMAT_R32G32B32A32_UINT = 3)] =
  29503. 'DXGI_FORMAT_R32G32B32A32_UINT'),
  29504. (t[(t.DXGI_FORMAT_R32G32B32A32_SINT = 4)] =
  29505. 'DXGI_FORMAT_R32G32B32A32_SINT'),
  29506. (t[(t.DXGI_FORMAT_R32G32B32_TYPELESS = 5)] =
  29507. 'DXGI_FORMAT_R32G32B32_TYPELESS'),
  29508. (t[(t.DXGI_FORMAT_R32G32B32_FLOAT = 6)] = 'DXGI_FORMAT_R32G32B32_FLOAT'),
  29509. (t[(t.DXGI_FORMAT_R32G32B32_UINT = 7)] = 'DXGI_FORMAT_R32G32B32_UINT'),
  29510. (t[(t.DXGI_FORMAT_R32G32B32_SINT = 8)] = 'DXGI_FORMAT_R32G32B32_SINT'),
  29511. (t[(t.DXGI_FORMAT_R16G16B16A16_TYPELESS = 9)] =
  29512. 'DXGI_FORMAT_R16G16B16A16_TYPELESS'),
  29513. (t[(t.DXGI_FORMAT_R16G16B16A16_FLOAT = 10)] =
  29514. 'DXGI_FORMAT_R16G16B16A16_FLOAT'),
  29515. (t[(t.DXGI_FORMAT_R16G16B16A16_UNORM = 11)] =
  29516. 'DXGI_FORMAT_R16G16B16A16_UNORM'),
  29517. (t[(t.DXGI_FORMAT_R16G16B16A16_UINT = 12)] =
  29518. 'DXGI_FORMAT_R16G16B16A16_UINT'),
  29519. (t[(t.DXGI_FORMAT_R16G16B16A16_SNORM = 13)] =
  29520. 'DXGI_FORMAT_R16G16B16A16_SNORM'),
  29521. (t[(t.DXGI_FORMAT_R16G16B16A16_SINT = 14)] =
  29522. 'DXGI_FORMAT_R16G16B16A16_SINT'),
  29523. (t[(t.DXGI_FORMAT_R32G32_TYPELESS = 15)] = 'DXGI_FORMAT_R32G32_TYPELESS'),
  29524. (t[(t.DXGI_FORMAT_R32G32_FLOAT = 16)] = 'DXGI_FORMAT_R32G32_FLOAT'),
  29525. (t[(t.DXGI_FORMAT_R32G32_UINT = 17)] = 'DXGI_FORMAT_R32G32_UINT'),
  29526. (t[(t.DXGI_FORMAT_R32G32_SINT = 18)] = 'DXGI_FORMAT_R32G32_SINT'),
  29527. (t[(t.DXGI_FORMAT_R32G8X24_TYPELESS = 19)] =
  29528. 'DXGI_FORMAT_R32G8X24_TYPELESS'),
  29529. (t[(t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20)] =
  29530. 'DXGI_FORMAT_D32_FLOAT_S8X24_UINT'),
  29531. (t[(t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21)] =
  29532. 'DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS'),
  29533. (t[(t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22)] =
  29534. 'DXGI_FORMAT_X32_TYPELESS_G8X24_UINT'),
  29535. (t[(t.DXGI_FORMAT_R10G10B10A2_TYPELESS = 23)] =
  29536. 'DXGI_FORMAT_R10G10B10A2_TYPELESS'),
  29537. (t[(t.DXGI_FORMAT_R10G10B10A2_UNORM = 24)] =
  29538. 'DXGI_FORMAT_R10G10B10A2_UNORM'),
  29539. (t[(t.DXGI_FORMAT_R10G10B10A2_UINT = 25)] =
  29540. 'DXGI_FORMAT_R10G10B10A2_UINT'),
  29541. (t[(t.DXGI_FORMAT_R11G11B10_FLOAT = 26)] = 'DXGI_FORMAT_R11G11B10_FLOAT'),
  29542. (t[(t.DXGI_FORMAT_R8G8B8A8_TYPELESS = 27)] =
  29543. 'DXGI_FORMAT_R8G8B8A8_TYPELESS'),
  29544. (t[(t.DXGI_FORMAT_R8G8B8A8_UNORM = 28)] = 'DXGI_FORMAT_R8G8B8A8_UNORM'),
  29545. (t[(t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29)] =
  29546. 'DXGI_FORMAT_R8G8B8A8_UNORM_SRGB'),
  29547. (t[(t.DXGI_FORMAT_R8G8B8A8_UINT = 30)] = 'DXGI_FORMAT_R8G8B8A8_UINT'),
  29548. (t[(t.DXGI_FORMAT_R8G8B8A8_SNORM = 31)] = 'DXGI_FORMAT_R8G8B8A8_SNORM'),
  29549. (t[(t.DXGI_FORMAT_R8G8B8A8_SINT = 32)] = 'DXGI_FORMAT_R8G8B8A8_SINT'),
  29550. (t[(t.DXGI_FORMAT_R16G16_TYPELESS = 33)] = 'DXGI_FORMAT_R16G16_TYPELESS'),
  29551. (t[(t.DXGI_FORMAT_R16G16_FLOAT = 34)] = 'DXGI_FORMAT_R16G16_FLOAT'),
  29552. (t[(t.DXGI_FORMAT_R16G16_UNORM = 35)] = 'DXGI_FORMAT_R16G16_UNORM'),
  29553. (t[(t.DXGI_FORMAT_R16G16_UINT = 36)] = 'DXGI_FORMAT_R16G16_UINT'),
  29554. (t[(t.DXGI_FORMAT_R16G16_SNORM = 37)] = 'DXGI_FORMAT_R16G16_SNORM'),
  29555. (t[(t.DXGI_FORMAT_R16G16_SINT = 38)] = 'DXGI_FORMAT_R16G16_SINT'),
  29556. (t[(t.DXGI_FORMAT_R32_TYPELESS = 39)] = 'DXGI_FORMAT_R32_TYPELESS'),
  29557. (t[(t.DXGI_FORMAT_D32_FLOAT = 40)] = 'DXGI_FORMAT_D32_FLOAT'),
  29558. (t[(t.DXGI_FORMAT_R32_FLOAT = 41)] = 'DXGI_FORMAT_R32_FLOAT'),
  29559. (t[(t.DXGI_FORMAT_R32_UINT = 42)] = 'DXGI_FORMAT_R32_UINT'),
  29560. (t[(t.DXGI_FORMAT_R32_SINT = 43)] = 'DXGI_FORMAT_R32_SINT'),
  29561. (t[(t.DXGI_FORMAT_R24G8_TYPELESS = 44)] = 'DXGI_FORMAT_R24G8_TYPELESS'),
  29562. (t[(t.DXGI_FORMAT_D24_UNORM_S8_UINT = 45)] =
  29563. 'DXGI_FORMAT_D24_UNORM_S8_UINT'),
  29564. (t[(t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46)] =
  29565. 'DXGI_FORMAT_R24_UNORM_X8_TYPELESS'),
  29566. (t[(t.DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47)] =
  29567. 'DXGI_FORMAT_X24_TYPELESS_G8_UINT'),
  29568. (t[(t.DXGI_FORMAT_R8G8_TYPELESS = 48)] = 'DXGI_FORMAT_R8G8_TYPELESS'),
  29569. (t[(t.DXGI_FORMAT_R8G8_UNORM = 49)] = 'DXGI_FORMAT_R8G8_UNORM'),
  29570. (t[(t.DXGI_FORMAT_R8G8_UINT = 50)] = 'DXGI_FORMAT_R8G8_UINT'),
  29571. (t[(t.DXGI_FORMAT_R8G8_SNORM = 51)] = 'DXGI_FORMAT_R8G8_SNORM'),
  29572. (t[(t.DXGI_FORMAT_R8G8_SINT = 52)] = 'DXGI_FORMAT_R8G8_SINT'),
  29573. (t[(t.DXGI_FORMAT_R16_TYPELESS = 53)] = 'DXGI_FORMAT_R16_TYPELESS'),
  29574. (t[(t.DXGI_FORMAT_R16_FLOAT = 54)] = 'DXGI_FORMAT_R16_FLOAT'),
  29575. (t[(t.DXGI_FORMAT_D16_UNORM = 55)] = 'DXGI_FORMAT_D16_UNORM'),
  29576. (t[(t.DXGI_FORMAT_R16_UNORM = 56)] = 'DXGI_FORMAT_R16_UNORM'),
  29577. (t[(t.DXGI_FORMAT_R16_UINT = 57)] = 'DXGI_FORMAT_R16_UINT'),
  29578. (t[(t.DXGI_FORMAT_R16_SNORM = 58)] = 'DXGI_FORMAT_R16_SNORM'),
  29579. (t[(t.DXGI_FORMAT_R16_SINT = 59)] = 'DXGI_FORMAT_R16_SINT'),
  29580. (t[(t.DXGI_FORMAT_R8_TYPELESS = 60)] = 'DXGI_FORMAT_R8_TYPELESS'),
  29581. (t[(t.DXGI_FORMAT_R8_UNORM = 61)] = 'DXGI_FORMAT_R8_UNORM'),
  29582. (t[(t.DXGI_FORMAT_R8_UINT = 62)] = 'DXGI_FORMAT_R8_UINT'),
  29583. (t[(t.DXGI_FORMAT_R8_SNORM = 63)] = 'DXGI_FORMAT_R8_SNORM'),
  29584. (t[(t.DXGI_FORMAT_R8_SINT = 64)] = 'DXGI_FORMAT_R8_SINT'),
  29585. (t[(t.DXGI_FORMAT_A8_UNORM = 65)] = 'DXGI_FORMAT_A8_UNORM'),
  29586. (t[(t.DXGI_FORMAT_R1_UNORM = 66)] = 'DXGI_FORMAT_R1_UNORM'),
  29587. (t[(t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67)] =
  29588. 'DXGI_FORMAT_R9G9B9E5_SHAREDEXP'),
  29589. (t[(t.DXGI_FORMAT_R8G8_B8G8_UNORM = 68)] = 'DXGI_FORMAT_R8G8_B8G8_UNORM'),
  29590. (t[(t.DXGI_FORMAT_G8R8_G8B8_UNORM = 69)] = 'DXGI_FORMAT_G8R8_G8B8_UNORM'),
  29591. (t[(t.DXGI_FORMAT_BC1_TYPELESS = 70)] = 'DXGI_FORMAT_BC1_TYPELESS'),
  29592. (t[(t.DXGI_FORMAT_BC1_UNORM = 71)] = 'DXGI_FORMAT_BC1_UNORM'),
  29593. (t[(t.DXGI_FORMAT_BC1_UNORM_SRGB = 72)] = 'DXGI_FORMAT_BC1_UNORM_SRGB'),
  29594. (t[(t.DXGI_FORMAT_BC2_TYPELESS = 73)] = 'DXGI_FORMAT_BC2_TYPELESS'),
  29595. (t[(t.DXGI_FORMAT_BC2_UNORM = 74)] = 'DXGI_FORMAT_BC2_UNORM'),
  29596. (t[(t.DXGI_FORMAT_BC2_UNORM_SRGB = 75)] = 'DXGI_FORMAT_BC2_UNORM_SRGB'),
  29597. (t[(t.DXGI_FORMAT_BC3_TYPELESS = 76)] = 'DXGI_FORMAT_BC3_TYPELESS'),
  29598. (t[(t.DXGI_FORMAT_BC3_UNORM = 77)] = 'DXGI_FORMAT_BC3_UNORM'),
  29599. (t[(t.DXGI_FORMAT_BC3_UNORM_SRGB = 78)] = 'DXGI_FORMAT_BC3_UNORM_SRGB'),
  29600. (t[(t.DXGI_FORMAT_BC4_TYPELESS = 79)] = 'DXGI_FORMAT_BC4_TYPELESS'),
  29601. (t[(t.DXGI_FORMAT_BC4_UNORM = 80)] = 'DXGI_FORMAT_BC4_UNORM'),
  29602. (t[(t.DXGI_FORMAT_BC4_SNORM = 81)] = 'DXGI_FORMAT_BC4_SNORM'),
  29603. (t[(t.DXGI_FORMAT_BC5_TYPELESS = 82)] = 'DXGI_FORMAT_BC5_TYPELESS'),
  29604. (t[(t.DXGI_FORMAT_BC5_UNORM = 83)] = 'DXGI_FORMAT_BC5_UNORM'),
  29605. (t[(t.DXGI_FORMAT_BC5_SNORM = 84)] = 'DXGI_FORMAT_BC5_SNORM'),
  29606. (t[(t.DXGI_FORMAT_B5G6R5_UNORM = 85)] = 'DXGI_FORMAT_B5G6R5_UNORM'),
  29607. (t[(t.DXGI_FORMAT_B5G5R5A1_UNORM = 86)] = 'DXGI_FORMAT_B5G5R5A1_UNORM'),
  29608. (t[(t.DXGI_FORMAT_B8G8R8A8_UNORM = 87)] = 'DXGI_FORMAT_B8G8R8A8_UNORM'),
  29609. (t[(t.DXGI_FORMAT_B8G8R8X8_UNORM = 88)] = 'DXGI_FORMAT_B8G8R8X8_UNORM'),
  29610. (t[(t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89)] =
  29611. 'DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM'),
  29612. (t[(t.DXGI_FORMAT_B8G8R8A8_TYPELESS = 90)] =
  29613. 'DXGI_FORMAT_B8G8R8A8_TYPELESS'),
  29614. (t[(t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91)] =
  29615. 'DXGI_FORMAT_B8G8R8A8_UNORM_SRGB'),
  29616. (t[(t.DXGI_FORMAT_B8G8R8X8_TYPELESS = 92)] =
  29617. 'DXGI_FORMAT_B8G8R8X8_TYPELESS'),
  29618. (t[(t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93)] =
  29619. 'DXGI_FORMAT_B8G8R8X8_UNORM_SRGB'),
  29620. (t[(t.DXGI_FORMAT_BC6H_TYPELESS = 94)] = 'DXGI_FORMAT_BC6H_TYPELESS'),
  29621. (t[(t.DXGI_FORMAT_BC6H_UF16 = 95)] = 'DXGI_FORMAT_BC6H_UF16'),
  29622. (t[(t.DXGI_FORMAT_BC6H_SF16 = 96)] = 'DXGI_FORMAT_BC6H_SF16'),
  29623. (t[(t.DXGI_FORMAT_BC7_TYPELESS = 97)] = 'DXGI_FORMAT_BC7_TYPELESS'),
  29624. (t[(t.DXGI_FORMAT_BC7_UNORM = 98)] = 'DXGI_FORMAT_BC7_UNORM'),
  29625. (t[(t.DXGI_FORMAT_BC7_UNORM_SRGB = 99)] = 'DXGI_FORMAT_BC7_UNORM_SRGB'),
  29626. (t[(t.DXGI_FORMAT_AYUV = 100)] = 'DXGI_FORMAT_AYUV'),
  29627. (t[(t.DXGI_FORMAT_Y410 = 101)] = 'DXGI_FORMAT_Y410'),
  29628. (t[(t.DXGI_FORMAT_Y416 = 102)] = 'DXGI_FORMAT_Y416'),
  29629. (t[(t.DXGI_FORMAT_NV12 = 103)] = 'DXGI_FORMAT_NV12'),
  29630. (t[(t.DXGI_FORMAT_P010 = 104)] = 'DXGI_FORMAT_P010'),
  29631. (t[(t.DXGI_FORMAT_P016 = 105)] = 'DXGI_FORMAT_P016'),
  29632. (t[(t.DXGI_FORMAT_420_OPAQUE = 106)] = 'DXGI_FORMAT_420_OPAQUE'),
  29633. (t[(t.DXGI_FORMAT_YUY2 = 107)] = 'DXGI_FORMAT_YUY2'),
  29634. (t[(t.DXGI_FORMAT_Y210 = 108)] = 'DXGI_FORMAT_Y210'),
  29635. (t[(t.DXGI_FORMAT_Y216 = 109)] = 'DXGI_FORMAT_Y216'),
  29636. (t[(t.DXGI_FORMAT_NV11 = 110)] = 'DXGI_FORMAT_NV11'),
  29637. (t[(t.DXGI_FORMAT_AI44 = 111)] = 'DXGI_FORMAT_AI44'),
  29638. (t[(t.DXGI_FORMAT_IA44 = 112)] = 'DXGI_FORMAT_IA44'),
  29639. (t[(t.DXGI_FORMAT_P8 = 113)] = 'DXGI_FORMAT_P8'),
  29640. (t[(t.DXGI_FORMAT_A8P8 = 114)] = 'DXGI_FORMAT_A8P8'),
  29641. (t[(t.DXGI_FORMAT_B4G4R4A4_UNORM = 115)] = 'DXGI_FORMAT_B4G4R4A4_UNORM'),
  29642. (t[(t.DXGI_FORMAT_P208 = 116)] = 'DXGI_FORMAT_P208'),
  29643. (t[(t.DXGI_FORMAT_V208 = 117)] = 'DXGI_FORMAT_V208'),
  29644. (t[(t.DXGI_FORMAT_V408 = 118)] = 'DXGI_FORMAT_V408'),
  29645. (t[(t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 119)] =
  29646. 'DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE'),
  29647. (t[(t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 120)] =
  29648. 'DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE'),
  29649. (t[(t.DXGI_FORMAT_FORCE_UINT = 121)] = 'DXGI_FORMAT_FORCE_UINT');
  29650. })(nk || (nk = {})),
  29651. (function (t) {
  29652. (t[(t.DDS_DIMENSION_TEXTURE1D = 2)] = 'DDS_DIMENSION_TEXTURE1D'),
  29653. (t[(t.DDS_DIMENSION_TEXTURE2D = 3)] = 'DDS_DIMENSION_TEXTURE2D'),
  29654. (t[(t.DDS_DIMENSION_TEXTURE3D = 6)] = 'DDS_DIMENSION_TEXTURE3D');
  29655. })(ik || (ik = {}));
  29656. var vk,
  29657. mk,
  29658. yk,
  29659. gk =
  29660. (((qN = {})[827611204] = HN.COMPRESSED_RGBA_S3TC_DXT1_EXT),
  29661. (qN[861165636] = HN.COMPRESSED_RGBA_S3TC_DXT3_EXT),
  29662. (qN[894720068] = HN.COMPRESSED_RGBA_S3TC_DXT5_EXT),
  29663. qN),
  29664. _k =
  29665. (((QN = {})[nk.DXGI_FORMAT_BC1_TYPELESS] =
  29666. HN.COMPRESSED_RGBA_S3TC_DXT1_EXT),
  29667. (QN[nk.DXGI_FORMAT_BC1_UNORM] = HN.COMPRESSED_RGBA_S3TC_DXT1_EXT),
  29668. (QN[nk.DXGI_FORMAT_BC2_TYPELESS] = HN.COMPRESSED_RGBA_S3TC_DXT3_EXT),
  29669. (QN[nk.DXGI_FORMAT_BC2_UNORM] = HN.COMPRESSED_RGBA_S3TC_DXT3_EXT),
  29670. (QN[nk.DXGI_FORMAT_BC3_TYPELESS] = HN.COMPRESSED_RGBA_S3TC_DXT5_EXT),
  29671. (QN[nk.DXGI_FORMAT_BC3_UNORM] = HN.COMPRESSED_RGBA_S3TC_DXT5_EXT),
  29672. (QN[nk.DXGI_FORMAT_BC1_UNORM_SRGB] =
  29673. HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT),
  29674. (QN[nk.DXGI_FORMAT_BC2_UNORM_SRGB] =
  29675. HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT),
  29676. (QN[nk.DXGI_FORMAT_BC3_UNORM_SRGB] =
  29677. HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),
  29678. QN);
  29679. var bk = [171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10],
  29680. Tk = 12,
  29681. xk = 16,
  29682. Ek = 24,
  29683. Sk = 28,
  29684. wk = 36,
  29685. Rk = 40,
  29686. Ck = 44,
  29687. Pk = 48,
  29688. Ak = 52,
  29689. Ok = 56,
  29690. Ik = 60,
  29691. Mk =
  29692. (((vk = {})[LP.UNSIGNED_BYTE] = 1),
  29693. (vk[LP.UNSIGNED_SHORT] = 2),
  29694. (vk[LP.INT] = 4),
  29695. (vk[LP.UNSIGNED_INT] = 4),
  29696. (vk[LP.FLOAT] = 4),
  29697. (vk[LP.HALF_FLOAT] = 8),
  29698. vk),
  29699. Dk =
  29700. (((mk = {})[MP.RGBA] = 4),
  29701. (mk[MP.RGB] = 3),
  29702. (mk[MP.RG] = 2),
  29703. (mk[MP.RED] = 1),
  29704. (mk[MP.LUMINANCE] = 1),
  29705. (mk[MP.LUMINANCE_ALPHA] = 2),
  29706. (mk[MP.ALPHA] = 1),
  29707. mk),
  29708. Lk =
  29709. (((yk = {})[LP.UNSIGNED_SHORT_4_4_4_4] = 2),
  29710. (yk[LP.UNSIGNED_SHORT_5_5_5_1] = 2),
  29711. (yk[LP.UNSIGNED_SHORT_5_6_5] = 2),
  29712. yk);
  29713. function Fk(t, e, r) {
  29714. void 0 === r && (r = !1);
  29715. var n = new DataView(e);
  29716. if (
  29717. !(function (t, e) {
  29718. for (var r = 0; r < bk.length; r++)
  29719. if (e.getUint8(r) !== bk[r])
  29720. return console.error(t + ' is not a valid *.ktx file!'), !1;
  29721. return !0;
  29722. })(t, n)
  29723. )
  29724. return null;
  29725. var i = 67305985 === n.getUint32(Tk, !0),
  29726. o = n.getUint32(xk, i),
  29727. s = n.getUint32(Ek, i),
  29728. a = n.getUint32(Sk, i),
  29729. u = n.getUint32(wk, i),
  29730. c = n.getUint32(Rk, i) || 1,
  29731. h = n.getUint32(Ck, i) || 1,
  29732. l = n.getUint32(Pk, i) || 1,
  29733. d = n.getUint32(Ak, i),
  29734. f = n.getUint32(Ok, i),
  29735. p = n.getUint32(Ik, i);
  29736. if (0 === c || 1 !== h) throw new Error('Only 2D textures are supported');
  29737. if (1 !== d)
  29738. throw new Error('CubeTextures are not supported by KTXLoader yet!');
  29739. if (1 !== l) throw new Error('WebGL does not support array textures');
  29740. var v,
  29741. m = (u + 3) & -4,
  29742. y = (c + 3) & -4,
  29743. g = new Array(l),
  29744. _ = u * c;
  29745. if (
  29746. (0 === o && (_ = m * y),
  29747. void 0 === (v = 0 !== o ? (Mk[o] ? Mk[o] * Dk[s] : Lk[o]) : YN[a]))
  29748. )
  29749. throw new Error(
  29750. 'Unable to resolve the pixel format stored in the *.ktx file!'
  29751. );
  29752. for (
  29753. var b = r
  29754. ? (function (t, e, r) {
  29755. var n = new Map(),
  29756. i = 0;
  29757. for (; i < e; ) {
  29758. var o = t.getUint32(64 + i, r),
  29759. s = 64 + i + 4,
  29760. a = 3 - ((o + 3) % 4);
  29761. if (0 === o || o > e - i) {
  29762. console.error('KTXLoader: keyAndValueByteSize out of bounds');
  29763. break;
  29764. }
  29765. for (var u = 0; u < o && 0 !== t.getUint8(s + u); u++);
  29766. if (-1 === u) {
  29767. console.error(
  29768. 'KTXLoader: Failed to find null byte terminating kvData key'
  29769. );
  29770. break;
  29771. }
  29772. var c = new TextDecoder().decode(
  29773. new Uint8Array(t.buffer, s, u)
  29774. ),
  29775. h = new DataView(t.buffer, s + u + 1, o - u - 1);
  29776. n.set(c, h), (i += 4 + o + a);
  29777. }
  29778. return n;
  29779. })(n, p, i)
  29780. : null,
  29781. T = _ * v,
  29782. x = u,
  29783. E = c,
  29784. S = m,
  29785. w = y,
  29786. R = 64 + p,
  29787. C = 0;
  29788. C < f;
  29789. C++
  29790. ) {
  29791. for (var P = n.getUint32(R, i), A = R + 4, O = 0; O < l; O++) {
  29792. var I = g[O];
  29793. I || (I = g[O] = new Array(f)),
  29794. (I[C] = {
  29795. levelID: C,
  29796. levelWidth: f > 1 || 0 !== o ? x : S,
  29797. levelHeight: f > 1 || 0 !== o ? E : w,
  29798. levelBuffer: new Uint8Array(e, A, T),
  29799. }),
  29800. (A += T);
  29801. }
  29802. (R = (R += P + 4) % 4 != 0 ? R + 4 - (R % 4) : R),
  29803. (T =
  29804. (S = ((x = x >> 1 || 1) + 4 - 1) & -4) *
  29805. (w = ((E = E >> 1 || 1) + 4 - 1) & -4) *
  29806. v);
  29807. }
  29808. return 0 !== o
  29809. ? {
  29810. uncompressed: g.map(function (t) {
  29811. var e = t[0].levelBuffer,
  29812. r = !1;
  29813. return (
  29814. o === LP.FLOAT
  29815. ? (e = new Float32Array(
  29816. t[0].levelBuffer.buffer,
  29817. t[0].levelBuffer.byteOffset,
  29818. t[0].levelBuffer.byteLength / 4
  29819. ))
  29820. : o === LP.UNSIGNED_INT
  29821. ? ((r = !0),
  29822. (e = new Uint32Array(
  29823. t[0].levelBuffer.buffer,
  29824. t[0].levelBuffer.byteOffset,
  29825. t[0].levelBuffer.byteLength / 4
  29826. )))
  29827. : o === LP.INT &&
  29828. ((r = !0),
  29829. (e = new Int32Array(
  29830. t[0].levelBuffer.buffer,
  29831. t[0].levelBuffer.byteOffset,
  29832. t[0].levelBuffer.byteLength / 4
  29833. ))),
  29834. {
  29835. resource: new oL(e, {
  29836. width: t[0].levelWidth,
  29837. height: t[0].levelHeight,
  29838. }),
  29839. type: o,
  29840. format: r ? Nk(s) : s,
  29841. }
  29842. );
  29843. }),
  29844. kvData: b,
  29845. }
  29846. : {
  29847. compressed: g.map(function (t) {
  29848. return new tk(null, {
  29849. format: a,
  29850. width: u,
  29851. height: c,
  29852. levels: f,
  29853. levelBuffers: t,
  29854. });
  29855. }),
  29856. kvData: b,
  29857. };
  29858. }
  29859. function Nk(t) {
  29860. switch (t) {
  29861. case MP.RGBA:
  29862. return MP.RGBA_INTEGER;
  29863. case MP.RGB:
  29864. return MP.RGB_INTEGER;
  29865. case MP.RG:
  29866. return MP.RG_INTEGER;
  29867. case MP.RED:
  29868. return MP.RED_INTEGER;
  29869. default:
  29870. return t;
  29871. }
  29872. }
  29873. DN.setExtensionXhrType('dds', DN.XHR_RESPONSE_TYPE.BUFFER);
  29874. var kk = (function () {
  29875. function t() {}
  29876. return (
  29877. (t.use = function (t, e) {
  29878. if ('dds' === t.extension && t.data)
  29879. try {
  29880. Object.assign(
  29881. t,
  29882. rk(
  29883. t.name || t.url,
  29884. (function (t) {
  29885. var e = new Uint32Array(t);
  29886. if (542327876 !== e[0])
  29887. throw new Error('Invalid DDS file magic word');
  29888. var r = new Uint32Array(
  29889. t,
  29890. 0,
  29891. ok / Uint32Array.BYTES_PER_ELEMENT
  29892. ),
  29893. n = r[sk],
  29894. i = r[ak],
  29895. o = r[uk],
  29896. s = new Uint32Array(
  29897. t,
  29898. ck * Uint32Array.BYTES_PER_ELEMENT,
  29899. 32 / Uint32Array.BYTES_PER_ELEMENT
  29900. ),
  29901. a = s[1];
  29902. if (4 & a) {
  29903. var u = s[hk];
  29904. if (808540228 !== u) {
  29905. var c = gk[u],
  29906. h = new Uint8Array(t, 128);
  29907. return [
  29908. new tk(h, {
  29909. format: c,
  29910. width: i,
  29911. height: n,
  29912. levels: o,
  29913. }),
  29914. ];
  29915. }
  29916. var l = new Uint32Array(
  29917. e.buffer,
  29918. 128,
  29919. 20 / Uint32Array.BYTES_PER_ELEMENT
  29920. ),
  29921. d = l[lk],
  29922. f = l[dk],
  29923. p = l[fk],
  29924. v = l[pk],
  29925. m = _k[d];
  29926. if (void 0 === m)
  29927. throw new Error(
  29928. 'DDSParser cannot parse texture data with DXGI format ' +
  29929. d
  29930. );
  29931. if (4 === p)
  29932. throw new Error(
  29933. 'DDSParser does not support cubemap textures'
  29934. );
  29935. if (f === ik.DDS_DIMENSION_TEXTURE3D)
  29936. throw new Error(
  29937. 'DDSParser does not supported 3D texture data'
  29938. );
  29939. var y = new Array();
  29940. if (1 === v) y.push(new Uint8Array(t, 148));
  29941. else {
  29942. for (
  29943. var g = YN[m], _ = 0, b = i, T = n, x = 0;
  29944. x < o;
  29945. x++
  29946. )
  29947. (_ +=
  29948. Math.max(1, (b + 3) & -4) *
  29949. Math.max(1, (T + 3) & -4) *
  29950. g),
  29951. (b >>>= 1),
  29952. (T >>>= 1);
  29953. var E = 148;
  29954. for (x = 0; x < v; x++)
  29955. y.push(new Uint8Array(t, E, _)), (E += _);
  29956. }
  29957. return y.map(function (t) {
  29958. return new tk(t, {
  29959. format: m,
  29960. width: i,
  29961. height: n,
  29962. levels: o,
  29963. });
  29964. });
  29965. }
  29966. if (64 & a)
  29967. throw new Error(
  29968. 'DDSParser does not support uncompressed texture data.'
  29969. );
  29970. if (512 & a)
  29971. throw new Error(
  29972. 'DDSParser does not supported YUV uncompressed texture data.'
  29973. );
  29974. if (131072 & a)
  29975. throw new Error(
  29976. 'DDSParser does not support single-channel (lumninance) texture data!'
  29977. );
  29978. if (2 & a)
  29979. throw new Error(
  29980. 'DDSParser does not support single-channel (alpha) texture data!'
  29981. );
  29982. throw new Error(
  29983. 'DDSParser failed to load a texture file due to an unknown reason!'
  29984. );
  29985. })(t.data),
  29986. t.metadata
  29987. )
  29988. );
  29989. } catch (t) {
  29990. return void e(t);
  29991. }
  29992. e();
  29993. }),
  29994. (t.extension = HD.Loader),
  29995. t
  29996. );
  29997. })();
  29998. DN.setExtensionXhrType('ktx', DN.XHR_RESPONSE_TYPE.BUFFER);
  29999. var Bk = (function () {
  30000. function t() {}
  30001. return (
  30002. (t.use = function (t, e) {
  30003. if ('ktx' === t.extension && t.data)
  30004. try {
  30005. var r = t.name || t.url,
  30006. n = Fk(r, t.data, this.loadKeyValueData),
  30007. i = n.compressed,
  30008. o = n.uncompressed,
  30009. s = n.kvData;
  30010. if (i) {
  30011. var a = rk(r, i, t.metadata);
  30012. if (s && a.textures)
  30013. for (var u in a.textures)
  30014. a.textures[u].baseTexture.ktxKeyValueData = s;
  30015. Object.assign(t, a);
  30016. } else if (o) {
  30017. var c = {};
  30018. o.forEach(function (t, e) {
  30019. var n = new EL(
  30020. new aL(t.resource, {
  30021. mipmap: BP.OFF,
  30022. alphaMode: GP.NO_PREMULTIPLIED_ALPHA,
  30023. type: t.type,
  30024. format: t.format,
  30025. })
  30026. ),
  30027. i = r + '-' + (e + 1);
  30028. s && (n.baseTexture.ktxKeyValueData = s),
  30029. aL.addToCache(n.baseTexture, i),
  30030. EL.addToCache(n, i),
  30031. 0 === e &&
  30032. ((c[r] = n),
  30033. aL.addToCache(n.baseTexture, r),
  30034. EL.addToCache(n, r)),
  30035. (c[i] = n);
  30036. }),
  30037. Object.assign(t, { textures: c });
  30038. }
  30039. } catch (t) {
  30040. return void e(t);
  30041. }
  30042. e();
  30043. }),
  30044. (t.extension = HD.Loader),
  30045. (t.loadKeyValueData = !1),
  30046. t
  30047. );
  30048. })(),
  30049. Gk = function (t, e) {
  30050. return (
  30051. (Gk =
  30052. Object.setPrototypeOf ||
  30053. ({ __proto__: [] } instanceof Array &&
  30054. function (t, e) {
  30055. t.__proto__ = e;
  30056. }) ||
  30057. function (t, e) {
  30058. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  30059. }),
  30060. Gk(t, e)
  30061. );
  30062. };
  30063. function Uk(t, e) {
  30064. function r() {
  30065. this.constructor = t;
  30066. }
  30067. Gk(t, e),
  30068. (t.prototype =
  30069. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  30070. }
  30071. var jk,
  30072. Xk,
  30073. Vk = (function (t) {
  30074. function e(e, r, n, i) {
  30075. void 0 === e && (e = 1500),
  30076. void 0 === n && (n = 16384),
  30077. void 0 === i && (i = !1);
  30078. var o = t.call(this) || this;
  30079. return (
  30080. n > 16384 && (n = 16384),
  30081. (o._properties = [!1, !0, !1, !1, !1]),
  30082. (o._maxSize = e),
  30083. (o._batchSize = n),
  30084. (o._buffers = null),
  30085. (o._bufferUpdateIDs = []),
  30086. (o._updateID = 0),
  30087. (o.interactiveChildren = !1),
  30088. (o.blendMode = OP.NORMAL),
  30089. (o.autoResize = i),
  30090. (o.roundPixels = !0),
  30091. (o.baseTexture = null),
  30092. o.setProperties(r),
  30093. (o._tint = 0),
  30094. (o.tintRgb = new Float32Array(4)),
  30095. (o.tint = 16777215),
  30096. o
  30097. );
  30098. }
  30099. return (
  30100. Uk(e, t),
  30101. (e.prototype.setProperties = function (t) {
  30102. t &&
  30103. ((this._properties[0] =
  30104. 'vertices' in t || 'scale' in t
  30105. ? !!t.vertices || !!t.scale
  30106. : this._properties[0]),
  30107. (this._properties[1] =
  30108. 'position' in t ? !!t.position : this._properties[1]),
  30109. (this._properties[2] =
  30110. 'rotation' in t ? !!t.rotation : this._properties[2]),
  30111. (this._properties[3] = 'uvs' in t ? !!t.uvs : this._properties[3]),
  30112. (this._properties[4] =
  30113. 'tint' in t || 'alpha' in t
  30114. ? !!t.tint || !!t.alpha
  30115. : this._properties[4]));
  30116. }),
  30117. (e.prototype.updateTransform = function () {
  30118. this.displayObjectUpdateTransform();
  30119. }),
  30120. Object.defineProperty(e.prototype, 'tint', {
  30121. get: function () {
  30122. return this._tint;
  30123. },
  30124. set: function (t) {
  30125. (this._tint = t), HM(t, this.tintRgb);
  30126. },
  30127. enumerable: !1,
  30128. configurable: !0,
  30129. }),
  30130. (e.prototype.render = function (t) {
  30131. var e = this;
  30132. this.visible &&
  30133. !(this.worldAlpha <= 0) &&
  30134. this.children.length &&
  30135. this.renderable &&
  30136. (this.baseTexture ||
  30137. ((this.baseTexture = this.children[0]._texture.baseTexture),
  30138. this.baseTexture.valid ||
  30139. this.baseTexture.once('update', function () {
  30140. return e.onChildrenChange(0);
  30141. })),
  30142. t.batch.setObjectRenderer(t.plugins.particle),
  30143. t.plugins.particle.render(this));
  30144. }),
  30145. (e.prototype.onChildrenChange = function (t) {
  30146. for (
  30147. var e = Math.floor(t / this._batchSize);
  30148. this._bufferUpdateIDs.length < e;
  30149. )
  30150. this._bufferUpdateIDs.push(0);
  30151. this._bufferUpdateIDs[e] = ++this._updateID;
  30152. }),
  30153. (e.prototype.dispose = function () {
  30154. if (this._buffers) {
  30155. for (var t = 0; t < this._buffers.length; ++t)
  30156. this._buffers[t].destroy();
  30157. this._buffers = null;
  30158. }
  30159. }),
  30160. (e.prototype.destroy = function (e) {
  30161. t.prototype.destroy.call(this, e),
  30162. this.dispose(),
  30163. (this._properties = null),
  30164. (this._buffers = null),
  30165. (this._bufferUpdateIDs = null);
  30166. }),
  30167. e
  30168. );
  30169. })(VD),
  30170. Hk = (function () {
  30171. function t(t, e, r) {
  30172. (this.geometry = new DL()),
  30173. (this.indexBuffer = null),
  30174. (this.size = r),
  30175. (this.dynamicProperties = []),
  30176. (this.staticProperties = []);
  30177. for (var n = 0; n < t.length; ++n) {
  30178. var i = t[n];
  30179. (i = {
  30180. attributeName: i.attributeName,
  30181. size: i.size,
  30182. uploadFunction: i.uploadFunction,
  30183. type: i.type || LP.FLOAT,
  30184. offset: i.offset,
  30185. }),
  30186. e[n]
  30187. ? this.dynamicProperties.push(i)
  30188. : this.staticProperties.push(i);
  30189. }
  30190. (this.staticStride = 0),
  30191. (this.staticBuffer = null),
  30192. (this.staticData = null),
  30193. (this.staticDataUint32 = null),
  30194. (this.dynamicStride = 0),
  30195. (this.dynamicBuffer = null),
  30196. (this.dynamicData = null),
  30197. (this.dynamicDataUint32 = null),
  30198. (this._updateID = 0),
  30199. this.initBuffers();
  30200. }
  30201. return (
  30202. (t.prototype.initBuffers = function () {
  30203. var t = this.geometry,
  30204. e = 0;
  30205. (this.indexBuffer = new PL(
  30206. (function (t, e) {
  30207. void 0 === e && (e = null);
  30208. var r = 6 * t;
  30209. if ((e = e || new Uint16Array(r)).length !== r)
  30210. throw new Error(
  30211. 'Out buffer length is incorrect, got ' +
  30212. e.length +
  30213. ' and expected ' +
  30214. r
  30215. );
  30216. for (var n = 0, i = 0; n < r; n += 6, i += 4)
  30217. (e[n + 0] = i + 0),
  30218. (e[n + 1] = i + 1),
  30219. (e[n + 2] = i + 2),
  30220. (e[n + 3] = i + 0),
  30221. (e[n + 4] = i + 2),
  30222. (e[n + 5] = i + 3);
  30223. return e;
  30224. })(this.size),
  30225. !0,
  30226. !0
  30227. )),
  30228. t.addIndex(this.indexBuffer),
  30229. (this.dynamicStride = 0);
  30230. for (var r = 0; r < this.dynamicProperties.length; ++r) {
  30231. ((s = this.dynamicProperties[r]).offset = e),
  30232. (e += s.size),
  30233. (this.dynamicStride += s.size);
  30234. }
  30235. var n = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);
  30236. (this.dynamicData = new Float32Array(n)),
  30237. (this.dynamicDataUint32 = new Uint32Array(n)),
  30238. (this.dynamicBuffer = new PL(this.dynamicData, !1, !1));
  30239. var i = 0;
  30240. this.staticStride = 0;
  30241. for (r = 0; r < this.staticProperties.length; ++r) {
  30242. ((s = this.staticProperties[r]).offset = i),
  30243. (i += s.size),
  30244. (this.staticStride += s.size);
  30245. }
  30246. var o = new ArrayBuffer(this.size * this.staticStride * 4 * 4);
  30247. (this.staticData = new Float32Array(o)),
  30248. (this.staticDataUint32 = new Uint32Array(o)),
  30249. (this.staticBuffer = new PL(this.staticData, !0, !1));
  30250. for (r = 0; r < this.dynamicProperties.length; ++r) {
  30251. var s = this.dynamicProperties[r];
  30252. t.addAttribute(
  30253. s.attributeName,
  30254. this.dynamicBuffer,
  30255. 0,
  30256. s.type === LP.UNSIGNED_BYTE,
  30257. s.type,
  30258. 4 * this.dynamicStride,
  30259. 4 * s.offset
  30260. );
  30261. }
  30262. for (r = 0; r < this.staticProperties.length; ++r) {
  30263. s = this.staticProperties[r];
  30264. t.addAttribute(
  30265. s.attributeName,
  30266. this.staticBuffer,
  30267. 0,
  30268. s.type === LP.UNSIGNED_BYTE,
  30269. s.type,
  30270. 4 * this.staticStride,
  30271. 4 * s.offset
  30272. );
  30273. }
  30274. }),
  30275. (t.prototype.uploadDynamic = function (t, e, r) {
  30276. for (var n = 0; n < this.dynamicProperties.length; n++) {
  30277. var i = this.dynamicProperties[n];
  30278. i.uploadFunction(
  30279. t,
  30280. e,
  30281. r,
  30282. i.type === LP.UNSIGNED_BYTE
  30283. ? this.dynamicDataUint32
  30284. : this.dynamicData,
  30285. this.dynamicStride,
  30286. i.offset
  30287. );
  30288. }
  30289. this.dynamicBuffer._updateID++;
  30290. }),
  30291. (t.prototype.uploadStatic = function (t, e, r) {
  30292. for (var n = 0; n < this.staticProperties.length; n++) {
  30293. var i = this.staticProperties[n];
  30294. i.uploadFunction(
  30295. t,
  30296. e,
  30297. r,
  30298. i.type === LP.UNSIGNED_BYTE
  30299. ? this.staticDataUint32
  30300. : this.staticData,
  30301. this.staticStride,
  30302. i.offset
  30303. );
  30304. }
  30305. this.staticBuffer._updateID++;
  30306. }),
  30307. (t.prototype.destroy = function () {
  30308. (this.indexBuffer = null),
  30309. (this.dynamicProperties = null),
  30310. (this.dynamicBuffer = null),
  30311. (this.dynamicData = null),
  30312. (this.dynamicDataUint32 = null),
  30313. (this.staticProperties = null),
  30314. (this.staticBuffer = null),
  30315. (this.staticData = null),
  30316. (this.staticDataUint32 = null),
  30317. this.geometry.destroy();
  30318. }),
  30319. t
  30320. );
  30321. })(),
  30322. Wk = (function (t) {
  30323. function e(e) {
  30324. var r = t.call(this, e) || this;
  30325. return (
  30326. (r.shader = null),
  30327. (r.properties = null),
  30328. (r.tempMatrix = new CD()),
  30329. (r.properties = [
  30330. {
  30331. attributeName: 'aVertexPosition',
  30332. size: 2,
  30333. uploadFunction: r.uploadVertices,
  30334. offset: 0,
  30335. },
  30336. {
  30337. attributeName: 'aPositionCoord',
  30338. size: 2,
  30339. uploadFunction: r.uploadPosition,
  30340. offset: 0,
  30341. },
  30342. {
  30343. attributeName: 'aRotation',
  30344. size: 1,
  30345. uploadFunction: r.uploadRotation,
  30346. offset: 0,
  30347. },
  30348. {
  30349. attributeName: 'aTextureCoord',
  30350. size: 2,
  30351. uploadFunction: r.uploadUvs,
  30352. offset: 0,
  30353. },
  30354. {
  30355. attributeName: 'aColor',
  30356. size: 1,
  30357. type: LP.UNSIGNED_BYTE,
  30358. uploadFunction: r.uploadTint,
  30359. offset: 0,
  30360. },
  30361. ]),
  30362. (r.shader = TF.from(
  30363. 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n',
  30364. 'varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}',
  30365. {}
  30366. )),
  30367. (r.state = xF.for2d()),
  30368. r
  30369. );
  30370. }
  30371. return (
  30372. Uk(e, t),
  30373. (e.prototype.render = function (t) {
  30374. var e = t.children,
  30375. r = t._maxSize,
  30376. n = t._batchSize,
  30377. i = this.renderer,
  30378. o = e.length;
  30379. if (0 !== o) {
  30380. o > r && !t.autoResize && (o = r);
  30381. var s = t._buffers;
  30382. s || (s = t._buffers = this.generateBuffers(t));
  30383. var a = e[0]._texture.baseTexture,
  30384. u = a.alphaMode > 0;
  30385. (this.state.blendMode = JM(t.blendMode, u)),
  30386. i.state.set(this.state);
  30387. var c,
  30388. h,
  30389. l,
  30390. d,
  30391. f = i.gl,
  30392. p = t.worldTransform.copyTo(this.tempMatrix);
  30393. p.prepend(i.globalUniforms.uniforms.projectionMatrix),
  30394. (this.shader.uniforms.translationMatrix = p.toArray(!0)),
  30395. (this.shader.uniforms.uColor =
  30396. ((c = t.tintRgb),
  30397. (h = t.worldAlpha),
  30398. (l = this.shader.uniforms.uColor),
  30399. (d = u),
  30400. (l = l || new Float32Array(4)),
  30401. d || void 0 === d
  30402. ? ((l[0] = c[0] * h), (l[1] = c[1] * h), (l[2] = c[2] * h))
  30403. : ((l[0] = c[0]), (l[1] = c[1]), (l[2] = c[2])),
  30404. (l[3] = h),
  30405. l)),
  30406. (this.shader.uniforms.uSampler = a),
  30407. this.renderer.shader.bind(this.shader);
  30408. for (var v = !1, m = 0, y = 0; m < o; m += n, y += 1) {
  30409. var g = o - m;
  30410. g > n && (g = n),
  30411. y >= s.length && s.push(this._generateOneMoreBuffer(t));
  30412. var _ = s[y];
  30413. _.uploadDynamic(e, m, g);
  30414. var b = t._bufferUpdateIDs[y] || 0;
  30415. (v = v || _._updateID < b) &&
  30416. ((_._updateID = t._updateID), _.uploadStatic(e, m, g)),
  30417. i.geometry.bind(_.geometry),
  30418. f.drawElements(f.TRIANGLES, 6 * g, f.UNSIGNED_SHORT, 0);
  30419. }
  30420. }
  30421. }),
  30422. (e.prototype.generateBuffers = function (t) {
  30423. for (
  30424. var e = [],
  30425. r = t._maxSize,
  30426. n = t._batchSize,
  30427. i = t._properties,
  30428. o = 0;
  30429. o < r;
  30430. o += n
  30431. )
  30432. e.push(new Hk(this.properties, i, n));
  30433. return e;
  30434. }),
  30435. (e.prototype._generateOneMoreBuffer = function (t) {
  30436. var e = t._batchSize,
  30437. r = t._properties;
  30438. return new Hk(this.properties, r, e);
  30439. }),
  30440. (e.prototype.uploadVertices = function (t, e, r, n, i, o) {
  30441. for (var s = 0, a = 0, u = 0, c = 0, h = 0; h < r; ++h) {
  30442. var l = t[e + h],
  30443. d = l._texture,
  30444. f = l.scale.x,
  30445. p = l.scale.y,
  30446. v = d.trim,
  30447. m = d.orig;
  30448. v
  30449. ? ((s = (a = v.x - l.anchor.x * m.width) + v.width),
  30450. (u = (c = v.y - l.anchor.y * m.height) + v.height))
  30451. : ((s = m.width * (1 - l.anchor.x)),
  30452. (a = m.width * -l.anchor.x),
  30453. (u = m.height * (1 - l.anchor.y)),
  30454. (c = m.height * -l.anchor.y)),
  30455. (n[o] = a * f),
  30456. (n[o + 1] = c * p),
  30457. (n[o + i] = s * f),
  30458. (n[o + i + 1] = c * p),
  30459. (n[o + 2 * i] = s * f),
  30460. (n[o + 2 * i + 1] = u * p),
  30461. (n[o + 3 * i] = a * f),
  30462. (n[o + 3 * i + 1] = u * p),
  30463. (o += 4 * i);
  30464. }
  30465. }),
  30466. (e.prototype.uploadPosition = function (t, e, r, n, i, o) {
  30467. for (var s = 0; s < r; s++) {
  30468. var a = t[e + s].position;
  30469. (n[o] = a.x),
  30470. (n[o + 1] = a.y),
  30471. (n[o + i] = a.x),
  30472. (n[o + i + 1] = a.y),
  30473. (n[o + 2 * i] = a.x),
  30474. (n[o + 2 * i + 1] = a.y),
  30475. (n[o + 3 * i] = a.x),
  30476. (n[o + 3 * i + 1] = a.y),
  30477. (o += 4 * i);
  30478. }
  30479. }),
  30480. (e.prototype.uploadRotation = function (t, e, r, n, i, o) {
  30481. for (var s = 0; s < r; s++) {
  30482. var a = t[e + s].rotation;
  30483. (n[o] = a),
  30484. (n[o + i] = a),
  30485. (n[o + 2 * i] = a),
  30486. (n[o + 3 * i] = a),
  30487. (o += 4 * i);
  30488. }
  30489. }),
  30490. (e.prototype.uploadUvs = function (t, e, r, n, i, o) {
  30491. for (var s = 0; s < r; ++s) {
  30492. var a = t[e + s]._texture._uvs;
  30493. a
  30494. ? ((n[o] = a.x0),
  30495. (n[o + 1] = a.y0),
  30496. (n[o + i] = a.x1),
  30497. (n[o + i + 1] = a.y1),
  30498. (n[o + 2 * i] = a.x2),
  30499. (n[o + 2 * i + 1] = a.y2),
  30500. (n[o + 3 * i] = a.x3),
  30501. (n[o + 3 * i + 1] = a.y3),
  30502. (o += 4 * i))
  30503. : ((n[o] = 0),
  30504. (n[o + 1] = 0),
  30505. (n[o + i] = 0),
  30506. (n[o + i + 1] = 0),
  30507. (n[o + 2 * i] = 0),
  30508. (n[o + 2 * i + 1] = 0),
  30509. (n[o + 3 * i] = 0),
  30510. (n[o + 3 * i + 1] = 0),
  30511. (o += 4 * i));
  30512. }
  30513. }),
  30514. (e.prototype.uploadTint = function (t, e, r, n, i, o) {
  30515. for (var s = 0; s < r; ++s) {
  30516. var a = t[e + s],
  30517. u = a._texture.baseTexture.alphaMode > 0,
  30518. c = a.alpha,
  30519. h =
  30520. c < 1 && u ? KM(a._tintRGB, c) : a._tintRGB + ((255 * c) << 24);
  30521. (n[o] = h),
  30522. (n[o + i] = h),
  30523. (n[o + 2 * i] = h),
  30524. (n[o + 3 * i] = h),
  30525. (o += 4 * i);
  30526. }
  30527. }),
  30528. (e.prototype.destroy = function () {
  30529. t.prototype.destroy.call(this),
  30530. this.shader && (this.shader.destroy(), (this.shader = null)),
  30531. (this.tempMatrix = null);
  30532. }),
  30533. (e.extension = { name: 'particle', type: HD.RendererPlugin }),
  30534. e
  30535. );
  30536. })(XL);
  30537. !(function (t) {
  30538. (t.MITER = 'miter'), (t.BEVEL = 'bevel'), (t.ROUND = 'round');
  30539. })(jk || (jk = {})),
  30540. (function (t) {
  30541. (t.BUTT = 'butt'), (t.ROUND = 'round'), (t.SQUARE = 'square');
  30542. })(Xk || (Xk = {}));
  30543. var Yk = {
  30544. adaptive: !0,
  30545. maxLength: 10,
  30546. minSegments: 8,
  30547. maxSegments: 2048,
  30548. epsilon: 1e-4,
  30549. _segmentsCount: function (t, e) {
  30550. if ((void 0 === e && (e = 20), !this.adaptive || !t || isNaN(t)))
  30551. return e;
  30552. var r = Math.ceil(t / this.maxLength);
  30553. return (
  30554. r < this.minSegments
  30555. ? (r = this.minSegments)
  30556. : r > this.maxSegments && (r = this.maxSegments),
  30557. r
  30558. );
  30559. },
  30560. },
  30561. zk = (function () {
  30562. function t() {
  30563. (this.color = 16777215),
  30564. (this.alpha = 1),
  30565. (this.texture = EL.WHITE),
  30566. (this.matrix = null),
  30567. (this.visible = !1),
  30568. this.reset();
  30569. }
  30570. return (
  30571. (t.prototype.clone = function () {
  30572. var e = new t();
  30573. return (
  30574. (e.color = this.color),
  30575. (e.alpha = this.alpha),
  30576. (e.texture = this.texture),
  30577. (e.matrix = this.matrix),
  30578. (e.visible = this.visible),
  30579. e
  30580. );
  30581. }),
  30582. (t.prototype.reset = function () {
  30583. (this.color = 16777215),
  30584. (this.alpha = 1),
  30585. (this.texture = EL.WHITE),
  30586. (this.matrix = null),
  30587. (this.visible = !1);
  30588. }),
  30589. (t.prototype.destroy = function () {
  30590. (this.texture = null), (this.matrix = null);
  30591. }),
  30592. t
  30593. );
  30594. })(),
  30595. Zk = function (t, e) {
  30596. return (
  30597. (Zk =
  30598. Object.setPrototypeOf ||
  30599. ({ __proto__: [] } instanceof Array &&
  30600. function (t, e) {
  30601. t.__proto__ = e;
  30602. }) ||
  30603. function (t, e) {
  30604. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  30605. }),
  30606. Zk(t, e)
  30607. );
  30608. };
  30609. function Jk(t, e) {
  30610. function r() {
  30611. this.constructor = t;
  30612. }
  30613. Zk(t, e),
  30614. (t.prototype =
  30615. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  30616. }
  30617. function Kk(t, e) {
  30618. var r, n;
  30619. void 0 === e && (e = !1);
  30620. var i = t.length;
  30621. if (!(i < 6)) {
  30622. for (var o = 0, s = 0, a = t[i - 2], u = t[i - 1]; s < i; s += 2) {
  30623. var c = t[s],
  30624. h = t[s + 1];
  30625. (o += (c - a) * (h + u)), (a = c), (u = h);
  30626. }
  30627. if ((!e && o > 0) || (e && o <= 0)) {
  30628. var l = i / 2;
  30629. for (s = l + (l % 2); s < i; s += 2) {
  30630. var d = i - s - 2,
  30631. f = i - s - 1,
  30632. p = s,
  30633. v = s + 1;
  30634. (r = [t[p], t[d]]),
  30635. (t[d] = r[0]),
  30636. (t[p] = r[1]),
  30637. (n = [t[v], t[f]]),
  30638. (t[f] = n[0]),
  30639. (t[v] = n[1]);
  30640. }
  30641. }
  30642. }
  30643. }
  30644. var qk = {
  30645. build: function (t) {
  30646. t.points = t.shape.points.slice();
  30647. },
  30648. triangulate: function (t, e) {
  30649. var r = t.points,
  30650. n = t.holes,
  30651. i = e.points,
  30652. o = e.indices;
  30653. if (r.length >= 6) {
  30654. Kk(r, !1);
  30655. for (var s = [], a = 0; a < n.length; a++) {
  30656. var u = n[a];
  30657. Kk(u.points, !0), s.push(r.length / 2), (r = r.concat(u.points));
  30658. }
  30659. var c = WA(r, s, 2);
  30660. if (!c) return;
  30661. var h = i.length / 2;
  30662. for (a = 0; a < c.length; a += 3)
  30663. o.push(c[a] + h), o.push(c[a + 1] + h), o.push(c[a + 2] + h);
  30664. for (a = 0; a < r.length; a++) i.push(r[a]);
  30665. }
  30666. },
  30667. },
  30668. Qk = {
  30669. build: function (t) {
  30670. var e,
  30671. r,
  30672. n,
  30673. i,
  30674. o,
  30675. s,
  30676. a = t.points;
  30677. if (t.type === vD.CIRC) {
  30678. var u = t.shape;
  30679. (e = u.x), (r = u.y), (o = s = u.radius), (n = i = 0);
  30680. } else if (t.type === vD.ELIP) {
  30681. var c = t.shape;
  30682. (e = c.x), (r = c.y), (o = c.width), (s = c.height), (n = i = 0);
  30683. } else {
  30684. var h = t.shape,
  30685. l = h.width / 2,
  30686. d = h.height / 2;
  30687. (e = h.x + l),
  30688. (r = h.y + d),
  30689. (n = l - (o = s = Math.max(0, Math.min(h.radius, Math.min(l, d))))),
  30690. (i = d - s);
  30691. }
  30692. if (o >= 0 && s >= 0 && n >= 0 && i >= 0) {
  30693. var f = Math.ceil(2.3 * Math.sqrt(o + s)),
  30694. p = 8 * f + (n ? 4 : 0) + (i ? 4 : 0);
  30695. if (((a.length = p), 0 !== p)) {
  30696. if (0 === f)
  30697. return (
  30698. (a.length = 8),
  30699. (a[0] = a[6] = e + n),
  30700. (a[1] = a[3] = r + i),
  30701. (a[2] = a[4] = e - n),
  30702. void (a[5] = a[7] = r - i)
  30703. );
  30704. var v = 0,
  30705. m = 4 * f + (n ? 2 : 0) + 2,
  30706. y = m,
  30707. g = p,
  30708. _ = e + (w = n + o),
  30709. b = e - w,
  30710. T = r + (R = i);
  30711. if (((a[v++] = _), (a[v++] = T), (a[--m] = T), (a[--m] = b), i)) {
  30712. var x = r - R;
  30713. (a[y++] = b), (a[y++] = x), (a[--g] = x), (a[--g] = _);
  30714. }
  30715. for (var E = 1; E < f; E++) {
  30716. var S = (Math.PI / 2) * (E / f);
  30717. (_ = e + (w = n + Math.cos(S) * o)),
  30718. (b = e - w),
  30719. (T = r + (R = i + Math.sin(S) * s)),
  30720. (x = r - R);
  30721. (a[v++] = _),
  30722. (a[v++] = T),
  30723. (a[--m] = T),
  30724. (a[--m] = b),
  30725. (a[y++] = b),
  30726. (a[y++] = x),
  30727. (a[--g] = x),
  30728. (a[--g] = _);
  30729. }
  30730. var w, R;
  30731. (_ = e + (w = n)), (b = e - w), (T = r + (R = i + s)), (x = r - R);
  30732. (a[v++] = _),
  30733. (a[v++] = T),
  30734. (a[--g] = x),
  30735. (a[--g] = _),
  30736. n && ((a[v++] = b), (a[v++] = T), (a[--g] = x), (a[--g] = b));
  30737. }
  30738. } else a.length = 0;
  30739. },
  30740. triangulate: function (t, e) {
  30741. var r = t.points,
  30742. n = e.points,
  30743. i = e.indices;
  30744. if (0 !== r.length) {
  30745. var o,
  30746. s,
  30747. a = n.length / 2,
  30748. u = a;
  30749. if (t.type !== vD.RREC) {
  30750. var c = t.shape;
  30751. (o = c.x), (s = c.y);
  30752. } else {
  30753. var h = t.shape;
  30754. (o = h.x + h.width / 2), (s = h.y + h.height / 2);
  30755. }
  30756. var l = t.matrix;
  30757. n.push(
  30758. t.matrix ? l.a * o + l.c * s + l.tx : o,
  30759. t.matrix ? l.b * o + l.d * s + l.ty : s
  30760. ),
  30761. a++,
  30762. n.push(r[0], r[1]);
  30763. for (var d = 2; d < r.length; d += 2)
  30764. n.push(r[d], r[d + 1]), i.push(a++, u, a);
  30765. i.push(u + 1, u, a);
  30766. }
  30767. },
  30768. };
  30769. function $k(t, e, r) {
  30770. return t + (e - t) * r;
  30771. }
  30772. function tB(t, e, r, n, i, o, s) {
  30773. void 0 === s && (s = []);
  30774. for (
  30775. var a = s, u = 0, c = 0, h = 0, l = 0, d = 0, f = 0, p = 0, v = 0;
  30776. p <= 20;
  30777. ++p
  30778. )
  30779. (u = $k(t, r, (v = p / 20))),
  30780. (c = $k(e, n, v)),
  30781. (h = $k(r, i, v)),
  30782. (l = $k(n, o, v)),
  30783. (d = $k(u, h, v)),
  30784. (f = $k(c, l, v)),
  30785. (0 === p && a[a.length - 2] === d && a[a.length - 1] === f) ||
  30786. a.push(d, f);
  30787. return a;
  30788. }
  30789. var eB = {
  30790. build: function (t) {
  30791. if (_B.nextRoundedRectBehavior) Qk.build(t);
  30792. else {
  30793. var e = t.shape,
  30794. r = t.points,
  30795. n = e.x,
  30796. i = e.y,
  30797. o = e.width,
  30798. s = e.height,
  30799. a = Math.max(0, Math.min(e.radius, Math.min(o, s) / 2));
  30800. (r.length = 0),
  30801. a
  30802. ? (tB(n, i + a, n, i, n + a, i, r),
  30803. tB(n + o - a, i, n + o, i, n + o, i + a, r),
  30804. tB(n + o, i + s - a, n + o, i + s, n + o - a, i + s, r),
  30805. tB(n + a, i + s, n, i + s, n, i + s - a, r))
  30806. : r.push(n, i, n + o, i, n + o, i + s, n, i + s);
  30807. }
  30808. },
  30809. triangulate: function (t, e) {
  30810. if (_B.nextRoundedRectBehavior) Qk.triangulate(t, e);
  30811. else {
  30812. for (
  30813. var r = t.points,
  30814. n = e.points,
  30815. i = e.indices,
  30816. o = n.length / 2,
  30817. s = WA(r, null, 2),
  30818. a = 0,
  30819. u = s.length;
  30820. a < u;
  30821. a += 3
  30822. )
  30823. i.push(s[a] + o), i.push(s[a + 1] + o), i.push(s[a + 2] + o);
  30824. for (a = 0, u = r.length; a < u; a++) n.push(r[a], r[++a]);
  30825. }
  30826. },
  30827. };
  30828. function rB(t, e, r, n, i, o, s, a) {
  30829. var u, c;
  30830. s ? ((u = n), (c = -r)) : ((u = -n), (c = r));
  30831. var h = t - r * i + u,
  30832. l = e - n * i + c,
  30833. d = t + r * o + u,
  30834. f = e + n * o + c;
  30835. return a.push(h, l), a.push(d, f), 2;
  30836. }
  30837. function nB(t, e, r, n, i, o, s, a) {
  30838. var u = r - t,
  30839. c = n - e,
  30840. h = Math.atan2(u, c),
  30841. l = Math.atan2(i - t, o - e);
  30842. a && h < l ? (h += 2 * Math.PI) : !a && h > l && (l += 2 * Math.PI);
  30843. var d = h,
  30844. f = l - h,
  30845. p = Math.abs(f),
  30846. v = Math.sqrt(u * u + c * c),
  30847. m = 1 + (((15 * p * Math.sqrt(v)) / Math.PI) >> 0),
  30848. y = f / m;
  30849. if (((d += y), a)) {
  30850. s.push(t, e), s.push(r, n);
  30851. for (var g = 1, _ = d; g < m; g++, _ += y)
  30852. s.push(t, e), s.push(t + Math.sin(_) * v, e + Math.cos(_) * v);
  30853. s.push(t, e), s.push(i, o);
  30854. } else {
  30855. s.push(r, n), s.push(t, e);
  30856. for (g = 1, _ = d; g < m; g++, _ += y)
  30857. s.push(t + Math.sin(_) * v, e + Math.cos(_) * v), s.push(t, e);
  30858. s.push(i, o), s.push(t, e);
  30859. }
  30860. return 2 * m;
  30861. }
  30862. function iB(t, e) {
  30863. t.lineStyle.native
  30864. ? (function (t, e) {
  30865. var r = 0,
  30866. n = t.shape,
  30867. i = t.points || n.points,
  30868. o = n.type !== vD.POLY || n.closeStroke;
  30869. if (0 !== i.length) {
  30870. var s = e.points,
  30871. a = e.indices,
  30872. u = i.length / 2,
  30873. c = s.length / 2,
  30874. h = c;
  30875. for (s.push(i[0], i[1]), r = 1; r < u; r++)
  30876. s.push(i[2 * r], i[2 * r + 1]), a.push(h, h + 1), h++;
  30877. o && a.push(h, c);
  30878. }
  30879. })(t, e)
  30880. : (function (t, e) {
  30881. var r = t.shape,
  30882. n = t.points || r.points.slice(),
  30883. i = e.closePointEps;
  30884. if (0 !== n.length) {
  30885. var o = t.lineStyle,
  30886. s = new _D(n[0], n[1]),
  30887. a = new _D(n[n.length - 2], n[n.length - 1]),
  30888. u = r.type !== vD.POLY || r.closeStroke,
  30889. c = Math.abs(s.x - a.x) < i && Math.abs(s.y - a.y) < i;
  30890. if (u) {
  30891. (n = n.slice()),
  30892. c &&
  30893. (n.pop(), n.pop(), a.set(n[n.length - 2], n[n.length - 1]));
  30894. var h = 0.5 * (s.x + a.x),
  30895. l = 0.5 * (a.y + s.y);
  30896. n.unshift(h, l), n.push(h, l);
  30897. }
  30898. var d = e.points,
  30899. f = n.length / 2,
  30900. p = n.length,
  30901. v = d.length / 2,
  30902. m = o.width / 2,
  30903. y = m * m,
  30904. g = o.miterLimit * o.miterLimit,
  30905. _ = n[0],
  30906. b = n[1],
  30907. T = n[2],
  30908. x = n[3],
  30909. E = 0,
  30910. S = 0,
  30911. w = -(b - x),
  30912. R = _ - T,
  30913. C = 0,
  30914. P = 0,
  30915. A = Math.sqrt(w * w + R * R);
  30916. (w /= A), (R /= A), (w *= m), (R *= m);
  30917. var O = o.alignment,
  30918. I = 2 * (1 - O),
  30919. M = 2 * O;
  30920. u ||
  30921. (o.cap === Xk.ROUND
  30922. ? (p +=
  30923. nB(
  30924. _ - w * (I - M) * 0.5,
  30925. b - R * (I - M) * 0.5,
  30926. _ - w * I,
  30927. b - R * I,
  30928. _ + w * M,
  30929. b + R * M,
  30930. d,
  30931. !0
  30932. ) + 2)
  30933. : o.cap === Xk.SQUARE && (p += rB(_, b, w, R, I, M, !0, d))),
  30934. d.push(_ - w * I, b - R * I),
  30935. d.push(_ + w * M, b + R * M);
  30936. for (var D = 1; D < f - 1; ++D) {
  30937. (_ = n[2 * (D - 1)]),
  30938. (b = n[2 * (D - 1) + 1]),
  30939. (T = n[2 * D]),
  30940. (x = n[2 * D + 1]),
  30941. (E = n[2 * (D + 1)]),
  30942. (S = n[2 * (D + 1) + 1]),
  30943. (w = -(b - x)),
  30944. (R = _ - T),
  30945. (w /= A = Math.sqrt(w * w + R * R)),
  30946. (R /= A),
  30947. (w *= m),
  30948. (R *= m),
  30949. (C = -(x - S)),
  30950. (P = T - E),
  30951. (C /= A = Math.sqrt(C * C + P * P)),
  30952. (P /= A),
  30953. (C *= m),
  30954. (P *= m);
  30955. var L = T - _,
  30956. F = b - x,
  30957. N = T - E,
  30958. k = S - x,
  30959. B = L * N + F * k,
  30960. G = F * N - k * L,
  30961. U = G < 0;
  30962. if (Math.abs(G) < 0.001 * Math.abs(B))
  30963. d.push(T - w * I, x - R * I),
  30964. d.push(T + w * M, x + R * M),
  30965. B >= 0 &&
  30966. (o.join === jk.ROUND
  30967. ? (p +=
  30968. nB(
  30969. T,
  30970. x,
  30971. T - w * I,
  30972. x - R * I,
  30973. T - C * I,
  30974. x - P * I,
  30975. d,
  30976. !1
  30977. ) + 4)
  30978. : (p += 2),
  30979. d.push(T - C * M, x - P * M),
  30980. d.push(T + C * I, x + P * I));
  30981. else {
  30982. var j = (-w + _) * (-R + x) - (-w + T) * (-R + b),
  30983. X = (-C + E) * (-P + x) - (-C + T) * (-P + S),
  30984. V = (L * X - N * j) / G,
  30985. H = (k * j - F * X) / G,
  30986. W = (V - T) * (V - T) + (H - x) * (H - x),
  30987. Y = T + (V - T) * I,
  30988. z = x + (H - x) * I,
  30989. Z = T - (V - T) * M,
  30990. J = x - (H - x) * M,
  30991. K = U ? I : M;
  30992. W <= Math.min(L * L + F * F, N * N + k * k) + K * K * y
  30993. ? o.join === jk.BEVEL || W / y > g
  30994. ? (U
  30995. ? (d.push(Y, z),
  30996. d.push(T + w * M, x + R * M),
  30997. d.push(Y, z),
  30998. d.push(T + C * M, x + P * M))
  30999. : (d.push(T - w * I, x - R * I),
  31000. d.push(Z, J),
  31001. d.push(T - C * I, x - P * I),
  31002. d.push(Z, J)),
  31003. (p += 2))
  31004. : o.join === jk.ROUND
  31005. ? U
  31006. ? (d.push(Y, z),
  31007. d.push(T + w * M, x + R * M),
  31008. (p +=
  31009. nB(
  31010. T,
  31011. x,
  31012. T + w * M,
  31013. x + R * M,
  31014. T + C * M,
  31015. x + P * M,
  31016. d,
  31017. !0
  31018. ) + 4),
  31019. d.push(Y, z),
  31020. d.push(T + C * M, x + P * M))
  31021. : (d.push(T - w * I, x - R * I),
  31022. d.push(Z, J),
  31023. (p +=
  31024. nB(
  31025. T,
  31026. x,
  31027. T - w * I,
  31028. x - R * I,
  31029. T - C * I,
  31030. x - P * I,
  31031. d,
  31032. !1
  31033. ) + 4),
  31034. d.push(T - C * I, x - P * I),
  31035. d.push(Z, J))
  31036. : (d.push(Y, z), d.push(Z, J))
  31037. : (d.push(T - w * I, x - R * I),
  31038. d.push(T + w * M, x + R * M),
  31039. o.join === jk.ROUND
  31040. ? (p += U
  31041. ? nB(
  31042. T,
  31043. x,
  31044. T + w * M,
  31045. x + R * M,
  31046. T + C * M,
  31047. x + P * M,
  31048. d,
  31049. !0
  31050. ) + 2
  31051. : nB(
  31052. T,
  31053. x,
  31054. T - w * I,
  31055. x - R * I,
  31056. T - C * I,
  31057. x - P * I,
  31058. d,
  31059. !1
  31060. ) + 2)
  31061. : o.join === jk.MITER &&
  31062. W / y <= g &&
  31063. (U
  31064. ? (d.push(Z, J), d.push(Z, J))
  31065. : (d.push(Y, z), d.push(Y, z)),
  31066. (p += 2)),
  31067. d.push(T - C * I, x - P * I),
  31068. d.push(T + C * M, x + P * M),
  31069. (p += 2));
  31070. }
  31071. }
  31072. (_ = n[2 * (f - 2)]),
  31073. (b = n[2 * (f - 2) + 1]),
  31074. (T = n[2 * (f - 1)]),
  31075. (w = -(b - (x = n[2 * (f - 1) + 1]))),
  31076. (R = _ - T),
  31077. (w /= A = Math.sqrt(w * w + R * R)),
  31078. (R /= A),
  31079. (w *= m),
  31080. (R *= m),
  31081. d.push(T - w * I, x - R * I),
  31082. d.push(T + w * M, x + R * M),
  31083. u ||
  31084. (o.cap === Xk.ROUND
  31085. ? (p +=
  31086. nB(
  31087. T - w * (I - M) * 0.5,
  31088. x - R * (I - M) * 0.5,
  31089. T - w * I,
  31090. x - R * I,
  31091. T + w * M,
  31092. x + R * M,
  31093. d,
  31094. !1
  31095. ) + 2)
  31096. : o.cap === Xk.SQUARE && (p += rB(T, x, w, R, I, M, !1, d)));
  31097. var q = e.indices,
  31098. Q = Yk.epsilon * Yk.epsilon;
  31099. for (D = v; D < p + v - 2; ++D)
  31100. (_ = d[2 * D]),
  31101. (b = d[2 * D + 1]),
  31102. (T = d[2 * (D + 1)]),
  31103. (x = d[2 * (D + 1) + 1]),
  31104. (E = d[2 * (D + 2)]),
  31105. (S = d[2 * (D + 2) + 1]),
  31106. Math.abs(_ * (x - S) + T * (S - b) + E * (b - x)) < Q ||
  31107. q.push(D, D + 1, D + 2);
  31108. }
  31109. })(t, e);
  31110. }
  31111. var oB,
  31112. sB = (function () {
  31113. function t() {}
  31114. return (
  31115. (t.curveTo = function (t, e, r, n, i, o) {
  31116. var s = o[o.length - 2],
  31117. a = o[o.length - 1] - e,
  31118. u = s - t,
  31119. c = n - e,
  31120. h = r - t,
  31121. l = Math.abs(a * h - u * c);
  31122. if (l < 1e-8 || 0 === i)
  31123. return (
  31124. (o[o.length - 2] === t && o[o.length - 1] === e) || o.push(t, e),
  31125. null
  31126. );
  31127. var d = a * a + u * u,
  31128. f = c * c + h * h,
  31129. p = a * c + u * h,
  31130. v = (i * Math.sqrt(d)) / l,
  31131. m = (i * Math.sqrt(f)) / l,
  31132. y = (v * p) / d,
  31133. g = (m * p) / f,
  31134. _ = v * h + m * u,
  31135. b = v * c + m * a,
  31136. T = u * (m + y),
  31137. x = a * (m + y),
  31138. E = h * (v + g),
  31139. S = c * (v + g);
  31140. return {
  31141. cx: _ + t,
  31142. cy: b + e,
  31143. radius: i,
  31144. startAngle: Math.atan2(x - b, T - _),
  31145. endAngle: Math.atan2(S - b, E - _),
  31146. anticlockwise: u * c > h * a,
  31147. };
  31148. }),
  31149. (t.arc = function (t, e, r, n, i, o, s, a, u) {
  31150. for (
  31151. var c = s - o,
  31152. h = Yk._segmentsCount(
  31153. Math.abs(c) * i,
  31154. 40 * Math.ceil(Math.abs(c) / mD)
  31155. ),
  31156. l = c / (2 * h),
  31157. d = 2 * l,
  31158. f = Math.cos(l),
  31159. p = Math.sin(l),
  31160. v = h - 1,
  31161. m = (v % 1) / v,
  31162. y = 0;
  31163. y <= v;
  31164. ++y
  31165. ) {
  31166. var g = l + o + d * (y + m * y),
  31167. _ = Math.cos(g),
  31168. b = -Math.sin(g);
  31169. u.push((f * _ + p * b) * i + r, (f * -b + p * _) * i + n);
  31170. }
  31171. }),
  31172. t
  31173. );
  31174. })(),
  31175. aB = (function () {
  31176. function t() {}
  31177. return (
  31178. (t.curveLength = function (t, e, r, n, i, o, s, a) {
  31179. for (
  31180. var u = 0,
  31181. c = 0,
  31182. h = 0,
  31183. l = 0,
  31184. d = 0,
  31185. f = 0,
  31186. p = 0,
  31187. v = 0,
  31188. m = 0,
  31189. y = 0,
  31190. g = 0,
  31191. _ = t,
  31192. b = e,
  31193. T = 1;
  31194. T <= 10;
  31195. ++T
  31196. )
  31197. (y =
  31198. _ -
  31199. (v =
  31200. (p = (f = (d = 1 - (c = T / 10)) * d) * d) * t +
  31201. 3 * f * c * r +
  31202. 3 * d * (h = c * c) * i +
  31203. (l = h * c) * s)),
  31204. (g = b - (m = p * e + 3 * f * c * n + 3 * d * h * o + l * a)),
  31205. (_ = v),
  31206. (b = m),
  31207. (u += Math.sqrt(y * y + g * g));
  31208. return u;
  31209. }),
  31210. (t.curveTo = function (e, r, n, i, o, s, a) {
  31211. var u = a[a.length - 2],
  31212. c = a[a.length - 1];
  31213. a.length -= 2;
  31214. var h = Yk._segmentsCount(t.curveLength(u, c, e, r, n, i, o, s)),
  31215. l = 0,
  31216. d = 0,
  31217. f = 0,
  31218. p = 0,
  31219. v = 0;
  31220. a.push(u, c);
  31221. for (var m = 1, y = 0; m <= h; ++m)
  31222. (f = (d = (l = 1 - (y = m / h)) * l) * l),
  31223. (v = (p = y * y) * y),
  31224. a.push(
  31225. f * u + 3 * d * y * e + 3 * l * p * n + v * o,
  31226. f * c + 3 * d * y * r + 3 * l * p * i + v * s
  31227. );
  31228. }),
  31229. t
  31230. );
  31231. })(),
  31232. uB = (function () {
  31233. function t() {}
  31234. return (
  31235. (t.curveLength = function (t, e, r, n, i, o) {
  31236. var s = t - 2 * r + i,
  31237. a = e - 2 * n + o,
  31238. u = 2 * r - 2 * t,
  31239. c = 2 * n - 2 * e,
  31240. h = 4 * (s * s + a * a),
  31241. l = 4 * (s * u + a * c),
  31242. d = u * u + c * c,
  31243. f = 2 * Math.sqrt(h + l + d),
  31244. p = Math.sqrt(h),
  31245. v = 2 * h * p,
  31246. m = 2 * Math.sqrt(d),
  31247. y = l / p;
  31248. return (
  31249. (v * f +
  31250. p * l * (f - m) +
  31251. (4 * d * h - l * l) * Math.log((2 * p + y + f) / (y + m))) /
  31252. (4 * v)
  31253. );
  31254. }),
  31255. (t.curveTo = function (e, r, n, i, o) {
  31256. for (
  31257. var s = o[o.length - 2],
  31258. a = o[o.length - 1],
  31259. u = Yk._segmentsCount(t.curveLength(s, a, e, r, n, i)),
  31260. c = 0,
  31261. h = 0,
  31262. l = 1;
  31263. l <= u;
  31264. ++l
  31265. ) {
  31266. var d = l / u;
  31267. (c = s + (e - s) * d),
  31268. (h = a + (r - a) * d),
  31269. o.push(
  31270. c + (e + (n - e) * d - c) * d,
  31271. h + (r + (i - r) * d - h) * d
  31272. );
  31273. }
  31274. }),
  31275. t
  31276. );
  31277. })(),
  31278. cB = (function () {
  31279. function t() {
  31280. this.reset();
  31281. }
  31282. return (
  31283. (t.prototype.begin = function (t, e, r) {
  31284. this.reset(),
  31285. (this.style = t),
  31286. (this.start = e),
  31287. (this.attribStart = r);
  31288. }),
  31289. (t.prototype.end = function (t, e) {
  31290. (this.attribSize = e - this.attribStart),
  31291. (this.size = t - this.start);
  31292. }),
  31293. (t.prototype.reset = function () {
  31294. (this.style = null),
  31295. (this.size = 0),
  31296. (this.start = 0),
  31297. (this.attribStart = 0),
  31298. (this.attribSize = 0);
  31299. }),
  31300. t
  31301. );
  31302. })(),
  31303. hB =
  31304. (((oB = {})[vD.POLY] = qk),
  31305. (oB[vD.CIRC] = Qk),
  31306. (oB[vD.ELIP] = Qk),
  31307. (oB[vD.RECT] = {
  31308. build: function (t) {
  31309. var e = t.shape,
  31310. r = e.x,
  31311. n = e.y,
  31312. i = e.width,
  31313. o = e.height,
  31314. s = t.points;
  31315. (s.length = 0), s.push(r, n, r + i, n, r + i, n + o, r, n + o);
  31316. },
  31317. triangulate: function (t, e) {
  31318. var r = t.points,
  31319. n = e.points,
  31320. i = n.length / 2;
  31321. n.push(r[0], r[1], r[2], r[3], r[6], r[7], r[4], r[5]),
  31322. e.indices.push(i, i + 1, i + 2, i + 1, i + 2, i + 3);
  31323. },
  31324. }),
  31325. (oB[vD.RREC] = eB),
  31326. oB),
  31327. lB = [],
  31328. dB = [],
  31329. fB = (function () {
  31330. function t(t, e, r, n) {
  31331. void 0 === e && (e = null),
  31332. void 0 === r && (r = null),
  31333. void 0 === n && (n = null),
  31334. (this.points = []),
  31335. (this.holes = []),
  31336. (this.shape = t),
  31337. (this.lineStyle = r),
  31338. (this.fillStyle = e),
  31339. (this.matrix = n),
  31340. (this.type = t.type);
  31341. }
  31342. return (
  31343. (t.prototype.clone = function () {
  31344. return new t(this.shape, this.fillStyle, this.lineStyle, this.matrix);
  31345. }),
  31346. (t.prototype.destroy = function () {
  31347. (this.shape = null),
  31348. (this.holes.length = 0),
  31349. (this.holes = null),
  31350. (this.points.length = 0),
  31351. (this.points = null),
  31352. (this.lineStyle = null),
  31353. (this.fillStyle = null);
  31354. }),
  31355. t
  31356. );
  31357. })(),
  31358. pB = new _D(),
  31359. vB = (function (t) {
  31360. function e() {
  31361. var e = t.call(this) || this;
  31362. return (
  31363. (e.closePointEps = 1e-4),
  31364. (e.boundsPadding = 0),
  31365. (e.uvsFloat32 = null),
  31366. (e.indicesUint16 = null),
  31367. (e.batchable = !1),
  31368. (e.points = []),
  31369. (e.colors = []),
  31370. (e.uvs = []),
  31371. (e.indices = []),
  31372. (e.textureIds = []),
  31373. (e.graphicsData = []),
  31374. (e.drawCalls = []),
  31375. (e.batchDirty = -1),
  31376. (e.batches = []),
  31377. (e.dirty = 0),
  31378. (e.cacheDirty = -1),
  31379. (e.clearDirty = 0),
  31380. (e.shapeIndex = 0),
  31381. (e._bounds = new kD()),
  31382. (e.boundsDirty = -1),
  31383. e
  31384. );
  31385. }
  31386. return (
  31387. Jk(e, t),
  31388. Object.defineProperty(e.prototype, 'bounds', {
  31389. get: function () {
  31390. return (
  31391. this.updateBatches(),
  31392. this.boundsDirty !== this.dirty &&
  31393. ((this.boundsDirty = this.dirty), this.calculateBounds()),
  31394. this._bounds
  31395. );
  31396. },
  31397. enumerable: !1,
  31398. configurable: !0,
  31399. }),
  31400. (e.prototype.invalidate = function () {
  31401. (this.boundsDirty = -1),
  31402. this.dirty++,
  31403. this.batchDirty++,
  31404. (this.shapeIndex = 0),
  31405. (this.points.length = 0),
  31406. (this.colors.length = 0),
  31407. (this.uvs.length = 0),
  31408. (this.indices.length = 0),
  31409. (this.textureIds.length = 0);
  31410. for (var t = 0; t < this.drawCalls.length; t++)
  31411. this.drawCalls[t].texArray.clear(), dB.push(this.drawCalls[t]);
  31412. this.drawCalls.length = 0;
  31413. for (t = 0; t < this.batches.length; t++) {
  31414. var e = this.batches[t];
  31415. e.reset(), lB.push(e);
  31416. }
  31417. this.batches.length = 0;
  31418. }),
  31419. (e.prototype.clear = function () {
  31420. return (
  31421. this.graphicsData.length > 0 &&
  31422. (this.invalidate(),
  31423. this.clearDirty++,
  31424. (this.graphicsData.length = 0)),
  31425. this
  31426. );
  31427. }),
  31428. (e.prototype.drawShape = function (t, e, r, n) {
  31429. void 0 === e && (e = null),
  31430. void 0 === r && (r = null),
  31431. void 0 === n && (n = null);
  31432. var i = new fB(t, e, r, n);
  31433. return this.graphicsData.push(i), this.dirty++, this;
  31434. }),
  31435. (e.prototype.drawHole = function (t, e) {
  31436. if ((void 0 === e && (e = null), !this.graphicsData.length))
  31437. return null;
  31438. var r = new fB(t, null, null, e),
  31439. n = this.graphicsData[this.graphicsData.length - 1];
  31440. return (
  31441. (r.lineStyle = n.lineStyle), n.holes.push(r), this.dirty++, this
  31442. );
  31443. }),
  31444. (e.prototype.destroy = function () {
  31445. t.prototype.destroy.call(this);
  31446. for (var e = 0; e < this.graphicsData.length; ++e)
  31447. this.graphicsData[e].destroy();
  31448. (this.points.length = 0),
  31449. (this.points = null),
  31450. (this.colors.length = 0),
  31451. (this.colors = null),
  31452. (this.uvs.length = 0),
  31453. (this.uvs = null),
  31454. (this.indices.length = 0),
  31455. (this.indices = null),
  31456. this.indexBuffer.destroy(),
  31457. (this.indexBuffer = null),
  31458. (this.graphicsData.length = 0),
  31459. (this.graphicsData = null),
  31460. (this.drawCalls.length = 0),
  31461. (this.drawCalls = null),
  31462. (this.batches.length = 0),
  31463. (this.batches = null),
  31464. (this._bounds = null);
  31465. }),
  31466. (e.prototype.containsPoint = function (t) {
  31467. for (var e = this.graphicsData, r = 0; r < e.length; ++r) {
  31468. var n = e[r];
  31469. if (
  31470. n.fillStyle.visible &&
  31471. n.shape &&
  31472. (n.matrix ? n.matrix.applyInverse(t, pB) : pB.copyFrom(t),
  31473. n.shape.contains(pB.x, pB.y))
  31474. ) {
  31475. var i = !1;
  31476. if (n.holes)
  31477. for (var o = 0; o < n.holes.length; o++) {
  31478. if (n.holes[o].shape.contains(pB.x, pB.y)) {
  31479. i = !0;
  31480. break;
  31481. }
  31482. }
  31483. if (!i) return !0;
  31484. }
  31485. }
  31486. return !1;
  31487. }),
  31488. (e.prototype.updateBatches = function () {
  31489. if (this.graphicsData.length) {
  31490. if (this.validateBatching()) {
  31491. this.cacheDirty = this.dirty;
  31492. var t = this.uvs,
  31493. e = this.graphicsData,
  31494. r = null,
  31495. n = null;
  31496. this.batches.length > 0 &&
  31497. (n = (r = this.batches[this.batches.length - 1]).style);
  31498. for (var i = this.shapeIndex; i < e.length; i++) {
  31499. this.shapeIndex++;
  31500. var o = e[i],
  31501. s = o.fillStyle,
  31502. a = o.lineStyle;
  31503. hB[o.type].build(o),
  31504. o.matrix && this.transformPoints(o.points, o.matrix),
  31505. (s.visible || a.visible) && this.processHoles(o.holes);
  31506. for (var u = 0; u < 2; u++) {
  31507. var c = 0 === u ? s : a;
  31508. if (c.visible) {
  31509. var h = c.texture.baseTexture,
  31510. l = this.indices.length,
  31511. d = this.points.length / 2;
  31512. (h.wrapMode = kP.REPEAT),
  31513. 0 === u ? this.processFill(o) : this.processLine(o);
  31514. var f = this.points.length / 2 - d;
  31515. 0 !== f &&
  31516. (r &&
  31517. !this._compareStyles(n, c) &&
  31518. (r.end(l, d), (r = null)),
  31519. r ||
  31520. ((r = lB.pop() || new cB()).begin(c, l, d),
  31521. this.batches.push(r),
  31522. (n = c)),
  31523. this.addUvs(this.points, t, c.texture, d, f, c.matrix));
  31524. }
  31525. }
  31526. }
  31527. var p = this.indices.length,
  31528. v = this.points.length / 2;
  31529. if ((r && r.end(p, v), 0 !== this.batches.length)) {
  31530. var m = v > 65535;
  31531. this.indicesUint16 &&
  31532. this.indices.length === this.indicesUint16.length &&
  31533. m === this.indicesUint16.BYTES_PER_ELEMENT > 2
  31534. ? this.indicesUint16.set(this.indices)
  31535. : (this.indicesUint16 = m
  31536. ? new Uint32Array(this.indices)
  31537. : new Uint16Array(this.indices)),
  31538. (this.batchable = this.isBatchable()),
  31539. this.batchable ? this.packBatches() : this.buildDrawCalls();
  31540. } else this.batchable = !0;
  31541. }
  31542. } else this.batchable = !0;
  31543. }),
  31544. (e.prototype._compareStyles = function (t, e) {
  31545. return (
  31546. !(!t || !e) &&
  31547. t.texture.baseTexture === e.texture.baseTexture &&
  31548. t.color + t.alpha === e.color + e.alpha &&
  31549. !!t.native == !!e.native
  31550. );
  31551. }),
  31552. (e.prototype.validateBatching = function () {
  31553. if (this.dirty === this.cacheDirty || !this.graphicsData.length)
  31554. return !1;
  31555. for (var t = 0, e = this.graphicsData.length; t < e; t++) {
  31556. var r = this.graphicsData[t],
  31557. n = r.fillStyle,
  31558. i = r.lineStyle;
  31559. if (n && !n.texture.baseTexture.valid) return !1;
  31560. if (i && !i.texture.baseTexture.valid) return !1;
  31561. }
  31562. return !0;
  31563. }),
  31564. (e.prototype.packBatches = function () {
  31565. this.batchDirty++, (this.uvsFloat32 = new Float32Array(this.uvs));
  31566. for (var t = this.batches, e = 0, r = t.length; e < r; e++)
  31567. for (var n = t[e], i = 0; i < n.size; i++) {
  31568. var o = n.start + i;
  31569. this.indicesUint16[o] = this.indicesUint16[o] - n.attribStart;
  31570. }
  31571. }),
  31572. (e.prototype.isBatchable = function () {
  31573. if (this.points.length > 131070) return !1;
  31574. for (var t = this.batches, r = 0; r < t.length; r++)
  31575. if (t[r].style.native) return !1;
  31576. return this.points.length < 2 * e.BATCHABLE_SIZE;
  31577. }),
  31578. (e.prototype.buildDrawCalls = function () {
  31579. for (var t = ++aL._globalBatch, e = 0; e < this.drawCalls.length; e++)
  31580. this.drawCalls[e].texArray.clear(), dB.push(this.drawCalls[e]);
  31581. this.drawCalls.length = 0;
  31582. var r = this.colors,
  31583. n = this.textureIds,
  31584. i = dB.pop();
  31585. i || ((i = new nN()).texArray = new iN()),
  31586. (i.texArray.count = 0),
  31587. (i.start = 0),
  31588. (i.size = 0),
  31589. (i.type = IP.TRIANGLES);
  31590. var o = 0,
  31591. s = null,
  31592. a = 0,
  31593. u = !1,
  31594. c = IP.TRIANGLES,
  31595. h = 0;
  31596. this.drawCalls.push(i);
  31597. for (e = 0; e < this.batches.length; e++) {
  31598. var l = this.batches[e],
  31599. d = l.style,
  31600. f = d.texture.baseTexture;
  31601. u !== !!d.native &&
  31602. ((c = (u = !!d.native) ? IP.LINES : IP.TRIANGLES),
  31603. (s = null),
  31604. (o = 8),
  31605. t++),
  31606. s !== f &&
  31607. ((s = f),
  31608. f._batchEnabled !== t &&
  31609. (8 === o &&
  31610. (t++,
  31611. (o = 0),
  31612. i.size > 0 &&
  31613. ((i = dB.pop()) || ((i = new nN()).texArray = new iN()),
  31614. this.drawCalls.push(i)),
  31615. (i.start = h),
  31616. (i.size = 0),
  31617. (i.texArray.count = 0),
  31618. (i.type = c)),
  31619. (f.touched = 1),
  31620. (f._batchEnabled = t),
  31621. (f._batchLocation = o),
  31622. (f.wrapMode = kP.REPEAT),
  31623. (i.texArray.elements[i.texArray.count++] = f),
  31624. o++)),
  31625. (i.size += l.size),
  31626. (h += l.size),
  31627. (a = f._batchLocation),
  31628. this.addColors(r, d.color, d.alpha, l.attribSize, l.attribStart),
  31629. this.addTextureIds(n, a, l.attribSize, l.attribStart);
  31630. }
  31631. (aL._globalBatch = t), this.packAttributes();
  31632. }),
  31633. (e.prototype.packAttributes = function () {
  31634. for (
  31635. var t = this.points,
  31636. e = this.uvs,
  31637. r = this.colors,
  31638. n = this.textureIds,
  31639. i = new ArrayBuffer(3 * t.length * 4),
  31640. o = new Float32Array(i),
  31641. s = new Uint32Array(i),
  31642. a = 0,
  31643. u = 0;
  31644. u < t.length / 2;
  31645. u++
  31646. )
  31647. (o[a++] = t[2 * u]),
  31648. (o[a++] = t[2 * u + 1]),
  31649. (o[a++] = e[2 * u]),
  31650. (o[a++] = e[2 * u + 1]),
  31651. (s[a++] = r[u]),
  31652. (o[a++] = n[u]);
  31653. this._buffer.update(i), this._indexBuffer.update(this.indicesUint16);
  31654. }),
  31655. (e.prototype.processFill = function (t) {
  31656. t.holes.length
  31657. ? qk.triangulate(t, this)
  31658. : hB[t.type].triangulate(t, this);
  31659. }),
  31660. (e.prototype.processLine = function (t) {
  31661. iB(t, this);
  31662. for (var e = 0; e < t.holes.length; e++) iB(t.holes[e], this);
  31663. }),
  31664. (e.prototype.processHoles = function (t) {
  31665. for (var e = 0; e < t.length; e++) {
  31666. var r = t[e];
  31667. hB[r.type].build(r),
  31668. r.matrix && this.transformPoints(r.points, r.matrix);
  31669. }
  31670. }),
  31671. (e.prototype.calculateBounds = function () {
  31672. var t = this._bounds;
  31673. t.clear(),
  31674. t.addVertexData(this.points, 0, this.points.length),
  31675. t.pad(this.boundsPadding, this.boundsPadding);
  31676. }),
  31677. (e.prototype.transformPoints = function (t, e) {
  31678. for (var r = 0; r < t.length / 2; r++) {
  31679. var n = t[2 * r],
  31680. i = t[2 * r + 1];
  31681. (t[2 * r] = e.a * n + e.c * i + e.tx),
  31682. (t[2 * r + 1] = e.b * n + e.d * i + e.ty);
  31683. }
  31684. }),
  31685. (e.prototype.addColors = function (t, e, r, n, i) {
  31686. void 0 === i && (i = 0);
  31687. var o = KM((e >> 16) + (65280 & e) + ((255 & e) << 16), r);
  31688. t.length = Math.max(t.length, i + n);
  31689. for (var s = 0; s < n; s++) t[i + s] = o;
  31690. }),
  31691. (e.prototype.addTextureIds = function (t, e, r, n) {
  31692. void 0 === n && (n = 0), (t.length = Math.max(t.length, n + r));
  31693. for (var i = 0; i < r; i++) t[n + i] = e;
  31694. }),
  31695. (e.prototype.addUvs = function (t, e, r, n, i, o) {
  31696. void 0 === o && (o = null);
  31697. for (var s = 0, a = e.length, u = r.frame; s < i; ) {
  31698. var c = t[2 * (n + s)],
  31699. h = t[2 * (n + s) + 1];
  31700. if (o) {
  31701. var l = o.a * c + o.c * h + o.tx;
  31702. (h = o.b * c + o.d * h + o.ty), (c = l);
  31703. }
  31704. s++, e.push(c / u.width, h / u.height);
  31705. }
  31706. var d = r.baseTexture;
  31707. (u.width < d.width || u.height < d.height) &&
  31708. this.adjustUvs(e, r, a, i);
  31709. }),
  31710. (e.prototype.adjustUvs = function (t, e, r, n) {
  31711. for (
  31712. var i = e.baseTexture,
  31713. o = 1e-6,
  31714. s = r + 2 * n,
  31715. a = e.frame,
  31716. u = a.width / i.width,
  31717. c = a.height / i.height,
  31718. h = a.x / a.width,
  31719. l = a.y / a.height,
  31720. d = Math.floor(t[r] + o),
  31721. f = Math.floor(t[r + 1] + o),
  31722. p = r + 2;
  31723. p < s;
  31724. p += 2
  31725. )
  31726. (d = Math.min(d, Math.floor(t[p] + o))),
  31727. (f = Math.min(f, Math.floor(t[p + 1] + o)));
  31728. (h -= d), (l -= f);
  31729. for (p = r; p < s; p += 2)
  31730. (t[p] = (t[p] + h) * u), (t[p + 1] = (t[p + 1] + l) * c);
  31731. }),
  31732. (e.BATCHABLE_SIZE = 100),
  31733. e
  31734. );
  31735. })(uN),
  31736. mB = (function (t) {
  31737. function e() {
  31738. var e = (null !== t && t.apply(this, arguments)) || this;
  31739. return (
  31740. (e.width = 0),
  31741. (e.alignment = 0.5),
  31742. (e.native = !1),
  31743. (e.cap = Xk.BUTT),
  31744. (e.join = jk.MITER),
  31745. (e.miterLimit = 10),
  31746. e
  31747. );
  31748. }
  31749. return (
  31750. Jk(e, t),
  31751. (e.prototype.clone = function () {
  31752. var t = new e();
  31753. return (
  31754. (t.color = this.color),
  31755. (t.alpha = this.alpha),
  31756. (t.texture = this.texture),
  31757. (t.matrix = this.matrix),
  31758. (t.visible = this.visible),
  31759. (t.width = this.width),
  31760. (t.alignment = this.alignment),
  31761. (t.native = this.native),
  31762. (t.cap = this.cap),
  31763. (t.join = this.join),
  31764. (t.miterLimit = this.miterLimit),
  31765. t
  31766. );
  31767. }),
  31768. (e.prototype.reset = function () {
  31769. t.prototype.reset.call(this),
  31770. (this.color = 0),
  31771. (this.alignment = 0.5),
  31772. (this.width = 0),
  31773. (this.native = !1);
  31774. }),
  31775. e
  31776. );
  31777. })(zk),
  31778. yB = new Float32Array(3),
  31779. gB = {},
  31780. _B = (function (t) {
  31781. function e(e) {
  31782. void 0 === e && (e = null);
  31783. var r = t.call(this) || this;
  31784. return (
  31785. (r.shader = null),
  31786. (r.pluginName = 'batch'),
  31787. (r.currentPath = null),
  31788. (r.batches = []),
  31789. (r.batchTint = -1),
  31790. (r.batchDirty = -1),
  31791. (r.vertexData = null),
  31792. (r._fillStyle = new zk()),
  31793. (r._lineStyle = new mB()),
  31794. (r._matrix = null),
  31795. (r._holeMode = !1),
  31796. (r.state = xF.for2d()),
  31797. (r._geometry = e || new vB()),
  31798. r._geometry.refCount++,
  31799. (r._transformID = -1),
  31800. (r.tint = 16777215),
  31801. (r.blendMode = OP.NORMAL),
  31802. r
  31803. );
  31804. }
  31805. return (
  31806. Jk(e, t),
  31807. Object.defineProperty(e.prototype, 'geometry', {
  31808. get: function () {
  31809. return this._geometry;
  31810. },
  31811. enumerable: !1,
  31812. configurable: !0,
  31813. }),
  31814. (e.prototype.clone = function () {
  31815. return this.finishPoly(), new e(this._geometry);
  31816. }),
  31817. Object.defineProperty(e.prototype, 'blendMode', {
  31818. get: function () {
  31819. return this.state.blendMode;
  31820. },
  31821. set: function (t) {
  31822. this.state.blendMode = t;
  31823. },
  31824. enumerable: !1,
  31825. configurable: !0,
  31826. }),
  31827. Object.defineProperty(e.prototype, 'tint', {
  31828. get: function () {
  31829. return this._tint;
  31830. },
  31831. set: function (t) {
  31832. this._tint = t;
  31833. },
  31834. enumerable: !1,
  31835. configurable: !0,
  31836. }),
  31837. Object.defineProperty(e.prototype, 'fill', {
  31838. get: function () {
  31839. return this._fillStyle;
  31840. },
  31841. enumerable: !1,
  31842. configurable: !0,
  31843. }),
  31844. Object.defineProperty(e.prototype, 'line', {
  31845. get: function () {
  31846. return this._lineStyle;
  31847. },
  31848. enumerable: !1,
  31849. configurable: !0,
  31850. }),
  31851. (e.prototype.lineStyle = function (t, e, r, n, i) {
  31852. return (
  31853. void 0 === t && (t = null),
  31854. void 0 === e && (e = 0),
  31855. void 0 === r && (r = 1),
  31856. void 0 === n && (n = 0.5),
  31857. void 0 === i && (i = !1),
  31858. 'number' == typeof t &&
  31859. (t = { width: t, color: e, alpha: r, alignment: n, native: i }),
  31860. this.lineTextureStyle(t)
  31861. );
  31862. }),
  31863. (e.prototype.lineTextureStyle = function (t) {
  31864. (t = Object.assign(
  31865. {
  31866. width: 0,
  31867. texture: EL.WHITE,
  31868. color: t && t.texture ? 16777215 : 0,
  31869. alpha: 1,
  31870. matrix: null,
  31871. alignment: 0.5,
  31872. native: !1,
  31873. cap: Xk.BUTT,
  31874. join: jk.MITER,
  31875. miterLimit: 10,
  31876. },
  31877. t
  31878. )),
  31879. this.currentPath && this.startPoly();
  31880. var e = t.width > 0 && t.alpha > 0;
  31881. return (
  31882. e
  31883. ? (t.matrix && ((t.matrix = t.matrix.clone()), t.matrix.invert()),
  31884. Object.assign(this._lineStyle, { visible: e }, t))
  31885. : this._lineStyle.reset(),
  31886. this
  31887. );
  31888. }),
  31889. (e.prototype.startPoly = function () {
  31890. if (this.currentPath) {
  31891. var t = this.currentPath.points,
  31892. e = this.currentPath.points.length;
  31893. e > 2 &&
  31894. (this.drawShape(this.currentPath),
  31895. (this.currentPath = new SD()),
  31896. (this.currentPath.closeStroke = !1),
  31897. this.currentPath.points.push(t[e - 2], t[e - 1]));
  31898. } else
  31899. (this.currentPath = new SD()), (this.currentPath.closeStroke = !1);
  31900. }),
  31901. (e.prototype.finishPoly = function () {
  31902. this.currentPath &&
  31903. (this.currentPath.points.length > 2
  31904. ? (this.drawShape(this.currentPath), (this.currentPath = null))
  31905. : (this.currentPath.points.length = 0));
  31906. }),
  31907. (e.prototype.moveTo = function (t, e) {
  31908. return (
  31909. this.startPoly(),
  31910. (this.currentPath.points[0] = t),
  31911. (this.currentPath.points[1] = e),
  31912. this
  31913. );
  31914. }),
  31915. (e.prototype.lineTo = function (t, e) {
  31916. this.currentPath || this.moveTo(0, 0);
  31917. var r = this.currentPath.points,
  31918. n = r[r.length - 2],
  31919. i = r[r.length - 1];
  31920. return (n === t && i === e) || r.push(t, e), this;
  31921. }),
  31922. (e.prototype._initCurve = function (t, e) {
  31923. void 0 === t && (t = 0),
  31924. void 0 === e && (e = 0),
  31925. this.currentPath
  31926. ? 0 === this.currentPath.points.length &&
  31927. (this.currentPath.points = [t, e])
  31928. : this.moveTo(t, e);
  31929. }),
  31930. (e.prototype.quadraticCurveTo = function (t, e, r, n) {
  31931. this._initCurve();
  31932. var i = this.currentPath.points;
  31933. return (
  31934. 0 === i.length && this.moveTo(0, 0), uB.curveTo(t, e, r, n, i), this
  31935. );
  31936. }),
  31937. (e.prototype.bezierCurveTo = function (t, e, r, n, i, o) {
  31938. return (
  31939. this._initCurve(),
  31940. aB.curveTo(t, e, r, n, i, o, this.currentPath.points),
  31941. this
  31942. );
  31943. }),
  31944. (e.prototype.arcTo = function (t, e, r, n, i) {
  31945. this._initCurve(t, e);
  31946. var o = this.currentPath.points,
  31947. s = sB.curveTo(t, e, r, n, i, o);
  31948. if (s) {
  31949. var a = s.cx,
  31950. u = s.cy,
  31951. c = s.radius,
  31952. h = s.startAngle,
  31953. l = s.endAngle,
  31954. d = s.anticlockwise;
  31955. this.arc(a, u, c, h, l, d);
  31956. }
  31957. return this;
  31958. }),
  31959. (e.prototype.arc = function (t, e, r, n, i, o) {
  31960. if ((void 0 === o && (o = !1), n === i)) return this;
  31961. if (
  31962. (!o && i <= n ? (i += mD) : o && n <= i && (n += mD), 0 === i - n)
  31963. )
  31964. return this;
  31965. var s = t + Math.cos(n) * r,
  31966. a = e + Math.sin(n) * r,
  31967. u = this._geometry.closePointEps,
  31968. c = this.currentPath ? this.currentPath.points : null;
  31969. if (c) {
  31970. var h = Math.abs(c[c.length - 2] - s),
  31971. l = Math.abs(c[c.length - 1] - a);
  31972. (h < u && l < u) || c.push(s, a);
  31973. } else this.moveTo(s, a), (c = this.currentPath.points);
  31974. return sB.arc(s, a, t, e, r, n, i, o, c), this;
  31975. }),
  31976. (e.prototype.beginFill = function (t, e) {
  31977. return (
  31978. void 0 === t && (t = 0),
  31979. void 0 === e && (e = 1),
  31980. this.beginTextureFill({ texture: EL.WHITE, color: t, alpha: e })
  31981. );
  31982. }),
  31983. (e.prototype.beginTextureFill = function (t) {
  31984. (t = Object.assign(
  31985. { texture: EL.WHITE, color: 16777215, alpha: 1, matrix: null },
  31986. t
  31987. )),
  31988. this.currentPath && this.startPoly();
  31989. var e = t.alpha > 0;
  31990. return (
  31991. e
  31992. ? (t.matrix && ((t.matrix = t.matrix.clone()), t.matrix.invert()),
  31993. Object.assign(this._fillStyle, { visible: e }, t))
  31994. : this._fillStyle.reset(),
  31995. this
  31996. );
  31997. }),
  31998. (e.prototype.endFill = function () {
  31999. return this.finishPoly(), this._fillStyle.reset(), this;
  32000. }),
  32001. (e.prototype.drawRect = function (t, e, r, n) {
  32002. return this.drawShape(new TD(t, e, r, n));
  32003. }),
  32004. (e.prototype.drawRoundedRect = function (t, e, r, n, i) {
  32005. return this.drawShape(new wD(t, e, r, n, i));
  32006. }),
  32007. (e.prototype.drawCircle = function (t, e, r) {
  32008. return this.drawShape(new xD(t, e, r));
  32009. }),
  32010. (e.prototype.drawEllipse = function (t, e, r, n) {
  32011. return this.drawShape(new ED(t, e, r, n));
  32012. }),
  32013. (e.prototype.drawPolygon = function () {
  32014. for (var t, e = arguments, r = [], n = 0; n < arguments.length; n++)
  32015. r[n] = e[n];
  32016. var i = !0,
  32017. o = r[0];
  32018. o.points
  32019. ? ((i = o.closeStroke), (t = o.points))
  32020. : (t = Array.isArray(r[0]) ? r[0] : r);
  32021. var s = new SD(t);
  32022. return (s.closeStroke = i), this.drawShape(s), this;
  32023. }),
  32024. (e.prototype.drawShape = function (t) {
  32025. return (
  32026. this._holeMode
  32027. ? this._geometry.drawHole(t, this._matrix)
  32028. : this._geometry.drawShape(
  32029. t,
  32030. this._fillStyle.clone(),
  32031. this._lineStyle.clone(),
  32032. this._matrix
  32033. ),
  32034. this
  32035. );
  32036. }),
  32037. (e.prototype.clear = function () {
  32038. return (
  32039. this._geometry.clear(),
  32040. this._lineStyle.reset(),
  32041. this._fillStyle.reset(),
  32042. this._boundsID++,
  32043. (this._matrix = null),
  32044. (this._holeMode = !1),
  32045. (this.currentPath = null),
  32046. this
  32047. );
  32048. }),
  32049. (e.prototype.isFastRect = function () {
  32050. var t = this._geometry.graphicsData;
  32051. return !(
  32052. 1 !== t.length ||
  32053. t[0].shape.type !== vD.RECT ||
  32054. t[0].matrix ||
  32055. t[0].holes.length ||
  32056. (t[0].lineStyle.visible && t[0].lineStyle.width)
  32057. );
  32058. }),
  32059. (e.prototype._render = function (t) {
  32060. this.finishPoly();
  32061. var e = this._geometry;
  32062. e.updateBatches(),
  32063. e.batchable
  32064. ? (this.batchDirty !== e.batchDirty && this._populateBatches(),
  32065. this._renderBatched(t))
  32066. : (t.batch.flush(), this._renderDirect(t));
  32067. }),
  32068. (e.prototype._populateBatches = function () {
  32069. var t = this._geometry,
  32070. e = this.blendMode,
  32071. r = t.batches.length;
  32072. (this.batchTint = -1),
  32073. (this._transformID = -1),
  32074. (this.batchDirty = t.batchDirty),
  32075. (this.batches.length = r),
  32076. (this.vertexData = new Float32Array(t.points));
  32077. for (var n = 0; n < r; n++) {
  32078. var i = t.batches[n],
  32079. o = i.style.color,
  32080. s = new Float32Array(
  32081. this.vertexData.buffer,
  32082. 4 * i.attribStart * 2,
  32083. 2 * i.attribSize
  32084. ),
  32085. a = new Float32Array(
  32086. t.uvsFloat32.buffer,
  32087. 4 * i.attribStart * 2,
  32088. 2 * i.attribSize
  32089. ),
  32090. u = {
  32091. vertexData: s,
  32092. blendMode: e,
  32093. indices: new Uint16Array(
  32094. t.indicesUint16.buffer,
  32095. 2 * i.start,
  32096. i.size
  32097. ),
  32098. uvs: a,
  32099. _batchRGB: HM(o),
  32100. _tintRGB: o,
  32101. _texture: i.style.texture,
  32102. alpha: i.style.alpha,
  32103. worldAlpha: 1,
  32104. };
  32105. this.batches[n] = u;
  32106. }
  32107. }),
  32108. (e.prototype._renderBatched = function (t) {
  32109. if (this.batches.length) {
  32110. t.batch.setObjectRenderer(t.plugins[this.pluginName]),
  32111. this.calculateVertices(),
  32112. this.calculateTints();
  32113. for (var e = 0, r = this.batches.length; e < r; e++) {
  32114. var n = this.batches[e];
  32115. (n.worldAlpha = this.worldAlpha * n.alpha),
  32116. t.plugins[this.pluginName].render(n);
  32117. }
  32118. }
  32119. }),
  32120. (e.prototype._renderDirect = function (t) {
  32121. var e = this._resolveDirectShader(t),
  32122. r = this._geometry,
  32123. n = this.tint,
  32124. i = this.worldAlpha,
  32125. o = e.uniforms,
  32126. s = r.drawCalls;
  32127. (o.translationMatrix = this.transform.worldTransform),
  32128. (o.tint[0] = (((n >> 16) & 255) / 255) * i),
  32129. (o.tint[1] = (((n >> 8) & 255) / 255) * i),
  32130. (o.tint[2] = ((255 & n) / 255) * i),
  32131. (o.tint[3] = i),
  32132. t.shader.bind(e),
  32133. t.geometry.bind(r, e),
  32134. t.state.set(this.state);
  32135. for (var a = 0, u = s.length; a < u; a++)
  32136. this._renderDrawCallDirect(t, r.drawCalls[a]);
  32137. }),
  32138. (e.prototype._renderDrawCallDirect = function (t, e) {
  32139. for (
  32140. var r = e.texArray,
  32141. n = e.type,
  32142. i = e.size,
  32143. o = e.start,
  32144. s = r.count,
  32145. a = 0;
  32146. a < s;
  32147. a++
  32148. )
  32149. t.texture.bind(r.elements[a], a);
  32150. t.geometry.draw(n, i, o);
  32151. }),
  32152. (e.prototype._resolveDirectShader = function (t) {
  32153. var e = this.shader,
  32154. r = this.pluginName;
  32155. if (!e) {
  32156. if (!gB[r]) {
  32157. for (
  32158. var n = t.plugins[r].MAX_TEXTURES, i = new Int32Array(n), o = 0;
  32159. o < n;
  32160. o++
  32161. )
  32162. i[o] = o;
  32163. var s = {
  32164. tint: new Float32Array([1, 1, 1, 1]),
  32165. translationMatrix: new CD(),
  32166. default: kL.from({ uSamplers: i }, !0),
  32167. },
  32168. a = t.plugins[r]._shader.program;
  32169. gB[r] = new TF(a, s);
  32170. }
  32171. e = gB[r];
  32172. }
  32173. return e;
  32174. }),
  32175. (e.prototype._calculateBounds = function () {
  32176. this.finishPoly();
  32177. var t = this._geometry;
  32178. if (t.graphicsData.length) {
  32179. var e = t.bounds,
  32180. r = e.minX,
  32181. n = e.minY,
  32182. i = e.maxX,
  32183. o = e.maxY;
  32184. this._bounds.addFrame(this.transform, r, n, i, o);
  32185. }
  32186. }),
  32187. (e.prototype.containsPoint = function (t) {
  32188. return (
  32189. this.worldTransform.applyInverse(t, e._TEMP_POINT),
  32190. this._geometry.containsPoint(e._TEMP_POINT)
  32191. );
  32192. }),
  32193. (e.prototype.calculateTints = function () {
  32194. if (this.batchTint !== this.tint) {
  32195. this.batchTint = this.tint;
  32196. for (
  32197. var t = HM(this.tint, yB), e = 0;
  32198. e < this.batches.length;
  32199. e++
  32200. ) {
  32201. var r = this.batches[e],
  32202. n = r._batchRGB,
  32203. i =
  32204. ((t[0] * n[0] * 255) << 16) +
  32205. ((t[1] * n[1] * 255) << 8) +
  32206. (0 | (t[2] * n[2] * 255));
  32207. r._tintRGB = (i >> 16) + (65280 & i) + ((255 & i) << 16);
  32208. }
  32209. }
  32210. }),
  32211. (e.prototype.calculateVertices = function () {
  32212. var t = this.transform._worldID;
  32213. if (this._transformID !== t) {
  32214. this._transformID = t;
  32215. for (
  32216. var e = this.transform.worldTransform,
  32217. r = e.a,
  32218. n = e.b,
  32219. i = e.c,
  32220. o = e.d,
  32221. s = e.tx,
  32222. a = e.ty,
  32223. u = this._geometry.points,
  32224. c = this.vertexData,
  32225. h = 0,
  32226. l = 0;
  32227. l < u.length;
  32228. l += 2
  32229. ) {
  32230. var d = u[l],
  32231. f = u[l + 1];
  32232. (c[h++] = r * d + i * f + s), (c[h++] = o * f + n * d + a);
  32233. }
  32234. }
  32235. }),
  32236. (e.prototype.closePath = function () {
  32237. var t = this.currentPath;
  32238. return t && ((t.closeStroke = !0), this.finishPoly()), this;
  32239. }),
  32240. (e.prototype.setMatrix = function (t) {
  32241. return (this._matrix = t), this;
  32242. }),
  32243. (e.prototype.beginHole = function () {
  32244. return this.finishPoly(), (this._holeMode = !0), this;
  32245. }),
  32246. (e.prototype.endHole = function () {
  32247. return this.finishPoly(), (this._holeMode = !1), this;
  32248. }),
  32249. (e.prototype.destroy = function (e) {
  32250. this._geometry.refCount--,
  32251. 0 === this._geometry.refCount && this._geometry.dispose(),
  32252. (this._matrix = null),
  32253. (this.currentPath = null),
  32254. this._lineStyle.destroy(),
  32255. (this._lineStyle = null),
  32256. this._fillStyle.destroy(),
  32257. (this._fillStyle = null),
  32258. (this._geometry = null),
  32259. (this.shader = null),
  32260. (this.vertexData = null),
  32261. (this.batches.length = 0),
  32262. (this.batches = null),
  32263. t.prototype.destroy.call(this, e);
  32264. }),
  32265. (e.nextRoundedRectBehavior = !1),
  32266. (e._TEMP_POINT = new _D()),
  32267. e
  32268. );
  32269. })(VD),
  32270. bB = function (t, e) {
  32271. return (
  32272. (bB =
  32273. Object.setPrototypeOf ||
  32274. ({ __proto__: [] } instanceof Array &&
  32275. function (t, e) {
  32276. t.__proto__ = e;
  32277. }) ||
  32278. function (t, e) {
  32279. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  32280. }),
  32281. bB(t, e)
  32282. );
  32283. };
  32284. var TB,
  32285. xB = new _D(),
  32286. EB = new Uint16Array([0, 1, 2, 0, 2, 3]),
  32287. SB = (function (t) {
  32288. function e(e) {
  32289. var r = t.call(this) || this;
  32290. return (
  32291. (r._anchor = new RD(
  32292. r._onAnchorUpdate,
  32293. r,
  32294. e ? e.defaultAnchor.x : 0,
  32295. e ? e.defaultAnchor.y : 0
  32296. )),
  32297. (r._texture = null),
  32298. (r._width = 0),
  32299. (r._height = 0),
  32300. (r._tint = null),
  32301. (r._tintRGB = null),
  32302. (r.tint = 16777215),
  32303. (r.blendMode = OP.NORMAL),
  32304. (r._cachedTint = 16777215),
  32305. (r.uvs = null),
  32306. (r.texture = e || EL.EMPTY),
  32307. (r.vertexData = new Float32Array(8)),
  32308. (r.vertexTrimmedData = null),
  32309. (r._transformID = -1),
  32310. (r._textureID = -1),
  32311. (r._transformTrimmedID = -1),
  32312. (r._textureTrimmedID = -1),
  32313. (r.indices = EB),
  32314. (r.pluginName = 'batch'),
  32315. (r.isSprite = !0),
  32316. (r._roundPixels = vA.ROUND_PIXELS),
  32317. r
  32318. );
  32319. }
  32320. return (
  32321. (function (t, e) {
  32322. function r() {
  32323. this.constructor = t;
  32324. }
  32325. bB(t, e),
  32326. (t.prototype =
  32327. null === e
  32328. ? Object.create(e)
  32329. : ((r.prototype = e.prototype), new r()));
  32330. })(e, t),
  32331. (e.prototype._onTextureUpdate = function () {
  32332. (this._textureID = -1),
  32333. (this._textureTrimmedID = -1),
  32334. (this._cachedTint = 16777215),
  32335. this._width &&
  32336. (this.scale.x =
  32337. (nD(this.scale.x) * this._width) / this._texture.orig.width),
  32338. this._height &&
  32339. (this.scale.y =
  32340. (nD(this.scale.y) * this._height) / this._texture.orig.height);
  32341. }),
  32342. (e.prototype._onAnchorUpdate = function () {
  32343. (this._transformID = -1), (this._transformTrimmedID = -1);
  32344. }),
  32345. (e.prototype.calculateVertices = function () {
  32346. var t = this._texture;
  32347. if (
  32348. this._transformID !== this.transform._worldID ||
  32349. this._textureID !== t._updateID
  32350. ) {
  32351. this._textureID !== t._updateID &&
  32352. (this.uvs = this._texture._uvs.uvsFloat32),
  32353. (this._transformID = this.transform._worldID),
  32354. (this._textureID = t._updateID);
  32355. var e = this.transform.worldTransform,
  32356. r = e.a,
  32357. n = e.b,
  32358. i = e.c,
  32359. o = e.d,
  32360. s = e.tx,
  32361. a = e.ty,
  32362. u = this.vertexData,
  32363. c = t.trim,
  32364. h = t.orig,
  32365. l = this._anchor,
  32366. d = 0,
  32367. f = 0,
  32368. p = 0,
  32369. v = 0;
  32370. if (
  32371. (c
  32372. ? ((d = (f = c.x - l._x * h.width) + c.width),
  32373. (p = (v = c.y - l._y * h.height) + c.height))
  32374. : ((d = (f = -l._x * h.width) + h.width),
  32375. (p = (v = -l._y * h.height) + h.height)),
  32376. (u[0] = r * f + i * v + s),
  32377. (u[1] = o * v + n * f + a),
  32378. (u[2] = r * d + i * v + s),
  32379. (u[3] = o * v + n * d + a),
  32380. (u[4] = r * d + i * p + s),
  32381. (u[5] = o * p + n * d + a),
  32382. (u[6] = r * f + i * p + s),
  32383. (u[7] = o * p + n * f + a),
  32384. this._roundPixels)
  32385. )
  32386. for (var m = vA.RESOLUTION, y = 0; y < u.length; ++y)
  32387. u[y] = Math.round(((u[y] * m) | 0) / m);
  32388. }
  32389. }),
  32390. (e.prototype.calculateTrimmedVertices = function () {
  32391. if (this.vertexTrimmedData) {
  32392. if (
  32393. this._transformTrimmedID === this.transform._worldID &&
  32394. this._textureTrimmedID === this._texture._updateID
  32395. )
  32396. return;
  32397. } else this.vertexTrimmedData = new Float32Array(8);
  32398. (this._transformTrimmedID = this.transform._worldID),
  32399. (this._textureTrimmedID = this._texture._updateID);
  32400. var t = this._texture,
  32401. e = this.vertexTrimmedData,
  32402. r = t.orig,
  32403. n = this._anchor,
  32404. i = this.transform.worldTransform,
  32405. o = i.a,
  32406. s = i.b,
  32407. a = i.c,
  32408. u = i.d,
  32409. c = i.tx,
  32410. h = i.ty,
  32411. l = -n._x * r.width,
  32412. d = l + r.width,
  32413. f = -n._y * r.height,
  32414. p = f + r.height;
  32415. (e[0] = o * l + a * f + c),
  32416. (e[1] = u * f + s * l + h),
  32417. (e[2] = o * d + a * f + c),
  32418. (e[3] = u * f + s * d + h),
  32419. (e[4] = o * d + a * p + c),
  32420. (e[5] = u * p + s * d + h),
  32421. (e[6] = o * l + a * p + c),
  32422. (e[7] = u * p + s * l + h);
  32423. }),
  32424. (e.prototype._render = function (t) {
  32425. this.calculateVertices(),
  32426. t.batch.setObjectRenderer(t.plugins[this.pluginName]),
  32427. t.plugins[this.pluginName].render(this);
  32428. }),
  32429. (e.prototype._calculateBounds = function () {
  32430. var t = this._texture.trim,
  32431. e = this._texture.orig;
  32432. !t || (t.width === e.width && t.height === e.height)
  32433. ? (this.calculateVertices(), this._bounds.addQuad(this.vertexData))
  32434. : (this.calculateTrimmedVertices(),
  32435. this._bounds.addQuad(this.vertexTrimmedData));
  32436. }),
  32437. (e.prototype.getLocalBounds = function (e) {
  32438. return 0 === this.children.length
  32439. ? (this._localBounds || (this._localBounds = new kD()),
  32440. (this._localBounds.minX =
  32441. this._texture.orig.width * -this._anchor._x),
  32442. (this._localBounds.minY =
  32443. this._texture.orig.height * -this._anchor._y),
  32444. (this._localBounds.maxX =
  32445. this._texture.orig.width * (1 - this._anchor._x)),
  32446. (this._localBounds.maxY =
  32447. this._texture.orig.height * (1 - this._anchor._y)),
  32448. e ||
  32449. (this._localBoundsRect || (this._localBoundsRect = new TD()),
  32450. (e = this._localBoundsRect)),
  32451. this._localBounds.getRectangle(e))
  32452. : t.prototype.getLocalBounds.call(this, e);
  32453. }),
  32454. (e.prototype.containsPoint = function (t) {
  32455. this.worldTransform.applyInverse(t, xB);
  32456. var e = this._texture.orig.width,
  32457. r = this._texture.orig.height,
  32458. n = -e * this.anchor.x,
  32459. i = 0;
  32460. return (
  32461. xB.x >= n &&
  32462. xB.x < n + e &&
  32463. ((i = -r * this.anchor.y), xB.y >= i && xB.y < i + r)
  32464. );
  32465. }),
  32466. (e.prototype.destroy = function (e) {
  32467. if (
  32468. (t.prototype.destroy.call(this, e),
  32469. this._texture.off('update', this._onTextureUpdate, this),
  32470. (this._anchor = null),
  32471. 'boolean' == typeof e ? e : e && e.texture)
  32472. ) {
  32473. var r = 'boolean' == typeof e ? e : e && e.baseTexture;
  32474. this._texture.destroy(!!r);
  32475. }
  32476. this._texture = null;
  32477. }),
  32478. (e.from = function (t, r) {
  32479. return new e(t instanceof EL ? t : EL.from(t, r));
  32480. }),
  32481. Object.defineProperty(e.prototype, 'roundPixels', {
  32482. get: function () {
  32483. return this._roundPixels;
  32484. },
  32485. set: function (t) {
  32486. this._roundPixels !== t && (this._transformID = -1),
  32487. (this._roundPixels = t);
  32488. },
  32489. enumerable: !1,
  32490. configurable: !0,
  32491. }),
  32492. Object.defineProperty(e.prototype, 'width', {
  32493. get: function () {
  32494. return Math.abs(this.scale.x) * this._texture.orig.width;
  32495. },
  32496. set: function (t) {
  32497. var e = nD(this.scale.x) || 1;
  32498. (this.scale.x = (e * t) / this._texture.orig.width),
  32499. (this._width = t);
  32500. },
  32501. enumerable: !1,
  32502. configurable: !0,
  32503. }),
  32504. Object.defineProperty(e.prototype, 'height', {
  32505. get: function () {
  32506. return Math.abs(this.scale.y) * this._texture.orig.height;
  32507. },
  32508. set: function (t) {
  32509. var e = nD(this.scale.y) || 1;
  32510. (this.scale.y = (e * t) / this._texture.orig.height),
  32511. (this._height = t);
  32512. },
  32513. enumerable: !1,
  32514. configurable: !0,
  32515. }),
  32516. Object.defineProperty(e.prototype, 'anchor', {
  32517. get: function () {
  32518. return this._anchor;
  32519. },
  32520. set: function (t) {
  32521. this._anchor.copyFrom(t);
  32522. },
  32523. enumerable: !1,
  32524. configurable: !0,
  32525. }),
  32526. Object.defineProperty(e.prototype, 'tint', {
  32527. get: function () {
  32528. return this._tint;
  32529. },
  32530. set: function (t) {
  32531. (this._tint = t),
  32532. (this._tintRGB = (t >> 16) + (65280 & t) + ((255 & t) << 16));
  32533. },
  32534. enumerable: !1,
  32535. configurable: !0,
  32536. }),
  32537. Object.defineProperty(e.prototype, 'texture', {
  32538. get: function () {
  32539. return this._texture;
  32540. },
  32541. set: function (t) {
  32542. this._texture !== t &&
  32543. (this._texture &&
  32544. this._texture.off('update', this._onTextureUpdate, this),
  32545. (this._texture = t || EL.EMPTY),
  32546. (this._cachedTint = 16777215),
  32547. (this._textureID = -1),
  32548. (this._textureTrimmedID = -1),
  32549. t &&
  32550. (t.baseTexture.valid
  32551. ? this._onTextureUpdate()
  32552. : t.once('update', this._onTextureUpdate, this)));
  32553. },
  32554. enumerable: !1,
  32555. configurable: !0,
  32556. }),
  32557. e
  32558. );
  32559. })(VD),
  32560. wB = function (t, e) {
  32561. return (
  32562. (wB =
  32563. Object.setPrototypeOf ||
  32564. ({ __proto__: [] } instanceof Array &&
  32565. function (t, e) {
  32566. t.__proto__ = e;
  32567. }) ||
  32568. function (t, e) {
  32569. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  32570. }),
  32571. wB(t, e)
  32572. );
  32573. };
  32574. !(function (t) {
  32575. (t[(t.LINEAR_VERTICAL = 0)] = 'LINEAR_VERTICAL'),
  32576. (t[(t.LINEAR_HORIZONTAL = 1)] = 'LINEAR_HORIZONTAL');
  32577. })(TB || (TB = {}));
  32578. var RB = {
  32579. align: 'left',
  32580. breakWords: !1,
  32581. dropShadow: !1,
  32582. dropShadowAlpha: 1,
  32583. dropShadowAngle: Math.PI / 6,
  32584. dropShadowBlur: 0,
  32585. dropShadowColor: 'black',
  32586. dropShadowDistance: 5,
  32587. fill: 'black',
  32588. fillGradientType: TB.LINEAR_VERTICAL,
  32589. fillGradientStops: [],
  32590. fontFamily: 'Arial',
  32591. fontSize: 26,
  32592. fontStyle: 'normal',
  32593. fontVariant: 'normal',
  32594. fontWeight: 'normal',
  32595. letterSpacing: 0,
  32596. lineHeight: 0,
  32597. lineJoin: 'miter',
  32598. miterLimit: 10,
  32599. padding: 0,
  32600. stroke: 'black',
  32601. strokeThickness: 0,
  32602. textBaseline: 'alphabetic',
  32603. trim: !1,
  32604. whiteSpace: 'pre',
  32605. wordWrap: !1,
  32606. wordWrapWidth: 100,
  32607. leading: 0,
  32608. },
  32609. CB = [
  32610. 'serif',
  32611. 'sans-serif',
  32612. 'monospace',
  32613. 'cursive',
  32614. 'fantasy',
  32615. 'system-ui',
  32616. ],
  32617. PB = (function () {
  32618. function t(t) {
  32619. (this.styleID = 0), this.reset(), IB(this, t, t);
  32620. }
  32621. return (
  32622. (t.prototype.clone = function () {
  32623. var e = {};
  32624. return IB(e, this, RB), new t(e);
  32625. }),
  32626. (t.prototype.reset = function () {
  32627. IB(this, RB, RB);
  32628. }),
  32629. Object.defineProperty(t.prototype, 'align', {
  32630. get: function () {
  32631. return this._align;
  32632. },
  32633. set: function (t) {
  32634. this._align !== t && ((this._align = t), this.styleID++);
  32635. },
  32636. enumerable: !1,
  32637. configurable: !0,
  32638. }),
  32639. Object.defineProperty(t.prototype, 'breakWords', {
  32640. get: function () {
  32641. return this._breakWords;
  32642. },
  32643. set: function (t) {
  32644. this._breakWords !== t && ((this._breakWords = t), this.styleID++);
  32645. },
  32646. enumerable: !1,
  32647. configurable: !0,
  32648. }),
  32649. Object.defineProperty(t.prototype, 'dropShadow', {
  32650. get: function () {
  32651. return this._dropShadow;
  32652. },
  32653. set: function (t) {
  32654. this._dropShadow !== t && ((this._dropShadow = t), this.styleID++);
  32655. },
  32656. enumerable: !1,
  32657. configurable: !0,
  32658. }),
  32659. Object.defineProperty(t.prototype, 'dropShadowAlpha', {
  32660. get: function () {
  32661. return this._dropShadowAlpha;
  32662. },
  32663. set: function (t) {
  32664. this._dropShadowAlpha !== t &&
  32665. ((this._dropShadowAlpha = t), this.styleID++);
  32666. },
  32667. enumerable: !1,
  32668. configurable: !0,
  32669. }),
  32670. Object.defineProperty(t.prototype, 'dropShadowAngle', {
  32671. get: function () {
  32672. return this._dropShadowAngle;
  32673. },
  32674. set: function (t) {
  32675. this._dropShadowAngle !== t &&
  32676. ((this._dropShadowAngle = t), this.styleID++);
  32677. },
  32678. enumerable: !1,
  32679. configurable: !0,
  32680. }),
  32681. Object.defineProperty(t.prototype, 'dropShadowBlur', {
  32682. get: function () {
  32683. return this._dropShadowBlur;
  32684. },
  32685. set: function (t) {
  32686. this._dropShadowBlur !== t &&
  32687. ((this._dropShadowBlur = t), this.styleID++);
  32688. },
  32689. enumerable: !1,
  32690. configurable: !0,
  32691. }),
  32692. Object.defineProperty(t.prototype, 'dropShadowColor', {
  32693. get: function () {
  32694. return this._dropShadowColor;
  32695. },
  32696. set: function (t) {
  32697. var e = OB(t);
  32698. this._dropShadowColor !== e &&
  32699. ((this._dropShadowColor = e), this.styleID++);
  32700. },
  32701. enumerable: !1,
  32702. configurable: !0,
  32703. }),
  32704. Object.defineProperty(t.prototype, 'dropShadowDistance', {
  32705. get: function () {
  32706. return this._dropShadowDistance;
  32707. },
  32708. set: function (t) {
  32709. this._dropShadowDistance !== t &&
  32710. ((this._dropShadowDistance = t), this.styleID++);
  32711. },
  32712. enumerable: !1,
  32713. configurable: !0,
  32714. }),
  32715. Object.defineProperty(t.prototype, 'fill', {
  32716. get: function () {
  32717. return this._fill;
  32718. },
  32719. set: function (t) {
  32720. var e = OB(t);
  32721. this._fill !== e && ((this._fill = e), this.styleID++);
  32722. },
  32723. enumerable: !1,
  32724. configurable: !0,
  32725. }),
  32726. Object.defineProperty(t.prototype, 'fillGradientType', {
  32727. get: function () {
  32728. return this._fillGradientType;
  32729. },
  32730. set: function (t) {
  32731. this._fillGradientType !== t &&
  32732. ((this._fillGradientType = t), this.styleID++);
  32733. },
  32734. enumerable: !1,
  32735. configurable: !0,
  32736. }),
  32737. Object.defineProperty(t.prototype, 'fillGradientStops', {
  32738. get: function () {
  32739. return this._fillGradientStops;
  32740. },
  32741. set: function (t) {
  32742. (function (t, e) {
  32743. if (!Array.isArray(t) || !Array.isArray(e)) return !1;
  32744. if (t.length !== e.length) return !1;
  32745. for (var r = 0; r < t.length; ++r) if (t[r] !== e[r]) return !1;
  32746. return !0;
  32747. })(this._fillGradientStops, t) ||
  32748. ((this._fillGradientStops = t), this.styleID++);
  32749. },
  32750. enumerable: !1,
  32751. configurable: !0,
  32752. }),
  32753. Object.defineProperty(t.prototype, 'fontFamily', {
  32754. get: function () {
  32755. return this._fontFamily;
  32756. },
  32757. set: function (t) {
  32758. this.fontFamily !== t && ((this._fontFamily = t), this.styleID++);
  32759. },
  32760. enumerable: !1,
  32761. configurable: !0,
  32762. }),
  32763. Object.defineProperty(t.prototype, 'fontSize', {
  32764. get: function () {
  32765. return this._fontSize;
  32766. },
  32767. set: function (t) {
  32768. this._fontSize !== t && ((this._fontSize = t), this.styleID++);
  32769. },
  32770. enumerable: !1,
  32771. configurable: !0,
  32772. }),
  32773. Object.defineProperty(t.prototype, 'fontStyle', {
  32774. get: function () {
  32775. return this._fontStyle;
  32776. },
  32777. set: function (t) {
  32778. this._fontStyle !== t && ((this._fontStyle = t), this.styleID++);
  32779. },
  32780. enumerable: !1,
  32781. configurable: !0,
  32782. }),
  32783. Object.defineProperty(t.prototype, 'fontVariant', {
  32784. get: function () {
  32785. return this._fontVariant;
  32786. },
  32787. set: function (t) {
  32788. this._fontVariant !== t &&
  32789. ((this._fontVariant = t), this.styleID++);
  32790. },
  32791. enumerable: !1,
  32792. configurable: !0,
  32793. }),
  32794. Object.defineProperty(t.prototype, 'fontWeight', {
  32795. get: function () {
  32796. return this._fontWeight;
  32797. },
  32798. set: function (t) {
  32799. this._fontWeight !== t && ((this._fontWeight = t), this.styleID++);
  32800. },
  32801. enumerable: !1,
  32802. configurable: !0,
  32803. }),
  32804. Object.defineProperty(t.prototype, 'letterSpacing', {
  32805. get: function () {
  32806. return this._letterSpacing;
  32807. },
  32808. set: function (t) {
  32809. this._letterSpacing !== t &&
  32810. ((this._letterSpacing = t), this.styleID++);
  32811. },
  32812. enumerable: !1,
  32813. configurable: !0,
  32814. }),
  32815. Object.defineProperty(t.prototype, 'lineHeight', {
  32816. get: function () {
  32817. return this._lineHeight;
  32818. },
  32819. set: function (t) {
  32820. this._lineHeight !== t && ((this._lineHeight = t), this.styleID++);
  32821. },
  32822. enumerable: !1,
  32823. configurable: !0,
  32824. }),
  32825. Object.defineProperty(t.prototype, 'leading', {
  32826. get: function () {
  32827. return this._leading;
  32828. },
  32829. set: function (t) {
  32830. this._leading !== t && ((this._leading = t), this.styleID++);
  32831. },
  32832. enumerable: !1,
  32833. configurable: !0,
  32834. }),
  32835. Object.defineProperty(t.prototype, 'lineJoin', {
  32836. get: function () {
  32837. return this._lineJoin;
  32838. },
  32839. set: function (t) {
  32840. this._lineJoin !== t && ((this._lineJoin = t), this.styleID++);
  32841. },
  32842. enumerable: !1,
  32843. configurable: !0,
  32844. }),
  32845. Object.defineProperty(t.prototype, 'miterLimit', {
  32846. get: function () {
  32847. return this._miterLimit;
  32848. },
  32849. set: function (t) {
  32850. this._miterLimit !== t && ((this._miterLimit = t), this.styleID++);
  32851. },
  32852. enumerable: !1,
  32853. configurable: !0,
  32854. }),
  32855. Object.defineProperty(t.prototype, 'padding', {
  32856. get: function () {
  32857. return this._padding;
  32858. },
  32859. set: function (t) {
  32860. this._padding !== t && ((this._padding = t), this.styleID++);
  32861. },
  32862. enumerable: !1,
  32863. configurable: !0,
  32864. }),
  32865. Object.defineProperty(t.prototype, 'stroke', {
  32866. get: function () {
  32867. return this._stroke;
  32868. },
  32869. set: function (t) {
  32870. var e = OB(t);
  32871. this._stroke !== e && ((this._stroke = e), this.styleID++);
  32872. },
  32873. enumerable: !1,
  32874. configurable: !0,
  32875. }),
  32876. Object.defineProperty(t.prototype, 'strokeThickness', {
  32877. get: function () {
  32878. return this._strokeThickness;
  32879. },
  32880. set: function (t) {
  32881. this._strokeThickness !== t &&
  32882. ((this._strokeThickness = t), this.styleID++);
  32883. },
  32884. enumerable: !1,
  32885. configurable: !0,
  32886. }),
  32887. Object.defineProperty(t.prototype, 'textBaseline', {
  32888. get: function () {
  32889. return this._textBaseline;
  32890. },
  32891. set: function (t) {
  32892. this._textBaseline !== t &&
  32893. ((this._textBaseline = t), this.styleID++);
  32894. },
  32895. enumerable: !1,
  32896. configurable: !0,
  32897. }),
  32898. Object.defineProperty(t.prototype, 'trim', {
  32899. get: function () {
  32900. return this._trim;
  32901. },
  32902. set: function (t) {
  32903. this._trim !== t && ((this._trim = t), this.styleID++);
  32904. },
  32905. enumerable: !1,
  32906. configurable: !0,
  32907. }),
  32908. Object.defineProperty(t.prototype, 'whiteSpace', {
  32909. get: function () {
  32910. return this._whiteSpace;
  32911. },
  32912. set: function (t) {
  32913. this._whiteSpace !== t && ((this._whiteSpace = t), this.styleID++);
  32914. },
  32915. enumerable: !1,
  32916. configurable: !0,
  32917. }),
  32918. Object.defineProperty(t.prototype, 'wordWrap', {
  32919. get: function () {
  32920. return this._wordWrap;
  32921. },
  32922. set: function (t) {
  32923. this._wordWrap !== t && ((this._wordWrap = t), this.styleID++);
  32924. },
  32925. enumerable: !1,
  32926. configurable: !0,
  32927. }),
  32928. Object.defineProperty(t.prototype, 'wordWrapWidth', {
  32929. get: function () {
  32930. return this._wordWrapWidth;
  32931. },
  32932. set: function (t) {
  32933. this._wordWrapWidth !== t &&
  32934. ((this._wordWrapWidth = t), this.styleID++);
  32935. },
  32936. enumerable: !1,
  32937. configurable: !0,
  32938. }),
  32939. (t.prototype.toFontString = function () {
  32940. var t =
  32941. 'number' == typeof this.fontSize
  32942. ? this.fontSize + 'px'
  32943. : this.fontSize,
  32944. e = this.fontFamily;
  32945. Array.isArray(this.fontFamily) || (e = this.fontFamily.split(','));
  32946. for (var r = e.length - 1; r >= 0; r--) {
  32947. var n = e[r].trim();
  32948. !/([\"\'])[^\'\"]+\1/.test(n) &&
  32949. CB.indexOf(n) < 0 &&
  32950. (n = '"' + n + '"'),
  32951. (e[r] = n);
  32952. }
  32953. return (
  32954. this.fontStyle +
  32955. ' ' +
  32956. this.fontVariant +
  32957. ' ' +
  32958. this.fontWeight +
  32959. ' ' +
  32960. t +
  32961. ' ' +
  32962. e.join(',')
  32963. );
  32964. }),
  32965. t
  32966. );
  32967. })();
  32968. function AB(t) {
  32969. return 'number' == typeof t
  32970. ? WM(t)
  32971. : ('string' == typeof t &&
  32972. 0 === t.indexOf('0x') &&
  32973. (t = t.replace('0x', '#')),
  32974. t);
  32975. }
  32976. function OB(t) {
  32977. if (Array.isArray(t)) {
  32978. for (var e = 0; e < t.length; ++e) t[e] = AB(t[e]);
  32979. return t;
  32980. }
  32981. return AB(t);
  32982. }
  32983. function IB(t, e, r) {
  32984. for (var n in r)
  32985. Array.isArray(e[n]) ? (t[n] = e[n].slice()) : (t[n] = e[n]);
  32986. }
  32987. var MB = { willReadFrequently: !0 },
  32988. DB = (function () {
  32989. function t(t, e, r, n, i, o, s, a, u) {
  32990. (this.text = t),
  32991. (this.style = e),
  32992. (this.width = r),
  32993. (this.height = n),
  32994. (this.lines = i),
  32995. (this.lineWidths = o),
  32996. (this.lineHeight = s),
  32997. (this.maxLineWidth = a),
  32998. (this.fontProperties = u);
  32999. }
  33000. return (
  33001. (t.measureText = function (e, r, n, i) {
  33002. void 0 === i && (i = t._canvas), (n = null == n ? r.wordWrap : n);
  33003. var o = r.toFontString(),
  33004. s = t.measureFont(o);
  33005. 0 === s.fontSize &&
  33006. ((s.fontSize = r.fontSize), (s.ascent = r.fontSize));
  33007. var a = i.getContext('2d', MB);
  33008. a.font = o;
  33009. for (
  33010. var u = (n ? t.wordWrap(e, r, i) : e).split(/(?:\r\n|\r|\n)/),
  33011. c = new Array(u.length),
  33012. h = 0,
  33013. l = 0;
  33014. l < u.length;
  33015. l++
  33016. ) {
  33017. var d =
  33018. a.measureText(u[l]).width + (u[l].length - 1) * r.letterSpacing;
  33019. (c[l] = d), (h = Math.max(h, d));
  33020. }
  33021. var f = h + r.strokeThickness;
  33022. r.dropShadow && (f += r.dropShadowDistance);
  33023. var p = r.lineHeight || s.fontSize + r.strokeThickness,
  33024. v =
  33025. Math.max(p, s.fontSize + r.strokeThickness) +
  33026. (u.length - 1) * (p + r.leading);
  33027. return (
  33028. r.dropShadow && (v += r.dropShadowDistance),
  33029. new t(e, r, f, v, u, c, p + r.leading, h, s)
  33030. );
  33031. }),
  33032. (t.wordWrap = function (e, r, n) {
  33033. void 0 === n && (n = t._canvas);
  33034. for (
  33035. var i = n.getContext('2d', MB),
  33036. o = 0,
  33037. s = '',
  33038. a = '',
  33039. u = Object.create(null),
  33040. c = r.letterSpacing,
  33041. h = r.whiteSpace,
  33042. l = t.collapseSpaces(h),
  33043. d = t.collapseNewlines(h),
  33044. f = !l,
  33045. p = r.wordWrapWidth + c,
  33046. v = t.tokenize(e),
  33047. m = 0;
  33048. m < v.length;
  33049. m++
  33050. ) {
  33051. var y = v[m];
  33052. if (t.isNewline(y)) {
  33053. if (!d) {
  33054. (a += t.addLine(s)), (f = !l), (s = ''), (o = 0);
  33055. continue;
  33056. }
  33057. y = ' ';
  33058. }
  33059. if (l) {
  33060. var g = t.isBreakingSpace(y),
  33061. _ = t.isBreakingSpace(s[s.length - 1]);
  33062. if (g && _) continue;
  33063. }
  33064. var b = t.getFromCache(y, c, u, i);
  33065. if (b > p)
  33066. if (
  33067. ('' !== s && ((a += t.addLine(s)), (s = ''), (o = 0)),
  33068. t.canBreakWords(y, r.breakWords))
  33069. )
  33070. for (var T = t.wordWrapSplit(y), x = 0; x < T.length; x++) {
  33071. for (var E = T[x], S = 1; T[x + S]; ) {
  33072. var w = T[x + S],
  33073. R = E[E.length - 1];
  33074. if (t.canBreakChars(R, w, y, x, r.breakWords)) break;
  33075. (E += w), S++;
  33076. }
  33077. x += E.length - 1;
  33078. var C = t.getFromCache(E, c, u, i);
  33079. C + o > p &&
  33080. ((a += t.addLine(s)), (f = !1), (s = ''), (o = 0)),
  33081. (s += E),
  33082. (o += C);
  33083. }
  33084. else {
  33085. s.length > 0 && ((a += t.addLine(s)), (s = ''), (o = 0));
  33086. var P = m === v.length - 1;
  33087. (a += t.addLine(y, !P)), (f = !1), (s = ''), (o = 0);
  33088. }
  33089. else
  33090. b + o > p && ((f = !1), (a += t.addLine(s)), (s = ''), (o = 0)),
  33091. (s.length > 0 || !t.isBreakingSpace(y) || f) &&
  33092. ((s += y), (o += b));
  33093. }
  33094. return (a += t.addLine(s, !1));
  33095. }),
  33096. (t.addLine = function (e, r) {
  33097. return (
  33098. void 0 === r && (r = !0),
  33099. (e = t.trimRight(e)),
  33100. (e = r ? e + '\n' : e)
  33101. );
  33102. }),
  33103. (t.getFromCache = function (t, e, r, n) {
  33104. var i = r[t];
  33105. if ('number' != typeof i) {
  33106. var o = t.length * e;
  33107. (i = n.measureText(t).width + o), (r[t] = i);
  33108. }
  33109. return i;
  33110. }),
  33111. (t.collapseSpaces = function (t) {
  33112. return 'normal' === t || 'pre-line' === t;
  33113. }),
  33114. (t.collapseNewlines = function (t) {
  33115. return 'normal' === t;
  33116. }),
  33117. (t.trimRight = function (e) {
  33118. if ('string' != typeof e) return '';
  33119. for (var r = e.length - 1; r >= 0; r--) {
  33120. var n = e[r];
  33121. if (!t.isBreakingSpace(n)) break;
  33122. e = e.slice(0, -1);
  33123. }
  33124. return e;
  33125. }),
  33126. (t.isNewline = function (e) {
  33127. return (
  33128. 'string' == typeof e && t._newlines.indexOf(e.charCodeAt(0)) >= 0
  33129. );
  33130. }),
  33131. (t.isBreakingSpace = function (e, r) {
  33132. return (
  33133. 'string' == typeof e &&
  33134. t._breakingSpaces.indexOf(e.charCodeAt(0)) >= 0
  33135. );
  33136. }),
  33137. (t.tokenize = function (e) {
  33138. var r = [],
  33139. n = '';
  33140. if ('string' != typeof e) return r;
  33141. for (var i = 0; i < e.length; i++) {
  33142. var o = e[i],
  33143. s = e[i + 1];
  33144. t.isBreakingSpace(o, s) || t.isNewline(o)
  33145. ? ('' !== n && (r.push(n), (n = '')), r.push(o))
  33146. : (n += o);
  33147. }
  33148. return '' !== n && r.push(n), r;
  33149. }),
  33150. (t.canBreakWords = function (t, e) {
  33151. return e;
  33152. }),
  33153. (t.canBreakChars = function (t, e, r, n, i) {
  33154. return !0;
  33155. }),
  33156. (t.wordWrapSplit = function (t) {
  33157. return t.split('');
  33158. }),
  33159. (t.measureFont = function (e) {
  33160. if (t._fonts[e]) return t._fonts[e];
  33161. var r = { ascent: 0, descent: 0, fontSize: 0 },
  33162. n = t._canvas,
  33163. i = t._context;
  33164. i.font = e;
  33165. var o = t.METRICS_STRING + t.BASELINE_SYMBOL,
  33166. s = Math.ceil(i.measureText(o).width),
  33167. a = Math.ceil(i.measureText(t.BASELINE_SYMBOL).width),
  33168. u = Math.ceil(t.HEIGHT_MULTIPLIER * a);
  33169. (a = (a * t.BASELINE_MULTIPLIER) | 0),
  33170. (n.width = s),
  33171. (n.height = u),
  33172. (i.fillStyle = '#f00'),
  33173. i.fillRect(0, 0, s, u),
  33174. (i.font = e),
  33175. (i.textBaseline = 'alphabetic'),
  33176. (i.fillStyle = '#000'),
  33177. i.fillText(o, 0, a);
  33178. var c = i.getImageData(0, 0, s, u).data,
  33179. h = c.length,
  33180. l = 4 * s,
  33181. d = 0,
  33182. f = 0,
  33183. p = !1;
  33184. for (d = 0; d < a; ++d) {
  33185. for (var v = 0; v < l; v += 4)
  33186. if (255 !== c[f + v]) {
  33187. p = !0;
  33188. break;
  33189. }
  33190. if (p) break;
  33191. f += l;
  33192. }
  33193. for (r.ascent = a - d, f = h - l, p = !1, d = u; d > a; --d) {
  33194. for (v = 0; v < l; v += 4)
  33195. if (255 !== c[f + v]) {
  33196. p = !0;
  33197. break;
  33198. }
  33199. if (p) break;
  33200. f -= l;
  33201. }
  33202. return (
  33203. (r.descent = d - a),
  33204. (r.fontSize = r.ascent + r.descent),
  33205. (t._fonts[e] = r),
  33206. r
  33207. );
  33208. }),
  33209. (t.clearMetrics = function (e) {
  33210. void 0 === e && (e = ''), e ? delete t._fonts[e] : (t._fonts = {});
  33211. }),
  33212. Object.defineProperty(t, '_canvas', {
  33213. get: function () {
  33214. if (!t.__canvas) {
  33215. var e = void 0;
  33216. try {
  33217. var r = new OffscreenCanvas(0, 0),
  33218. n = r.getContext('2d', MB);
  33219. if (n && n.measureText) return (t.__canvas = r), r;
  33220. e = vA.ADAPTER.createCanvas();
  33221. } catch (t) {
  33222. e = vA.ADAPTER.createCanvas();
  33223. }
  33224. (e.width = e.height = 10), (t.__canvas = e);
  33225. }
  33226. return t.__canvas;
  33227. },
  33228. enumerable: !1,
  33229. configurable: !0,
  33230. }),
  33231. Object.defineProperty(t, '_context', {
  33232. get: function () {
  33233. return (
  33234. t.__context || (t.__context = t._canvas.getContext('2d', MB)),
  33235. t.__context
  33236. );
  33237. },
  33238. enumerable: !1,
  33239. configurable: !0,
  33240. }),
  33241. t
  33242. );
  33243. })();
  33244. (DB._fonts = {}),
  33245. (DB.METRICS_STRING = '|ÉqÅ'),
  33246. (DB.BASELINE_SYMBOL = 'M'),
  33247. (DB.BASELINE_MULTIPLIER = 1.4),
  33248. (DB.HEIGHT_MULTIPLIER = 2),
  33249. (DB._newlines = [10, 13]),
  33250. (DB._breakingSpaces = [
  33251. 9, 32, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8200, 8201, 8202, 8287,
  33252. 12288,
  33253. ]);
  33254. var LB = { texture: !0, children: !1, baseTexture: !0 },
  33255. FB = (function (t) {
  33256. function e(e, r, n) {
  33257. var i = this,
  33258. o = !1;
  33259. n || ((n = vA.ADAPTER.createCanvas()), (o = !0)),
  33260. (n.width = 3),
  33261. (n.height = 3);
  33262. var s = EL.from(n);
  33263. return (
  33264. (s.orig = new TD()),
  33265. (s.trim = new TD()),
  33266. ((i = t.call(this, s) || this)._ownCanvas = o),
  33267. (i.canvas = n),
  33268. (i.context = n.getContext('2d', { willReadFrequently: !0 })),
  33269. (i._resolution = vA.RESOLUTION),
  33270. (i._autoResolution = !0),
  33271. (i._text = null),
  33272. (i._style = null),
  33273. (i._styleListener = null),
  33274. (i._font = ''),
  33275. (i.text = e),
  33276. (i.style = r),
  33277. (i.localStyleID = -1),
  33278. i
  33279. );
  33280. }
  33281. return (
  33282. (function (t, e) {
  33283. function r() {
  33284. this.constructor = t;
  33285. }
  33286. wB(t, e),
  33287. (t.prototype =
  33288. null === e
  33289. ? Object.create(e)
  33290. : ((r.prototype = e.prototype), new r()));
  33291. })(e, t),
  33292. (e.prototype.updateText = function (t) {
  33293. var r = this._style;
  33294. if (
  33295. (this.localStyleID !== r.styleID &&
  33296. ((this.dirty = !0), (this.localStyleID = r.styleID)),
  33297. this.dirty || !t)
  33298. ) {
  33299. this._font = this._style.toFontString();
  33300. var n,
  33301. i,
  33302. o = this.context,
  33303. s = DB.measureText(
  33304. this._text || ' ',
  33305. this._style,
  33306. this._style.wordWrap,
  33307. this.canvas
  33308. ),
  33309. a = s.width,
  33310. u = s.height,
  33311. c = s.lines,
  33312. h = s.lineHeight,
  33313. l = s.lineWidths,
  33314. d = s.maxLineWidth,
  33315. f = s.fontProperties;
  33316. (this.canvas.width = Math.ceil(
  33317. Math.ceil(Math.max(1, a) + 2 * r.padding) * this._resolution
  33318. )),
  33319. (this.canvas.height = Math.ceil(
  33320. Math.ceil(Math.max(1, u) + 2 * r.padding) * this._resolution
  33321. )),
  33322. o.scale(this._resolution, this._resolution),
  33323. o.clearRect(0, 0, this.canvas.width, this.canvas.height),
  33324. (o.font = this._font),
  33325. (o.lineWidth = r.strokeThickness),
  33326. (o.textBaseline = r.textBaseline),
  33327. (o.lineJoin = r.lineJoin),
  33328. (o.miterLimit = r.miterLimit);
  33329. for (var p = r.dropShadow ? 2 : 1, v = 0; v < p; ++v) {
  33330. var m = r.dropShadow && 0 === v,
  33331. y = m ? Math.ceil(Math.max(1, u) + 2 * r.padding) : 0,
  33332. g = y * this._resolution;
  33333. if (m) {
  33334. (o.fillStyle = 'black'), (o.strokeStyle = 'black');
  33335. var _ = r.dropShadowColor,
  33336. b = HM('number' == typeof _ ? _ : YM(_)),
  33337. T = r.dropShadowBlur * this._resolution,
  33338. x = r.dropShadowDistance * this._resolution;
  33339. (o.shadowColor =
  33340. 'rgba(' +
  33341. 255 * b[0] +
  33342. ',' +
  33343. 255 * b[1] +
  33344. ',' +
  33345. 255 * b[2] +
  33346. ',' +
  33347. r.dropShadowAlpha +
  33348. ')'),
  33349. (o.shadowBlur = T),
  33350. (o.shadowOffsetX = Math.cos(r.dropShadowAngle) * x),
  33351. (o.shadowOffsetY = Math.sin(r.dropShadowAngle) * x + g);
  33352. } else
  33353. (o.fillStyle = this._generateFillStyle(r, c, s)),
  33354. (o.strokeStyle = r.stroke),
  33355. (o.shadowColor = 'black'),
  33356. (o.shadowBlur = 0),
  33357. (o.shadowOffsetX = 0),
  33358. (o.shadowOffsetY = 0);
  33359. var E = (h - f.fontSize) / 2;
  33360. (!e.nextLineHeightBehavior || h - f.fontSize < 0) && (E = 0);
  33361. for (var S = 0; S < c.length; S++)
  33362. (n = r.strokeThickness / 2),
  33363. (i = r.strokeThickness / 2 + S * h + f.ascent + E),
  33364. 'right' === r.align
  33365. ? (n += d - l[S])
  33366. : 'center' === r.align && (n += (d - l[S]) / 2),
  33367. r.stroke &&
  33368. r.strokeThickness &&
  33369. this.drawLetterSpacing(
  33370. c[S],
  33371. n + r.padding,
  33372. i + r.padding - y,
  33373. !0
  33374. ),
  33375. r.fill &&
  33376. this.drawLetterSpacing(
  33377. c[S],
  33378. n + r.padding,
  33379. i + r.padding - y
  33380. );
  33381. }
  33382. this.updateTexture();
  33383. }
  33384. }),
  33385. (e.prototype.drawLetterSpacing = function (t, r, n, i) {
  33386. void 0 === i && (i = !1);
  33387. var o = this._style.letterSpacing,
  33388. s =
  33389. e.experimentalLetterSpacing &&
  33390. ('letterSpacing' in CanvasRenderingContext2D.prototype ||
  33391. 'textLetterSpacing' in CanvasRenderingContext2D.prototype);
  33392. if (0 === o || s)
  33393. return (
  33394. s &&
  33395. ((this.context.letterSpacing = o),
  33396. (this.context.textLetterSpacing = o)),
  33397. void (i
  33398. ? this.context.strokeText(t, r, n)
  33399. : this.context.fillText(t, r, n))
  33400. );
  33401. for (
  33402. var a = r,
  33403. u = Array.from ? Array.from(t) : t.split(''),
  33404. c = this.context.measureText(t).width,
  33405. h = 0,
  33406. l = 0;
  33407. l < u.length;
  33408. ++l
  33409. ) {
  33410. var d = u[l];
  33411. i
  33412. ? this.context.strokeText(d, a, n)
  33413. : this.context.fillText(d, a, n);
  33414. for (var f = '', p = l + 1; p < u.length; ++p) f += u[p];
  33415. (a += c - (h = this.context.measureText(f).width) + o), (c = h);
  33416. }
  33417. }),
  33418. (e.prototype.updateTexture = function () {
  33419. var t = this.canvas;
  33420. if (this._style.trim) {
  33421. var e = (function (t) {
  33422. var e,
  33423. r,
  33424. n,
  33425. i = t.width,
  33426. o = t.height,
  33427. s = t.getContext('2d', { willReadFrequently: !0 }),
  33428. a = s.getImageData(0, 0, i, o).data,
  33429. u = a.length,
  33430. c = { top: null, left: null, right: null, bottom: null },
  33431. h = null;
  33432. for (e = 0; e < u; e += 4)
  33433. 0 !== a[e + 3] &&
  33434. ((r = (e / 4) % i),
  33435. (n = ~~(e / 4 / i)),
  33436. null === c.top && (c.top = n),
  33437. (null === c.left || r < c.left) && (c.left = r),
  33438. (null === c.right || c.right < r) && (c.right = r + 1),
  33439. (null === c.bottom || c.bottom < n) && (c.bottom = n));
  33440. return (
  33441. null !== c.top &&
  33442. ((i = c.right - c.left),
  33443. (o = c.bottom - c.top + 1),
  33444. (h = s.getImageData(c.left, c.top, i, o))),
  33445. { height: o, width: i, data: h }
  33446. );
  33447. })(t);
  33448. e.data &&
  33449. ((t.width = e.width),
  33450. (t.height = e.height),
  33451. this.context.putImageData(e.data, 0, 0));
  33452. }
  33453. var r = this._texture,
  33454. n = this._style,
  33455. i = n.trim ? 0 : n.padding,
  33456. o = r.baseTexture;
  33457. (r.trim.width = r._frame.width = t.width / this._resolution),
  33458. (r.trim.height = r._frame.height = t.height / this._resolution),
  33459. (r.trim.x = -i),
  33460. (r.trim.y = -i),
  33461. (r.orig.width = r._frame.width - 2 * i),
  33462. (r.orig.height = r._frame.height - 2 * i),
  33463. this._onTextureUpdate(),
  33464. o.setRealSize(t.width, t.height, this._resolution),
  33465. r.updateUvs(),
  33466. (this.dirty = !1);
  33467. }),
  33468. (e.prototype._render = function (e) {
  33469. this._autoResolution &&
  33470. this._resolution !== e.resolution &&
  33471. ((this._resolution = e.resolution), (this.dirty = !0)),
  33472. this.updateText(!0),
  33473. t.prototype._render.call(this, e);
  33474. }),
  33475. (e.prototype.updateTransform = function () {
  33476. this.updateText(!0), t.prototype.updateTransform.call(this);
  33477. }),
  33478. (e.prototype.getBounds = function (e, r) {
  33479. return (
  33480. this.updateText(!0),
  33481. -1 === this._textureID && (e = !1),
  33482. t.prototype.getBounds.call(this, e, r)
  33483. );
  33484. }),
  33485. (e.prototype.getLocalBounds = function (e) {
  33486. return this.updateText(!0), t.prototype.getLocalBounds.call(this, e);
  33487. }),
  33488. (e.prototype._calculateBounds = function () {
  33489. this.calculateVertices(), this._bounds.addQuad(this.vertexData);
  33490. }),
  33491. (e.prototype._generateFillStyle = function (t, e, r) {
  33492. var n,
  33493. i = t.fill;
  33494. if (!Array.isArray(i)) return i;
  33495. if (1 === i.length) return i[0];
  33496. var o = t.dropShadow ? t.dropShadowDistance : 0,
  33497. s = t.padding || 0,
  33498. a = this.canvas.width / this._resolution - o - 2 * s,
  33499. u = this.canvas.height / this._resolution - o - 2 * s,
  33500. c = i.slice(),
  33501. h = t.fillGradientStops.slice();
  33502. if (!h.length)
  33503. for (var l = c.length + 1, d = 1; d < l; ++d) h.push(d / l);
  33504. if (
  33505. (c.unshift(i[0]),
  33506. h.unshift(0),
  33507. c.push(i[i.length - 1]),
  33508. h.push(1),
  33509. t.fillGradientType === TB.LINEAR_VERTICAL)
  33510. ) {
  33511. n = this.context.createLinearGradient(a / 2, s, a / 2, u + s);
  33512. var f = r.fontProperties.fontSize + t.strokeThickness;
  33513. for (d = 0; d < e.length; d++) {
  33514. var p = r.lineHeight * (d - 1) + f,
  33515. v = r.lineHeight * d,
  33516. m = v;
  33517. d > 0 && p > v && (m = (v + p) / 2);
  33518. var y = v + f,
  33519. g = r.lineHeight * (d + 1),
  33520. _ = y;
  33521. d + 1 < e.length && g < y && (_ = (y + g) / 2);
  33522. for (var b = (_ - m) / u, T = 0; T < c.length; T++) {
  33523. var x = 0;
  33524. x = 'number' == typeof h[T] ? h[T] : T / c.length;
  33525. var E = Math.min(1, Math.max(0, m / u + x * b));
  33526. (E = Number(E.toFixed(5))), n.addColorStop(E, c[T]);
  33527. }
  33528. }
  33529. } else {
  33530. n = this.context.createLinearGradient(s, u / 2, a + s, u / 2);
  33531. var S = c.length + 1,
  33532. w = 1;
  33533. for (d = 0; d < c.length; d++) {
  33534. var R = void 0;
  33535. (R = 'number' == typeof h[d] ? h[d] : w / S),
  33536. n.addColorStop(R, c[d]),
  33537. w++;
  33538. }
  33539. }
  33540. return n;
  33541. }),
  33542. (e.prototype.destroy = function (e) {
  33543. 'boolean' == typeof e && (e = { children: e }),
  33544. (e = Object.assign({}, LB, e)),
  33545. t.prototype.destroy.call(this, e),
  33546. this._ownCanvas && (this.canvas.height = this.canvas.width = 0),
  33547. (this.context = null),
  33548. (this.canvas = null),
  33549. (this._style = null);
  33550. }),
  33551. Object.defineProperty(e.prototype, 'width', {
  33552. get: function () {
  33553. return (
  33554. this.updateText(!0),
  33555. Math.abs(this.scale.x) * this._texture.orig.width
  33556. );
  33557. },
  33558. set: function (t) {
  33559. this.updateText(!0);
  33560. var e = nD(this.scale.x) || 1;
  33561. (this.scale.x = (e * t) / this._texture.orig.width),
  33562. (this._width = t);
  33563. },
  33564. enumerable: !1,
  33565. configurable: !0,
  33566. }),
  33567. Object.defineProperty(e.prototype, 'height', {
  33568. get: function () {
  33569. return (
  33570. this.updateText(!0),
  33571. Math.abs(this.scale.y) * this._texture.orig.height
  33572. );
  33573. },
  33574. set: function (t) {
  33575. this.updateText(!0);
  33576. var e = nD(this.scale.y) || 1;
  33577. (this.scale.y = (e * t) / this._texture.orig.height),
  33578. (this._height = t);
  33579. },
  33580. enumerable: !1,
  33581. configurable: !0,
  33582. }),
  33583. Object.defineProperty(e.prototype, 'style', {
  33584. get: function () {
  33585. return this._style;
  33586. },
  33587. set: function (t) {
  33588. (t = t || {}),
  33589. (this._style = t instanceof PB ? t : new PB(t)),
  33590. (this.localStyleID = -1),
  33591. (this.dirty = !0);
  33592. },
  33593. enumerable: !1,
  33594. configurable: !0,
  33595. }),
  33596. Object.defineProperty(e.prototype, 'text', {
  33597. get: function () {
  33598. return this._text;
  33599. },
  33600. set: function (t) {
  33601. (t = String(null == t ? '' : t)),
  33602. this._text !== t && ((this._text = t), (this.dirty = !0));
  33603. },
  33604. enumerable: !1,
  33605. configurable: !0,
  33606. }),
  33607. Object.defineProperty(e.prototype, 'resolution', {
  33608. get: function () {
  33609. return this._resolution;
  33610. },
  33611. set: function (t) {
  33612. (this._autoResolution = !1),
  33613. this._resolution !== t &&
  33614. ((this._resolution = t), (this.dirty = !0));
  33615. },
  33616. enumerable: !1,
  33617. configurable: !0,
  33618. }),
  33619. (e.nextLineHeightBehavior = !1),
  33620. (e.experimentalLetterSpacing = !1),
  33621. e
  33622. );
  33623. })(SB);
  33624. vA.UPLOADS_PER_FRAME = 4;
  33625. var NB = function (t, e) {
  33626. return (
  33627. (NB =
  33628. Object.setPrototypeOf ||
  33629. ({ __proto__: [] } instanceof Array &&
  33630. function (t, e) {
  33631. t.__proto__ = e;
  33632. }) ||
  33633. function (t, e) {
  33634. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  33635. }),
  33636. NB(t, e)
  33637. );
  33638. };
  33639. var kB = (function () {
  33640. function t(t) {
  33641. (this.maxItemsPerFrame = t), (this.itemsLeft = 0);
  33642. }
  33643. return (
  33644. (t.prototype.beginFrame = function () {
  33645. this.itemsLeft = this.maxItemsPerFrame;
  33646. }),
  33647. (t.prototype.allowedToUpload = function () {
  33648. return this.itemsLeft-- > 0;
  33649. }),
  33650. t
  33651. );
  33652. })();
  33653. function BB(t, e) {
  33654. var r = !1;
  33655. if (t && t._textures && t._textures.length)
  33656. for (var n = 0; n < t._textures.length; n++)
  33657. if (t._textures[n] instanceof EL) {
  33658. var i = t._textures[n].baseTexture;
  33659. -1 === e.indexOf(i) && (e.push(i), (r = !0));
  33660. }
  33661. return r;
  33662. }
  33663. function GB(t, e) {
  33664. if (t.baseTexture instanceof aL) {
  33665. var r = t.baseTexture;
  33666. return -1 === e.indexOf(r) && e.push(r), !0;
  33667. }
  33668. return !1;
  33669. }
  33670. function UB(t, e) {
  33671. if (t._texture && t._texture instanceof EL) {
  33672. var r = t._texture.baseTexture;
  33673. return -1 === e.indexOf(r) && e.push(r), !0;
  33674. }
  33675. return !1;
  33676. }
  33677. function jB(t, e) {
  33678. return e instanceof FB && (e.updateText(!0), !0);
  33679. }
  33680. function XB(t, e) {
  33681. if (e instanceof PB) {
  33682. var r = e.toFontString();
  33683. return DB.measureFont(r), !0;
  33684. }
  33685. return !1;
  33686. }
  33687. function VB(t, e) {
  33688. if (t instanceof FB) {
  33689. -1 === e.indexOf(t.style) && e.push(t.style),
  33690. -1 === e.indexOf(t) && e.push(t);
  33691. var r = t._texture.baseTexture;
  33692. return -1 === e.indexOf(r) && e.push(r), !0;
  33693. }
  33694. return !1;
  33695. }
  33696. function HB(t, e) {
  33697. return t instanceof PB && (-1 === e.indexOf(t) && e.push(t), !0);
  33698. }
  33699. var WB = (function () {
  33700. function t(t) {
  33701. var e = this;
  33702. (this.limiter = new kB(vA.UPLOADS_PER_FRAME)),
  33703. (this.renderer = t),
  33704. (this.uploadHookHelper = null),
  33705. (this.queue = []),
  33706. (this.addHooks = []),
  33707. (this.uploadHooks = []),
  33708. (this.completes = []),
  33709. (this.ticking = !1),
  33710. (this.delayedTick = function () {
  33711. e.queue && e.prepareItems();
  33712. }),
  33713. this.registerFindHook(VB),
  33714. this.registerFindHook(HB),
  33715. this.registerFindHook(BB),
  33716. this.registerFindHook(GB),
  33717. this.registerFindHook(UB),
  33718. this.registerUploadHook(jB),
  33719. this.registerUploadHook(XB);
  33720. }
  33721. return (
  33722. (t.prototype.upload = function (t, e) {
  33723. var r = this;
  33724. return (
  33725. 'function' == typeof t && ((e = t), (t = null)),
  33726. e &&
  33727. aD(
  33728. '6.5.0',
  33729. 'BasePrepare.upload callback is deprecated, use the return Promise instead.'
  33730. ),
  33731. new Promise(function (n) {
  33732. t && r.add(t);
  33733. var i = function () {
  33734. null == e || e(), n();
  33735. };
  33736. r.queue.length
  33737. ? (r.completes.push(i),
  33738. r.ticking ||
  33739. ((r.ticking = !0), qD.system.addOnce(r.tick, r, YD.UTILITY)))
  33740. : i();
  33741. })
  33742. );
  33743. }),
  33744. (t.prototype.tick = function () {
  33745. setTimeout(this.delayedTick, 0);
  33746. }),
  33747. (t.prototype.prepareItems = function () {
  33748. for (
  33749. this.limiter.beginFrame();
  33750. this.queue.length && this.limiter.allowedToUpload();
  33751. ) {
  33752. var t = this.queue[0],
  33753. e = !1;
  33754. if (t && !t._destroyed)
  33755. for (var r = 0, n = this.uploadHooks.length; r < n; r++)
  33756. if (this.uploadHooks[r](this.uploadHookHelper, t)) {
  33757. this.queue.shift(), (e = !0);
  33758. break;
  33759. }
  33760. e || this.queue.shift();
  33761. }
  33762. if (this.queue.length) qD.system.addOnce(this.tick, this, YD.UTILITY);
  33763. else {
  33764. this.ticking = !1;
  33765. var i = this.completes.slice(0);
  33766. this.completes.length = 0;
  33767. for (r = 0, n = i.length; r < n; r++) i[r]();
  33768. }
  33769. }),
  33770. (t.prototype.registerFindHook = function (t) {
  33771. return t && this.addHooks.push(t), this;
  33772. }),
  33773. (t.prototype.registerUploadHook = function (t) {
  33774. return t && this.uploadHooks.push(t), this;
  33775. }),
  33776. (t.prototype.add = function (t) {
  33777. for (
  33778. var e = 0, r = this.addHooks.length;
  33779. e < r && !this.addHooks[e](t, this.queue);
  33780. e++
  33781. );
  33782. if (t instanceof VD)
  33783. for (e = t.children.length - 1; e >= 0; e--) this.add(t.children[e]);
  33784. return this;
  33785. }),
  33786. (t.prototype.destroy = function () {
  33787. this.ticking && qD.system.remove(this.tick, this),
  33788. (this.ticking = !1),
  33789. (this.addHooks = null),
  33790. (this.uploadHooks = null),
  33791. (this.renderer = null),
  33792. (this.completes = null),
  33793. (this.queue = null),
  33794. (this.limiter = null),
  33795. (this.uploadHookHelper = null);
  33796. }),
  33797. t
  33798. );
  33799. })();
  33800. function YB(t, e) {
  33801. return (
  33802. e instanceof aL && (e._glTextures[t.CONTEXT_UID] || t.texture.bind(e), !0)
  33803. );
  33804. }
  33805. function zB(t, e) {
  33806. if (!(e instanceof _B)) return !1;
  33807. var r = e.geometry;
  33808. e.finishPoly(), r.updateBatches();
  33809. for (var n = r.batches, i = 0; i < n.length; i++) {
  33810. var o = n[i].style.texture;
  33811. o && YB(t, o.baseTexture);
  33812. }
  33813. return r.batchable || t.geometry.bind(r, e._resolveDirectShader(t)), !0;
  33814. }
  33815. function ZB(t, e) {
  33816. return t instanceof _B && (e.push(t), !0);
  33817. }
  33818. var JB = (function (t) {
  33819. function e(e) {
  33820. var r = t.call(this, e) || this;
  33821. return (
  33822. (r.uploadHookHelper = r.renderer),
  33823. r.registerFindHook(ZB),
  33824. r.registerUploadHook(YB),
  33825. r.registerUploadHook(zB),
  33826. r
  33827. );
  33828. }
  33829. return (
  33830. (function (t, e) {
  33831. function r() {
  33832. this.constructor = t;
  33833. }
  33834. NB(t, e),
  33835. (t.prototype =
  33836. null === e
  33837. ? Object.create(e)
  33838. : ((r.prototype = e.prototype), new r()));
  33839. })(e, t),
  33840. (e.extension = { name: 'prepare', type: HD.RendererPlugin }),
  33841. e
  33842. );
  33843. })(WB),
  33844. KB = (function () {
  33845. function t(t, e, r) {
  33846. void 0 === r && (r = null),
  33847. (this.linkedSheets = []),
  33848. (this._texture = t instanceof EL ? t : null),
  33849. (this.baseTexture = t instanceof aL ? t : this._texture.baseTexture),
  33850. (this.textures = {}),
  33851. (this.animations = {}),
  33852. (this.data = e);
  33853. var n = this.baseTexture.resource;
  33854. (this.resolution = this._updateResolution(r || (n ? n.url : null))),
  33855. (this._frames = this.data.frames),
  33856. (this._frameKeys = Object.keys(this._frames)),
  33857. (this._batchIndex = 0),
  33858. (this._callback = null);
  33859. }
  33860. return (
  33861. (t.prototype._updateResolution = function (t) {
  33862. void 0 === t && (t = null);
  33863. var e = this.data.meta.scale,
  33864. r = pD(t, null);
  33865. return (
  33866. null === r && (r = void 0 !== e ? parseFloat(e) : 1),
  33867. 1 !== r && this.baseTexture.setResolution(r),
  33868. r
  33869. );
  33870. }),
  33871. (t.prototype.parse = function (e) {
  33872. var r = this;
  33873. return (
  33874. e &&
  33875. aD(
  33876. '6.5.0',
  33877. 'Spritesheet.parse callback is deprecated, use the return Promise instead.'
  33878. ),
  33879. new Promise(function (n) {
  33880. (r._callback = function (t) {
  33881. null == e || e(t), n(t);
  33882. }),
  33883. (r._batchIndex = 0),
  33884. r._frameKeys.length <= t.BATCH_SIZE
  33885. ? (r._processFrames(0),
  33886. r._processAnimations(),
  33887. r._parseComplete())
  33888. : r._nextBatch();
  33889. })
  33890. );
  33891. }),
  33892. (t.prototype._processFrames = function (e) {
  33893. for (
  33894. var r = e, n = t.BATCH_SIZE;
  33895. r - e < n && r < this._frameKeys.length;
  33896. ) {
  33897. var i = this._frameKeys[r],
  33898. o = this._frames[i],
  33899. s = o.frame;
  33900. if (s) {
  33901. var a = null,
  33902. u = null,
  33903. c = !1 !== o.trimmed && o.sourceSize ? o.sourceSize : o.frame,
  33904. h = new TD(
  33905. 0,
  33906. 0,
  33907. Math.floor(c.w) / this.resolution,
  33908. Math.floor(c.h) / this.resolution
  33909. );
  33910. (a = o.rotated
  33911. ? new TD(
  33912. Math.floor(s.x) / this.resolution,
  33913. Math.floor(s.y) / this.resolution,
  33914. Math.floor(s.h) / this.resolution,
  33915. Math.floor(s.w) / this.resolution
  33916. )
  33917. : new TD(
  33918. Math.floor(s.x) / this.resolution,
  33919. Math.floor(s.y) / this.resolution,
  33920. Math.floor(s.w) / this.resolution,
  33921. Math.floor(s.h) / this.resolution
  33922. )),
  33923. !1 !== o.trimmed &&
  33924. o.spriteSourceSize &&
  33925. (u = new TD(
  33926. Math.floor(o.spriteSourceSize.x) / this.resolution,
  33927. Math.floor(o.spriteSourceSize.y) / this.resolution,
  33928. Math.floor(s.w) / this.resolution,
  33929. Math.floor(s.h) / this.resolution
  33930. )),
  33931. (this.textures[i] = new EL(
  33932. this.baseTexture,
  33933. a,
  33934. h,
  33935. u,
  33936. o.rotated ? 2 : 0,
  33937. o.anchor
  33938. )),
  33939. EL.addToCache(this.textures[i], i);
  33940. }
  33941. r++;
  33942. }
  33943. }),
  33944. (t.prototype._processAnimations = function () {
  33945. var t = this.data.animations || {};
  33946. for (var e in t) {
  33947. this.animations[e] = [];
  33948. for (var r = 0; r < t[e].length; r++) {
  33949. var n = t[e][r];
  33950. this.animations[e].push(this.textures[n]);
  33951. }
  33952. }
  33953. }),
  33954. (t.prototype._parseComplete = function () {
  33955. var t = this._callback;
  33956. (this._callback = null),
  33957. (this._batchIndex = 0),
  33958. t.call(this, this.textures);
  33959. }),
  33960. (t.prototype._nextBatch = function () {
  33961. var e = this;
  33962. this._processFrames(this._batchIndex * t.BATCH_SIZE),
  33963. this._batchIndex++,
  33964. setTimeout(function () {
  33965. e._batchIndex * t.BATCH_SIZE < e._frameKeys.length
  33966. ? e._nextBatch()
  33967. : (e._processAnimations(), e._parseComplete());
  33968. }, 0);
  33969. }),
  33970. (t.prototype.destroy = function (t) {
  33971. var e;
  33972. for (var r in (void 0 === t && (t = !1), this.textures))
  33973. this.textures[r].destroy();
  33974. (this._frames = null),
  33975. (this._frameKeys = null),
  33976. (this.data = null),
  33977. (this.textures = null),
  33978. t &&
  33979. (null === (e = this._texture) || void 0 === e || e.destroy(),
  33980. this.baseTexture.destroy()),
  33981. (this._texture = null),
  33982. (this.baseTexture = null),
  33983. (this.linkedSheets = []);
  33984. }),
  33985. (t.BATCH_SIZE = 1e3),
  33986. t
  33987. );
  33988. })(),
  33989. qB = (function () {
  33990. function t() {}
  33991. return (
  33992. (t.use = function (e, r) {
  33993. var n,
  33994. i,
  33995. o = this,
  33996. s = e.name + '_image';
  33997. if (
  33998. e.data &&
  33999. e.type === DN.TYPE.JSON &&
  34000. e.data.frames &&
  34001. !o.resources[s]
  34002. ) {
  34003. var a =
  34004. null ===
  34005. (i = null === (n = e.data) || void 0 === n ? void 0 : n.meta) ||
  34006. void 0 === i
  34007. ? void 0
  34008. : i.related_multi_packs;
  34009. if (Array.isArray(a))
  34010. for (
  34011. var u = function (t) {
  34012. if ('string' != typeof t) return 'continue';
  34013. var r = t.replace('.json', ''),
  34014. n = GM.resolve(e.url.replace(o.baseUrl, ''), t);
  34015. if (
  34016. o.resources[r] ||
  34017. Object.values(o.resources).some(function (t) {
  34018. return GM.format(GM.parse(t.url)) === n;
  34019. })
  34020. )
  34021. return 'continue';
  34022. var i = {
  34023. crossOrigin: e.crossOrigin,
  34024. loadType: DN.LOAD_TYPE.XHR,
  34025. xhrType: DN.XHR_RESPONSE_TYPE.JSON,
  34026. parentResource: e,
  34027. metadata: e.metadata,
  34028. };
  34029. o.add(r, n, i);
  34030. },
  34031. c = 0,
  34032. h = a;
  34033. c < h.length;
  34034. c++
  34035. ) {
  34036. u(h[c]);
  34037. }
  34038. var l = {
  34039. crossOrigin: e.crossOrigin,
  34040. metadata: e.metadata.imageMetadata,
  34041. parentResource: e,
  34042. },
  34043. d = t.getResourcePath(e, o.baseUrl);
  34044. o.add(s, d, l, function (t) {
  34045. if (t.error) r(t.error);
  34046. else {
  34047. var n = new KB(t.texture, e.data, e.url);
  34048. n.parse().then(function () {
  34049. (e.spritesheet = n), (e.textures = n.textures), r();
  34050. });
  34051. }
  34052. });
  34053. } else r();
  34054. }),
  34055. (t.getResourcePath = function (t, e) {
  34056. return t.isDataUrl
  34057. ? t.data.meta.image
  34058. : GM.resolve(t.url.replace(e, ''), t.data.meta.image);
  34059. }),
  34060. (t.extension = HD.Loader),
  34061. t
  34062. );
  34063. })(),
  34064. QB = function (t, e) {
  34065. return (
  34066. (QB =
  34067. Object.setPrototypeOf ||
  34068. ({ __proto__: [] } instanceof Array &&
  34069. function (t, e) {
  34070. t.__proto__ = e;
  34071. }) ||
  34072. function (t, e) {
  34073. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  34074. }),
  34075. QB(t, e)
  34076. );
  34077. };
  34078. function $B(t, e) {
  34079. function r() {
  34080. this.constructor = t;
  34081. }
  34082. QB(t, e),
  34083. (t.prototype =
  34084. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  34085. }
  34086. var tG = new _D(),
  34087. eG = (function (t) {
  34088. function e(e, r, n) {
  34089. void 0 === r && (r = 100), void 0 === n && (n = 100);
  34090. var i = t.call(this, e) || this;
  34091. return (
  34092. (i.tileTransform = new ND()),
  34093. (i._width = r),
  34094. (i._height = n),
  34095. (i.uvMatrix = i.texture.uvMatrix || new wF(e)),
  34096. (i.pluginName = 'tilingSprite'),
  34097. (i.uvRespectAnchor = !1),
  34098. i
  34099. );
  34100. }
  34101. return (
  34102. $B(e, t),
  34103. Object.defineProperty(e.prototype, 'clampMargin', {
  34104. get: function () {
  34105. return this.uvMatrix.clampMargin;
  34106. },
  34107. set: function (t) {
  34108. (this.uvMatrix.clampMargin = t), this.uvMatrix.update(!0);
  34109. },
  34110. enumerable: !1,
  34111. configurable: !0,
  34112. }),
  34113. Object.defineProperty(e.prototype, 'tileScale', {
  34114. get: function () {
  34115. return this.tileTransform.scale;
  34116. },
  34117. set: function (t) {
  34118. this.tileTransform.scale.copyFrom(t);
  34119. },
  34120. enumerable: !1,
  34121. configurable: !0,
  34122. }),
  34123. Object.defineProperty(e.prototype, 'tilePosition', {
  34124. get: function () {
  34125. return this.tileTransform.position;
  34126. },
  34127. set: function (t) {
  34128. this.tileTransform.position.copyFrom(t);
  34129. },
  34130. enumerable: !1,
  34131. configurable: !0,
  34132. }),
  34133. (e.prototype._onTextureUpdate = function () {
  34134. this.uvMatrix && (this.uvMatrix.texture = this._texture),
  34135. (this._cachedTint = 16777215);
  34136. }),
  34137. (e.prototype._render = function (t) {
  34138. var e = this._texture;
  34139. e &&
  34140. e.valid &&
  34141. (this.tileTransform.updateLocalTransform(),
  34142. this.uvMatrix.update(),
  34143. t.batch.setObjectRenderer(t.plugins[this.pluginName]),
  34144. t.plugins[this.pluginName].render(this));
  34145. }),
  34146. (e.prototype._calculateBounds = function () {
  34147. var t = this._width * -this._anchor._x,
  34148. e = this._height * -this._anchor._y,
  34149. r = this._width * (1 - this._anchor._x),
  34150. n = this._height * (1 - this._anchor._y);
  34151. this._bounds.addFrame(this.transform, t, e, r, n);
  34152. }),
  34153. (e.prototype.getLocalBounds = function (e) {
  34154. return 0 === this.children.length
  34155. ? ((this._bounds.minX = this._width * -this._anchor._x),
  34156. (this._bounds.minY = this._height * -this._anchor._y),
  34157. (this._bounds.maxX = this._width * (1 - this._anchor._x)),
  34158. (this._bounds.maxY = this._height * (1 - this._anchor._y)),
  34159. e ||
  34160. (this._localBoundsRect || (this._localBoundsRect = new TD()),
  34161. (e = this._localBoundsRect)),
  34162. this._bounds.getRectangle(e))
  34163. : t.prototype.getLocalBounds.call(this, e);
  34164. }),
  34165. (e.prototype.containsPoint = function (t) {
  34166. this.worldTransform.applyInverse(t, tG);
  34167. var e = this._width,
  34168. r = this._height,
  34169. n = -e * this.anchor._x;
  34170. if (tG.x >= n && tG.x < n + e) {
  34171. var i = -r * this.anchor._y;
  34172. if (tG.y >= i && tG.y < i + r) return !0;
  34173. }
  34174. return !1;
  34175. }),
  34176. (e.prototype.destroy = function (e) {
  34177. t.prototype.destroy.call(this, e),
  34178. (this.tileTransform = null),
  34179. (this.uvMatrix = null);
  34180. }),
  34181. (e.from = function (t, r) {
  34182. return new e(t instanceof EL ? t : EL.from(t, r), r.width, r.height);
  34183. }),
  34184. Object.defineProperty(e.prototype, 'width', {
  34185. get: function () {
  34186. return this._width;
  34187. },
  34188. set: function (t) {
  34189. this._width = t;
  34190. },
  34191. enumerable: !1,
  34192. configurable: !0,
  34193. }),
  34194. Object.defineProperty(e.prototype, 'height', {
  34195. get: function () {
  34196. return this._height;
  34197. },
  34198. set: function (t) {
  34199. this._height = t;
  34200. },
  34201. enumerable: !1,
  34202. configurable: !0,
  34203. }),
  34204. e
  34205. );
  34206. })(SB),
  34207. rG =
  34208. '#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n',
  34209. nG = new CD(),
  34210. iG = (function (t) {
  34211. function e(e) {
  34212. var r = t.call(this, e) || this;
  34213. return (
  34214. e.runners.contextChange.add(r),
  34215. (r.quad = new FL()),
  34216. (r.state = xF.for2d()),
  34217. r
  34218. );
  34219. }
  34220. return (
  34221. $B(e, t),
  34222. (e.prototype.contextChange = function () {
  34223. var t = this.renderer,
  34224. e = { globals: t.globalUniforms };
  34225. (this.simpleShader = TF.from(
  34226. rG,
  34227. '#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 texSample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = texSample * uColor;\n}\n',
  34228. e
  34229. )),
  34230. (this.shader =
  34231. t.context.webGLVersion > 1
  34232. ? TF.from(
  34233. '#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n',
  34234. '#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n',
  34235. e
  34236. )
  34237. : TF.from(
  34238. rG,
  34239. '#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n',
  34240. e
  34241. ));
  34242. }),
  34243. (e.prototype.render = function (t) {
  34244. var e = this.renderer,
  34245. r = this.quad,
  34246. n = r.vertices;
  34247. (n[0] = n[6] = t._width * -t.anchor.x),
  34248. (n[1] = n[3] = t._height * -t.anchor.y),
  34249. (n[2] = n[4] = t._width * (1 - t.anchor.x)),
  34250. (n[5] = n[7] = t._height * (1 - t.anchor.y));
  34251. var i = t.uvRespectAnchor ? t.anchor.x : 0,
  34252. o = t.uvRespectAnchor ? t.anchor.y : 0;
  34253. ((n = r.uvs)[0] = n[6] = -i),
  34254. (n[1] = n[3] = -o),
  34255. (n[2] = n[4] = 1 - i),
  34256. (n[5] = n[7] = 1 - o),
  34257. r.invalidate();
  34258. var s = t._texture,
  34259. a = s.baseTexture,
  34260. u = a.alphaMode > 0,
  34261. c = t.tileTransform.localTransform,
  34262. h = t.uvMatrix,
  34263. l =
  34264. a.isPowerOfTwo &&
  34265. s.frame.width === a.width &&
  34266. s.frame.height === a.height;
  34267. l &&
  34268. (a._glTextures[e.CONTEXT_UID]
  34269. ? (l = a.wrapMode !== kP.CLAMP)
  34270. : a.wrapMode === kP.CLAMP && (a.wrapMode = kP.REPEAT));
  34271. var d = l ? this.simpleShader : this.shader,
  34272. f = s.width,
  34273. p = s.height,
  34274. v = t._width,
  34275. m = t._height;
  34276. nG.set(
  34277. (c.a * f) / v,
  34278. (c.b * f) / m,
  34279. (c.c * p) / v,
  34280. (c.d * p) / m,
  34281. c.tx / v,
  34282. c.ty / m
  34283. ),
  34284. nG.invert(),
  34285. l
  34286. ? nG.prepend(h.mapCoord)
  34287. : ((d.uniforms.uMapCoord = h.mapCoord.toArray(!0)),
  34288. (d.uniforms.uClampFrame = h.uClampFrame),
  34289. (d.uniforms.uClampOffset = h.uClampOffset)),
  34290. (d.uniforms.uTransform = nG.toArray(!0)),
  34291. (d.uniforms.uColor = qM(
  34292. t.tint,
  34293. t.worldAlpha,
  34294. d.uniforms.uColor,
  34295. u
  34296. )),
  34297. (d.uniforms.translationMatrix = t.transform.worldTransform.toArray(
  34298. !0
  34299. )),
  34300. (d.uniforms.uSampler = s),
  34301. e.shader.bind(d),
  34302. e.geometry.bind(r),
  34303. (this.state.blendMode = JM(t.blendMode, u)),
  34304. e.state.set(this.state),
  34305. e.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);
  34306. }),
  34307. (e.extension = { name: 'tilingSprite', type: HD.RendererPlugin }),
  34308. e
  34309. );
  34310. })(XL),
  34311. oG = function (t, e) {
  34312. return (
  34313. (oG =
  34314. Object.setPrototypeOf ||
  34315. ({ __proto__: [] } instanceof Array &&
  34316. function (t, e) {
  34317. t.__proto__ = e;
  34318. }) ||
  34319. function (t, e) {
  34320. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  34321. }),
  34322. oG(t, e)
  34323. );
  34324. };
  34325. function sG(t, e) {
  34326. function r() {
  34327. this.constructor = t;
  34328. }
  34329. oG(t, e),
  34330. (t.prototype =
  34331. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  34332. }
  34333. var aG = (function () {
  34334. function t(t, e) {
  34335. (this.uvBuffer = t),
  34336. (this.uvMatrix = e),
  34337. (this.data = null),
  34338. (this._bufferUpdateId = -1),
  34339. (this._textureUpdateId = -1),
  34340. (this._updateID = 0);
  34341. }
  34342. return (
  34343. (t.prototype.update = function (t) {
  34344. if (
  34345. t ||
  34346. this._bufferUpdateId !== this.uvBuffer._updateID ||
  34347. this._textureUpdateId !== this.uvMatrix._updateID
  34348. ) {
  34349. (this._bufferUpdateId = this.uvBuffer._updateID),
  34350. (this._textureUpdateId = this.uvMatrix._updateID);
  34351. var e = this.uvBuffer.data;
  34352. (this.data && this.data.length === e.length) ||
  34353. (this.data = new Float32Array(e.length)),
  34354. this.uvMatrix.multiplyUvs(e, this.data),
  34355. this._updateID++;
  34356. }
  34357. }),
  34358. t
  34359. );
  34360. })(),
  34361. uG = new _D(),
  34362. cG = new SD(),
  34363. hG = (function (t) {
  34364. function e(e, r, n, i) {
  34365. void 0 === i && (i = IP.TRIANGLES);
  34366. var o = t.call(this) || this;
  34367. return (
  34368. (o.geometry = e),
  34369. (o.shader = r),
  34370. (o.state = n || xF.for2d()),
  34371. (o.drawMode = i),
  34372. (o.start = 0),
  34373. (o.size = 0),
  34374. (o.uvs = null),
  34375. (o.indices = null),
  34376. (o.vertexData = new Float32Array(1)),
  34377. (o.vertexDirty = -1),
  34378. (o._transformID = -1),
  34379. (o._roundPixels = vA.ROUND_PIXELS),
  34380. (o.batchUvs = null),
  34381. o
  34382. );
  34383. }
  34384. return (
  34385. sG(e, t),
  34386. Object.defineProperty(e.prototype, 'geometry', {
  34387. get: function () {
  34388. return this._geometry;
  34389. },
  34390. set: function (t) {
  34391. this._geometry !== t &&
  34392. (this._geometry &&
  34393. (this._geometry.refCount--,
  34394. 0 === this._geometry.refCount && this._geometry.dispose()),
  34395. (this._geometry = t),
  34396. this._geometry && this._geometry.refCount++,
  34397. (this.vertexDirty = -1));
  34398. },
  34399. enumerable: !1,
  34400. configurable: !0,
  34401. }),
  34402. Object.defineProperty(e.prototype, 'uvBuffer', {
  34403. get: function () {
  34404. return this.geometry.buffers[1];
  34405. },
  34406. enumerable: !1,
  34407. configurable: !0,
  34408. }),
  34409. Object.defineProperty(e.prototype, 'verticesBuffer', {
  34410. get: function () {
  34411. return this.geometry.buffers[0];
  34412. },
  34413. enumerable: !1,
  34414. configurable: !0,
  34415. }),
  34416. Object.defineProperty(e.prototype, 'material', {
  34417. get: function () {
  34418. return this.shader;
  34419. },
  34420. set: function (t) {
  34421. this.shader = t;
  34422. },
  34423. enumerable: !1,
  34424. configurable: !0,
  34425. }),
  34426. Object.defineProperty(e.prototype, 'blendMode', {
  34427. get: function () {
  34428. return this.state.blendMode;
  34429. },
  34430. set: function (t) {
  34431. this.state.blendMode = t;
  34432. },
  34433. enumerable: !1,
  34434. configurable: !0,
  34435. }),
  34436. Object.defineProperty(e.prototype, 'roundPixels', {
  34437. get: function () {
  34438. return this._roundPixels;
  34439. },
  34440. set: function (t) {
  34441. this._roundPixels !== t && (this._transformID = -1),
  34442. (this._roundPixels = t);
  34443. },
  34444. enumerable: !1,
  34445. configurable: !0,
  34446. }),
  34447. Object.defineProperty(e.prototype, 'tint', {
  34448. get: function () {
  34449. return 'tint' in this.shader ? this.shader.tint : null;
  34450. },
  34451. set: function (t) {
  34452. this.shader.tint = t;
  34453. },
  34454. enumerable: !1,
  34455. configurable: !0,
  34456. }),
  34457. Object.defineProperty(e.prototype, 'texture', {
  34458. get: function () {
  34459. return 'texture' in this.shader ? this.shader.texture : null;
  34460. },
  34461. set: function (t) {
  34462. this.shader.texture = t;
  34463. },
  34464. enumerable: !1,
  34465. configurable: !0,
  34466. }),
  34467. (e.prototype._render = function (t) {
  34468. var r = this.geometry.buffers[0].data;
  34469. this.shader.batchable &&
  34470. this.drawMode === IP.TRIANGLES &&
  34471. r.length < 2 * e.BATCHABLE_SIZE
  34472. ? this._renderToBatch(t)
  34473. : this._renderDefault(t);
  34474. }),
  34475. (e.prototype._renderDefault = function (t) {
  34476. var e = this.shader;
  34477. (e.alpha = this.worldAlpha),
  34478. e.update && e.update(),
  34479. t.batch.flush(),
  34480. (e.uniforms.translationMatrix =
  34481. this.transform.worldTransform.toArray(!0)),
  34482. t.shader.bind(e),
  34483. t.state.set(this.state),
  34484. t.geometry.bind(this.geometry, e),
  34485. t.geometry.draw(
  34486. this.drawMode,
  34487. this.size,
  34488. this.start,
  34489. this.geometry.instanceCount
  34490. );
  34491. }),
  34492. (e.prototype._renderToBatch = function (t) {
  34493. var e = this.geometry,
  34494. r = this.shader;
  34495. r.uvMatrix && (r.uvMatrix.update(), this.calculateUvs()),
  34496. this.calculateVertices(),
  34497. (this.indices = e.indexBuffer.data),
  34498. (this._tintRGB = r._tintRGB),
  34499. (this._texture = r.texture);
  34500. var n = this.material.pluginName;
  34501. t.batch.setObjectRenderer(t.plugins[n]), t.plugins[n].render(this);
  34502. }),
  34503. (e.prototype.calculateVertices = function () {
  34504. var t = this.geometry.buffers[0],
  34505. e = t.data,
  34506. r = t._updateID;
  34507. if (
  34508. r !== this.vertexDirty ||
  34509. this._transformID !== this.transform._worldID
  34510. ) {
  34511. (this._transformID = this.transform._worldID),
  34512. this.vertexData.length !== e.length &&
  34513. (this.vertexData = new Float32Array(e.length));
  34514. for (
  34515. var n = this.transform.worldTransform,
  34516. i = n.a,
  34517. o = n.b,
  34518. s = n.c,
  34519. a = n.d,
  34520. u = n.tx,
  34521. c = n.ty,
  34522. h = this.vertexData,
  34523. l = 0;
  34524. l < h.length / 2;
  34525. l++
  34526. ) {
  34527. var d = e[2 * l],
  34528. f = e[2 * l + 1];
  34529. (h[2 * l] = i * d + s * f + u),
  34530. (h[2 * l + 1] = o * d + a * f + c);
  34531. }
  34532. if (this._roundPixels) {
  34533. var p = vA.RESOLUTION;
  34534. for (l = 0; l < h.length; ++l)
  34535. h[l] = Math.round(((h[l] * p) | 0) / p);
  34536. }
  34537. this.vertexDirty = r;
  34538. }
  34539. }),
  34540. (e.prototype.calculateUvs = function () {
  34541. var t = this.geometry.buffers[1],
  34542. e = this.shader;
  34543. e.uvMatrix.isSimple
  34544. ? (this.uvs = t.data)
  34545. : (this.batchUvs || (this.batchUvs = new aG(t, e.uvMatrix)),
  34546. this.batchUvs.update(),
  34547. (this.uvs = this.batchUvs.data));
  34548. }),
  34549. (e.prototype._calculateBounds = function () {
  34550. this.calculateVertices(),
  34551. this._bounds.addVertexData(
  34552. this.vertexData,
  34553. 0,
  34554. this.vertexData.length
  34555. );
  34556. }),
  34557. (e.prototype.containsPoint = function (t) {
  34558. if (!this.getBounds().contains(t.x, t.y)) return !1;
  34559. this.worldTransform.applyInverse(t, uG);
  34560. for (
  34561. var e = this.geometry.getBuffer('aVertexPosition').data,
  34562. r = cG.points,
  34563. n = this.geometry.getIndex().data,
  34564. i = n.length,
  34565. o = 4 === this.drawMode ? 3 : 1,
  34566. s = 0;
  34567. s + 2 < i;
  34568. s += o
  34569. ) {
  34570. var a = 2 * n[s],
  34571. u = 2 * n[s + 1],
  34572. c = 2 * n[s + 2];
  34573. if (
  34574. ((r[0] = e[a]),
  34575. (r[1] = e[a + 1]),
  34576. (r[2] = e[u]),
  34577. (r[3] = e[u + 1]),
  34578. (r[4] = e[c]),
  34579. (r[5] = e[c + 1]),
  34580. cG.contains(uG.x, uG.y))
  34581. )
  34582. return !0;
  34583. }
  34584. return !1;
  34585. }),
  34586. (e.prototype.destroy = function (e) {
  34587. t.prototype.destroy.call(this, e),
  34588. this._cachedTexture &&
  34589. (this._cachedTexture.destroy(), (this._cachedTexture = null)),
  34590. (this.geometry = null),
  34591. (this.shader = null),
  34592. (this.state = null),
  34593. (this.uvs = null),
  34594. (this.indices = null),
  34595. (this.vertexData = null);
  34596. }),
  34597. (e.BATCHABLE_SIZE = 100),
  34598. e
  34599. );
  34600. })(VD),
  34601. lG = (function (t) {
  34602. function e(e, r) {
  34603. var n = this,
  34604. i = {
  34605. uSampler: e,
  34606. alpha: 1,
  34607. uTextureMatrix: CD.IDENTITY,
  34608. uColor: new Float32Array([1, 1, 1, 1]),
  34609. };
  34610. return (
  34611. (r = Object.assign(
  34612. { tint: 16777215, alpha: 1, pluginName: 'batch' },
  34613. r
  34614. )).uniforms && Object.assign(i, r.uniforms),
  34615. ((n =
  34616. t.call(
  34617. this,
  34618. r.program ||
  34619. bF.from(
  34620. 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n',
  34621. 'varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n'
  34622. ),
  34623. i
  34624. ) || this)._colorDirty = !1),
  34625. (n.uvMatrix = new wF(e)),
  34626. (n.batchable = void 0 === r.program),
  34627. (n.pluginName = r.pluginName),
  34628. (n.tint = r.tint),
  34629. (n.alpha = r.alpha),
  34630. n
  34631. );
  34632. }
  34633. return (
  34634. sG(e, t),
  34635. Object.defineProperty(e.prototype, 'texture', {
  34636. get: function () {
  34637. return this.uniforms.uSampler;
  34638. },
  34639. set: function (t) {
  34640. this.uniforms.uSampler !== t &&
  34641. (!this.uniforms.uSampler.baseTexture.alphaMode !=
  34642. !t.baseTexture.alphaMode && (this._colorDirty = !0),
  34643. (this.uniforms.uSampler = t),
  34644. (this.uvMatrix.texture = t));
  34645. },
  34646. enumerable: !1,
  34647. configurable: !0,
  34648. }),
  34649. Object.defineProperty(e.prototype, 'alpha', {
  34650. get: function () {
  34651. return this._alpha;
  34652. },
  34653. set: function (t) {
  34654. t !== this._alpha && ((this._alpha = t), (this._colorDirty = !0));
  34655. },
  34656. enumerable: !1,
  34657. configurable: !0,
  34658. }),
  34659. Object.defineProperty(e.prototype, 'tint', {
  34660. get: function () {
  34661. return this._tint;
  34662. },
  34663. set: function (t) {
  34664. t !== this._tint &&
  34665. ((this._tint = t),
  34666. (this._tintRGB = (t >> 16) + (65280 & t) + ((255 & t) << 16)),
  34667. (this._colorDirty = !0));
  34668. },
  34669. enumerable: !1,
  34670. configurable: !0,
  34671. }),
  34672. (e.prototype.update = function () {
  34673. if (this._colorDirty) {
  34674. this._colorDirty = !1;
  34675. var t = this.texture.baseTexture;
  34676. qM(this._tint, this._alpha, this.uniforms.uColor, t.alphaMode);
  34677. }
  34678. this.uvMatrix.update() &&
  34679. (this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord);
  34680. }),
  34681. e
  34682. );
  34683. })(TF),
  34684. dG = (function (t) {
  34685. function e(e, r, n) {
  34686. var i = t.call(this) || this,
  34687. o = new PL(e),
  34688. s = new PL(r, !0),
  34689. a = new PL(n, !0, !0);
  34690. return (
  34691. i
  34692. .addAttribute('aVertexPosition', o, 2, !1, LP.FLOAT)
  34693. .addAttribute('aTextureCoord', s, 2, !1, LP.FLOAT)
  34694. .addIndex(a),
  34695. (i._updateId = -1),
  34696. i
  34697. );
  34698. }
  34699. return (
  34700. sG(e, t),
  34701. Object.defineProperty(e.prototype, 'vertexDirtyId', {
  34702. get: function () {
  34703. return this.buffers[0]._updateID;
  34704. },
  34705. enumerable: !1,
  34706. configurable: !0,
  34707. }),
  34708. e
  34709. );
  34710. })(DL),
  34711. fG = function (t, e) {
  34712. return (
  34713. (fG =
  34714. Object.setPrototypeOf ||
  34715. ({ __proto__: [] } instanceof Array &&
  34716. function (t, e) {
  34717. t.__proto__ = e;
  34718. }) ||
  34719. function (t, e) {
  34720. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  34721. }),
  34722. fG(t, e)
  34723. );
  34724. };
  34725. var pG = function () {
  34726. (this.info = []),
  34727. (this.common = []),
  34728. (this.page = []),
  34729. (this.char = []),
  34730. (this.kerning = []),
  34731. (this.distanceField = []);
  34732. },
  34733. vG = (function () {
  34734. function t() {}
  34735. return (
  34736. (t.test = function (t) {
  34737. return 'string' == typeof t && 0 === t.indexOf('info face=');
  34738. }),
  34739. (t.parse = function (t) {
  34740. var e = t.match(/^[a-z]+\s+.+$/gm),
  34741. r = {
  34742. info: [],
  34743. common: [],
  34744. page: [],
  34745. char: [],
  34746. chars: [],
  34747. kerning: [],
  34748. kernings: [],
  34749. distanceField: [],
  34750. };
  34751. for (var n in e) {
  34752. var i = e[n].match(/^[a-z]+/gm)[0],
  34753. o = e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),
  34754. s = {};
  34755. for (var a in o) {
  34756. var u = o[a].split('='),
  34757. c = u[0],
  34758. h = u[1].replace(/"/gm, ''),
  34759. l = parseFloat(h),
  34760. d = isNaN(l) ? h : l;
  34761. s[c] = d;
  34762. }
  34763. r[i].push(s);
  34764. }
  34765. var f = new pG();
  34766. return (
  34767. r.info.forEach(function (t) {
  34768. return f.info.push({ face: t.face, size: parseInt(t.size, 10) });
  34769. }),
  34770. r.common.forEach(function (t) {
  34771. return f.common.push({ lineHeight: parseInt(t.lineHeight, 10) });
  34772. }),
  34773. r.page.forEach(function (t) {
  34774. return f.page.push({ id: parseInt(t.id, 10), file: t.file });
  34775. }),
  34776. r.char.forEach(function (t) {
  34777. return f.char.push({
  34778. id: parseInt(t.id, 10),
  34779. page: parseInt(t.page, 10),
  34780. x: parseInt(t.x, 10),
  34781. y: parseInt(t.y, 10),
  34782. width: parseInt(t.width, 10),
  34783. height: parseInt(t.height, 10),
  34784. xoffset: parseInt(t.xoffset, 10),
  34785. yoffset: parseInt(t.yoffset, 10),
  34786. xadvance: parseInt(t.xadvance, 10),
  34787. });
  34788. }),
  34789. r.kerning.forEach(function (t) {
  34790. return f.kerning.push({
  34791. first: parseInt(t.first, 10),
  34792. second: parseInt(t.second, 10),
  34793. amount: parseInt(t.amount, 10),
  34794. });
  34795. }),
  34796. r.distanceField.forEach(function (t) {
  34797. return f.distanceField.push({
  34798. distanceRange: parseInt(t.distanceRange, 10),
  34799. fieldType: t.fieldType,
  34800. });
  34801. }),
  34802. f
  34803. );
  34804. }),
  34805. t
  34806. );
  34807. })(),
  34808. mG = (function () {
  34809. function t() {}
  34810. return (
  34811. (t.test = function (t) {
  34812. return (
  34813. t instanceof XMLDocument &&
  34814. t.getElementsByTagName('page').length &&
  34815. null !== t.getElementsByTagName('info')[0].getAttribute('face')
  34816. );
  34817. }),
  34818. (t.parse = function (t) {
  34819. for (
  34820. var e = new pG(),
  34821. r = t.getElementsByTagName('info'),
  34822. n = t.getElementsByTagName('common'),
  34823. i = t.getElementsByTagName('page'),
  34824. o = t.getElementsByTagName('char'),
  34825. s = t.getElementsByTagName('kerning'),
  34826. a = t.getElementsByTagName('distanceField'),
  34827. u = 0;
  34828. u < r.length;
  34829. u++
  34830. )
  34831. e.info.push({
  34832. face: r[u].getAttribute('face'),
  34833. size: parseInt(r[u].getAttribute('size'), 10),
  34834. });
  34835. for (u = 0; u < n.length; u++)
  34836. e.common.push({
  34837. lineHeight: parseInt(n[u].getAttribute('lineHeight'), 10),
  34838. });
  34839. for (u = 0; u < i.length; u++)
  34840. e.page.push({
  34841. id: parseInt(i[u].getAttribute('id'), 10) || 0,
  34842. file: i[u].getAttribute('file'),
  34843. });
  34844. for (u = 0; u < o.length; u++) {
  34845. var c = o[u];
  34846. e.char.push({
  34847. id: parseInt(c.getAttribute('id'), 10),
  34848. page: parseInt(c.getAttribute('page'), 10) || 0,
  34849. x: parseInt(c.getAttribute('x'), 10),
  34850. y: parseInt(c.getAttribute('y'), 10),
  34851. width: parseInt(c.getAttribute('width'), 10),
  34852. height: parseInt(c.getAttribute('height'), 10),
  34853. xoffset: parseInt(c.getAttribute('xoffset'), 10),
  34854. yoffset: parseInt(c.getAttribute('yoffset'), 10),
  34855. xadvance: parseInt(c.getAttribute('xadvance'), 10),
  34856. });
  34857. }
  34858. for (u = 0; u < s.length; u++)
  34859. e.kerning.push({
  34860. first: parseInt(s[u].getAttribute('first'), 10),
  34861. second: parseInt(s[u].getAttribute('second'), 10),
  34862. amount: parseInt(s[u].getAttribute('amount'), 10),
  34863. });
  34864. for (u = 0; u < a.length; u++)
  34865. e.distanceField.push({
  34866. fieldType: a[u].getAttribute('fieldType'),
  34867. distanceRange: parseInt(a[u].getAttribute('distanceRange'), 10),
  34868. });
  34869. return e;
  34870. }),
  34871. t
  34872. );
  34873. })(),
  34874. yG = (function () {
  34875. function t() {}
  34876. return (
  34877. (t.test = function (t) {
  34878. if ('string' == typeof t && t.indexOf('<font>') > -1) {
  34879. var e = new globalThis.DOMParser().parseFromString(t, 'text/xml');
  34880. return mG.test(e);
  34881. }
  34882. return !1;
  34883. }),
  34884. (t.parse = function (t) {
  34885. var e = new globalThis.DOMParser().parseFromString(t, 'text/xml');
  34886. return mG.parse(e);
  34887. }),
  34888. t
  34889. );
  34890. })(),
  34891. gG = [vG, mG, yG];
  34892. function _G(t) {
  34893. for (var e = 0; e < gG.length; e++) if (gG[e].test(t)) return gG[e];
  34894. return null;
  34895. }
  34896. function bG(t, e, r, n, i, o, s) {
  34897. var a = r.text,
  34898. u = r.fontProperties;
  34899. e.translate(n, i), e.scale(o, o);
  34900. var c = s.strokeThickness / 2,
  34901. h = -s.strokeThickness / 2;
  34902. if (
  34903. ((e.font = s.toFontString()),
  34904. (e.lineWidth = s.strokeThickness),
  34905. (e.textBaseline = s.textBaseline),
  34906. (e.lineJoin = s.lineJoin),
  34907. (e.miterLimit = s.miterLimit),
  34908. (e.fillStyle = (function (t, e, r, n, i, o) {
  34909. var s,
  34910. a = r.fill;
  34911. if (!Array.isArray(a)) return a;
  34912. if (1 === a.length) return a[0];
  34913. var u = r.dropShadow ? r.dropShadowDistance : 0,
  34914. c = r.padding || 0,
  34915. h = t.width / n - u - 2 * c,
  34916. l = t.height / n - u - 2 * c,
  34917. d = a.slice(),
  34918. f = r.fillGradientStops.slice();
  34919. if (!f.length)
  34920. for (var p = d.length + 1, v = 1; v < p; ++v) f.push(v / p);
  34921. if (
  34922. (d.unshift(a[0]),
  34923. f.unshift(0),
  34924. d.push(a[a.length - 1]),
  34925. f.push(1),
  34926. r.fillGradientType === TB.LINEAR_VERTICAL)
  34927. ) {
  34928. s = e.createLinearGradient(h / 2, c, h / 2, l + c);
  34929. var m = 0,
  34930. y = (o.fontProperties.fontSize + r.strokeThickness) / l;
  34931. for (v = 0; v < i.length; v++)
  34932. for (var g = o.lineHeight * v, _ = 0; _ < d.length; _++) {
  34933. var b =
  34934. g / l + ('number' == typeof f[_] ? f[_] : _ / d.length) * y,
  34935. T = Math.max(m, b);
  34936. (T = Math.min(T, 1)), s.addColorStop(T, d[_]), (m = T);
  34937. }
  34938. } else {
  34939. s = e.createLinearGradient(c, l / 2, h + c, l / 2);
  34940. var x = d.length + 1,
  34941. E = 1;
  34942. for (v = 0; v < d.length; v++) {
  34943. var S = void 0;
  34944. (S = 'number' == typeof f[v] ? f[v] : E / x),
  34945. s.addColorStop(S, d[v]),
  34946. E++;
  34947. }
  34948. }
  34949. return s;
  34950. })(t, e, s, o, [a], r)),
  34951. (e.strokeStyle = s.stroke),
  34952. s.dropShadow)
  34953. ) {
  34954. var l = s.dropShadowColor,
  34955. d = HM('number' == typeof l ? l : YM(l)),
  34956. f = s.dropShadowBlur * o,
  34957. p = s.dropShadowDistance * o;
  34958. (e.shadowColor =
  34959. 'rgba(' +
  34960. 255 * d[0] +
  34961. ',' +
  34962. 255 * d[1] +
  34963. ',' +
  34964. 255 * d[2] +
  34965. ',' +
  34966. s.dropShadowAlpha +
  34967. ')'),
  34968. (e.shadowBlur = f),
  34969. (e.shadowOffsetX = Math.cos(s.dropShadowAngle) * p),
  34970. (e.shadowOffsetY = Math.sin(s.dropShadowAngle) * p);
  34971. } else
  34972. (e.shadowColor = 'black'),
  34973. (e.shadowBlur = 0),
  34974. (e.shadowOffsetX = 0),
  34975. (e.shadowOffsetY = 0);
  34976. s.stroke &&
  34977. s.strokeThickness &&
  34978. e.strokeText(a, c, h + r.lineHeight - u.descent),
  34979. s.fill && e.fillText(a, c, h + r.lineHeight - u.descent),
  34980. e.setTransform(1, 0, 0, 1, 0, 0),
  34981. (e.fillStyle = 'rgba(0, 0, 0, 0)');
  34982. }
  34983. function TG(t) {
  34984. return Array.from ? Array.from(t) : t.split('');
  34985. }
  34986. function xG(t) {
  34987. return t.codePointAt ? t.codePointAt(0) : t.charCodeAt(0);
  34988. }
  34989. var EG = (function () {
  34990. function t(t, e, r) {
  34991. var n,
  34992. i,
  34993. o = t.info[0],
  34994. s = t.common[0],
  34995. a = t.page[0],
  34996. u = t.distanceField[0],
  34997. c = pD(a.file),
  34998. h = {};
  34999. (this._ownsTextures = r),
  35000. (this.font = o.face),
  35001. (this.size = o.size),
  35002. (this.lineHeight = s.lineHeight / c),
  35003. (this.chars = {}),
  35004. (this.pageTextures = h);
  35005. for (var l = 0; l < t.page.length; l++) {
  35006. var d = t.page[l],
  35007. f = d.id,
  35008. p = d.file;
  35009. (h[f] = e instanceof Array ? e[l] : e[p]),
  35010. (null == u ? void 0 : u.fieldType) &&
  35011. 'none' !== u.fieldType &&
  35012. ((h[f].baseTexture.alphaMode = GP.NO_PREMULTIPLIED_ALPHA),
  35013. (h[f].baseTexture.mipmap = BP.OFF));
  35014. }
  35015. for (l = 0; l < t.char.length; l++) {
  35016. var v = t.char[l],
  35017. m = ((f = v.id), v.page),
  35018. y = t.char[l],
  35019. g = y.x,
  35020. _ = y.y,
  35021. b = y.width,
  35022. T = y.height,
  35023. x = y.xoffset,
  35024. E = y.yoffset,
  35025. S = y.xadvance;
  35026. (_ /= c), (b /= c), (T /= c), (x /= c), (E /= c), (S /= c);
  35027. var w = new TD(
  35028. (g /= c) + h[m].frame.x / c,
  35029. _ + h[m].frame.y / c,
  35030. b,
  35031. T
  35032. );
  35033. this.chars[f] = {
  35034. xOffset: x,
  35035. yOffset: E,
  35036. xAdvance: S,
  35037. kerning: {},
  35038. texture: new EL(h[m].baseTexture, w),
  35039. page: m,
  35040. };
  35041. }
  35042. for (l = 0; l < t.kerning.length; l++) {
  35043. var R = t.kerning[l],
  35044. C = R.first,
  35045. P = R.second,
  35046. A = R.amount;
  35047. (C /= c),
  35048. (P /= c),
  35049. (A /= c),
  35050. this.chars[P] && (this.chars[P].kerning[C] = A);
  35051. }
  35052. (this.distanceFieldRange = null == u ? void 0 : u.distanceRange),
  35053. (this.distanceFieldType =
  35054. null !==
  35055. (i =
  35056. null === (n = null == u ? void 0 : u.fieldType) || void 0 === n
  35057. ? void 0
  35058. : n.toLowerCase()) && void 0 !== i
  35059. ? i
  35060. : 'none');
  35061. }
  35062. return (
  35063. (t.prototype.destroy = function () {
  35064. for (var t in this.chars)
  35065. this.chars[t].texture.destroy(), (this.chars[t].texture = null);
  35066. for (var t in this.pageTextures)
  35067. this._ownsTextures && this.pageTextures[t].destroy(!0),
  35068. (this.pageTextures[t] = null);
  35069. (this.chars = null), (this.pageTextures = null);
  35070. }),
  35071. (t.install = function (e, r, n) {
  35072. var i;
  35073. if (e instanceof pG) i = e;
  35074. else {
  35075. var o = _G(e);
  35076. if (!o) throw new Error('Unrecognized data format for font.');
  35077. i = o.parse(e);
  35078. }
  35079. r instanceof EL && (r = [r]);
  35080. var s = new t(i, r, n);
  35081. return (t.available[s.font] = s), s;
  35082. }),
  35083. (t.uninstall = function (e) {
  35084. var r = t.available[e];
  35085. if (!r) throw new Error("No font found named '" + e + "'");
  35086. r.destroy(), delete t.available[e];
  35087. }),
  35088. (t.from = function (e, r, n) {
  35089. if (!e) throw new Error('[BitmapFont] Property `name` is required.');
  35090. var i = Object.assign({}, t.defaultOptions, n),
  35091. o = i.chars,
  35092. s = i.padding,
  35093. a = i.resolution,
  35094. u = i.textureWidth,
  35095. c = i.textureHeight,
  35096. h = (function (t) {
  35097. 'string' == typeof t && (t = [t]);
  35098. for (var e = [], r = 0, n = t.length; r < n; r++) {
  35099. var i = t[r];
  35100. if (Array.isArray(i)) {
  35101. if (2 !== i.length)
  35102. throw new Error(
  35103. '[BitmapFont]: Invalid character range length, expecting 2 got ' +
  35104. i.length +
  35105. '.'
  35106. );
  35107. var o = i[0].charCodeAt(0),
  35108. s = i[1].charCodeAt(0);
  35109. if (s < o)
  35110. throw new Error('[BitmapFont]: Invalid character range.');
  35111. for (var a = o, u = s; a <= u; a++)
  35112. e.push(String.fromCharCode(a));
  35113. } else e.push.apply(e, TG(i));
  35114. }
  35115. if (0 === e.length)
  35116. throw new Error(
  35117. '[BitmapFont]: Empty set when resolving characters.'
  35118. );
  35119. return e;
  35120. })(o),
  35121. l = r instanceof PB ? r : new PB(r),
  35122. d = u,
  35123. f = new pG();
  35124. (f.info[0] = { face: l.fontFamily, size: l.fontSize }),
  35125. (f.common[0] = { lineHeight: l.fontSize });
  35126. for (
  35127. var p, v, m, y = 0, g = 0, _ = 0, b = [], T = 0;
  35128. T < h.length;
  35129. T++
  35130. ) {
  35131. p ||
  35132. (((p = vA.ADAPTER.createCanvas()).width = u),
  35133. (p.height = c),
  35134. (v = p.getContext('2d')),
  35135. (m = new aL(p, { resolution: a })),
  35136. b.push(new EL(m)),
  35137. f.page.push({ id: b.length - 1, file: '' }));
  35138. var x = h[T],
  35139. E = DB.measureText(x, l, !1, p),
  35140. S = E.width,
  35141. w = Math.ceil(E.height),
  35142. R = Math.ceil(('italic' === l.fontStyle ? 2 : 1) * S);
  35143. if (g >= c - w * a) {
  35144. if (0 === g)
  35145. throw new Error(
  35146. '[BitmapFont] textureHeight ' +
  35147. c +
  35148. "px is too small (fontFamily: '" +
  35149. l.fontFamily +
  35150. "', fontSize: " +
  35151. l.fontSize +
  35152. "px, char: '" +
  35153. x +
  35154. "')"
  35155. );
  35156. --T,
  35157. (p = null),
  35158. (v = null),
  35159. (m = null),
  35160. (g = 0),
  35161. (y = 0),
  35162. (_ = 0);
  35163. } else if (
  35164. ((_ = Math.max(w + E.fontProperties.descent, _)), R * a + y >= d)
  35165. ) {
  35166. if (0 === y)
  35167. throw new Error(
  35168. '[BitmapFont] textureWidth ' +
  35169. u +
  35170. "px is too small (fontFamily: '" +
  35171. l.fontFamily +
  35172. "', fontSize: " +
  35173. l.fontSize +
  35174. "px, char: '" +
  35175. x +
  35176. "')"
  35177. );
  35178. --T, (g += _ * a), (g = Math.ceil(g)), (y = 0), (_ = 0);
  35179. } else {
  35180. bG(p, v, E, y, g, a, l);
  35181. var C = xG(E.text);
  35182. f.char.push({
  35183. id: C,
  35184. page: b.length - 1,
  35185. x: y / a,
  35186. y: g / a,
  35187. width: R,
  35188. height: w,
  35189. xoffset: 0,
  35190. yoffset: 0,
  35191. xadvance: Math.ceil(
  35192. S -
  35193. (l.dropShadow ? l.dropShadowDistance : 0) -
  35194. (l.stroke ? l.strokeThickness : 0)
  35195. ),
  35196. }),
  35197. (y += (R + 2 * s) * a),
  35198. (y = Math.ceil(y));
  35199. }
  35200. }
  35201. if (!(null == n ? void 0 : n.skipKerning)) {
  35202. T = 0;
  35203. for (var P = h.length; T < P; T++)
  35204. for (var A = h[T], O = 0; O < P; O++) {
  35205. var I = h[O],
  35206. M = v.measureText(A).width,
  35207. D = v.measureText(I).width,
  35208. L = v.measureText(A + I).width - (M + D);
  35209. L && f.kerning.push({ first: xG(A), second: xG(I), amount: L });
  35210. }
  35211. }
  35212. var F = new t(f, b, !0);
  35213. return (
  35214. void 0 !== t.available[e] && t.uninstall(e), (t.available[e] = F), F
  35215. );
  35216. }),
  35217. (t.ALPHA = [['a', 'z'], ['A', 'Z'], ' ']),
  35218. (t.NUMERIC = [['0', '9']]),
  35219. (t.ALPHANUMERIC = [['a', 'z'], ['A', 'Z'], ['0', '9'], ' ']),
  35220. (t.ASCII = [[' ', '~']]),
  35221. (t.defaultOptions = {
  35222. resolution: 1,
  35223. textureWidth: 512,
  35224. textureHeight: 512,
  35225. padding: 4,
  35226. chars: t.ALPHANUMERIC,
  35227. }),
  35228. (t.available = {}),
  35229. t
  35230. );
  35231. })(),
  35232. SG = [],
  35233. wG = [],
  35234. RG = [];
  35235. !(function (t) {
  35236. function e(r, n) {
  35237. void 0 === n && (n = {});
  35238. var i = t.call(this) || this;
  35239. i._tint = 16777215;
  35240. var o = Object.assign({}, e.styleDefaults, n),
  35241. s = o.align,
  35242. a = o.tint,
  35243. u = o.maxWidth,
  35244. c = o.letterSpacing,
  35245. h = o.fontName,
  35246. l = o.fontSize;
  35247. if (!EG.available[h]) throw new Error('Missing BitmapFont "' + h + '"');
  35248. return (
  35249. (i._activePagesMeshData = []),
  35250. (i._textWidth = 0),
  35251. (i._textHeight = 0),
  35252. (i._align = s),
  35253. (i._tint = a),
  35254. (i._font = void 0),
  35255. (i._fontName = h),
  35256. (i._fontSize = l),
  35257. (i.text = r),
  35258. (i._maxWidth = u),
  35259. (i._maxLineHeight = 0),
  35260. (i._letterSpacing = c),
  35261. (i._anchor = new RD(
  35262. function () {
  35263. i.dirty = !0;
  35264. },
  35265. i,
  35266. 0,
  35267. 0
  35268. )),
  35269. (i._roundPixels = vA.ROUND_PIXELS),
  35270. (i.dirty = !0),
  35271. (i._resolution = vA.RESOLUTION),
  35272. (i._autoResolution = !0),
  35273. (i._textureCache = {}),
  35274. i
  35275. );
  35276. }
  35277. (function (t, e) {
  35278. function r() {
  35279. this.constructor = t;
  35280. }
  35281. fG(t, e),
  35282. (t.prototype =
  35283. null === e
  35284. ? Object.create(e)
  35285. : ((r.prototype = e.prototype), new r()));
  35286. })(e, t),
  35287. (e.prototype.updateText = function () {
  35288. for (
  35289. var t,
  35290. e = EG.available[this._fontName],
  35291. r = this.fontSize,
  35292. n = r / e.size,
  35293. i = new _D(),
  35294. o = [],
  35295. s = [],
  35296. a = [],
  35297. u = TG(this._text.replace(/(?:\r\n|\r)/g, '\n') || ' '),
  35298. c = (this._maxWidth * e.size) / r,
  35299. h = 'none' === e.distanceFieldType ? SG : wG,
  35300. l = null,
  35301. d = 0,
  35302. f = 0,
  35303. p = 0,
  35304. v = -1,
  35305. m = 0,
  35306. y = 0,
  35307. g = 0,
  35308. _ = 0,
  35309. b = 0;
  35310. b < u.length;
  35311. b++
  35312. ) {
  35313. var T = xG((j = u[b]));
  35314. if (
  35315. (/(?:\s)/.test(j) && ((v = b), (m = d), _++),
  35316. '\r' !== j && '\n' !== j)
  35317. ) {
  35318. var x = e.chars[T];
  35319. if (x) {
  35320. l && x.kerning[l] && (i.x += x.kerning[l]);
  35321. var E = RG.pop() || {
  35322. texture: EL.EMPTY,
  35323. line: 0,
  35324. charCode: 0,
  35325. prevSpaces: 0,
  35326. position: new _D(),
  35327. };
  35328. (E.texture = x.texture),
  35329. (E.line = p),
  35330. (E.charCode = T),
  35331. (E.position.x = i.x + x.xOffset + this._letterSpacing / 2),
  35332. (E.position.y = i.y + x.yOffset),
  35333. (E.prevSpaces = _),
  35334. o.push(E),
  35335. (d =
  35336. E.position.x +
  35337. Math.max(x.xAdvance - x.xOffset, x.texture.orig.width)),
  35338. (i.x += x.xAdvance + this._letterSpacing),
  35339. (g = Math.max(g, x.yOffset + x.texture.height)),
  35340. (l = T),
  35341. -1 !== v &&
  35342. c > 0 &&
  35343. i.x > c &&
  35344. (rD(o, 1 + v - ++y, 1 + b - v),
  35345. (b = v),
  35346. (v = -1),
  35347. s.push(m),
  35348. a.push(o.length > 0 ? o[o.length - 1].prevSpaces : 0),
  35349. (f = Math.max(f, m)),
  35350. p++,
  35351. (i.x = 0),
  35352. (i.y += e.lineHeight),
  35353. (l = null),
  35354. (_ = 0));
  35355. }
  35356. } else
  35357. s.push(d),
  35358. a.push(-1),
  35359. (f = Math.max(f, d)),
  35360. ++p,
  35361. ++y,
  35362. (i.x = 0),
  35363. (i.y += e.lineHeight),
  35364. (l = null),
  35365. (_ = 0);
  35366. }
  35367. var S = u[u.length - 1];
  35368. '\r' !== S &&
  35369. '\n' !== S &&
  35370. (/(?:\s)/.test(S) && (d = m),
  35371. s.push(d),
  35372. (f = Math.max(f, d)),
  35373. a.push(-1));
  35374. var w = [];
  35375. for (b = 0; b <= p; b++) {
  35376. var R = 0;
  35377. 'right' === this._align
  35378. ? (R = f - s[b])
  35379. : 'center' === this._align
  35380. ? (R = (f - s[b]) / 2)
  35381. : 'justify' === this._align &&
  35382. (R = a[b] < 0 ? 0 : (f - s[b]) / a[b]),
  35383. w.push(R);
  35384. }
  35385. var C = o.length,
  35386. P = {},
  35387. A = [],
  35388. O = this._activePagesMeshData;
  35389. h.push.apply(h, O);
  35390. for (b = 0; b < C; b++) {
  35391. var I = (V = o[b].texture).baseTexture.uid;
  35392. if (!P[I]) {
  35393. if (!(K = h.pop())) {
  35394. var M = new dG(),
  35395. D = void 0,
  35396. L = void 0;
  35397. 'none' === e.distanceFieldType
  35398. ? ((D = new lG(EL.EMPTY)), (L = OP.NORMAL))
  35399. : ((D = new lG(EL.EMPTY, {
  35400. program: bF.from(
  35401. '// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n',
  35402. '// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n if (median < 0.01) {\r\n alpha = 0.0;\r\n } else if (median > 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n'
  35403. ),
  35404. uniforms: { uFWidth: 0 },
  35405. })),
  35406. (L = OP.NORMAL_NPM));
  35407. var F = new hG(M, D);
  35408. (F.blendMode = L),
  35409. (K = {
  35410. index: 0,
  35411. indexCount: 0,
  35412. vertexCount: 0,
  35413. uvsCount: 0,
  35414. total: 0,
  35415. mesh: F,
  35416. vertices: null,
  35417. uvs: null,
  35418. indices: null,
  35419. });
  35420. }
  35421. (K.index = 0),
  35422. (K.indexCount = 0),
  35423. (K.vertexCount = 0),
  35424. (K.uvsCount = 0),
  35425. (K.total = 0);
  35426. var N = this._textureCache;
  35427. (N[I] = N[I] || new EL(V.baseTexture)),
  35428. (K.mesh.texture = N[I]),
  35429. (K.mesh.tint = this._tint),
  35430. A.push(K),
  35431. (P[I] = K);
  35432. }
  35433. P[I].total++;
  35434. }
  35435. for (b = 0; b < O.length; b++)
  35436. -1 === A.indexOf(O[b]) && this.removeChild(O[b].mesh);
  35437. for (b = 0; b < A.length; b++)
  35438. A[b].mesh.parent !== this && this.addChild(A[b].mesh);
  35439. for (var b in ((this._activePagesMeshData = A), P)) {
  35440. var k = (K = P[b]).total;
  35441. if (
  35442. !(
  35443. (null === (t = K.indices) || void 0 === t ? void 0 : t.length) >
  35444. 6 * k
  35445. ) ||
  35446. K.vertices.length < 2 * hG.BATCHABLE_SIZE
  35447. )
  35448. (K.vertices = new Float32Array(8 * k)),
  35449. (K.uvs = new Float32Array(8 * k)),
  35450. (K.indices = new Uint16Array(6 * k));
  35451. else
  35452. for (
  35453. var B = K.total, G = K.vertices, U = 4 * B * 2;
  35454. U < G.length;
  35455. U++
  35456. )
  35457. G[U] = 0;
  35458. K.mesh.size = 6 * k;
  35459. }
  35460. for (b = 0; b < C; b++) {
  35461. var j,
  35462. X =
  35463. (j = o[b]).position.x +
  35464. w[j.line] * ('justify' === this._align ? j.prevSpaces : 1);
  35465. this._roundPixels && (X = Math.round(X));
  35466. var V,
  35467. H = X * n,
  35468. W = j.position.y * n,
  35469. Y = P[(V = j.texture).baseTexture.uid],
  35470. z = V.frame,
  35471. Z = V._uvs,
  35472. J = Y.index++;
  35473. (Y.indices[6 * J + 0] = 0 + 4 * J),
  35474. (Y.indices[6 * J + 1] = 1 + 4 * J),
  35475. (Y.indices[6 * J + 2] = 2 + 4 * J),
  35476. (Y.indices[6 * J + 3] = 0 + 4 * J),
  35477. (Y.indices[6 * J + 4] = 2 + 4 * J),
  35478. (Y.indices[6 * J + 5] = 3 + 4 * J),
  35479. (Y.vertices[8 * J + 0] = H),
  35480. (Y.vertices[8 * J + 1] = W),
  35481. (Y.vertices[8 * J + 2] = H + z.width * n),
  35482. (Y.vertices[8 * J + 3] = W),
  35483. (Y.vertices[8 * J + 4] = H + z.width * n),
  35484. (Y.vertices[8 * J + 5] = W + z.height * n),
  35485. (Y.vertices[8 * J + 6] = H),
  35486. (Y.vertices[8 * J + 7] = W + z.height * n),
  35487. (Y.uvs[8 * J + 0] = Z.x0),
  35488. (Y.uvs[8 * J + 1] = Z.y0),
  35489. (Y.uvs[8 * J + 2] = Z.x1),
  35490. (Y.uvs[8 * J + 3] = Z.y1),
  35491. (Y.uvs[8 * J + 4] = Z.x2),
  35492. (Y.uvs[8 * J + 5] = Z.y2),
  35493. (Y.uvs[8 * J + 6] = Z.x3),
  35494. (Y.uvs[8 * J + 7] = Z.y3);
  35495. }
  35496. for (var b in ((this._textWidth = f * n),
  35497. (this._textHeight = (i.y + e.lineHeight) * n),
  35498. P)) {
  35499. var K = P[b];
  35500. if (0 !== this.anchor.x || 0 !== this.anchor.y)
  35501. for (
  35502. var q = 0,
  35503. Q = this._textWidth * this.anchor.x,
  35504. $ = this._textHeight * this.anchor.y,
  35505. tt = 0;
  35506. tt < K.total;
  35507. tt++
  35508. )
  35509. (K.vertices[q++] -= Q),
  35510. (K.vertices[q++] -= $),
  35511. (K.vertices[q++] -= Q),
  35512. (K.vertices[q++] -= $),
  35513. (K.vertices[q++] -= Q),
  35514. (K.vertices[q++] -= $),
  35515. (K.vertices[q++] -= Q),
  35516. (K.vertices[q++] -= $);
  35517. this._maxLineHeight = g * n;
  35518. var et = K.mesh.geometry.getBuffer('aVertexPosition'),
  35519. rt = K.mesh.geometry.getBuffer('aTextureCoord'),
  35520. nt = K.mesh.geometry.getIndex();
  35521. (et.data = K.vertices),
  35522. (rt.data = K.uvs),
  35523. (nt.data = K.indices),
  35524. et.update(),
  35525. rt.update(),
  35526. nt.update();
  35527. }
  35528. for (b = 0; b < o.length; b++) RG.push(o[b]);
  35529. (this._font = e), (this.dirty = !1);
  35530. }),
  35531. (e.prototype.updateTransform = function () {
  35532. this.validate(), this.containerUpdateTransform();
  35533. }),
  35534. (e.prototype._render = function (e) {
  35535. this._autoResolution &&
  35536. this._resolution !== e.resolution &&
  35537. ((this._resolution = e.resolution), (this.dirty = !0));
  35538. var r = EG.available[this._fontName],
  35539. n = r.distanceFieldRange,
  35540. i = r.distanceFieldType,
  35541. o = r.size;
  35542. if ('none' !== i)
  35543. for (
  35544. var s = this.worldTransform,
  35545. a = s.a,
  35546. u = s.b,
  35547. c = s.c,
  35548. h = s.d,
  35549. l = Math.sqrt(a * a + u * u),
  35550. d = Math.sqrt(c * c + h * h),
  35551. f = (Math.abs(l) + Math.abs(d)) / 2,
  35552. p = this.fontSize / o,
  35553. v = 0,
  35554. m = this._activePagesMeshData;
  35555. v < m.length;
  35556. v++
  35557. ) {
  35558. m[v].mesh.shader.uniforms.uFWidth = f * n * p * this._resolution;
  35559. }
  35560. t.prototype._render.call(this, e);
  35561. }),
  35562. (e.prototype.getLocalBounds = function () {
  35563. return this.validate(), t.prototype.getLocalBounds.call(this);
  35564. }),
  35565. (e.prototype.validate = function () {
  35566. var t = EG.available[this._fontName];
  35567. if (!t) throw new Error('Missing BitmapFont "' + this._fontName + '"');
  35568. this._font !== t && (this.dirty = !0), this.dirty && this.updateText();
  35569. }),
  35570. Object.defineProperty(e.prototype, 'tint', {
  35571. get: function () {
  35572. return this._tint;
  35573. },
  35574. set: function (t) {
  35575. if (this._tint !== t) {
  35576. this._tint = t;
  35577. for (var e = 0; e < this._activePagesMeshData.length; e++)
  35578. this._activePagesMeshData[e].mesh.tint = t;
  35579. }
  35580. },
  35581. enumerable: !1,
  35582. configurable: !0,
  35583. }),
  35584. Object.defineProperty(e.prototype, 'align', {
  35585. get: function () {
  35586. return this._align;
  35587. },
  35588. set: function (t) {
  35589. this._align !== t && ((this._align = t), (this.dirty = !0));
  35590. },
  35591. enumerable: !1,
  35592. configurable: !0,
  35593. }),
  35594. Object.defineProperty(e.prototype, 'fontName', {
  35595. get: function () {
  35596. return this._fontName;
  35597. },
  35598. set: function (t) {
  35599. if (!EG.available[t])
  35600. throw new Error('Missing BitmapFont "' + t + '"');
  35601. this._fontName !== t && ((this._fontName = t), (this.dirty = !0));
  35602. },
  35603. enumerable: !1,
  35604. configurable: !0,
  35605. }),
  35606. Object.defineProperty(e.prototype, 'fontSize', {
  35607. get: function () {
  35608. var t;
  35609. return null !== (t = this._fontSize) && void 0 !== t
  35610. ? t
  35611. : EG.available[this._fontName].size;
  35612. },
  35613. set: function (t) {
  35614. this._fontSize !== t && ((this._fontSize = t), (this.dirty = !0));
  35615. },
  35616. enumerable: !1,
  35617. configurable: !0,
  35618. }),
  35619. Object.defineProperty(e.prototype, 'anchor', {
  35620. get: function () {
  35621. return this._anchor;
  35622. },
  35623. set: function (t) {
  35624. 'number' == typeof t ? this._anchor.set(t) : this._anchor.copyFrom(t);
  35625. },
  35626. enumerable: !1,
  35627. configurable: !0,
  35628. }),
  35629. Object.defineProperty(e.prototype, 'text', {
  35630. get: function () {
  35631. return this._text;
  35632. },
  35633. set: function (t) {
  35634. (t = String(null == t ? '' : t)),
  35635. this._text !== t && ((this._text = t), (this.dirty = !0));
  35636. },
  35637. enumerable: !1,
  35638. configurable: !0,
  35639. }),
  35640. Object.defineProperty(e.prototype, 'maxWidth', {
  35641. get: function () {
  35642. return this._maxWidth;
  35643. },
  35644. set: function (t) {
  35645. this._maxWidth !== t && ((this._maxWidth = t), (this.dirty = !0));
  35646. },
  35647. enumerable: !1,
  35648. configurable: !0,
  35649. }),
  35650. Object.defineProperty(e.prototype, 'maxLineHeight', {
  35651. get: function () {
  35652. return this.validate(), this._maxLineHeight;
  35653. },
  35654. enumerable: !1,
  35655. configurable: !0,
  35656. }),
  35657. Object.defineProperty(e.prototype, 'textWidth', {
  35658. get: function () {
  35659. return this.validate(), this._textWidth;
  35660. },
  35661. enumerable: !1,
  35662. configurable: !0,
  35663. }),
  35664. Object.defineProperty(e.prototype, 'letterSpacing', {
  35665. get: function () {
  35666. return this._letterSpacing;
  35667. },
  35668. set: function (t) {
  35669. this._letterSpacing !== t &&
  35670. ((this._letterSpacing = t), (this.dirty = !0));
  35671. },
  35672. enumerable: !1,
  35673. configurable: !0,
  35674. }),
  35675. Object.defineProperty(e.prototype, 'roundPixels', {
  35676. get: function () {
  35677. return this._roundPixels;
  35678. },
  35679. set: function (t) {
  35680. t !== this._roundPixels &&
  35681. ((this._roundPixels = t), (this.dirty = !0));
  35682. },
  35683. enumerable: !1,
  35684. configurable: !0,
  35685. }),
  35686. Object.defineProperty(e.prototype, 'textHeight', {
  35687. get: function () {
  35688. return this.validate(), this._textHeight;
  35689. },
  35690. enumerable: !1,
  35691. configurable: !0,
  35692. }),
  35693. Object.defineProperty(e.prototype, 'resolution', {
  35694. get: function () {
  35695. return this._resolution;
  35696. },
  35697. set: function (t) {
  35698. (this._autoResolution = !1),
  35699. this._resolution !== t &&
  35700. ((this._resolution = t), (this.dirty = !0));
  35701. },
  35702. enumerable: !1,
  35703. configurable: !0,
  35704. }),
  35705. (e.prototype.destroy = function (e) {
  35706. var r = this._textureCache,
  35707. n =
  35708. 'none' === EG.available[this._fontName].distanceFieldType ? SG : wG;
  35709. n.push.apply(n, this._activePagesMeshData);
  35710. for (var i = 0, o = this._activePagesMeshData; i < o.length; i++) {
  35711. var s = o[i];
  35712. this.removeChild(s.mesh);
  35713. }
  35714. for (var a in ((this._activePagesMeshData = []),
  35715. n
  35716. .filter(function (t) {
  35717. return r[t.mesh.texture.baseTexture.uid];
  35718. })
  35719. .forEach(function (t) {
  35720. t.mesh.texture = EL.EMPTY;
  35721. }),
  35722. r)) {
  35723. r[a].destroy(), delete r[a];
  35724. }
  35725. (this._font = null),
  35726. (this._textureCache = null),
  35727. t.prototype.destroy.call(this, e);
  35728. }),
  35729. (e.styleDefaults = {
  35730. align: 'left',
  35731. tint: 16777215,
  35732. maxWidth: 0,
  35733. letterSpacing: 0,
  35734. });
  35735. })(VD);
  35736. var CG = (function () {
  35737. function t() {}
  35738. return (
  35739. (t.add = function () {
  35740. DN.setExtensionXhrType('fnt', DN.XHR_RESPONSE_TYPE.TEXT);
  35741. }),
  35742. (t.use = function (e, r) {
  35743. var n = _G(e.data);
  35744. if (n)
  35745. for (
  35746. var i = t.getBaseUrl(this, e),
  35747. o = n.parse(e.data),
  35748. s = {},
  35749. a = function (t) {
  35750. (s[t.metadata.pageFile] = t.texture),
  35751. Object.keys(s).length === o.page.length &&
  35752. ((e.bitmapFont = EG.install(o, s, !0)), r());
  35753. },
  35754. u = 0;
  35755. u < o.page.length;
  35756. ++u
  35757. ) {
  35758. var c = o.page[u].file,
  35759. h = i + c,
  35760. l = !1;
  35761. for (var d in this.resources) {
  35762. var f = this.resources[d];
  35763. if (f.url === h) {
  35764. (f.metadata.pageFile = c),
  35765. f.texture ? a(f) : f.onAfterMiddleware.add(a),
  35766. (l = !0);
  35767. break;
  35768. }
  35769. }
  35770. if (!l) {
  35771. var p = {
  35772. crossOrigin: e.crossOrigin,
  35773. loadType: DN.LOAD_TYPE.IMAGE,
  35774. metadata: Object.assign(
  35775. { pageFile: c },
  35776. e.metadata.imageMetadata
  35777. ),
  35778. parentResource: e,
  35779. };
  35780. this.add(h, p, a);
  35781. }
  35782. }
  35783. else r();
  35784. }),
  35785. (t.getBaseUrl = function (e, r) {
  35786. var n = r.isDataUrl ? '' : t.dirname(r.url);
  35787. return (
  35788. r.isDataUrl &&
  35789. ('.' === n && (n = ''),
  35790. e.baseUrl &&
  35791. n &&
  35792. '/' === e.baseUrl.charAt(e.baseUrl.length - 1) &&
  35793. (n += '/')),
  35794. (n = n.replace(e.baseUrl, '')) &&
  35795. '/' !== n.charAt(n.length - 1) &&
  35796. (n += '/'),
  35797. n
  35798. );
  35799. }),
  35800. (t.dirname = function (t) {
  35801. var e = t
  35802. .replace(/\\/g, '/')
  35803. .replace(/\/$/, '')
  35804. .replace(/\/[^\/]*$/, '');
  35805. return e === t ? '.' : '' === e ? '/' : e;
  35806. }),
  35807. (t.extension = HD.Loader),
  35808. t
  35809. );
  35810. })(),
  35811. PG = function (t, e) {
  35812. return (
  35813. (PG =
  35814. Object.setPrototypeOf ||
  35815. ({ __proto__: [] } instanceof Array &&
  35816. function (t, e) {
  35817. t.__proto__ = e;
  35818. }) ||
  35819. function (t, e) {
  35820. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  35821. }),
  35822. PG(t, e)
  35823. );
  35824. };
  35825. !(function (t) {
  35826. function e(e) {
  35827. void 0 === e && (e = 1);
  35828. var r =
  35829. t.call(
  35830. this,
  35831. 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}',
  35832. 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n',
  35833. { uAlpha: 1 }
  35834. ) || this;
  35835. return (r.alpha = e), r;
  35836. }
  35837. (function (t, e) {
  35838. function r() {
  35839. this.constructor = t;
  35840. }
  35841. PG(t, e),
  35842. (t.prototype =
  35843. null === e
  35844. ? Object.create(e)
  35845. : ((r.prototype = e.prototype), new r()));
  35846. })(e, t),
  35847. Object.defineProperty(e.prototype, 'alpha', {
  35848. get: function () {
  35849. return this.uniforms.uAlpha;
  35850. },
  35851. set: function (t) {
  35852. this.uniforms.uAlpha = t;
  35853. },
  35854. enumerable: !1,
  35855. configurable: !0,
  35856. });
  35857. })(EF);
  35858. var AG = function (t, e) {
  35859. return (
  35860. (AG =
  35861. Object.setPrototypeOf ||
  35862. ({ __proto__: [] } instanceof Array &&
  35863. function (t, e) {
  35864. t.__proto__ = e;
  35865. }) ||
  35866. function (t, e) {
  35867. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  35868. }),
  35869. AG(t, e)
  35870. );
  35871. };
  35872. function OG(t, e) {
  35873. function r() {
  35874. this.constructor = t;
  35875. }
  35876. AG(t, e),
  35877. (t.prototype =
  35878. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  35879. }
  35880. var IG = {
  35881. 5: [0.153388, 0.221461, 0.250301],
  35882. 7: [0.071303, 0.131514, 0.189879, 0.214607],
  35883. 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],
  35884. 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],
  35885. 13: [
  35886. 0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641,
  35887. ],
  35888. 15: [
  35889. 489e-6, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697,
  35890. 0.197448,
  35891. ],
  35892. },
  35893. MG = [
  35894. 'varying vec2 vBlurTexCoords[%size%];',
  35895. 'uniform sampler2D uSampler;',
  35896. 'void main(void)',
  35897. '{',
  35898. ' gl_FragColor = vec4(0.0);',
  35899. ' %blur%',
  35900. '}',
  35901. ].join('\n');
  35902. var DG = (function (t) {
  35903. function e(e, r, n, i, o) {
  35904. void 0 === r && (r = 8),
  35905. void 0 === n && (n = 4),
  35906. void 0 === i && (i = vA.FILTER_RESOLUTION),
  35907. void 0 === o && (o = 5);
  35908. var s = this,
  35909. a = (function (t, e) {
  35910. var r,
  35911. n = Math.ceil(t / 2),
  35912. i =
  35913. '\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }',
  35914. o = '';
  35915. r = e
  35916. ? 'vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);'
  35917. : 'vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);';
  35918. for (var s = 0; s < t; s++) {
  35919. var a = r.replace('%index%', s.toString());
  35920. (o += a = a.replace('%sampleIndex%', s - (n - 1) + '.0')),
  35921. (o += '\n');
  35922. }
  35923. return (i = i.replace('%blur%', o)).replace('%size%', t.toString());
  35924. })(o, e),
  35925. u = (function (t) {
  35926. for (
  35927. var e, r = IG[t], n = r.length, i = MG, o = '', s = 0;
  35928. s < t;
  35929. s++
  35930. ) {
  35931. var a =
  35932. 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;'.replace(
  35933. '%index%',
  35934. s.toString()
  35935. );
  35936. (e = s),
  35937. s >= n && (e = t - s - 1),
  35938. (o += a = a.replace('%value%', r[e].toString())),
  35939. (o += '\n');
  35940. }
  35941. return (i = i.replace('%blur%', o)).replace('%size%', t.toString());
  35942. })(o);
  35943. return (
  35944. ((s = t.call(this, a, u) || this).horizontal = e),
  35945. (s.resolution = i),
  35946. (s._quality = 0),
  35947. (s.quality = n),
  35948. (s.blur = r),
  35949. s
  35950. );
  35951. }
  35952. return (
  35953. OG(e, t),
  35954. (e.prototype.apply = function (t, e, r, n) {
  35955. if (
  35956. (r
  35957. ? this.horizontal
  35958. ? (this.uniforms.strength = (1 / r.width) * (r.width / e.width))
  35959. : (this.uniforms.strength =
  35960. (1 / r.height) * (r.height / e.height))
  35961. : this.horizontal
  35962. ? (this.uniforms.strength =
  35963. (1 / t.renderer.width) * (t.renderer.width / e.width))
  35964. : (this.uniforms.strength =
  35965. (1 / t.renderer.height) * (t.renderer.height / e.height)),
  35966. (this.uniforms.strength *= this.strength),
  35967. (this.uniforms.strength /= this.passes),
  35968. 1 === this.passes)
  35969. )
  35970. t.applyFilter(this, e, r, n);
  35971. else {
  35972. var i = t.getFilterTexture(),
  35973. o = t.renderer,
  35974. s = e,
  35975. a = i;
  35976. (this.state.blend = !1), t.applyFilter(this, s, a, UP.CLEAR);
  35977. for (var u = 1; u < this.passes - 1; u++) {
  35978. t.bindAndClear(s, UP.BLIT), (this.uniforms.uSampler = a);
  35979. var c = a;
  35980. (a = s), (s = c), o.shader.bind(this), o.geometry.draw(5);
  35981. }
  35982. (this.state.blend = !0),
  35983. t.applyFilter(this, a, r, n),
  35984. t.returnFilterTexture(i);
  35985. }
  35986. }),
  35987. Object.defineProperty(e.prototype, 'blur', {
  35988. get: function () {
  35989. return this.strength;
  35990. },
  35991. set: function (t) {
  35992. (this.padding = 1 + 2 * Math.abs(t)), (this.strength = t);
  35993. },
  35994. enumerable: !1,
  35995. configurable: !0,
  35996. }),
  35997. Object.defineProperty(e.prototype, 'quality', {
  35998. get: function () {
  35999. return this._quality;
  36000. },
  36001. set: function (t) {
  36002. (this._quality = t), (this.passes = t);
  36003. },
  36004. enumerable: !1,
  36005. configurable: !0,
  36006. }),
  36007. e
  36008. );
  36009. })(EF);
  36010. !(function (t) {
  36011. function e(e, r, n, i) {
  36012. void 0 === e && (e = 8),
  36013. void 0 === r && (r = 4),
  36014. void 0 === n && (n = vA.FILTER_RESOLUTION),
  36015. void 0 === i && (i = 5);
  36016. var o = t.call(this) || this;
  36017. return (
  36018. (o.blurXFilter = new DG(!0, e, r, n, i)),
  36019. (o.blurYFilter = new DG(!1, e, r, n, i)),
  36020. (o.resolution = n),
  36021. (o.quality = r),
  36022. (o.blur = e),
  36023. (o.repeatEdgePixels = !1),
  36024. o
  36025. );
  36026. }
  36027. OG(e, t),
  36028. (e.prototype.apply = function (t, e, r, n) {
  36029. var i = Math.abs(this.blurXFilter.strength),
  36030. o = Math.abs(this.blurYFilter.strength);
  36031. if (i && o) {
  36032. var s = t.getFilterTexture();
  36033. this.blurXFilter.apply(t, e, s, UP.CLEAR),
  36034. this.blurYFilter.apply(t, s, r, n),
  36035. t.returnFilterTexture(s);
  36036. } else
  36037. o
  36038. ? this.blurYFilter.apply(t, e, r, n)
  36039. : this.blurXFilter.apply(t, e, r, n);
  36040. }),
  36041. (e.prototype.updatePadding = function () {
  36042. this._repeatEdgePixels
  36043. ? (this.padding = 0)
  36044. : (this.padding =
  36045. 2 *
  36046. Math.max(
  36047. Math.abs(this.blurXFilter.strength),
  36048. Math.abs(this.blurYFilter.strength)
  36049. ));
  36050. }),
  36051. Object.defineProperty(e.prototype, 'blur', {
  36052. get: function () {
  36053. return this.blurXFilter.blur;
  36054. },
  36055. set: function (t) {
  36056. (this.blurXFilter.blur = this.blurYFilter.blur = t),
  36057. this.updatePadding();
  36058. },
  36059. enumerable: !1,
  36060. configurable: !0,
  36061. }),
  36062. Object.defineProperty(e.prototype, 'quality', {
  36063. get: function () {
  36064. return this.blurXFilter.quality;
  36065. },
  36066. set: function (t) {
  36067. this.blurXFilter.quality = this.blurYFilter.quality = t;
  36068. },
  36069. enumerable: !1,
  36070. configurable: !0,
  36071. }),
  36072. Object.defineProperty(e.prototype, 'blurX', {
  36073. get: function () {
  36074. return this.blurXFilter.blur;
  36075. },
  36076. set: function (t) {
  36077. (this.blurXFilter.blur = t), this.updatePadding();
  36078. },
  36079. enumerable: !1,
  36080. configurable: !0,
  36081. }),
  36082. Object.defineProperty(e.prototype, 'blurY', {
  36083. get: function () {
  36084. return this.blurYFilter.blur;
  36085. },
  36086. set: function (t) {
  36087. (this.blurYFilter.blur = t), this.updatePadding();
  36088. },
  36089. enumerable: !1,
  36090. configurable: !0,
  36091. }),
  36092. Object.defineProperty(e.prototype, 'blendMode', {
  36093. get: function () {
  36094. return this.blurYFilter.blendMode;
  36095. },
  36096. set: function (t) {
  36097. this.blurYFilter.blendMode = t;
  36098. },
  36099. enumerable: !1,
  36100. configurable: !0,
  36101. }),
  36102. Object.defineProperty(e.prototype, 'repeatEdgePixels', {
  36103. get: function () {
  36104. return this._repeatEdgePixels;
  36105. },
  36106. set: function (t) {
  36107. (this._repeatEdgePixels = t), this.updatePadding();
  36108. },
  36109. enumerable: !1,
  36110. configurable: !0,
  36111. });
  36112. })(EF);
  36113. var LG = function (t, e) {
  36114. return (
  36115. (LG =
  36116. Object.setPrototypeOf ||
  36117. ({ __proto__: [] } instanceof Array &&
  36118. function (t, e) {
  36119. t.__proto__ = e;
  36120. }) ||
  36121. function (t, e) {
  36122. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  36123. }),
  36124. LG(t, e)
  36125. );
  36126. };
  36127. var FG = (function (t) {
  36128. function e() {
  36129. var e = this,
  36130. r = {
  36131. m: new Float32Array([
  36132. 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
  36133. ]),
  36134. uAlpha: 1,
  36135. };
  36136. return (
  36137. ((e =
  36138. t.call(
  36139. this,
  36140. rN,
  36141. 'varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n',
  36142. r
  36143. ) || this).alpha = 1),
  36144. e
  36145. );
  36146. }
  36147. return (
  36148. (function (t, e) {
  36149. function r() {
  36150. this.constructor = t;
  36151. }
  36152. LG(t, e),
  36153. (t.prototype =
  36154. null === e
  36155. ? Object.create(e)
  36156. : ((r.prototype = e.prototype), new r()));
  36157. })(e, t),
  36158. (e.prototype._loadMatrix = function (t, e) {
  36159. void 0 === e && (e = !1);
  36160. var r = t;
  36161. e &&
  36162. (this._multiply(r, this.uniforms.m, t), (r = this._colorMatrix(r))),
  36163. (this.uniforms.m = r);
  36164. }),
  36165. (e.prototype._multiply = function (t, e, r) {
  36166. return (
  36167. (t[0] = e[0] * r[0] + e[1] * r[5] + e[2] * r[10] + e[3] * r[15]),
  36168. (t[1] = e[0] * r[1] + e[1] * r[6] + e[2] * r[11] + e[3] * r[16]),
  36169. (t[2] = e[0] * r[2] + e[1] * r[7] + e[2] * r[12] + e[3] * r[17]),
  36170. (t[3] = e[0] * r[3] + e[1] * r[8] + e[2] * r[13] + e[3] * r[18]),
  36171. (t[4] =
  36172. e[0] * r[4] + e[1] * r[9] + e[2] * r[14] + e[3] * r[19] + e[4]),
  36173. (t[5] = e[5] * r[0] + e[6] * r[5] + e[7] * r[10] + e[8] * r[15]),
  36174. (t[6] = e[5] * r[1] + e[6] * r[6] + e[7] * r[11] + e[8] * r[16]),
  36175. (t[7] = e[5] * r[2] + e[6] * r[7] + e[7] * r[12] + e[8] * r[17]),
  36176. (t[8] = e[5] * r[3] + e[6] * r[8] + e[7] * r[13] + e[8] * r[18]),
  36177. (t[9] =
  36178. e[5] * r[4] + e[6] * r[9] + e[7] * r[14] + e[8] * r[19] + e[9]),
  36179. (t[10] = e[10] * r[0] + e[11] * r[5] + e[12] * r[10] + e[13] * r[15]),
  36180. (t[11] = e[10] * r[1] + e[11] * r[6] + e[12] * r[11] + e[13] * r[16]),
  36181. (t[12] = e[10] * r[2] + e[11] * r[7] + e[12] * r[12] + e[13] * r[17]),
  36182. (t[13] = e[10] * r[3] + e[11] * r[8] + e[12] * r[13] + e[13] * r[18]),
  36183. (t[14] =
  36184. e[10] * r[4] +
  36185. e[11] * r[9] +
  36186. e[12] * r[14] +
  36187. e[13] * r[19] +
  36188. e[14]),
  36189. (t[15] = e[15] * r[0] + e[16] * r[5] + e[17] * r[10] + e[18] * r[15]),
  36190. (t[16] = e[15] * r[1] + e[16] * r[6] + e[17] * r[11] + e[18] * r[16]),
  36191. (t[17] = e[15] * r[2] + e[16] * r[7] + e[17] * r[12] + e[18] * r[17]),
  36192. (t[18] = e[15] * r[3] + e[16] * r[8] + e[17] * r[13] + e[18] * r[18]),
  36193. (t[19] =
  36194. e[15] * r[4] +
  36195. e[16] * r[9] +
  36196. e[17] * r[14] +
  36197. e[18] * r[19] +
  36198. e[19]),
  36199. t
  36200. );
  36201. }),
  36202. (e.prototype._colorMatrix = function (t) {
  36203. var e = new Float32Array(t);
  36204. return (e[4] /= 255), (e[9] /= 255), (e[14] /= 255), (e[19] /= 255), e;
  36205. }),
  36206. (e.prototype.brightness = function (t, e) {
  36207. var r = [t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, 1, 0];
  36208. this._loadMatrix(r, e);
  36209. }),
  36210. (e.prototype.tint = function (t, e) {
  36211. var r = [
  36212. ((t >> 16) & 255) / 255,
  36213. 0,
  36214. 0,
  36215. 0,
  36216. 0,
  36217. 0,
  36218. ((t >> 8) & 255) / 255,
  36219. 0,
  36220. 0,
  36221. 0,
  36222. 0,
  36223. 0,
  36224. (255 & t) / 255,
  36225. 0,
  36226. 0,
  36227. 0,
  36228. 0,
  36229. 0,
  36230. 1,
  36231. 0,
  36232. ];
  36233. this._loadMatrix(r, e);
  36234. }),
  36235. (e.prototype.greyscale = function (t, e) {
  36236. var r = [t, t, t, 0, 0, t, t, t, 0, 0, t, t, t, 0, 0, 0, 0, 0, 1, 0];
  36237. this._loadMatrix(r, e);
  36238. }),
  36239. (e.prototype.blackAndWhite = function (t) {
  36240. this._loadMatrix(
  36241. [
  36242. 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0,
  36243. 0, 1, 0,
  36244. ],
  36245. t
  36246. );
  36247. }),
  36248. (e.prototype.hue = function (t, e) {
  36249. t = ((t || 0) / 180) * Math.PI;
  36250. var r = Math.cos(t),
  36251. n = Math.sin(t),
  36252. i = 1 / 3,
  36253. o = (0, Math.sqrt)(i),
  36254. s = [
  36255. r + (1 - r) * i,
  36256. i * (1 - r) - o * n,
  36257. i * (1 - r) + o * n,
  36258. 0,
  36259. 0,
  36260. i * (1 - r) + o * n,
  36261. r + i * (1 - r),
  36262. i * (1 - r) - o * n,
  36263. 0,
  36264. 0,
  36265. i * (1 - r) - o * n,
  36266. i * (1 - r) + o * n,
  36267. r + i * (1 - r),
  36268. 0,
  36269. 0,
  36270. 0,
  36271. 0,
  36272. 0,
  36273. 1,
  36274. 0,
  36275. ];
  36276. this._loadMatrix(s, e);
  36277. }),
  36278. (e.prototype.contrast = function (t, e) {
  36279. var r = (t || 0) + 1,
  36280. n = -0.5 * (r - 1),
  36281. i = [r, 0, 0, 0, n, 0, r, 0, 0, n, 0, 0, r, 0, n, 0, 0, 0, 1, 0];
  36282. this._loadMatrix(i, e);
  36283. }),
  36284. (e.prototype.saturate = function (t, e) {
  36285. void 0 === t && (t = 0);
  36286. var r = (2 * t) / 3 + 1,
  36287. n = -0.5 * (r - 1),
  36288. i = [r, n, n, 0, 0, n, r, n, 0, 0, n, n, r, 0, 0, 0, 0, 0, 1, 0];
  36289. this._loadMatrix(i, e);
  36290. }),
  36291. (e.prototype.desaturate = function () {
  36292. this.saturate(-1);
  36293. }),
  36294. (e.prototype.negative = function (t) {
  36295. this._loadMatrix(
  36296. [-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0],
  36297. t
  36298. );
  36299. }),
  36300. (e.prototype.sepia = function (t) {
  36301. this._loadMatrix(
  36302. [
  36303. 0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0,
  36304. 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0,
  36305. ],
  36306. t
  36307. );
  36308. }),
  36309. (e.prototype.technicolor = function (t) {
  36310. this._loadMatrix(
  36311. [
  36312. 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0,
  36313. 11.793603434377337, -0.3087833385928097, 1.7658908555458428,
  36314. -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616,
  36315. -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0,
  36316. 0, 1, 0,
  36317. ],
  36318. t
  36319. );
  36320. }),
  36321. (e.prototype.polaroid = function (t) {
  36322. this._loadMatrix(
  36323. [
  36324. 1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016,
  36325. -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0,
  36326. ],
  36327. t
  36328. );
  36329. }),
  36330. (e.prototype.toBGR = function (t) {
  36331. this._loadMatrix(
  36332. [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0],
  36333. t
  36334. );
  36335. }),
  36336. (e.prototype.kodachrome = function (t) {
  36337. this._loadMatrix(
  36338. [
  36339. 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0,
  36340. 63.72958762196502, -0.16404339962244616, 1.0835251566291304,
  36341. -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763,
  36342. -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0,
  36343. 0, 1, 0,
  36344. ],
  36345. t
  36346. );
  36347. }),
  36348. (e.prototype.browni = function (t) {
  36349. this._loadMatrix(
  36350. [
  36351. 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0,
  36352. 47.43192855600873, -0.037703249837783157, 0.8609577587992641,
  36353. 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335,
  36354. -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0,
  36355. 0, 0, 1, 0,
  36356. ],
  36357. t
  36358. );
  36359. }),
  36360. (e.prototype.vintage = function (t) {
  36361. this._loadMatrix(
  36362. [
  36363. 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0,
  36364. 9.651285835294123, 0.02578397704808868, 0.6441188644374771,
  36365. 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719,
  36366. -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0,
  36367. 0, 1, 0,
  36368. ],
  36369. t
  36370. );
  36371. }),
  36372. (e.prototype.colorTone = function (t, e, r, n, i) {
  36373. var o = (((r = r || 16770432) >> 16) & 255) / 255,
  36374. s = ((r >> 8) & 255) / 255,
  36375. a = (255 & r) / 255,
  36376. u = (((n = n || 3375104) >> 16) & 255) / 255,
  36377. c = ((n >> 8) & 255) / 255,
  36378. h = (255 & n) / 255,
  36379. l = [
  36380. 0.3,
  36381. 0.59,
  36382. 0.11,
  36383. 0,
  36384. 0,
  36385. o,
  36386. s,
  36387. a,
  36388. (t = t || 0.2),
  36389. 0,
  36390. u,
  36391. c,
  36392. h,
  36393. (e = e || 0.15),
  36394. 0,
  36395. o - u,
  36396. s - c,
  36397. a - h,
  36398. 0,
  36399. 0,
  36400. ];
  36401. this._loadMatrix(l, i);
  36402. }),
  36403. (e.prototype.night = function (t, e) {
  36404. var r = [
  36405. -2 * (t = t || 0.1),
  36406. -t,
  36407. 0,
  36408. 0,
  36409. 0,
  36410. -t,
  36411. 0,
  36412. t,
  36413. 0,
  36414. 0,
  36415. 0,
  36416. t,
  36417. 2 * t,
  36418. 0,
  36419. 0,
  36420. 0,
  36421. 0,
  36422. 0,
  36423. 1,
  36424. 0,
  36425. ];
  36426. this._loadMatrix(r, e);
  36427. }),
  36428. (e.prototype.predator = function (t, e) {
  36429. var r = [
  36430. 11.224130630493164 * t,
  36431. -4.794486999511719 * t,
  36432. -2.8746118545532227 * t,
  36433. 0 * t,
  36434. 0.40342438220977783 * t,
  36435. -3.6330697536468506 * t,
  36436. 9.193157196044922 * t,
  36437. -2.951810836791992 * t,
  36438. 0 * t,
  36439. -1.316135048866272 * t,
  36440. -3.2184197902679443 * t,
  36441. -4.2375030517578125 * t,
  36442. 7.476448059082031 * t,
  36443. 0 * t,
  36444. 0.8044459223747253 * t,
  36445. 0,
  36446. 0,
  36447. 0,
  36448. 1,
  36449. 0,
  36450. ];
  36451. this._loadMatrix(r, e);
  36452. }),
  36453. (e.prototype.lsd = function (t) {
  36454. this._loadMatrix(
  36455. [
  36456. 2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0,
  36457. 0, 1, 0,
  36458. ],
  36459. t
  36460. );
  36461. }),
  36462. (e.prototype.reset = function () {
  36463. this._loadMatrix(
  36464. [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0],
  36465. !1
  36466. );
  36467. }),
  36468. Object.defineProperty(e.prototype, 'matrix', {
  36469. get: function () {
  36470. return this.uniforms.m;
  36471. },
  36472. set: function (t) {
  36473. this.uniforms.m = t;
  36474. },
  36475. enumerable: !1,
  36476. configurable: !0,
  36477. }),
  36478. Object.defineProperty(e.prototype, 'alpha', {
  36479. get: function () {
  36480. return this.uniforms.uAlpha;
  36481. },
  36482. set: function (t) {
  36483. this.uniforms.uAlpha = t;
  36484. },
  36485. enumerable: !1,
  36486. configurable: !0,
  36487. }),
  36488. e
  36489. );
  36490. })(EF);
  36491. FG.prototype.grayscale = FG.prototype.greyscale;
  36492. var NG = function (t, e) {
  36493. return (
  36494. (NG =
  36495. Object.setPrototypeOf ||
  36496. ({ __proto__: [] } instanceof Array &&
  36497. function (t, e) {
  36498. t.__proto__ = e;
  36499. }) ||
  36500. function (t, e) {
  36501. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  36502. }),
  36503. NG(t, e)
  36504. );
  36505. };
  36506. !(function (t) {
  36507. function e(e, r) {
  36508. var n = this,
  36509. i = new CD();
  36510. return (
  36511. (e.renderable = !1),
  36512. ((n =
  36513. t.call(
  36514. this,
  36515. 'attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n',
  36516. 'varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n',
  36517. {
  36518. mapSampler: e._texture,
  36519. filterMatrix: i,
  36520. scale: { x: 1, y: 1 },
  36521. rotation: new Float32Array([1, 0, 0, 1]),
  36522. }
  36523. ) || this).maskSprite = e),
  36524. (n.maskMatrix = i),
  36525. null == r && (r = 20),
  36526. (n.scale = new _D(r, r)),
  36527. n
  36528. );
  36529. }
  36530. (function (t, e) {
  36531. function r() {
  36532. this.constructor = t;
  36533. }
  36534. NG(t, e),
  36535. (t.prototype =
  36536. null === e
  36537. ? Object.create(e)
  36538. : ((r.prototype = e.prototype), new r()));
  36539. })(e, t),
  36540. (e.prototype.apply = function (t, e, r, n) {
  36541. (this.uniforms.filterMatrix = t.calculateSpriteMatrix(
  36542. this.maskMatrix,
  36543. this.maskSprite
  36544. )),
  36545. (this.uniforms.scale.x = this.scale.x),
  36546. (this.uniforms.scale.y = this.scale.y);
  36547. var i = this.maskSprite.worldTransform,
  36548. o = Math.sqrt(i.a * i.a + i.b * i.b),
  36549. s = Math.sqrt(i.c * i.c + i.d * i.d);
  36550. 0 !== o &&
  36551. 0 !== s &&
  36552. ((this.uniforms.rotation[0] = i.a / o),
  36553. (this.uniforms.rotation[1] = i.b / o),
  36554. (this.uniforms.rotation[2] = i.c / s),
  36555. (this.uniforms.rotation[3] = i.d / s)),
  36556. t.applyFilter(this, e, r, n);
  36557. }),
  36558. Object.defineProperty(e.prototype, 'map', {
  36559. get: function () {
  36560. return this.uniforms.mapSampler;
  36561. },
  36562. set: function (t) {
  36563. this.uniforms.mapSampler = t;
  36564. },
  36565. enumerable: !1,
  36566. configurable: !0,
  36567. });
  36568. })(EF);
  36569. var kG = function (t, e) {
  36570. return (
  36571. (kG =
  36572. Object.setPrototypeOf ||
  36573. ({ __proto__: [] } instanceof Array &&
  36574. function (t, e) {
  36575. t.__proto__ = e;
  36576. }) ||
  36577. function (t, e) {
  36578. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  36579. }),
  36580. kG(t, e)
  36581. );
  36582. };
  36583. !(function (t) {
  36584. function e() {
  36585. return (
  36586. t.call(
  36587. this,
  36588. '\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n',
  36589. 'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'
  36590. ) || this
  36591. );
  36592. }
  36593. (function (t, e) {
  36594. function r() {
  36595. this.constructor = t;
  36596. }
  36597. kG(t, e),
  36598. (t.prototype =
  36599. null === e
  36600. ? Object.create(e)
  36601. : ((r.prototype = e.prototype), new r()));
  36602. })(e, t);
  36603. })(EF);
  36604. var BG = function (t, e) {
  36605. return (
  36606. (BG =
  36607. Object.setPrototypeOf ||
  36608. ({ __proto__: [] } instanceof Array &&
  36609. function (t, e) {
  36610. t.__proto__ = e;
  36611. }) ||
  36612. function (t, e) {
  36613. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  36614. }),
  36615. BG(t, e)
  36616. );
  36617. };
  36618. !(function (t) {
  36619. function e(e, r) {
  36620. void 0 === e && (e = 0.5), void 0 === r && (r = Math.random());
  36621. var n =
  36622. t.call(
  36623. this,
  36624. rN,
  36625. 'precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n',
  36626. { uNoise: 0, uSeed: 0 }
  36627. ) || this;
  36628. return (n.noise = e), (n.seed = r), n;
  36629. }
  36630. (function (t, e) {
  36631. function r() {
  36632. this.constructor = t;
  36633. }
  36634. BG(t, e),
  36635. (t.prototype =
  36636. null === e
  36637. ? Object.create(e)
  36638. : ((r.prototype = e.prototype), new r()));
  36639. })(e, t),
  36640. Object.defineProperty(e.prototype, 'noise', {
  36641. get: function () {
  36642. return this.uniforms.uNoise;
  36643. },
  36644. set: function (t) {
  36645. this.uniforms.uNoise = t;
  36646. },
  36647. enumerable: !1,
  36648. configurable: !0,
  36649. }),
  36650. Object.defineProperty(e.prototype, 'seed', {
  36651. get: function () {
  36652. return this.uniforms.uSeed;
  36653. },
  36654. set: function (t) {
  36655. this.uniforms.uSeed = t;
  36656. },
  36657. enumerable: !1,
  36658. configurable: !0,
  36659. });
  36660. })(EF);
  36661. var GG = new CD();
  36662. (UD.prototype._cacheAsBitmap = !1),
  36663. (UD.prototype._cacheData = null),
  36664. (UD.prototype._cacheAsBitmapResolution = null),
  36665. (UD.prototype._cacheAsBitmapMultisample = WP.NONE);
  36666. var UG = function () {
  36667. (this.textureCacheId = null),
  36668. (this.originalRender = null),
  36669. (this.originalRenderCanvas = null),
  36670. (this.originalCalculateBounds = null),
  36671. (this.originalGetLocalBounds = null),
  36672. (this.originalUpdateTransform = null),
  36673. (this.originalDestroy = null),
  36674. (this.originalMask = null),
  36675. (this.originalFilterArea = null),
  36676. (this.originalContainsPoint = null),
  36677. (this.sprite = null);
  36678. };
  36679. Object.defineProperties(UD.prototype, {
  36680. cacheAsBitmapResolution: {
  36681. get: function () {
  36682. return this._cacheAsBitmapResolution;
  36683. },
  36684. set: function (t) {
  36685. t !== this._cacheAsBitmapResolution &&
  36686. ((this._cacheAsBitmapResolution = t),
  36687. this.cacheAsBitmap &&
  36688. ((this.cacheAsBitmap = !1), (this.cacheAsBitmap = !0)));
  36689. },
  36690. },
  36691. cacheAsBitmapMultisample: {
  36692. get: function () {
  36693. return this._cacheAsBitmapMultisample;
  36694. },
  36695. set: function (t) {
  36696. t !== this._cacheAsBitmapMultisample &&
  36697. ((this._cacheAsBitmapMultisample = t),
  36698. this.cacheAsBitmap &&
  36699. ((this.cacheAsBitmap = !1), (this.cacheAsBitmap = !0)));
  36700. },
  36701. },
  36702. cacheAsBitmap: {
  36703. get: function () {
  36704. return this._cacheAsBitmap;
  36705. },
  36706. set: function (t) {
  36707. var e;
  36708. this._cacheAsBitmap !== t &&
  36709. ((this._cacheAsBitmap = t),
  36710. t
  36711. ? (this._cacheData || (this._cacheData = new UG()),
  36712. ((e = this._cacheData).originalRender = this.render),
  36713. (e.originalRenderCanvas = this.renderCanvas),
  36714. (e.originalUpdateTransform = this.updateTransform),
  36715. (e.originalCalculateBounds = this.calculateBounds),
  36716. (e.originalGetLocalBounds = this.getLocalBounds),
  36717. (e.originalDestroy = this.destroy),
  36718. (e.originalContainsPoint = this.containsPoint),
  36719. (e.originalMask = this._mask),
  36720. (e.originalFilterArea = this.filterArea),
  36721. (this.render = this._renderCached),
  36722. (this.renderCanvas = this._renderCachedCanvas),
  36723. (this.destroy = this._cacheAsBitmapDestroy))
  36724. : ((e = this._cacheData).sprite &&
  36725. this._destroyCachedDisplayObject(),
  36726. (this.render = e.originalRender),
  36727. (this.renderCanvas = e.originalRenderCanvas),
  36728. (this.calculateBounds = e.originalCalculateBounds),
  36729. (this.getLocalBounds = e.originalGetLocalBounds),
  36730. (this.destroy = e.originalDestroy),
  36731. (this.updateTransform = e.originalUpdateTransform),
  36732. (this.containsPoint = e.originalContainsPoint),
  36733. (this._mask = e.originalMask),
  36734. (this.filterArea = e.originalFilterArea)));
  36735. },
  36736. },
  36737. }),
  36738. (UD.prototype._renderCached = function (t) {
  36739. !this.visible ||
  36740. this.worldAlpha <= 0 ||
  36741. !this.renderable ||
  36742. (this._initCachedDisplayObject(t),
  36743. (this._cacheData.sprite.transform._worldID = this.transform._worldID),
  36744. (this._cacheData.sprite.worldAlpha = this.worldAlpha),
  36745. this._cacheData.sprite._render(t));
  36746. }),
  36747. (UD.prototype._initCachedDisplayObject = function (t) {
  36748. var e;
  36749. if (!this._cacheData || !this._cacheData.sprite) {
  36750. var r = this.alpha;
  36751. (this.alpha = 1), t.batch.flush();
  36752. var n = this.getLocalBounds(null, !0).clone();
  36753. if (this.filters && this.filters.length) {
  36754. var i = this.filters[0].padding;
  36755. n.pad(i);
  36756. }
  36757. n.ceil(vA.RESOLUTION);
  36758. var o = t.renderTexture.current,
  36759. s = t.renderTexture.sourceFrame.clone(),
  36760. a = t.renderTexture.destinationFrame.clone(),
  36761. u = t.projection.transform,
  36762. c = SL.create({
  36763. width: n.width,
  36764. height: n.height,
  36765. resolution: this.cacheAsBitmapResolution || t.resolution,
  36766. multisample:
  36767. null !== (e = this.cacheAsBitmapMultisample) && void 0 !== e
  36768. ? e
  36769. : t.multisample,
  36770. }),
  36771. h = 'cacheAsBitmap_' + oD();
  36772. (this._cacheData.textureCacheId = h),
  36773. aL.addToCache(c.baseTexture, h),
  36774. EL.addToCache(c, h);
  36775. var l = this.transform.localTransform
  36776. .copyTo(GG)
  36777. .invert()
  36778. .translate(-n.x, -n.y);
  36779. (this.render = this._cacheData.originalRender),
  36780. t.render(this, {
  36781. renderTexture: c,
  36782. clear: !0,
  36783. transform: l,
  36784. skipUpdateTransform: !1,
  36785. }),
  36786. t.framebuffer.blit(),
  36787. (t.projection.transform = u),
  36788. t.renderTexture.bind(o, s, a),
  36789. (this.render = this._renderCached),
  36790. (this.updateTransform = this.displayObjectUpdateTransform),
  36791. (this.calculateBounds = this._calculateCachedBounds),
  36792. (this.getLocalBounds = this._getCachedLocalBounds),
  36793. (this._mask = null),
  36794. (this.filterArea = null),
  36795. (this.alpha = r);
  36796. var d = new SB(c);
  36797. (d.transform.worldTransform = this.transform.worldTransform),
  36798. (d.anchor.x = -n.x / n.width),
  36799. (d.anchor.y = -n.y / n.height),
  36800. (d.alpha = r),
  36801. (d._bounds = this._bounds),
  36802. (this._cacheData.sprite = d),
  36803. (this.transform._parentID = -1),
  36804. this.parent
  36805. ? this.updateTransform()
  36806. : (this.enableTempParent(),
  36807. this.updateTransform(),
  36808. this.disableTempParent(null)),
  36809. (this.containsPoint = d.containsPoint.bind(d));
  36810. }
  36811. }),
  36812. (UD.prototype._renderCachedCanvas = function (t) {
  36813. !this.visible ||
  36814. this.worldAlpha <= 0 ||
  36815. !this.renderable ||
  36816. (this._initCachedDisplayObjectCanvas(t),
  36817. (this._cacheData.sprite.worldAlpha = this.worldAlpha),
  36818. this._cacheData.sprite._renderCanvas(t));
  36819. }),
  36820. (UD.prototype._initCachedDisplayObjectCanvas = function (t) {
  36821. if (!this._cacheData || !this._cacheData.sprite) {
  36822. var e = this.getLocalBounds(null, !0),
  36823. r = this.alpha;
  36824. this.alpha = 1;
  36825. var n = t.context,
  36826. i = t._projTransform;
  36827. e.ceil(vA.RESOLUTION);
  36828. var o = SL.create({ width: e.width, height: e.height }),
  36829. s = 'cacheAsBitmap_' + oD();
  36830. (this._cacheData.textureCacheId = s),
  36831. aL.addToCache(o.baseTexture, s),
  36832. EL.addToCache(o, s);
  36833. var a = GG;
  36834. this.transform.localTransform.copyTo(a),
  36835. a.invert(),
  36836. (a.tx -= e.x),
  36837. (a.ty -= e.y),
  36838. (this.renderCanvas = this._cacheData.originalRenderCanvas),
  36839. t.render(this, {
  36840. renderTexture: o,
  36841. clear: !0,
  36842. transform: a,
  36843. skipUpdateTransform: !1,
  36844. }),
  36845. (t.context = n),
  36846. (t._projTransform = i),
  36847. (this.renderCanvas = this._renderCachedCanvas),
  36848. (this.updateTransform = this.displayObjectUpdateTransform),
  36849. (this.calculateBounds = this._calculateCachedBounds),
  36850. (this.getLocalBounds = this._getCachedLocalBounds),
  36851. (this._mask = null),
  36852. (this.filterArea = null),
  36853. (this.alpha = r);
  36854. var u = new SB(o);
  36855. (u.transform.worldTransform = this.transform.worldTransform),
  36856. (u.anchor.x = -e.x / e.width),
  36857. (u.anchor.y = -e.y / e.height),
  36858. (u.alpha = r),
  36859. (u._bounds = this._bounds),
  36860. (this._cacheData.sprite = u),
  36861. (this.transform._parentID = -1),
  36862. this.parent
  36863. ? this.updateTransform()
  36864. : ((this.parent = t._tempDisplayObjectParent),
  36865. this.updateTransform(),
  36866. (this.parent = null)),
  36867. (this.containsPoint = u.containsPoint.bind(u));
  36868. }
  36869. }),
  36870. (UD.prototype._calculateCachedBounds = function () {
  36871. this._bounds.clear(),
  36872. (this._cacheData.sprite.transform._worldID = this.transform._worldID),
  36873. this._cacheData.sprite._calculateBounds(),
  36874. (this._bounds.updateID = this._boundsID);
  36875. }),
  36876. (UD.prototype._getCachedLocalBounds = function () {
  36877. return this._cacheData.sprite.getLocalBounds(null);
  36878. }),
  36879. (UD.prototype._destroyCachedDisplayObject = function () {
  36880. this._cacheData.sprite._texture.destroy(!0),
  36881. (this._cacheData.sprite = null),
  36882. aL.removeFromCache(this._cacheData.textureCacheId),
  36883. EL.removeFromCache(this._cacheData.textureCacheId),
  36884. (this._cacheData.textureCacheId = null);
  36885. }),
  36886. (UD.prototype._cacheAsBitmapDestroy = function (t) {
  36887. (this.cacheAsBitmap = !1), this.destroy(t);
  36888. }),
  36889. (UD.prototype.name = null),
  36890. (VD.prototype.getChildByName = function (t, e) {
  36891. for (var r = 0, n = this.children.length; r < n; r++)
  36892. if (this.children[r].name === t) return this.children[r];
  36893. if (e)
  36894. for (r = 0, n = this.children.length; r < n; r++) {
  36895. var i = this.children[r];
  36896. if (i.getChildByName) {
  36897. var o = i.getChildByName(t, !0);
  36898. if (o) return o;
  36899. }
  36900. }
  36901. return null;
  36902. }),
  36903. (UD.prototype.getGlobalPosition = function (t, e) {
  36904. return (
  36905. void 0 === t && (t = new _D()),
  36906. void 0 === e && (e = !1),
  36907. this.parent
  36908. ? this.parent.toGlobal(this.position, t, e)
  36909. : ((t.x = this.position.x), (t.y = this.position.y)),
  36910. t
  36911. );
  36912. });
  36913. var jG = (function () {
  36914. function t() {}
  36915. return (
  36916. (t.init = function (t) {
  36917. var e = this;
  36918. Object.defineProperty(this, 'resizeTo', {
  36919. set: function (t) {
  36920. globalThis.removeEventListener('resize', this.queueResize),
  36921. (this._resizeTo = t),
  36922. t &&
  36923. (globalThis.addEventListener('resize', this.queueResize),
  36924. this.resize());
  36925. },
  36926. get: function () {
  36927. return this._resizeTo;
  36928. },
  36929. }),
  36930. (this.queueResize = function () {
  36931. e._resizeTo &&
  36932. (e.cancelResize(),
  36933. (e._resizeId = requestAnimationFrame(function () {
  36934. return e.resize();
  36935. })));
  36936. }),
  36937. (this.cancelResize = function () {
  36938. e._resizeId &&
  36939. (cancelAnimationFrame(e._resizeId), (e._resizeId = null));
  36940. }),
  36941. (this.resize = function () {
  36942. if (e._resizeTo) {
  36943. var t, r;
  36944. if ((e.cancelResize(), e._resizeTo === globalThis.window))
  36945. (t = globalThis.innerWidth), (r = globalThis.innerHeight);
  36946. else {
  36947. var n = e._resizeTo;
  36948. (t = n.clientWidth), (r = n.clientHeight);
  36949. }
  36950. e.renderer.resize(t, r);
  36951. }
  36952. }),
  36953. (this._resizeId = null),
  36954. (this._resizeTo = null),
  36955. (this.resizeTo = t.resizeTo || null);
  36956. }),
  36957. (t.destroy = function () {
  36958. globalThis.removeEventListener('resize', this.queueResize),
  36959. this.cancelResize(),
  36960. (this.cancelResize = null),
  36961. (this.queueResize = null),
  36962. (this.resizeTo = null),
  36963. (this.resize = null);
  36964. }),
  36965. (t.extension = HD.Application),
  36966. t
  36967. );
  36968. })(),
  36969. XG = (function () {
  36970. function t(e) {
  36971. var r = this;
  36972. (this.stage = new VD()),
  36973. (e = Object.assign({ forceCanvas: !1 }, e)),
  36974. (this.renderer = eN(e)),
  36975. t._plugins.forEach(function (t) {
  36976. t.init.call(r, e);
  36977. });
  36978. }
  36979. return (
  36980. (t.registerPlugin = function (t) {
  36981. aD(
  36982. '6.5.0',
  36983. 'Application.registerPlugin() is deprecated, use extensions.add()'
  36984. ),
  36985. ZD.add({ type: HD.Application, ref: t });
  36986. }),
  36987. (t.prototype.render = function () {
  36988. this.renderer.render(this.stage);
  36989. }),
  36990. Object.defineProperty(t.prototype, 'view', {
  36991. get: function () {
  36992. return this.renderer.view;
  36993. },
  36994. enumerable: !1,
  36995. configurable: !0,
  36996. }),
  36997. Object.defineProperty(t.prototype, 'screen', {
  36998. get: function () {
  36999. return this.renderer.screen;
  37000. },
  37001. enumerable: !1,
  37002. configurable: !0,
  37003. }),
  37004. (t.prototype.destroy = function (e, r) {
  37005. var n = this,
  37006. i = t._plugins.slice(0);
  37007. i.reverse(),
  37008. i.forEach(function (t) {
  37009. t.destroy.call(n);
  37010. }),
  37011. this.stage.destroy(r),
  37012. (this.stage = null),
  37013. this.renderer.destroy(e),
  37014. (this.renderer = null);
  37015. }),
  37016. (t._plugins = []),
  37017. t
  37018. );
  37019. })();
  37020. ZD.handleByList(HD.Application, XG._plugins), ZD.add(jG);
  37021. var VG = function (t, e) {
  37022. return (
  37023. (VG =
  37024. Object.setPrototypeOf ||
  37025. ({ __proto__: [] } instanceof Array &&
  37026. function (t, e) {
  37027. t.__proto__ = e;
  37028. }) ||
  37029. function (t, e) {
  37030. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  37031. }),
  37032. VG(t, e)
  37033. );
  37034. };
  37035. function HG(t, e) {
  37036. function r() {
  37037. this.constructor = t;
  37038. }
  37039. VG(t, e),
  37040. (t.prototype =
  37041. null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
  37042. }
  37043. var WG = (function (t) {
  37044. function e(e, r, n, i) {
  37045. void 0 === e && (e = 100),
  37046. void 0 === r && (r = 100),
  37047. void 0 === n && (n = 10),
  37048. void 0 === i && (i = 10);
  37049. var o = t.call(this) || this;
  37050. return (
  37051. (o.segWidth = n),
  37052. (o.segHeight = i),
  37053. (o.width = e),
  37054. (o.height = r),
  37055. o.build(),
  37056. o
  37057. );
  37058. }
  37059. return (
  37060. HG(e, t),
  37061. (e.prototype.build = function () {
  37062. for (
  37063. var t = this.segWidth * this.segHeight,
  37064. e = [],
  37065. r = [],
  37066. n = [],
  37067. i = this.segWidth - 1,
  37068. o = this.segHeight - 1,
  37069. s = this.width / i,
  37070. a = this.height / o,
  37071. u = 0;
  37072. u < t;
  37073. u++
  37074. ) {
  37075. var c = u % this.segWidth,
  37076. h = (u / this.segWidth) | 0;
  37077. e.push(c * s, h * a), r.push(c / i, h / o);
  37078. }
  37079. var l = i * o;
  37080. for (u = 0; u < l; u++) {
  37081. var d = u % i,
  37082. f = (u / i) | 0,
  37083. p = f * this.segWidth + d,
  37084. v = f * this.segWidth + d + 1,
  37085. m = (f + 1) * this.segWidth + d,
  37086. y = (f + 1) * this.segWidth + d + 1;
  37087. n.push(p, v, m, v, y, m);
  37088. }
  37089. (this.buffers[0].data = new Float32Array(e)),
  37090. (this.buffers[1].data = new Float32Array(r)),
  37091. (this.indexBuffer.data = new Uint16Array(n)),
  37092. this.buffers[0].update(),
  37093. this.buffers[1].update(),
  37094. this.indexBuffer.update();
  37095. }),
  37096. e
  37097. );
  37098. })(dG),
  37099. YG = (function (t) {
  37100. function e(e, r, n) {
  37101. void 0 === e && (e = 200), void 0 === n && (n = 0);
  37102. var i =
  37103. t.call(
  37104. this,
  37105. new Float32Array(4 * r.length),
  37106. new Float32Array(4 * r.length),
  37107. new Uint16Array(6 * (r.length - 1))
  37108. ) || this;
  37109. return (
  37110. (i.points = r), (i._width = e), (i.textureScale = n), i.build(), i
  37111. );
  37112. }
  37113. return (
  37114. HG(e, t),
  37115. Object.defineProperty(e.prototype, 'width', {
  37116. get: function () {
  37117. return this._width;
  37118. },
  37119. enumerable: !1,
  37120. configurable: !0,
  37121. }),
  37122. (e.prototype.build = function () {
  37123. var t = this.points;
  37124. if (t) {
  37125. var e = this.getBuffer('aVertexPosition'),
  37126. r = this.getBuffer('aTextureCoord'),
  37127. n = this.getIndex();
  37128. if (!(t.length < 1)) {
  37129. e.data.length / 4 !== t.length &&
  37130. ((e.data = new Float32Array(4 * t.length)),
  37131. (r.data = new Float32Array(4 * t.length)),
  37132. (n.data = new Uint16Array(6 * (t.length - 1))));
  37133. var i = r.data,
  37134. o = n.data;
  37135. (i[0] = 0), (i[1] = 0), (i[2] = 0), (i[3] = 1);
  37136. for (
  37137. var s = 0,
  37138. a = t[0],
  37139. u = this._width * this.textureScale,
  37140. c = t.length,
  37141. h = 0;
  37142. h < c;
  37143. h++
  37144. ) {
  37145. var l = 4 * h;
  37146. if (this.textureScale > 0) {
  37147. var d = a.x - t[h].x,
  37148. f = a.y - t[h].y,
  37149. p = Math.sqrt(d * d + f * f);
  37150. (a = t[h]), (s += p / u);
  37151. } else s = h / (c - 1);
  37152. (i[l] = s), (i[l + 1] = 0), (i[l + 2] = s), (i[l + 3] = 1);
  37153. }
  37154. var v = 0;
  37155. for (h = 0; h < c - 1; h++) {
  37156. l = 2 * h;
  37157. (o[v++] = l),
  37158. (o[v++] = l + 1),
  37159. (o[v++] = l + 2),
  37160. (o[v++] = l + 2),
  37161. (o[v++] = l + 1),
  37162. (o[v++] = l + 3);
  37163. }
  37164. r.update(), n.update(), this.updateVertices();
  37165. }
  37166. }
  37167. }),
  37168. (e.prototype.updateVertices = function () {
  37169. var t = this.points;
  37170. if (!(t.length < 1)) {
  37171. for (
  37172. var e,
  37173. r = t[0],
  37174. n = 0,
  37175. i = 0,
  37176. o = this.buffers[0].data,
  37177. s = t.length,
  37178. a = 0;
  37179. a < s;
  37180. a++
  37181. ) {
  37182. var u = t[a],
  37183. c = 4 * a;
  37184. (i = -((e = a < t.length - 1 ? t[a + 1] : u).x - r.x)),
  37185. (n = e.y - r.y);
  37186. var h = Math.sqrt(n * n + i * i),
  37187. l =
  37188. this.textureScale > 0
  37189. ? (this.textureScale * this._width) / 2
  37190. : this._width / 2;
  37191. (n /= h),
  37192. (i /= h),
  37193. (n *= l),
  37194. (i *= l),
  37195. (o[c] = u.x + n),
  37196. (o[c + 1] = u.y + i),
  37197. (o[c + 2] = u.x - n),
  37198. (o[c + 3] = u.y - i),
  37199. (r = u);
  37200. }
  37201. this.buffers[0].update();
  37202. }
  37203. }),
  37204. (e.prototype.update = function () {
  37205. this.textureScale > 0 ? this.build() : this.updateVertices();
  37206. }),
  37207. e
  37208. );
  37209. })(dG),
  37210. zG = (function (t) {
  37211. function e(e, r, n) {
  37212. void 0 === n && (n = 0);
  37213. var i = this,
  37214. o = new YG(e.height, r, n),
  37215. s = new lG(e);
  37216. return (
  37217. n > 0 && (e.baseTexture.wrapMode = kP.REPEAT),
  37218. ((i = t.call(this, o, s) || this).autoUpdate = !0),
  37219. i
  37220. );
  37221. }
  37222. return (
  37223. HG(e, t),
  37224. (e.prototype._render = function (e) {
  37225. var r = this.geometry;
  37226. (this.autoUpdate || r._width !== this.shader.texture.height) &&
  37227. ((r._width = this.shader.texture.height), r.update()),
  37228. t.prototype._render.call(this, e);
  37229. }),
  37230. e
  37231. );
  37232. })(hG),
  37233. ZG = (function (t) {
  37234. function e(e, r, n) {
  37235. var i = this,
  37236. o = new WG(e.width, e.height, r, n),
  37237. s = new lG(EL.WHITE);
  37238. return (
  37239. ((i = t.call(this, o, s) || this).texture = e), (i.autoResize = !0), i
  37240. );
  37241. }
  37242. return (
  37243. HG(e, t),
  37244. (e.prototype.textureUpdated = function () {
  37245. this._textureID = this.shader.texture._updateID;
  37246. var t = this.geometry,
  37247. e = this.shader.texture,
  37248. r = e.width,
  37249. n = e.height;
  37250. !this.autoResize ||
  37251. (t.width === r && t.height === n) ||
  37252. ((t.width = this.shader.texture.width),
  37253. (t.height = this.shader.texture.height),
  37254. t.build());
  37255. }),
  37256. Object.defineProperty(e.prototype, 'texture', {
  37257. get: function () {
  37258. return this.shader.texture;
  37259. },
  37260. set: function (t) {
  37261. this.shader.texture !== t &&
  37262. ((this.shader.texture = t),
  37263. (this._textureID = -1),
  37264. t.baseTexture.valid
  37265. ? this.textureUpdated()
  37266. : t.once('update', this.textureUpdated, this));
  37267. },
  37268. enumerable: !1,
  37269. configurable: !0,
  37270. }),
  37271. (e.prototype._render = function (e) {
  37272. this._textureID !== this.shader.texture._updateID &&
  37273. this.textureUpdated(),
  37274. t.prototype._render.call(this, e);
  37275. }),
  37276. (e.prototype.destroy = function (e) {
  37277. this.shader.texture.off('update', this.textureUpdated, this),
  37278. t.prototype.destroy.call(this, e);
  37279. }),
  37280. e
  37281. );
  37282. })(hG),
  37283. JG = (function (t) {
  37284. function e(e, r, n, i, o) {
  37285. void 0 === e && (e = EL.EMPTY);
  37286. var s = this,
  37287. a = new dG(r, n, i);
  37288. a.getBuffer('aVertexPosition').static = !1;
  37289. var u = new lG(e);
  37290. return ((s = t.call(this, a, u, null, o) || this).autoUpdate = !0), s;
  37291. }
  37292. return (
  37293. HG(e, t),
  37294. Object.defineProperty(e.prototype, 'vertices', {
  37295. get: function () {
  37296. return this.geometry.getBuffer('aVertexPosition').data;
  37297. },
  37298. set: function (t) {
  37299. this.geometry.getBuffer('aVertexPosition').data = t;
  37300. },
  37301. enumerable: !1,
  37302. configurable: !0,
  37303. }),
  37304. (e.prototype._render = function (e) {
  37305. this.autoUpdate &&
  37306. this.geometry.getBuffer('aVertexPosition').update(),
  37307. t.prototype._render.call(this, e);
  37308. }),
  37309. e
  37310. );
  37311. })(hG),
  37312. KG = (function (t) {
  37313. function e(e, r, n, i, o) {
  37314. void 0 === r && (r = 10),
  37315. void 0 === n && (n = 10),
  37316. void 0 === i && (i = 10),
  37317. void 0 === o && (o = 10);
  37318. var s = t.call(this, EL.WHITE, 4, 4) || this;
  37319. return (
  37320. (s._origWidth = e.orig.width),
  37321. (s._origHeight = e.orig.height),
  37322. (s._width = s._origWidth),
  37323. (s._height = s._origHeight),
  37324. (s._leftWidth = r),
  37325. (s._rightWidth = i),
  37326. (s._topHeight = n),
  37327. (s._bottomHeight = o),
  37328. (s.texture = e),
  37329. s
  37330. );
  37331. }
  37332. return (
  37333. HG(e, t),
  37334. (e.prototype.textureUpdated = function () {
  37335. (this._textureID = this.shader.texture._updateID), this._refresh();
  37336. }),
  37337. Object.defineProperty(e.prototype, 'vertices', {
  37338. get: function () {
  37339. return this.geometry.getBuffer('aVertexPosition').data;
  37340. },
  37341. set: function (t) {
  37342. this.geometry.getBuffer('aVertexPosition').data = t;
  37343. },
  37344. enumerable: !1,
  37345. configurable: !0,
  37346. }),
  37347. (e.prototype.updateHorizontalVertices = function () {
  37348. var t = this.vertices,
  37349. e = this._getMinScale();
  37350. (t[9] = t[11] = t[13] = t[15] = this._topHeight * e),
  37351. (t[17] =
  37352. t[19] =
  37353. t[21] =
  37354. t[23] =
  37355. this._height - this._bottomHeight * e),
  37356. (t[25] = t[27] = t[29] = t[31] = this._height);
  37357. }),
  37358. (e.prototype.updateVerticalVertices = function () {
  37359. var t = this.vertices,
  37360. e = this._getMinScale();
  37361. (t[2] = t[10] = t[18] = t[26] = this._leftWidth * e),
  37362. (t[4] = t[12] = t[20] = t[28] = this._width - this._rightWidth * e),
  37363. (t[6] = t[14] = t[22] = t[30] = this._width);
  37364. }),
  37365. (e.prototype._getMinScale = function () {
  37366. var t = this._leftWidth + this._rightWidth,
  37367. e = this._width > t ? 1 : this._width / t,
  37368. r = this._topHeight + this._bottomHeight,
  37369. n = this._height > r ? 1 : this._height / r;
  37370. return Math.min(e, n);
  37371. }),
  37372. Object.defineProperty(e.prototype, 'width', {
  37373. get: function () {
  37374. return this._width;
  37375. },
  37376. set: function (t) {
  37377. (this._width = t), this._refresh();
  37378. },
  37379. enumerable: !1,
  37380. configurable: !0,
  37381. }),
  37382. Object.defineProperty(e.prototype, 'height', {
  37383. get: function () {
  37384. return this._height;
  37385. },
  37386. set: function (t) {
  37387. (this._height = t), this._refresh();
  37388. },
  37389. enumerable: !1,
  37390. configurable: !0,
  37391. }),
  37392. Object.defineProperty(e.prototype, 'leftWidth', {
  37393. get: function () {
  37394. return this._leftWidth;
  37395. },
  37396. set: function (t) {
  37397. (this._leftWidth = t), this._refresh();
  37398. },
  37399. enumerable: !1,
  37400. configurable: !0,
  37401. }),
  37402. Object.defineProperty(e.prototype, 'rightWidth', {
  37403. get: function () {
  37404. return this._rightWidth;
  37405. },
  37406. set: function (t) {
  37407. (this._rightWidth = t), this._refresh();
  37408. },
  37409. enumerable: !1,
  37410. configurable: !0,
  37411. }),
  37412. Object.defineProperty(e.prototype, 'topHeight', {
  37413. get: function () {
  37414. return this._topHeight;
  37415. },
  37416. set: function (t) {
  37417. (this._topHeight = t), this._refresh();
  37418. },
  37419. enumerable: !1,
  37420. configurable: !0,
  37421. }),
  37422. Object.defineProperty(e.prototype, 'bottomHeight', {
  37423. get: function () {
  37424. return this._bottomHeight;
  37425. },
  37426. set: function (t) {
  37427. (this._bottomHeight = t), this._refresh();
  37428. },
  37429. enumerable: !1,
  37430. configurable: !0,
  37431. }),
  37432. (e.prototype._refresh = function () {
  37433. var t = this.texture,
  37434. e = this.geometry.buffers[1].data;
  37435. (this._origWidth = t.orig.width), (this._origHeight = t.orig.height);
  37436. var r = 1 / this._origWidth,
  37437. n = 1 / this._origHeight;
  37438. (e[0] = e[8] = e[16] = e[24] = 0),
  37439. (e[1] = e[3] = e[5] = e[7] = 0),
  37440. (e[6] = e[14] = e[22] = e[30] = 1),
  37441. (e[25] = e[27] = e[29] = e[31] = 1),
  37442. (e[2] = e[10] = e[18] = e[26] = r * this._leftWidth),
  37443. (e[4] = e[12] = e[20] = e[28] = 1 - r * this._rightWidth),
  37444. (e[9] = e[11] = e[13] = e[15] = n * this._topHeight),
  37445. (e[17] = e[19] = e[21] = e[23] = 1 - n * this._bottomHeight),
  37446. this.updateHorizontalVertices(),
  37447. this.updateVerticalVertices(),
  37448. this.geometry.buffers[0].update(),
  37449. this.geometry.buffers[1].update();
  37450. }),
  37451. e
  37452. );
  37453. })(ZG),
  37454. qG = function (t, e) {
  37455. return (
  37456. (qG =
  37457. Object.setPrototypeOf ||
  37458. ({ __proto__: [] } instanceof Array &&
  37459. function (t, e) {
  37460. t.__proto__ = e;
  37461. }) ||
  37462. function (t, e) {
  37463. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  37464. }),
  37465. qG(t, e)
  37466. );
  37467. };
  37468. !(function (t) {
  37469. function e(e, r) {
  37470. void 0 === r && (r = !0);
  37471. var n = t.call(this, e[0] instanceof EL ? e[0] : e[0].texture) || this;
  37472. return (
  37473. (n._textures = null),
  37474. (n._durations = null),
  37475. (n._autoUpdate = r),
  37476. (n._isConnectedToTicker = !1),
  37477. (n.animationSpeed = 1),
  37478. (n.loop = !0),
  37479. (n.updateAnchor = !1),
  37480. (n.onComplete = null),
  37481. (n.onFrameChange = null),
  37482. (n.onLoop = null),
  37483. (n._currentTime = 0),
  37484. (n._playing = !1),
  37485. (n._previousFrame = null),
  37486. (n.textures = e),
  37487. n
  37488. );
  37489. }
  37490. (function (t, e) {
  37491. function r() {
  37492. this.constructor = t;
  37493. }
  37494. qG(t, e),
  37495. (t.prototype =
  37496. null === e
  37497. ? Object.create(e)
  37498. : ((r.prototype = e.prototype), new r()));
  37499. })(e, t),
  37500. (e.prototype.stop = function () {
  37501. this._playing &&
  37502. ((this._playing = !1),
  37503. this._autoUpdate &&
  37504. this._isConnectedToTicker &&
  37505. (qD.shared.remove(this.update, this),
  37506. (this._isConnectedToTicker = !1)));
  37507. }),
  37508. (e.prototype.play = function () {
  37509. this._playing ||
  37510. ((this._playing = !0),
  37511. this._autoUpdate &&
  37512. !this._isConnectedToTicker &&
  37513. (qD.shared.add(this.update, this, YD.HIGH),
  37514. (this._isConnectedToTicker = !0)));
  37515. }),
  37516. (e.prototype.gotoAndStop = function (t) {
  37517. this.stop();
  37518. var e = this.currentFrame;
  37519. (this._currentTime = t),
  37520. e !== this.currentFrame && this.updateTexture();
  37521. }),
  37522. (e.prototype.gotoAndPlay = function (t) {
  37523. var e = this.currentFrame;
  37524. (this._currentTime = t),
  37525. e !== this.currentFrame && this.updateTexture(),
  37526. this.play();
  37527. }),
  37528. (e.prototype.update = function (t) {
  37529. if (this._playing) {
  37530. var e = this.animationSpeed * t,
  37531. r = this.currentFrame;
  37532. if (null !== this._durations) {
  37533. var n =
  37534. (this._currentTime % 1) * this._durations[this.currentFrame];
  37535. for (n += (e / 60) * 1e3; n < 0; )
  37536. this._currentTime--, (n += this._durations[this.currentFrame]);
  37537. var i = Math.sign(this.animationSpeed * t);
  37538. for (
  37539. this._currentTime = Math.floor(this._currentTime);
  37540. n >= this._durations[this.currentFrame];
  37541. )
  37542. (n -= this._durations[this.currentFrame] * i),
  37543. (this._currentTime += i);
  37544. this._currentTime += n / this._durations[this.currentFrame];
  37545. } else this._currentTime += e;
  37546. this._currentTime < 0 && !this.loop
  37547. ? (this.gotoAndStop(0), this.onComplete && this.onComplete())
  37548. : this._currentTime >= this._textures.length && !this.loop
  37549. ? (this.gotoAndStop(this._textures.length - 1),
  37550. this.onComplete && this.onComplete())
  37551. : r !== this.currentFrame &&
  37552. (this.loop &&
  37553. this.onLoop &&
  37554. ((this.animationSpeed > 0 && this.currentFrame < r) ||
  37555. (this.animationSpeed < 0 && this.currentFrame > r)) &&
  37556. this.onLoop(),
  37557. this.updateTexture());
  37558. }
  37559. }),
  37560. (e.prototype.updateTexture = function () {
  37561. var t = this.currentFrame;
  37562. this._previousFrame !== t &&
  37563. ((this._previousFrame = t),
  37564. (this._texture = this._textures[t]),
  37565. (this._textureID = -1),
  37566. (this._textureTrimmedID = -1),
  37567. (this._cachedTint = 16777215),
  37568. (this.uvs = this._texture._uvs.uvsFloat32),
  37569. this.updateAnchor &&
  37570. this._anchor.copyFrom(this._texture.defaultAnchor),
  37571. this.onFrameChange && this.onFrameChange(this.currentFrame));
  37572. }),
  37573. (e.prototype.destroy = function (e) {
  37574. this.stop(),
  37575. t.prototype.destroy.call(this, e),
  37576. (this.onComplete = null),
  37577. (this.onFrameChange = null),
  37578. (this.onLoop = null);
  37579. }),
  37580. (e.fromFrames = function (t) {
  37581. for (var r = [], n = 0; n < t.length; ++n) r.push(EL.from(t[n]));
  37582. return new e(r);
  37583. }),
  37584. (e.fromImages = function (t) {
  37585. for (var r = [], n = 0; n < t.length; ++n) r.push(EL.from(t[n]));
  37586. return new e(r);
  37587. }),
  37588. Object.defineProperty(e.prototype, 'totalFrames', {
  37589. get: function () {
  37590. return this._textures.length;
  37591. },
  37592. enumerable: !1,
  37593. configurable: !0,
  37594. }),
  37595. Object.defineProperty(e.prototype, 'textures', {
  37596. get: function () {
  37597. return this._textures;
  37598. },
  37599. set: function (t) {
  37600. if (t[0] instanceof EL)
  37601. (this._textures = t), (this._durations = null);
  37602. else {
  37603. (this._textures = []), (this._durations = []);
  37604. for (var e = 0; e < t.length; e++)
  37605. this._textures.push(t[e].texture),
  37606. this._durations.push(t[e].time);
  37607. }
  37608. (this._previousFrame = null),
  37609. this.gotoAndStop(0),
  37610. this.updateTexture();
  37611. },
  37612. enumerable: !1,
  37613. configurable: !0,
  37614. }),
  37615. Object.defineProperty(e.prototype, 'currentFrame', {
  37616. get: function () {
  37617. var t = Math.floor(this._currentTime) % this._textures.length;
  37618. return t < 0 && (t += this._textures.length), t;
  37619. },
  37620. enumerable: !1,
  37621. configurable: !0,
  37622. }),
  37623. Object.defineProperty(e.prototype, 'playing', {
  37624. get: function () {
  37625. return this._playing;
  37626. },
  37627. enumerable: !1,
  37628. configurable: !0,
  37629. }),
  37630. Object.defineProperty(e.prototype, 'autoUpdate', {
  37631. get: function () {
  37632. return this._autoUpdate;
  37633. },
  37634. set: function (t) {
  37635. t !== this._autoUpdate &&
  37636. ((this._autoUpdate = t),
  37637. !this._autoUpdate && this._isConnectedToTicker
  37638. ? (qD.shared.remove(this.update, this),
  37639. (this._isConnectedToTicker = !1))
  37640. : this._autoUpdate &&
  37641. !this._isConnectedToTicker &&
  37642. this._playing &&
  37643. (qD.shared.add(this.update, this),
  37644. (this._isConnectedToTicker = !0)));
  37645. },
  37646. enumerable: !1,
  37647. configurable: !0,
  37648. });
  37649. })(SB),
  37650. ZD.add(fN, EN, TN, Wk, JB, dN, iG, CG, ek, kk, Bk, qB, QD, UN);
  37651. var QG = function (t, e) {
  37652. return (
  37653. (QG =
  37654. Object.setPrototypeOf ||
  37655. ({ __proto__: [] } instanceof Array &&
  37656. function (t, e) {
  37657. t.__proto__ = e;
  37658. }) ||
  37659. function (t, e) {
  37660. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  37661. }),
  37662. QG(t, e)
  37663. );
  37664. };
  37665. var $G = (function () {
  37666. function t(t) {
  37667. (this._foundShapes = []), (this.renderer = t);
  37668. }
  37669. return (
  37670. (t.prototype.pushMask = function (t) {
  37671. var e = this.renderer,
  37672. r = t.maskObject || t;
  37673. e.context.save();
  37674. var n = this._foundShapes;
  37675. if ((this.recursiveFindShapes(r, n), n.length > 0)) {
  37676. var i = e.context;
  37677. i.beginPath();
  37678. for (var o = 0; o < n.length; o++) {
  37679. var s = n[o],
  37680. a = s.transform.worldTransform;
  37681. this.renderer.setContextTransform(a), this.renderGraphicsShape(s);
  37682. }
  37683. (n.length = 0), i.clip();
  37684. }
  37685. }),
  37686. (t.prototype.recursiveFindShapes = function (t, e) {
  37687. t.geometry && t.geometry.graphicsData && e.push(t);
  37688. var r = t.children;
  37689. if (r)
  37690. for (var n = 0; n < r.length; n++) this.recursiveFindShapes(r[n], e);
  37691. }),
  37692. (t.prototype.renderGraphicsShape = function (t) {
  37693. t.finishPoly();
  37694. var e = this.renderer.context,
  37695. r = t.geometry.graphicsData,
  37696. n = r.length;
  37697. if (0 !== n)
  37698. for (var i = 0; i < n; i++) {
  37699. var o = r[i],
  37700. s = o.shape;
  37701. if (s.type === vD.POLY) {
  37702. var a = s.points,
  37703. u = o.holes,
  37704. c = void 0,
  37705. h = void 0,
  37706. l = void 0,
  37707. d = void 0;
  37708. e.moveTo(a[0], a[1]);
  37709. for (var f = 1; f < a.length / 2; f++)
  37710. e.lineTo(a[2 * f], a[2 * f + 1]);
  37711. if (u.length > 0) {
  37712. (c = 0), (l = a[0]), (d = a[1]);
  37713. for (f = 2; f + 2 < a.length; f += 2)
  37714. c +=
  37715. (a[f] - l) * (a[f + 3] - d) -
  37716. (a[f + 2] - l) * (a[f + 1] - d);
  37717. for (var p = 0; p < u.length; p++)
  37718. if ((a = u[p].shape.points)) {
  37719. (h = 0), (l = a[0]), (d = a[1]);
  37720. for (f = 2; f + 2 < a.length; f += 2)
  37721. h +=
  37722. (a[f] - l) * (a[f + 3] - d) -
  37723. (a[f + 2] - l) * (a[f + 1] - d);
  37724. if (h * c < 0) {
  37725. e.moveTo(a[0], a[1]);
  37726. for (f = 2; f < a.length; f += 2)
  37727. e.lineTo(a[f], a[f + 1]);
  37728. } else {
  37729. e.moveTo(a[a.length - 2], a[a.length - 1]);
  37730. for (f = a.length - 4; f >= 0; f -= 2)
  37731. e.lineTo(a[f], a[f + 1]);
  37732. }
  37733. u[p].shape.closeStroke && e.closePath();
  37734. }
  37735. }
  37736. a[0] === a[a.length - 2] &&
  37737. a[1] === a[a.length - 1] &&
  37738. e.closePath();
  37739. } else if (s.type === vD.RECT)
  37740. e.rect(s.x, s.y, s.width, s.height), e.closePath();
  37741. else if (s.type === vD.CIRC)
  37742. e.arc(s.x, s.y, s.radius, 0, 2 * Math.PI), e.closePath();
  37743. else if (s.type === vD.ELIP) {
  37744. var v = 2 * s.width,
  37745. m = 2 * s.height,
  37746. y = s.x - v / 2,
  37747. g = s.y - m / 2,
  37748. _ = 0.5522848,
  37749. b = (v / 2) * _,
  37750. T = (m / 2) * _,
  37751. x = y + v,
  37752. E = g + m,
  37753. S = y + v / 2,
  37754. w = g + m / 2;
  37755. e.moveTo(y, w),
  37756. e.bezierCurveTo(y, w - T, S - b, g, S, g),
  37757. e.bezierCurveTo(S + b, g, x, w - T, x, w),
  37758. e.bezierCurveTo(x, w + T, S + b, E, S, E),
  37759. e.bezierCurveTo(S - b, E, y, w + T, y, w),
  37760. e.closePath();
  37761. } else if (s.type === vD.RREC) {
  37762. var R = s.x,
  37763. C = s.y,
  37764. P = s.width,
  37765. A = s.height,
  37766. O = s.radius,
  37767. I = Math.min(P, A) / 2;
  37768. (O = O > I ? I : O),
  37769. e.moveTo(R, C + O),
  37770. e.lineTo(R, C + A - O),
  37771. e.quadraticCurveTo(R, C + A, R + O, C + A),
  37772. e.lineTo(R + P - O, C + A),
  37773. e.quadraticCurveTo(R + P, C + A, R + P, C + A - O),
  37774. e.lineTo(R + P, C + O),
  37775. e.quadraticCurveTo(R + P, C, R + P - O, C),
  37776. e.lineTo(R + O, C),
  37777. e.quadraticCurveTo(R, C, R, C + O),
  37778. e.closePath();
  37779. }
  37780. }
  37781. }),
  37782. (t.prototype.popMask = function (t) {
  37783. t.context.restore(), t.invalidateBlendMode();
  37784. }),
  37785. (t.prototype.destroy = function () {}),
  37786. t
  37787. );
  37788. })();
  37789. function tU(t) {
  37790. var e = vA.ADAPTER.createCanvas(6, 1),
  37791. r = e.getContext('2d');
  37792. return (r.fillStyle = t), r.fillRect(0, 0, 6, 1), e;
  37793. }
  37794. function eU() {
  37795. if ('undefined' == typeof document) return !1;
  37796. var t = tU('#ff00ff'),
  37797. e = tU('#ffff00'),
  37798. r = vA.ADAPTER.createCanvas(6, 1).getContext('2d');
  37799. (r.globalCompositeOperation = 'multiply'),
  37800. r.drawImage(t, 0, 0),
  37801. r.drawImage(e, 2, 0);
  37802. var n = r.getImageData(2, 0, 1, 1);
  37803. if (!n) return !1;
  37804. var i = n.data;
  37805. return 255 === i[0] && 0 === i[1] && 0 === i[2];
  37806. }
  37807. var rU = new CD(),
  37808. nU = (function (t) {
  37809. function e(r) {
  37810. var n,
  37811. i = t.call(this, PP.CANVAS, r) || this;
  37812. if (
  37813. ((i.refresh = !0),
  37814. (i.maskManager = new $G(i)),
  37815. (i.smoothProperty = 'imageSmoothingEnabled'),
  37816. (i.blendModes =
  37817. (void 0 === n && (n = []),
  37818. eU()
  37819. ? ((n[OP.NORMAL] = 'source-over'),
  37820. (n[OP.ADD] = 'lighter'),
  37821. (n[OP.MULTIPLY] = 'multiply'),
  37822. (n[OP.SCREEN] = 'screen'),
  37823. (n[OP.OVERLAY] = 'overlay'),
  37824. (n[OP.DARKEN] = 'darken'),
  37825. (n[OP.LIGHTEN] = 'lighten'),
  37826. (n[OP.COLOR_DODGE] = 'color-dodge'),
  37827. (n[OP.COLOR_BURN] = 'color-burn'),
  37828. (n[OP.HARD_LIGHT] = 'hard-light'),
  37829. (n[OP.SOFT_LIGHT] = 'soft-light'),
  37830. (n[OP.DIFFERENCE] = 'difference'),
  37831. (n[OP.EXCLUSION] = 'exclusion'),
  37832. (n[OP.HUE] = 'hue'),
  37833. (n[OP.SATURATION] = 'saturation'),
  37834. (n[OP.COLOR] = 'color'),
  37835. (n[OP.LUMINOSITY] = 'luminosity'))
  37836. : ((n[OP.NORMAL] = 'source-over'),
  37837. (n[OP.ADD] = 'lighter'),
  37838. (n[OP.MULTIPLY] = 'source-over'),
  37839. (n[OP.SCREEN] = 'source-over'),
  37840. (n[OP.OVERLAY] = 'source-over'),
  37841. (n[OP.DARKEN] = 'source-over'),
  37842. (n[OP.LIGHTEN] = 'source-over'),
  37843. (n[OP.COLOR_DODGE] = 'source-over'),
  37844. (n[OP.COLOR_BURN] = 'source-over'),
  37845. (n[OP.HARD_LIGHT] = 'source-over'),
  37846. (n[OP.SOFT_LIGHT] = 'source-over'),
  37847. (n[OP.DIFFERENCE] = 'source-over'),
  37848. (n[OP.EXCLUSION] = 'source-over'),
  37849. (n[OP.HUE] = 'source-over'),
  37850. (n[OP.SATURATION] = 'source-over'),
  37851. (n[OP.COLOR] = 'source-over'),
  37852. (n[OP.LUMINOSITY] = 'source-over')),
  37853. (n[OP.NORMAL_NPM] = n[OP.NORMAL]),
  37854. (n[OP.ADD_NPM] = n[OP.ADD]),
  37855. (n[OP.SCREEN_NPM] = n[OP.SCREEN]),
  37856. (n[OP.SRC_IN] = 'source-in'),
  37857. (n[OP.SRC_OUT] = 'source-out'),
  37858. (n[OP.SRC_ATOP] = 'source-atop'),
  37859. (n[OP.DST_OVER] = 'destination-over'),
  37860. (n[OP.DST_IN] = 'destination-in'),
  37861. (n[OP.DST_OUT] = 'destination-out'),
  37862. (n[OP.DST_ATOP] = 'destination-atop'),
  37863. (n[OP.XOR] = 'xor'),
  37864. (n[OP.SUBTRACT] = 'source-over'),
  37865. n)),
  37866. (i.renderingToScreen = !1),
  37867. (i._activeBlendMode = null),
  37868. (i._projTransform = null),
  37869. (i._outerBlend = !1),
  37870. (i.rootContext = i.view.getContext('2d', {
  37871. alpha: i.useContextAlpha,
  37872. })),
  37873. (i.context = i.rootContext),
  37874. !i.rootContext.imageSmoothingEnabled)
  37875. ) {
  37876. var o = i.rootContext;
  37877. o.webkitImageSmoothingEnabled
  37878. ? (i.smoothProperty = 'webkitImageSmoothingEnabled')
  37879. : o.mozImageSmoothingEnabled
  37880. ? (i.smoothProperty = 'mozImageSmoothingEnabled')
  37881. : o.oImageSmoothingEnabled
  37882. ? (i.smoothProperty = 'oImageSmoothingEnabled')
  37883. : o.msImageSmoothingEnabled &&
  37884. (i.smoothProperty = 'msImageSmoothingEnabled');
  37885. }
  37886. return (
  37887. i.initPlugins(e.__plugins),
  37888. XM('Canvas'),
  37889. i.resize(i.options.width, i.options.height),
  37890. i
  37891. );
  37892. }
  37893. return (
  37894. (function (t, e) {
  37895. function r() {
  37896. this.constructor = t;
  37897. }
  37898. QG(t, e),
  37899. (t.prototype =
  37900. null === e
  37901. ? Object.create(e)
  37902. : ((r.prototype = e.prototype), new r()));
  37903. })(e, t),
  37904. (e.prototype.addSystem = function () {
  37905. return this;
  37906. }),
  37907. (e.prototype.render = function (t, e) {
  37908. if (this.view) {
  37909. var r, n, i, o;
  37910. e &&
  37911. (e instanceof SL || e instanceof _L
  37912. ? (aD(
  37913. '6.0.0',
  37914. 'CanvasRenderer#render arguments changed, use options instead.'
  37915. ),
  37916. (r = e),
  37917. (n = arguments[2]),
  37918. (i = arguments[3]),
  37919. (o = arguments[4]))
  37920. : ((r = e.renderTexture),
  37921. (n = e.clear),
  37922. (i = e.transform),
  37923. (o = e.skipUpdateTransform))),
  37924. (this.renderingToScreen = !r),
  37925. this.emit('prerender');
  37926. var s = this.resolution;
  37927. r
  37928. ? ((r = r.castToBaseTexture())._canvasRenderTarget ||
  37929. ((r._canvasRenderTarget = new dD(
  37930. r.width,
  37931. r.height,
  37932. r.resolution
  37933. )),
  37934. (r.resource = new lL(r._canvasRenderTarget.canvas)),
  37935. (r.valid = !0)),
  37936. (this.context = r._canvasRenderTarget.context),
  37937. (this.resolution = r._canvasRenderTarget.resolution))
  37938. : (this.context = this.rootContext);
  37939. var a = this.context;
  37940. if (
  37941. ((this._projTransform = i || null),
  37942. r || (this._lastObjectRendered = t),
  37943. !o)
  37944. ) {
  37945. var u = t.enableTempParent();
  37946. t.updateTransform(), t.disableTempParent(u);
  37947. }
  37948. if (
  37949. (a.save(),
  37950. a.setTransform(1, 0, 0, 1, 0, 0),
  37951. (a.globalAlpha = 1),
  37952. (this._activeBlendMode = OP.NORMAL),
  37953. (this._outerBlend = !1),
  37954. (a.globalCompositeOperation = this.blendModes[OP.NORMAL]),
  37955. void 0 !== n ? n : this.clearBeforeRender)
  37956. )
  37957. if (this.renderingToScreen)
  37958. a.clearRect(0, 0, this.width, this.height),
  37959. this.backgroundAlpha > 0 &&
  37960. ((a.globalAlpha = this.useContextAlpha
  37961. ? this.backgroundAlpha
  37962. : 1),
  37963. (a.fillStyle = this._backgroundColorString),
  37964. a.fillRect(0, 0, this.width, this.height),
  37965. (a.globalAlpha = 1));
  37966. else {
  37967. r._canvasRenderTarget.clear();
  37968. var c = r.clearColor;
  37969. c[3] > 0 &&
  37970. ((a.globalAlpha = this.useContextAlpha ? c[3] : 1),
  37971. (a.fillStyle = WM(zM(c))),
  37972. a.fillRect(0, 0, r.realWidth, r.realHeight),
  37973. (a.globalAlpha = 1));
  37974. }
  37975. var h = this.context;
  37976. (this.context = a),
  37977. t.renderCanvas(this),
  37978. (this.context = h),
  37979. a.restore(),
  37980. (this.resolution = s),
  37981. (this._projTransform = null),
  37982. this.emit('postrender');
  37983. }
  37984. }),
  37985. (e.prototype.setContextTransform = function (t, e, r) {
  37986. var n = t,
  37987. i = this._projTransform,
  37988. o = this.resolution;
  37989. (r = r || o),
  37990. i && ((n = rU).copyFrom(t), n.prepend(i)),
  37991. e
  37992. ? this.context.setTransform(
  37993. n.a * r,
  37994. n.b * r,
  37995. n.c * r,
  37996. n.d * r,
  37997. (n.tx * o) | 0,
  37998. (n.ty * o) | 0
  37999. )
  38000. : this.context.setTransform(
  38001. n.a * r,
  38002. n.b * r,
  38003. n.c * r,
  38004. n.d * r,
  38005. n.tx * o,
  38006. n.ty * o
  38007. );
  38008. }),
  38009. (e.prototype.clear = function (t, e) {
  38010. void 0 === t && (t = this._backgroundColorString),
  38011. void 0 === e && (e = this.backgroundAlpha);
  38012. var r = this.context;
  38013. r.clearRect(0, 0, this.width, this.height),
  38014. t &&
  38015. ((r.globalAlpha = this.useContextAlpha ? e : 1),
  38016. (r.fillStyle = t),
  38017. r.fillRect(0, 0, this.width, this.height),
  38018. (r.globalAlpha = 1));
  38019. }),
  38020. (e.prototype.setBlendMode = function (t, e) {
  38021. var r =
  38022. t === OP.SRC_IN ||
  38023. t === OP.SRC_OUT ||
  38024. t === OP.DST_IN ||
  38025. t === OP.DST_ATOP;
  38026. !e && r && (t = OP.NORMAL),
  38027. this._activeBlendMode !== t &&
  38028. ((this._activeBlendMode = t),
  38029. (this._outerBlend = r),
  38030. (this.context.globalCompositeOperation = this.blendModes[t]));
  38031. }),
  38032. (e.prototype.destroy = function (e) {
  38033. t.prototype.destroy.call(this, e),
  38034. (this.context = null),
  38035. (this.refresh = !0),
  38036. this.maskManager.destroy(),
  38037. (this.maskManager = null),
  38038. (this.smoothProperty = null);
  38039. }),
  38040. (e.prototype.resize = function (e, r) {
  38041. t.prototype.resize.call(this, e, r),
  38042. this.smoothProperty &&
  38043. (this.rootContext[this.smoothProperty] =
  38044. vA.SCALE_MODE === NP.LINEAR);
  38045. }),
  38046. (e.prototype.invalidateBlendMode = function () {
  38047. this._activeBlendMode = this.blendModes.indexOf(
  38048. this.context.globalCompositeOperation
  38049. );
  38050. }),
  38051. (e.registerPlugin = function (t, e) {
  38052. aD(
  38053. '6.5.0',
  38054. 'CanvasRenderer.registerPlugin() has been deprecated, please use extensions.add() instead.'
  38055. ),
  38056. ZD.add({ name: t, type: HD.CanvasRendererPlugin, ref: e });
  38057. }),
  38058. (e.__plugins = {}),
  38059. e
  38060. );
  38061. })(qF);
  38062. ZD.handleByMap(HD.CanvasRendererPlugin, nU.__plugins);
  38063. var iU = {
  38064. canvas: null,
  38065. getTintedCanvas: function (t, e) {
  38066. var r = t.texture,
  38067. n =
  38068. '#' + ('00000' + (0 | (e = iU.roundColor(e))).toString(16)).slice(-6);
  38069. r.tintCache = r.tintCache || {};
  38070. var i,
  38071. o = r.tintCache[n];
  38072. if (o) {
  38073. if (o.tintId === r._updateID) return r.tintCache[n];
  38074. i = r.tintCache[n];
  38075. } else i = vA.ADAPTER.createCanvas();
  38076. return (
  38077. iU.tintMethod(r, e, i),
  38078. (i.tintId = r._updateID),
  38079. (r.tintCache[n] = i),
  38080. i
  38081. );
  38082. },
  38083. getTintedPattern: function (t, e) {
  38084. var r =
  38085. '#' + ('00000' + (0 | (e = iU.roundColor(e))).toString(16)).slice(-6);
  38086. t.patternCache = t.patternCache || {};
  38087. var n = t.patternCache[r];
  38088. return (
  38089. (n && n.tintId === t._updateID) ||
  38090. (iU.canvas || (iU.canvas = vA.ADAPTER.createCanvas()),
  38091. iU.tintMethod(t, e, iU.canvas),
  38092. ((n = iU.canvas
  38093. .getContext('2d')
  38094. .createPattern(iU.canvas, 'repeat')).tintId = t._updateID),
  38095. (t.patternCache[r] = n)),
  38096. n
  38097. );
  38098. },
  38099. tintWithMultiply: function (t, e, r) {
  38100. var n = r.getContext('2d'),
  38101. i = t._frame.clone(),
  38102. o = t.baseTexture.resolution;
  38103. (i.x *= o),
  38104. (i.y *= o),
  38105. (i.width *= o),
  38106. (i.height *= o),
  38107. (r.width = Math.ceil(i.width)),
  38108. (r.height = Math.ceil(i.height)),
  38109. n.save(),
  38110. (n.fillStyle = '#' + ('00000' + (0 | e).toString(16)).slice(-6)),
  38111. n.fillRect(0, 0, i.width, i.height),
  38112. (n.globalCompositeOperation = 'multiply');
  38113. var s = t.baseTexture.getDrawableSource();
  38114. n.drawImage(s, i.x, i.y, i.width, i.height, 0, 0, i.width, i.height),
  38115. (n.globalCompositeOperation = 'destination-atop'),
  38116. n.drawImage(s, i.x, i.y, i.width, i.height, 0, 0, i.width, i.height),
  38117. n.restore();
  38118. },
  38119. tintWithOverlay: function (t, e, r) {
  38120. var n = r.getContext('2d'),
  38121. i = t._frame.clone(),
  38122. o = t.baseTexture.resolution;
  38123. (i.x *= o),
  38124. (i.y *= o),
  38125. (i.width *= o),
  38126. (i.height *= o),
  38127. (r.width = Math.ceil(i.width)),
  38128. (r.height = Math.ceil(i.height)),
  38129. n.save(),
  38130. (n.globalCompositeOperation = 'copy'),
  38131. (n.fillStyle = '#' + ('00000' + (0 | e).toString(16)).slice(-6)),
  38132. n.fillRect(0, 0, i.width, i.height),
  38133. (n.globalCompositeOperation = 'destination-atop'),
  38134. n.drawImage(
  38135. t.baseTexture.getDrawableSource(),
  38136. i.x,
  38137. i.y,
  38138. i.width,
  38139. i.height,
  38140. 0,
  38141. 0,
  38142. i.width,
  38143. i.height
  38144. ),
  38145. n.restore();
  38146. },
  38147. tintWithPerPixel: function (t, e, r) {
  38148. var n = r.getContext('2d'),
  38149. i = t._frame.clone(),
  38150. o = t.baseTexture.resolution;
  38151. (i.x *= o),
  38152. (i.y *= o),
  38153. (i.width *= o),
  38154. (i.height *= o),
  38155. (r.width = Math.ceil(i.width)),
  38156. (r.height = Math.ceil(i.height)),
  38157. n.save(),
  38158. (n.globalCompositeOperation = 'copy'),
  38159. n.drawImage(
  38160. t.baseTexture.getDrawableSource(),
  38161. i.x,
  38162. i.y,
  38163. i.width,
  38164. i.height,
  38165. 0,
  38166. 0,
  38167. i.width,
  38168. i.height
  38169. ),
  38170. n.restore();
  38171. for (
  38172. var s = HM(e),
  38173. a = s[0],
  38174. u = s[1],
  38175. c = s[2],
  38176. h = n.getImageData(0, 0, i.width, i.height),
  38177. l = h.data,
  38178. d = 0;
  38179. d < l.length;
  38180. d += 4
  38181. )
  38182. (l[d + 0] *= a), (l[d + 1] *= u), (l[d + 2] *= c);
  38183. n.putImageData(h, 0, 0);
  38184. },
  38185. roundColor: function (t) {
  38186. var e = iU.cacheStepsPerColorChannel,
  38187. r = HM(t);
  38188. return (
  38189. (r[0] = Math.min(255, (r[0] / e) * e)),
  38190. (r[1] = Math.min(255, (r[1] / e) * e)),
  38191. (r[2] = Math.min(255, (r[2] / e) * e)),
  38192. zM(r)
  38193. );
  38194. },
  38195. cacheStepsPerColorChannel: 8,
  38196. convertTintToImage: !1,
  38197. canUseMultiply: eU(),
  38198. tintMethod: null,
  38199. };
  38200. iU.tintMethod = iU.canUseMultiply ? iU.tintWithMultiply : iU.tintWithPerPixel;
  38201. var oU = tN.create;
  38202. (tN.create = function (t) {
  38203. if (!(t && t.forceCanvas))
  38204. try {
  38205. return oU(t);
  38206. } catch (t) {}
  38207. return new nU(t);
  38208. }),
  38209. (aL.prototype.getDrawableSource = function () {
  38210. var t = this.resource;
  38211. return t ? t.bitmap || t.source : null;
  38212. }),
  38213. (_L.prototype._canvasRenderTarget = null),
  38214. (EL.prototype.patternCache = null),
  38215. (EL.prototype.tintCache = null);
  38216. var sU = (function () {
  38217. function t(t) {
  38218. this.renderer = t;
  38219. }
  38220. return (
  38221. (t.prototype.render = function (t) {
  38222. var e = this.renderer,
  38223. r = t.worldTransform;
  38224. (e.context.globalAlpha = t.worldAlpha),
  38225. e.setBlendMode(t.blendMode),
  38226. e.setContextTransform(r, t.roundPixels),
  38227. t.drawMode !== IP.TRIANGLES
  38228. ? this._renderTriangleMesh(t)
  38229. : this._renderTriangles(t);
  38230. }),
  38231. (t.prototype._renderTriangleMesh = function (t) {
  38232. for (var e = t.geometry.buffers[0].data.length, r = 0; r < e - 2; r++) {
  38233. var n = 2 * r;
  38234. this._renderDrawTriangle(t, n, n + 2, n + 4);
  38235. }
  38236. }),
  38237. (t.prototype._renderTriangles = function (t) {
  38238. for (
  38239. var e = t.geometry.getIndex().data, r = e.length, n = 0;
  38240. n < r;
  38241. n += 3
  38242. ) {
  38243. var i = 2 * e[n],
  38244. o = 2 * e[n + 1],
  38245. s = 2 * e[n + 2];
  38246. this._renderDrawTriangle(t, i, o, s);
  38247. }
  38248. }),
  38249. (t.prototype._renderDrawTriangle = function (t, e, r, n) {
  38250. var i = this.renderer.context,
  38251. o = t.geometry.buffers[0].data,
  38252. s = t.uvs,
  38253. a = t.texture;
  38254. if (a.valid) {
  38255. var u = 16777215 !== t.tint,
  38256. c = a.baseTexture,
  38257. h = c.width,
  38258. l = c.height;
  38259. u &&
  38260. t._cachedTint !== t.tint &&
  38261. ((t._cachedTint = t.tint),
  38262. (t._cachedTexture = t._cachedTexture || new EL(c)),
  38263. (t._tintedCanvas = iU.getTintedCanvas(
  38264. { texture: t._cachedTexture },
  38265. t.tint
  38266. )));
  38267. var d = u ? t._tintedCanvas : c.getDrawableSource(),
  38268. f = s[e] * c.width,
  38269. p = s[r] * c.width,
  38270. v = s[n] * c.width,
  38271. m = s[e + 1] * c.height,
  38272. y = s[r + 1] * c.height,
  38273. g = s[n + 1] * c.height,
  38274. _ = o[e],
  38275. b = o[r],
  38276. T = o[n],
  38277. x = o[e + 1],
  38278. E = o[r + 1],
  38279. S = o[n + 1],
  38280. w = t.canvasPadding / this.renderer.resolution;
  38281. if (w > 0) {
  38282. var R = t.worldTransform,
  38283. C = R.a,
  38284. P = R.b,
  38285. A = R.c,
  38286. O = R.d,
  38287. I = (_ + b + T) / 3,
  38288. M = (x + E + S) / 3,
  38289. D = _ - I,
  38290. L = x - M,
  38291. F = C * D + A * L,
  38292. N = P * D + O * L,
  38293. k = Math.sqrt(F * F + N * N),
  38294. B = 1 + w / k;
  38295. (_ = I + D * B),
  38296. (x = M + L * B),
  38297. (F = C * (D = b - I) + A * (L = E - M)),
  38298. (N = P * D + O * L),
  38299. (b = I + D * (B = 1 + w / (k = Math.sqrt(F * F + N * N)))),
  38300. (E = M + L * B),
  38301. (F = C * (D = T - I) + A * (L = S - M)),
  38302. (N = P * D + O * L),
  38303. (T = I + D * (B = 1 + w / (k = Math.sqrt(F * F + N * N)))),
  38304. (S = M + L * B);
  38305. }
  38306. i.save(),
  38307. i.beginPath(),
  38308. i.moveTo(_, x),
  38309. i.lineTo(b, E),
  38310. i.lineTo(T, S),
  38311. i.closePath(),
  38312. i.clip();
  38313. var G = f * y + m * v + p * g - y * v - m * p - f * g,
  38314. U = _ * y + m * T + b * g - y * T - m * b - _ * g,
  38315. j = f * b + _ * v + p * T - b * v - _ * p - f * T,
  38316. X =
  38317. f * y * T +
  38318. m * b * v +
  38319. _ * p * g -
  38320. _ * y * v -
  38321. m * p * T -
  38322. f * b * g,
  38323. V = x * y + m * S + E * g - y * S - m * E - x * g,
  38324. H = f * E + x * v + p * S - E * v - x * p - f * S,
  38325. W =
  38326. f * y * S +
  38327. m * E * v +
  38328. x * p * g -
  38329. x * y * v -
  38330. m * p * S -
  38331. f * E * g;
  38332. i.transform(U / G, V / G, j / G, H / G, X / G, W / G),
  38333. i.drawImage(
  38334. d,
  38335. 0,
  38336. 0,
  38337. h * c.resolution,
  38338. l * c.resolution,
  38339. 0,
  38340. 0,
  38341. h,
  38342. l
  38343. ),
  38344. i.restore(),
  38345. this.renderer.invalidateBlendMode();
  38346. }
  38347. }),
  38348. (t.prototype.renderMeshFlat = function (t) {
  38349. var e = this.renderer.context,
  38350. r = t.geometry.getBuffer('aVertexPosition').data,
  38351. n = r.length / 2;
  38352. e.beginPath();
  38353. for (var i = 1; i < n - 2; ++i) {
  38354. var o = 2 * i,
  38355. s = r[o],
  38356. a = r[o + 1],
  38357. u = r[o + 2],
  38358. c = r[o + 3],
  38359. h = r[o + 4],
  38360. l = r[o + 5];
  38361. e.moveTo(s, a), e.lineTo(u, c), e.lineTo(h, l);
  38362. }
  38363. (e.fillStyle = '#FF0000'), e.fill(), e.closePath();
  38364. }),
  38365. (t.prototype.destroy = function () {
  38366. this.renderer = null;
  38367. }),
  38368. (t.extension = { name: 'mesh', type: HD.CanvasRendererPlugin }),
  38369. t
  38370. );
  38371. })();
  38372. (vA.MESH_CANVAS_PADDING = 0),
  38373. (lG.prototype._renderCanvas = function (t, e) {
  38374. t.plugins.mesh.render(e);
  38375. }),
  38376. (KG.prototype._cachedTint = 16777215),
  38377. (KG.prototype._tintedCanvas = null),
  38378. (KG.prototype._canvasUvs = null),
  38379. (KG.prototype._renderCanvas = function (t) {
  38380. var e = t.context,
  38381. r = this.worldTransform,
  38382. n = 16777215 !== this.tint,
  38383. i = this.texture;
  38384. if (i.valid) {
  38385. n &&
  38386. this._cachedTint !== this.tint &&
  38387. ((this._cachedTint = this.tint),
  38388. (this._tintedCanvas = iU.getTintedCanvas(this, this.tint)));
  38389. var o = n ? this._tintedCanvas : i.baseTexture.getDrawableSource();
  38390. this._canvasUvs || (this._canvasUvs = [0, 0, 0, 0, 0, 0, 0, 0]);
  38391. var s = this.vertices,
  38392. a = this._canvasUvs,
  38393. u = n ? 0 : i.frame.x,
  38394. c = n ? 0 : i.frame.y,
  38395. h = u + i.frame.width,
  38396. l = c + i.frame.height;
  38397. (a[0] = u),
  38398. (a[1] = u + this._leftWidth),
  38399. (a[2] = h - this._rightWidth),
  38400. (a[3] = h),
  38401. (a[4] = c),
  38402. (a[5] = c + this._topHeight),
  38403. (a[6] = l - this._bottomHeight),
  38404. (a[7] = l);
  38405. for (var d = 0; d < 8; d++) a[d] *= i.baseTexture.resolution;
  38406. (e.globalAlpha = this.worldAlpha),
  38407. t.setBlendMode(this.blendMode),
  38408. t.setContextTransform(r, this.roundPixels);
  38409. for (var f = 0; f < 3; f++)
  38410. for (var p = 0; p < 3; p++) {
  38411. var v = 2 * p + 8 * f,
  38412. m = Math.max(1, a[p + 1] - a[p]),
  38413. y = Math.max(1, a[f + 5] - a[f + 4]),
  38414. g = Math.max(1, s[v + 10] - s[v]),
  38415. _ = Math.max(1, s[v + 11] - s[v + 1]);
  38416. e.drawImage(o, a[p], a[f + 4], m, y, s[v], s[v + 1], g, _);
  38417. }
  38418. }
  38419. });
  38420. var aU = !1;
  38421. (hG.prototype._cachedTint = 16777215),
  38422. (hG.prototype._tintedCanvas = null),
  38423. (hG.prototype._cachedTexture = null),
  38424. (hG.prototype._renderCanvas = function (t) {
  38425. this.shader.uvMatrix &&
  38426. (this.shader.uvMatrix.update(), this.calculateUvs()),
  38427. this.material._renderCanvas
  38428. ? this.material._renderCanvas(t, this)
  38429. : aU ||
  38430. ((aU = !0),
  38431. globalThis.console &&
  38432. console.warn(
  38433. 'Mesh with custom shaders are not supported in CanvasRenderer.'
  38434. ));
  38435. }),
  38436. (hG.prototype._canvasPadding = null),
  38437. Object.defineProperty(hG.prototype, 'canvasPadding', {
  38438. get: function () {
  38439. return null !== this._canvasPadding
  38440. ? this._canvasPadding
  38441. : vA.MESH_CANVAS_PADDING;
  38442. },
  38443. set: function (t) {
  38444. this._canvasPadding = t;
  38445. },
  38446. }),
  38447. (JG.prototype._renderCanvas = function (t) {
  38448. this.autoUpdate && this.geometry.getBuffer('aVertexPosition').update(),
  38449. this.shader.update && this.shader.update(),
  38450. this.calculateUvs(),
  38451. this.material._renderCanvas(t, this);
  38452. }),
  38453. (zG.prototype._renderCanvas = function (t) {
  38454. (this.autoUpdate ||
  38455. this.geometry._width !== this.shader.texture.height) &&
  38456. ((this.geometry._width = this.shader.texture.height),
  38457. this.geometry.update()),
  38458. this.shader.update && this.shader.update(),
  38459. this.calculateUvs(),
  38460. this.material._renderCanvas(t, this);
  38461. });
  38462. var uU,
  38463. cU = (function () {
  38464. function t() {}
  38465. return (
  38466. (t.offsetPolygon = function (e, r) {
  38467. var n = [],
  38468. i = e.length;
  38469. r = t.isPolygonClockwise(e) ? r : -1 * r;
  38470. for (var o = 0; o < i; o += 2) {
  38471. var s = o - 2;
  38472. s < 0 && (s += i);
  38473. var a = (o + 2) % i,
  38474. u = e[o] - e[s],
  38475. c = e[o + 1] - e[s + 1],
  38476. h = Math.sqrt(u * u + c * c);
  38477. (u /= h), (c /= h);
  38478. var l = -(c *= r),
  38479. d = (u *= r),
  38480. f = [e[s] + l, e[s + 1] + d],
  38481. p = [e[o] + l, e[o + 1] + d],
  38482. v = e[a] - e[o],
  38483. m = e[a + 1] - e[o + 1];
  38484. (v /= h = Math.sqrt(v * v + m * m)), (m /= h);
  38485. var y = -(m *= r),
  38486. g = (v *= r),
  38487. _ = [e[o] + y, e[o + 1] + g],
  38488. b = [e[a] + y, e[a + 1] + g],
  38489. T = t.findIntersection(
  38490. f[0],
  38491. f[1],
  38492. p[0],
  38493. p[1],
  38494. _[0],
  38495. _[1],
  38496. b[0],
  38497. b[1]
  38498. );
  38499. T && n.push.apply(n, T);
  38500. }
  38501. return n;
  38502. }),
  38503. (t.findIntersection = function (t, e, r, n, i, o, s, a) {
  38504. var u = (a - o) * (r - t) - (s - i) * (n - e),
  38505. c = (s - i) * (e - o) - (a - o) * (t - i);
  38506. if (0 === u)
  38507. return 0 === c && 0 === (r - t) * (e - o) - (n - e) * (t - i)
  38508. ? [(t + r) / 2, (e + n) / 2]
  38509. : null;
  38510. var h = c / u;
  38511. return [t + h * (r - t), e + h * (n - e)];
  38512. }),
  38513. (t.isPolygonClockwise = function (t) {
  38514. for (var e = 0, r = 0, n = t.length - 2; r < t.length; n = r, r += 2)
  38515. e += (t[r] - t[n]) * (t[r + 1] + t[n + 1]);
  38516. return e > 0;
  38517. }),
  38518. t
  38519. );
  38520. })(),
  38521. hU = (function () {
  38522. function t(t) {
  38523. (this._svgMatrix = null),
  38524. (this._tempMatrix = new CD()),
  38525. (this.renderer = t);
  38526. }
  38527. return (
  38528. (t.prototype._calcCanvasStyle = function (t, e) {
  38529. var r;
  38530. return (
  38531. t.texture && t.texture.baseTexture !== EL.WHITE.baseTexture
  38532. ? t.texture.valid
  38533. ? ((r = iU.getTintedPattern(t.texture, e)),
  38534. this.setPatternTransform(r, t.matrix || CD.IDENTITY))
  38535. : (r = '#808080')
  38536. : (r = '#' + ('00000' + (0 | e).toString(16)).slice(-6)),
  38537. r
  38538. );
  38539. }),
  38540. (t.prototype.render = function (t) {
  38541. var e = this.renderer,
  38542. r = e.context,
  38543. n = t.worldAlpha,
  38544. i = t.transform.worldTransform;
  38545. e.setContextTransform(i), e.setBlendMode(t.blendMode);
  38546. for (
  38547. var o,
  38548. s,
  38549. a = t.geometry.graphicsData,
  38550. u = ((t.tint >> 16) & 255) / 255,
  38551. c = ((t.tint >> 8) & 255) / 255,
  38552. h = (255 & t.tint) / 255,
  38553. l = 0;
  38554. l < a.length;
  38555. l++
  38556. ) {
  38557. var d = a[l],
  38558. f = d.shape,
  38559. p = d.fillStyle,
  38560. v = d.lineStyle,
  38561. m = 0 | d.fillStyle.color,
  38562. y = 0 | d.lineStyle.color;
  38563. if (
  38564. (d.matrix &&
  38565. e.setContextTransform(
  38566. i.copyTo(this._tempMatrix).append(d.matrix)
  38567. ),
  38568. p.visible)
  38569. ) {
  38570. var g =
  38571. (((((m >> 16) & 255) / 255) * u * 255) << 16) +
  38572. (((((m >> 8) & 255) / 255) * c * 255) << 8) +
  38573. ((255 & m) / 255) * h * 255;
  38574. o = this._calcCanvasStyle(p, g);
  38575. }
  38576. if (v.visible) {
  38577. var _ =
  38578. (((((y >> 16) & 255) / 255) * u * 255) << 16) +
  38579. (((((y >> 8) & 255) / 255) * c * 255) << 8) +
  38580. ((255 & y) / 255) * h * 255;
  38581. s = this._calcCanvasStyle(v, _);
  38582. }
  38583. if (
  38584. ((r.lineWidth = v.width),
  38585. (r.lineCap = v.cap),
  38586. (r.lineJoin = v.join),
  38587. (r.miterLimit = v.miterLimit),
  38588. d.type === vD.POLY)
  38589. ) {
  38590. r.beginPath();
  38591. var b = (A = f).points,
  38592. T = d.holes,
  38593. x = void 0,
  38594. E = void 0,
  38595. S = void 0,
  38596. w = void 0,
  38597. R = void 0;
  38598. r.moveTo(b[0], b[1]);
  38599. for (var C = 2; C < b.length; C += 2) r.lineTo(b[C], b[C + 1]);
  38600. if ((A.closeStroke && r.closePath(), T.length > 0)) {
  38601. (R = []), (x = 0), (S = b[0]), (w = b[1]);
  38602. for (C = 2; C + 2 < b.length; C += 2)
  38603. x +=
  38604. (b[C] - S) * (b[C + 3] - w) -
  38605. (b[C + 2] - S) * (b[C + 1] - w);
  38606. for (var P = 0; P < T.length; P++)
  38607. if ((b = T[P].shape.points)) {
  38608. (E = 0), (S = b[0]), (w = b[1]);
  38609. for (C = 2; C + 2 < b.length; C += 2)
  38610. E +=
  38611. (b[C] - S) * (b[C + 3] - w) -
  38612. (b[C + 2] - S) * (b[C + 1] - w);
  38613. if (E * x < 0) {
  38614. r.moveTo(b[0], b[1]);
  38615. for (C = 2; C < b.length; C += 2)
  38616. r.lineTo(b[C], b[C + 1]);
  38617. } else {
  38618. r.moveTo(b[b.length - 2], b[b.length - 1]);
  38619. for (C = b.length - 4; C >= 0; C -= 2)
  38620. r.lineTo(b[C], b[C + 1]);
  38621. }
  38622. T[P].shape.closeStroke && r.closePath(), (R[P] = E * x < 0);
  38623. }
  38624. }
  38625. p.visible &&
  38626. ((r.globalAlpha = p.alpha * n), (r.fillStyle = o), r.fill()),
  38627. v.visible && this.paintPolygonStroke(A, v, s, T, R, n, r);
  38628. } else if (d.type === vD.RECT) {
  38629. var A = f;
  38630. if (
  38631. (p.visible &&
  38632. ((r.globalAlpha = p.alpha * n),
  38633. (r.fillStyle = o),
  38634. r.fillRect(A.x, A.y, A.width, A.height)),
  38635. v.visible)
  38636. ) {
  38637. var O = v.width * (0.5 - (1 - v.alignment)),
  38638. I = A.width + 2 * O,
  38639. M = A.height + 2 * O;
  38640. (r.globalAlpha = v.alpha * n),
  38641. (r.strokeStyle = s),
  38642. r.strokeRect(A.x - O, A.y - O, I, M);
  38643. }
  38644. } else if (d.type === vD.CIRC) {
  38645. A = f;
  38646. if (
  38647. (r.beginPath(),
  38648. r.arc(A.x, A.y, A.radius, 0, 2 * Math.PI),
  38649. r.closePath(),
  38650. p.visible &&
  38651. ((r.globalAlpha = p.alpha * n), (r.fillStyle = o), r.fill()),
  38652. v.visible)
  38653. ) {
  38654. if (0.5 !== v.alignment) {
  38655. O = v.width * (0.5 - (1 - v.alignment));
  38656. r.beginPath(),
  38657. r.arc(A.x, A.y, A.radius + O, 0, 2 * Math.PI),
  38658. r.closePath();
  38659. }
  38660. (r.globalAlpha = v.alpha * n), (r.strokeStyle = s), r.stroke();
  38661. }
  38662. } else if (d.type === vD.ELIP) {
  38663. A = f;
  38664. if (
  38665. ((H = 1 === v.alignment) || this.paintEllipse(A, p, v, o, n, r),
  38666. v.visible)
  38667. ) {
  38668. if (0.5 !== v.alignment) {
  38669. var D = 0.5522848,
  38670. L =
  38671. ((O = v.width * (0.5 - (1 - v.alignment))),
  38672. 2 * (A.width + O)),
  38673. F = 2 * (A.height + O),
  38674. N = A.x - L / 2,
  38675. k = A.y - F / 2,
  38676. B = (L / 2) * D,
  38677. G = (F / 2) * D,
  38678. U = N + L,
  38679. j = k + F,
  38680. X = N + L / 2,
  38681. V = k + F / 2;
  38682. r.beginPath(),
  38683. r.moveTo(N, V),
  38684. r.bezierCurveTo(N, V - G, X - B, k, X, k),
  38685. r.bezierCurveTo(X + B, k, U, V - G, U, V),
  38686. r.bezierCurveTo(U, V + G, X + B, j, X, j),
  38687. r.bezierCurveTo(X - B, j, N, V + G, N, V),
  38688. r.closePath();
  38689. }
  38690. (r.globalAlpha = v.alpha * n), (r.strokeStyle = s), r.stroke();
  38691. }
  38692. H && this.paintEllipse(A, p, v, o, n, r);
  38693. } else if (d.type === vD.RREC) {
  38694. var H;
  38695. A = f;
  38696. if (
  38697. ((H = 1 === v.alignment) ||
  38698. this.paintRoundedRectangle(A, p, v, o, n, r),
  38699. v.visible)
  38700. ) {
  38701. if (0.5 !== v.alignment) {
  38702. (I = A.width),
  38703. (M = A.height),
  38704. (O = v.width * (0.5 - (1 - v.alignment)));
  38705. var W = A.x - O,
  38706. Y = A.y - O,
  38707. z = A.width + 2 * O,
  38708. Z = A.height + 2 * O,
  38709. J =
  38710. O *
  38711. (v.alignment >= 1
  38712. ? Math.min(z / I, Z / M)
  38713. : Math.min(I / z, M / Z)),
  38714. K = A.radius + J,
  38715. q = Math.min(z, Z) / 2;
  38716. (K = K > q ? q : K),
  38717. r.beginPath(),
  38718. r.moveTo(W, Y + K),
  38719. r.lineTo(W, Y + Z - K),
  38720. r.quadraticCurveTo(W, Y + Z, W + K, Y + Z),
  38721. r.lineTo(W + z - K, Y + Z),
  38722. r.quadraticCurveTo(W + z, Y + Z, W + z, Y + Z - K),
  38723. r.lineTo(W + z, Y + K),
  38724. r.quadraticCurveTo(W + z, Y, W + z - K, Y),
  38725. r.lineTo(W + K, Y),
  38726. r.quadraticCurveTo(W, Y, W, Y + K),
  38727. r.closePath();
  38728. }
  38729. (r.globalAlpha = v.alpha * n), (r.strokeStyle = s), r.stroke();
  38730. }
  38731. H && this.paintRoundedRectangle(A, p, v, o, n, r);
  38732. }
  38733. }
  38734. }),
  38735. (t.prototype.paintPolygonStroke = function (t, e, r, n, i, o, s) {
  38736. if (0.5 !== e.alignment) {
  38737. var a = e.width * (0.5 - (1 - e.alignment)),
  38738. u = cU.offsetPolygon(t.points, a),
  38739. c = void 0;
  38740. s.beginPath(), s.moveTo(u[0], u[1]);
  38741. for (var h = 2; h < u.length; h += 2) s.lineTo(u[h], u[h + 1]);
  38742. t.closeStroke && s.closePath();
  38743. for (var l = 0; l < n.length; l++) {
  38744. if (
  38745. ((c = n[l].shape.points), (u = cU.offsetPolygon(c, a)), i[l])
  38746. ) {
  38747. s.moveTo(u[0], u[1]);
  38748. for (h = 2; h < u.length; h += 2) s.lineTo(u[h], u[h + 1]);
  38749. } else {
  38750. s.moveTo(u[u.length - 2], u[u.length - 1]);
  38751. for (h = u.length - 4; h >= 0; h -= 2) s.lineTo(u[h], u[h + 1]);
  38752. }
  38753. n[l].shape.closeStroke && s.closePath();
  38754. }
  38755. }
  38756. (s.globalAlpha = e.alpha * o), (s.strokeStyle = r), s.stroke();
  38757. }),
  38758. (t.prototype.paintEllipse = function (t, e, r, n, i, o) {
  38759. var s = 2 * t.width,
  38760. a = 2 * t.height,
  38761. u = t.x - s / 2,
  38762. c = t.y - a / 2,
  38763. h = 0.5522848,
  38764. l = (s / 2) * h,
  38765. d = (a / 2) * h,
  38766. f = u + s,
  38767. p = c + a,
  38768. v = u + s / 2,
  38769. m = c + a / 2;
  38770. 0 === r.alignment && o.save(),
  38771. o.beginPath(),
  38772. o.moveTo(u, m),
  38773. o.bezierCurveTo(u, m - d, v - l, c, v, c),
  38774. o.bezierCurveTo(v + l, c, f, m - d, f, m),
  38775. o.bezierCurveTo(f, m + d, v + l, p, v, p),
  38776. o.bezierCurveTo(v - l, p, u, m + d, u, m),
  38777. o.closePath(),
  38778. 0 === r.alignment && o.clip(),
  38779. e.visible &&
  38780. ((o.globalAlpha = e.alpha * i), (o.fillStyle = n), o.fill()),
  38781. 0 === r.alignment && o.restore();
  38782. }),
  38783. (t.prototype.paintRoundedRectangle = function (t, e, r, n, i, o) {
  38784. var s = t.x,
  38785. a = t.y,
  38786. u = t.width,
  38787. c = t.height,
  38788. h = t.radius,
  38789. l = Math.min(u, c) / 2;
  38790. (h = h > l ? l : h),
  38791. 0 === r.alignment && o.save(),
  38792. o.beginPath(),
  38793. o.moveTo(s, a + h),
  38794. o.lineTo(s, a + c - h),
  38795. o.quadraticCurveTo(s, a + c, s + h, a + c),
  38796. o.lineTo(s + u - h, a + c),
  38797. o.quadraticCurveTo(s + u, a + c, s + u, a + c - h),
  38798. o.lineTo(s + u, a + h),
  38799. o.quadraticCurveTo(s + u, a, s + u - h, a),
  38800. o.lineTo(s + h, a),
  38801. o.quadraticCurveTo(s, a, s, a + h),
  38802. o.closePath(),
  38803. 0 === r.alignment && o.clip(),
  38804. e.visible &&
  38805. ((o.globalAlpha = e.alpha * i), (o.fillStyle = n), o.fill()),
  38806. 0 === r.alignment && o.restore();
  38807. }),
  38808. (t.prototype.setPatternTransform = function (t, e) {
  38809. if (!1 !== this._svgMatrix) {
  38810. if (!this._svgMatrix) {
  38811. var r = document.createElementNS(
  38812. 'http://www.w3.org/2000/svg',
  38813. 'svg'
  38814. );
  38815. if (
  38816. (r &&
  38817. r.createSVGMatrix &&
  38818. (this._svgMatrix = r.createSVGMatrix()),
  38819. !this._svgMatrix || !t.setTransform)
  38820. )
  38821. return void (this._svgMatrix = !1);
  38822. }
  38823. (this._svgMatrix.a = e.a),
  38824. (this._svgMatrix.b = e.b),
  38825. (this._svgMatrix.c = e.c),
  38826. (this._svgMatrix.d = e.d),
  38827. (this._svgMatrix.e = e.tx),
  38828. (this._svgMatrix.f = e.ty),
  38829. t.setTransform(this._svgMatrix.inverse());
  38830. }
  38831. }),
  38832. (t.prototype.destroy = function () {
  38833. (this.renderer = null),
  38834. (this._svgMatrix = null),
  38835. (this._tempMatrix = null);
  38836. }),
  38837. (t.extension = { name: 'graphics', type: HD.CanvasRendererPlugin }),
  38838. t
  38839. );
  38840. })(),
  38841. lU = new CD();
  38842. (_B.prototype.generateCanvasTexture = function (t, e) {
  38843. void 0 === e && (e = 1);
  38844. var r = this.getLocalBounds(),
  38845. n = SL.create({
  38846. width: r.width,
  38847. height: r.height,
  38848. scaleMode: t,
  38849. resolution: e,
  38850. });
  38851. uU || (uU = new nU()),
  38852. this.transform.updateLocalTransform(),
  38853. this.transform.localTransform.copyTo(lU),
  38854. lU.invert(),
  38855. (lU.tx -= r.x),
  38856. (lU.ty -= r.y),
  38857. uU.render(this, { renderTexture: n, clear: !0, transform: lU });
  38858. var i = EL.from(n.baseTexture._canvasRenderTarget.canvas, { scaleMode: t });
  38859. return i.baseTexture.setResolution(e), i;
  38860. }),
  38861. (_B.prototype.cachedGraphicsData = []),
  38862. (_B.prototype._renderCanvas = function (t) {
  38863. !0 !== this.isMask &&
  38864. (this.finishPoly(), t.plugins.graphics.render(this));
  38865. });
  38866. var dU = new CD(),
  38867. fU = (function () {
  38868. function t(t) {
  38869. this.renderer = t;
  38870. }
  38871. return (
  38872. (t.prototype.render = function (t) {
  38873. var e = t._texture,
  38874. r = this.renderer,
  38875. n = r.context;
  38876. if (e.valid) {
  38877. var i = e._frame.width,
  38878. o = e._frame.height,
  38879. s = e._frame.width,
  38880. a = e._frame.height;
  38881. e.trim &&
  38882. (FD.isVertical(e.rotate)
  38883. ? ((s = e.trim.height), (a = e.trim.width))
  38884. : ((s = e.trim.width), (a = e.trim.height)));
  38885. var u = t.transform.worldTransform,
  38886. c = 0,
  38887. h = 0,
  38888. l = e.baseTexture.getDrawableSource();
  38889. if (!(e.orig.width <= 0 || e.orig.height <= 0) && e.valid && l) {
  38890. r.setBlendMode(t.blendMode, !0),
  38891. (r.context.globalAlpha = t.worldAlpha);
  38892. var d = e.baseTexture.scaleMode === NP.LINEAR;
  38893. r.smoothProperty &&
  38894. r.context[r.smoothProperty] !== d &&
  38895. (n[r.smoothProperty] = d),
  38896. e.trim
  38897. ? ((c =
  38898. e.trim.width / 2 + e.trim.x - t.anchor.x * e.orig.width),
  38899. (h =
  38900. e.trim.height / 2 +
  38901. e.trim.y -
  38902. t.anchor.y * e.orig.height))
  38903. : ((c = (0.5 - t.anchor.x) * e.orig.width),
  38904. (h = (0.5 - t.anchor.y) * e.orig.height)),
  38905. e.rotate &&
  38906. (u.copyTo(dU),
  38907. (u = dU),
  38908. FD.matrixAppendRotationInv(u, e.rotate, c, h),
  38909. (c = 0),
  38910. (h = 0)),
  38911. (c -= s / 2),
  38912. (h -= a / 2),
  38913. r.setContextTransform(u, t.roundPixels, 1),
  38914. t.roundPixels && ((c |= 0), (h |= 0));
  38915. var f = e.baseTexture.resolution,
  38916. p = r._outerBlend;
  38917. p &&
  38918. (n.save(),
  38919. n.beginPath(),
  38920. n.rect(
  38921. c * r.resolution,
  38922. h * r.resolution,
  38923. s * r.resolution,
  38924. a * r.resolution
  38925. ),
  38926. n.clip()),
  38927. 16777215 !== t.tint
  38928. ? ((t._cachedTint === t.tint &&
  38929. t._tintedCanvas.tintId === t._texture._updateID) ||
  38930. ((t._cachedTint = t.tint),
  38931. (t._tintedCanvas = iU.getTintedCanvas(t, t.tint))),
  38932. n.drawImage(
  38933. t._tintedCanvas,
  38934. 0,
  38935. 0,
  38936. Math.floor(i * f),
  38937. Math.floor(o * f),
  38938. Math.floor(c * r.resolution),
  38939. Math.floor(h * r.resolution),
  38940. Math.floor(s * r.resolution),
  38941. Math.floor(a * r.resolution)
  38942. ))
  38943. : n.drawImage(
  38944. l,
  38945. e._frame.x * f,
  38946. e._frame.y * f,
  38947. Math.floor(i * f),
  38948. Math.floor(o * f),
  38949. Math.floor(c * r.resolution),
  38950. Math.floor(h * r.resolution),
  38951. Math.floor(s * r.resolution),
  38952. Math.floor(a * r.resolution)
  38953. ),
  38954. p && n.restore(),
  38955. r.setBlendMode(OP.NORMAL);
  38956. }
  38957. }
  38958. }),
  38959. (t.prototype.destroy = function () {
  38960. this.renderer = null;
  38961. }),
  38962. (t.extension = { name: 'sprite', type: HD.CanvasRendererPlugin }),
  38963. t
  38964. );
  38965. })();
  38966. (SB.prototype._tintedCanvas = null),
  38967. (SB.prototype._renderCanvas = function (t) {
  38968. t.plugins.sprite.render(this);
  38969. });
  38970. var pU = new TD(),
  38971. vU = (function () {
  38972. function t(t) {
  38973. this.renderer = t;
  38974. }
  38975. return (
  38976. (t.prototype.image = function (t, e, r) {
  38977. var n = new Image();
  38978. return (n.src = this.base64(t, e, r)), n;
  38979. }),
  38980. (t.prototype.base64 = function (t, e, r) {
  38981. return this.canvas(t).toDataURL(e, r);
  38982. }),
  38983. (t.prototype.canvas = function (t, e) {
  38984. var r,
  38985. n,
  38986. i,
  38987. o = this.renderer;
  38988. t && (i = t instanceof SL ? t : o.generateTexture(t)),
  38989. i
  38990. ? ((r = i.baseTexture._canvasRenderTarget.context),
  38991. (n = i.baseTexture._canvasRenderTarget.resolution),
  38992. (e = null != e ? e : i.frame))
  38993. : ((r = o.rootContext),
  38994. (n = o.resolution),
  38995. e || (((e = pU).width = o.width), (e.height = o.height)));
  38996. var s = Math.round(e.x * n),
  38997. a = Math.round(e.y * n),
  38998. u = Math.round(e.width * n),
  38999. c = Math.round(e.height * n),
  39000. h = new dD(u, c, 1),
  39001. l = r.getImageData(s, a, u, c);
  39002. return h.context.putImageData(l, 0, 0), h.canvas;
  39003. }),
  39004. (t.prototype.pixels = function (t, e) {
  39005. var r,
  39006. n,
  39007. i,
  39008. o = this.renderer;
  39009. t && (i = t instanceof SL ? t : o.generateTexture(t)),
  39010. i
  39011. ? ((r = i.baseTexture._canvasRenderTarget.context),
  39012. (n = i.baseTexture._canvasRenderTarget.resolution),
  39013. (e = null != e ? e : i.frame))
  39014. : ((r = o.rootContext),
  39015. (n = o.resolution),
  39016. e || (((e = pU).width = o.width), (e.height = o.height)));
  39017. var s = Math.round(e.x * n),
  39018. a = Math.round(e.y * n),
  39019. u = Math.round(e.width * n),
  39020. c = Math.round(e.height * n);
  39021. return r.getImageData(s, a, u, c).data;
  39022. }),
  39023. (t.prototype.destroy = function () {
  39024. this.renderer = null;
  39025. }),
  39026. (t.extension = { name: 'extract', type: HD.CanvasRendererPlugin }),
  39027. t
  39028. );
  39029. })(),
  39030. mU = function (t, e) {
  39031. return (
  39032. (mU =
  39033. Object.setPrototypeOf ||
  39034. ({ __proto__: [] } instanceof Array &&
  39035. function (t, e) {
  39036. t.__proto__ = e;
  39037. }) ||
  39038. function (t, e) {
  39039. for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
  39040. }),
  39041. mU(t, e)
  39042. );
  39043. };
  39044. function yU(t, e) {
  39045. var r = t;
  39046. if (e instanceof aL) {
  39047. var n = e.source,
  39048. i = 0 === n.width ? r.canvas.width : Math.min(r.canvas.width, n.width),
  39049. o =
  39050. 0 === n.height
  39051. ? r.canvas.height
  39052. : Math.min(r.canvas.height, n.height);
  39053. return (
  39054. r.ctx.drawImage(n, 0, 0, i, o, 0, 0, r.canvas.width, r.canvas.height),
  39055. !0
  39056. );
  39057. }
  39058. return !1;
  39059. }
  39060. var gU = (function (t) {
  39061. function e(e) {
  39062. var r = t.call(this, e) || this;
  39063. return (
  39064. (r.uploadHookHelper = r),
  39065. (r.canvas = vA.ADAPTER.createCanvas(16, 16)),
  39066. (r.ctx = r.canvas.getContext('2d')),
  39067. r.registerUploadHook(yU),
  39068. r
  39069. );
  39070. }
  39071. return (
  39072. (function (t, e) {
  39073. function r() {
  39074. this.constructor = t;
  39075. }
  39076. mU(t, e),
  39077. (t.prototype =
  39078. null === e
  39079. ? Object.create(e)
  39080. : ((r.prototype = e.prototype), new r()));
  39081. })(e, t),
  39082. (e.prototype.destroy = function () {
  39083. t.prototype.destroy.call(this),
  39084. (this.ctx = null),
  39085. (this.canvas = null);
  39086. }),
  39087. (e.extension = { name: 'prepare', type: HD.CanvasRendererPlugin }),
  39088. e
  39089. );
  39090. })(WB),
  39091. _U = new CD(),
  39092. bU = new CD(),
  39093. TU = [new _D(), new _D(), new _D(), new _D()];
  39094. (eG.prototype._renderCanvas = function (t) {
  39095. var e = this._texture;
  39096. if (e.baseTexture.valid) {
  39097. var r = t.context,
  39098. n = this.worldTransform,
  39099. i = e.baseTexture,
  39100. o = i.getDrawableSource(),
  39101. s = i.resolution;
  39102. if (
  39103. this._textureID !== this._texture._updateID ||
  39104. this._cachedTint !== this.tint
  39105. ) {
  39106. this._textureID = this._texture._updateID;
  39107. var a = new dD(e._frame.width, e._frame.height, s);
  39108. 16777215 !== this.tint
  39109. ? ((this._tintedCanvas = iU.getTintedCanvas(this, this.tint)),
  39110. a.context.drawImage(this._tintedCanvas, 0, 0))
  39111. : a.context.drawImage(o, -e._frame.x * s, -e._frame.y * s),
  39112. (this._cachedTint = this.tint),
  39113. (this._canvasPattern = a.context.createPattern(a.canvas, 'repeat'));
  39114. }
  39115. (r.globalAlpha = this.worldAlpha),
  39116. t.setBlendMode(this.blendMode),
  39117. this.tileTransform.updateLocalTransform();
  39118. var u = this.tileTransform.localTransform,
  39119. c = this._width,
  39120. h = this._height;
  39121. _U.identity(),
  39122. bU.copyFrom(u),
  39123. this.uvRespectAnchor ||
  39124. bU.translate(-this.anchor.x * c, -this.anchor.y * h),
  39125. bU.scale(this.tileScale.x / s, this.tileScale.y / s),
  39126. _U.prepend(bU),
  39127. _U.prepend(n),
  39128. t.setContextTransform(_U),
  39129. (r.fillStyle = this._canvasPattern);
  39130. var l = this.anchor.x * -c,
  39131. d = this.anchor.y * -h;
  39132. TU[0].set(l, d),
  39133. TU[1].set(l + c, d),
  39134. TU[2].set(l + c, d + h),
  39135. TU[3].set(l, d + h);
  39136. for (var f = 0; f < 4; f++) bU.applyInverse(TU[f], TU[f]);
  39137. r.beginPath(), r.moveTo(TU[0].x, TU[0].y);
  39138. for (f = 1; f < 4; f++) r.lineTo(TU[f].x, TU[f].y);
  39139. r.closePath(), r.fill();
  39140. }
  39141. }),
  39142. (Vk.prototype.renderCanvas = function (t) {
  39143. if (
  39144. this.visible &&
  39145. !(this.worldAlpha <= 0) &&
  39146. this.children.length &&
  39147. this.renderable
  39148. ) {
  39149. var e = t.context,
  39150. r = this.worldTransform,
  39151. n = !0,
  39152. i = 0,
  39153. o = 0,
  39154. s = 0,
  39155. a = 0;
  39156. t.setBlendMode(this.blendMode),
  39157. (e.globalAlpha = this.worldAlpha),
  39158. this.displayObjectUpdateTransform();
  39159. for (var u = 0; u < this.children.length; ++u) {
  39160. var c = this.children[u];
  39161. if (c.visible && c._texture.valid) {
  39162. var h = c._texture.frame;
  39163. if (
  39164. ((e.globalAlpha = this.worldAlpha * c.alpha),
  39165. c.rotation % (2 * Math.PI) == 0)
  39166. )
  39167. n && (t.setContextTransform(r, !1, 1), (n = !1)),
  39168. (i = c.anchor.x * (-h.width * c.scale.x) + c.position.x + 0.5),
  39169. (o = c.anchor.y * (-h.height * c.scale.y) + c.position.y + 0.5),
  39170. (s = h.width * c.scale.x),
  39171. (a = h.height * c.scale.y);
  39172. else {
  39173. n || (n = !0), c.displayObjectUpdateTransform();
  39174. var l = c.worldTransform;
  39175. t.setContextTransform(l, this.roundPixels, 1),
  39176. (i = c.anchor.x * -h.width + 0.5),
  39177. (o = c.anchor.y * -h.height + 0.5),
  39178. (s = h.width),
  39179. (a = h.height);
  39180. }
  39181. var d = c._texture.baseTexture.resolution;
  39182. e.drawImage(
  39183. c._texture.baseTexture.getDrawableSource(),
  39184. h.x * d,
  39185. h.y * d,
  39186. h.width * d,
  39187. h.height * d,
  39188. i * t.resolution,
  39189. o * t.resolution,
  39190. s * t.resolution,
  39191. a * t.resolution
  39192. );
  39193. }
  39194. }
  39195. }
  39196. }),
  39197. (VD.prototype._renderCanvas = function (t) {}),
  39198. (VD.prototype.renderCanvas = function (t) {
  39199. if (this.visible && !(this.worldAlpha <= 0) && this.renderable) {
  39200. this._mask && t.maskManager.pushMask(this._mask), this._renderCanvas(t);
  39201. for (var e = 0, r = this.children.length; e < r; ++e)
  39202. this.children[e].renderCanvas(t);
  39203. this._mask && t.maskManager.popMask(t);
  39204. }
  39205. }),
  39206. (UD.prototype.renderCanvas = function (t) {}),
  39207. (FB.prototype._renderCanvas = function (t) {
  39208. this._autoResolution &&
  39209. this._resolution !== t.resolution &&
  39210. ((this._resolution = t.resolution), (this.dirty = !0)),
  39211. this.updateText(!0),
  39212. SB.prototype._renderCanvas.call(this, t);
  39213. }),
  39214. ZD.add(vU, hU, sU, gU, fU);
  39215. var xU = function (t, e) {
  39216. return (
  39217. (xU =
  39218. Object.setPrototypeOf ||
  39219. ({ __proto__: [] } instanceof Array &&
  39220. function (t, e) {
  39221. t.__proto__ = e;
  39222. }) ||
  39223. function (t, e) {
  39224. for (var r in e)
  39225. Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
  39226. }),
  39227. xU(t, e)
  39228. );
  39229. };
  39230. var EU = (function (t) {
  39231. function e(e) {
  39232. var r =
  39233. t.call(
  39234. this,
  39235. 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}',
  39236. 'varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (c.a > 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n'
  39237. ) || this;
  39238. return (
  39239. (r.gamma = 1),
  39240. (r.saturation = 1),
  39241. (r.contrast = 1),
  39242. (r.brightness = 1),
  39243. (r.red = 1),
  39244. (r.green = 1),
  39245. (r.blue = 1),
  39246. (r.alpha = 1),
  39247. Object.assign(r, e),
  39248. r
  39249. );
  39250. }
  39251. return (
  39252. (function (t, e) {
  39253. function r() {
  39254. this.constructor = t;
  39255. }
  39256. xU(t, e),
  39257. (t.prototype =
  39258. null === e
  39259. ? Object.create(e)
  39260. : ((r.prototype = e.prototype), new r()));
  39261. })(e, t),
  39262. (e.prototype.apply = function (t, e, r, n) {
  39263. (this.uniforms.gamma = Math.max(this.gamma, 1e-4)),
  39264. (this.uniforms.saturation = this.saturation),
  39265. (this.uniforms.contrast = this.contrast),
  39266. (this.uniforms.brightness = this.brightness),
  39267. (this.uniforms.red = this.red),
  39268. (this.uniforms.green = this.green),
  39269. (this.uniforms.blue = this.blue),
  39270. (this.uniforms.alpha = this.alpha),
  39271. t.applyFilter(this, e, r, n);
  39272. }),
  39273. e
  39274. );
  39275. })(EF),
  39276. SU = Yf('process:video'),
  39277. wU = (function () {
  39278. function t(t) {
  39279. var e, r;
  39280. (this.frameRate = null),
  39281. (this.resolution = null),
  39282. (this.backgroundColor = null),
  39283. (this.streamList = []),
  39284. (this.textList = []),
  39285. (this.isStart = !1),
  39286. (this.output = null),
  39287. (this.worker = null),
  39288. (this.renderer = null),
  39289. (this.stage = null),
  39290. (this.ticker = qD.shared),
  39291. (this.isPaused = !1);
  39292. var n = t.frameRate,
  39293. i = t.resolution,
  39294. o = t.backgroundColor;
  39295. (this.frameRate = n),
  39296. (this.resolution = i),
  39297. (this.backgroundColor = o),
  39298. (this.worker = LC()),
  39299. (this.renderer = eN({
  39300. width: i.width,
  39301. height: i.height,
  39302. backgroundColor: o,
  39303. antialias: !0,
  39304. resolution: 1,
  39305. forceCanvas: $x,
  39306. })),
  39307. (this.stage = new VD()),
  39308. (this.stage.sortableChildren = !0),
  39309. (this.ticker.autoStart = !1),
  39310. this.ticker.stop(),
  39311. (this.draw = lh((e = this.draw)).call(e, this)),
  39312. (this.setStreamParams = lh((r = this.setStreamParams)).call(r, this));
  39313. }
  39314. return (
  39315. (t.prototype.setResolution = function (t) {
  39316. var e;
  39317. (this.resolution = t),
  39318. null === (e = this.renderer) ||
  39319. void 0 === e ||
  39320. e.resize(t.width, t.height);
  39321. }),
  39322. (t.prototype.setBackgroundColor = function (t) {
  39323. (this.backgroundColor = t),
  39324. this.renderer && (this.renderer.backgroundColor = t);
  39325. }),
  39326. (t.prototype.addStream = function (t) {
  39327. var e,
  39328. r = this,
  39329. n = t.source,
  39330. i = t.order,
  39331. o = null,
  39332. s = null;
  39333. if (n instanceof MediaStream) {
  39334. var a,
  39335. u = El((a = this.streamList)).call(a, function (t) {
  39336. return t.source === n;
  39337. });
  39338. u
  39339. ? (o = u.element)
  39340. : (((o = gy()).onpause = function () {
  39341. SU('video is paused, try to resume'),
  39342. cd(function () {
  39343. var t;
  39344. null === (t = null == o ? void 0 : o.play) ||
  39345. void 0 === t ||
  39346. t.call(o);
  39347. }, 50);
  39348. }),
  39349. (o.muted = !0),
  39350. (o.srcObject = n),
  39351. o.load());
  39352. } else o = n;
  39353. var c = El((e = this.streamList)).call(e, function (t) {
  39354. return t.element === o;
  39355. });
  39356. s = c ? c.texture : EL.from(o);
  39357. var h = new SB(s),
  39358. l = _y(o),
  39359. d = l.width,
  39360. f = l.height;
  39361. if (0 === d || 0 === f) {
  39362. var p = o instanceof HTMLVideoElement ? 'loadedmetadata' : 'load';
  39363. o.addEventListener(
  39364. p,
  39365. function e() {
  39366. o.removeEventListener(p, e, !1), r.setStreamParams(h, o, t);
  39367. },
  39368. !1
  39369. );
  39370. } else this.setStreamParams(h, o, t);
  39371. (h.zIndex = i),
  39372. this.stage.addChild(h),
  39373. this.streamList.push(
  39374. xd(xd({}, t), { element: o, texture: s, sprite: h })
  39375. );
  39376. }),
  39377. (t.prototype.removeStream = function (t) {
  39378. var e,
  39379. r,
  39380. n,
  39381. i = Vh((e = this.streamList)).call(e, function (e) {
  39382. return e.id === t;
  39383. });
  39384. if (-1 !== i) {
  39385. var o,
  39386. s = Rd(pl((r = this.streamList)).call(r, i, 1), 1)[0];
  39387. if (
  39388. (this.stage.removeChild(s.sprite),
  39389. (s.sprite.filters = null),
  39390. s.sprite.destroy(),
  39391. (s.sprite = null),
  39392. !El((n = this.streamList)).call(n, function (t) {
  39393. return t.element === s.element;
  39394. }))
  39395. ) {
  39396. if (s.source instanceof HTMLVideoElement) {
  39397. var a = s.texture.baseTexture.resource,
  39398. u = a.source,
  39399. c = a._onError;
  39400. u && u.removeEventListener('error', c, !0), (a.source = null);
  39401. }
  39402. s.texture.destroy(!0);
  39403. }
  39404. if (((s.texture = null), s.source instanceof MediaStream))
  39405. if (
  39406. !El((o = this.streamList)).call(o, function (t) {
  39407. return t.source === s.source;
  39408. }) &&
  39409. s.element instanceof HTMLVideoElement
  39410. ) {
  39411. var h = s.element;
  39412. (h.onpause = null),
  39413. h.pause(),
  39414. (h.srcObject = null),
  39415. h.load(),
  39416. h.remove();
  39417. }
  39418. s.element = null;
  39419. } else SU('remove failed, stream '.concat(t, ' is not existed'));
  39420. }),
  39421. (t.prototype.addText = function (t) {
  39422. var e = t.x,
  39423. r = t.y,
  39424. n = t.order,
  39425. i = t.content,
  39426. o = t.style,
  39427. s = o.font_alpha,
  39428. a = void 0 === s ? 100 : s,
  39429. u = o.background_color,
  39430. c = o.background_alpha,
  39431. h = void 0 === c ? 100 : c,
  39432. l = new VD();
  39433. l.sortableChildren = !0;
  39434. var d = this.transformTextStyle(o),
  39435. f = new FB(i, d);
  39436. if (((f.alpha = Number(a) / 100), (f.zIndex = 1), l.addChild(f), u)) {
  39437. var p = new _B();
  39438. p.beginFill('number' == typeof u ? u : YM(u), Number(h) / 100),
  39439. p.drawRect(0, 0, l.width, l.height),
  39440. p.endFill(),
  39441. (p.zIndex = 0),
  39442. l.addChild(p);
  39443. }
  39444. (l.pivot.x = l.width / 2),
  39445. (l.pivot.y = l.height / 2),
  39446. (l.x = e),
  39447. (l.y = r),
  39448. (l.zIndex = n),
  39449. this.stage.addChild(l),
  39450. this.textList.push(xd(xd({}, t), { container: l }));
  39451. }),
  39452. (t.prototype.removeText = function (t) {
  39453. var e,
  39454. r,
  39455. n = Vh((e = this.textList)).call(e, function (e) {
  39456. return e.id === t;
  39457. });
  39458. if (-1 !== n) {
  39459. var i = Rd(pl((r = this.textList)).call(r, n, 1), 1)[0];
  39460. this.stage.removeChild(i.container),
  39461. i.container.destroy(!0),
  39462. (i.container = null);
  39463. } else SU('remove failed, text '.concat(t, ' is not existed'));
  39464. }),
  39465. (t.prototype.start = function () {
  39466. var t;
  39467. this.isStart
  39468. ? SU('rendering has started')
  39469. : this.renderer
  39470. ? ((this.isStart = !0),
  39471. (this.isPaused = !1),
  39472. this.draw(),
  39473. (this.output =
  39474. null === (t = this.getRenderView()) || void 0 === t
  39475. ? void 0
  39476. : t.captureStream(this.frameRate)))
  39477. : SU('renderer is not existed');
  39478. }),
  39479. (t.prototype.stop = function () {
  39480. this.isStart
  39481. ? ((this.isStart = !1), (this.isPaused = !1), this.destroy())
  39482. : SU('rendering has stopped');
  39483. }),
  39484. (t.prototype.getOutput = function () {
  39485. return this.output;
  39486. }),
  39487. (t.prototype.getRenderView = function () {
  39488. var t;
  39489. return null === (t = this.renderer) || void 0 === t ? void 0 : t.view;
  39490. }),
  39491. (t.prototype.pause = function () {
  39492. this.isPaused = !0;
  39493. }),
  39494. (t.prototype.resume = function () {
  39495. this.isPaused = !1;
  39496. }),
  39497. (t.prototype.setStreamParams = function (t, e, r) {
  39498. var n = r.x,
  39499. i = r.y,
  39500. o = r.width,
  39501. s = r.height,
  39502. a = r.operations,
  39503. u = _y(e),
  39504. c = u.width,
  39505. h = u.height,
  39506. l = { width: o, height: s };
  39507. 0 !== c &&
  39508. 0 !== h &&
  39509. (l =
  39510. o / s < c / h
  39511. ? { width: o, height: (o * h) / c }
  39512. : { width: (s * c) / h, height: s }),
  39513. t.anchor.set(0.5, 0.5),
  39514. (t.width = l.width),
  39515. (t.height = l.height),
  39516. (t.x = n),
  39517. (t.y = i),
  39518. Ph(a).call(a, function (e) {
  39519. var r,
  39520. n,
  39521. i,
  39522. o = e.type,
  39523. s = e.params,
  39524. a = void 0 === s ? {} : s;
  39525. if (
  39526. ('image_mirror' === o &&
  39527. (a.left_right && (t.scale.x *= -1),
  39528. a.up_down && (t.scale.y *= -1)),
  39529. 'image_filter_normal' === o)
  39530. ) {
  39531. t.filters || (t.filters = []);
  39532. var u = function (t) {
  39533. return 1 + t / 100;
  39534. },
  39535. c = {
  39536. contrast: u(
  39537. null !== (r = a.contrast) && void 0 !== r ? r : 0
  39538. ),
  39539. brightness: u(
  39540. null !== (n = a.brightness) && void 0 !== n ? n : 0
  39541. ),
  39542. saturation: u(
  39543. null !== (i = a.saturation) && void 0 !== i ? i : 0
  39544. ),
  39545. };
  39546. t.filters.push(new EU(c));
  39547. }
  39548. });
  39549. }),
  39550. (t.prototype.transformTextStyle = function (t) {
  39551. var e,
  39552. r = {};
  39553. return (
  39554. Ph((e = Rl(t))).call(e, function (e) {
  39555. var n = zC[e];
  39556. if (n)
  39557. switch (n) {
  39558. case 'fontWeight':
  39559. r[n] = t[e] ? 'bold' : 'normal';
  39560. break;
  39561. case 'fontStyle':
  39562. r[n] = t[e] ? 'italic' : 'normal';
  39563. break;
  39564. case 'dropShadowColor':
  39565. t[e] && ((r.dropShadow = !0), (r[n] = t[e]));
  39566. break;
  39567. case 'dropShadowAlpha':
  39568. r[n] = Number(t[e]) / 100;
  39569. break;
  39570. default:
  39571. r[n] = t[e];
  39572. }
  39573. }),
  39574. new PB(r)
  39575. );
  39576. }),
  39577. (t.prototype.draw = function () {
  39578. this.isStart && this.renderer && this.stage
  39579. ? (this.isPaused ||
  39580. (this.ticker.update(), this.renderer.render(this.stage)),
  39581. this.requestAnimationFrameWrapper(this.draw))
  39582. : SU('render stop');
  39583. }),
  39584. (t.prototype.destroy = function () {
  39585. var t,
  39586. e,
  39587. r,
  39588. n,
  39589. i,
  39590. o,
  39591. s,
  39592. a = this;
  39593. null === (n = this.worker) || void 0 === n || n.terminate(),
  39594. (this.worker = null);
  39595. var u = vd((t = this.streamList)).call(t, function (t) {
  39596. return t.id;
  39597. });
  39598. Ph(u).call(u, function (t) {
  39599. a.removeStream(t);
  39600. }),
  39601. (this.streamList = []);
  39602. var c = vd((e = this.textList)).call(e, function (t) {
  39603. return t.id;
  39604. });
  39605. Ph(c).call(c, function (t) {
  39606. a.removeText(t);
  39607. }),
  39608. (this.textList = []),
  39609. null === (i = this.stage) ||
  39610. void 0 === i ||
  39611. i.destroy({ children: !0, texture: !0, baseTexture: !0 }),
  39612. (this.stage = null),
  39613. null === (o = this.renderer) || void 0 === o || o.destroy(!0),
  39614. (this.renderer = null),
  39615. null === (s = this.output) ||
  39616. void 0 === s ||
  39617. Ph((r = s.getTracks())).call(r, function (t) {
  39618. t.stop();
  39619. }),
  39620. (this.output = null);
  39621. }),
  39622. (t.prototype.setWorkerInterval = function (t, e) {
  39623. var r,
  39624. n,
  39625. i = this;
  39626. null === (r = this.worker) ||
  39627. void 0 === r ||
  39628. r.addEventListener('message', t),
  39629. null === (n = this.worker) ||
  39630. void 0 === n ||
  39631. n.postMessage({ type: 'start', data: { time: e } });
  39632. return function () {
  39633. var e, r;
  39634. null === (e = i.worker) ||
  39635. void 0 === e ||
  39636. e.postMessage({ type: 'stop' }),
  39637. null === (r = i.worker) ||
  39638. void 0 === r ||
  39639. r.removeEventListener('message', t);
  39640. };
  39641. }),
  39642. (t.prototype.requestAnimationFrameWrapper = function (t) {
  39643. var e = !1,
  39644. r = this.setWorkerInterval(function () {
  39645. !e && document.hidden && ((e = !0), r(), t());
  39646. }, 1e3 / this.frameRate);
  39647. requestAnimationFrame(function () {
  39648. e || ((e = !0), r(), t());
  39649. });
  39650. }),
  39651. t
  39652. );
  39653. })(),
  39654. RU = sh('Array').entries,
  39655. CU = rn,
  39656. PU = qt,
  39657. AU = ut,
  39658. OU = RU,
  39659. IU = Array.prototype,
  39660. MU = { DOMTokenList: !0, NodeList: !0 },
  39661. DU = function (t) {
  39662. var e = t.entries;
  39663. return t === IU || (AU(IU, t) && e === IU.entries) || PU(MU, CU(t))
  39664. ? OU
  39665. : e;
  39666. },
  39667. LU = Yf('process:audio'),
  39668. FU = (function () {
  39669. function t() {
  39670. (this.streamList = []),
  39671. (this.isStart = !1),
  39672. (this.output = null),
  39673. (this.audioContext = null),
  39674. (this.audioDestination = null),
  39675. (this.audioConstantSource = null);
  39676. var t = yy(),
  39677. e = t.createGain();
  39678. if (((e.gain.value = 1), t.createConstantSource)) {
  39679. var r = t.createConstantSource();
  39680. r.start();
  39681. var n = t.createGain();
  39682. (n.gain.value = 0),
  39683. r.connect(n),
  39684. n.connect(e),
  39685. (this.audioConstantSource = r);
  39686. }
  39687. (this.audioContext = t), (this.audioDestination = e);
  39688. }
  39689. return (
  39690. (t.prototype.addStream = function (t) {
  39691. var e,
  39692. r,
  39693. n,
  39694. i = this,
  39695. o = t.source,
  39696. s = t.operations,
  39697. a = null,
  39698. u = El((e = this.streamList)).call(e, function (t) {
  39699. return t.source === o;
  39700. });
  39701. u
  39702. ? (a = u.audioSource)
  39703. : o instanceof MediaStream
  39704. ? o.getAudioTracks().length > 0 &&
  39705. (a = this.audioContext.createMediaStreamSource(o))
  39706. : ((a =
  39707. o._audioSource ||
  39708. this.audioContext.createMediaElementSource(o)),
  39709. (o._audioSource = a),
  39710. a.connect(this.audioContext.destination));
  39711. var c = [];
  39712. if (a) {
  39713. Ph(s).call(s, function (t) {
  39714. var e,
  39715. r,
  39716. n,
  39717. o,
  39718. s,
  39719. a,
  39720. u = t.type,
  39721. h = t.params,
  39722. l = void 0 === h ? {} : h;
  39723. if ('audio_volumes' === u) {
  39724. var d = i.audioContext.createGain();
  39725. (d.gain.value =
  39726. (null !== (e = l.all) && void 0 !== e ? e : 100) / 100),
  39727. c.push(d);
  39728. }
  39729. if ('audio_compressor' === u) {
  39730. var f = i.audioContext.createDynamicsCompressor();
  39731. (f.threshold.value =
  39732. null !== (r = l.threshold) && void 0 !== r
  39733. ? r
  39734. : ZC.threshold.value),
  39735. (f.ratio.value =
  39736. null !== (n = l.ratio) && void 0 !== n
  39737. ? n
  39738. : ZC.ratio.value),
  39739. (f.knee.value =
  39740. null !== (o = l.knee) && void 0 !== o ? o : ZC.knee.value),
  39741. (f.attack.value =
  39742. (null !== (s = l.attack) && void 0 !== s
  39743. ? s
  39744. : ZC.attack.value) / 1e3),
  39745. (f.release.value =
  39746. (null !== (a = l.release) && void 0 !== a
  39747. ? a
  39748. : ZC.release.value) / 1e3),
  39749. c.push(f);
  39750. }
  39751. });
  39752. var h = c.length;
  39753. if (h > 0)
  39754. try {
  39755. for (
  39756. var l = wd(DU(c).call(c)), d = l.next();
  39757. !d.done;
  39758. d = l.next()
  39759. ) {
  39760. var f = Rd(d.value, 2),
  39761. p = f[0],
  39762. v = f[1];
  39763. 0 === p && a.connect(v),
  39764. p === h - 1 && v.connect(this.audioDestination),
  39765. p < h - 1 && v.connect(c[p + 1]);
  39766. }
  39767. } catch (t) {
  39768. r = { error: t };
  39769. } finally {
  39770. try {
  39771. d && !d.done && (n = l.return) && n.call(l);
  39772. } finally {
  39773. if (r) throw r.error;
  39774. }
  39775. }
  39776. else a.connect(this.audioDestination);
  39777. }
  39778. this.streamList.push(
  39779. xd(xd({}, t), { audioSource: a, audioNodeList: c })
  39780. );
  39781. }),
  39782. (t.prototype.removeStream = function (t) {
  39783. var e,
  39784. r,
  39785. n,
  39786. i,
  39787. o = Vh((e = this.streamList)).call(e, function (e) {
  39788. return e.id === t;
  39789. });
  39790. if (-1 !== o) {
  39791. var s = Rd(pl((r = this.streamList)).call(r, o, 1), 1)[0];
  39792. if (s.audioSource) {
  39793. var a = s.audioSource,
  39794. u = s.audioNodeList,
  39795. c = u.length;
  39796. if (c > 0)
  39797. try {
  39798. for (
  39799. var h = wd(DU(u).call(u)), l = h.next();
  39800. !l.done;
  39801. l = h.next()
  39802. ) {
  39803. var d = Rd(l.value, 2),
  39804. f = d[0],
  39805. p = d[1];
  39806. 0 === f && a.disconnect(p),
  39807. f === c - 1 && p.disconnect(this.audioDestination),
  39808. f < c - 1 && p.disconnect(u[f + 1]);
  39809. }
  39810. } catch (t) {
  39811. n = { error: t };
  39812. } finally {
  39813. try {
  39814. l && !l.done && (i = h.return) && i.call(h);
  39815. } finally {
  39816. if (n) throw n.error;
  39817. }
  39818. }
  39819. else a.disconnect(this.audioDestination);
  39820. }
  39821. (s.audioSource = null), (s.audioNodeList = null);
  39822. } else LU('remove failed, stream '.concat(t, ' is not existed'));
  39823. }),
  39824. (t.prototype.start = function () {
  39825. if (this.isStart) LU('process has started');
  39826. else if (this.audioContext && this.audioDestination) {
  39827. this.isStart = !0;
  39828. var t = this.audioContext.createMediaStreamDestination();
  39829. this.audioDestination.connect(t), (this.output = t.stream);
  39830. } else LU('audio context is not existed');
  39831. }),
  39832. (t.prototype.stop = function () {
  39833. this.isStart
  39834. ? ((this.isStart = !1), this.destroy())
  39835. : LU('process has stopped');
  39836. }),
  39837. (t.prototype.getOutput = function () {
  39838. return this.output;
  39839. }),
  39840. (t.prototype.destroy = function () {
  39841. var t,
  39842. e,
  39843. r,
  39844. n,
  39845. i,
  39846. o,
  39847. s,
  39848. a = this,
  39849. u = vd((t = this.streamList)).call(t, function (t) {
  39850. return t.id;
  39851. });
  39852. Ph(u).call(u, function (t) {
  39853. a.removeStream(t);
  39854. }),
  39855. (this.streamList = []),
  39856. null === (r = this.audioConstantSource) || void 0 === r || r.stop(),
  39857. null === (n = this.audioConstantSource) ||
  39858. void 0 === n ||
  39859. n.disconnect(),
  39860. (this.audioConstantSource = null),
  39861. null === (i = this.audioDestination) ||
  39862. void 0 === i ||
  39863. i.disconnect(),
  39864. (this.audioDestination = null),
  39865. window.TXLiveAudioContext ||
  39866. (null === (o = this.audioContext) || void 0 === o || o.close(),
  39867. (this.audioContext = null)),
  39868. null === (s = this.output) ||
  39869. void 0 === s ||
  39870. Ph((e = s.getTracks())).call(e, function (t) {
  39871. t.stop();
  39872. }),
  39873. (this.output = null);
  39874. }),
  39875. t
  39876. );
  39877. })(),
  39878. NU = Yf('process'),
  39879. kU = (function () {
  39880. function t(t) {
  39881. void 0 === t && (t = {}),
  39882. (this.frameRate = 15),
  39883. (this.resolution = WC),
  39884. (this.backgroundColor = 0),
  39885. (this.lastData = null),
  39886. (this.curData = null),
  39887. (this.isProcessStart = !1),
  39888. (this.output = null),
  39889. (this.videoProcess = null),
  39890. (this.audioProcess = null);
  39891. var e = t.frameRate,
  39892. r = t.resolution,
  39893. n = t.backgroundColor,
  39894. i = t.data;
  39895. e && this.setFrameRate(e),
  39896. r && this.setResolution(r),
  39897. n && this.setBackgroundColor(n),
  39898. i && this.setData(i);
  39899. }
  39900. return (
  39901. (t.prototype.setFrameRate = function (t) {
  39902. t
  39903. ? 'number' != typeof t || t <= 0
  39904. ? NU('frameRate must be a number greater than 0')
  39905. : (this.frameRate = t)
  39906. : NU('frameRate must be existed');
  39907. }),
  39908. (t.prototype.setResolution = function (t) {
  39909. var e;
  39910. t
  39911. ? 'object' === Wc(t) &&
  39912. 'number' == typeof t.width &&
  39913. 'number' == typeof t.height &&
  39914. ((t.width > 0 && t.height > 0) ||
  39915. (0 === t.width && 0 === t.height))
  39916. ? ((this.resolution = t),
  39917. t.width > 0 &&
  39918. t.height > 0 &&
  39919. (null === (e = this.videoProcess) ||
  39920. void 0 === e ||
  39921. e.setResolution(t)))
  39922. : NU(
  39923. 'resolution width and height must be a number greater than or equal to 0'
  39924. )
  39925. : NU('resolution must be existed');
  39926. }),
  39927. (t.prototype.setBackgroundColor = function (t) {
  39928. var e;
  39929. null != t
  39930. ? 'number' != typeof t || t < 0 || t > 16777215
  39931. ? NU('backgroundColor must be a valid color number')
  39932. : ((this.backgroundColor = t),
  39933. null === (e = this.videoProcess) ||
  39934. void 0 === e ||
  39935. e.setBackgroundColor(t))
  39936. : NU('backgroundColor must be existed');
  39937. }),
  39938. (t.prototype.setData = function (t) {
  39939. var e,
  39940. r,
  39941. n,
  39942. i,
  39943. o,
  39944. s,
  39945. a = this;
  39946. if (HC(t)) {
  39947. try {
  39948. for (var u = wd(t), c = u.next(); !c.done; c = u.next()) {
  39949. var h,
  39950. l = c.value,
  39951. d = l.id,
  39952. f = l.type,
  39953. p = l.order,
  39954. v = l.items;
  39955. if (!d) return void NU('data.id is not existed');
  39956. if (!Jl((h = Rl(YC))).call(h, f))
  39957. return void NU('data.type('.concat(f, ') is invalid'));
  39958. if (void 0 !== p && 'number' != typeof p)
  39959. return void NU('data.order must be a number');
  39960. if (!HC(v)) return void NU('data.items must be an array');
  39961. try {
  39962. for (
  39963. var m = ((n = void 0), wd(v)), y = m.next();
  39964. !y.done;
  39965. y = m.next()
  39966. ) {
  39967. var g,
  39968. _ = y.value,
  39969. b = _.id,
  39970. T = _.type,
  39971. x = _.source,
  39972. E = _.content,
  39973. S = _.operations;
  39974. if (!b) return void NU('data.items.id is not existed');
  39975. if (!Jl((g = YC[f])).call(g, T))
  39976. return void NU(
  39977. 'data.items.type('.concat(T, ') is invalid')
  39978. );
  39979. if ('video' === f) {
  39980. if (
  39981. !(
  39982. 'video' !== T ||
  39983. x instanceof UC ||
  39984. x instanceof MediaStream ||
  39985. x instanceof HTMLVideoElement
  39986. )
  39987. )
  39988. return void NU(
  39989. 'data.items.source('.concat(T, ') is invalid')
  39990. );
  39991. if ('image' === T && !(x instanceof HTMLImageElement))
  39992. return void NU(
  39993. 'data.items.source('.concat(T, ') is invalid')
  39994. );
  39995. } else if ('audio' === f) {
  39996. if (
  39997. !(
  39998. x instanceof UC ||
  39999. x instanceof MediaStream ||
  40000. x instanceof HTMLVideoElement ||
  40001. x instanceof HTMLAudioElement
  40002. )
  40003. )
  40004. return void NU(
  40005. 'data.items.source('.concat(T, ') is invalid')
  40006. );
  40007. } else if ('text' === f) {
  40008. if (!E)
  40009. return void NU('data.items.content is not existed');
  40010. var w = E.text,
  40011. R = E.text_style;
  40012. if (!w)
  40013. return void NU(
  40014. 'data.items.content.text is not existed'
  40015. );
  40016. if ('object' !== Wc(R) || HC(R) || null === R)
  40017. return void NU(
  40018. 'data.items.content.text_style is invalid'
  40019. );
  40020. }
  40021. if (void 0 !== S) {
  40022. if (!HC(S))
  40023. return void NU(
  40024. 'data.items.operations must be an array'
  40025. );
  40026. var C = function (t) {
  40027. var e,
  40028. r,
  40029. n = t.type,
  40030. i = t.params,
  40031. o = void 0 === i ? {} : i;
  40032. if (
  40033. 'audio_volumes' === n &&
  40034. void 0 !== o.all &&
  40035. 'number' != typeof o.all
  40036. )
  40037. return (
  40038. NU('audio_volumes param must be a number'),
  40039. { value: void 0 }
  40040. );
  40041. if (
  40042. 'audio_compressor' === n &&
  40043. Rl(o).length > 0 &&
  40044. !PE((e = Rl(o))).call(e, function (t) {
  40045. var e = ZC[t];
  40046. if (!e)
  40047. return (
  40048. NU(
  40049. 'audio_compressor param '.concat(
  40050. t,
  40051. ' is invalid'
  40052. )
  40053. ),
  40054. !1
  40055. );
  40056. var r,
  40057. n,
  40058. i = o[t];
  40059. return (
  40060. !(
  40061. 'number' != typeof i ||
  40062. i < e.min ||
  40063. i > e.max
  40064. ) ||
  40065. (NU(
  40066. mh(
  40067. (r = mh(
  40068. (n = 'audio_compressor param '.concat(
  40069. t,
  40070. ' must be a number between '
  40071. ))
  40072. ).call(n, e.min, ' and '))
  40073. ).call(r, e.max)
  40074. ),
  40075. !1)
  40076. );
  40077. })
  40078. )
  40079. return { value: void 0 };
  40080. if (
  40081. 'image_filter_normal' === n &&
  40082. Rl(o).length > 0 &&
  40083. !PE((r = Rl(o))).call(r, function (t) {
  40084. var e = o[t];
  40085. return (
  40086. !('number' != typeof e || e < -100 || e > 100) ||
  40087. (NU(
  40088. 'image_filter_normal param '.concat(
  40089. t,
  40090. ' must be a number between -100 and 100'
  40091. )
  40092. ),
  40093. !1)
  40094. );
  40095. })
  40096. )
  40097. return { value: void 0 };
  40098. };
  40099. try {
  40100. for (
  40101. var P = ((o = void 0), wd(S)), A = P.next();
  40102. !A.done;
  40103. A = P.next()
  40104. ) {
  40105. var O = C(A.value);
  40106. if ('object' === Wc(O)) return O.value;
  40107. }
  40108. } catch (t) {
  40109. o = { error: t };
  40110. } finally {
  40111. try {
  40112. A && !A.done && (s = P.return) && s.call(P);
  40113. } finally {
  40114. if (o) throw o.error;
  40115. }
  40116. }
  40117. }
  40118. }
  40119. } catch (t) {
  40120. n = { error: t };
  40121. } finally {
  40122. try {
  40123. y && !y.done && (i = m.return) && i.call(m);
  40124. } finally {
  40125. if (n) throw n.error;
  40126. }
  40127. }
  40128. }
  40129. } catch (t) {
  40130. e = { error: t };
  40131. } finally {
  40132. try {
  40133. c && !c.done && (r = u.return) && r.call(u);
  40134. } finally {
  40135. if (e) throw e.error;
  40136. }
  40137. }
  40138. if (
  40139. ((this.lastData = this.curData),
  40140. (this.curData = zm(t)),
  40141. this.isProcessStart)
  40142. ) {
  40143. var I = Rd(
  40144. ((L = this.curData),
  40145. (F = this.lastData),
  40146. [fy(F, L, py), fy(L, F, py)]),
  40147. 2
  40148. ),
  40149. M = I[0],
  40150. D = I[1];
  40151. this.videoProcess &&
  40152. (this.videoProcess.pause(),
  40153. this.removeVideoData(M),
  40154. this.addVideoData(D),
  40155. cd(function () {
  40156. var t;
  40157. null === (t = a.videoProcess) || void 0 === t || t.resume();
  40158. }, 1500 / this.frameRate)),
  40159. this.removeAudioData(M),
  40160. this.addAudioData(D);
  40161. }
  40162. var L, F;
  40163. } else NU('data must be an array');
  40164. }),
  40165. (t.prototype.start = function () {
  40166. var t = this;
  40167. return new zx(function (e, r) {
  40168. var n;
  40169. if (t.isProcessStart)
  40170. return (
  40171. NU('processing has started'),
  40172. void r(new Error('processing has started'))
  40173. );
  40174. if (!t.curData || 0 === t.curData.length)
  40175. return NU('data is empty'), void r(new Error('data is empty'));
  40176. t.isProcessStart = !0;
  40177. var i = t,
  40178. o = i.frameRate,
  40179. s = i.resolution,
  40180. a = i.backgroundColor;
  40181. s.width > 0 &&
  40182. s.height > 0 &&
  40183. ((t.videoProcess = new wU({
  40184. frameRate: o,
  40185. resolution: s,
  40186. backgroundColor: a,
  40187. })),
  40188. t.addVideoData(t.curData)),
  40189. (t.audioProcess = new FU()),
  40190. t.addAudioData(t.curData),
  40191. null === (n = t.videoProcess) || void 0 === n || n.start(),
  40192. t.audioProcess.start(),
  40193. e();
  40194. });
  40195. }),
  40196. (t.prototype.stop = function () {
  40197. var t, e, r;
  40198. this.isProcessStart
  40199. ? ((this.isProcessStart = !1),
  40200. null === (e = this.videoProcess) || void 0 === e || e.stop(),
  40201. this.audioProcess.stop(),
  40202. (this.lastData = null),
  40203. (this.videoProcess = null),
  40204. (this.audioProcess = null),
  40205. null === (r = this.output) ||
  40206. void 0 === r ||
  40207. Ph((t = r.getTracks())).call(t, function (t) {
  40208. t.stop();
  40209. }),
  40210. (this.output = null))
  40211. : NU('processing has stopped');
  40212. }),
  40213. (t.prototype.isStart = function () {
  40214. return this.isProcessStart;
  40215. }),
  40216. (t.prototype.getOutput = function () {
  40217. var t, e, r, n;
  40218. if (!this.isProcessStart) return null;
  40219. var i = this.output || new MediaStream(),
  40220. o = i.getVideoTracks().length > 0,
  40221. s = i.getAudioTracks().length > 0,
  40222. a =
  40223. null ===
  40224. (e =
  40225. null === (t = this.videoProcess) || void 0 === t
  40226. ? void 0
  40227. : t.getOutput()) || void 0 === e
  40228. ? void 0
  40229. : e.getVideoTracks();
  40230. !o && (null == a ? void 0 : a.length)
  40231. ? i.addTrack(a[0])
  40232. : o &&
  40233. !(null == a ? void 0 : a.length) &&
  40234. i.removeTrack(i.getVideoTracks()[0]);
  40235. var u =
  40236. null ===
  40237. (n =
  40238. null === (r = this.audioProcess) || void 0 === r
  40239. ? void 0
  40240. : r.getOutput()) || void 0 === n
  40241. ? void 0
  40242. : n.getAudioTracks();
  40243. return (
  40244. !s && (null == u ? void 0 : u.length)
  40245. ? i.addTrack(u[0])
  40246. : s &&
  40247. !(null == u ? void 0 : u.length) &&
  40248. i.removeTrack(i.getAudioTracks()[0]),
  40249. (this.output = i),
  40250. i
  40251. );
  40252. }),
  40253. (t.prototype.getRenderView = function () {
  40254. var t;
  40255. return null === (t = this.videoProcess) || void 0 === t
  40256. ? void 0
  40257. : t.getRenderView();
  40258. }),
  40259. (t.prototype.addVideoData = function (t) {
  40260. var e = this;
  40261. if (this.videoProcess) {
  40262. var r = Lh(t).call(t, function (t) {
  40263. return 'video' === t.type || 'text' === t.type;
  40264. });
  40265. Ph(r).call(r, function (t) {
  40266. var r = t.id,
  40267. n = t.order,
  40268. i = void 0 === n ? 0 : n,
  40269. o = t.items;
  40270. Ph(o).call(o, function (t) {
  40271. var n,
  40272. o = t.id,
  40273. s = t.type,
  40274. a = t.source,
  40275. u = t.width,
  40276. c = void 0 === u ? e.resolution.width : u,
  40277. h = t.height,
  40278. l = void 0 === h ? e.resolution.height : h,
  40279. d = t.position,
  40280. f = void 0 === d ? {} : d,
  40281. p = t.content,
  40282. v = void 0 === p ? {} : p,
  40283. m = t.operations,
  40284. y = void 0 === m ? [] : m,
  40285. g = f.x,
  40286. _ = void 0 === g ? 0 : g,
  40287. b = f.y,
  40288. T = void 0 === b ? 0 : b,
  40289. x = v.text,
  40290. E = void 0 === x ? '' : x,
  40291. S = v.text_style,
  40292. w = void 0 === S ? {} : S,
  40293. R = mh((n = ''.concat(r, '-'))).call(n, o);
  40294. if ('video' === s || 'image' === s) {
  40295. if (0 === c || 0 === l) return;
  40296. var C = a instanceof UC ? a.getMediaStream() : a,
  40297. P = a instanceof UC ? a.getRenderElement() : null;
  40298. if (!C) return;
  40299. e.videoProcess.addStream({
  40300. id: R,
  40301. width: c,
  40302. height: l,
  40303. x: _,
  40304. y: T,
  40305. order: i,
  40306. source: null != P ? P : C,
  40307. operations: y,
  40308. });
  40309. } else
  40310. 'text' === s &&
  40311. e.videoProcess.addText({
  40312. id: R,
  40313. x: _,
  40314. y: T,
  40315. order: i,
  40316. operations: y,
  40317. content: E,
  40318. style: w,
  40319. });
  40320. });
  40321. });
  40322. }
  40323. }),
  40324. (t.prototype.removeVideoData = function (t) {
  40325. var e = this;
  40326. if (this.videoProcess) {
  40327. var r = Lh(t).call(t, function (t) {
  40328. return 'video' === t.type || 'text' === t.type;
  40329. });
  40330. Ph(r).call(r, function (t) {
  40331. var r = t.id,
  40332. n = t.items;
  40333. Ph(n).call(n, function (t) {
  40334. var n,
  40335. i = t.id,
  40336. o = t.type,
  40337. s = mh((n = ''.concat(r, '-'))).call(n, i);
  40338. 'video' === o || 'image' === o
  40339. ? e.videoProcess.removeStream(s)
  40340. : 'text' === o && e.videoProcess.removeText(s);
  40341. });
  40342. });
  40343. }
  40344. }),
  40345. (t.prototype.addAudioData = function (t) {
  40346. var e = this,
  40347. r = Lh(t).call(t, function (t) {
  40348. return 'video' === t.type || 'audio' === t.type;
  40349. });
  40350. Ph(r).call(r, function (t) {
  40351. var r = t.id,
  40352. n = t.items;
  40353. Ph(n).call(n, function (t) {
  40354. var n = t.id,
  40355. i = t.type,
  40356. o = t.source,
  40357. s = t.operations,
  40358. a = void 0 === s ? [] : s;
  40359. if ('video' === i || 'audio' === i) {
  40360. var u,
  40361. c = o instanceof UC ? o.getMediaStream() : o;
  40362. if (!c) return;
  40363. e.audioProcess.addStream({
  40364. id: mh((u = ''.concat(r, '-'))).call(u, n),
  40365. source: c,
  40366. operations: a,
  40367. });
  40368. }
  40369. });
  40370. });
  40371. }),
  40372. (t.prototype.removeAudioData = function (t) {
  40373. var e = this,
  40374. r = Lh(t).call(t, function (t) {
  40375. return 'video' === t.type || 'audio' === t.type;
  40376. });
  40377. Ph(r).call(r, function (t) {
  40378. var r = t.id,
  40379. n = t.items;
  40380. Ph(n).call(n, function (t) {
  40381. var n,
  40382. i = t.id,
  40383. o = t.type;
  40384. ('video' !== o && 'audio' !== o) ||
  40385. e.audioProcess.removeStream(
  40386. mh((n = ''.concat(r, '-'))).call(n, i)
  40387. );
  40388. });
  40389. });
  40390. }),
  40391. t
  40392. );
  40393. })();
  40394. Yf.disable();
  40395. var BU = Yf('app'),
  40396. GU = (function () {
  40397. function t() {
  40398. var t, e, r, n;
  40399. (this.videoView = null),
  40400. (this.canvasView = null),
  40401. (this.videoQuality = xd({}, Jf['720p'])),
  40402. (this.audioQuality = xd(xd({}, Kf.standard), {
  40403. echoCancellation: !0,
  40404. noiseSuppression: !0,
  40405. autoGainControl: !0,
  40406. })),
  40407. (this.connectRetry = {
  40408. maxCount: 3,
  40409. curCount: 0,
  40410. delay: 1,
  40411. timeoutId: 0,
  40412. }),
  40413. (this.connection = null),
  40414. (this.isStreamPushing = !1),
  40415. (this.streamList = []),
  40416. (this.streamOutput = null),
  40417. (this.deviceManager = null),
  40418. (this.videoEffectManager = null),
  40419. (this.audioEffectManager = null),
  40420. (this.effectProcess = null),
  40421. (this.effectTrackList = []),
  40422. (this.observer = {
  40423. onError: null,
  40424. onWarning: null,
  40425. onCaptureFirstAudioFrame: null,
  40426. onCaptureFirstVideoFrame: null,
  40427. onPushStatusUpdate: null,
  40428. onStatisticsUpdate: null,
  40429. }),
  40430. (this.advancedSettings = { signalingServer: null, metadata: null }),
  40431. (this.onConnectionStatusUpdate = lh(
  40432. (t = this.onConnectionStatusUpdate)
  40433. ).call(t, this)),
  40434. (this.setProcessData = lh((e = this.setProcessData)).call(e, this)),
  40435. (this.getCommonData = lh((r = this.getCommonData)).call(r, this)),
  40436. (this.onVisibilityChange = lh((n = this.onVisibilityChange)).call(
  40437. n,
  40438. this
  40439. )),
  40440. null === document ||
  40441. void 0 === document ||
  40442. document.addEventListener(
  40443. 'visibilitychange',
  40444. this.onVisibilityChange
  40445. ),
  40446. (this.deviceManager = new XC({ getCommonData: this.getCommonData })),
  40447. (this.videoEffectManager = new $C({
  40448. getCommonData: this.getCommonData,
  40449. })),
  40450. (this.audioEffectManager = new eP({
  40451. getCommonData: this.getCommonData,
  40452. }));
  40453. }
  40454. return (
  40455. (t.checkSupport = function () {
  40456. return Ed(void 0, void 0, void 0, function () {
  40457. var t;
  40458. return Sd(this, function (e) {
  40459. switch (e.label) {
  40460. case 0:
  40461. return (
  40462. (t = {
  40463. isWebRTCSupported: !(
  40464. !window.RTCPeerConnection &&
  40465. !window.webkitRTCPeerConnection
  40466. ),
  40467. }),
  40468. [
  40469. 4,
  40470. new zx(function (t) {
  40471. try {
  40472. var e,
  40473. r = new RTCPeerConnection({ iceServers: [] });
  40474. r.addEventListener('negotiationneeded', function e() {
  40475. r.createOffer().then(function (n) {
  40476. var i,
  40477. o = Jl((i = n.sdp.toLowerCase())).call(
  40478. i,
  40479. 'h264'
  40480. );
  40481. r.removeEventListener('negotiationneeded', e),
  40482. r.close(),
  40483. t(o);
  40484. });
  40485. });
  40486. var n = document.createElement('canvas');
  40487. n.getContext('2d');
  40488. var i = n.captureStream(0);
  40489. Ph((e = i.getTracks())).call(e, function (t) {
  40490. r.addTrack(t, i);
  40491. });
  40492. } catch (e) {
  40493. t(!1);
  40494. }
  40495. }),
  40496. ]
  40497. );
  40498. case 1:
  40499. return (
  40500. (t.isH264EncodeSupported = e.sent()),
  40501. [
  40502. 4,
  40503. Ed(void 0, void 0, void 0, function () {
  40504. var t, e, r, n;
  40505. return Sd(this, function (i) {
  40506. var o;
  40507. switch (i.label) {
  40508. case 0:
  40509. return (
  40510. i.trys.push([0, 2, , 3]),
  40511. (t = new RTCPeerConnection({
  40512. iceServers: [],
  40513. sdpSemantics: 'unified-plan',
  40514. })),
  40515. (e = {}),
  40516. t.addTransceiver
  40517. ? (t.addTransceiver('audio', {
  40518. direction: 'recvonly',
  40519. }),
  40520. t.addTransceiver('video', {
  40521. direction: 'recvonly',
  40522. }))
  40523. : (e = {
  40524. offerToReceiveVideo: !0,
  40525. offerToReceiveAudio: !0,
  40526. }),
  40527. [4, t.createOffer(e)]
  40528. );
  40529. case 1:
  40530. return (
  40531. (r = i.sent()),
  40532. (n = Jl((o = r.sdp.toLowerCase())).call(
  40533. o,
  40534. 'h264'
  40535. )),
  40536. t.close(),
  40537. [2, n]
  40538. );
  40539. case 2:
  40540. return i.sent(), [2, !1];
  40541. case 3:
  40542. return [2];
  40543. }
  40544. });
  40545. }),
  40546. ]
  40547. );
  40548. case 2:
  40549. return [
  40550. 2,
  40551. ((t.isH264DecodeSupported = e.sent()),
  40552. (t.isMediaDevicesSupported = eE()),
  40553. (t.isScreenCaptureSupported = rE()),
  40554. (t.isMediaFileSupported = !(
  40555. !document.createElement('canvas').captureStream ||
  40556. (!window.AudioContext && !window.webkitAudioContext)
  40557. )),
  40558. t),
  40559. ];
  40560. }
  40561. });
  40562. });
  40563. }),
  40564. (t.init = function () {
  40565. var t,
  40566. e = Mf.browserDetails,
  40567. r = e.browser,
  40568. n = e.version;
  40569. BU(mh((t = 'browser is '.concat(r, ', version is '))).call(t, n));
  40570. var i = document.body;
  40571. if (i)
  40572. if (window.TXLiveAudioContext) BU('TXLiveAudioContext is existed');
  40573. else {
  40574. var o = ['touchstart', 'touchend', 'mouseup', 'click'],
  40575. s = function t() {
  40576. Ph(o).call(o, function (e) {
  40577. return i.removeEventListener(e, t, !1);
  40578. });
  40579. var e = new (window.AudioContext ||
  40580. window.webkitAudioContext)();
  40581. my(e), (window.TXLiveAudioContext = e);
  40582. };
  40583. Ph(o).call(o, function (t) {
  40584. return i.addEventListener(t, s, !1);
  40585. });
  40586. }
  40587. else BU('document.body is not existed');
  40588. }),
  40589. (t.prototype.setRenderView = function (t) {
  40590. if (this.videoView) BU('render view is existed');
  40591. else {
  40592. var e = 'string' == typeof t ? document.getElementById(t) : t;
  40593. e && e instanceof HTMLDivElement
  40594. ? (this.videoView = gy({
  40595. parentEl: e,
  40596. style: Zf,
  40597. crossOrigin: !1,
  40598. loop: !1,
  40599. }))
  40600. : BU('require container element id or HTMLDivElement');
  40601. }
  40602. }),
  40603. (t.prototype.setVideoQuality = function (t) {
  40604. Jf[t]
  40605. ? (this.videoQuality = xd(xd({}, this.videoQuality), Jf[t]))
  40606. : BU('video quality '.concat(t, ' is not existed'));
  40607. }),
  40608. (t.prototype.setAudioQuality = function (t) {
  40609. Kf[t]
  40610. ? (this.audioQuality = xd(xd({}, this.audioQuality), Kf[t]))
  40611. : BU('audio quality '.concat(t, ' is not existed'));
  40612. }),
  40613. (t.prototype.setProperty = function (t, e) {
  40614. var r, n;
  40615. switch (t) {
  40616. case 'setVideoResolution':
  40617. 'object' === Wc(e) &&
  40618. 'number' == typeof e.width &&
  40619. 'number' == typeof e.height &&
  40620. e.width > 0 &&
  40621. e.height > 0
  40622. ? ((this.videoQuality.width = e.width),
  40623. (this.videoQuality.height = e.height))
  40624. : BU(
  40625. 'videoResolution width and height must be a number greater than 0'
  40626. );
  40627. break;
  40628. case 'setVideoFPS':
  40629. 'number' == typeof e && e > 0
  40630. ? (this.videoQuality.frameRate = e)
  40631. : BU('videoFPS must be a number greater than 0');
  40632. break;
  40633. case 'setVideoBitrate':
  40634. 'number' == typeof e && e > 0
  40635. ? ((this.videoQuality.bitrate = e),
  40636. null === (r = this.connection) ||
  40637. void 0 === r ||
  40638. r.setVideoBitrate(e))
  40639. : BU('videoBitrate must be a number greater than 0');
  40640. break;
  40641. case 'setAudioSampleRate':
  40642. 'number' == typeof e && e > 0
  40643. ? (this.audioQuality.sampleRate = e)
  40644. : BU('audioSampleRate must be a number greater than 0');
  40645. break;
  40646. case 'setAudioBitrate':
  40647. 'number' == typeof e && e > 0
  40648. ? ((this.audioQuality.bitrate = e),
  40649. null === (n = this.connection) ||
  40650. void 0 === n ||
  40651. n.setAudioBitrate(e))
  40652. : BU('audioBitrate must be a number greater than 0');
  40653. break;
  40654. case 'enableAudioAEC':
  40655. this.audioQuality.echoCancellation = !!e;
  40656. break;
  40657. case 'enableAudioAGC':
  40658. this.audioQuality.autoGainControl = !!e;
  40659. break;
  40660. case 'enableAudioANS':
  40661. this.audioQuality.noiseSuppression = !!e;
  40662. break;
  40663. case 'setConnectRetryCount':
  40664. 'number' == typeof e && e >= 0 && e <= 10
  40665. ? (this.connectRetry.maxCount = e)
  40666. : BU(
  40667. 'connectRetryCount must be a number between 0 and '.concat(
  40668. 10
  40669. )
  40670. );
  40671. break;
  40672. case 'setConnectRetryDelay':
  40673. 'number' == typeof e && e >= 0 && e <= 10
  40674. ? (this.connectRetry.delay = e)
  40675. : BU(
  40676. 'connectRetryDelay must be a number between 0 and '.concat(
  40677. 10
  40678. )
  40679. );
  40680. break;
  40681. case 'setMetadata':
  40682. 'object' === Wc(e)
  40683. ? (this.advancedSettings.metadata = e ? xd({}, e) : null)
  40684. : BU('metadata must be an object');
  40685. break;
  40686. case 'setSignalingServer':
  40687. 'string' == typeof e
  40688. ? (this.advancedSettings.signalingServer = e)
  40689. : BU('signalingServer must be string');
  40690. break;
  40691. case 'enableLog':
  40692. e ? Yf.enable('*') : Yf.disable();
  40693. break;
  40694. default:
  40695. BU(''.concat(t, ' is not existed'));
  40696. }
  40697. }),
  40698. (t.prototype.startCamera = function (t) {
  40699. var e, r, n;
  40700. return Ed(this, void 0, void 0, function () {
  40701. var i,
  40702. o,
  40703. s,
  40704. a,
  40705. u,
  40706. c,
  40707. h,
  40708. l,
  40709. d,
  40710. f = this;
  40711. return Sd(this, function (p) {
  40712. switch (p.label) {
  40713. case 0:
  40714. if (!this.videoEffectManager.enabled) {
  40715. if (this.isStreamPushing)
  40716. throw (
  40717. (BU('stream is pushing, please stop pushing first'),
  40718. new Error('stream is pushing'))
  40719. );
  40720. if (
  40721. (null === (e = this.streamOutput) || void 0 === e
  40722. ? void 0
  40723. : e.getVideoTracks().length) > 0
  40724. )
  40725. throw (
  40726. (BU('video track is existed'),
  40727. new Error('video track is existed'))
  40728. );
  40729. }
  40730. (i = Df()),
  40731. (o = new UC({
  40732. type: 'device',
  40733. video: !0,
  40734. audio: !1,
  40735. onEvent: function (t) {
  40736. var e, r, n;
  40737. t.type === lp &&
  40738. 'stream ended' ===
  40739. (null === (e = t.data) || void 0 === e
  40740. ? void 0
  40741. : e.message) &&
  40742. (null === (n = (r = f.observer).onWarning) ||
  40743. void 0 === n ||
  40744. n.call(
  40745. r,
  40746. Hf.TXLIVE_WARNING_CAMERA_INTERRUPTED,
  40747. 'interrupted',
  40748. { streamId: i }
  40749. ));
  40750. },
  40751. })),
  40752. (s = this.videoQuality),
  40753. (a = s.frameRate),
  40754. (u = s.width),
  40755. (c = s.height),
  40756. o.setVideoConfig({
  40757. deviceId: t || '',
  40758. frameRate: a,
  40759. resolution: { width: u, height: c },
  40760. }),
  40761. (p.label = 1);
  40762. case 1:
  40763. return p.trys.push([1, 3, , 4]), [4, o.start()];
  40764. case 2:
  40765. return (
  40766. (h = p.sent()),
  40767. (l = qC('video', o)),
  40768. this.initTrackData(l, h),
  40769. this.streamList.push({
  40770. id: i,
  40771. type: 'camera',
  40772. source: o,
  40773. track: l,
  40774. }),
  40775. this.videoEffectManager.enabled
  40776. ? this.startVideoProcess()
  40777. : this.startVideoPlay(),
  40778. [2, i]
  40779. );
  40780. case 3:
  40781. throw (
  40782. ((d = p.sent()),
  40783. null === (n = (r = this.observer).onWarning) ||
  40784. void 0 === n ||
  40785. n.call(
  40786. r,
  40787. Hf.TXLIVE_WARNING_CAMERA_START_FAILED,
  40788. d.toString(),
  40789. null
  40790. ),
  40791. d)
  40792. );
  40793. case 4:
  40794. return [2];
  40795. }
  40796. });
  40797. });
  40798. }),
  40799. (t.prototype.stopCamera = function (t) {
  40800. var e, r, n;
  40801. if (this.videoEffectManager.enabled || !this.isStreamPushing) {
  40802. var i = Lh((e = this.streamList)).call(e, function (e) {
  40803. return 'camera' === e.type && (void 0 === t || e.id === t);
  40804. });
  40805. if (0 !== i.length) {
  40806. var o = function (t, e) {
  40807. var r;
  40808. e instanceof UC && e.stop();
  40809. var n,
  40810. i = Vh((r = s.streamList)).call(r, function (e) {
  40811. return e.id === t;
  40812. });
  40813. -1 !== i && pl((n = s.streamList)).call(n, i, 1);
  40814. s.videoEffectManager.enabled
  40815. ? s.updateVideoProcess()
  40816. : s.stopVideoPlay();
  40817. },
  40818. s = this;
  40819. try {
  40820. for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
  40821. var c = u.value;
  40822. o(c.id, c.source);
  40823. }
  40824. } catch (t) {
  40825. r = { error: t };
  40826. } finally {
  40827. try {
  40828. u && !u.done && (n = a.return) && n.call(a);
  40829. } finally {
  40830. if (r) throw r.error;
  40831. }
  40832. }
  40833. } else BU('camera stream is not existed');
  40834. } else BU('stream is pushing, please stop pushing first');
  40835. }),
  40836. (t.prototype.startMicrophone = function (t) {
  40837. var e, r, n;
  40838. return Ed(this, void 0, void 0, function () {
  40839. var i,
  40840. o,
  40841. s,
  40842. a,
  40843. u,
  40844. c,
  40845. h,
  40846. l,
  40847. d,
  40848. f,
  40849. p = this;
  40850. return Sd(this, function (v) {
  40851. switch (v.label) {
  40852. case 0:
  40853. if (!this.videoEffectManager.enabled) {
  40854. if (this.isStreamPushing)
  40855. throw (
  40856. (BU('stream is pushing, please stop pushing first'),
  40857. new Error('stream is pushing'))
  40858. );
  40859. if (
  40860. (null === (e = this.streamOutput) || void 0 === e
  40861. ? void 0
  40862. : e.getAudioTracks().length) > 0
  40863. )
  40864. throw (
  40865. (BU('audio track is existed'),
  40866. new Error('audio track is existed'))
  40867. );
  40868. }
  40869. (i = Df()),
  40870. (o = new UC({
  40871. type: 'device',
  40872. video: !1,
  40873. audio: !0,
  40874. onEvent: function (t) {
  40875. var e, r, n;
  40876. t.type === lp &&
  40877. 'stream ended' ===
  40878. (null === (e = t.data) || void 0 === e
  40879. ? void 0
  40880. : e.message) &&
  40881. (null === (n = (r = p.observer).onWarning) ||
  40882. void 0 === n ||
  40883. n.call(
  40884. r,
  40885. Hf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,
  40886. 'interrupted',
  40887. { streamId: i }
  40888. ));
  40889. },
  40890. })),
  40891. (s = this.audioQuality),
  40892. (a = s.sampleRate),
  40893. (u = s.echoCancellation),
  40894. (c = s.noiseSuppression),
  40895. (h = s.autoGainControl),
  40896. o.setAudioConfig({
  40897. deviceId: t || '',
  40898. sampleRate: a,
  40899. echoCancellation: u,
  40900. noiseSuppression: c,
  40901. autoGainControl: h,
  40902. }),
  40903. (v.label = 1);
  40904. case 1:
  40905. return v.trys.push([1, 3, , 4]), [4, o.start()];
  40906. case 2:
  40907. return (
  40908. (l = v.sent()),
  40909. (d = qC('audio', o)),
  40910. this.initTrackData(d, l),
  40911. this.streamList.push({
  40912. id: i,
  40913. type: 'microphone',
  40914. source: o,
  40915. track: d,
  40916. }),
  40917. this.videoEffectManager.enabled
  40918. ? this.startVideoProcess()
  40919. : this.startVideoPlay(),
  40920. [2, i]
  40921. );
  40922. case 3:
  40923. throw (
  40924. ((f = v.sent()),
  40925. null === (n = (r = this.observer).onWarning) ||
  40926. void 0 === n ||
  40927. n.call(
  40928. r,
  40929. Hf.TXLIVE_WARNING_MICROPHONE_START_FAILED,
  40930. f.toString(),
  40931. null
  40932. ),
  40933. f)
  40934. );
  40935. case 4:
  40936. return [2];
  40937. }
  40938. });
  40939. });
  40940. }),
  40941. (t.prototype.stopMicrophone = function (t) {
  40942. var e, r, n;
  40943. if (this.videoEffectManager.enabled || !this.isStreamPushing) {
  40944. var i = Lh((e = this.streamList)).call(e, function (e) {
  40945. return 'microphone' === e.type && (void 0 === t || e.id === t);
  40946. });
  40947. if (0 !== i.length) {
  40948. var o = function (t, e) {
  40949. var r;
  40950. e instanceof UC && e.stop();
  40951. var n,
  40952. i = Vh((r = s.streamList)).call(r, function (e) {
  40953. return e.id === t;
  40954. });
  40955. -1 !== i && pl((n = s.streamList)).call(n, i, 1);
  40956. s.videoEffectManager.enabled
  40957. ? s.updateVideoProcess()
  40958. : s.stopVideoPlay();
  40959. },
  40960. s = this;
  40961. try {
  40962. for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
  40963. var c = u.value;
  40964. o(c.id, c.source);
  40965. }
  40966. } catch (t) {
  40967. r = { error: t };
  40968. } finally {
  40969. try {
  40970. u && !u.done && (n = a.return) && n.call(a);
  40971. } finally {
  40972. if (r) throw r.error;
  40973. }
  40974. }
  40975. } else BU('microphone stream is not existed');
  40976. } else BU('stream is pushing, please stop pushing first');
  40977. }),
  40978. (t.prototype.startScreenCapture = function (t) {
  40979. var e, r, n, i;
  40980. return (
  40981. void 0 === t && (t = !1),
  40982. Ed(this, void 0, void 0, function () {
  40983. var o,
  40984. s,
  40985. a,
  40986. u,
  40987. c,
  40988. h,
  40989. l,
  40990. d,
  40991. f,
  40992. p,
  40993. v,
  40994. m,
  40995. y,
  40996. g,
  40997. _ = this;
  40998. return Sd(this, function (b) {
  40999. switch (b.label) {
  41000. case 0:
  41001. if (!this.videoEffectManager.enabled) {
  41002. if (this.isStreamPushing)
  41003. throw (
  41004. (BU('stream is pushing, please stop pushing first'),
  41005. new Error('stream is pushing'))
  41006. );
  41007. if (
  41008. (null === (e = this.streamOutput) || void 0 === e
  41009. ? void 0
  41010. : e.getVideoTracks().length) > 0
  41011. )
  41012. throw (
  41013. (BU('video track is existed'),
  41014. new Error('video track is existed'))
  41015. );
  41016. if (
  41017. t &&
  41018. (null === (r = this.streamOutput) || void 0 === r
  41019. ? void 0
  41020. : r.getAudioTracks().length) > 0
  41021. )
  41022. throw (
  41023. (BU('audio track is existed'),
  41024. new Error('audio track is existed'))
  41025. );
  41026. }
  41027. (o = Df()),
  41028. (s = new UC({
  41029. type: 'screen',
  41030. video: !0,
  41031. audio: t,
  41032. onEvent: function (t) {
  41033. var e, r, n;
  41034. t.type === lp &&
  41035. 'stream ended' ===
  41036. (null === (e = t.data) || void 0 === e
  41037. ? void 0
  41038. : e.message) &&
  41039. (null === (n = (r = _.observer).onWarning) ||
  41040. void 0 === n ||
  41041. n.call(
  41042. r,
  41043. Hf.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED,
  41044. 'interrupted',
  41045. { streamId: o }
  41046. ));
  41047. },
  41048. })),
  41049. (a = this.videoQuality),
  41050. (u = a.frameRate),
  41051. (c = a.width),
  41052. (h = a.height),
  41053. s.setVideoConfig({
  41054. frameRate: u,
  41055. resolution: { width: c, height: h },
  41056. }),
  41057. t &&
  41058. ((l = this.audioQuality),
  41059. (d = l.sampleRate),
  41060. (f = l.echoCancellation),
  41061. (p = l.noiseSuppression),
  41062. (v = l.autoGainControl),
  41063. s.setAudioConfig({
  41064. sampleRate: d,
  41065. echoCancellation: f,
  41066. noiseSuppression: p,
  41067. autoGainControl: v,
  41068. })),
  41069. (b.label = 1);
  41070. case 1:
  41071. return b.trys.push([1, 3, , 4]), [4, s.start()];
  41072. case 2:
  41073. return (
  41074. (m = b.sent()),
  41075. (y = qC('video', s)),
  41076. this.initTrackData(y, m),
  41077. this.streamList.push({
  41078. id: o,
  41079. type: 'screen',
  41080. source: s,
  41081. track: y,
  41082. }),
  41083. this.videoEffectManager.enabled
  41084. ? this.startVideoProcess()
  41085. : this.startVideoPlay(),
  41086. [2, o]
  41087. );
  41088. case 3:
  41089. throw (
  41090. ((g = b.sent()),
  41091. null === (i = (n = this.observer).onWarning) ||
  41092. void 0 === i ||
  41093. i.call(
  41094. n,
  41095. Hf.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED,
  41096. g.toString(),
  41097. null
  41098. ),
  41099. g)
  41100. );
  41101. case 4:
  41102. return [2];
  41103. }
  41104. });
  41105. })
  41106. );
  41107. }),
  41108. (t.prototype.stopScreenCapture = function (t) {
  41109. var e, r, n;
  41110. if (this.videoEffectManager.enabled || !this.isStreamPushing) {
  41111. var i = Lh((e = this.streamList)).call(e, function (e) {
  41112. return 'screen' === e.type && (void 0 === t || e.id === t);
  41113. });
  41114. if (0 !== i.length) {
  41115. var o = function (t, e) {
  41116. var r;
  41117. e instanceof UC && e.stop();
  41118. var n,
  41119. i = Vh((r = s.streamList)).call(r, function (e) {
  41120. return e.id === t;
  41121. });
  41122. -1 !== i && pl((n = s.streamList)).call(n, i, 1);
  41123. s.videoEffectManager.enabled
  41124. ? s.updateVideoProcess()
  41125. : s.stopVideoPlay();
  41126. },
  41127. s = this;
  41128. try {
  41129. for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
  41130. var c = u.value;
  41131. o(c.id, c.source);
  41132. }
  41133. } catch (t) {
  41134. r = { error: t };
  41135. } finally {
  41136. try {
  41137. u && !u.done && (n = a.return) && n.call(a);
  41138. } finally {
  41139. if (r) throw r.error;
  41140. }
  41141. }
  41142. } else BU('screen stream is not existed');
  41143. } else BU('stream is pushing, please stop pushing first');
  41144. }),
  41145. (t.prototype.startVirtualCamera = function (t) {
  41146. var e, r, n, i;
  41147. return Ed(this, void 0, void 0, function () {
  41148. var o, s, a, u, c, h, l, d, f, p;
  41149. return Sd(this, function (v) {
  41150. switch (v.label) {
  41151. case 0:
  41152. if (!(t && t instanceof File))
  41153. throw (BU('file is invalid'), new Error('file is invalid'));
  41154. if (
  41155. ((o = (function (t) {
  41156. var e = '';
  41157. switch (t.type) {
  41158. case 'video/mp4':
  41159. e = 'video';
  41160. break;
  41161. case 'audio/mpeg':
  41162. e = 'audio';
  41163. break;
  41164. case 'image/jpeg':
  41165. case 'image/png':
  41166. case 'image/bmp':
  41167. e = 'image';
  41168. break;
  41169. default:
  41170. e = '';
  41171. }
  41172. return e;
  41173. })(t)),
  41174. !o)
  41175. )
  41176. throw (
  41177. (BU('file type is invalid'),
  41178. new Error('file type is invalid'))
  41179. );
  41180. if (!this.videoEffectManager.enabled) {
  41181. if (this.isStreamPushing)
  41182. throw (
  41183. (BU('stream is pushing, please stop pushing first'),
  41184. new Error('stream is pushing'))
  41185. );
  41186. if (
  41187. ('video' === o || 'image' === o) &&
  41188. (null === (e = this.streamOutput) || void 0 === e
  41189. ? void 0
  41190. : e.getVideoTracks().length) > 0
  41191. )
  41192. throw (
  41193. (BU('video track is existed'),
  41194. new Error('video track is existed'))
  41195. );
  41196. if (
  41197. ('video' === o || 'audio' === o) &&
  41198. (null === (r = this.streamOutput) || void 0 === r
  41199. ? void 0
  41200. : r.getAudioTracks().length) > 0
  41201. )
  41202. throw (
  41203. (BU('audio track is existed'),
  41204. new Error('audio track is existed'))
  41205. );
  41206. }
  41207. (s = Df()),
  41208. (a = new UC({
  41209. type: 'file',
  41210. video: 'audio' !== o,
  41211. audio: 'image' !== o,
  41212. fileSource: t,
  41213. })),
  41214. (u = this.videoQuality),
  41215. (c = u.frameRate),
  41216. (h = u.width),
  41217. (l = u.height),
  41218. a.setVideoConfig({
  41219. frameRate: c,
  41220. resolution: { width: h, height: l },
  41221. }),
  41222. (v.label = 1);
  41223. case 1:
  41224. return v.trys.push([1, 3, , 4]), [4, a.start()];
  41225. case 2:
  41226. return (
  41227. (d = v.sent()),
  41228. (f = qC('audio' !== o ? 'video' : 'audio', a)),
  41229. this.initTrackData(f, d),
  41230. this.streamList.push({
  41231. id: s,
  41232. type: 'file',
  41233. source: a,
  41234. track: f,
  41235. }),
  41236. this.videoEffectManager.enabled
  41237. ? this.startVideoProcess()
  41238. : this.startVideoPlay(),
  41239. [2, s]
  41240. );
  41241. case 3:
  41242. throw (
  41243. ((p = v.sent()),
  41244. null === (i = (n = this.observer).onWarning) ||
  41245. void 0 === i ||
  41246. i.call(
  41247. n,
  41248. Hf.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED,
  41249. p.toString(),
  41250. null
  41251. ),
  41252. p)
  41253. );
  41254. case 4:
  41255. return [2];
  41256. }
  41257. });
  41258. });
  41259. }),
  41260. (t.prototype.stopVirtualCamera = function (t) {
  41261. var e, r, n;
  41262. if (this.videoEffectManager.enabled || !this.isStreamPushing) {
  41263. var i = Lh((e = this.streamList)).call(e, function (e) {
  41264. return 'file' === e.type && (void 0 === t || e.id === t);
  41265. });
  41266. if (0 !== i.length) {
  41267. var o = function (t, e) {
  41268. var r;
  41269. e instanceof UC && e.stop();
  41270. var n,
  41271. i = Vh((r = s.streamList)).call(r, function (e) {
  41272. return e.id === t;
  41273. });
  41274. -1 !== i && pl((n = s.streamList)).call(n, i, 1);
  41275. s.videoEffectManager.enabled
  41276. ? s.updateVideoProcess()
  41277. : s.stopVideoPlay();
  41278. },
  41279. s = this;
  41280. try {
  41281. for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
  41282. var c = u.value;
  41283. o(c.id, c.source);
  41284. }
  41285. } catch (t) {
  41286. r = { error: t };
  41287. } finally {
  41288. try {
  41289. u && !u.done && (n = a.return) && n.call(a);
  41290. } finally {
  41291. if (r) throw r.error;
  41292. }
  41293. }
  41294. } else BU('file stream is not existed');
  41295. } else BU('stream is pushing, please stop pushing first');
  41296. }),
  41297. (t.prototype.startMediaFile = function (t) {
  41298. return this.startVirtualCamera(t);
  41299. }),
  41300. (t.prototype.stopMediaFile = function (t) {
  41301. return this.stopVirtualCamera(t);
  41302. }),
  41303. (t.prototype.startCustomCapture = function (t) {
  41304. var e, r;
  41305. return Ed(this, void 0, void 0, function () {
  41306. var n, i, o, s;
  41307. return Sd(this, function (a) {
  41308. if (!(t && t instanceof MediaStream))
  41309. throw (BU('stream is invalid'), new Error('stream is invalid'));
  41310. if (
  41311. ((n = t.getVideoTracks().length),
  41312. (i = t.getAudioTracks().length),
  41313. 0 === n && 0 === i)
  41314. )
  41315. throw (BU('stream is empty'), new Error('stream is empty'));
  41316. if (n > 1 || i > 1)
  41317. throw (
  41318. (BU(
  41319. 'the number of '.concat(
  41320. n > 1 ? 'video' : 'audio',
  41321. ' tracks is greater than 1'
  41322. )
  41323. ),
  41324. new Error(
  41325. 'the number of '.concat(
  41326. n > 1 ? 'video' : 'audio',
  41327. ' tracks is greater than 1'
  41328. )
  41329. ))
  41330. );
  41331. if (!this.videoEffectManager.enabled) {
  41332. if (this.isStreamPushing)
  41333. throw (
  41334. (BU('stream is pushing, please stop pushing first'),
  41335. new Error('stream is pushing'))
  41336. );
  41337. if (
  41338. n > 0 &&
  41339. (null === (e = this.streamOutput) || void 0 === e
  41340. ? void 0
  41341. : e.getVideoTracks().length) > 0
  41342. )
  41343. throw (
  41344. (BU('video track is existed'),
  41345. new Error('video track is existed'))
  41346. );
  41347. if (
  41348. i > 0 &&
  41349. (null === (r = this.streamOutput) || void 0 === r
  41350. ? void 0
  41351. : r.getAudioTracks().length) > 0
  41352. )
  41353. throw (
  41354. (BU('audio track is existed'),
  41355. new Error('audio track is existed'))
  41356. );
  41357. }
  41358. return (
  41359. (o = Df()),
  41360. (s = qC(n > 0 ? 'video' : 'audio', t)),
  41361. this.initTrackData(s, t),
  41362. this.streamList.push({
  41363. id: o,
  41364. type: 'custom',
  41365. source: t,
  41366. track: s,
  41367. }),
  41368. this.videoEffectManager.enabled
  41369. ? this.startVideoProcess()
  41370. : this.startVideoPlay(),
  41371. [2, o]
  41372. );
  41373. });
  41374. });
  41375. }),
  41376. (t.prototype.stopCustomCapture = function (t) {
  41377. var e, r, n;
  41378. if (this.videoEffectManager.enabled || !this.isStreamPushing) {
  41379. var i = Lh((e = this.streamList)).call(e, function (e) {
  41380. return 'custom' === e.type && (void 0 === t || e.id === t);
  41381. });
  41382. if (0 !== i.length) {
  41383. var o = function (t, e) {
  41384. var r,
  41385. n,
  41386. i = Vh((r = s.streamList)).call(r, function (e) {
  41387. return e.id === t;
  41388. });
  41389. -1 !== i && pl((n = s.streamList)).call(n, i, 1);
  41390. s.videoEffectManager.enabled
  41391. ? s.updateVideoProcess()
  41392. : s.stopVideoPlay(e);
  41393. },
  41394. s = this;
  41395. try {
  41396. for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
  41397. var c = u.value;
  41398. o(c.id, c.source);
  41399. }
  41400. } catch (t) {
  41401. r = { error: t };
  41402. } finally {
  41403. try {
  41404. u && !u.done && (n = a.return) && n.call(a);
  41405. } finally {
  41406. if (r) throw r.error;
  41407. }
  41408. }
  41409. } else BU('custom stream is not existed');
  41410. } else BU('stream is pushing, please stop pushing first');
  41411. }),
  41412. (t.prototype.startPush = function (t) {
  41413. var e, r;
  41414. return Ed(this, void 0, void 0, function () {
  41415. var n,
  41416. i,
  41417. o,
  41418. s,
  41419. a,
  41420. u,
  41421. c,
  41422. h = this;
  41423. return Sd(this, function (l) {
  41424. switch (l.label) {
  41425. case 0:
  41426. if (!t)
  41427. throw (
  41428. (BU('push url is not existed'),
  41429. new Error('push url is not existed'))
  41430. );
  41431. if (this.isStreamPushing)
  41432. throw (
  41433. (BU('stream is pushing, please stop pushing first'),
  41434. new Error('stream is pushing'))
  41435. );
  41436. if (!this.streamOutput)
  41437. throw (
  41438. (BU('no stream for pushing'),
  41439. new Error('no stream for pushing'))
  41440. );
  41441. this.connection ||
  41442. (this.connection = new cP({
  41443. onStatusUpdate: this.onConnectionStatusUpdate,
  41444. onStatisticsUpdate: function (t) {
  41445. var e, r;
  41446. null === (r = (e = h.observer).onStatisticsUpdate) ||
  41447. void 0 === r ||
  41448. r.call(e, t);
  41449. },
  41450. })),
  41451. this.connection.setUrl(t),
  41452. this.connection.setStreamSource(this.streamOutput),
  41453. this.connection.setVideoBitrate(this.videoQuality.bitrate),
  41454. this.connection.setAudioBitrate(this.audioQuality.bitrate),
  41455. (n = this.advancedSettings),
  41456. (i = n.metadata),
  41457. (o = n.signalingServer),
  41458. (s = o ? { domainName: o } : {}),
  41459. (a = i || {
  41460. videodatarate: this.videoQuality.bitrate,
  41461. audiodatarate: this.audioQuality.bitrate,
  41462. }),
  41463. this.connection.setSignalingConfig(
  41464. xd(xd({}, s), { extraParams: { metadata: a } })
  41465. ),
  41466. (l.label = 1);
  41467. case 1:
  41468. return l.trys.push([1, 3, , 4]), [4, this.connection.start()];
  41469. case 2:
  41470. return l.sent(), [3, 4];
  41471. case 3:
  41472. throw (
  41473. ((u = l.sent()),
  41474. (c =
  41475. 'RequestError' === u.name
  41476. ? Hf.TXLIVE_ERROR_REQUEST_FAILED
  41477. : Hf.TXLIVE_ERROR_WEBRTC_FAILED),
  41478. null === (r = (e = this.observer).onError) ||
  41479. void 0 === r ||
  41480. r.call(e, c, u.toString(), null),
  41481. u)
  41482. );
  41483. case 4:
  41484. return [2];
  41485. }
  41486. });
  41487. });
  41488. }),
  41489. (t.prototype.stopPush = function () {
  41490. var t;
  41491. this.isStreamPushing
  41492. ? (this.connectRetry.timeoutId &&
  41493. (window.clearTimeout(this.connectRetry.timeoutId),
  41494. (this.connectRetry.timeoutId = null),
  41495. (this.connectRetry.curCount = 0)),
  41496. null === (t = this.connection) || void 0 === t || t.stop())
  41497. : BU('no stream is pushing');
  41498. }),
  41499. (t.prototype.isPushing = function () {
  41500. return !(!this.streamOutput || !this.isStreamPushing);
  41501. }),
  41502. (t.prototype.getRenderView = function () {
  41503. return this.videoView;
  41504. }),
  41505. (t.prototype.getMediaStream = function (t) {
  41506. var e;
  41507. if (!t) return BU('streamId is not existed'), null;
  41508. var r = El((e = this.streamList)).call(e, function (e) {
  41509. return e.id === t;
  41510. });
  41511. return r
  41512. ? r.source instanceof UC
  41513. ? r.source.getMediaStream()
  41514. : r.source
  41515. : (BU('stream is not existed'), null);
  41516. }),
  41517. (t.prototype.getDeviceManager = function () {
  41518. return this.deviceManager;
  41519. }),
  41520. (t.prototype.getVideoEffectManager = function () {
  41521. return this.videoEffectManager;
  41522. }),
  41523. (t.prototype.getAudioEffectManager = function () {
  41524. return this.audioEffectManager;
  41525. }),
  41526. (t.prototype.setVideoMute = function (t) {
  41527. var e, r;
  41528. null === (r = this.streamOutput) ||
  41529. void 0 === r ||
  41530. Ph((e = r.getVideoTracks())).call(e, function (e) {
  41531. e.enabled = !t;
  41532. }),
  41533. this.canvasView &&
  41534. (t
  41535. ? (this.canvasView.style.filter = 'brightness(0%)')
  41536. : this.canvasView.style.removeProperty('filter'));
  41537. }),
  41538. (t.prototype.setAudioMute = function (t) {
  41539. var e, r;
  41540. null === (r = this.streamOutput) ||
  41541. void 0 === r ||
  41542. Ph((e = r.getAudioTracks())).call(e, function (e) {
  41543. e.enabled = !t;
  41544. });
  41545. }),
  41546. (t.prototype.pauseVideo = function () {
  41547. this.setVideoMute(!0);
  41548. }),
  41549. (t.prototype.pauseAudio = function () {
  41550. this.setAudioMute(!0);
  41551. }),
  41552. (t.prototype.resumeVideo = function () {
  41553. this.setVideoMute(!1);
  41554. }),
  41555. (t.prototype.resumeAudio = function () {
  41556. this.setAudioMute(!1);
  41557. }),
  41558. (t.prototype.setVideoContentHint = function (t) {
  41559. var e, r;
  41560. null === (r = this.streamOutput) ||
  41561. void 0 === r ||
  41562. Ph((e = r.getVideoTracks())).call(e, function (e) {
  41563. e.contentHint = t;
  41564. });
  41565. }),
  41566. (t.prototype.setObserver = function (t) {
  41567. var e,
  41568. r = this,
  41569. n = Rl(this.observer);
  41570. Ph((e = Rl(t))).call(e, function (e) {
  41571. var i = t[e];
  41572. Jl(n).call(n, e) && 'function' == typeof i && (r.observer[e] = i);
  41573. });
  41574. }),
  41575. (t.prototype.destroy = function () {
  41576. var t, e;
  41577. (null === document ||
  41578. void 0 === document ||
  41579. document.removeEventListener(
  41580. 'visibilitychange',
  41581. this.onVisibilityChange
  41582. ),
  41583. this.connectRetry.timeoutId &&
  41584. (window.clearTimeout(this.connectRetry.timeoutId),
  41585. (this.connectRetry.timeoutId = null)),
  41586. this.connection && (this.connection.stop(), (this.connection = null)),
  41587. this.effectProcess &&
  41588. (this.effectProcess.stop(), (this.effectProcess = null)),
  41589. this.streamList) &&
  41590. (Ph((t = this.streamList)).call(t, function (t) {
  41591. t.source instanceof UC && t.source.stop();
  41592. }),
  41593. (this.streamList = null));
  41594. this.streamOutput &&
  41595. (Ph((e = this.streamOutput.getTracks())).call(e, function (t) {
  41596. 'ended' !== t.readyState && t.stop();
  41597. }),
  41598. (this.streamOutput = null));
  41599. this.videoView &&
  41600. (this.videoView.pause(),
  41601. (this.videoView.srcObject = null),
  41602. this.videoView.load(),
  41603. this.videoView.remove(),
  41604. (this.videoView = null)),
  41605. this.canvasView &&
  41606. (this.canvasView.remove(), (this.canvasView = null)),
  41607. (this.observer = null),
  41608. (this.deviceManager = null),
  41609. (this.videoEffectManager = null),
  41610. (this.audioEffectManager = null);
  41611. }),
  41612. (t.prototype.onConnectionStatusUpdate = function (t) {
  41613. var e,
  41614. r,
  41615. n,
  41616. i,
  41617. o,
  41618. s,
  41619. a,
  41620. u = this;
  41621. t.type === ep
  41622. ? ((this.isStreamPushing = !0),
  41623. (this.connectRetry.curCount = 0),
  41624. null === (r = (e = this.observer).onPushStatusUpdate) ||
  41625. void 0 === r ||
  41626. r.call(e, Wf.TXLIVE_PUSH_STATUS_CONNECTED, 'connected', null))
  41627. : t.type === $f
  41628. ? ((this.isStreamPushing = !1),
  41629. 'connection disconnected' ===
  41630. (null === (n = t.data) || void 0 === n ? void 0 : n.message)
  41631. ? (this.connection.stop(),
  41632. this.connectRetry.timeoutId &&
  41633. (window.clearTimeout(this.connectRetry.timeoutId),
  41634. (this.connectRetry.timeoutId = null)),
  41635. (this.connectRetry.timeoutId = cd(function () {
  41636. var t, e, r, n;
  41637. u.connectRetry.curCount += 1;
  41638. var i,
  41639. o = u.connectRetry,
  41640. s = o.curCount,
  41641. a = o.maxCount;
  41642. s <= a
  41643. ? (BU(
  41644. mh(
  41645. (i = 'current retry count: '.concat(
  41646. s,
  41647. ', max retry count: '
  41648. ))
  41649. ).call(i, a)
  41650. ),
  41651. null === (e = (t = u.observer).onPushStatusUpdate) ||
  41652. void 0 === e ||
  41653. e.call(
  41654. t,
  41655. Wf.TXLIVE_PUSH_STATUS_RECONNECTING,
  41656. 'reconnecting',
  41657. null
  41658. ),
  41659. u.connection.start().catch(function (t) {
  41660. var e, r;
  41661. BU('reconnect error, '.concat(t.toString())),
  41662. 'RequestError' === t.name &&
  41663. (null === (r = (e = u.observer).onError) ||
  41664. void 0 === r ||
  41665. r.call(
  41666. e,
  41667. Hf.TXLIVE_ERROR_REQUEST_FAILED,
  41668. t.toString(),
  41669. null
  41670. ));
  41671. }))
  41672. : (null === (n = (r = u.observer).onPushStatusUpdate) ||
  41673. void 0 === n ||
  41674. n.call(
  41675. r,
  41676. Wf.TXLIVE_PUSH_STATUS_DISCONNECTED,
  41677. 'disconnected',
  41678. null
  41679. ),
  41680. (u.connectRetry.curCount = 0),
  41681. u.stopVideoProcess());
  41682. u.connectRetry.timeoutId = null;
  41683. }, 1e3 * this.connectRetry.delay)))
  41684. : (null === (o = (i = this.observer).onPushStatusUpdate) ||
  41685. void 0 === o ||
  41686. o.call(
  41687. i,
  41688. Wf.TXLIVE_PUSH_STATUS_DISCONNECTED,
  41689. 'disconnected',
  41690. null
  41691. ),
  41692. this.stopVideoProcess()))
  41693. : t.type === tp &&
  41694. (null === (a = (s = this.observer).onPushStatusUpdate) ||
  41695. void 0 === a ||
  41696. a.call(
  41697. s,
  41698. Wf.TXLIVE_PUSH_STATUS_CONNECTING,
  41699. 'connecting',
  41700. null
  41701. ));
  41702. }),
  41703. (t.prototype.initTrackData = function (t, e) {
  41704. if (e.getVideoTracks().length > 0) {
  41705. var r,
  41706. n = Lh((r = this.streamList)).call(r, function (t) {
  41707. var e,
  41708. r = t.source,
  41709. n = r instanceof UC ? r.getMediaStream() : r;
  41710. return null === (e = null == n ? void 0 : n.getVideoTracks()) ||
  41711. void 0 === e
  41712. ? void 0
  41713. : e.length;
  41714. });
  41715. t.setOrder(n.length);
  41716. }
  41717. e.getAudioTracks().length > 0 && t.setVolume(100);
  41718. }),
  41719. (t.prototype.setProcessData = function () {
  41720. var t,
  41721. e,
  41722. r,
  41723. n,
  41724. i,
  41725. o,
  41726. s = null;
  41727. this.videoEffectManager.enabled
  41728. ? (s = vd(
  41729. (e = mh(
  41730. (r = vd((n = this.streamList)).call(n, function (t) {
  41731. return t.track;
  41732. }))
  41733. ).call(r, this.effectTrackList))
  41734. ).call(e, function (t) {
  41735. return t.data;
  41736. }))
  41737. : (s = vd(
  41738. (i = Lh((o = this.streamList)).call(o, function (t) {
  41739. var e,
  41740. r = t.source,
  41741. n = r instanceof UC ? r.getMediaStream() : r;
  41742. return null ===
  41743. (e = null == n ? void 0 : n.getAudioTracks()) ||
  41744. void 0 === e
  41745. ? void 0
  41746. : e.length;
  41747. }))
  41748. ).call(i, function (t) {
  41749. return t.track.data;
  41750. }));
  41751. null === (t = this.effectProcess) || void 0 === t || t.setData(s);
  41752. }),
  41753. (t.prototype.startVideoPlay = function () {
  41754. var t, e, r, n, i;
  41755. return Ed(this, void 0, void 0, function () {
  41756. var o, s, a, u, c, h, l, d;
  41757. return Sd(this, function (f) {
  41758. switch (f.label) {
  41759. case 0:
  41760. return (
  41761. this.streamOutput ||
  41762. (this.streamOutput = new MediaStream()),
  41763. this.effectProcess || (this.effectProcess = new kU()),
  41764. (o = this.streamList[this.streamList.length - 1]),
  41765. (s = o.source),
  41766. (a = s instanceof UC ? s.getMediaStream() : s),
  41767. (u = null),
  41768. a.getAudioTracks().length > 0
  41769. ? (this.setProcessData(),
  41770. this.effectProcess.isStart()
  41771. ? [3, 2]
  41772. : (this.effectProcess.setResolution({
  41773. width: 0,
  41774. height: 0,
  41775. }),
  41776. [4, this.effectProcess.start()]))
  41777. : [3, 3]
  41778. );
  41779. case 1:
  41780. f.sent(), (f.label = 2);
  41781. case 2:
  41782. (u = this.effectProcess.getOutput()), (f.label = 3);
  41783. case 3:
  41784. if (
  41785. ((c = a.getVideoTracks()),
  41786. 0 === this.streamOutput.getVideoTracks().length &&
  41787. c.length > 0 &&
  41788. (this.streamOutput.addTrack(c[0]),
  41789. null ===
  41790. (e = (t = this.observer).onCaptureFirstVideoFrame) ||
  41791. void 0 === e ||
  41792. e.call(t)),
  41793. (h = null == u ? void 0 : u.getAudioTracks()),
  41794. 0 === this.streamOutput.getAudioTracks().length &&
  41795. (null == h ? void 0 : h.length) > 0 &&
  41796. (this.streamOutput.addTrack(h[0]),
  41797. null ===
  41798. (n = (r = this.observer).onCaptureFirstAudioFrame) ||
  41799. void 0 === n ||
  41800. n.call(r)),
  41801. !this.videoView)
  41802. )
  41803. return [2];
  41804. var p;
  41805. if (!this.canvasView)
  41806. if ((l = $x && s instanceof UC ? s.getRenderView() : null))
  41807. l.setAttribute('style', Zf),
  41808. (this.canvasView = l),
  41809. this.videoView.setAttribute(
  41810. 'style',
  41811. mh((p = ''.concat(Zf))).call(p, vy)
  41812. ),
  41813. null === (i = this.videoView.parentElement) ||
  41814. void 0 === i ||
  41815. i.insertBefore(l, this.videoView);
  41816. if (this.videoView.srcObject) return [2];
  41817. if (
  41818. ((this.videoView.srcObject = this.streamOutput),
  41819. this.videoView.load(),
  41820. !this.videoView.autoplay)
  41821. )
  41822. return [2];
  41823. f.label = 4;
  41824. case 4:
  41825. return f.trys.push([4, 6, , 7]), [4, this.videoView.play()];
  41826. case 5:
  41827. return f.sent(), BU('play ok'), [3, 7];
  41828. case 6:
  41829. return (d = f.sent()), BU('play failed', d), [3, 7];
  41830. case 7:
  41831. return [2];
  41832. }
  41833. });
  41834. });
  41835. }),
  41836. (t.prototype.stopVideoPlay = function (t) {
  41837. var e,
  41838. r,
  41839. n = this;
  41840. if (this.streamOutput) {
  41841. var i,
  41842. o =
  41843. null === (e = this.effectProcess) || void 0 === e
  41844. ? void 0
  41845. : e.getOutput();
  41846. if (
  41847. null === (r = null == o ? void 0 : o.getAudioTracks()) ||
  41848. void 0 === r
  41849. ? void 0
  41850. : r.length
  41851. )
  41852. Td((i = this.streamList)).call(i, function (t) {
  41853. var e = t.source;
  41854. return e instanceof UC
  41855. ? !!e.getAudioTrack()
  41856. : e.getAudioTracks().length > 0;
  41857. }) ||
  41858. (this.streamOutput.removeTrack(o.getAudioTracks()[0]),
  41859. this.effectProcess.stop());
  41860. var s,
  41861. a = this.streamOutput.getTracks();
  41862. if (
  41863. (Ph(a).call(a, function (t) {
  41864. 'ended' === t.readyState && n.streamOutput.removeTrack(t);
  41865. }),
  41866. t && t instanceof MediaStream)
  41867. )
  41868. Ph((s = t.getTracks())).call(s, function (t) {
  41869. n.streamOutput.removeTrack(t);
  41870. });
  41871. this.canvasView &&
  41872. 0 === this.streamOutput.getVideoTracks().length &&
  41873. (this.canvasView.remove(),
  41874. (this.canvasView = null),
  41875. this.videoView.setAttribute('style', Zf)),
  41876. this.streamOutput.getTracks().length > 0 ||
  41877. ((this.streamOutput = null),
  41878. this.videoView &&
  41879. (this.videoView.pause(),
  41880. (this.videoView.srcObject = null),
  41881. this.videoView.load()));
  41882. }
  41883. }),
  41884. (t.prototype.startVideoProcess = function () {
  41885. var t, e, r, n, i, o, s;
  41886. return Ed(this, void 0, void 0, function () {
  41887. var a, u, c, h, l, d, f, p, v, m, y, g, _, b, T, x, E, S, w;
  41888. return Sd(this, function (R) {
  41889. switch (R.label) {
  41890. case 0:
  41891. var C;
  41892. if (
  41893. (this.streamOutput ||
  41894. (this.streamOutput = new MediaStream()),
  41895. this.effectProcess || (this.effectProcess = new kU()),
  41896. (a = this.videoEffectManager.getMixingConfig()),
  41897. (u = a.videoWidth),
  41898. (c = a.videoHeight),
  41899. (h = a.videoFramerate),
  41900. (l = a.backgroundColor),
  41901. (d = this.streamList[this.streamList.length - 1]),
  41902. (f = d.source),
  41903. (p = f instanceof UC ? f.getMediaStream() : f),
  41904. null === (t = null == p ? void 0 : p.getVideoTracks()) ||
  41905. void 0 === t
  41906. ? void 0
  41907. : t.length)
  41908. )
  41909. (v =
  41910. null !==
  41911. (e =
  41912. f instanceof UC
  41913. ? f.getResolution()
  41914. : p.getVideoTracks()[0].getSettings()) &&
  41915. void 0 !== e
  41916. ? e
  41917. : {}),
  41918. (m = Lh((C = this.streamList)).call(C, function (t) {
  41919. var e,
  41920. r = t.source,
  41921. n = r instanceof UC ? r.getMediaStream() : r;
  41922. return null ===
  41923. (e = null == n ? void 0 : n.getVideoTracks()) ||
  41924. void 0 === e
  41925. ? void 0
  41926. : e.length;
  41927. })),
  41928. 1 === m.length
  41929. ? d.track.setLayout({
  41930. width: u,
  41931. height: c,
  41932. x: u / 2,
  41933. y: c / 2,
  41934. })
  41935. : ((y = v.width),
  41936. (g = v.height),
  41937. (_ = null != y ? y : u),
  41938. (b = null != g ? g : c),
  41939. d.track.setLayout({
  41940. width: _ / 2,
  41941. height: b / 2,
  41942. x: _ / 4,
  41943. y: b / 4,
  41944. }));
  41945. return (
  41946. this.setProcessData(),
  41947. this.effectProcess.isStart()
  41948. ? [3, 2]
  41949. : (this.effectProcess.setResolution({
  41950. width: u,
  41951. height: c,
  41952. }),
  41953. this.effectProcess.setFrameRate(h),
  41954. this.effectProcess.setBackgroundColor(l),
  41955. [4, this.effectProcess.start()])
  41956. );
  41957. case 1:
  41958. R.sent(), (R.label = 2);
  41959. case 2:
  41960. if (
  41961. ((T = this.effectProcess.getOutput()),
  41962. (x = T.getVideoTracks()),
  41963. 0 === this.streamOutput.getVideoTracks().length &&
  41964. x.length > 0 &&
  41965. (this.streamOutput.addTrack(x[0]),
  41966. null ===
  41967. (n = (r = this.observer).onCaptureFirstVideoFrame) ||
  41968. void 0 === n ||
  41969. n.call(r)),
  41970. (E = T.getAudioTracks()),
  41971. 0 === this.streamOutput.getAudioTracks().length &&
  41972. E.length > 0 &&
  41973. (this.streamOutput.addTrack(E[0]),
  41974. null ===
  41975. (o = (i = this.observer).onCaptureFirstAudioFrame) ||
  41976. void 0 === o ||
  41977. o.call(i)),
  41978. !this.videoView)
  41979. )
  41980. return [2];
  41981. var P;
  41982. if (!this.canvasView)
  41983. if ((S = $x ? this.effectProcess.getRenderView() : null))
  41984. S.setAttribute('style', Zf),
  41985. (this.canvasView = S),
  41986. this.videoView.setAttribute(
  41987. 'style',
  41988. mh((P = ''.concat(Zf))).call(P, vy)
  41989. ),
  41990. null === (s = this.videoView.parentElement) ||
  41991. void 0 === s ||
  41992. s.insertBefore(S, this.videoView);
  41993. if (this.videoView.srcObject) return [2];
  41994. if (
  41995. ((this.videoView.srcObject = this.streamOutput),
  41996. this.videoView.load(),
  41997. !this.videoView.autoplay)
  41998. )
  41999. return [2];
  42000. R.label = 3;
  42001. case 3:
  42002. return R.trys.push([3, 5, , 6]), [4, this.videoView.play()];
  42003. case 4:
  42004. return R.sent(), BU('play ok'), [3, 6];
  42005. case 5:
  42006. return (w = R.sent()), BU('play failed', w), [3, 6];
  42007. case 6:
  42008. return [2];
  42009. }
  42010. });
  42011. });
  42012. }),
  42013. (t.prototype.updateVideoProcess = function () {
  42014. 0 !== this.streamList.length || this.isStreamPushing
  42015. ? this.setProcessData()
  42016. : this.stopVideoProcess();
  42017. }),
  42018. (t.prototype.stopVideoProcess = function () {
  42019. var t,
  42020. e = this;
  42021. if (
  42022. this.videoEffectManager.enabled &&
  42023. this.streamOutput &&
  42024. 0 === this.streamList.length
  42025. ) {
  42026. var r,
  42027. n =
  42028. null === (t = this.effectProcess) || void 0 === t
  42029. ? void 0
  42030. : t.getOutput();
  42031. if (n)
  42032. Ph((r = n.getTracks())).call(r, function (t) {
  42033. e.streamOutput.removeTrack(t);
  42034. }),
  42035. this.effectProcess.stop();
  42036. (this.streamOutput = null),
  42037. this.canvasView &&
  42038. (this.canvasView.remove(),
  42039. (this.canvasView = null),
  42040. this.videoView.setAttribute('style', Zf)),
  42041. this.videoView &&
  42042. (this.videoView.pause(),
  42043. (this.videoView.srcObject = null),
  42044. this.videoView.load());
  42045. }
  42046. }),
  42047. (t.prototype.getCommonData = function () {
  42048. return {
  42049. streamList: this.streamList,
  42050. videoEffectManager: this.videoEffectManager,
  42051. observer: this.observer,
  42052. videoQuality: this.videoQuality,
  42053. audioQuality: this.audioQuality,
  42054. streamOutput: this.streamOutput,
  42055. isStreamPushing: this.isStreamPushing,
  42056. connection: this.connection,
  42057. setProcessData: this.setProcessData,
  42058. effectTrackList: this.effectTrackList,
  42059. effectProcess: this.effectProcess,
  42060. };
  42061. }),
  42062. (t.prototype.onVisibilityChange = function () {
  42063. 'visible' === document.visibilityState &&
  42064. window.TXLiveAudioContext &&
  42065. my(window.TXLiveAudioContext);
  42066. }),
  42067. (t.version = zf),
  42068. t
  42069. );
  42070. })();
  42071. return GU.init(), GU;
  42072. });