capture.worker.js 352 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349
  1. // include: shell.js
  2. // The Module object: Our interface to the outside world. We import
  3. // and export values on it. There are various ways Module can be used:
  4. // 1. Not defined. We create it here
  5. // 2. A function parameter, function(Module) { ..generated code.. }
  6. // 3. pre-run appended it, var Module = {}; ..generated code..
  7. // 4. External script tag defines var Module.
  8. // We need to check if Module already exists (e.g. case 3 above).
  9. // Substitution will be replaced with actual code on later stage of the build,
  10. // this way Closure Compiler will not mangle it (e.g. case 4. above).
  11. // Note that if you want to run closure, and also to use Module
  12. // after the generated code, you will need to define var Module = {};
  13. // before the code. Then that object will be used in the code, and you
  14. // can continue to use Module afterwards as well.
  15. var Module = typeof Module != "undefined" ? Module : {};
  16. // --pre-jses are emitted after the Module integration code, so that they can
  17. // refer to Module (if they choose; they can also define Module)
  18. /******/ (function () {
  19. // webpackBootstrap
  20. /******/ var __webpack_modules__ = {
  21. /***/ 3099: /***/ function (module) {
  22. module.exports = function (it) {
  23. if (typeof it != "function") {
  24. throw TypeError(String(it) + " is not a function");
  25. }
  26. return it;
  27. };
  28. /***/
  29. },
  30. /***/ 6077: /***/ function (
  31. module,
  32. __unused_webpack_exports,
  33. __webpack_require__
  34. ) {
  35. var isObject = __webpack_require__(111);
  36. module.exports = function (it) {
  37. if (!isObject(it) && it !== null) {
  38. throw TypeError("Can't set " + String(it) + " as a prototype");
  39. }
  40. return it;
  41. };
  42. /***/
  43. },
  44. /***/ 1223: /***/ function (
  45. module,
  46. __unused_webpack_exports,
  47. __webpack_require__
  48. ) {
  49. var wellKnownSymbol = __webpack_require__(5112);
  50. var create = __webpack_require__(30);
  51. var definePropertyModule = __webpack_require__(3070);
  52. var UNSCOPABLES = wellKnownSymbol("unscopables");
  53. var ArrayPrototype = Array.prototype;
  54. // Array.prototype[@@unscopables]
  55. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  56. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  57. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  58. configurable: true,
  59. value: create(null)
  60. });
  61. }
  62. // add a key to Array.prototype[@@unscopables]
  63. module.exports = function (key) {
  64. ArrayPrototype[UNSCOPABLES][key] = true;
  65. };
  66. /***/
  67. },
  68. /***/ 5787: /***/ function (module) {
  69. module.exports = function (it, Constructor, name) {
  70. if (!(it instanceof Constructor)) {
  71. throw TypeError(
  72. "Incorrect " + (name ? name + " " : "") + "invocation"
  73. );
  74. }
  75. return it;
  76. };
  77. /***/
  78. },
  79. /***/ 9670: /***/ function (
  80. module,
  81. __unused_webpack_exports,
  82. __webpack_require__
  83. ) {
  84. var isObject = __webpack_require__(111);
  85. module.exports = function (it) {
  86. if (!isObject(it)) {
  87. throw TypeError(String(it) + " is not an object");
  88. }
  89. return it;
  90. };
  91. /***/
  92. },
  93. /***/ 4019: /***/ function (module) {
  94. module.exports =
  95. typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined";
  96. /***/
  97. },
  98. /***/ 260: /***/ function (
  99. module,
  100. __unused_webpack_exports,
  101. __webpack_require__
  102. ) {
  103. "use strict";
  104. var NATIVE_ARRAY_BUFFER = __webpack_require__(4019);
  105. var DESCRIPTORS = __webpack_require__(9781);
  106. var global = __webpack_require__(7854);
  107. var isObject = __webpack_require__(111);
  108. var has = __webpack_require__(6656);
  109. var classof = __webpack_require__(648);
  110. var createNonEnumerableProperty = __webpack_require__(8880);
  111. var redefine = __webpack_require__(1320);
  112. var defineProperty = __webpack_require__(3070).f;
  113. var getPrototypeOf = __webpack_require__(9518);
  114. var setPrototypeOf = __webpack_require__(7674);
  115. var wellKnownSymbol = __webpack_require__(5112);
  116. var uid = __webpack_require__(9711);
  117. var Int8Array = global.Int8Array;
  118. var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
  119. var Uint8ClampedArray = global.Uint8ClampedArray;
  120. var Uint8ClampedArrayPrototype =
  121. Uint8ClampedArray && Uint8ClampedArray.prototype;
  122. var TypedArray = Int8Array && getPrototypeOf(Int8Array);
  123. var TypedArrayPrototype =
  124. Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
  125. var ObjectPrototype = Object.prototype;
  126. var isPrototypeOf = ObjectPrototype.isPrototypeOf;
  127. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  128. var TYPED_ARRAY_TAG = uid("TYPED_ARRAY_TAG");
  129. // Fixing native typed arrays in Opera Presto crashes the browser, see #595
  130. var NATIVE_ARRAY_BUFFER_VIEWS =
  131. NATIVE_ARRAY_BUFFER &&
  132. !!setPrototypeOf &&
  133. classof(global.opera) !== "Opera";
  134. var TYPED_ARRAY_TAG_REQIRED = false;
  135. var NAME;
  136. var TypedArrayConstructorsList = {
  137. Int8Array: 1,
  138. Uint8Array: 1,
  139. Uint8ClampedArray: 1,
  140. Int16Array: 2,
  141. Uint16Array: 2,
  142. Int32Array: 4,
  143. Uint32Array: 4,
  144. Float32Array: 4,
  145. Float64Array: 8
  146. };
  147. var isView = function isView(it) {
  148. var klass = classof(it);
  149. return klass === "DataView" || has(TypedArrayConstructorsList, klass);
  150. };
  151. var isTypedArray = function (it) {
  152. return isObject(it) && has(TypedArrayConstructorsList, classof(it));
  153. };
  154. var aTypedArray = function (it) {
  155. if (isTypedArray(it)) return it;
  156. throw TypeError("Target is not a typed array");
  157. };
  158. var aTypedArrayConstructor = function (C) {
  159. if (setPrototypeOf) {
  160. if (isPrototypeOf.call(TypedArray, C)) return C;
  161. } else
  162. for (var ARRAY in TypedArrayConstructorsList)
  163. if (has(TypedArrayConstructorsList, NAME)) {
  164. var TypedArrayConstructor = global[ARRAY];
  165. if (
  166. TypedArrayConstructor &&
  167. (C === TypedArrayConstructor ||
  168. isPrototypeOf.call(TypedArrayConstructor, C))
  169. ) {
  170. return C;
  171. }
  172. }
  173. throw TypeError("Target is not a typed array constructor");
  174. };
  175. var exportTypedArrayMethod = function (KEY, property, forced) {
  176. if (!DESCRIPTORS) return;
  177. if (forced)
  178. for (var ARRAY in TypedArrayConstructorsList) {
  179. var TypedArrayConstructor = global[ARRAY];
  180. if (
  181. TypedArrayConstructor &&
  182. has(TypedArrayConstructor.prototype, KEY)
  183. ) {
  184. delete TypedArrayConstructor.prototype[KEY];
  185. }
  186. }
  187. if (!TypedArrayPrototype[KEY] || forced) {
  188. redefine(
  189. TypedArrayPrototype,
  190. KEY,
  191. forced
  192. ? property
  193. : (NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY]) ||
  194. property
  195. );
  196. }
  197. };
  198. var exportTypedArrayStaticMethod = function (KEY, property, forced) {
  199. var ARRAY, TypedArrayConstructor;
  200. if (!DESCRIPTORS) return;
  201. if (setPrototypeOf) {
  202. if (forced)
  203. for (ARRAY in TypedArrayConstructorsList) {
  204. TypedArrayConstructor = global[ARRAY];
  205. if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) {
  206. delete TypedArrayConstructor[KEY];
  207. }
  208. }
  209. if (!TypedArray[KEY] || forced) {
  210. // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
  211. try {
  212. return redefine(
  213. TypedArray,
  214. KEY,
  215. forced
  216. ? property
  217. : (NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY]) || property
  218. );
  219. } catch (error) {
  220. /* empty */
  221. }
  222. } else return;
  223. }
  224. for (ARRAY in TypedArrayConstructorsList) {
  225. TypedArrayConstructor = global[ARRAY];
  226. if (
  227. TypedArrayConstructor &&
  228. (!TypedArrayConstructor[KEY] || forced)
  229. ) {
  230. redefine(TypedArrayConstructor, KEY, property);
  231. }
  232. }
  233. };
  234. for (NAME in TypedArrayConstructorsList) {
  235. if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false;
  236. }
  237. // WebKit bug - typed arrays constructors prototype is Object.prototype
  238. if (
  239. !NATIVE_ARRAY_BUFFER_VIEWS ||
  240. typeof TypedArray != "function" ||
  241. TypedArray === Function.prototype
  242. ) {
  243. // eslint-disable-next-line no-shadow
  244. TypedArray = function TypedArray() {
  245. throw TypeError("Incorrect invocation");
  246. };
  247. if (NATIVE_ARRAY_BUFFER_VIEWS)
  248. for (NAME in TypedArrayConstructorsList) {
  249. if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);
  250. }
  251. }
  252. if (
  253. !NATIVE_ARRAY_BUFFER_VIEWS ||
  254. !TypedArrayPrototype ||
  255. TypedArrayPrototype === ObjectPrototype
  256. ) {
  257. TypedArrayPrototype = TypedArray.prototype;
  258. if (NATIVE_ARRAY_BUFFER_VIEWS)
  259. for (NAME in TypedArrayConstructorsList) {
  260. if (global[NAME])
  261. setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
  262. }
  263. }
  264. // WebKit bug - one more object in Uint8ClampedArray prototype chain
  265. if (
  266. NATIVE_ARRAY_BUFFER_VIEWS &&
  267. getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype
  268. ) {
  269. setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
  270. }
  271. if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {
  272. TYPED_ARRAY_TAG_REQIRED = true;
  273. defineProperty(TypedArrayPrototype, TO_STRING_TAG, {
  274. get: function () {
  275. return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
  276. }
  277. });
  278. for (NAME in TypedArrayConstructorsList)
  279. if (global[NAME]) {
  280. createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);
  281. }
  282. }
  283. module.exports = {
  284. NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
  285. TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
  286. aTypedArray: aTypedArray,
  287. aTypedArrayConstructor: aTypedArrayConstructor,
  288. exportTypedArrayMethod: exportTypedArrayMethod,
  289. exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
  290. isView: isView,
  291. isTypedArray: isTypedArray,
  292. TypedArray: TypedArray,
  293. TypedArrayPrototype: TypedArrayPrototype
  294. };
  295. /***/
  296. },
  297. /***/ 3331: /***/ function (
  298. module,
  299. __unused_webpack_exports,
  300. __webpack_require__
  301. ) {
  302. "use strict";
  303. var global = __webpack_require__(7854);
  304. var DESCRIPTORS = __webpack_require__(9781);
  305. var NATIVE_ARRAY_BUFFER = __webpack_require__(4019);
  306. var createNonEnumerableProperty = __webpack_require__(8880);
  307. var redefineAll = __webpack_require__(2248);
  308. var fails = __webpack_require__(7293);
  309. var anInstance = __webpack_require__(5787);
  310. var toInteger = __webpack_require__(9958);
  311. var toLength = __webpack_require__(7466);
  312. var toIndex = __webpack_require__(7067);
  313. var IEEE754 = __webpack_require__(1179);
  314. var getPrototypeOf = __webpack_require__(9518);
  315. var setPrototypeOf = __webpack_require__(7674);
  316. var getOwnPropertyNames = __webpack_require__(8006).f;
  317. var defineProperty = __webpack_require__(3070).f;
  318. var arrayFill = __webpack_require__(1285);
  319. var setToStringTag = __webpack_require__(8003);
  320. var InternalStateModule = __webpack_require__(9909);
  321. var getInternalState = InternalStateModule.get;
  322. var setInternalState = InternalStateModule.set;
  323. var ARRAY_BUFFER = "ArrayBuffer";
  324. var DATA_VIEW = "DataView";
  325. var PROTOTYPE = "prototype";
  326. var WRONG_LENGTH = "Wrong length";
  327. var WRONG_INDEX = "Wrong index";
  328. var NativeArrayBuffer = global[ARRAY_BUFFER];
  329. var $ArrayBuffer = NativeArrayBuffer;
  330. var $DataView = global[DATA_VIEW];
  331. var $DataViewPrototype = $DataView && $DataView[PROTOTYPE];
  332. var ObjectPrototype = Object.prototype;
  333. var RangeError = global.RangeError;
  334. var packIEEE754 = IEEE754.pack;
  335. var unpackIEEE754 = IEEE754.unpack;
  336. var packInt8 = function (number) {
  337. return [number & 0xff];
  338. };
  339. var packInt16 = function (number) {
  340. return [number & 0xff, (number >> 8) & 0xff];
  341. };
  342. var packInt32 = function (number) {
  343. return [
  344. number & 0xff,
  345. (number >> 8) & 0xff,
  346. (number >> 16) & 0xff,
  347. (number >> 24) & 0xff
  348. ];
  349. };
  350. var unpackInt32 = function (buffer) {
  351. return (
  352. (buffer[3] << 24) | (buffer[2] << 16) | (buffer[1] << 8) | buffer[0]
  353. );
  354. };
  355. var packFloat32 = function (number) {
  356. return packIEEE754(number, 23, 4);
  357. };
  358. var packFloat64 = function (number) {
  359. return packIEEE754(number, 52, 8);
  360. };
  361. var addGetter = function (Constructor, key) {
  362. defineProperty(Constructor[PROTOTYPE], key, {
  363. get: function () {
  364. return getInternalState(this)[key];
  365. }
  366. });
  367. };
  368. var get = function (view, count, index, isLittleEndian) {
  369. var intIndex = toIndex(index);
  370. var store = getInternalState(view);
  371. if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
  372. var bytes = getInternalState(store.buffer).bytes;
  373. var start = intIndex + store.byteOffset;
  374. var pack = bytes.slice(start, start + count);
  375. return isLittleEndian ? pack : pack.reverse();
  376. };
  377. var set = function (
  378. view,
  379. count,
  380. index,
  381. conversion,
  382. value,
  383. isLittleEndian
  384. ) {
  385. var intIndex = toIndex(index);
  386. var store = getInternalState(view);
  387. if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
  388. var bytes = getInternalState(store.buffer).bytes;
  389. var start = intIndex + store.byteOffset;
  390. var pack = conversion(+value);
  391. for (var i = 0; i < count; i++)
  392. bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
  393. };
  394. if (!NATIVE_ARRAY_BUFFER) {
  395. $ArrayBuffer = function ArrayBuffer(length) {
  396. anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
  397. var byteLength = toIndex(length);
  398. setInternalState(this, {
  399. bytes: arrayFill.call(new Array(byteLength), 0),
  400. byteLength: byteLength
  401. });
  402. if (!DESCRIPTORS) this.byteLength = byteLength;
  403. };
  404. $DataView = function DataView(buffer, byteOffset, byteLength) {
  405. anInstance(this, $DataView, DATA_VIEW);
  406. anInstance(buffer, $ArrayBuffer, DATA_VIEW);
  407. var bufferLength = getInternalState(buffer).byteLength;
  408. var offset = toInteger(byteOffset);
  409. if (offset < 0 || offset > bufferLength)
  410. throw RangeError("Wrong offset");
  411. byteLength =
  412. byteLength === undefined
  413. ? bufferLength - offset
  414. : toLength(byteLength);
  415. if (offset + byteLength > bufferLength)
  416. throw RangeError(WRONG_LENGTH);
  417. setInternalState(this, {
  418. buffer: buffer,
  419. byteLength: byteLength,
  420. byteOffset: offset
  421. });
  422. if (!DESCRIPTORS) {
  423. this.buffer = buffer;
  424. this.byteLength = byteLength;
  425. this.byteOffset = offset;
  426. }
  427. };
  428. if (DESCRIPTORS) {
  429. addGetter($ArrayBuffer, "byteLength");
  430. addGetter($DataView, "buffer");
  431. addGetter($DataView, "byteLength");
  432. addGetter($DataView, "byteOffset");
  433. }
  434. redefineAll($DataView[PROTOTYPE], {
  435. getInt8: function getInt8(byteOffset) {
  436. return (get(this, 1, byteOffset)[0] << 24) >> 24;
  437. },
  438. getUint8: function getUint8(byteOffset) {
  439. return get(this, 1, byteOffset)[0];
  440. },
  441. getInt16: function getInt16(byteOffset /* , littleEndian */) {
  442. var bytes = get(
  443. this,
  444. 2,
  445. byteOffset,
  446. arguments.length > 1 ? arguments[1] : undefined
  447. );
  448. return (((bytes[1] << 8) | bytes[0]) << 16) >> 16;
  449. },
  450. getUint16: function getUint16(byteOffset /* , littleEndian */) {
  451. var bytes = get(
  452. this,
  453. 2,
  454. byteOffset,
  455. arguments.length > 1 ? arguments[1] : undefined
  456. );
  457. return (bytes[1] << 8) | bytes[0];
  458. },
  459. getInt32: function getInt32(byteOffset /* , littleEndian */) {
  460. return unpackInt32(
  461. get(
  462. this,
  463. 4,
  464. byteOffset,
  465. arguments.length > 1 ? arguments[1] : undefined
  466. )
  467. );
  468. },
  469. getUint32: function getUint32(byteOffset /* , littleEndian */) {
  470. return (
  471. unpackInt32(
  472. get(
  473. this,
  474. 4,
  475. byteOffset,
  476. arguments.length > 1 ? arguments[1] : undefined
  477. )
  478. ) >>> 0
  479. );
  480. },
  481. getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
  482. return unpackIEEE754(
  483. get(
  484. this,
  485. 4,
  486. byteOffset,
  487. arguments.length > 1 ? arguments[1] : undefined
  488. ),
  489. 23
  490. );
  491. },
  492. getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
  493. return unpackIEEE754(
  494. get(
  495. this,
  496. 8,
  497. byteOffset,
  498. arguments.length > 1 ? arguments[1] : undefined
  499. ),
  500. 52
  501. );
  502. },
  503. setInt8: function setInt8(byteOffset, value) {
  504. set(this, 1, byteOffset, packInt8, value);
  505. },
  506. setUint8: function setUint8(byteOffset, value) {
  507. set(this, 1, byteOffset, packInt8, value);
  508. },
  509. setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
  510. set(
  511. this,
  512. 2,
  513. byteOffset,
  514. packInt16,
  515. value,
  516. arguments.length > 2 ? arguments[2] : undefined
  517. );
  518. },
  519. setUint16: function setUint16(
  520. byteOffset,
  521. value /* , littleEndian */
  522. ) {
  523. set(
  524. this,
  525. 2,
  526. byteOffset,
  527. packInt16,
  528. value,
  529. arguments.length > 2 ? arguments[2] : undefined
  530. );
  531. },
  532. setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
  533. set(
  534. this,
  535. 4,
  536. byteOffset,
  537. packInt32,
  538. value,
  539. arguments.length > 2 ? arguments[2] : undefined
  540. );
  541. },
  542. setUint32: function setUint32(
  543. byteOffset,
  544. value /* , littleEndian */
  545. ) {
  546. set(
  547. this,
  548. 4,
  549. byteOffset,
  550. packInt32,
  551. value,
  552. arguments.length > 2 ? arguments[2] : undefined
  553. );
  554. },
  555. setFloat32: function setFloat32(
  556. byteOffset,
  557. value /* , littleEndian */
  558. ) {
  559. set(
  560. this,
  561. 4,
  562. byteOffset,
  563. packFloat32,
  564. value,
  565. arguments.length > 2 ? arguments[2] : undefined
  566. );
  567. },
  568. setFloat64: function setFloat64(
  569. byteOffset,
  570. value /* , littleEndian */
  571. ) {
  572. set(
  573. this,
  574. 8,
  575. byteOffset,
  576. packFloat64,
  577. value,
  578. arguments.length > 2 ? arguments[2] : undefined
  579. );
  580. }
  581. });
  582. } else {
  583. if (
  584. !fails(function () {
  585. NativeArrayBuffer(1);
  586. }) ||
  587. !fails(function () {
  588. new NativeArrayBuffer(-1); // eslint-disable-line no-new
  589. }) ||
  590. fails(function () {
  591. new NativeArrayBuffer(); // eslint-disable-line no-new
  592. new NativeArrayBuffer(1.5); // eslint-disable-line no-new
  593. new NativeArrayBuffer(NaN); // eslint-disable-line no-new
  594. return NativeArrayBuffer.name != ARRAY_BUFFER;
  595. })
  596. ) {
  597. $ArrayBuffer = function ArrayBuffer(length) {
  598. anInstance(this, $ArrayBuffer);
  599. return new NativeArrayBuffer(toIndex(length));
  600. };
  601. var ArrayBufferPrototype = ($ArrayBuffer[PROTOTYPE] =
  602. NativeArrayBuffer[PROTOTYPE]);
  603. for (
  604. var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key;
  605. keys.length > j;
  606. ) {
  607. if (!((key = keys[j++]) in $ArrayBuffer)) {
  608. createNonEnumerableProperty(
  609. $ArrayBuffer,
  610. key,
  611. NativeArrayBuffer[key]
  612. );
  613. }
  614. }
  615. ArrayBufferPrototype.constructor = $ArrayBuffer;
  616. }
  617. // WebKit bug - the same parent prototype for typed arrays and data view
  618. if (
  619. setPrototypeOf &&
  620. getPrototypeOf($DataViewPrototype) !== ObjectPrototype
  621. ) {
  622. setPrototypeOf($DataViewPrototype, ObjectPrototype);
  623. }
  624. // iOS Safari 7.x bug
  625. var testView = new $DataView(new $ArrayBuffer(2));
  626. var nativeSetInt8 = $DataViewPrototype.setInt8;
  627. testView.setInt8(0, 2147483648);
  628. testView.setInt8(1, 2147483649);
  629. if (testView.getInt8(0) || !testView.getInt8(1))
  630. redefineAll(
  631. $DataViewPrototype,
  632. {
  633. setInt8: function setInt8(byteOffset, value) {
  634. nativeSetInt8.call(this, byteOffset, (value << 24) >> 24);
  635. },
  636. setUint8: function setUint8(byteOffset, value) {
  637. nativeSetInt8.call(this, byteOffset, (value << 24) >> 24);
  638. }
  639. },
  640. { unsafe: true }
  641. );
  642. }
  643. setToStringTag($ArrayBuffer, ARRAY_BUFFER);
  644. setToStringTag($DataView, DATA_VIEW);
  645. module.exports = {
  646. ArrayBuffer: $ArrayBuffer,
  647. DataView: $DataView
  648. };
  649. /***/
  650. },
  651. /***/ 1285: /***/ function (
  652. module,
  653. __unused_webpack_exports,
  654. __webpack_require__
  655. ) {
  656. "use strict";
  657. var toObject = __webpack_require__(7908);
  658. var toAbsoluteIndex = __webpack_require__(1400);
  659. var toLength = __webpack_require__(7466);
  660. // `Array.prototype.fill` method implementation
  661. // https://tc39.github.io/ecma262/#sec-array.prototype.fill
  662. module.exports = function fill(value /* , start = 0, end = @length */) {
  663. var O = toObject(this);
  664. var length = toLength(O.length);
  665. var argumentsLength = arguments.length;
  666. var index = toAbsoluteIndex(
  667. argumentsLength > 1 ? arguments[1] : undefined,
  668. length
  669. );
  670. var end = argumentsLength > 2 ? arguments[2] : undefined;
  671. var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  672. while (endPos > index) O[index++] = value;
  673. return O;
  674. };
  675. /***/
  676. },
  677. /***/ 8533: /***/ function (
  678. module,
  679. __unused_webpack_exports,
  680. __webpack_require__
  681. ) {
  682. "use strict";
  683. var $forEach = __webpack_require__(2092).forEach;
  684. var arrayMethodIsStrict = __webpack_require__(9341);
  685. var arrayMethodUsesToLength = __webpack_require__(9207);
  686. var STRICT_METHOD = arrayMethodIsStrict("forEach");
  687. var USES_TO_LENGTH = arrayMethodUsesToLength("forEach");
  688. // `Array.prototype.forEach` method implementation
  689. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  690. module.exports =
  691. !STRICT_METHOD || !USES_TO_LENGTH
  692. ? function forEach(callbackfn /* , thisArg */) {
  693. return $forEach(
  694. this,
  695. callbackfn,
  696. arguments.length > 1 ? arguments[1] : undefined
  697. );
  698. }
  699. : [].forEach;
  700. /***/
  701. },
  702. /***/ 1318: /***/ function (
  703. module,
  704. __unused_webpack_exports,
  705. __webpack_require__
  706. ) {
  707. var toIndexedObject = __webpack_require__(5656);
  708. var toLength = __webpack_require__(7466);
  709. var toAbsoluteIndex = __webpack_require__(1400);
  710. // `Array.prototype.{ indexOf, includes }` methods implementation
  711. var createMethod = function (IS_INCLUDES) {
  712. return function ($this, el, fromIndex) {
  713. var O = toIndexedObject($this);
  714. var length = toLength(O.length);
  715. var index = toAbsoluteIndex(fromIndex, length);
  716. var value;
  717. // Array#includes uses SameValueZero equality algorithm
  718. // eslint-disable-next-line no-self-compare
  719. if (IS_INCLUDES && el != el)
  720. while (length > index) {
  721. value = O[index++];
  722. // eslint-disable-next-line no-self-compare
  723. if (value != value) return true;
  724. // Array#indexOf ignores holes, Array#includes - not
  725. }
  726. else
  727. for (; length > index; index++) {
  728. if ((IS_INCLUDES || index in O) && O[index] === el)
  729. return IS_INCLUDES || index || 0;
  730. }
  731. return !IS_INCLUDES && -1;
  732. };
  733. };
  734. module.exports = {
  735. // `Array.prototype.includes` method
  736. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  737. includes: createMethod(true),
  738. // `Array.prototype.indexOf` method
  739. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  740. indexOf: createMethod(false)
  741. };
  742. /***/
  743. },
  744. /***/ 2092: /***/ function (
  745. module,
  746. __unused_webpack_exports,
  747. __webpack_require__
  748. ) {
  749. var bind = __webpack_require__(9974);
  750. var IndexedObject = __webpack_require__(8361);
  751. var toObject = __webpack_require__(7908);
  752. var toLength = __webpack_require__(7466);
  753. var arraySpeciesCreate = __webpack_require__(5417);
  754. var push = [].push;
  755. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  756. var createMethod = function (TYPE) {
  757. var IS_MAP = TYPE == 1;
  758. var IS_FILTER = TYPE == 2;
  759. var IS_SOME = TYPE == 3;
  760. var IS_EVERY = TYPE == 4;
  761. var IS_FIND_INDEX = TYPE == 6;
  762. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  763. return function ($this, callbackfn, that, specificCreate) {
  764. var O = toObject($this);
  765. var self = IndexedObject(O);
  766. var boundFunction = bind(callbackfn, that, 3);
  767. var length = toLength(self.length);
  768. var index = 0;
  769. var create = specificCreate || arraySpeciesCreate;
  770. var target = IS_MAP
  771. ? create($this, length)
  772. : IS_FILTER
  773. ? create($this, 0)
  774. : undefined;
  775. var value, result;
  776. for (; length > index; index++)
  777. if (NO_HOLES || index in self) {
  778. value = self[index];
  779. result = boundFunction(value, index, O);
  780. if (TYPE) {
  781. if (IS_MAP) target[index] = result; // map
  782. else if (result)
  783. switch (TYPE) {
  784. case 3:
  785. return true; // some
  786. case 5:
  787. return value; // find
  788. case 6:
  789. return index; // findIndex
  790. case 2:
  791. push.call(target, value); // filter
  792. }
  793. else if (IS_EVERY) return false; // every
  794. }
  795. }
  796. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  797. };
  798. };
  799. module.exports = {
  800. // `Array.prototype.forEach` method
  801. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  802. forEach: createMethod(0),
  803. // `Array.prototype.map` method
  804. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  805. map: createMethod(1),
  806. // `Array.prototype.filter` method
  807. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  808. filter: createMethod(2),
  809. // `Array.prototype.some` method
  810. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  811. some: createMethod(3),
  812. // `Array.prototype.every` method
  813. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  814. every: createMethod(4),
  815. // `Array.prototype.find` method
  816. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  817. find: createMethod(5),
  818. // `Array.prototype.findIndex` method
  819. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  820. findIndex: createMethod(6)
  821. };
  822. /***/
  823. },
  824. /***/ 1194: /***/ function (
  825. module,
  826. __unused_webpack_exports,
  827. __webpack_require__
  828. ) {
  829. var fails = __webpack_require__(7293);
  830. var wellKnownSymbol = __webpack_require__(5112);
  831. var V8_VERSION = __webpack_require__(7392);
  832. var SPECIES = wellKnownSymbol("species");
  833. module.exports = function (METHOD_NAME) {
  834. // We can't use this feature detection in V8 since it causes
  835. // deoptimization and serious performance degradation
  836. // https://github.com/zloirock/core-js/issues/677
  837. return (
  838. V8_VERSION >= 51 ||
  839. !fails(function () {
  840. var array = [];
  841. var constructor = (array.constructor = {});
  842. constructor[SPECIES] = function () {
  843. return { foo: 1 };
  844. };
  845. return array[METHOD_NAME](Boolean).foo !== 1;
  846. })
  847. );
  848. };
  849. /***/
  850. },
  851. /***/ 9341: /***/ function (
  852. module,
  853. __unused_webpack_exports,
  854. __webpack_require__
  855. ) {
  856. "use strict";
  857. var fails = __webpack_require__(7293);
  858. module.exports = function (METHOD_NAME, argument) {
  859. var method = [][METHOD_NAME];
  860. return (
  861. !!method &&
  862. fails(function () {
  863. // eslint-disable-next-line no-useless-call,no-throw-literal
  864. method.call(
  865. null,
  866. argument ||
  867. function () {
  868. throw 1;
  869. },
  870. 1
  871. );
  872. })
  873. );
  874. };
  875. /***/
  876. },
  877. /***/ 9207: /***/ function (
  878. module,
  879. __unused_webpack_exports,
  880. __webpack_require__
  881. ) {
  882. var DESCRIPTORS = __webpack_require__(9781);
  883. var fails = __webpack_require__(7293);
  884. var has = __webpack_require__(6656);
  885. var defineProperty = Object.defineProperty;
  886. var cache = {};
  887. var thrower = function (it) {
  888. throw it;
  889. };
  890. module.exports = function (METHOD_NAME, options) {
  891. if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
  892. if (!options) options = {};
  893. var method = [][METHOD_NAME];
  894. var ACCESSORS = has(options, "ACCESSORS") ? options.ACCESSORS : false;
  895. var argument0 = has(options, 0) ? options[0] : thrower;
  896. var argument1 = has(options, 1) ? options[1] : undefined;
  897. return (cache[METHOD_NAME] =
  898. !!method &&
  899. !fails(function () {
  900. if (ACCESSORS && !DESCRIPTORS) return true;
  901. var O = { length: -1 };
  902. if (ACCESSORS)
  903. defineProperty(O, 1, { enumerable: true, get: thrower });
  904. else O[1] = 1;
  905. method.call(O, argument0, argument1);
  906. }));
  907. };
  908. /***/
  909. },
  910. /***/ 5417: /***/ function (
  911. module,
  912. __unused_webpack_exports,
  913. __webpack_require__
  914. ) {
  915. var isObject = __webpack_require__(111);
  916. var isArray = __webpack_require__(3157);
  917. var wellKnownSymbol = __webpack_require__(5112);
  918. var SPECIES = wellKnownSymbol("species");
  919. // `ArraySpeciesCreate` abstract operation
  920. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  921. module.exports = function (originalArray, length) {
  922. var C;
  923. if (isArray(originalArray)) {
  924. C = originalArray.constructor;
  925. // cross-realm fallback
  926. if (typeof C == "function" && (C === Array || isArray(C.prototype)))
  927. C = undefined;
  928. else if (isObject(C)) {
  929. C = C[SPECIES];
  930. if (C === null) C = undefined;
  931. }
  932. }
  933. return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  934. };
  935. /***/
  936. },
  937. /***/ 3411: /***/ function (
  938. module,
  939. __unused_webpack_exports,
  940. __webpack_require__
  941. ) {
  942. var anObject = __webpack_require__(9670);
  943. // call something on iterator step with safe closing on error
  944. module.exports = function (iterator, fn, value, ENTRIES) {
  945. try {
  946. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  947. // 7.4.6 IteratorClose(iterator, completion)
  948. } catch (error) {
  949. var returnMethod = iterator["return"];
  950. if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
  951. throw error;
  952. }
  953. };
  954. /***/
  955. },
  956. /***/ 7072: /***/ function (
  957. module,
  958. __unused_webpack_exports,
  959. __webpack_require__
  960. ) {
  961. var wellKnownSymbol = __webpack_require__(5112);
  962. var ITERATOR = wellKnownSymbol("iterator");
  963. var SAFE_CLOSING = false;
  964. try {
  965. var called = 0;
  966. var iteratorWithReturn = {
  967. next: function () {
  968. return { done: !!called++ };
  969. },
  970. return: function () {
  971. SAFE_CLOSING = true;
  972. }
  973. };
  974. iteratorWithReturn[ITERATOR] = function () {
  975. return this;
  976. };
  977. // eslint-disable-next-line no-throw-literal
  978. Array.from(iteratorWithReturn, function () {
  979. throw 2;
  980. });
  981. } catch (error) {
  982. /* empty */
  983. }
  984. module.exports = function (exec, SKIP_CLOSING) {
  985. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  986. var ITERATION_SUPPORT = false;
  987. try {
  988. var object = {};
  989. object[ITERATOR] = function () {
  990. return {
  991. next: function () {
  992. return { done: (ITERATION_SUPPORT = true) };
  993. }
  994. };
  995. };
  996. exec(object);
  997. } catch (error) {
  998. /* empty */
  999. }
  1000. return ITERATION_SUPPORT;
  1001. };
  1002. /***/
  1003. },
  1004. /***/ 4326: /***/ function (module) {
  1005. var toString = {}.toString;
  1006. module.exports = function (it) {
  1007. return toString.call(it).slice(8, -1);
  1008. };
  1009. /***/
  1010. },
  1011. /***/ 648: /***/ function (
  1012. module,
  1013. __unused_webpack_exports,
  1014. __webpack_require__
  1015. ) {
  1016. var TO_STRING_TAG_SUPPORT = __webpack_require__(1694);
  1017. var classofRaw = __webpack_require__(4326);
  1018. var wellKnownSymbol = __webpack_require__(5112);
  1019. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  1020. // ES3 wrong here
  1021. var CORRECT_ARGUMENTS =
  1022. classofRaw(
  1023. (function () {
  1024. return arguments;
  1025. })()
  1026. ) == "Arguments";
  1027. // fallback for IE11 Script Access Denied error
  1028. var tryGet = function (it, key) {
  1029. try {
  1030. return it[key];
  1031. } catch (error) {
  1032. /* empty */
  1033. }
  1034. };
  1035. // getting tag from ES6+ `Object.prototype.toString`
  1036. module.exports = TO_STRING_TAG_SUPPORT
  1037. ? classofRaw
  1038. : function (it) {
  1039. var O, tag, result;
  1040. return it === undefined
  1041. ? "Undefined"
  1042. : it === null
  1043. ? "Null"
  1044. : // @@toStringTag case
  1045. typeof (tag = tryGet((O = Object(it)), TO_STRING_TAG)) == "string"
  1046. ? tag
  1047. : // builtinTag case
  1048. CORRECT_ARGUMENTS
  1049. ? classofRaw(O)
  1050. : // ES3 arguments fallback
  1051. (result = classofRaw(O)) == "Object" &&
  1052. typeof O.callee == "function"
  1053. ? "Arguments"
  1054. : result;
  1055. };
  1056. /***/
  1057. },
  1058. /***/ 9920: /***/ function (
  1059. module,
  1060. __unused_webpack_exports,
  1061. __webpack_require__
  1062. ) {
  1063. var has = __webpack_require__(6656);
  1064. var ownKeys = __webpack_require__(3887);
  1065. var getOwnPropertyDescriptorModule = __webpack_require__(1236);
  1066. var definePropertyModule = __webpack_require__(3070);
  1067. module.exports = function (target, source) {
  1068. var keys = ownKeys(source);
  1069. var defineProperty = definePropertyModule.f;
  1070. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  1071. for (var i = 0; i < keys.length; i++) {
  1072. var key = keys[i];
  1073. if (!has(target, key))
  1074. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  1075. }
  1076. };
  1077. /***/
  1078. },
  1079. /***/ 8544: /***/ function (
  1080. module,
  1081. __unused_webpack_exports,
  1082. __webpack_require__
  1083. ) {
  1084. var fails = __webpack_require__(7293);
  1085. module.exports = !fails(function () {
  1086. function F() {
  1087. /* empty */
  1088. }
  1089. F.prototype.constructor = null;
  1090. return Object.getPrototypeOf(new F()) !== F.prototype;
  1091. });
  1092. /***/
  1093. },
  1094. /***/ 4994: /***/ function (
  1095. module,
  1096. __unused_webpack_exports,
  1097. __webpack_require__
  1098. ) {
  1099. "use strict";
  1100. var IteratorPrototype = __webpack_require__(3383).IteratorPrototype;
  1101. var create = __webpack_require__(30);
  1102. var createPropertyDescriptor = __webpack_require__(9114);
  1103. var setToStringTag = __webpack_require__(8003);
  1104. var Iterators = __webpack_require__(7497);
  1105. var returnThis = function () {
  1106. return this;
  1107. };
  1108. module.exports = function (IteratorConstructor, NAME, next) {
  1109. var TO_STRING_TAG = NAME + " Iterator";
  1110. IteratorConstructor.prototype = create(IteratorPrototype, {
  1111. next: createPropertyDescriptor(1, next)
  1112. });
  1113. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  1114. Iterators[TO_STRING_TAG] = returnThis;
  1115. return IteratorConstructor;
  1116. };
  1117. /***/
  1118. },
  1119. /***/ 8880: /***/ function (
  1120. module,
  1121. __unused_webpack_exports,
  1122. __webpack_require__
  1123. ) {
  1124. var DESCRIPTORS = __webpack_require__(9781);
  1125. var definePropertyModule = __webpack_require__(3070);
  1126. var createPropertyDescriptor = __webpack_require__(9114);
  1127. module.exports = DESCRIPTORS
  1128. ? function (object, key, value) {
  1129. return definePropertyModule.f(
  1130. object,
  1131. key,
  1132. createPropertyDescriptor(1, value)
  1133. );
  1134. }
  1135. : function (object, key, value) {
  1136. object[key] = value;
  1137. return object;
  1138. };
  1139. /***/
  1140. },
  1141. /***/ 9114: /***/ function (module) {
  1142. module.exports = function (bitmap, value) {
  1143. return {
  1144. enumerable: !(bitmap & 1),
  1145. configurable: !(bitmap & 2),
  1146. writable: !(bitmap & 4),
  1147. value: value
  1148. };
  1149. };
  1150. /***/
  1151. },
  1152. /***/ 6135: /***/ function (
  1153. module,
  1154. __unused_webpack_exports,
  1155. __webpack_require__
  1156. ) {
  1157. "use strict";
  1158. var toPrimitive = __webpack_require__(7593);
  1159. var definePropertyModule = __webpack_require__(3070);
  1160. var createPropertyDescriptor = __webpack_require__(9114);
  1161. module.exports = function (object, key, value) {
  1162. var propertyKey = toPrimitive(key);
  1163. if (propertyKey in object)
  1164. definePropertyModule.f(
  1165. object,
  1166. propertyKey,
  1167. createPropertyDescriptor(0, value)
  1168. );
  1169. else object[propertyKey] = value;
  1170. };
  1171. /***/
  1172. },
  1173. /***/ 654: /***/ function (
  1174. module,
  1175. __unused_webpack_exports,
  1176. __webpack_require__
  1177. ) {
  1178. "use strict";
  1179. var $ = __webpack_require__(2109);
  1180. var createIteratorConstructor = __webpack_require__(4994);
  1181. var getPrototypeOf = __webpack_require__(9518);
  1182. var setPrototypeOf = __webpack_require__(7674);
  1183. var setToStringTag = __webpack_require__(8003);
  1184. var createNonEnumerableProperty = __webpack_require__(8880);
  1185. var redefine = __webpack_require__(1320);
  1186. var wellKnownSymbol = __webpack_require__(5112);
  1187. var IS_PURE = __webpack_require__(1913);
  1188. var Iterators = __webpack_require__(7497);
  1189. var IteratorsCore = __webpack_require__(3383);
  1190. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  1191. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  1192. var ITERATOR = wellKnownSymbol("iterator");
  1193. var KEYS = "keys";
  1194. var VALUES = "values";
  1195. var ENTRIES = "entries";
  1196. var returnThis = function () {
  1197. return this;
  1198. };
  1199. module.exports = function (
  1200. Iterable,
  1201. NAME,
  1202. IteratorConstructor,
  1203. next,
  1204. DEFAULT,
  1205. IS_SET,
  1206. FORCED
  1207. ) {
  1208. createIteratorConstructor(IteratorConstructor, NAME, next);
  1209. var getIterationMethod = function (KIND) {
  1210. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  1211. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
  1212. return IterablePrototype[KIND];
  1213. switch (KIND) {
  1214. case KEYS:
  1215. return function keys() {
  1216. return new IteratorConstructor(this, KIND);
  1217. };
  1218. case VALUES:
  1219. return function values() {
  1220. return new IteratorConstructor(this, KIND);
  1221. };
  1222. case ENTRIES:
  1223. return function entries() {
  1224. return new IteratorConstructor(this, KIND);
  1225. };
  1226. }
  1227. return function () {
  1228. return new IteratorConstructor(this);
  1229. };
  1230. };
  1231. var TO_STRING_TAG = NAME + " Iterator";
  1232. var INCORRECT_VALUES_NAME = false;
  1233. var IterablePrototype = Iterable.prototype;
  1234. var nativeIterator =
  1235. IterablePrototype[ITERATOR] ||
  1236. IterablePrototype["@@iterator"] ||
  1237. (DEFAULT && IterablePrototype[DEFAULT]);
  1238. var defaultIterator =
  1239. (!BUGGY_SAFARI_ITERATORS && nativeIterator) ||
  1240. getIterationMethod(DEFAULT);
  1241. var anyNativeIterator =
  1242. NAME == "Array"
  1243. ? IterablePrototype.entries || nativeIterator
  1244. : nativeIterator;
  1245. var CurrentIteratorPrototype, methods, KEY;
  1246. // fix native
  1247. if (anyNativeIterator) {
  1248. CurrentIteratorPrototype = getPrototypeOf(
  1249. anyNativeIterator.call(new Iterable())
  1250. );
  1251. if (
  1252. IteratorPrototype !== Object.prototype &&
  1253. CurrentIteratorPrototype.next
  1254. ) {
  1255. if (
  1256. !IS_PURE &&
  1257. getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype
  1258. ) {
  1259. if (setPrototypeOf) {
  1260. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  1261. } else if (
  1262. typeof CurrentIteratorPrototype[ITERATOR] != "function"
  1263. ) {
  1264. createNonEnumerableProperty(
  1265. CurrentIteratorPrototype,
  1266. ITERATOR,
  1267. returnThis
  1268. );
  1269. }
  1270. }
  1271. // Set @@toStringTag to native iterators
  1272. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  1273. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  1274. }
  1275. }
  1276. // fix Array#{values, @@iterator}.name in V8 / FF
  1277. if (
  1278. DEFAULT == VALUES &&
  1279. nativeIterator &&
  1280. nativeIterator.name !== VALUES
  1281. ) {
  1282. INCORRECT_VALUES_NAME = true;
  1283. defaultIterator = function values() {
  1284. return nativeIterator.call(this);
  1285. };
  1286. }
  1287. // define iterator
  1288. if (
  1289. (!IS_PURE || FORCED) &&
  1290. IterablePrototype[ITERATOR] !== defaultIterator
  1291. ) {
  1292. createNonEnumerableProperty(
  1293. IterablePrototype,
  1294. ITERATOR,
  1295. defaultIterator
  1296. );
  1297. }
  1298. Iterators[NAME] = defaultIterator;
  1299. // export additional methods
  1300. if (DEFAULT) {
  1301. methods = {
  1302. values: getIterationMethod(VALUES),
  1303. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  1304. entries: getIterationMethod(ENTRIES)
  1305. };
  1306. if (FORCED)
  1307. for (KEY in methods) {
  1308. if (
  1309. BUGGY_SAFARI_ITERATORS ||
  1310. INCORRECT_VALUES_NAME ||
  1311. !(KEY in IterablePrototype)
  1312. ) {
  1313. redefine(IterablePrototype, KEY, methods[KEY]);
  1314. }
  1315. }
  1316. else
  1317. $(
  1318. {
  1319. target: NAME,
  1320. proto: true,
  1321. forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME
  1322. },
  1323. methods
  1324. );
  1325. }
  1326. return methods;
  1327. };
  1328. /***/
  1329. },
  1330. /***/ 7235: /***/ function (
  1331. module,
  1332. __unused_webpack_exports,
  1333. __webpack_require__
  1334. ) {
  1335. var path = __webpack_require__(857);
  1336. var has = __webpack_require__(6656);
  1337. var wrappedWellKnownSymbolModule = __webpack_require__(6061);
  1338. var defineProperty = __webpack_require__(3070).f;
  1339. module.exports = function (NAME) {
  1340. var Symbol = path.Symbol || (path.Symbol = {});
  1341. if (!has(Symbol, NAME))
  1342. defineProperty(Symbol, NAME, {
  1343. value: wrappedWellKnownSymbolModule.f(NAME)
  1344. });
  1345. };
  1346. /***/
  1347. },
  1348. /***/ 9781: /***/ function (
  1349. module,
  1350. __unused_webpack_exports,
  1351. __webpack_require__
  1352. ) {
  1353. var fails = __webpack_require__(7293);
  1354. // Thank's IE8 for his funny defineProperty
  1355. module.exports = !fails(function () {
  1356. return (
  1357. Object.defineProperty({}, 1, {
  1358. get: function () {
  1359. return 7;
  1360. }
  1361. })[1] != 7
  1362. );
  1363. });
  1364. /***/
  1365. },
  1366. /***/ 317: /***/ function (
  1367. module,
  1368. __unused_webpack_exports,
  1369. __webpack_require__
  1370. ) {
  1371. var global = __webpack_require__(7854);
  1372. var isObject = __webpack_require__(111);
  1373. var document = global.document;
  1374. // typeof document.createElement is 'object' in old IE
  1375. var EXISTS = isObject(document) && isObject(document.createElement);
  1376. module.exports = function (it) {
  1377. return EXISTS ? document.createElement(it) : {};
  1378. };
  1379. /***/
  1380. },
  1381. /***/ 8324: /***/ function (module) {
  1382. // iterable DOM collections
  1383. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1384. module.exports = {
  1385. CSSRuleList: 0,
  1386. CSSStyleDeclaration: 0,
  1387. CSSValueList: 0,
  1388. ClientRectList: 0,
  1389. DOMRectList: 0,
  1390. DOMStringList: 0,
  1391. DOMTokenList: 1,
  1392. DataTransferItemList: 0,
  1393. FileList: 0,
  1394. HTMLAllCollection: 0,
  1395. HTMLCollection: 0,
  1396. HTMLFormElement: 0,
  1397. HTMLSelectElement: 0,
  1398. MediaList: 0,
  1399. MimeTypeArray: 0,
  1400. NamedNodeMap: 0,
  1401. NodeList: 1,
  1402. PaintRequestList: 0,
  1403. Plugin: 0,
  1404. PluginArray: 0,
  1405. SVGLengthList: 0,
  1406. SVGNumberList: 0,
  1407. SVGPathSegList: 0,
  1408. SVGPointList: 0,
  1409. SVGStringList: 0,
  1410. SVGTransformList: 0,
  1411. SourceBufferList: 0,
  1412. StyleSheetList: 0,
  1413. TextTrackCueList: 0,
  1414. TextTrackList: 0,
  1415. TouchList: 0
  1416. };
  1417. /***/
  1418. },
  1419. /***/ 6833: /***/ function (
  1420. module,
  1421. __unused_webpack_exports,
  1422. __webpack_require__
  1423. ) {
  1424. var userAgent = __webpack_require__(8113);
  1425. module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
  1426. /***/
  1427. },
  1428. /***/ 8113: /***/ function (
  1429. module,
  1430. __unused_webpack_exports,
  1431. __webpack_require__
  1432. ) {
  1433. var getBuiltIn = __webpack_require__(5005);
  1434. module.exports = getBuiltIn("navigator", "userAgent") || "";
  1435. /***/
  1436. },
  1437. /***/ 7392: /***/ function (
  1438. module,
  1439. __unused_webpack_exports,
  1440. __webpack_require__
  1441. ) {
  1442. var global = __webpack_require__(7854);
  1443. var userAgent = __webpack_require__(8113);
  1444. var process = global.process;
  1445. var versions = process && process.versions;
  1446. var v8 = versions && versions.v8;
  1447. var match, version;
  1448. if (v8) {
  1449. match = v8.split(".");
  1450. version = match[0] + match[1];
  1451. } else if (userAgent) {
  1452. match = userAgent.match(/Edge\/(\d+)/);
  1453. if (!match || match[1] >= 74) {
  1454. match = userAgent.match(/Chrome\/(\d+)/);
  1455. if (match) version = match[1];
  1456. }
  1457. }
  1458. module.exports = version && +version;
  1459. /***/
  1460. },
  1461. /***/ 748: /***/ function (module) {
  1462. // IE8- don't enum bug keys
  1463. module.exports = [
  1464. "constructor",
  1465. "hasOwnProperty",
  1466. "isPrototypeOf",
  1467. "propertyIsEnumerable",
  1468. "toLocaleString",
  1469. "toString",
  1470. "valueOf"
  1471. ];
  1472. /***/
  1473. },
  1474. /***/ 2109: /***/ function (
  1475. module,
  1476. __unused_webpack_exports,
  1477. __webpack_require__
  1478. ) {
  1479. var global = __webpack_require__(7854);
  1480. var getOwnPropertyDescriptor = __webpack_require__(1236).f;
  1481. var createNonEnumerableProperty = __webpack_require__(8880);
  1482. var redefine = __webpack_require__(1320);
  1483. var setGlobal = __webpack_require__(3505);
  1484. var copyConstructorProperties = __webpack_require__(9920);
  1485. var isForced = __webpack_require__(4705);
  1486. /*
  1487. options.target - name of the target object
  1488. options.global - target is the global object
  1489. options.stat - export as static methods of target
  1490. options.proto - export as prototype methods of target
  1491. options.real - real prototype method for the `pure` version
  1492. options.forced - export even if the native feature is available
  1493. options.bind - bind methods to the target, required for the `pure` version
  1494. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  1495. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  1496. options.sham - add a flag to not completely full polyfills
  1497. options.enumerable - export as enumerable property
  1498. options.noTargetGet - prevent calling a getter on target
  1499. */
  1500. module.exports = function (options, source) {
  1501. var TARGET = options.target;
  1502. var GLOBAL = options.global;
  1503. var STATIC = options.stat;
  1504. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  1505. if (GLOBAL) {
  1506. target = global;
  1507. } else if (STATIC) {
  1508. target = global[TARGET] || setGlobal(TARGET, {});
  1509. } else {
  1510. target = (global[TARGET] || {}).prototype;
  1511. }
  1512. if (target)
  1513. for (key in source) {
  1514. sourceProperty = source[key];
  1515. if (options.noTargetGet) {
  1516. descriptor = getOwnPropertyDescriptor(target, key);
  1517. targetProperty = descriptor && descriptor.value;
  1518. } else targetProperty = target[key];
  1519. FORCED = isForced(
  1520. GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key,
  1521. options.forced
  1522. );
  1523. // contained in target
  1524. if (!FORCED && targetProperty !== undefined) {
  1525. if (typeof sourceProperty === typeof targetProperty) continue;
  1526. copyConstructorProperties(sourceProperty, targetProperty);
  1527. }
  1528. // add a flag to not completely full polyfills
  1529. if (options.sham || (targetProperty && targetProperty.sham)) {
  1530. createNonEnumerableProperty(sourceProperty, "sham", true);
  1531. }
  1532. // extend global
  1533. redefine(target, key, sourceProperty, options);
  1534. }
  1535. };
  1536. /***/
  1537. },
  1538. /***/ 7293: /***/ function (module) {
  1539. module.exports = function (exec) {
  1540. try {
  1541. return !!exec();
  1542. } catch (error) {
  1543. return true;
  1544. }
  1545. };
  1546. /***/
  1547. },
  1548. /***/ 9974: /***/ function (
  1549. module,
  1550. __unused_webpack_exports,
  1551. __webpack_require__
  1552. ) {
  1553. var aFunction = __webpack_require__(3099);
  1554. // optional / simple context binding
  1555. module.exports = function (fn, that, length) {
  1556. aFunction(fn);
  1557. if (that === undefined) return fn;
  1558. switch (length) {
  1559. case 0:
  1560. return function () {
  1561. return fn.call(that);
  1562. };
  1563. case 1:
  1564. return function (a) {
  1565. return fn.call(that, a);
  1566. };
  1567. case 2:
  1568. return function (a, b) {
  1569. return fn.call(that, a, b);
  1570. };
  1571. case 3:
  1572. return function (a, b, c) {
  1573. return fn.call(that, a, b, c);
  1574. };
  1575. }
  1576. return function (/* ...args */) {
  1577. return fn.apply(that, arguments);
  1578. };
  1579. };
  1580. /***/
  1581. },
  1582. /***/ 5005: /***/ function (
  1583. module,
  1584. __unused_webpack_exports,
  1585. __webpack_require__
  1586. ) {
  1587. var path = __webpack_require__(857);
  1588. var global = __webpack_require__(7854);
  1589. var aFunction = function (variable) {
  1590. return typeof variable == "function" ? variable : undefined;
  1591. };
  1592. module.exports = function (namespace, method) {
  1593. return arguments.length < 2
  1594. ? aFunction(path[namespace]) || aFunction(global[namespace])
  1595. : (path[namespace] && path[namespace][method]) ||
  1596. (global[namespace] && global[namespace][method]);
  1597. };
  1598. /***/
  1599. },
  1600. /***/ 1246: /***/ function (
  1601. module,
  1602. __unused_webpack_exports,
  1603. __webpack_require__
  1604. ) {
  1605. var classof = __webpack_require__(648);
  1606. var Iterators = __webpack_require__(7497);
  1607. var wellKnownSymbol = __webpack_require__(5112);
  1608. var ITERATOR = wellKnownSymbol("iterator");
  1609. module.exports = function (it) {
  1610. if (it != undefined)
  1611. return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)];
  1612. };
  1613. /***/
  1614. },
  1615. /***/ 7854: /***/ function (
  1616. module,
  1617. __unused_webpack_exports,
  1618. __webpack_require__
  1619. ) {
  1620. var check = function (it) {
  1621. return it && it.Math == Math && it;
  1622. };
  1623. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1624. module.exports =
  1625. // eslint-disable-next-line no-undef
  1626. check(typeof globalThis == "object" && globalThis) ||
  1627. check(typeof window == "object" && window) ||
  1628. check(typeof self == "object" && self) ||
  1629. check(
  1630. typeof __webpack_require__.g == "object" && __webpack_require__.g
  1631. ) ||
  1632. // eslint-disable-next-line no-new-func
  1633. Function("return this")();
  1634. /***/
  1635. },
  1636. /***/ 6656: /***/ function (module) {
  1637. var hasOwnProperty = {}.hasOwnProperty;
  1638. module.exports = function (it, key) {
  1639. return hasOwnProperty.call(it, key);
  1640. };
  1641. /***/
  1642. },
  1643. /***/ 3501: /***/ function (module) {
  1644. module.exports = {};
  1645. /***/
  1646. },
  1647. /***/ 842: /***/ function (
  1648. module,
  1649. __unused_webpack_exports,
  1650. __webpack_require__
  1651. ) {
  1652. var global = __webpack_require__(7854);
  1653. module.exports = function (a, b) {
  1654. var console = global.console;
  1655. if (console && console.error) {
  1656. arguments.length === 1 ? console.error(a) : console.error(a, b);
  1657. }
  1658. };
  1659. /***/
  1660. },
  1661. /***/ 490: /***/ function (
  1662. module,
  1663. __unused_webpack_exports,
  1664. __webpack_require__
  1665. ) {
  1666. var getBuiltIn = __webpack_require__(5005);
  1667. module.exports = getBuiltIn("document", "documentElement");
  1668. /***/
  1669. },
  1670. /***/ 4664: /***/ function (
  1671. module,
  1672. __unused_webpack_exports,
  1673. __webpack_require__
  1674. ) {
  1675. var DESCRIPTORS = __webpack_require__(9781);
  1676. var fails = __webpack_require__(7293);
  1677. var createElement = __webpack_require__(317);
  1678. // Thank's IE8 for his funny defineProperty
  1679. module.exports =
  1680. !DESCRIPTORS &&
  1681. !fails(function () {
  1682. return (
  1683. Object.defineProperty(createElement("div"), "a", {
  1684. get: function () {
  1685. return 7;
  1686. }
  1687. }).a != 7
  1688. );
  1689. });
  1690. /***/
  1691. },
  1692. /***/ 1179: /***/ function (module) {
  1693. // IEEE754 conversions based on https://github.com/feross/ieee754
  1694. // eslint-disable-next-line no-shadow-restricted-names
  1695. var Infinity = 1 / 0;
  1696. var abs = Math.abs;
  1697. var pow = Math.pow;
  1698. var floor = Math.floor;
  1699. var log = Math.log;
  1700. var LN2 = Math.LN2;
  1701. var pack = function (number, mantissaLength, bytes) {
  1702. var buffer = new Array(bytes);
  1703. var exponentLength = bytes * 8 - mantissaLength - 1;
  1704. var eMax = (1 << exponentLength) - 1;
  1705. var eBias = eMax >> 1;
  1706. var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
  1707. var sign = number < 0 || (number === 0 && 1 / number < 0) ? 1 : 0;
  1708. var index = 0;
  1709. var exponent, mantissa, c;
  1710. number = abs(number);
  1711. // eslint-disable-next-line no-self-compare
  1712. if (number != number || number === Infinity) {
  1713. // eslint-disable-next-line no-self-compare
  1714. mantissa = number != number ? 1 : 0;
  1715. exponent = eMax;
  1716. } else {
  1717. exponent = floor(log(number) / LN2);
  1718. if (number * (c = pow(2, -exponent)) < 1) {
  1719. exponent--;
  1720. c *= 2;
  1721. }
  1722. if (exponent + eBias >= 1) {
  1723. number += rt / c;
  1724. } else {
  1725. number += rt * pow(2, 1 - eBias);
  1726. }
  1727. if (number * c >= 2) {
  1728. exponent++;
  1729. c /= 2;
  1730. }
  1731. if (exponent + eBias >= eMax) {
  1732. mantissa = 0;
  1733. exponent = eMax;
  1734. } else if (exponent + eBias >= 1) {
  1735. mantissa = (number * c - 1) * pow(2, mantissaLength);
  1736. exponent = exponent + eBias;
  1737. } else {
  1738. mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
  1739. exponent = 0;
  1740. }
  1741. }
  1742. for (
  1743. ;
  1744. mantissaLength >= 8;
  1745. buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8
  1746. );
  1747. exponent = (exponent << mantissaLength) | mantissa;
  1748. exponentLength += mantissaLength;
  1749. for (
  1750. ;
  1751. exponentLength > 0;
  1752. buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8
  1753. );
  1754. buffer[--index] |= sign * 128;
  1755. return buffer;
  1756. };
  1757. var unpack = function (buffer, mantissaLength) {
  1758. var bytes = buffer.length;
  1759. var exponentLength = bytes * 8 - mantissaLength - 1;
  1760. var eMax = (1 << exponentLength) - 1;
  1761. var eBias = eMax >> 1;
  1762. var nBits = exponentLength - 7;
  1763. var index = bytes - 1;
  1764. var sign = buffer[index--];
  1765. var exponent = sign & 127;
  1766. var mantissa;
  1767. sign >>= 7;
  1768. for (
  1769. ;
  1770. nBits > 0;
  1771. exponent = exponent * 256 + buffer[index], index--, nBits -= 8
  1772. );
  1773. mantissa = exponent & ((1 << -nBits) - 1);
  1774. exponent >>= -nBits;
  1775. nBits += mantissaLength;
  1776. for (
  1777. ;
  1778. nBits > 0;
  1779. mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8
  1780. );
  1781. if (exponent === 0) {
  1782. exponent = 1 - eBias;
  1783. } else if (exponent === eMax) {
  1784. return mantissa ? NaN : sign ? -Infinity : Infinity;
  1785. } else {
  1786. mantissa = mantissa + pow(2, mantissaLength);
  1787. exponent = exponent - eBias;
  1788. }
  1789. return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
  1790. };
  1791. module.exports = {
  1792. pack: pack,
  1793. unpack: unpack
  1794. };
  1795. /***/
  1796. },
  1797. /***/ 8361: /***/ function (
  1798. module,
  1799. __unused_webpack_exports,
  1800. __webpack_require__
  1801. ) {
  1802. var fails = __webpack_require__(7293);
  1803. var classof = __webpack_require__(4326);
  1804. var split = "".split;
  1805. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1806. module.exports = fails(function () {
  1807. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  1808. // eslint-disable-next-line no-prototype-builtins
  1809. return !Object("z").propertyIsEnumerable(0);
  1810. })
  1811. ? function (it) {
  1812. return classof(it) == "String" ? split.call(it, "") : Object(it);
  1813. }
  1814. : Object;
  1815. /***/
  1816. },
  1817. /***/ 9587: /***/ function (
  1818. module,
  1819. __unused_webpack_exports,
  1820. __webpack_require__
  1821. ) {
  1822. var isObject = __webpack_require__(111);
  1823. var setPrototypeOf = __webpack_require__(7674);
  1824. // makes subclassing work correct for wrapped built-ins
  1825. module.exports = function ($this, dummy, Wrapper) {
  1826. var NewTarget, NewTargetPrototype;
  1827. if (
  1828. // it can work only with native `setPrototypeOf`
  1829. setPrototypeOf &&
  1830. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  1831. typeof (NewTarget = dummy.constructor) == "function" &&
  1832. NewTarget !== Wrapper &&
  1833. isObject((NewTargetPrototype = NewTarget.prototype)) &&
  1834. NewTargetPrototype !== Wrapper.prototype
  1835. )
  1836. setPrototypeOf($this, NewTargetPrototype);
  1837. return $this;
  1838. };
  1839. /***/
  1840. },
  1841. /***/ 2788: /***/ function (
  1842. module,
  1843. __unused_webpack_exports,
  1844. __webpack_require__
  1845. ) {
  1846. var store = __webpack_require__(5465);
  1847. var functionToString = Function.toString;
  1848. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  1849. if (typeof store.inspectSource != "function") {
  1850. store.inspectSource = function (it) {
  1851. return functionToString.call(it);
  1852. };
  1853. }
  1854. module.exports = store.inspectSource;
  1855. /***/
  1856. },
  1857. /***/ 9909: /***/ function (
  1858. module,
  1859. __unused_webpack_exports,
  1860. __webpack_require__
  1861. ) {
  1862. var NATIVE_WEAK_MAP = __webpack_require__(8536);
  1863. var global = __webpack_require__(7854);
  1864. var isObject = __webpack_require__(111);
  1865. var createNonEnumerableProperty = __webpack_require__(8880);
  1866. var objectHas = __webpack_require__(6656);
  1867. var sharedKey = __webpack_require__(6200);
  1868. var hiddenKeys = __webpack_require__(3501);
  1869. var WeakMap = global.WeakMap;
  1870. var set, get, has;
  1871. var enforce = function (it) {
  1872. return has(it) ? get(it) : set(it, {});
  1873. };
  1874. var getterFor = function (TYPE) {
  1875. return function (it) {
  1876. var state;
  1877. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  1878. throw TypeError("Incompatible receiver, " + TYPE + " required");
  1879. }
  1880. return state;
  1881. };
  1882. };
  1883. if (NATIVE_WEAK_MAP) {
  1884. var store = new WeakMap();
  1885. var wmget = store.get;
  1886. var wmhas = store.has;
  1887. var wmset = store.set;
  1888. set = function (it, metadata) {
  1889. wmset.call(store, it, metadata);
  1890. return metadata;
  1891. };
  1892. get = function (it) {
  1893. return wmget.call(store, it) || {};
  1894. };
  1895. has = function (it) {
  1896. return wmhas.call(store, it);
  1897. };
  1898. } else {
  1899. var STATE = sharedKey("state");
  1900. hiddenKeys[STATE] = true;
  1901. set = function (it, metadata) {
  1902. createNonEnumerableProperty(it, STATE, metadata);
  1903. return metadata;
  1904. };
  1905. get = function (it) {
  1906. return objectHas(it, STATE) ? it[STATE] : {};
  1907. };
  1908. has = function (it) {
  1909. return objectHas(it, STATE);
  1910. };
  1911. }
  1912. module.exports = {
  1913. set: set,
  1914. get: get,
  1915. has: has,
  1916. enforce: enforce,
  1917. getterFor: getterFor
  1918. };
  1919. /***/
  1920. },
  1921. /***/ 7659: /***/ function (
  1922. module,
  1923. __unused_webpack_exports,
  1924. __webpack_require__
  1925. ) {
  1926. var wellKnownSymbol = __webpack_require__(5112);
  1927. var Iterators = __webpack_require__(7497);
  1928. var ITERATOR = wellKnownSymbol("iterator");
  1929. var ArrayPrototype = Array.prototype;
  1930. // check on default Array iterator
  1931. module.exports = function (it) {
  1932. return (
  1933. it !== undefined &&
  1934. (Iterators.Array === it || ArrayPrototype[ITERATOR] === it)
  1935. );
  1936. };
  1937. /***/
  1938. },
  1939. /***/ 3157: /***/ function (
  1940. module,
  1941. __unused_webpack_exports,
  1942. __webpack_require__
  1943. ) {
  1944. var classof = __webpack_require__(4326);
  1945. // `IsArray` abstract operation
  1946. // https://tc39.github.io/ecma262/#sec-isarray
  1947. module.exports =
  1948. Array.isArray ||
  1949. function isArray(arg) {
  1950. return classof(arg) == "Array";
  1951. };
  1952. /***/
  1953. },
  1954. /***/ 4705: /***/ function (
  1955. module,
  1956. __unused_webpack_exports,
  1957. __webpack_require__
  1958. ) {
  1959. var fails = __webpack_require__(7293);
  1960. var replacement = /#|\.prototype\./;
  1961. var isForced = function (feature, detection) {
  1962. var value = data[normalize(feature)];
  1963. return value == POLYFILL
  1964. ? true
  1965. : value == NATIVE
  1966. ? false
  1967. : typeof detection == "function"
  1968. ? fails(detection)
  1969. : !!detection;
  1970. };
  1971. var normalize = (isForced.normalize = function (string) {
  1972. return String(string).replace(replacement, ".").toLowerCase();
  1973. });
  1974. var data = (isForced.data = {});
  1975. var NATIVE = (isForced.NATIVE = "N");
  1976. var POLYFILL = (isForced.POLYFILL = "P");
  1977. module.exports = isForced;
  1978. /***/
  1979. },
  1980. /***/ 111: /***/ function (module) {
  1981. module.exports = function (it) {
  1982. return typeof it === "object" ? it !== null : typeof it === "function";
  1983. };
  1984. /***/
  1985. },
  1986. /***/ 1913: /***/ function (module) {
  1987. module.exports = false;
  1988. /***/
  1989. },
  1990. /***/ 408: /***/ function (
  1991. module,
  1992. __unused_webpack_exports,
  1993. __webpack_require__
  1994. ) {
  1995. var anObject = __webpack_require__(9670);
  1996. var isArrayIteratorMethod = __webpack_require__(7659);
  1997. var toLength = __webpack_require__(7466);
  1998. var bind = __webpack_require__(9974);
  1999. var getIteratorMethod = __webpack_require__(1246);
  2000. var callWithSafeIterationClosing = __webpack_require__(3411);
  2001. var Result = function (stopped, result) {
  2002. this.stopped = stopped;
  2003. this.result = result;
  2004. };
  2005. var iterate = (module.exports = function (
  2006. iterable,
  2007. fn,
  2008. that,
  2009. AS_ENTRIES,
  2010. IS_ITERATOR
  2011. ) {
  2012. var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);
  2013. var iterator, iterFn, index, length, result, next, step;
  2014. if (IS_ITERATOR) {
  2015. iterator = iterable;
  2016. } else {
  2017. iterFn = getIteratorMethod(iterable);
  2018. if (typeof iterFn != "function")
  2019. throw TypeError("Target is not iterable");
  2020. // optimisation for array iterators
  2021. if (isArrayIteratorMethod(iterFn)) {
  2022. for (
  2023. index = 0, length = toLength(iterable.length);
  2024. length > index;
  2025. index++
  2026. ) {
  2027. result = AS_ENTRIES
  2028. ? boundFunction(anObject((step = iterable[index]))[0], step[1])
  2029. : boundFunction(iterable[index]);
  2030. if (result && result instanceof Result) return result;
  2031. }
  2032. return new Result(false);
  2033. }
  2034. iterator = iterFn.call(iterable);
  2035. }
  2036. next = iterator.next;
  2037. while (!(step = next.call(iterator)).done) {
  2038. result = callWithSafeIterationClosing(
  2039. iterator,
  2040. boundFunction,
  2041. step.value,
  2042. AS_ENTRIES
  2043. );
  2044. if (typeof result == "object" && result && result instanceof Result)
  2045. return result;
  2046. }
  2047. return new Result(false);
  2048. });
  2049. iterate.stop = function (result) {
  2050. return new Result(true, result);
  2051. };
  2052. /***/
  2053. },
  2054. /***/ 3383: /***/ function (
  2055. module,
  2056. __unused_webpack_exports,
  2057. __webpack_require__
  2058. ) {
  2059. "use strict";
  2060. var getPrototypeOf = __webpack_require__(9518);
  2061. var createNonEnumerableProperty = __webpack_require__(8880);
  2062. var has = __webpack_require__(6656);
  2063. var wellKnownSymbol = __webpack_require__(5112);
  2064. var IS_PURE = __webpack_require__(1913);
  2065. var ITERATOR = wellKnownSymbol("iterator");
  2066. var BUGGY_SAFARI_ITERATORS = false;
  2067. var returnThis = function () {
  2068. return this;
  2069. };
  2070. // `%IteratorPrototype%` object
  2071. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  2072. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  2073. if ([].keys) {
  2074. arrayIterator = [].keys();
  2075. // Safari 8 has buggy iterators w/o `next`
  2076. if (!("next" in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  2077. else {
  2078. PrototypeOfArrayIteratorPrototype = getPrototypeOf(
  2079. getPrototypeOf(arrayIterator)
  2080. );
  2081. if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
  2082. IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  2083. }
  2084. }
  2085. if (IteratorPrototype == undefined) IteratorPrototype = {};
  2086. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  2087. if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
  2088. createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
  2089. }
  2090. module.exports = {
  2091. IteratorPrototype: IteratorPrototype,
  2092. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  2093. };
  2094. /***/
  2095. },
  2096. /***/ 7497: /***/ function (module) {
  2097. module.exports = {};
  2098. /***/
  2099. },
  2100. /***/ 5948: /***/ function (
  2101. module,
  2102. __unused_webpack_exports,
  2103. __webpack_require__
  2104. ) {
  2105. var global = __webpack_require__(7854);
  2106. var getOwnPropertyDescriptor = __webpack_require__(1236).f;
  2107. var classof = __webpack_require__(4326);
  2108. var macrotask = __webpack_require__(261).set;
  2109. var IS_IOS = __webpack_require__(6833);
  2110. var MutationObserver =
  2111. global.MutationObserver || global.WebKitMutationObserver;
  2112. var process = global.process;
  2113. var Promise = global.Promise;
  2114. var IS_NODE = classof(process) == "process";
  2115. // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
  2116. var queueMicrotaskDescriptor = getOwnPropertyDescriptor(
  2117. global,
  2118. "queueMicrotask"
  2119. );
  2120. var queueMicrotask =
  2121. queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
  2122. var flush, head, last, notify, toggle, node, promise, then;
  2123. // modern engines have queueMicrotask method
  2124. if (!queueMicrotask) {
  2125. flush = function () {
  2126. var parent, fn;
  2127. if (IS_NODE && (parent = process.domain)) parent.exit();
  2128. while (head) {
  2129. fn = head.fn;
  2130. head = head.next;
  2131. try {
  2132. fn();
  2133. } catch (error) {
  2134. if (head) notify();
  2135. else last = undefined;
  2136. throw error;
  2137. }
  2138. }
  2139. last = undefined;
  2140. if (parent) parent.enter();
  2141. };
  2142. // Node.js
  2143. if (IS_NODE) {
  2144. notify = function () {
  2145. process.nextTick(flush);
  2146. };
  2147. // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
  2148. } else if (MutationObserver && !IS_IOS) {
  2149. toggle = true;
  2150. node = document.createTextNode("");
  2151. new MutationObserver(flush).observe(node, { characterData: true });
  2152. notify = function () {
  2153. node.data = toggle = !toggle;
  2154. };
  2155. // environments with maybe non-completely correct, but existent Promise
  2156. } else if (Promise && Promise.resolve) {
  2157. // Promise.resolve without an argument throws an error in LG WebOS 2
  2158. promise = Promise.resolve(undefined);
  2159. then = promise.then;
  2160. notify = function () {
  2161. then.call(promise, flush);
  2162. };
  2163. // for other environments - macrotask based on:
  2164. // - setImmediate
  2165. // - MessageChannel
  2166. // - window.postMessag
  2167. // - onreadystatechange
  2168. // - setTimeout
  2169. } else {
  2170. notify = function () {
  2171. // strange IE + webpack dev server bug - use .call(global)
  2172. macrotask.call(global, flush);
  2173. };
  2174. }
  2175. }
  2176. module.exports =
  2177. queueMicrotask ||
  2178. function (fn) {
  2179. var task = { fn: fn, next: undefined };
  2180. if (last) last.next = task;
  2181. if (!head) {
  2182. head = task;
  2183. notify();
  2184. }
  2185. last = task;
  2186. };
  2187. /***/
  2188. },
  2189. /***/ 3366: /***/ function (
  2190. module,
  2191. __unused_webpack_exports,
  2192. __webpack_require__
  2193. ) {
  2194. var global = __webpack_require__(7854);
  2195. module.exports = global.Promise;
  2196. /***/
  2197. },
  2198. /***/ 133: /***/ function (
  2199. module,
  2200. __unused_webpack_exports,
  2201. __webpack_require__
  2202. ) {
  2203. var fails = __webpack_require__(7293);
  2204. module.exports =
  2205. !!Object.getOwnPropertySymbols &&
  2206. !fails(function () {
  2207. // Chrome 38 Symbol has incorrect toString conversion
  2208. // eslint-disable-next-line no-undef
  2209. return !String(Symbol());
  2210. });
  2211. /***/
  2212. },
  2213. /***/ 8536: /***/ function (
  2214. module,
  2215. __unused_webpack_exports,
  2216. __webpack_require__
  2217. ) {
  2218. var global = __webpack_require__(7854);
  2219. var inspectSource = __webpack_require__(2788);
  2220. var WeakMap = global.WeakMap;
  2221. module.exports =
  2222. typeof WeakMap === "function" &&
  2223. /native code/.test(inspectSource(WeakMap));
  2224. /***/
  2225. },
  2226. /***/ 8523: /***/ function (
  2227. module,
  2228. __unused_webpack_exports,
  2229. __webpack_require__
  2230. ) {
  2231. "use strict";
  2232. var aFunction = __webpack_require__(3099);
  2233. var PromiseCapability = function (C) {
  2234. var resolve, reject;
  2235. this.promise = new C(function ($$resolve, $$reject) {
  2236. if (resolve !== undefined || reject !== undefined)
  2237. throw TypeError("Bad Promise constructor");
  2238. resolve = $$resolve;
  2239. reject = $$reject;
  2240. });
  2241. this.resolve = aFunction(resolve);
  2242. this.reject = aFunction(reject);
  2243. };
  2244. // 25.4.1.5 NewPromiseCapability(C)
  2245. module.exports.f = function (C) {
  2246. return new PromiseCapability(C);
  2247. };
  2248. /***/
  2249. },
  2250. /***/ 30: /***/ function (
  2251. module,
  2252. __unused_webpack_exports,
  2253. __webpack_require__
  2254. ) {
  2255. var anObject = __webpack_require__(9670);
  2256. var defineProperties = __webpack_require__(6048);
  2257. var enumBugKeys = __webpack_require__(748);
  2258. var hiddenKeys = __webpack_require__(3501);
  2259. var html = __webpack_require__(490);
  2260. var documentCreateElement = __webpack_require__(317);
  2261. var sharedKey = __webpack_require__(6200);
  2262. var GT = ">";
  2263. var LT = "<";
  2264. var PROTOTYPE = "prototype";
  2265. var SCRIPT = "script";
  2266. var IE_PROTO = sharedKey("IE_PROTO");
  2267. var EmptyConstructor = function () {
  2268. /* empty */
  2269. };
  2270. var scriptTag = function (content) {
  2271. return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
  2272. };
  2273. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  2274. var NullProtoObjectViaActiveX = function (activeXDocument) {
  2275. activeXDocument.write(scriptTag(""));
  2276. activeXDocument.close();
  2277. var temp = activeXDocument.parentWindow.Object;
  2278. activeXDocument = null; // avoid memory leak
  2279. return temp;
  2280. };
  2281. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  2282. var NullProtoObjectViaIFrame = function () {
  2283. // Thrash, waste and sodomy: IE GC bug
  2284. var iframe = documentCreateElement("iframe");
  2285. var JS = "java" + SCRIPT + ":";
  2286. var iframeDocument;
  2287. iframe.style.display = "none";
  2288. html.appendChild(iframe);
  2289. // https://github.com/zloirock/core-js/issues/475
  2290. iframe.src = String(JS);
  2291. iframeDocument = iframe.contentWindow.document;
  2292. iframeDocument.open();
  2293. iframeDocument.write(scriptTag("document.F=Object"));
  2294. iframeDocument.close();
  2295. return iframeDocument.F;
  2296. };
  2297. // Check for document.domain and active x support
  2298. // No need to use active x approach when document.domain is not set
  2299. // see https://github.com/es-shims/es5-shim/issues/150
  2300. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  2301. // avoid IE GC bug
  2302. var activeXDocument;
  2303. var NullProtoObject = function () {
  2304. try {
  2305. /* global ActiveXObject */
  2306. activeXDocument = document.domain && new ActiveXObject("htmlfile");
  2307. } catch (error) {
  2308. /* ignore */
  2309. }
  2310. NullProtoObject = activeXDocument
  2311. ? NullProtoObjectViaActiveX(activeXDocument)
  2312. : NullProtoObjectViaIFrame();
  2313. var length = enumBugKeys.length;
  2314. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  2315. return NullProtoObject();
  2316. };
  2317. hiddenKeys[IE_PROTO] = true;
  2318. // `Object.create` method
  2319. // https://tc39.github.io/ecma262/#sec-object.create
  2320. module.exports =
  2321. Object.create ||
  2322. function create(O, Properties) {
  2323. var result;
  2324. if (O !== null) {
  2325. EmptyConstructor[PROTOTYPE] = anObject(O);
  2326. result = new EmptyConstructor();
  2327. EmptyConstructor[PROTOTYPE] = null;
  2328. // add "__proto__" for Object.getPrototypeOf polyfill
  2329. result[IE_PROTO] = O;
  2330. } else result = NullProtoObject();
  2331. return Properties === undefined
  2332. ? result
  2333. : defineProperties(result, Properties);
  2334. };
  2335. /***/
  2336. },
  2337. /***/ 6048: /***/ function (
  2338. module,
  2339. __unused_webpack_exports,
  2340. __webpack_require__
  2341. ) {
  2342. var DESCRIPTORS = __webpack_require__(9781);
  2343. var definePropertyModule = __webpack_require__(3070);
  2344. var anObject = __webpack_require__(9670);
  2345. var objectKeys = __webpack_require__(1956);
  2346. // `Object.defineProperties` method
  2347. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  2348. module.exports = DESCRIPTORS
  2349. ? Object.defineProperties
  2350. : function defineProperties(O, Properties) {
  2351. anObject(O);
  2352. var keys = objectKeys(Properties);
  2353. var length = keys.length;
  2354. var index = 0;
  2355. var key;
  2356. while (length > index)
  2357. definePropertyModule.f(O, (key = keys[index++]), Properties[key]);
  2358. return O;
  2359. };
  2360. /***/
  2361. },
  2362. /***/ 3070: /***/ function (
  2363. __unused_webpack_module,
  2364. exports,
  2365. __webpack_require__
  2366. ) {
  2367. var DESCRIPTORS = __webpack_require__(9781);
  2368. var IE8_DOM_DEFINE = __webpack_require__(4664);
  2369. var anObject = __webpack_require__(9670);
  2370. var toPrimitive = __webpack_require__(7593);
  2371. var nativeDefineProperty = Object.defineProperty;
  2372. // `Object.defineProperty` method
  2373. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  2374. exports.f = DESCRIPTORS
  2375. ? nativeDefineProperty
  2376. : function defineProperty(O, P, Attributes) {
  2377. anObject(O);
  2378. P = toPrimitive(P, true);
  2379. anObject(Attributes);
  2380. if (IE8_DOM_DEFINE)
  2381. try {
  2382. return nativeDefineProperty(O, P, Attributes);
  2383. } catch (error) {
  2384. /* empty */
  2385. }
  2386. if ("get" in Attributes || "set" in Attributes)
  2387. throw TypeError("Accessors not supported");
  2388. if ("value" in Attributes) O[P] = Attributes.value;
  2389. return O;
  2390. };
  2391. /***/
  2392. },
  2393. /***/ 1236: /***/ function (
  2394. __unused_webpack_module,
  2395. exports,
  2396. __webpack_require__
  2397. ) {
  2398. var DESCRIPTORS = __webpack_require__(9781);
  2399. var propertyIsEnumerableModule = __webpack_require__(5296);
  2400. var createPropertyDescriptor = __webpack_require__(9114);
  2401. var toIndexedObject = __webpack_require__(5656);
  2402. var toPrimitive = __webpack_require__(7593);
  2403. var has = __webpack_require__(6656);
  2404. var IE8_DOM_DEFINE = __webpack_require__(4664);
  2405. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  2406. // `Object.getOwnPropertyDescriptor` method
  2407. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  2408. exports.f = DESCRIPTORS
  2409. ? nativeGetOwnPropertyDescriptor
  2410. : function getOwnPropertyDescriptor(O, P) {
  2411. O = toIndexedObject(O);
  2412. P = toPrimitive(P, true);
  2413. if (IE8_DOM_DEFINE)
  2414. try {
  2415. return nativeGetOwnPropertyDescriptor(O, P);
  2416. } catch (error) {
  2417. /* empty */
  2418. }
  2419. if (has(O, P))
  2420. return createPropertyDescriptor(
  2421. !propertyIsEnumerableModule.f.call(O, P),
  2422. O[P]
  2423. );
  2424. };
  2425. /***/
  2426. },
  2427. /***/ 8006: /***/ function (
  2428. __unused_webpack_module,
  2429. exports,
  2430. __webpack_require__
  2431. ) {
  2432. var internalObjectKeys = __webpack_require__(6324);
  2433. var enumBugKeys = __webpack_require__(748);
  2434. var hiddenKeys = enumBugKeys.concat("length", "prototype");
  2435. // `Object.getOwnPropertyNames` method
  2436. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  2437. exports.f =
  2438. Object.getOwnPropertyNames ||
  2439. function getOwnPropertyNames(O) {
  2440. return internalObjectKeys(O, hiddenKeys);
  2441. };
  2442. /***/
  2443. },
  2444. /***/ 5181: /***/ function (__unused_webpack_module, exports) {
  2445. exports.f = Object.getOwnPropertySymbols;
  2446. /***/
  2447. },
  2448. /***/ 9518: /***/ function (
  2449. module,
  2450. __unused_webpack_exports,
  2451. __webpack_require__
  2452. ) {
  2453. var has = __webpack_require__(6656);
  2454. var toObject = __webpack_require__(7908);
  2455. var sharedKey = __webpack_require__(6200);
  2456. var CORRECT_PROTOTYPE_GETTER = __webpack_require__(8544);
  2457. var IE_PROTO = sharedKey("IE_PROTO");
  2458. var ObjectPrototype = Object.prototype;
  2459. // `Object.getPrototypeOf` method
  2460. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  2461. module.exports = CORRECT_PROTOTYPE_GETTER
  2462. ? Object.getPrototypeOf
  2463. : function (O) {
  2464. O = toObject(O);
  2465. if (has(O, IE_PROTO)) return O[IE_PROTO];
  2466. if (
  2467. typeof O.constructor == "function" &&
  2468. O instanceof O.constructor
  2469. ) {
  2470. return O.constructor.prototype;
  2471. }
  2472. return O instanceof Object ? ObjectPrototype : null;
  2473. };
  2474. /***/
  2475. },
  2476. /***/ 6324: /***/ function (
  2477. module,
  2478. __unused_webpack_exports,
  2479. __webpack_require__
  2480. ) {
  2481. var has = __webpack_require__(6656);
  2482. var toIndexedObject = __webpack_require__(5656);
  2483. var indexOf = __webpack_require__(1318).indexOf;
  2484. var hiddenKeys = __webpack_require__(3501);
  2485. module.exports = function (object, names) {
  2486. var O = toIndexedObject(object);
  2487. var i = 0;
  2488. var result = [];
  2489. var key;
  2490. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  2491. // Don't enum bug & hidden keys
  2492. while (names.length > i)
  2493. if (has(O, (key = names[i++]))) {
  2494. ~indexOf(result, key) || result.push(key);
  2495. }
  2496. return result;
  2497. };
  2498. /***/
  2499. },
  2500. /***/ 1956: /***/ function (
  2501. module,
  2502. __unused_webpack_exports,
  2503. __webpack_require__
  2504. ) {
  2505. var internalObjectKeys = __webpack_require__(6324);
  2506. var enumBugKeys = __webpack_require__(748);
  2507. // `Object.keys` method
  2508. // https://tc39.github.io/ecma262/#sec-object.keys
  2509. module.exports =
  2510. Object.keys ||
  2511. function keys(O) {
  2512. return internalObjectKeys(O, enumBugKeys);
  2513. };
  2514. /***/
  2515. },
  2516. /***/ 5296: /***/ function (__unused_webpack_module, exports) {
  2517. "use strict";
  2518. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  2519. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  2520. // Nashorn ~ JDK8 bug
  2521. var NASHORN_BUG =
  2522. getOwnPropertyDescriptor &&
  2523. !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  2524. // `Object.prototype.propertyIsEnumerable` method implementation
  2525. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  2526. exports.f = NASHORN_BUG
  2527. ? function propertyIsEnumerable(V) {
  2528. var descriptor = getOwnPropertyDescriptor(this, V);
  2529. return !!descriptor && descriptor.enumerable;
  2530. }
  2531. : nativePropertyIsEnumerable;
  2532. /***/
  2533. },
  2534. /***/ 7674: /***/ function (
  2535. module,
  2536. __unused_webpack_exports,
  2537. __webpack_require__
  2538. ) {
  2539. var anObject = __webpack_require__(9670);
  2540. var aPossiblePrototype = __webpack_require__(6077);
  2541. // `Object.setPrototypeOf` method
  2542. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  2543. // Works with __proto__ only. Old v8 can't work with null proto objects.
  2544. /* eslint-disable no-proto */
  2545. module.exports =
  2546. Object.setPrototypeOf ||
  2547. ("__proto__" in {}
  2548. ? (function () {
  2549. var CORRECT_SETTER = false;
  2550. var test = {};
  2551. var setter;
  2552. try {
  2553. setter = Object.getOwnPropertyDescriptor(
  2554. Object.prototype,
  2555. "__proto__"
  2556. ).set;
  2557. setter.call(test, []);
  2558. CORRECT_SETTER = test instanceof Array;
  2559. } catch (error) {
  2560. /* empty */
  2561. }
  2562. return function setPrototypeOf(O, proto) {
  2563. anObject(O);
  2564. aPossiblePrototype(proto);
  2565. if (CORRECT_SETTER) setter.call(O, proto);
  2566. else O.__proto__ = proto;
  2567. return O;
  2568. };
  2569. })()
  2570. : undefined);
  2571. /***/
  2572. },
  2573. /***/ 3887: /***/ function (
  2574. module,
  2575. __unused_webpack_exports,
  2576. __webpack_require__
  2577. ) {
  2578. var getBuiltIn = __webpack_require__(5005);
  2579. var getOwnPropertyNamesModule = __webpack_require__(8006);
  2580. var getOwnPropertySymbolsModule = __webpack_require__(5181);
  2581. var anObject = __webpack_require__(9670);
  2582. // all object keys, includes non-enumerable and symbols
  2583. module.exports =
  2584. getBuiltIn("Reflect", "ownKeys") ||
  2585. function ownKeys(it) {
  2586. var keys = getOwnPropertyNamesModule.f(anObject(it));
  2587. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2588. return getOwnPropertySymbols
  2589. ? keys.concat(getOwnPropertySymbols(it))
  2590. : keys;
  2591. };
  2592. /***/
  2593. },
  2594. /***/ 857: /***/ function (
  2595. module,
  2596. __unused_webpack_exports,
  2597. __webpack_require__
  2598. ) {
  2599. var global = __webpack_require__(7854);
  2600. module.exports = global;
  2601. /***/
  2602. },
  2603. /***/ 2534: /***/ function (module) {
  2604. module.exports = function (exec) {
  2605. try {
  2606. return { error: false, value: exec() };
  2607. } catch (error) {
  2608. return { error: true, value: error };
  2609. }
  2610. };
  2611. /***/
  2612. },
  2613. /***/ 9478: /***/ function (
  2614. module,
  2615. __unused_webpack_exports,
  2616. __webpack_require__
  2617. ) {
  2618. var anObject = __webpack_require__(9670);
  2619. var isObject = __webpack_require__(111);
  2620. var newPromiseCapability = __webpack_require__(8523);
  2621. module.exports = function (C, x) {
  2622. anObject(C);
  2623. if (isObject(x) && x.constructor === C) return x;
  2624. var promiseCapability = newPromiseCapability.f(C);
  2625. var resolve = promiseCapability.resolve;
  2626. resolve(x);
  2627. return promiseCapability.promise;
  2628. };
  2629. /***/
  2630. },
  2631. /***/ 2248: /***/ function (
  2632. module,
  2633. __unused_webpack_exports,
  2634. __webpack_require__
  2635. ) {
  2636. var redefine = __webpack_require__(1320);
  2637. module.exports = function (target, src, options) {
  2638. for (var key in src) redefine(target, key, src[key], options);
  2639. return target;
  2640. };
  2641. /***/
  2642. },
  2643. /***/ 1320: /***/ function (
  2644. module,
  2645. __unused_webpack_exports,
  2646. __webpack_require__
  2647. ) {
  2648. var global = __webpack_require__(7854);
  2649. var createNonEnumerableProperty = __webpack_require__(8880);
  2650. var has = __webpack_require__(6656);
  2651. var setGlobal = __webpack_require__(3505);
  2652. var inspectSource = __webpack_require__(2788);
  2653. var InternalStateModule = __webpack_require__(9909);
  2654. var getInternalState = InternalStateModule.get;
  2655. var enforceInternalState = InternalStateModule.enforce;
  2656. var TEMPLATE = String(String).split("String");
  2657. (module.exports = function (O, key, value, options) {
  2658. var unsafe = options ? !!options.unsafe : false;
  2659. var simple = options ? !!options.enumerable : false;
  2660. var noTargetGet = options ? !!options.noTargetGet : false;
  2661. if (typeof value == "function") {
  2662. if (typeof key == "string" && !has(value, "name"))
  2663. createNonEnumerableProperty(value, "name", key);
  2664. enforceInternalState(value).source = TEMPLATE.join(
  2665. typeof key == "string" ? key : ""
  2666. );
  2667. }
  2668. if (O === global) {
  2669. if (simple) O[key] = value;
  2670. else setGlobal(key, value);
  2671. return;
  2672. } else if (!unsafe) {
  2673. delete O[key];
  2674. } else if (!noTargetGet && O[key]) {
  2675. simple = true;
  2676. }
  2677. if (simple) O[key] = value;
  2678. else createNonEnumerableProperty(O, key, value);
  2679. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  2680. })(Function.prototype, "toString", function toString() {
  2681. return (
  2682. (typeof this == "function" && getInternalState(this).source) ||
  2683. inspectSource(this)
  2684. );
  2685. });
  2686. /***/
  2687. },
  2688. /***/ 7066: /***/ function (
  2689. module,
  2690. __unused_webpack_exports,
  2691. __webpack_require__
  2692. ) {
  2693. "use strict";
  2694. var anObject = __webpack_require__(9670);
  2695. // `RegExp.prototype.flags` getter implementation
  2696. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  2697. module.exports = function () {
  2698. var that = anObject(this);
  2699. var result = "";
  2700. if (that.global) result += "g";
  2701. if (that.ignoreCase) result += "i";
  2702. if (that.multiline) result += "m";
  2703. if (that.dotAll) result += "s";
  2704. if (that.unicode) result += "u";
  2705. if (that.sticky) result += "y";
  2706. return result;
  2707. };
  2708. /***/
  2709. },
  2710. /***/ 4488: /***/ function (module) {
  2711. // `RequireObjectCoercible` abstract operation
  2712. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  2713. module.exports = function (it) {
  2714. if (it == undefined) throw TypeError("Can't call method on " + it);
  2715. return it;
  2716. };
  2717. /***/
  2718. },
  2719. /***/ 3505: /***/ function (
  2720. module,
  2721. __unused_webpack_exports,
  2722. __webpack_require__
  2723. ) {
  2724. var global = __webpack_require__(7854);
  2725. var createNonEnumerableProperty = __webpack_require__(8880);
  2726. module.exports = function (key, value) {
  2727. try {
  2728. createNonEnumerableProperty(global, key, value);
  2729. } catch (error) {
  2730. global[key] = value;
  2731. }
  2732. return value;
  2733. };
  2734. /***/
  2735. },
  2736. /***/ 6340: /***/ function (
  2737. module,
  2738. __unused_webpack_exports,
  2739. __webpack_require__
  2740. ) {
  2741. "use strict";
  2742. var getBuiltIn = __webpack_require__(5005);
  2743. var definePropertyModule = __webpack_require__(3070);
  2744. var wellKnownSymbol = __webpack_require__(5112);
  2745. var DESCRIPTORS = __webpack_require__(9781);
  2746. var SPECIES = wellKnownSymbol("species");
  2747. module.exports = function (CONSTRUCTOR_NAME) {
  2748. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  2749. var defineProperty = definePropertyModule.f;
  2750. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  2751. defineProperty(Constructor, SPECIES, {
  2752. configurable: true,
  2753. get: function () {
  2754. return this;
  2755. }
  2756. });
  2757. }
  2758. };
  2759. /***/
  2760. },
  2761. /***/ 8003: /***/ function (
  2762. module,
  2763. __unused_webpack_exports,
  2764. __webpack_require__
  2765. ) {
  2766. var defineProperty = __webpack_require__(3070).f;
  2767. var has = __webpack_require__(6656);
  2768. var wellKnownSymbol = __webpack_require__(5112);
  2769. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  2770. module.exports = function (it, TAG, STATIC) {
  2771. if (it && !has((it = STATIC ? it : it.prototype), TO_STRING_TAG)) {
  2772. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  2773. }
  2774. };
  2775. /***/
  2776. },
  2777. /***/ 6200: /***/ function (
  2778. module,
  2779. __unused_webpack_exports,
  2780. __webpack_require__
  2781. ) {
  2782. var shared = __webpack_require__(2309);
  2783. var uid = __webpack_require__(9711);
  2784. var keys = shared("keys");
  2785. module.exports = function (key) {
  2786. return keys[key] || (keys[key] = uid(key));
  2787. };
  2788. /***/
  2789. },
  2790. /***/ 5465: /***/ function (
  2791. module,
  2792. __unused_webpack_exports,
  2793. __webpack_require__
  2794. ) {
  2795. var global = __webpack_require__(7854);
  2796. var setGlobal = __webpack_require__(3505);
  2797. var SHARED = "__core-js_shared__";
  2798. var store = global[SHARED] || setGlobal(SHARED, {});
  2799. module.exports = store;
  2800. /***/
  2801. },
  2802. /***/ 2309: /***/ function (
  2803. module,
  2804. __unused_webpack_exports,
  2805. __webpack_require__
  2806. ) {
  2807. var IS_PURE = __webpack_require__(1913);
  2808. var store = __webpack_require__(5465);
  2809. (module.exports = function (key, value) {
  2810. return store[key] || (store[key] = value !== undefined ? value : {});
  2811. })("versions", []).push({
  2812. version: "3.6.5",
  2813. mode: IS_PURE ? "pure" : "global",
  2814. copyright: "© 2020 Denis Pushkarev (zloirock.ru)"
  2815. });
  2816. /***/
  2817. },
  2818. /***/ 6707: /***/ function (
  2819. module,
  2820. __unused_webpack_exports,
  2821. __webpack_require__
  2822. ) {
  2823. var anObject = __webpack_require__(9670);
  2824. var aFunction = __webpack_require__(3099);
  2825. var wellKnownSymbol = __webpack_require__(5112);
  2826. var SPECIES = wellKnownSymbol("species");
  2827. // `SpeciesConstructor` abstract operation
  2828. // https://tc39.github.io/ecma262/#sec-speciesconstructor
  2829. module.exports = function (O, defaultConstructor) {
  2830. var C = anObject(O).constructor;
  2831. var S;
  2832. return C === undefined || (S = anObject(C)[SPECIES]) == undefined
  2833. ? defaultConstructor
  2834. : aFunction(S);
  2835. };
  2836. /***/
  2837. },
  2838. /***/ 261: /***/ function (
  2839. module,
  2840. __unused_webpack_exports,
  2841. __webpack_require__
  2842. ) {
  2843. var global = __webpack_require__(7854);
  2844. var fails = __webpack_require__(7293);
  2845. var classof = __webpack_require__(4326);
  2846. var bind = __webpack_require__(9974);
  2847. var html = __webpack_require__(490);
  2848. var createElement = __webpack_require__(317);
  2849. var IS_IOS = __webpack_require__(6833);
  2850. var location = global.location;
  2851. var set = global.setImmediate;
  2852. var clear = global.clearImmediate;
  2853. var process = global.process;
  2854. var MessageChannel = global.MessageChannel;
  2855. var Dispatch = global.Dispatch;
  2856. var counter = 0;
  2857. var queue = {};
  2858. var ONREADYSTATECHANGE = "onreadystatechange";
  2859. var defer, channel, port;
  2860. var run = function (id) {
  2861. // eslint-disable-next-line no-prototype-builtins
  2862. if (queue.hasOwnProperty(id)) {
  2863. var fn = queue[id];
  2864. delete queue[id];
  2865. fn();
  2866. }
  2867. };
  2868. var runner = function (id) {
  2869. return function () {
  2870. run(id);
  2871. };
  2872. };
  2873. var listener = function (event) {
  2874. run(event.data);
  2875. };
  2876. var post = function (id) {
  2877. // old engines have not location.origin
  2878. global.postMessage(id + "", location.protocol + "//" + location.host);
  2879. };
  2880. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  2881. if (!set || !clear) {
  2882. set = function setImmediate(fn) {
  2883. var args = [];
  2884. var i = 1;
  2885. while (arguments.length > i) args.push(arguments[i++]);
  2886. queue[++counter] = function () {
  2887. // eslint-disable-next-line no-new-func
  2888. (typeof fn == "function" ? fn : Function(fn)).apply(
  2889. undefined,
  2890. args
  2891. );
  2892. };
  2893. defer(counter);
  2894. return counter;
  2895. };
  2896. clear = function clearImmediate(id) {
  2897. delete queue[id];
  2898. };
  2899. // Node.js 0.8-
  2900. if (classof(process) == "process") {
  2901. defer = function (id) {
  2902. process.nextTick(runner(id));
  2903. };
  2904. // Sphere (JS game engine) Dispatch API
  2905. } else if (Dispatch && Dispatch.now) {
  2906. defer = function (id) {
  2907. Dispatch.now(runner(id));
  2908. };
  2909. // Browsers with MessageChannel, includes WebWorkers
  2910. // except iOS - https://github.com/zloirock/core-js/issues/624
  2911. } else if (MessageChannel && !IS_IOS) {
  2912. channel = new MessageChannel();
  2913. port = channel.port2;
  2914. channel.port1.onmessage = listener;
  2915. defer = bind(port.postMessage, port, 1);
  2916. // Browsers with postMessage, skip WebWorkers
  2917. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  2918. } else if (
  2919. global.addEventListener &&
  2920. typeof postMessage == "function" &&
  2921. !global.importScripts &&
  2922. !fails(post) &&
  2923. location.protocol !== "file:"
  2924. ) {
  2925. defer = post;
  2926. global.addEventListener("message", listener, false);
  2927. // IE8-
  2928. } else if (ONREADYSTATECHANGE in createElement("script")) {
  2929. defer = function (id) {
  2930. html.appendChild(createElement("script"))[ONREADYSTATECHANGE] =
  2931. function () {
  2932. html.removeChild(this);
  2933. run(id);
  2934. };
  2935. };
  2936. // Rest old browsers
  2937. } else {
  2938. defer = function (id) {
  2939. setTimeout(runner(id), 0);
  2940. };
  2941. }
  2942. }
  2943. module.exports = {
  2944. set: set,
  2945. clear: clear
  2946. };
  2947. /***/
  2948. },
  2949. /***/ 1400: /***/ function (
  2950. module,
  2951. __unused_webpack_exports,
  2952. __webpack_require__
  2953. ) {
  2954. var toInteger = __webpack_require__(9958);
  2955. var max = Math.max;
  2956. var min = Math.min;
  2957. // Helper for a popular repeating case of the spec:
  2958. // Let integer be ? ToInteger(index).
  2959. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  2960. module.exports = function (index, length) {
  2961. var integer = toInteger(index);
  2962. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  2963. };
  2964. /***/
  2965. },
  2966. /***/ 7067: /***/ function (
  2967. module,
  2968. __unused_webpack_exports,
  2969. __webpack_require__
  2970. ) {
  2971. var toInteger = __webpack_require__(9958);
  2972. var toLength = __webpack_require__(7466);
  2973. // `ToIndex` abstract operation
  2974. // https://tc39.github.io/ecma262/#sec-toindex
  2975. module.exports = function (it) {
  2976. if (it === undefined) return 0;
  2977. var number = toInteger(it);
  2978. var length = toLength(number);
  2979. if (number !== length) throw RangeError("Wrong length or index");
  2980. return length;
  2981. };
  2982. /***/
  2983. },
  2984. /***/ 5656: /***/ function (
  2985. module,
  2986. __unused_webpack_exports,
  2987. __webpack_require__
  2988. ) {
  2989. // toObject with fallback for non-array-like ES3 strings
  2990. var IndexedObject = __webpack_require__(8361);
  2991. var requireObjectCoercible = __webpack_require__(4488);
  2992. module.exports = function (it) {
  2993. return IndexedObject(requireObjectCoercible(it));
  2994. };
  2995. /***/
  2996. },
  2997. /***/ 9958: /***/ function (module) {
  2998. var ceil = Math.ceil;
  2999. var floor = Math.floor;
  3000. // `ToInteger` abstract operation
  3001. // https://tc39.github.io/ecma262/#sec-tointeger
  3002. module.exports = function (argument) {
  3003. return isNaN((argument = +argument))
  3004. ? 0
  3005. : (argument > 0 ? floor : ceil)(argument);
  3006. };
  3007. /***/
  3008. },
  3009. /***/ 7466: /***/ function (
  3010. module,
  3011. __unused_webpack_exports,
  3012. __webpack_require__
  3013. ) {
  3014. var toInteger = __webpack_require__(9958);
  3015. var min = Math.min;
  3016. // `ToLength` abstract operation
  3017. // https://tc39.github.io/ecma262/#sec-tolength
  3018. module.exports = function (argument) {
  3019. return argument > 0 ? min(toInteger(argument), 0x1fffffffffffff) : 0; // 2 ** 53 - 1 == 9007199254740991
  3020. };
  3021. /***/
  3022. },
  3023. /***/ 7908: /***/ function (
  3024. module,
  3025. __unused_webpack_exports,
  3026. __webpack_require__
  3027. ) {
  3028. var requireObjectCoercible = __webpack_require__(4488);
  3029. // `ToObject` abstract operation
  3030. // https://tc39.github.io/ecma262/#sec-toobject
  3031. module.exports = function (argument) {
  3032. return Object(requireObjectCoercible(argument));
  3033. };
  3034. /***/
  3035. },
  3036. /***/ 4590: /***/ function (
  3037. module,
  3038. __unused_webpack_exports,
  3039. __webpack_require__
  3040. ) {
  3041. var toPositiveInteger = __webpack_require__(3002);
  3042. module.exports = function (it, BYTES) {
  3043. var offset = toPositiveInteger(it);
  3044. if (offset % BYTES) throw RangeError("Wrong offset");
  3045. return offset;
  3046. };
  3047. /***/
  3048. },
  3049. /***/ 3002: /***/ function (
  3050. module,
  3051. __unused_webpack_exports,
  3052. __webpack_require__
  3053. ) {
  3054. var toInteger = __webpack_require__(9958);
  3055. module.exports = function (it) {
  3056. var result = toInteger(it);
  3057. if (result < 0) throw RangeError("The argument can't be less than 0");
  3058. return result;
  3059. };
  3060. /***/
  3061. },
  3062. /***/ 7593: /***/ function (
  3063. module,
  3064. __unused_webpack_exports,
  3065. __webpack_require__
  3066. ) {
  3067. var isObject = __webpack_require__(111);
  3068. // `ToPrimitive` abstract operation
  3069. // https://tc39.github.io/ecma262/#sec-toprimitive
  3070. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  3071. // and the second argument - flag - preferred type is a string
  3072. module.exports = function (input, PREFERRED_STRING) {
  3073. if (!isObject(input)) return input;
  3074. var fn, val;
  3075. if (
  3076. PREFERRED_STRING &&
  3077. typeof (fn = input.toString) == "function" &&
  3078. !isObject((val = fn.call(input)))
  3079. )
  3080. return val;
  3081. if (
  3082. typeof (fn = input.valueOf) == "function" &&
  3083. !isObject((val = fn.call(input)))
  3084. )
  3085. return val;
  3086. if (
  3087. !PREFERRED_STRING &&
  3088. typeof (fn = input.toString) == "function" &&
  3089. !isObject((val = fn.call(input)))
  3090. )
  3091. return val;
  3092. throw TypeError("Can't convert object to primitive value");
  3093. };
  3094. /***/
  3095. },
  3096. /***/ 1694: /***/ function (
  3097. module,
  3098. __unused_webpack_exports,
  3099. __webpack_require__
  3100. ) {
  3101. var wellKnownSymbol = __webpack_require__(5112);
  3102. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  3103. var test = {};
  3104. test[TO_STRING_TAG] = "z";
  3105. module.exports = String(test) === "[object z]";
  3106. /***/
  3107. },
  3108. /***/ 9843: /***/ function (
  3109. module,
  3110. __unused_webpack_exports,
  3111. __webpack_require__
  3112. ) {
  3113. "use strict";
  3114. var $ = __webpack_require__(2109);
  3115. var global = __webpack_require__(7854);
  3116. var DESCRIPTORS = __webpack_require__(9781);
  3117. var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS =
  3118. __webpack_require__(3832);
  3119. var ArrayBufferViewCore = __webpack_require__(260);
  3120. var ArrayBufferModule = __webpack_require__(3331);
  3121. var anInstance = __webpack_require__(5787);
  3122. var createPropertyDescriptor = __webpack_require__(9114);
  3123. var createNonEnumerableProperty = __webpack_require__(8880);
  3124. var toLength = __webpack_require__(7466);
  3125. var toIndex = __webpack_require__(7067);
  3126. var toOffset = __webpack_require__(4590);
  3127. var toPrimitive = __webpack_require__(7593);
  3128. var has = __webpack_require__(6656);
  3129. var classof = __webpack_require__(648);
  3130. var isObject = __webpack_require__(111);
  3131. var create = __webpack_require__(30);
  3132. var setPrototypeOf = __webpack_require__(7674);
  3133. var getOwnPropertyNames = __webpack_require__(8006).f;
  3134. var typedArrayFrom = __webpack_require__(7321);
  3135. var forEach = __webpack_require__(2092).forEach;
  3136. var setSpecies = __webpack_require__(6340);
  3137. var definePropertyModule = __webpack_require__(3070);
  3138. var getOwnPropertyDescriptorModule = __webpack_require__(1236);
  3139. var InternalStateModule = __webpack_require__(9909);
  3140. var inheritIfRequired = __webpack_require__(9587);
  3141. var getInternalState = InternalStateModule.get;
  3142. var setInternalState = InternalStateModule.set;
  3143. var nativeDefineProperty = definePropertyModule.f;
  3144. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  3145. var round = Math.round;
  3146. var RangeError = global.RangeError;
  3147. var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
  3148. var DataView = ArrayBufferModule.DataView;
  3149. var NATIVE_ARRAY_BUFFER_VIEWS =
  3150. ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
  3151. var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
  3152. var TypedArray = ArrayBufferViewCore.TypedArray;
  3153. var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
  3154. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  3155. var isTypedArray = ArrayBufferViewCore.isTypedArray;
  3156. var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT";
  3157. var WRONG_LENGTH = "Wrong length";
  3158. var fromList = function (C, list) {
  3159. var index = 0;
  3160. var length = list.length;
  3161. var result = new (aTypedArrayConstructor(C))(length);
  3162. while (length > index) result[index] = list[index++];
  3163. return result;
  3164. };
  3165. var addGetter = function (it, key) {
  3166. nativeDefineProperty(it, key, {
  3167. get: function () {
  3168. return getInternalState(this)[key];
  3169. }
  3170. });
  3171. };
  3172. var isArrayBuffer = function (it) {
  3173. var klass;
  3174. return (
  3175. it instanceof ArrayBuffer ||
  3176. (klass = classof(it)) == "ArrayBuffer" ||
  3177. klass == "SharedArrayBuffer"
  3178. );
  3179. };
  3180. var isTypedArrayIndex = function (target, key) {
  3181. return (
  3182. isTypedArray(target) &&
  3183. typeof key != "symbol" &&
  3184. key in target &&
  3185. String(+key) == String(key)
  3186. );
  3187. };
  3188. var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(
  3189. target,
  3190. key
  3191. ) {
  3192. return isTypedArrayIndex(target, (key = toPrimitive(key, true)))
  3193. ? createPropertyDescriptor(2, target[key])
  3194. : nativeGetOwnPropertyDescriptor(target, key);
  3195. };
  3196. var wrappedDefineProperty = function defineProperty(
  3197. target,
  3198. key,
  3199. descriptor
  3200. ) {
  3201. if (
  3202. isTypedArrayIndex(target, (key = toPrimitive(key, true))) &&
  3203. isObject(descriptor) &&
  3204. has(descriptor, "value") &&
  3205. !has(descriptor, "get") &&
  3206. !has(descriptor, "set") &&
  3207. // TODO: add validation descriptor w/o calling accessors
  3208. !descriptor.configurable &&
  3209. (!has(descriptor, "writable") || descriptor.writable) &&
  3210. (!has(descriptor, "enumerable") || descriptor.enumerable)
  3211. ) {
  3212. target[key] = descriptor.value;
  3213. return target;
  3214. }
  3215. return nativeDefineProperty(target, key, descriptor);
  3216. };
  3217. if (DESCRIPTORS) {
  3218. if (!NATIVE_ARRAY_BUFFER_VIEWS) {
  3219. getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
  3220. definePropertyModule.f = wrappedDefineProperty;
  3221. addGetter(TypedArrayPrototype, "buffer");
  3222. addGetter(TypedArrayPrototype, "byteOffset");
  3223. addGetter(TypedArrayPrototype, "byteLength");
  3224. addGetter(TypedArrayPrototype, "length");
  3225. }
  3226. $(
  3227. { target: "Object", stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS },
  3228. {
  3229. getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
  3230. defineProperty: wrappedDefineProperty
  3231. }
  3232. );
  3233. module.exports = function (TYPE, wrapper, CLAMPED) {
  3234. var BYTES = TYPE.match(/\d+$/)[0] / 8;
  3235. var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array";
  3236. var GETTER = "get" + TYPE;
  3237. var SETTER = "set" + TYPE;
  3238. var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];
  3239. var TypedArrayConstructor = NativeTypedArrayConstructor;
  3240. var TypedArrayConstructorPrototype =
  3241. TypedArrayConstructor && TypedArrayConstructor.prototype;
  3242. var exported = {};
  3243. var getter = function (that, index) {
  3244. var data = getInternalState(that);
  3245. return data.view[GETTER](index * BYTES + data.byteOffset, true);
  3246. };
  3247. var setter = function (that, index, value) {
  3248. var data = getInternalState(that);
  3249. if (CLAMPED)
  3250. value =
  3251. (value = round(value)) < 0
  3252. ? 0
  3253. : value > 0xff
  3254. ? 0xff
  3255. : value & 0xff;
  3256. data.view[SETTER](index * BYTES + data.byteOffset, value, true);
  3257. };
  3258. var addElement = function (that, index) {
  3259. nativeDefineProperty(that, index, {
  3260. get: function () {
  3261. return getter(this, index);
  3262. },
  3263. set: function (value) {
  3264. return setter(this, index, value);
  3265. },
  3266. enumerable: true
  3267. });
  3268. };
  3269. if (!NATIVE_ARRAY_BUFFER_VIEWS) {
  3270. TypedArrayConstructor = wrapper(function (
  3271. that,
  3272. data,
  3273. offset,
  3274. $length
  3275. ) {
  3276. anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);
  3277. var index = 0;
  3278. var byteOffset = 0;
  3279. var buffer, byteLength, length;
  3280. if (!isObject(data)) {
  3281. length = toIndex(data);
  3282. byteLength = length * BYTES;
  3283. buffer = new ArrayBuffer(byteLength);
  3284. } else if (isArrayBuffer(data)) {
  3285. buffer = data;
  3286. byteOffset = toOffset(offset, BYTES);
  3287. var $len = data.byteLength;
  3288. if ($length === undefined) {
  3289. if ($len % BYTES) throw RangeError(WRONG_LENGTH);
  3290. byteLength = $len - byteOffset;
  3291. if (byteLength < 0) throw RangeError(WRONG_LENGTH);
  3292. } else {
  3293. byteLength = toLength($length) * BYTES;
  3294. if (byteLength + byteOffset > $len)
  3295. throw RangeError(WRONG_LENGTH);
  3296. }
  3297. length = byteLength / BYTES;
  3298. } else if (isTypedArray(data)) {
  3299. return fromList(TypedArrayConstructor, data);
  3300. } else {
  3301. return typedArrayFrom.call(TypedArrayConstructor, data);
  3302. }
  3303. setInternalState(that, {
  3304. buffer: buffer,
  3305. byteOffset: byteOffset,
  3306. byteLength: byteLength,
  3307. length: length,
  3308. view: new DataView(buffer)
  3309. });
  3310. while (index < length) addElement(that, index++);
  3311. });
  3312. if (setPrototypeOf)
  3313. setPrototypeOf(TypedArrayConstructor, TypedArray);
  3314. TypedArrayConstructorPrototype = TypedArrayConstructor.prototype =
  3315. create(TypedArrayPrototype);
  3316. } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
  3317. TypedArrayConstructor = wrapper(function (
  3318. dummy,
  3319. data,
  3320. typedArrayOffset,
  3321. $length
  3322. ) {
  3323. anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);
  3324. return inheritIfRequired(
  3325. (function () {
  3326. if (!isObject(data))
  3327. return new NativeTypedArrayConstructor(toIndex(data));
  3328. if (isArrayBuffer(data))
  3329. return $length !== undefined
  3330. ? new NativeTypedArrayConstructor(
  3331. data,
  3332. toOffset(typedArrayOffset, BYTES),
  3333. $length
  3334. )
  3335. : typedArrayOffset !== undefined
  3336. ? new NativeTypedArrayConstructor(
  3337. data,
  3338. toOffset(typedArrayOffset, BYTES)
  3339. )
  3340. : new NativeTypedArrayConstructor(data);
  3341. if (isTypedArray(data))
  3342. return fromList(TypedArrayConstructor, data);
  3343. return typedArrayFrom.call(TypedArrayConstructor, data);
  3344. })(),
  3345. dummy,
  3346. TypedArrayConstructor
  3347. );
  3348. });
  3349. if (setPrototypeOf)
  3350. setPrototypeOf(TypedArrayConstructor, TypedArray);
  3351. forEach(
  3352. getOwnPropertyNames(NativeTypedArrayConstructor),
  3353. function (key) {
  3354. if (!(key in TypedArrayConstructor)) {
  3355. createNonEnumerableProperty(
  3356. TypedArrayConstructor,
  3357. key,
  3358. NativeTypedArrayConstructor[key]
  3359. );
  3360. }
  3361. }
  3362. );
  3363. TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
  3364. }
  3365. if (
  3366. TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor
  3367. ) {
  3368. createNonEnumerableProperty(
  3369. TypedArrayConstructorPrototype,
  3370. "constructor",
  3371. TypedArrayConstructor
  3372. );
  3373. }
  3374. if (TYPED_ARRAY_TAG) {
  3375. createNonEnumerableProperty(
  3376. TypedArrayConstructorPrototype,
  3377. TYPED_ARRAY_TAG,
  3378. CONSTRUCTOR_NAME
  3379. );
  3380. }
  3381. exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
  3382. $(
  3383. {
  3384. global: true,
  3385. forced: TypedArrayConstructor != NativeTypedArrayConstructor,
  3386. sham: !NATIVE_ARRAY_BUFFER_VIEWS
  3387. },
  3388. exported
  3389. );
  3390. if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
  3391. createNonEnumerableProperty(
  3392. TypedArrayConstructor,
  3393. BYTES_PER_ELEMENT,
  3394. BYTES
  3395. );
  3396. }
  3397. if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
  3398. createNonEnumerableProperty(
  3399. TypedArrayConstructorPrototype,
  3400. BYTES_PER_ELEMENT,
  3401. BYTES
  3402. );
  3403. }
  3404. setSpecies(CONSTRUCTOR_NAME);
  3405. };
  3406. } else
  3407. module.exports = function () {
  3408. /* empty */
  3409. };
  3410. /***/
  3411. },
  3412. /***/ 3832: /***/ function (
  3413. module,
  3414. __unused_webpack_exports,
  3415. __webpack_require__
  3416. ) {
  3417. /* eslint-disable no-new */
  3418. var global = __webpack_require__(7854);
  3419. var fails = __webpack_require__(7293);
  3420. var checkCorrectnessOfIteration = __webpack_require__(7072);
  3421. var NATIVE_ARRAY_BUFFER_VIEWS =
  3422. __webpack_require__(260).NATIVE_ARRAY_BUFFER_VIEWS;
  3423. var ArrayBuffer = global.ArrayBuffer;
  3424. var Int8Array = global.Int8Array;
  3425. module.exports =
  3426. !NATIVE_ARRAY_BUFFER_VIEWS ||
  3427. !fails(function () {
  3428. Int8Array(1);
  3429. }) ||
  3430. !fails(function () {
  3431. new Int8Array(-1);
  3432. }) ||
  3433. !checkCorrectnessOfIteration(function (iterable) {
  3434. new Int8Array();
  3435. new Int8Array(null);
  3436. new Int8Array(1.5);
  3437. new Int8Array(iterable);
  3438. }, true) ||
  3439. fails(function () {
  3440. // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
  3441. return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
  3442. });
  3443. /***/
  3444. },
  3445. /***/ 7321: /***/ function (
  3446. module,
  3447. __unused_webpack_exports,
  3448. __webpack_require__
  3449. ) {
  3450. var toObject = __webpack_require__(7908);
  3451. var toLength = __webpack_require__(7466);
  3452. var getIteratorMethod = __webpack_require__(1246);
  3453. var isArrayIteratorMethod = __webpack_require__(7659);
  3454. var bind = __webpack_require__(9974);
  3455. var aTypedArrayConstructor =
  3456. __webpack_require__(260).aTypedArrayConstructor;
  3457. module.exports = function from(source /* , mapfn, thisArg */) {
  3458. var O = toObject(source);
  3459. var argumentsLength = arguments.length;
  3460. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  3461. var mapping = mapfn !== undefined;
  3462. var iteratorMethod = getIteratorMethod(O);
  3463. var i, length, result, step, iterator, next;
  3464. if (
  3465. iteratorMethod != undefined &&
  3466. !isArrayIteratorMethod(iteratorMethod)
  3467. ) {
  3468. iterator = iteratorMethod.call(O);
  3469. next = iterator.next;
  3470. O = [];
  3471. while (!(step = next.call(iterator)).done) {
  3472. O.push(step.value);
  3473. }
  3474. }
  3475. if (mapping && argumentsLength > 2) {
  3476. mapfn = bind(mapfn, arguments[2], 2);
  3477. }
  3478. length = toLength(O.length);
  3479. result = new (aTypedArrayConstructor(this))(length);
  3480. for (i = 0; length > i; i++) {
  3481. result[i] = mapping ? mapfn(O[i], i) : O[i];
  3482. }
  3483. return result;
  3484. };
  3485. /***/
  3486. },
  3487. /***/ 9711: /***/ function (module) {
  3488. var id = 0;
  3489. var postfix = Math.random();
  3490. module.exports = function (key) {
  3491. return (
  3492. "Symbol(" +
  3493. String(key === undefined ? "" : key) +
  3494. ")_" +
  3495. (++id + postfix).toString(36)
  3496. );
  3497. };
  3498. /***/
  3499. },
  3500. /***/ 3307: /***/ function (
  3501. module,
  3502. __unused_webpack_exports,
  3503. __webpack_require__
  3504. ) {
  3505. var NATIVE_SYMBOL = __webpack_require__(133);
  3506. module.exports =
  3507. NATIVE_SYMBOL &&
  3508. // eslint-disable-next-line no-undef
  3509. !Symbol.sham &&
  3510. // eslint-disable-next-line no-undef
  3511. typeof Symbol.iterator == "symbol";
  3512. /***/
  3513. },
  3514. /***/ 6061: /***/ function (
  3515. __unused_webpack_module,
  3516. exports,
  3517. __webpack_require__
  3518. ) {
  3519. var wellKnownSymbol = __webpack_require__(5112);
  3520. exports.f = wellKnownSymbol;
  3521. /***/
  3522. },
  3523. /***/ 5112: /***/ function (
  3524. module,
  3525. __unused_webpack_exports,
  3526. __webpack_require__
  3527. ) {
  3528. var global = __webpack_require__(7854);
  3529. var shared = __webpack_require__(2309);
  3530. var has = __webpack_require__(6656);
  3531. var uid = __webpack_require__(9711);
  3532. var NATIVE_SYMBOL = __webpack_require__(133);
  3533. var USE_SYMBOL_AS_UID = __webpack_require__(3307);
  3534. var WellKnownSymbolsStore = shared("wks");
  3535. var Symbol = global.Symbol;
  3536. var createWellKnownSymbol = USE_SYMBOL_AS_UID
  3537. ? Symbol
  3538. : (Symbol && Symbol.withoutSetter) || uid;
  3539. module.exports = function (name) {
  3540. if (!has(WellKnownSymbolsStore, name)) {
  3541. if (NATIVE_SYMBOL && has(Symbol, name))
  3542. WellKnownSymbolsStore[name] = Symbol[name];
  3543. else
  3544. WellKnownSymbolsStore[name] = createWellKnownSymbol(
  3545. "Symbol." + name
  3546. );
  3547. }
  3548. return WellKnownSymbolsStore[name];
  3549. };
  3550. /***/
  3551. },
  3552. /***/ 7327: /***/ function (
  3553. __unused_webpack_module,
  3554. __unused_webpack_exports,
  3555. __webpack_require__
  3556. ) {
  3557. "use strict";
  3558. var $ = __webpack_require__(2109);
  3559. var $filter = __webpack_require__(2092).filter;
  3560. var arrayMethodHasSpeciesSupport = __webpack_require__(1194);
  3561. var arrayMethodUsesToLength = __webpack_require__(9207);
  3562. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter");
  3563. // Edge 14- issue
  3564. var USES_TO_LENGTH = arrayMethodUsesToLength("filter");
  3565. // `Array.prototype.filter` method
  3566. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  3567. // with adding support of @@species
  3568. $(
  3569. {
  3570. target: "Array",
  3571. proto: true,
  3572. forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH
  3573. },
  3574. {
  3575. filter: function filter(callbackfn /* , thisArg */) {
  3576. return $filter(
  3577. this,
  3578. callbackfn,
  3579. arguments.length > 1 ? arguments[1] : undefined
  3580. );
  3581. }
  3582. }
  3583. );
  3584. /***/
  3585. },
  3586. /***/ 6992: /***/ function (
  3587. module,
  3588. __unused_webpack_exports,
  3589. __webpack_require__
  3590. ) {
  3591. "use strict";
  3592. var toIndexedObject = __webpack_require__(5656);
  3593. var addToUnscopables = __webpack_require__(1223);
  3594. var Iterators = __webpack_require__(7497);
  3595. var InternalStateModule = __webpack_require__(9909);
  3596. var defineIterator = __webpack_require__(654);
  3597. var ARRAY_ITERATOR = "Array Iterator";
  3598. var setInternalState = InternalStateModule.set;
  3599. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  3600. // `Array.prototype.entries` method
  3601. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  3602. // `Array.prototype.keys` method
  3603. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  3604. // `Array.prototype.values` method
  3605. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  3606. // `Array.prototype[@@iterator]` method
  3607. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  3608. // `CreateArrayIterator` internal method
  3609. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  3610. module.exports = defineIterator(
  3611. Array,
  3612. "Array",
  3613. function (iterated, kind) {
  3614. setInternalState(this, {
  3615. type: ARRAY_ITERATOR,
  3616. target: toIndexedObject(iterated), // target
  3617. index: 0, // next index
  3618. kind: kind // kind
  3619. });
  3620. // `%ArrayIteratorPrototype%.next` method
  3621. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  3622. },
  3623. function () {
  3624. var state = getInternalState(this);
  3625. var target = state.target;
  3626. var kind = state.kind;
  3627. var index = state.index++;
  3628. if (!target || index >= target.length) {
  3629. state.target = undefined;
  3630. return { value: undefined, done: true };
  3631. }
  3632. if (kind == "keys") return { value: index, done: false };
  3633. if (kind == "values") return { value: target[index], done: false };
  3634. return { value: [index, target[index]], done: false };
  3635. },
  3636. "values"
  3637. );
  3638. // argumentsList[@@iterator] is %ArrayProto_values%
  3639. // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
  3640. // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
  3641. Iterators.Arguments = Iterators.Array;
  3642. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  3643. addToUnscopables("keys");
  3644. addToUnscopables("values");
  3645. addToUnscopables("entries");
  3646. /***/
  3647. },
  3648. /***/ 7042: /***/ function (
  3649. __unused_webpack_module,
  3650. __unused_webpack_exports,
  3651. __webpack_require__
  3652. ) {
  3653. "use strict";
  3654. var $ = __webpack_require__(2109);
  3655. var isObject = __webpack_require__(111);
  3656. var isArray = __webpack_require__(3157);
  3657. var toAbsoluteIndex = __webpack_require__(1400);
  3658. var toLength = __webpack_require__(7466);
  3659. var toIndexedObject = __webpack_require__(5656);
  3660. var createProperty = __webpack_require__(6135);
  3661. var wellKnownSymbol = __webpack_require__(5112);
  3662. var arrayMethodHasSpeciesSupport = __webpack_require__(1194);
  3663. var arrayMethodUsesToLength = __webpack_require__(9207);
  3664. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice");
  3665. var USES_TO_LENGTH = arrayMethodUsesToLength("slice", {
  3666. ACCESSORS: true,
  3667. 0: 0,
  3668. 1: 2
  3669. });
  3670. var SPECIES = wellKnownSymbol("species");
  3671. var nativeSlice = [].slice;
  3672. var max = Math.max;
  3673. // `Array.prototype.slice` method
  3674. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  3675. // fallback for not array-like ES3 strings and DOM objects
  3676. $(
  3677. {
  3678. target: "Array",
  3679. proto: true,
  3680. forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH
  3681. },
  3682. {
  3683. slice: function slice(start, end) {
  3684. var O = toIndexedObject(this);
  3685. var length = toLength(O.length);
  3686. var k = toAbsoluteIndex(start, length);
  3687. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  3688. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  3689. var Constructor, result, n;
  3690. if (isArray(O)) {
  3691. Constructor = O.constructor;
  3692. // cross-realm fallback
  3693. if (
  3694. typeof Constructor == "function" &&
  3695. (Constructor === Array || isArray(Constructor.prototype))
  3696. ) {
  3697. Constructor = undefined;
  3698. } else if (isObject(Constructor)) {
  3699. Constructor = Constructor[SPECIES];
  3700. if (Constructor === null) Constructor = undefined;
  3701. }
  3702. if (Constructor === Array || Constructor === undefined) {
  3703. return nativeSlice.call(O, k, fin);
  3704. }
  3705. }
  3706. result = new (Constructor === undefined ? Array : Constructor)(
  3707. max(fin - k, 0)
  3708. );
  3709. for (n = 0; k < fin; k++, n++)
  3710. if (k in O) createProperty(result, n, O[k]);
  3711. result.length = n;
  3712. return result;
  3713. }
  3714. }
  3715. );
  3716. /***/
  3717. },
  3718. /***/ 3706: /***/ function (
  3719. __unused_webpack_module,
  3720. __unused_webpack_exports,
  3721. __webpack_require__
  3722. ) {
  3723. var global = __webpack_require__(7854);
  3724. var setToStringTag = __webpack_require__(8003);
  3725. // JSON[@@toStringTag] property
  3726. // https://tc39.github.io/ecma262/#sec-json-@@tostringtag
  3727. setToStringTag(global.JSON, "JSON", true);
  3728. /***/
  3729. },
  3730. /***/ 2703: /***/ function (
  3731. __unused_webpack_module,
  3732. __unused_webpack_exports,
  3733. __webpack_require__
  3734. ) {
  3735. var setToStringTag = __webpack_require__(8003);
  3736. // Math[@@toStringTag] property
  3737. // https://tc39.github.io/ecma262/#sec-math-@@tostringtag
  3738. setToStringTag(Math, "Math", true);
  3739. /***/
  3740. },
  3741. /***/ 9337: /***/ function (
  3742. __unused_webpack_module,
  3743. __unused_webpack_exports,
  3744. __webpack_require__
  3745. ) {
  3746. var $ = __webpack_require__(2109);
  3747. var DESCRIPTORS = __webpack_require__(9781);
  3748. var ownKeys = __webpack_require__(3887);
  3749. var toIndexedObject = __webpack_require__(5656);
  3750. var getOwnPropertyDescriptorModule = __webpack_require__(1236);
  3751. var createProperty = __webpack_require__(6135);
  3752. // `Object.getOwnPropertyDescriptors` method
  3753. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  3754. $(
  3755. { target: "Object", stat: true, sham: !DESCRIPTORS },
  3756. {
  3757. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(
  3758. object
  3759. ) {
  3760. var O = toIndexedObject(object);
  3761. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  3762. var keys = ownKeys(O);
  3763. var result = {};
  3764. var index = 0;
  3765. var key, descriptor;
  3766. while (keys.length > index) {
  3767. descriptor = getOwnPropertyDescriptor(O, (key = keys[index++]));
  3768. if (descriptor !== undefined)
  3769. createProperty(result, key, descriptor);
  3770. }
  3771. return result;
  3772. }
  3773. }
  3774. );
  3775. /***/
  3776. },
  3777. /***/ 8674: /***/ function (
  3778. __unused_webpack_module,
  3779. __unused_webpack_exports,
  3780. __webpack_require__
  3781. ) {
  3782. "use strict";
  3783. var $ = __webpack_require__(2109);
  3784. var IS_PURE = __webpack_require__(1913);
  3785. var global = __webpack_require__(7854);
  3786. var getBuiltIn = __webpack_require__(5005);
  3787. var NativePromise = __webpack_require__(3366);
  3788. var redefine = __webpack_require__(1320);
  3789. var redefineAll = __webpack_require__(2248);
  3790. var setToStringTag = __webpack_require__(8003);
  3791. var setSpecies = __webpack_require__(6340);
  3792. var isObject = __webpack_require__(111);
  3793. var aFunction = __webpack_require__(3099);
  3794. var anInstance = __webpack_require__(5787);
  3795. var classof = __webpack_require__(4326);
  3796. var inspectSource = __webpack_require__(2788);
  3797. var iterate = __webpack_require__(408);
  3798. var checkCorrectnessOfIteration = __webpack_require__(7072);
  3799. var speciesConstructor = __webpack_require__(6707);
  3800. var task = __webpack_require__(261).set;
  3801. var microtask = __webpack_require__(5948);
  3802. var promiseResolve = __webpack_require__(9478);
  3803. var hostReportErrors = __webpack_require__(842);
  3804. var newPromiseCapabilityModule = __webpack_require__(8523);
  3805. var perform = __webpack_require__(2534);
  3806. var InternalStateModule = __webpack_require__(9909);
  3807. var isForced = __webpack_require__(4705);
  3808. var wellKnownSymbol = __webpack_require__(5112);
  3809. var V8_VERSION = __webpack_require__(7392);
  3810. var SPECIES = wellKnownSymbol("species");
  3811. var PROMISE = "Promise";
  3812. var getInternalState = InternalStateModule.get;
  3813. var setInternalState = InternalStateModule.set;
  3814. var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
  3815. var PromiseConstructor = NativePromise;
  3816. var TypeError = global.TypeError;
  3817. var document = global.document;
  3818. var process = global.process;
  3819. var $fetch = getBuiltIn("fetch");
  3820. var newPromiseCapability = newPromiseCapabilityModule.f;
  3821. var newGenericPromiseCapability = newPromiseCapability;
  3822. var IS_NODE = classof(process) == "process";
  3823. var DISPATCH_EVENT = !!(
  3824. document &&
  3825. document.createEvent &&
  3826. global.dispatchEvent
  3827. );
  3828. var UNHANDLED_REJECTION = "unhandledrejection";
  3829. var REJECTION_HANDLED = "rejectionhandled";
  3830. var PENDING = 0;
  3831. var FULFILLED = 1;
  3832. var REJECTED = 2;
  3833. var HANDLED = 1;
  3834. var UNHANDLED = 2;
  3835. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  3836. var FORCED = isForced(PROMISE, function () {
  3837. var GLOBAL_CORE_JS_PROMISE =
  3838. inspectSource(PromiseConstructor) !== String(PromiseConstructor);
  3839. if (!GLOBAL_CORE_JS_PROMISE) {
  3840. // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  3841. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  3842. // We can't detect it synchronously, so just check versions
  3843. if (V8_VERSION === 66) return true;
  3844. // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  3845. if (!IS_NODE && typeof PromiseRejectionEvent != "function")
  3846. return true;
  3847. }
  3848. // We need Promise#finally in the pure version for preventing prototype pollution
  3849. if (IS_PURE && !PromiseConstructor.prototype["finally"]) return true;
  3850. // We can't use @@species feature detection in V8 since it causes
  3851. // deoptimization and performance degradation
  3852. // https://github.com/zloirock/core-js/issues/679
  3853. if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor))
  3854. return false;
  3855. // Detect correctness of subclassing with @@species support
  3856. var promise = PromiseConstructor.resolve(1);
  3857. var FakePromise = function (exec) {
  3858. exec(
  3859. function () {
  3860. /* empty */
  3861. },
  3862. function () {
  3863. /* empty */
  3864. }
  3865. );
  3866. };
  3867. var constructor = (promise.constructor = {});
  3868. constructor[SPECIES] = FakePromise;
  3869. return !(
  3870. promise.then(function () {
  3871. /* empty */
  3872. }) instanceof FakePromise
  3873. );
  3874. });
  3875. var INCORRECT_ITERATION =
  3876. FORCED ||
  3877. !checkCorrectnessOfIteration(function (iterable) {
  3878. PromiseConstructor.all(iterable)["catch"](function () {
  3879. /* empty */
  3880. });
  3881. });
  3882. // helpers
  3883. var isThenable = function (it) {
  3884. var then;
  3885. return isObject(it) && typeof (then = it.then) == "function"
  3886. ? then
  3887. : false;
  3888. };
  3889. var notify = function (promise, state, isReject) {
  3890. if (state.notified) return;
  3891. state.notified = true;
  3892. var chain = state.reactions;
  3893. microtask(function () {
  3894. var value = state.value;
  3895. var ok = state.state == FULFILLED;
  3896. var index = 0;
  3897. // variable length - can't use forEach
  3898. while (chain.length > index) {
  3899. var reaction = chain[index++];
  3900. var handler = ok ? reaction.ok : reaction.fail;
  3901. var resolve = reaction.resolve;
  3902. var reject = reaction.reject;
  3903. var domain = reaction.domain;
  3904. var result, then, exited;
  3905. try {
  3906. if (handler) {
  3907. if (!ok) {
  3908. if (state.rejection === UNHANDLED)
  3909. onHandleUnhandled(promise, state);
  3910. state.rejection = HANDLED;
  3911. }
  3912. if (handler === true) result = value;
  3913. else {
  3914. if (domain) domain.enter();
  3915. result = handler(value); // can throw
  3916. if (domain) {
  3917. domain.exit();
  3918. exited = true;
  3919. }
  3920. }
  3921. if (result === reaction.promise) {
  3922. reject(TypeError("Promise-chain cycle"));
  3923. } else if ((then = isThenable(result))) {
  3924. then.call(result, resolve, reject);
  3925. } else resolve(result);
  3926. } else reject(value);
  3927. } catch (error) {
  3928. if (domain && !exited) domain.exit();
  3929. reject(error);
  3930. }
  3931. }
  3932. state.reactions = [];
  3933. state.notified = false;
  3934. if (isReject && !state.rejection) onUnhandled(promise, state);
  3935. });
  3936. };
  3937. var dispatchEvent = function (name, promise, reason) {
  3938. var event, handler;
  3939. if (DISPATCH_EVENT) {
  3940. event = document.createEvent("Event");
  3941. event.promise = promise;
  3942. event.reason = reason;
  3943. event.initEvent(name, false, true);
  3944. global.dispatchEvent(event);
  3945. } else event = { promise: promise, reason: reason };
  3946. if ((handler = global["on" + name])) handler(event);
  3947. else if (name === UNHANDLED_REJECTION)
  3948. hostReportErrors("Unhandled promise rejection", reason);
  3949. };
  3950. var onUnhandled = function (promise, state) {
  3951. task.call(global, function () {
  3952. var value = state.value;
  3953. var IS_UNHANDLED = isUnhandled(state);
  3954. var result;
  3955. if (IS_UNHANDLED) {
  3956. result = perform(function () {
  3957. if (IS_NODE) {
  3958. process.emit("unhandledRejection", value, promise);
  3959. } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
  3960. });
  3961. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  3962. state.rejection =
  3963. IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
  3964. if (result.error) throw result.value;
  3965. }
  3966. });
  3967. };
  3968. var isUnhandled = function (state) {
  3969. return state.rejection !== HANDLED && !state.parent;
  3970. };
  3971. var onHandleUnhandled = function (promise, state) {
  3972. task.call(global, function () {
  3973. if (IS_NODE) {
  3974. process.emit("rejectionHandled", promise);
  3975. } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
  3976. });
  3977. };
  3978. var bind = function (fn, promise, state, unwrap) {
  3979. return function (value) {
  3980. fn(promise, state, value, unwrap);
  3981. };
  3982. };
  3983. var internalReject = function (promise, state, value, unwrap) {
  3984. if (state.done) return;
  3985. state.done = true;
  3986. if (unwrap) state = unwrap;
  3987. state.value = value;
  3988. state.state = REJECTED;
  3989. notify(promise, state, true);
  3990. };
  3991. var internalResolve = function (promise, state, value, unwrap) {
  3992. if (state.done) return;
  3993. state.done = true;
  3994. if (unwrap) state = unwrap;
  3995. try {
  3996. if (promise === value)
  3997. throw TypeError("Promise can't be resolved itself");
  3998. var then = isThenable(value);
  3999. if (then) {
  4000. microtask(function () {
  4001. var wrapper = { done: false };
  4002. try {
  4003. then.call(
  4004. value,
  4005. bind(internalResolve, promise, wrapper, state),
  4006. bind(internalReject, promise, wrapper, state)
  4007. );
  4008. } catch (error) {
  4009. internalReject(promise, wrapper, error, state);
  4010. }
  4011. });
  4012. } else {
  4013. state.value = value;
  4014. state.state = FULFILLED;
  4015. notify(promise, state, false);
  4016. }
  4017. } catch (error) {
  4018. internalReject(promise, { done: false }, error, state);
  4019. }
  4020. };
  4021. // constructor polyfill
  4022. if (FORCED) {
  4023. // 25.4.3.1 Promise(executor)
  4024. PromiseConstructor = function Promise(executor) {
  4025. anInstance(this, PromiseConstructor, PROMISE);
  4026. aFunction(executor);
  4027. Internal.call(this);
  4028. var state = getInternalState(this);
  4029. try {
  4030. executor(
  4031. bind(internalResolve, this, state),
  4032. bind(internalReject, this, state)
  4033. );
  4034. } catch (error) {
  4035. internalReject(this, state, error);
  4036. }
  4037. };
  4038. // eslint-disable-next-line no-unused-vars
  4039. Internal = function Promise(executor) {
  4040. setInternalState(this, {
  4041. type: PROMISE,
  4042. done: false,
  4043. notified: false,
  4044. parent: false,
  4045. reactions: [],
  4046. rejection: false,
  4047. state: PENDING,
  4048. value: undefined
  4049. });
  4050. };
  4051. Internal.prototype = redefineAll(PromiseConstructor.prototype, {
  4052. // `Promise.prototype.then` method
  4053. // https://tc39.github.io/ecma262/#sec-promise.prototype.then
  4054. then: function then(onFulfilled, onRejected) {
  4055. var state = getInternalPromiseState(this);
  4056. var reaction = newPromiseCapability(
  4057. speciesConstructor(this, PromiseConstructor)
  4058. );
  4059. reaction.ok = typeof onFulfilled == "function" ? onFulfilled : true;
  4060. reaction.fail = typeof onRejected == "function" && onRejected;
  4061. reaction.domain = IS_NODE ? process.domain : undefined;
  4062. state.parent = true;
  4063. state.reactions.push(reaction);
  4064. if (state.state != PENDING) notify(this, state, false);
  4065. return reaction.promise;
  4066. },
  4067. // `Promise.prototype.catch` method
  4068. // https://tc39.github.io/ecma262/#sec-promise.prototype.catch
  4069. catch: function (onRejected) {
  4070. return this.then(undefined, onRejected);
  4071. }
  4072. });
  4073. OwnPromiseCapability = function () {
  4074. var promise = new Internal();
  4075. var state = getInternalState(promise);
  4076. this.promise = promise;
  4077. this.resolve = bind(internalResolve, promise, state);
  4078. this.reject = bind(internalReject, promise, state);
  4079. };
  4080. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  4081. return C === PromiseConstructor || C === PromiseWrapper
  4082. ? new OwnPromiseCapability(C)
  4083. : newGenericPromiseCapability(C);
  4084. };
  4085. if (!IS_PURE && typeof NativePromise == "function") {
  4086. nativeThen = NativePromise.prototype.then;
  4087. // wrap native Promise#then for native async functions
  4088. redefine(
  4089. NativePromise.prototype,
  4090. "then",
  4091. function then(onFulfilled, onRejected) {
  4092. var that = this;
  4093. return new PromiseConstructor(function (resolve, reject) {
  4094. nativeThen.call(that, resolve, reject);
  4095. }).then(onFulfilled, onRejected);
  4096. // https://github.com/zloirock/core-js/issues/640
  4097. },
  4098. { unsafe: true }
  4099. );
  4100. // wrap fetch result
  4101. if (typeof $fetch == "function")
  4102. $(
  4103. { global: true, enumerable: true, forced: true },
  4104. {
  4105. // eslint-disable-next-line no-unused-vars
  4106. fetch: function fetch(input /* , init */) {
  4107. return promiseResolve(
  4108. PromiseConstructor,
  4109. $fetch.apply(global, arguments)
  4110. );
  4111. }
  4112. }
  4113. );
  4114. }
  4115. }
  4116. $(
  4117. { global: true, wrap: true, forced: FORCED },
  4118. {
  4119. Promise: PromiseConstructor
  4120. }
  4121. );
  4122. setToStringTag(PromiseConstructor, PROMISE, false, true);
  4123. setSpecies(PROMISE);
  4124. PromiseWrapper = getBuiltIn(PROMISE);
  4125. // statics
  4126. $(
  4127. { target: PROMISE, stat: true, forced: FORCED },
  4128. {
  4129. // `Promise.reject` method
  4130. // https://tc39.github.io/ecma262/#sec-promise.reject
  4131. reject: function reject(r) {
  4132. var capability = newPromiseCapability(this);
  4133. capability.reject.call(undefined, r);
  4134. return capability.promise;
  4135. }
  4136. }
  4137. );
  4138. $(
  4139. { target: PROMISE, stat: true, forced: IS_PURE || FORCED },
  4140. {
  4141. // `Promise.resolve` method
  4142. // https://tc39.github.io/ecma262/#sec-promise.resolve
  4143. resolve: function resolve(x) {
  4144. return promiseResolve(
  4145. IS_PURE && this === PromiseWrapper ? PromiseConstructor : this,
  4146. x
  4147. );
  4148. }
  4149. }
  4150. );
  4151. $(
  4152. { target: PROMISE, stat: true, forced: INCORRECT_ITERATION },
  4153. {
  4154. // `Promise.all` method
  4155. // https://tc39.github.io/ecma262/#sec-promise.all
  4156. all: function all(iterable) {
  4157. var C = this;
  4158. var capability = newPromiseCapability(C);
  4159. var resolve = capability.resolve;
  4160. var reject = capability.reject;
  4161. var result = perform(function () {
  4162. var $promiseResolve = aFunction(C.resolve);
  4163. var values = [];
  4164. var counter = 0;
  4165. var remaining = 1;
  4166. iterate(iterable, function (promise) {
  4167. var index = counter++;
  4168. var alreadyCalled = false;
  4169. values.push(undefined);
  4170. remaining++;
  4171. $promiseResolve.call(C, promise).then(function (value) {
  4172. if (alreadyCalled) return;
  4173. alreadyCalled = true;
  4174. values[index] = value;
  4175. --remaining || resolve(values);
  4176. }, reject);
  4177. });
  4178. --remaining || resolve(values);
  4179. });
  4180. if (result.error) reject(result.value);
  4181. return capability.promise;
  4182. },
  4183. // `Promise.race` method
  4184. // https://tc39.github.io/ecma262/#sec-promise.race
  4185. race: function race(iterable) {
  4186. var C = this;
  4187. var capability = newPromiseCapability(C);
  4188. var reject = capability.reject;
  4189. var result = perform(function () {
  4190. var $promiseResolve = aFunction(C.resolve);
  4191. iterate(iterable, function (promise) {
  4192. $promiseResolve
  4193. .call(C, promise)
  4194. .then(capability.resolve, reject);
  4195. });
  4196. });
  4197. if (result.error) reject(result.value);
  4198. return capability.promise;
  4199. }
  4200. }
  4201. );
  4202. /***/
  4203. },
  4204. /***/ 9714: /***/ function (
  4205. __unused_webpack_module,
  4206. __unused_webpack_exports,
  4207. __webpack_require__
  4208. ) {
  4209. "use strict";
  4210. var redefine = __webpack_require__(1320);
  4211. var anObject = __webpack_require__(9670);
  4212. var fails = __webpack_require__(7293);
  4213. var flags = __webpack_require__(7066);
  4214. var TO_STRING = "toString";
  4215. var RegExpPrototype = RegExp.prototype;
  4216. var nativeToString = RegExpPrototype[TO_STRING];
  4217. var NOT_GENERIC = fails(function () {
  4218. return nativeToString.call({ source: "a", flags: "b" }) != "/a/b";
  4219. });
  4220. // FF44- RegExp#toString has a wrong name
  4221. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  4222. // `RegExp.prototype.toString` method
  4223. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  4224. if (NOT_GENERIC || INCORRECT_NAME) {
  4225. redefine(
  4226. RegExp.prototype,
  4227. TO_STRING,
  4228. function toString() {
  4229. var R = anObject(this);
  4230. var p = String(R.source);
  4231. var rf = R.flags;
  4232. var f = String(
  4233. rf === undefined &&
  4234. R instanceof RegExp &&
  4235. !("flags" in RegExpPrototype)
  4236. ? flags.call(R)
  4237. : rf
  4238. );
  4239. return "/" + p + "/" + f;
  4240. },
  4241. { unsafe: true }
  4242. );
  4243. }
  4244. /***/
  4245. },
  4246. /***/ 2443: /***/ function (
  4247. __unused_webpack_module,
  4248. __unused_webpack_exports,
  4249. __webpack_require__
  4250. ) {
  4251. var defineWellKnownSymbol = __webpack_require__(7235);
  4252. // `Symbol.asyncIterator` well-known symbol
  4253. // https://tc39.github.io/ecma262/#sec-symbol.asynciterator
  4254. defineWellKnownSymbol("asyncIterator");
  4255. /***/
  4256. },
  4257. /***/ 1817: /***/ function (
  4258. __unused_webpack_module,
  4259. __unused_webpack_exports,
  4260. __webpack_require__
  4261. ) {
  4262. "use strict";
  4263. // `Symbol.prototype.description` getter
  4264. // https://tc39.github.io/ecma262/#sec-symbol.prototype.description
  4265. var $ = __webpack_require__(2109);
  4266. var DESCRIPTORS = __webpack_require__(9781);
  4267. var global = __webpack_require__(7854);
  4268. var has = __webpack_require__(6656);
  4269. var isObject = __webpack_require__(111);
  4270. var defineProperty = __webpack_require__(3070).f;
  4271. var copyConstructorProperties = __webpack_require__(9920);
  4272. var NativeSymbol = global.Symbol;
  4273. if (
  4274. DESCRIPTORS &&
  4275. typeof NativeSymbol == "function" &&
  4276. (!("description" in NativeSymbol.prototype) ||
  4277. // Safari 12 bug
  4278. NativeSymbol().description !== undefined)
  4279. ) {
  4280. var EmptyStringDescriptionStore = {};
  4281. // wrap Symbol constructor for correct work with undefined description
  4282. var SymbolWrapper = function Symbol() {
  4283. var description =
  4284. arguments.length < 1 || arguments[0] === undefined
  4285. ? undefined
  4286. : String(arguments[0]);
  4287. var result =
  4288. this instanceof SymbolWrapper
  4289. ? new NativeSymbol(description)
  4290. : // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  4291. description === undefined
  4292. ? NativeSymbol()
  4293. : NativeSymbol(description);
  4294. if (description === "") EmptyStringDescriptionStore[result] = true;
  4295. return result;
  4296. };
  4297. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  4298. var symbolPrototype = (SymbolWrapper.prototype =
  4299. NativeSymbol.prototype);
  4300. symbolPrototype.constructor = SymbolWrapper;
  4301. var symbolToString = symbolPrototype.toString;
  4302. var native = String(NativeSymbol("test")) == "Symbol(test)";
  4303. var regexp = /^Symbol\((.*)\)[^)]+$/;
  4304. defineProperty(symbolPrototype, "description", {
  4305. configurable: true,
  4306. get: function description() {
  4307. var symbol = isObject(this) ? this.valueOf() : this;
  4308. var string = symbolToString.call(symbol);
  4309. if (has(EmptyStringDescriptionStore, symbol)) return "";
  4310. var desc = native
  4311. ? string.slice(7, -1)
  4312. : string.replace(regexp, "$1");
  4313. return desc === "" ? undefined : desc;
  4314. }
  4315. });
  4316. $(
  4317. { global: true, forced: true },
  4318. {
  4319. Symbol: SymbolWrapper
  4320. }
  4321. );
  4322. }
  4323. /***/
  4324. },
  4325. /***/ 3105: /***/ function (
  4326. __unused_webpack_module,
  4327. __unused_webpack_exports,
  4328. __webpack_require__
  4329. ) {
  4330. "use strict";
  4331. var ArrayBufferViewCore = __webpack_require__(260);
  4332. var $fill = __webpack_require__(1285);
  4333. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  4334. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  4335. // `%TypedArray%.prototype.fill` method
  4336. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill
  4337. // eslint-disable-next-line no-unused-vars
  4338. exportTypedArrayMethod("fill", function fill(value /* , start, end */) {
  4339. return $fill.apply(aTypedArray(this), arguments);
  4340. });
  4341. /***/
  4342. },
  4343. /***/ 6319: /***/ function (
  4344. __unused_webpack_module,
  4345. __unused_webpack_exports,
  4346. __webpack_require__
  4347. ) {
  4348. "use strict";
  4349. var global = __webpack_require__(7854);
  4350. var ArrayBufferViewCore = __webpack_require__(260);
  4351. var ArrayIterators = __webpack_require__(6992);
  4352. var wellKnownSymbol = __webpack_require__(5112);
  4353. var ITERATOR = wellKnownSymbol("iterator");
  4354. var Uint8Array = global.Uint8Array;
  4355. var arrayValues = ArrayIterators.values;
  4356. var arrayKeys = ArrayIterators.keys;
  4357. var arrayEntries = ArrayIterators.entries;
  4358. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  4359. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  4360. var nativeTypedArrayIterator =
  4361. Uint8Array && Uint8Array.prototype[ITERATOR];
  4362. var CORRECT_ITER_NAME =
  4363. !!nativeTypedArrayIterator &&
  4364. (nativeTypedArrayIterator.name == "values" ||
  4365. nativeTypedArrayIterator.name == undefined);
  4366. var typedArrayValues = function values() {
  4367. return arrayValues.call(aTypedArray(this));
  4368. };
  4369. // `%TypedArray%.prototype.entries` method
  4370. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries
  4371. exportTypedArrayMethod("entries", function entries() {
  4372. return arrayEntries.call(aTypedArray(this));
  4373. });
  4374. // `%TypedArray%.prototype.keys` method
  4375. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys
  4376. exportTypedArrayMethod("keys", function keys() {
  4377. return arrayKeys.call(aTypedArray(this));
  4378. });
  4379. // `%TypedArray%.prototype.values` method
  4380. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values
  4381. exportTypedArrayMethod("values", typedArrayValues, !CORRECT_ITER_NAME);
  4382. // `%TypedArray%.prototype[@@iterator]` method
  4383. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator
  4384. exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);
  4385. /***/
  4386. },
  4387. /***/ 3462: /***/ function (
  4388. __unused_webpack_module,
  4389. __unused_webpack_exports,
  4390. __webpack_require__
  4391. ) {
  4392. "use strict";
  4393. var ArrayBufferViewCore = __webpack_require__(260);
  4394. var toLength = __webpack_require__(7466);
  4395. var toOffset = __webpack_require__(4590);
  4396. var toObject = __webpack_require__(7908);
  4397. var fails = __webpack_require__(7293);
  4398. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  4399. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  4400. var FORCED = fails(function () {
  4401. // eslint-disable-next-line no-undef
  4402. new Int8Array(1).set({});
  4403. });
  4404. // `%TypedArray%.prototype.set` method
  4405. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set
  4406. exportTypedArrayMethod(
  4407. "set",
  4408. function set(arrayLike /* , offset */) {
  4409. aTypedArray(this);
  4410. var offset = toOffset(
  4411. arguments.length > 1 ? arguments[1] : undefined,
  4412. 1
  4413. );
  4414. var length = this.length;
  4415. var src = toObject(arrayLike);
  4416. var len = toLength(src.length);
  4417. var index = 0;
  4418. if (len + offset > length) throw RangeError("Wrong length");
  4419. while (index < len) this[offset + index] = src[index++];
  4420. },
  4421. FORCED
  4422. );
  4423. /***/
  4424. },
  4425. /***/ 3824: /***/ function (
  4426. __unused_webpack_module,
  4427. __unused_webpack_exports,
  4428. __webpack_require__
  4429. ) {
  4430. "use strict";
  4431. var ArrayBufferViewCore = __webpack_require__(260);
  4432. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  4433. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  4434. var $sort = [].sort;
  4435. // `%TypedArray%.prototype.sort` method
  4436. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort
  4437. exportTypedArrayMethod("sort", function sort(comparefn) {
  4438. return $sort.call(aTypedArray(this), comparefn);
  4439. });
  4440. /***/
  4441. },
  4442. /***/ 5016: /***/ function (
  4443. __unused_webpack_module,
  4444. __unused_webpack_exports,
  4445. __webpack_require__
  4446. ) {
  4447. "use strict";
  4448. var exportTypedArrayMethod =
  4449. __webpack_require__(260).exportTypedArrayMethod;
  4450. var fails = __webpack_require__(7293);
  4451. var global = __webpack_require__(7854);
  4452. var Uint8Array = global.Uint8Array;
  4453. var Uint8ArrayPrototype = (Uint8Array && Uint8Array.prototype) || {};
  4454. var arrayToString = [].toString;
  4455. var arrayJoin = [].join;
  4456. if (
  4457. fails(function () {
  4458. arrayToString.call({});
  4459. })
  4460. ) {
  4461. arrayToString = function toString() {
  4462. return arrayJoin.call(this);
  4463. };
  4464. }
  4465. var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
  4466. // `%TypedArray%.prototype.toString` method
  4467. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring
  4468. exportTypedArrayMethod("toString", arrayToString, IS_NOT_ARRAY_METHOD);
  4469. /***/
  4470. },
  4471. /***/ 9743: /***/ function (
  4472. __unused_webpack_module,
  4473. __unused_webpack_exports,
  4474. __webpack_require__
  4475. ) {
  4476. var createTypedArrayConstructor = __webpack_require__(9843);
  4477. // `Uint8ClampedArray` constructor
  4478. // https://tc39.github.io/ecma262/#sec-typedarray-objects
  4479. createTypedArrayConstructor(
  4480. "Uint8",
  4481. function (init) {
  4482. return function Uint8ClampedArray(data, byteOffset, length) {
  4483. return init(this, data, byteOffset, length);
  4484. };
  4485. },
  4486. true
  4487. );
  4488. /***/
  4489. },
  4490. /***/ 4747: /***/ function (
  4491. __unused_webpack_module,
  4492. __unused_webpack_exports,
  4493. __webpack_require__
  4494. ) {
  4495. var global = __webpack_require__(7854);
  4496. var DOMIterables = __webpack_require__(8324);
  4497. var forEach = __webpack_require__(8533);
  4498. var createNonEnumerableProperty = __webpack_require__(8880);
  4499. for (var COLLECTION_NAME in DOMIterables) {
  4500. var Collection = global[COLLECTION_NAME];
  4501. var CollectionPrototype = Collection && Collection.prototype;
  4502. // some Chrome versions have non-configurable methods on DOMTokenList
  4503. if (CollectionPrototype && CollectionPrototype.forEach !== forEach)
  4504. try {
  4505. createNonEnumerableProperty(
  4506. CollectionPrototype,
  4507. "forEach",
  4508. forEach
  4509. );
  4510. } catch (error) {
  4511. CollectionPrototype.forEach = forEach;
  4512. }
  4513. }
  4514. /***/
  4515. },
  4516. /***/ 3948: /***/ function (
  4517. __unused_webpack_module,
  4518. __unused_webpack_exports,
  4519. __webpack_require__
  4520. ) {
  4521. var global = __webpack_require__(7854);
  4522. var DOMIterables = __webpack_require__(8324);
  4523. var ArrayIteratorMethods = __webpack_require__(6992);
  4524. var createNonEnumerableProperty = __webpack_require__(8880);
  4525. var wellKnownSymbol = __webpack_require__(5112);
  4526. var ITERATOR = wellKnownSymbol("iterator");
  4527. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  4528. var ArrayValues = ArrayIteratorMethods.values;
  4529. for (var COLLECTION_NAME in DOMIterables) {
  4530. var Collection = global[COLLECTION_NAME];
  4531. var CollectionPrototype = Collection && Collection.prototype;
  4532. if (CollectionPrototype) {
  4533. // some Chrome versions have non-configurable methods on DOMTokenList
  4534. if (CollectionPrototype[ITERATOR] !== ArrayValues)
  4535. try {
  4536. createNonEnumerableProperty(
  4537. CollectionPrototype,
  4538. ITERATOR,
  4539. ArrayValues
  4540. );
  4541. } catch (error) {
  4542. CollectionPrototype[ITERATOR] = ArrayValues;
  4543. }
  4544. if (!CollectionPrototype[TO_STRING_TAG]) {
  4545. createNonEnumerableProperty(
  4546. CollectionPrototype,
  4547. TO_STRING_TAG,
  4548. COLLECTION_NAME
  4549. );
  4550. }
  4551. if (DOMIterables[COLLECTION_NAME])
  4552. for (var METHOD_NAME in ArrayIteratorMethods) {
  4553. // some Chrome versions have non-configurable methods on DOMTokenList
  4554. if (
  4555. CollectionPrototype[METHOD_NAME] !==
  4556. ArrayIteratorMethods[METHOD_NAME]
  4557. )
  4558. try {
  4559. createNonEnumerableProperty(
  4560. CollectionPrototype,
  4561. METHOD_NAME,
  4562. ArrayIteratorMethods[METHOD_NAME]
  4563. );
  4564. } catch (error) {
  4565. CollectionPrototype[METHOD_NAME] =
  4566. ArrayIteratorMethods[METHOD_NAME];
  4567. }
  4568. }
  4569. }
  4570. }
  4571. /***/
  4572. }
  4573. /******/
  4574. };
  4575. /************************************************************************/
  4576. /******/ // The module cache
  4577. /******/ var __webpack_module_cache__ = {};
  4578. /******/
  4579. /******/ // The require function
  4580. /******/ function __webpack_require__(moduleId) {
  4581. /******/ // Check if module is in cache
  4582. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  4583. /******/ if (cachedModule !== undefined) {
  4584. /******/ return cachedModule.exports;
  4585. /******/
  4586. }
  4587. /******/ // Create a new module (and put it into the cache)
  4588. /******/ var module = (__webpack_module_cache__[moduleId] = {
  4589. /******/ // no module.id needed
  4590. /******/ // no module.loaded needed
  4591. /******/ exports: {}
  4592. /******/
  4593. });
  4594. /******/
  4595. /******/ // Execute the module function
  4596. /******/ __webpack_modules__[moduleId](
  4597. module,
  4598. module.exports,
  4599. __webpack_require__
  4600. );
  4601. /******/
  4602. /******/ // Return the exports of the module
  4603. /******/ return module.exports;
  4604. /******/
  4605. }
  4606. /******/
  4607. /************************************************************************/
  4608. /******/ /* webpack/runtime/compat get default export */
  4609. /******/ !(function () {
  4610. /******/ // getDefaultExport function for compatibility with non-harmony modules
  4611. /******/ __webpack_require__.n = function (module) {
  4612. /******/ var getter =
  4613. module && module.__esModule
  4614. ? /******/ function () {
  4615. return module["default"];
  4616. }
  4617. : /******/ function () {
  4618. return module;
  4619. };
  4620. /******/ __webpack_require__.d(getter, { a: getter });
  4621. /******/ return getter;
  4622. /******/
  4623. };
  4624. /******/
  4625. })();
  4626. /******/
  4627. /******/ /* webpack/runtime/define property getters */
  4628. /******/ !(function () {
  4629. /******/ // define getter functions for harmony exports
  4630. /******/ __webpack_require__.d = function (exports, definition) {
  4631. /******/ for (var key in definition) {
  4632. /******/ if (
  4633. __webpack_require__.o(definition, key) &&
  4634. !__webpack_require__.o(exports, key)
  4635. ) {
  4636. /******/ Object.defineProperty(exports, key, {
  4637. enumerable: true,
  4638. get: definition[key]
  4639. });
  4640. /******/
  4641. }
  4642. /******/
  4643. }
  4644. /******/
  4645. };
  4646. /******/
  4647. })();
  4648. /******/
  4649. /******/ /* webpack/runtime/global */
  4650. /******/ !(function () {
  4651. /******/ __webpack_require__.g = (function () {
  4652. /******/ if (typeof globalThis === "object") return globalThis;
  4653. /******/ try {
  4654. /******/ return this || new Function("return this")();
  4655. /******/
  4656. } catch (e) {
  4657. /******/ if (typeof window === "object") return window;
  4658. /******/
  4659. }
  4660. /******/
  4661. })();
  4662. /******/
  4663. })();
  4664. /******/
  4665. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  4666. /******/ !(function () {
  4667. /******/ __webpack_require__.o = function (obj, prop) {
  4668. return Object.prototype.hasOwnProperty.call(obj, prop);
  4669. };
  4670. /******/
  4671. })();
  4672. /******/
  4673. /************************************************************************/
  4674. var __webpack_exports__ = {};
  4675. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  4676. !(function () {
  4677. "use strict";
  4678. /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ =
  4679. __webpack_require__(7042);
  4680. /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0___default =
  4681. /*#__PURE__*/ __webpack_require__.n(
  4682. core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__
  4683. );
  4684. /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1__ =
  4685. __webpack_require__(6992);
  4686. /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1___default =
  4687. /*#__PURE__*/ __webpack_require__.n(
  4688. core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1__
  4689. );
  4690. /* harmony import */ var core_js_modules_es_typed_array_uint8_clamped_array_js__WEBPACK_IMPORTED_MODULE_2__ =
  4691. __webpack_require__(9743);
  4692. /* harmony import */ var core_js_modules_es_typed_array_uint8_clamped_array_js__WEBPACK_IMPORTED_MODULE_2___default =
  4693. /*#__PURE__*/ __webpack_require__.n(
  4694. core_js_modules_es_typed_array_uint8_clamped_array_js__WEBPACK_IMPORTED_MODULE_2__
  4695. );
  4696. /* harmony import */ var core_js_modules_es_typed_array_fill_js__WEBPACK_IMPORTED_MODULE_3__ =
  4697. __webpack_require__(3105);
  4698. /* harmony import */ var core_js_modules_es_typed_array_fill_js__WEBPACK_IMPORTED_MODULE_3___default =
  4699. /*#__PURE__*/ __webpack_require__.n(
  4700. core_js_modules_es_typed_array_fill_js__WEBPACK_IMPORTED_MODULE_3__
  4701. );
  4702. /* harmony import */ var core_js_modules_es_typed_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ =
  4703. __webpack_require__(6319);
  4704. /* harmony import */ var core_js_modules_es_typed_array_iterator_js__WEBPACK_IMPORTED_MODULE_4___default =
  4705. /*#__PURE__*/ __webpack_require__.n(
  4706. core_js_modules_es_typed_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__
  4707. );
  4708. /* harmony import */ var core_js_modules_es_typed_array_set_js__WEBPACK_IMPORTED_MODULE_5__ =
  4709. __webpack_require__(3462);
  4710. /* harmony import */ var core_js_modules_es_typed_array_set_js__WEBPACK_IMPORTED_MODULE_5___default =
  4711. /*#__PURE__*/ __webpack_require__.n(
  4712. core_js_modules_es_typed_array_set_js__WEBPACK_IMPORTED_MODULE_5__
  4713. );
  4714. /* harmony import */ var core_js_modules_es_typed_array_sort_js__WEBPACK_IMPORTED_MODULE_6__ =
  4715. __webpack_require__(3824);
  4716. /* harmony import */ var core_js_modules_es_typed_array_sort_js__WEBPACK_IMPORTED_MODULE_6___default =
  4717. /*#__PURE__*/ __webpack_require__.n(
  4718. core_js_modules_es_typed_array_sort_js__WEBPACK_IMPORTED_MODULE_6__
  4719. );
  4720. /* harmony import */ var core_js_modules_es_typed_array_to_string_js__WEBPACK_IMPORTED_MODULE_7__ =
  4721. __webpack_require__(5016);
  4722. /* harmony import */ var core_js_modules_es_typed_array_to_string_js__WEBPACK_IMPORTED_MODULE_7___default =
  4723. /*#__PURE__*/ __webpack_require__.n(
  4724. core_js_modules_es_typed_array_to_string_js__WEBPACK_IMPORTED_MODULE_7__
  4725. );
  4726. /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8__ =
  4727. __webpack_require__(4747);
  4728. /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8___default =
  4729. /*#__PURE__*/ __webpack_require__.n(
  4730. core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8__
  4731. );
  4732. /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_9__ =
  4733. __webpack_require__(9714);
  4734. /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_9___default =
  4735. /*#__PURE__*/ __webpack_require__.n(
  4736. core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_9__
  4737. );
  4738. /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_10__ =
  4739. __webpack_require__(1817);
  4740. /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_10___default =
  4741. /*#__PURE__*/ __webpack_require__.n(
  4742. core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_10__
  4743. );
  4744. /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_11__ =
  4745. __webpack_require__(8674);
  4746. /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_11___default =
  4747. /*#__PURE__*/ __webpack_require__.n(
  4748. core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_11__
  4749. );
  4750. /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_12__ =
  4751. __webpack_require__(7327);
  4752. /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_12___default =
  4753. /*#__PURE__*/ __webpack_require__.n(
  4754. core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_12__
  4755. );
  4756. /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_13__ =
  4757. __webpack_require__(9337);
  4758. /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_13___default =
  4759. /*#__PURE__*/ __webpack_require__.n(
  4760. core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_13__
  4761. );
  4762. /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14__ =
  4763. __webpack_require__(3948);
  4764. /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14___default =
  4765. /*#__PURE__*/ __webpack_require__.n(
  4766. core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14__
  4767. );
  4768. /* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_15__ =
  4769. __webpack_require__(2443);
  4770. /* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_15___default =
  4771. /*#__PURE__*/ __webpack_require__.n(
  4772. core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_15__
  4773. );
  4774. /* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_16__ =
  4775. __webpack_require__(3706);
  4776. /* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_16___default =
  4777. /*#__PURE__*/ __webpack_require__.n(
  4778. core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_16__
  4779. );
  4780. /* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_17__ =
  4781. __webpack_require__(2703);
  4782. /* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_17___default =
  4783. /*#__PURE__*/ __webpack_require__.n(
  4784. core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_17__
  4785. );
  4786. function _regeneratorRuntime() {
  4787. "use strict";
  4788. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime =
  4789. function _regeneratorRuntime() {
  4790. return exports;
  4791. };
  4792. var exports = {},
  4793. Op = Object.prototype,
  4794. hasOwn = Op.hasOwnProperty,
  4795. defineProperty =
  4796. Object.defineProperty ||
  4797. function (obj, key, desc) {
  4798. obj[key] = desc.value;
  4799. },
  4800. $Symbol = "function" == typeof Symbol ? Symbol : {},
  4801. iteratorSymbol = $Symbol.iterator || "@@iterator",
  4802. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  4803. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  4804. function define(obj, key, value) {
  4805. return (
  4806. Object.defineProperty(obj, key, {
  4807. value: value,
  4808. enumerable: !0,
  4809. configurable: !0,
  4810. writable: !0
  4811. }),
  4812. obj[key]
  4813. );
  4814. }
  4815. try {
  4816. define({}, "");
  4817. } catch (err) {
  4818. define = function define(obj, key, value) {
  4819. return (obj[key] = value);
  4820. };
  4821. }
  4822. function wrap(innerFn, outerFn, self, tryLocsList) {
  4823. var protoGenerator =
  4824. outerFn && outerFn.prototype instanceof Generator
  4825. ? outerFn
  4826. : Generator,
  4827. generator = Object.create(protoGenerator.prototype),
  4828. context = new Context(tryLocsList || []);
  4829. return (
  4830. defineProperty(generator, "_invoke", {
  4831. value: makeInvokeMethod(innerFn, self, context)
  4832. }),
  4833. generator
  4834. );
  4835. }
  4836. function tryCatch(fn, obj, arg) {
  4837. try {
  4838. return { type: "normal", arg: fn.call(obj, arg) };
  4839. } catch (err) {
  4840. return { type: "throw", arg: err };
  4841. }
  4842. }
  4843. exports.wrap = wrap;
  4844. var ContinueSentinel = {};
  4845. function Generator() {}
  4846. function GeneratorFunction() {}
  4847. function GeneratorFunctionPrototype() {}
  4848. var IteratorPrototype = {};
  4849. define(IteratorPrototype, iteratorSymbol, function () {
  4850. return this;
  4851. });
  4852. var getProto = Object.getPrototypeOf,
  4853. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  4854. NativeIteratorPrototype &&
  4855. NativeIteratorPrototype !== Op &&
  4856. hasOwn.call(NativeIteratorPrototype, iteratorSymbol) &&
  4857. (IteratorPrototype = NativeIteratorPrototype);
  4858. var Gp =
  4859. (GeneratorFunctionPrototype.prototype =
  4860. Generator.prototype =
  4861. Object.create(IteratorPrototype));
  4862. function defineIteratorMethods(prototype) {
  4863. ["next", "throw", "return"].forEach(function (method) {
  4864. define(prototype, method, function (arg) {
  4865. return this._invoke(method, arg);
  4866. });
  4867. });
  4868. }
  4869. function AsyncIterator(generator, PromiseImpl) {
  4870. function invoke(method, arg, resolve, reject) {
  4871. var record = tryCatch(generator[method], generator, arg);
  4872. if ("throw" !== record.type) {
  4873. var result = record.arg,
  4874. value = result.value;
  4875. return value &&
  4876. "object" == typeof value &&
  4877. hasOwn.call(value, "__await")
  4878. ? PromiseImpl.resolve(value.__await).then(
  4879. function (value) {
  4880. invoke("next", value, resolve, reject);
  4881. },
  4882. function (err) {
  4883. invoke("throw", err, resolve, reject);
  4884. }
  4885. )
  4886. : PromiseImpl.resolve(value).then(
  4887. function (unwrapped) {
  4888. (result.value = unwrapped), resolve(result);
  4889. },
  4890. function (error) {
  4891. return invoke("throw", error, resolve, reject);
  4892. }
  4893. );
  4894. }
  4895. reject(record.arg);
  4896. }
  4897. var previousPromise;
  4898. defineProperty(this, "_invoke", {
  4899. value: function value(method, arg) {
  4900. function callInvokeWithMethodAndArg() {
  4901. return new PromiseImpl(function (resolve, reject) {
  4902. invoke(method, arg, resolve, reject);
  4903. });
  4904. }
  4905. return (previousPromise = previousPromise
  4906. ? previousPromise.then(
  4907. callInvokeWithMethodAndArg,
  4908. callInvokeWithMethodAndArg
  4909. )
  4910. : callInvokeWithMethodAndArg());
  4911. }
  4912. });
  4913. }
  4914. function makeInvokeMethod(innerFn, self, context) {
  4915. var state = "suspendedStart";
  4916. return function (method, arg) {
  4917. if ("executing" === state)
  4918. throw new Error("Generator is already running");
  4919. if ("completed" === state) {
  4920. if ("throw" === method) throw arg;
  4921. return doneResult();
  4922. }
  4923. for (context.method = method, context.arg = arg; ; ) {
  4924. var delegate = context.delegate;
  4925. if (delegate) {
  4926. var delegateResult = maybeInvokeDelegate(delegate, context);
  4927. if (delegateResult) {
  4928. if (delegateResult === ContinueSentinel) continue;
  4929. return delegateResult;
  4930. }
  4931. }
  4932. if ("next" === context.method)
  4933. context.sent = context._sent = context.arg;
  4934. else if ("throw" === context.method) {
  4935. if ("suspendedStart" === state)
  4936. throw ((state = "completed"), context.arg);
  4937. context.dispatchException(context.arg);
  4938. } else
  4939. "return" === context.method &&
  4940. context.abrupt("return", context.arg);
  4941. state = "executing";
  4942. var record = tryCatch(innerFn, self, context);
  4943. if ("normal" === record.type) {
  4944. if (
  4945. ((state = context.done ? "completed" : "suspendedYield"),
  4946. record.arg === ContinueSentinel)
  4947. )
  4948. continue;
  4949. return { value: record.arg, done: context.done };
  4950. }
  4951. "throw" === record.type &&
  4952. ((state = "completed"),
  4953. (context.method = "throw"),
  4954. (context.arg = record.arg));
  4955. }
  4956. };
  4957. }
  4958. function maybeInvokeDelegate(delegate, context) {
  4959. var method = delegate.iterator[context.method];
  4960. if (undefined === method) {
  4961. if (((context.delegate = null), "throw" === context.method)) {
  4962. if (
  4963. delegate.iterator.return &&
  4964. ((context.method = "return"),
  4965. (context.arg = undefined),
  4966. maybeInvokeDelegate(delegate, context),
  4967. "throw" === context.method)
  4968. )
  4969. return ContinueSentinel;
  4970. (context.method = "throw"),
  4971. (context.arg = new TypeError(
  4972. "The iterator does not provide a 'throw' method"
  4973. ));
  4974. }
  4975. return ContinueSentinel;
  4976. }
  4977. var record = tryCatch(method, delegate.iterator, context.arg);
  4978. if ("throw" === record.type)
  4979. return (
  4980. (context.method = "throw"),
  4981. (context.arg = record.arg),
  4982. (context.delegate = null),
  4983. ContinueSentinel
  4984. );
  4985. var info = record.arg;
  4986. return info
  4987. ? info.done
  4988. ? ((context[delegate.resultName] = info.value),
  4989. (context.next = delegate.nextLoc),
  4990. "return" !== context.method &&
  4991. ((context.method = "next"), (context.arg = undefined)),
  4992. (context.delegate = null),
  4993. ContinueSentinel)
  4994. : info
  4995. : ((context.method = "throw"),
  4996. (context.arg = new TypeError("iterator result is not an object")),
  4997. (context.delegate = null),
  4998. ContinueSentinel);
  4999. }
  5000. function pushTryEntry(locs) {
  5001. var entry = { tryLoc: locs[0] };
  5002. 1 in locs && (entry.catchLoc = locs[1]),
  5003. 2 in locs &&
  5004. ((entry.finallyLoc = locs[2]), (entry.afterLoc = locs[3])),
  5005. this.tryEntries.push(entry);
  5006. }
  5007. function resetTryEntry(entry) {
  5008. var record = entry.completion || {};
  5009. (record.type = "normal"),
  5010. delete record.arg,
  5011. (entry.completion = record);
  5012. }
  5013. function Context(tryLocsList) {
  5014. (this.tryEntries = [{ tryLoc: "root" }]),
  5015. tryLocsList.forEach(pushTryEntry, this),
  5016. this.reset(!0);
  5017. }
  5018. function values(iterable) {
  5019. if (iterable) {
  5020. var iteratorMethod = iterable[iteratorSymbol];
  5021. if (iteratorMethod) return iteratorMethod.call(iterable);
  5022. if ("function" == typeof iterable.next) return iterable;
  5023. if (!isNaN(iterable.length)) {
  5024. var i = -1,
  5025. next = function next() {
  5026. for (; ++i < iterable.length; )
  5027. if (hasOwn.call(iterable, i))
  5028. return (next.value = iterable[i]), (next.done = !1), next;
  5029. return (next.value = undefined), (next.done = !0), next;
  5030. };
  5031. return (next.next = next);
  5032. }
  5033. }
  5034. return { next: doneResult };
  5035. }
  5036. function doneResult() {
  5037. return { value: undefined, done: !0 };
  5038. }
  5039. return (
  5040. (GeneratorFunction.prototype = GeneratorFunctionPrototype),
  5041. defineProperty(Gp, "constructor", {
  5042. value: GeneratorFunctionPrototype,
  5043. configurable: !0
  5044. }),
  5045. defineProperty(GeneratorFunctionPrototype, "constructor", {
  5046. value: GeneratorFunction,
  5047. configurable: !0
  5048. }),
  5049. (GeneratorFunction.displayName = define(
  5050. GeneratorFunctionPrototype,
  5051. toStringTagSymbol,
  5052. "GeneratorFunction"
  5053. )),
  5054. (exports.isGeneratorFunction = function (genFun) {
  5055. var ctor = "function" == typeof genFun && genFun.constructor;
  5056. return (
  5057. !!ctor &&
  5058. (ctor === GeneratorFunction ||
  5059. "GeneratorFunction" === (ctor.displayName || ctor.name))
  5060. );
  5061. }),
  5062. (exports.mark = function (genFun) {
  5063. return (
  5064. Object.setPrototypeOf
  5065. ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype)
  5066. : ((genFun.__proto__ = GeneratorFunctionPrototype),
  5067. define(genFun, toStringTagSymbol, "GeneratorFunction")),
  5068. (genFun.prototype = Object.create(Gp)),
  5069. genFun
  5070. );
  5071. }),
  5072. (exports.awrap = function (arg) {
  5073. return { __await: arg };
  5074. }),
  5075. defineIteratorMethods(AsyncIterator.prototype),
  5076. define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  5077. return this;
  5078. }),
  5079. (exports.AsyncIterator = AsyncIterator),
  5080. (exports.async = function (
  5081. innerFn,
  5082. outerFn,
  5083. self,
  5084. tryLocsList,
  5085. PromiseImpl
  5086. ) {
  5087. void 0 === PromiseImpl && (PromiseImpl = Promise);
  5088. var iter = new AsyncIterator(
  5089. wrap(innerFn, outerFn, self, tryLocsList),
  5090. PromiseImpl
  5091. );
  5092. return exports.isGeneratorFunction(outerFn)
  5093. ? iter
  5094. : iter.next().then(function (result) {
  5095. return result.done ? result.value : iter.next();
  5096. });
  5097. }),
  5098. defineIteratorMethods(Gp),
  5099. define(Gp, toStringTagSymbol, "Generator"),
  5100. define(Gp, iteratorSymbol, function () {
  5101. return this;
  5102. }),
  5103. define(Gp, "toString", function () {
  5104. return "[object Generator]";
  5105. }),
  5106. (exports.keys = function (val) {
  5107. var object = Object(val),
  5108. keys = [];
  5109. for (var key in object) keys.push(key);
  5110. return (
  5111. keys.reverse(),
  5112. function next() {
  5113. for (; keys.length; ) {
  5114. var key = keys.pop();
  5115. if (key in object)
  5116. return (next.value = key), (next.done = !1), next;
  5117. }
  5118. return (next.done = !0), next;
  5119. }
  5120. );
  5121. }),
  5122. (exports.values = values),
  5123. (Context.prototype = {
  5124. constructor: Context,
  5125. reset: function reset(skipTempReset) {
  5126. if (
  5127. ((this.prev = 0),
  5128. (this.next = 0),
  5129. (this.sent = this._sent = undefined),
  5130. (this.done = !1),
  5131. (this.delegate = null),
  5132. (this.method = "next"),
  5133. (this.arg = undefined),
  5134. this.tryEntries.forEach(resetTryEntry),
  5135. !skipTempReset)
  5136. )
  5137. for (var name in this)
  5138. "t" === name.charAt(0) &&
  5139. hasOwn.call(this, name) &&
  5140. !isNaN(+name.slice(1)) &&
  5141. (this[name] = undefined);
  5142. },
  5143. stop: function stop() {
  5144. this.done = !0;
  5145. var rootRecord = this.tryEntries[0].completion;
  5146. if ("throw" === rootRecord.type) throw rootRecord.arg;
  5147. return this.rval;
  5148. },
  5149. dispatchException: function dispatchException(exception) {
  5150. if (this.done) throw exception;
  5151. var context = this;
  5152. function handle(loc, caught) {
  5153. return (
  5154. (record.type = "throw"),
  5155. (record.arg = exception),
  5156. (context.next = loc),
  5157. caught &&
  5158. ((context.method = "next"), (context.arg = undefined)),
  5159. !!caught
  5160. );
  5161. }
  5162. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5163. var entry = this.tryEntries[i],
  5164. record = entry.completion;
  5165. if ("root" === entry.tryLoc) return handle("end");
  5166. if (entry.tryLoc <= this.prev) {
  5167. var hasCatch = hasOwn.call(entry, "catchLoc"),
  5168. hasFinally = hasOwn.call(entry, "finallyLoc");
  5169. if (hasCatch && hasFinally) {
  5170. if (this.prev < entry.catchLoc)
  5171. return handle(entry.catchLoc, !0);
  5172. if (this.prev < entry.finallyLoc)
  5173. return handle(entry.finallyLoc);
  5174. } else if (hasCatch) {
  5175. if (this.prev < entry.catchLoc)
  5176. return handle(entry.catchLoc, !0);
  5177. } else {
  5178. if (!hasFinally)
  5179. throw new Error("try statement without catch or finally");
  5180. if (this.prev < entry.finallyLoc)
  5181. return handle(entry.finallyLoc);
  5182. }
  5183. }
  5184. }
  5185. },
  5186. abrupt: function abrupt(type, arg) {
  5187. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5188. var entry = this.tryEntries[i];
  5189. if (
  5190. entry.tryLoc <= this.prev &&
  5191. hasOwn.call(entry, "finallyLoc") &&
  5192. this.prev < entry.finallyLoc
  5193. ) {
  5194. var finallyEntry = entry;
  5195. break;
  5196. }
  5197. }
  5198. finallyEntry &&
  5199. ("break" === type || "continue" === type) &&
  5200. finallyEntry.tryLoc <= arg &&
  5201. arg <= finallyEntry.finallyLoc &&
  5202. (finallyEntry = null);
  5203. var record = finallyEntry ? finallyEntry.completion : {};
  5204. return (
  5205. (record.type = type),
  5206. (record.arg = arg),
  5207. finallyEntry
  5208. ? ((this.method = "next"),
  5209. (this.next = finallyEntry.finallyLoc),
  5210. ContinueSentinel)
  5211. : this.complete(record)
  5212. );
  5213. },
  5214. complete: function complete(record, afterLoc) {
  5215. if ("throw" === record.type) throw record.arg;
  5216. return (
  5217. "break" === record.type || "continue" === record.type
  5218. ? (this.next = record.arg)
  5219. : "return" === record.type
  5220. ? ((this.rval = this.arg = record.arg),
  5221. (this.method = "return"),
  5222. (this.next = "end"))
  5223. : "normal" === record.type &&
  5224. afterLoc &&
  5225. (this.next = afterLoc),
  5226. ContinueSentinel
  5227. );
  5228. },
  5229. finish: function finish(finallyLoc) {
  5230. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5231. var entry = this.tryEntries[i];
  5232. if (entry.finallyLoc === finallyLoc)
  5233. return (
  5234. this.complete(entry.completion, entry.afterLoc),
  5235. resetTryEntry(entry),
  5236. ContinueSentinel
  5237. );
  5238. }
  5239. },
  5240. catch: function _catch(tryLoc) {
  5241. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  5242. var entry = this.tryEntries[i];
  5243. if (entry.tryLoc === tryLoc) {
  5244. var record = entry.completion;
  5245. if ("throw" === record.type) {
  5246. var thrown = record.arg;
  5247. resetTryEntry(entry);
  5248. }
  5249. return thrown;
  5250. }
  5251. }
  5252. throw new Error("illegal catch attempt");
  5253. },
  5254. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  5255. return (
  5256. (this.delegate = {
  5257. iterator: values(iterable),
  5258. resultName: resultName,
  5259. nextLoc: nextLoc
  5260. }),
  5261. "next" === this.method && (this.arg = undefined),
  5262. ContinueSentinel
  5263. );
  5264. }
  5265. }),
  5266. exports
  5267. );
  5268. }
  5269. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  5270. try {
  5271. var info = gen[key](arg);
  5272. var value = info.value;
  5273. } catch (error) {
  5274. reject(error);
  5275. return;
  5276. }
  5277. if (info.done) {
  5278. resolve(value);
  5279. } else {
  5280. Promise.resolve(value).then(_next, _throw);
  5281. }
  5282. }
  5283. function _asyncToGenerator(fn) {
  5284. return function () {
  5285. var self = this,
  5286. args = arguments;
  5287. return new Promise(function (resolve, reject) {
  5288. var gen = fn.apply(self, args);
  5289. function _next(value) {
  5290. asyncGeneratorStep(
  5291. gen,
  5292. resolve,
  5293. reject,
  5294. _next,
  5295. _throw,
  5296. "next",
  5297. value
  5298. );
  5299. }
  5300. function _throw(err) {
  5301. asyncGeneratorStep(
  5302. gen,
  5303. resolve,
  5304. reject,
  5305. _next,
  5306. _throw,
  5307. "throw",
  5308. err
  5309. );
  5310. }
  5311. _next(undefined);
  5312. });
  5313. };
  5314. }
  5315. function ownKeys(object, enumerableOnly) {
  5316. var keys = Object.keys(object);
  5317. if (Object.getOwnPropertySymbols) {
  5318. var symbols = Object.getOwnPropertySymbols(object);
  5319. enumerableOnly &&
  5320. (symbols = symbols.filter(function (sym) {
  5321. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  5322. })),
  5323. keys.push.apply(keys, symbols);
  5324. }
  5325. return keys;
  5326. }
  5327. function _objectSpread(target) {
  5328. for (var i = 1; i < arguments.length; i++) {
  5329. var source = null != arguments[i] ? arguments[i] : {};
  5330. i % 2
  5331. ? ownKeys(Object(source), !0).forEach(function (key) {
  5332. _defineProperty(target, key, source[key]);
  5333. })
  5334. : Object.getOwnPropertyDescriptors
  5335. ? Object.defineProperties(
  5336. target,
  5337. Object.getOwnPropertyDescriptors(source)
  5338. )
  5339. : ownKeys(Object(source)).forEach(function (key) {
  5340. Object.defineProperty(
  5341. target,
  5342. key,
  5343. Object.getOwnPropertyDescriptor(source, key)
  5344. );
  5345. });
  5346. }
  5347. return target;
  5348. }
  5349. function _defineProperty(obj, key, value) {
  5350. if (key in obj) {
  5351. Object.defineProperty(obj, key, {
  5352. value: value,
  5353. enumerable: true,
  5354. configurable: true,
  5355. writable: true
  5356. });
  5357. } else {
  5358. obj[key] = value;
  5359. }
  5360. return obj;
  5361. }
  5362. class ImageCapture {
  5363. constructor() {
  5364. this.isMKDIR = false;
  5365. this.cCaptureByCount = null;
  5366. this.cCaptureByMs = null; // c的方法
  5367. this.imageList = {};
  5368. this.captureInfo = {};
  5369. this.imgDataPtrList = [];
  5370. this.imgBufferPtrList = [];
  5371. }
  5372. getImageInfo(imgDataPtr) {
  5373. const width = Module.HEAPU32[imgDataPtr];
  5374. const height = Module.HEAPU32[imgDataPtr + 1];
  5375. const duration = Module.HEAPU32[imgDataPtr + 2];
  5376. const imageBufferPtr = Module.HEAPU32[imgDataPtr + 3];
  5377. const imageBuffer = Module.HEAPU8.slice(
  5378. imageBufferPtr,
  5379. imageBufferPtr + width * height * 3
  5380. );
  5381. // Module._free(imgDataPtr);
  5382. // Module._free(imageBufferPtr);
  5383. this.imgDataPtrList.push(imgDataPtr);
  5384. this.imgBufferPtrList.push(imageBufferPtr);
  5385. const imageDataBuffer = new Uint8ClampedArray(width * height * 4);
  5386. let j = 0;
  5387. for (let i = 0; i < imageBuffer.length; i++) {
  5388. if (i && i % 3 === 0) {
  5389. imageDataBuffer[j] = 255;
  5390. j += 1;
  5391. }
  5392. imageDataBuffer[j] = imageBuffer[i];
  5393. j += 1;
  5394. }
  5395. return {
  5396. width,
  5397. height,
  5398. duration,
  5399. imageDataBuffer
  5400. };
  5401. }
  5402. _singleImage(imgDataPtr) {
  5403. const width = Module.HEAPU32[imgDataPtr];
  5404. const height = Module.HEAPU32[imgDataPtr + 1];
  5405. const duration = Module.HEAPU32[imgDataPtr + 2];
  5406. const imageBufferPtr = Module.HEAPU32[imgDataPtr + 3];
  5407. const imageBuffer = Module.HEAPU8.slice(
  5408. imageBufferPtr,
  5409. imageBufferPtr + width * height * 3
  5410. );
  5411. Module._free(imgDataPtr);
  5412. Module._free(imageBufferPtr);
  5413. const imageDataBuffer = new Uint8ClampedArray(width * height * 4);
  5414. let j = 0;
  5415. for (let i = 0; i < imageBuffer.length; i++) {
  5416. if (i && i % 3 === 0) {
  5417. imageDataBuffer[j] = 255;
  5418. j += 1;
  5419. }
  5420. imageDataBuffer[j] = imageBuffer[i];
  5421. j += 1;
  5422. }
  5423. return {
  5424. width,
  5425. height,
  5426. duration,
  5427. imageDataBuffer
  5428. };
  5429. }
  5430. getImgList(imgDataPtr, count) {
  5431. const dataArr = [];
  5432. for (let i = 0; i < count; i++) {
  5433. dataArr.push(this._singleImage(imgDataPtr / 4 + i * 4));
  5434. }
  5435. return dataArr;
  5436. }
  5437. // 加载文件
  5438. mountFile(file, MOUNT_DIR, id) {
  5439. if (!this.isMKDIR) {
  5440. FS.mkdir(MOUNT_DIR);
  5441. this.isMKDIR = true;
  5442. }
  5443. const data = {};
  5444. let name = "";
  5445. // 判断类型 如果是blob转file
  5446. if (file instanceof File) {
  5447. data.files = [file];
  5448. name = file.name;
  5449. } else {
  5450. name = `${id}.mp4`;
  5451. data.blobs = [
  5452. {
  5453. name,
  5454. data: file
  5455. }
  5456. ];
  5457. }
  5458. // @ts-ignore
  5459. FS.mount(WORKERFS, data, MOUNT_DIR);
  5460. return name;
  5461. }
  5462. free() {
  5463. // 释放指针内存
  5464. this.imgDataPtrList.forEach(ptr => {
  5465. Module._free(ptr);
  5466. });
  5467. this.imgDataPtrList = [];
  5468. this.imgBufferPtrList.forEach(ptr => {
  5469. Module._free(ptr);
  5470. });
  5471. this.imgBufferPtrList = [];
  5472. }
  5473. capture(_ref) {
  5474. let id = _ref.id,
  5475. info = _ref.info,
  5476. _ref$path = _ref.path,
  5477. path = _ref$path === void 0 ? "/working" : _ref$path,
  5478. file = _ref.file;
  5479. try {
  5480. const name = this.mountFile(file, path, id);
  5481. let retData = 0;
  5482. this.imageList[id] = [];
  5483. if (info instanceof Array) {
  5484. // 说明是按照时间抽
  5485. this.captureInfo[id] = info.length;
  5486. if (!this.cCaptureByMs) {
  5487. this.cCaptureByMs = Module.cwrap("captureByMs", "number", [
  5488. "string",
  5489. "string",
  5490. "number"
  5491. ]);
  5492. }
  5493. // const imgDataPtr =
  5494. retData = this.cCaptureByMs(info.join(","), `${path}/${name}`, id);
  5495. this.free();
  5496. } else {
  5497. this.captureInfo[id] = info;
  5498. if (!this.cCaptureByCount) {
  5499. this.cCaptureByCount = Module.cwrap("captureByCount", "number", [
  5500. "number",
  5501. "string",
  5502. "number"
  5503. ]);
  5504. }
  5505. retData = this.cCaptureByCount(info, `${path}/${name}`, id);
  5506. this.free();
  5507. FS.unmount(path);
  5508. // 完善信息 这里需要一种模式 是否只一次性postmsg 不一张张读取
  5509. if (retData === 0) {
  5510. throw new Error("Frame draw exception!");
  5511. }
  5512. }
  5513. } catch (e) {
  5514. console.log("Error occurred", e);
  5515. // 如果发生错误 通知
  5516. self.postMessage({
  5517. type: "receiveError",
  5518. errmsg: e.toString(),
  5519. id
  5520. });
  5521. }
  5522. }
  5523. }
  5524. // importScripts('./capture.js');
  5525. const imageCapture = new ImageCapture();
  5526. let isInit = false;
  5527. const metaDataMap = {};
  5528. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  5529. function transpostFrame(ptr, id) {
  5530. const data = imageCapture.getImageInfo(ptr / 4);
  5531. // push到数组列表
  5532. imageCapture.imageList[id].push(_objectSpread({}, data));
  5533. self.postMessage(
  5534. _objectSpread(
  5535. _objectSpread(
  5536. {
  5537. type: "receiveImageOnchange"
  5538. },
  5539. data
  5540. ),
  5541. {},
  5542. {
  5543. id,
  5544. meta: metaDataMap[id] || {}
  5545. }
  5546. )
  5547. );
  5548. // console.log('transpostFrame==>', id, imageCapture.captureInfo);
  5549. if (imageCapture.imageList[id].length >= imageCapture.captureInfo[id]) {
  5550. // 说明已经到了数目 可以postonfinish事件
  5551. self.postMessage({
  5552. type: "receiveImageOnSuccess",
  5553. id,
  5554. meta: metaDataMap[id] || {}
  5555. // ...imageCapture.imageList[id], //TODO: 这个是否post未确定
  5556. });
  5557. }
  5558. }
  5559. function setAngle(a, id) {
  5560. metaDataMap[id].angle = +a;
  5561. }
  5562. function setDescription(a, id) {
  5563. metaDataMap[id].description = a;
  5564. }
  5565. self.transpostFrame = transpostFrame;
  5566. self.setAngle = setAngle;
  5567. self.setDescription = setDescription;
  5568. const initPromise = new Promise(res => {
  5569. self.goOnInit = res;
  5570. });
  5571. self.addEventListener("message", e => {
  5572. // console.log('receivemessage', e.data);
  5573. const _e$data = e.data,
  5574. type = _e$data.type,
  5575. id = _e$data.id,
  5576. info = _e$data.info,
  5577. path = _e$data.path,
  5578. file = _e$data.file;
  5579. if (type === "initPath") {
  5580. self.goOnInit(info);
  5581. }
  5582. if (isInit && type === "startCapture") {
  5583. metaDataMap[id] = {};
  5584. imageCapture.capture({
  5585. id,
  5586. info,
  5587. path,
  5588. file
  5589. });
  5590. }
  5591. });
  5592. self.Module = {
  5593. instantiateWasm: (function () {
  5594. var _instantiateWasm = _asyncToGenerator(
  5595. /*#__PURE__*/ _regeneratorRuntime().mark(function _callee(
  5596. info,
  5597. receiveInstance
  5598. ) {
  5599. var url;
  5600. return _regeneratorRuntime().wrap(function _callee$(_context) {
  5601. while (1)
  5602. switch ((_context.prev = _context.next)) {
  5603. case 0:
  5604. _context.next = 2;
  5605. return initPromise;
  5606. case 2:
  5607. url = _context.sent;
  5608. fetch(url || "./capture.worker.wasm")
  5609. .then(response => response.arrayBuffer())
  5610. .then(bytes => WebAssembly.instantiate(bytes, info))
  5611. .then(instance => receiveInstance(instance.instance));
  5612. // WebAssembly.instantiate(bytes, info).then(result => {
  5613. // receiveInstance(result.instance);
  5614. // });
  5615. case 4:
  5616. case "end":
  5617. return _context.stop();
  5618. }
  5619. }, _callee);
  5620. })
  5621. );
  5622. function instantiateWasm(_x, _x2) {
  5623. return _instantiateWasm.apply(this, arguments);
  5624. }
  5625. return instantiateWasm;
  5626. })(),
  5627. onRuntimeInitialized: () => {
  5628. isInit = true;
  5629. self.postMessage({
  5630. type: "init",
  5631. data: {}
  5632. });
  5633. }
  5634. };
  5635. })();
  5636. /******/
  5637. })();
  5638. // Sometimes an existing Module object exists with properties
  5639. // meant to overwrite the default module functionality. Here
  5640. // we collect those properties and reapply _after_ we configure
  5641. // the current environment's defaults to avoid having to be so
  5642. // defensive during initialization.
  5643. var moduleOverrides = Object.assign({}, Module);
  5644. var arguments_ = [];
  5645. var thisProgram = "./this.program";
  5646. var quit_ = (status, toThrow) => {
  5647. throw toThrow;
  5648. };
  5649. // Determine the runtime environment we are in. You can customize this by
  5650. // setting the ENVIRONMENT setting at compile time (see settings.js).
  5651. // Attempt to auto-detect the environment
  5652. var ENVIRONMENT_IS_WEB = typeof window == "object";
  5653. var ENVIRONMENT_IS_WORKER = typeof importScripts == "function";
  5654. // N.b. Electron.js environment is simultaneously a NODE-environment, but
  5655. // also a web environment.
  5656. var ENVIRONMENT_IS_NODE =
  5657. typeof process == "object" &&
  5658. typeof process.versions == "object" &&
  5659. typeof process.versions.node == "string";
  5660. var ENVIRONMENT_IS_SHELL =
  5661. !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
  5662. // `/` should be present at the end if `scriptDirectory` is not empty
  5663. var scriptDirectory = "";
  5664. function locateFile(path) {
  5665. if (Module["locateFile"]) {
  5666. return Module["locateFile"](path, scriptDirectory);
  5667. }
  5668. return scriptDirectory + path;
  5669. }
  5670. // Hooks that are implemented differently in different runtime environments.
  5671. var read_, readAsync, readBinary, setWindowTitle;
  5672. if (ENVIRONMENT_IS_NODE) {
  5673. // `require()` is no-op in an ESM module, use `createRequire()` to construct
  5674. // the require()` function. This is only necessary for multi-environment
  5675. // builds, `-sENVIRONMENT=node` emits a static import declaration instead.
  5676. // TODO: Swap all `require()`'s with `import()`'s?
  5677. // These modules will usually be used on Node.js. Load them eagerly to avoid
  5678. // the complexity of lazy-loading.
  5679. var fs = require("fs");
  5680. var nodePath = require("path");
  5681. if (ENVIRONMENT_IS_WORKER) {
  5682. scriptDirectory = nodePath.dirname(scriptDirectory) + "/";
  5683. } else {
  5684. scriptDirectory = __dirname + "/";
  5685. }
  5686. // include: node_shell_read.js
  5687. read_ = (filename, binary) => {
  5688. // We need to re-wrap `file://` strings to URLs. Normalizing isn't
  5689. // necessary in that case, the path should already be absolute.
  5690. filename = isFileURI(filename)
  5691. ? new URL(filename)
  5692. : nodePath.normalize(filename);
  5693. return fs.readFileSync(filename, binary ? undefined : "utf8");
  5694. };
  5695. readBinary = filename => {
  5696. var ret = read_(filename, true);
  5697. if (!ret.buffer) {
  5698. ret = new Uint8Array(ret);
  5699. }
  5700. return ret;
  5701. };
  5702. readAsync = (filename, onload, onerror, binary = true) => {
  5703. // See the comment in the `read_` function.
  5704. filename = isFileURI(filename)
  5705. ? new URL(filename)
  5706. : nodePath.normalize(filename);
  5707. fs.readFile(filename, binary ? undefined : "utf8", (err, data) => {
  5708. if (err) onerror(err);
  5709. else onload(binary ? data.buffer : data);
  5710. });
  5711. };
  5712. // end include: node_shell_read.js
  5713. if (!Module["thisProgram"] && process.argv.length > 1) {
  5714. thisProgram = process.argv[1].replace(/\\/g, "/");
  5715. }
  5716. arguments_ = process.argv.slice(2);
  5717. if (typeof module != "undefined") {
  5718. module["exports"] = Module;
  5719. }
  5720. process.on("uncaughtException", ex => {
  5721. // suppress ExitStatus exceptions from showing an error
  5722. if (
  5723. ex !== "unwind" &&
  5724. !(ex instanceof ExitStatus) &&
  5725. !(ex.context instanceof ExitStatus)
  5726. ) {
  5727. throw ex;
  5728. }
  5729. });
  5730. quit_ = (status, toThrow) => {
  5731. process.exitCode = status;
  5732. throw toThrow;
  5733. };
  5734. Module["inspect"] = () => "[Emscripten Module object]";
  5735. }
  5736. // Note that this includes Node.js workers when relevant (pthreads is enabled).
  5737. // Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and
  5738. // ENVIRONMENT_IS_NODE.
  5739. else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
  5740. if (ENVIRONMENT_IS_WORKER) {
  5741. // Check worker, not web, since window could be polyfilled
  5742. scriptDirectory = self.location.href;
  5743. } else if (typeof document != "undefined" && document.currentScript) {
  5744. // web
  5745. scriptDirectory = document.currentScript.src;
  5746. }
  5747. // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them.
  5748. // otherwise, slice off the final part of the url to find the script directory.
  5749. // if scriptDirectory does not contain a slash, lastIndexOf will return -1,
  5750. // and scriptDirectory will correctly be replaced with an empty string.
  5751. // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #),
  5752. // they are removed because they could contain a slash.
  5753. if (scriptDirectory.indexOf("blob:") !== 0) {
  5754. scriptDirectory = scriptDirectory.substr(
  5755. 0,
  5756. scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1
  5757. );
  5758. } else {
  5759. scriptDirectory = "";
  5760. }
  5761. // Differentiate the Web Worker from the Node Worker case, as reading must
  5762. // be done differently.
  5763. {
  5764. // include: web_or_worker_shell_read.js
  5765. read_ = url => {
  5766. var xhr = new XMLHttpRequest();
  5767. xhr.open("GET", url, false);
  5768. xhr.send(null);
  5769. return xhr.responseText;
  5770. };
  5771. if (ENVIRONMENT_IS_WORKER) {
  5772. readBinary = url => {
  5773. var xhr = new XMLHttpRequest();
  5774. xhr.open("GET", url, false);
  5775. xhr.responseType = "arraybuffer";
  5776. xhr.send(null);
  5777. return new Uint8Array(/** @type{!ArrayBuffer} */ (xhr.response));
  5778. };
  5779. }
  5780. readAsync = (url, onload, onerror) => {
  5781. var xhr = new XMLHttpRequest();
  5782. xhr.open("GET", url, true);
  5783. xhr.responseType = "arraybuffer";
  5784. xhr.onload = () => {
  5785. if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {
  5786. // file URLs can return 0
  5787. onload(xhr.response);
  5788. return;
  5789. }
  5790. onerror();
  5791. };
  5792. xhr.onerror = onerror;
  5793. xhr.send(null);
  5794. };
  5795. // end include: web_or_worker_shell_read.js
  5796. }
  5797. setWindowTitle = title => (document.title = title);
  5798. } else {
  5799. }
  5800. var out = Module["print"] || (() => {});
  5801. var err = Module["printErr"] || console.error.bind(console);
  5802. // Merge back in the overrides
  5803. Object.assign(Module, moduleOverrides);
  5804. // Free the object hierarchy contained in the overrides, this lets the GC
  5805. // reclaim data used e.g. in memoryInitializerRequest, which is a large typed array.
  5806. moduleOverrides = null;
  5807. // Emit code to handle expected values on the Module object. This applies Module.x
  5808. // to the proper local x. This has two benefits: first, we only emit it if it is
  5809. // expected to arrive, and second, by using a local everywhere else that can be
  5810. // minified.
  5811. if (Module["arguments"]) arguments_ = Module["arguments"];
  5812. if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
  5813. if (Module["quit"]) quit_ = Module["quit"];
  5814. // perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message
  5815. // end include: shell.js
  5816. // include: preamble.js
  5817. // === Preamble library stuff ===
  5818. // Documentation for the public APIs defined in this file must be updated in:
  5819. // site/source/docs/api_reference/preamble.js.rst
  5820. // A prebuilt local version of the documentation is available at:
  5821. // site/build/text/docs/api_reference/preamble.js.txt
  5822. // You can also build docs locally as HTML or other formats in site/
  5823. // An online HTML version (which may be of a different version of Emscripten)
  5824. // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
  5825. var wasmBinary;
  5826. if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
  5827. var noExitRuntime = Module["noExitRuntime"] || true;
  5828. if (typeof WebAssembly != "object") {
  5829. abort("no native wasm support detected");
  5830. }
  5831. // Wasm globals
  5832. var wasmMemory;
  5833. //========================================
  5834. // Runtime essentials
  5835. //========================================
  5836. // whether we are quitting the application. no code should run after this.
  5837. // set in exit() and abort()
  5838. var ABORT = false;
  5839. // set by exit() and abort(). Passed to 'onExit' handler.
  5840. // NOTE: This is also used as the process return code code in shell environments
  5841. // but only when noExitRuntime is false.
  5842. var EXITSTATUS;
  5843. /** @type {function(*, string=)} */
  5844. function assert(condition, text) {
  5845. if (!condition) {
  5846. // This build was created without ASSERTIONS defined. `assert()` should not
  5847. // ever be called in this configuration but in case there are callers in
  5848. // the wild leave this simple abort() implemenation here for now.
  5849. abort(text);
  5850. }
  5851. }
  5852. // Memory management
  5853. var HEAP,
  5854. /** @type {!Int8Array} */
  5855. HEAP8,
  5856. /** @type {!Uint8Array} */
  5857. HEAPU8,
  5858. /** @type {!Int16Array} */
  5859. HEAP16,
  5860. /** @type {!Uint16Array} */
  5861. HEAPU16,
  5862. /** @type {!Int32Array} */
  5863. HEAP32,
  5864. /** @type {!Uint32Array} */
  5865. HEAPU32,
  5866. /** @type {!Float32Array} */
  5867. HEAPF32,
  5868. /** @type {!Float64Array} */
  5869. HEAPF64;
  5870. function updateMemoryViews() {
  5871. var b = wasmMemory.buffer;
  5872. Module["HEAP8"] = HEAP8 = new Int8Array(b);
  5873. Module["HEAP16"] = HEAP16 = new Int16Array(b);
  5874. Module["HEAP32"] = HEAP32 = new Int32Array(b);
  5875. Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
  5876. Module["HEAPU16"] = HEAPU16 = new Uint16Array(b);
  5877. Module["HEAPU32"] = HEAPU32 = new Uint32Array(b);
  5878. Module["HEAPF32"] = HEAPF32 = new Float32Array(b);
  5879. Module["HEAPF64"] = HEAPF64 = new Float64Array(b);
  5880. }
  5881. // include: runtime_init_table.js
  5882. // In regular non-RELOCATABLE mode the table is exported
  5883. // from the wasm module and this will be assigned once
  5884. // the exports are available.
  5885. var wasmTable;
  5886. // end include: runtime_init_table.js
  5887. // include: runtime_stack_check.js
  5888. // end include: runtime_stack_check.js
  5889. // include: runtime_assertions.js
  5890. // end include: runtime_assertions.js
  5891. var __ATPRERUN__ = []; // functions called before the runtime is initialized
  5892. var __ATINIT__ = []; // functions called during startup
  5893. var __ATMAIN__ = []; // functions called when main() is to be run
  5894. var __ATEXIT__ = []; // functions called during shutdown
  5895. var __ATPOSTRUN__ = []; // functions called after the main() is called
  5896. var runtimeInitialized = false;
  5897. var runtimeKeepaliveCounter = 0;
  5898. function keepRuntimeAlive() {
  5899. return noExitRuntime || runtimeKeepaliveCounter > 0;
  5900. }
  5901. function preRun() {
  5902. if (Module["preRun"]) {
  5903. if (typeof Module["preRun"] == "function")
  5904. Module["preRun"] = [Module["preRun"]];
  5905. while (Module["preRun"].length) {
  5906. addOnPreRun(Module["preRun"].shift());
  5907. }
  5908. }
  5909. callRuntimeCallbacks(__ATPRERUN__);
  5910. }
  5911. function initRuntime() {
  5912. runtimeInitialized = true;
  5913. if (!Module["noFSInit"] && !FS.init.initialized) FS.init();
  5914. FS.ignorePermissions = false;
  5915. TTY.init();
  5916. callRuntimeCallbacks(__ATINIT__);
  5917. }
  5918. function preMain() {
  5919. callRuntimeCallbacks(__ATMAIN__);
  5920. }
  5921. function postRun() {
  5922. if (Module["postRun"]) {
  5923. if (typeof Module["postRun"] == "function")
  5924. Module["postRun"] = [Module["postRun"]];
  5925. while (Module["postRun"].length) {
  5926. addOnPostRun(Module["postRun"].shift());
  5927. }
  5928. }
  5929. callRuntimeCallbacks(__ATPOSTRUN__);
  5930. }
  5931. function addOnPreRun(cb) {
  5932. __ATPRERUN__.unshift(cb);
  5933. }
  5934. function addOnInit(cb) {
  5935. __ATINIT__.unshift(cb);
  5936. }
  5937. function addOnPreMain(cb) {
  5938. __ATMAIN__.unshift(cb);
  5939. }
  5940. function addOnExit(cb) {}
  5941. function addOnPostRun(cb) {
  5942. __ATPOSTRUN__.unshift(cb);
  5943. }
  5944. // include: runtime_math.js
  5945. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
  5946. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
  5947. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
  5948. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
  5949. // end include: runtime_math.js
  5950. // A counter of dependencies for calling run(). If we need to
  5951. // do asynchronous work before running, increment this and
  5952. // decrement it. Incrementing must happen in a place like
  5953. // Module.preRun (used by emcc to add file preloading).
  5954. // Note that you can add dependencies in preRun, even though
  5955. // it happens right before run - run will be postponed until
  5956. // the dependencies are met.
  5957. var runDependencies = 0;
  5958. var runDependencyWatcher = null;
  5959. var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
  5960. function getUniqueRunDependency(id) {
  5961. return id;
  5962. }
  5963. function addRunDependency(id) {
  5964. runDependencies++;
  5965. if (Module["monitorRunDependencies"]) {
  5966. Module["monitorRunDependencies"](runDependencies);
  5967. }
  5968. }
  5969. function removeRunDependency(id) {
  5970. runDependencies--;
  5971. if (Module["monitorRunDependencies"]) {
  5972. Module["monitorRunDependencies"](runDependencies);
  5973. }
  5974. if (runDependencies == 0) {
  5975. if (runDependencyWatcher !== null) {
  5976. clearInterval(runDependencyWatcher);
  5977. runDependencyWatcher = null;
  5978. }
  5979. if (dependenciesFulfilled) {
  5980. var callback = dependenciesFulfilled;
  5981. dependenciesFulfilled = null;
  5982. callback(); // can add another dependenciesFulfilled
  5983. }
  5984. }
  5985. }
  5986. /** @param {string|number=} what */
  5987. function abort(what) {
  5988. if (Module["onAbort"]) {
  5989. Module["onAbort"](what);
  5990. }
  5991. what = "Aborted(" + what + ")";
  5992. // TODO(sbc): Should we remove printing and leave it up to whoever
  5993. // catches the exception?
  5994. err(what);
  5995. ABORT = true;
  5996. EXITSTATUS = 1;
  5997. what += ". Build with -sASSERTIONS for more info.";
  5998. // Use a wasm runtime error, because a JS error might be seen as a foreign
  5999. // exception, which means we'd run destructors on it. We need the error to
  6000. // simply make the program stop.
  6001. // FIXME This approach does not work in Wasm EH because it currently does not assume
  6002. // all RuntimeErrors are from traps; it decides whether a RuntimeError is from
  6003. // a trap or not based on a hidden field within the object. So at the moment
  6004. // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that
  6005. // allows this in the wasm spec.
  6006. // Suppress closure compiler warning here. Closure compiler's builtin extern
  6007. // defintion for WebAssembly.RuntimeError claims it takes no arguments even
  6008. // though it can.
  6009. // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.
  6010. /** @suppress {checkTypes} */
  6011. var e = new WebAssembly.RuntimeError(what);
  6012. // Throw the error whether or not MODULARIZE is set because abort is used
  6013. // in code paths apart from instantiation where an exception is expected
  6014. // to be thrown when abort is called.
  6015. throw e;
  6016. }
  6017. // include: memoryprofiler.js
  6018. // end include: memoryprofiler.js
  6019. // include: URIUtils.js
  6020. // Prefix of data URIs emitted by SINGLE_FILE and related options.
  6021. var dataURIPrefix = "data:application/octet-stream;base64,";
  6022. // Indicates whether filename is a base64 data URI.
  6023. function isDataURI(filename) {
  6024. // Prefix of data URIs emitted by SINGLE_FILE and related options.
  6025. return filename.startsWith(dataURIPrefix);
  6026. }
  6027. // Indicates whether filename is delivered via file protocol (as opposed to http/https)
  6028. function isFileURI(filename) {
  6029. return filename.startsWith("file://");
  6030. }
  6031. // end include: URIUtils.js
  6032. // include: runtime_exceptions.js
  6033. // end include: runtime_exceptions.js
  6034. var wasmBinaryFile;
  6035. wasmBinaryFile = "capture.worker.wasm";
  6036. if (!isDataURI(wasmBinaryFile)) {
  6037. wasmBinaryFile = locateFile(wasmBinaryFile);
  6038. }
  6039. function getBinarySync(file) {
  6040. if (file == wasmBinaryFile && wasmBinary) {
  6041. return new Uint8Array(wasmBinary);
  6042. }
  6043. if (readBinary) {
  6044. return readBinary(file);
  6045. }
  6046. throw "both async and sync fetching of the wasm failed";
  6047. }
  6048. function getBinaryPromise(binaryFile) {
  6049. // If we don't have the binary yet, try to load it asynchronously.
  6050. // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.
  6051. // See https://github.com/github/fetch/pull/92#issuecomment-140665932
  6052. // Cordova or Electron apps are typically loaded from a file:// url.
  6053. // So use fetch if it is available and the url is not a file, otherwise fall back to XHR.
  6054. if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
  6055. if (typeof fetch == "function" && !isFileURI(binaryFile)) {
  6056. return fetch(binaryFile, { credentials: "same-origin" })
  6057. .then(response => {
  6058. if (!response["ok"]) {
  6059. throw "failed to load wasm binary file at '" + binaryFile + "'";
  6060. }
  6061. return response["arrayBuffer"]();
  6062. })
  6063. .catch(() => getBinarySync(binaryFile));
  6064. } else if (readAsync) {
  6065. // fetch is not available or url is file => try XHR (readAsync uses XHR internally)
  6066. return new Promise((resolve, reject) => {
  6067. readAsync(
  6068. binaryFile,
  6069. response =>
  6070. resolve(new Uint8Array(/** @type{!ArrayBuffer} */ (response))),
  6071. reject
  6072. );
  6073. });
  6074. }
  6075. }
  6076. // Otherwise, getBinarySync should be able to get it synchronously
  6077. return Promise.resolve().then(() => getBinarySync(binaryFile));
  6078. }
  6079. function instantiateArrayBuffer(binaryFile, imports, receiver) {
  6080. return getBinaryPromise(binaryFile)
  6081. .then(binary => {
  6082. return WebAssembly.instantiate(binary, imports);
  6083. })
  6084. .then(instance => {
  6085. return instance;
  6086. })
  6087. .then(receiver, reason => {
  6088. err("failed to asynchronously prepare wasm: " + reason);
  6089. abort(reason);
  6090. });
  6091. }
  6092. function instantiateAsync(binary, binaryFile, imports, callback) {
  6093. if (
  6094. !binary &&
  6095. typeof WebAssembly.instantiateStreaming == "function" &&
  6096. !isDataURI(binaryFile) &&
  6097. // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously.
  6098. !isFileURI(binaryFile) &&
  6099. // Avoid instantiateStreaming() on Node.js environment for now, as while
  6100. // Node.js v18.1.0 implements it, it does not have a full fetch()
  6101. // implementation yet.
  6102. //
  6103. // Reference:
  6104. // https://github.com/emscripten-core/emscripten/pull/16917
  6105. !ENVIRONMENT_IS_NODE &&
  6106. typeof fetch == "function"
  6107. ) {
  6108. return fetch(binaryFile, { credentials: "same-origin" }).then(response => {
  6109. // Suppress closure warning here since the upstream definition for
  6110. // instantiateStreaming only allows Promise<Repsponse> rather than
  6111. // an actual Response.
  6112. // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure is fixed.
  6113. /** @suppress {checkTypes} */
  6114. var result = WebAssembly.instantiateStreaming(response, imports);
  6115. return result.then(callback, function (reason) {
  6116. // We expect the most common failure cause to be a bad MIME type for the binary,
  6117. // in which case falling back to ArrayBuffer instantiation should work.
  6118. err("wasm streaming compile failed: " + reason);
  6119. err("falling back to ArrayBuffer instantiation");
  6120. return instantiateArrayBuffer(binaryFile, imports, callback);
  6121. });
  6122. });
  6123. }
  6124. return instantiateArrayBuffer(binaryFile, imports, callback);
  6125. }
  6126. // Create the wasm instance.
  6127. // Receives the wasm imports, returns the exports.
  6128. function createWasm() {
  6129. // prepare imports
  6130. var info = {
  6131. env: wasmImports,
  6132. wasi_snapshot_preview1: wasmImports
  6133. };
  6134. // Load the wasm module and create an instance of using native support in the JS engine.
  6135. // handle a generated wasm instance, receiving its exports and
  6136. // performing other necessary setup
  6137. /** @param {WebAssembly.Module=} module*/
  6138. function receiveInstance(instance, module) {
  6139. var exports = instance.exports;
  6140. Module["asm"] = exports;
  6141. wasmMemory = Module["asm"]["memory"];
  6142. updateMemoryViews();
  6143. wasmTable = Module["asm"]["__indirect_function_table"];
  6144. addOnInit(Module["asm"]["__wasm_call_ctors"]);
  6145. removeRunDependency("wasm-instantiate");
  6146. return exports;
  6147. }
  6148. // wait for the pthread pool (if any)
  6149. addRunDependency("wasm-instantiate");
  6150. // Prefer streaming instantiation if available.
  6151. function receiveInstantiationResult(result) {
  6152. // 'result' is a ResultObject object which has both the module and instance.
  6153. // receiveInstance() will swap in the exports (to Module.asm) so they can be called
  6154. // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
  6155. // When the regression is fixed, can restore the above PTHREADS-enabled path.
  6156. receiveInstance(result["instance"]);
  6157. }
  6158. // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
  6159. // to manually instantiate the Wasm module themselves. This allows pages to
  6160. // run the instantiation parallel to any other async startup actions they are
  6161. // performing.
  6162. // Also pthreads and wasm workers initialize the wasm instance through this
  6163. // path.
  6164. if (Module["instantiateWasm"]) {
  6165. try {
  6166. return Module["instantiateWasm"](info, receiveInstance);
  6167. } catch (e) {
  6168. err("Module.instantiateWasm callback failed with error: " + e);
  6169. return false;
  6170. }
  6171. }
  6172. instantiateAsync(
  6173. wasmBinary,
  6174. wasmBinaryFile,
  6175. info,
  6176. receiveInstantiationResult
  6177. );
  6178. return {}; // no exports yet; we'll fill them in later
  6179. }
  6180. // Globals used by JS i64 conversions (see makeSetValue)
  6181. var tempDouble;
  6182. var tempI64;
  6183. // include: runtime_debug.js
  6184. // end include: runtime_debug.js
  6185. // === Body ===
  6186. // end include: preamble.js
  6187. /** @constructor */
  6188. function ExitStatus(status) {
  6189. this.name = "ExitStatus";
  6190. this.message = `Program terminated with exit(${status})`;
  6191. this.status = status;
  6192. }
  6193. var callRuntimeCallbacks = callbacks => {
  6194. while (callbacks.length > 0) {
  6195. // Pass the module as the first argument.
  6196. callbacks.shift()(Module);
  6197. }
  6198. };
  6199. /**
  6200. * @param {number} ptr
  6201. * @param {string} type
  6202. */
  6203. function getValue(ptr, type = "i8") {
  6204. if (type.endsWith("*")) type = "*";
  6205. switch (type) {
  6206. case "i1":
  6207. return HEAP8[ptr >> 0];
  6208. case "i8":
  6209. return HEAP8[ptr >> 0];
  6210. case "i16":
  6211. return HEAP16[ptr >> 1];
  6212. case "i32":
  6213. return HEAP32[ptr >> 2];
  6214. case "i64":
  6215. abort("to do getValue(i64) use WASM_BIGINT");
  6216. case "float":
  6217. return HEAPF32[ptr >> 2];
  6218. case "double":
  6219. return HEAPF64[ptr >> 3];
  6220. case "*":
  6221. return HEAPU32[ptr >> 2];
  6222. default:
  6223. abort(`invalid type for getValue: ${type}`);
  6224. }
  6225. }
  6226. /**
  6227. * @param {number} ptr
  6228. * @param {number} value
  6229. * @param {string} type
  6230. */
  6231. function setValue(ptr, value, type = "i8") {
  6232. if (type.endsWith("*")) type = "*";
  6233. switch (type) {
  6234. case "i1":
  6235. HEAP8[ptr >> 0] = value;
  6236. break;
  6237. case "i8":
  6238. HEAP8[ptr >> 0] = value;
  6239. break;
  6240. case "i16":
  6241. HEAP16[ptr >> 1] = value;
  6242. break;
  6243. case "i32":
  6244. HEAP32[ptr >> 2] = value;
  6245. break;
  6246. case "i64":
  6247. abort("to do setValue(i64) use WASM_BIGINT");
  6248. case "float":
  6249. HEAPF32[ptr >> 2] = value;
  6250. break;
  6251. case "double":
  6252. HEAPF64[ptr >> 3] = value;
  6253. break;
  6254. case "*":
  6255. HEAPU32[ptr >> 2] = value;
  6256. break;
  6257. default:
  6258. abort(`invalid type for setValue: ${type}`);
  6259. }
  6260. }
  6261. var PATH = {
  6262. isAbs: path => path.charAt(0) === "/",
  6263. splitPath: filename => {
  6264. var splitPathRe =
  6265. /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  6266. return splitPathRe.exec(filename).slice(1);
  6267. },
  6268. normalizeArray: (parts, allowAboveRoot) => {
  6269. // if the path tries to go above the root, `up` ends up > 0
  6270. var up = 0;
  6271. for (var i = parts.length - 1; i >= 0; i--) {
  6272. var last = parts[i];
  6273. if (last === ".") {
  6274. parts.splice(i, 1);
  6275. } else if (last === "..") {
  6276. parts.splice(i, 1);
  6277. up++;
  6278. } else if (up) {
  6279. parts.splice(i, 1);
  6280. up--;
  6281. }
  6282. }
  6283. // if the path is allowed to go above the root, restore leading ..s
  6284. if (allowAboveRoot) {
  6285. for (; up; up--) {
  6286. parts.unshift("..");
  6287. }
  6288. }
  6289. return parts;
  6290. },
  6291. normalize: path => {
  6292. var isAbsolute = PATH.isAbs(path),
  6293. trailingSlash = path.substr(-1) === "/";
  6294. // Normalize the path
  6295. path = PATH.normalizeArray(
  6296. path.split("/").filter(p => !!p),
  6297. !isAbsolute
  6298. ).join("/");
  6299. if (!path && !isAbsolute) {
  6300. path = ".";
  6301. }
  6302. if (path && trailingSlash) {
  6303. path += "/";
  6304. }
  6305. return (isAbsolute ? "/" : "") + path;
  6306. },
  6307. dirname: path => {
  6308. var result = PATH.splitPath(path),
  6309. root = result[0],
  6310. dir = result[1];
  6311. if (!root && !dir) {
  6312. // No dirname whatsoever
  6313. return ".";
  6314. }
  6315. if (dir) {
  6316. // It has a dirname, strip trailing slash
  6317. dir = dir.substr(0, dir.length - 1);
  6318. }
  6319. return root + dir;
  6320. },
  6321. basename: path => {
  6322. // EMSCRIPTEN return '/'' for '/', not an empty string
  6323. if (path === "/") return "/";
  6324. path = PATH.normalize(path);
  6325. path = path.replace(/\/$/, "");
  6326. var lastSlash = path.lastIndexOf("/");
  6327. if (lastSlash === -1) return path;
  6328. return path.substr(lastSlash + 1);
  6329. },
  6330. join: function () {
  6331. var paths = Array.prototype.slice.call(arguments);
  6332. return PATH.normalize(paths.join("/"));
  6333. },
  6334. join2: (l, r) => {
  6335. return PATH.normalize(l + "/" + r);
  6336. }
  6337. };
  6338. var initRandomFill = () => {
  6339. if (
  6340. typeof crypto == "object" &&
  6341. typeof crypto["getRandomValues"] == "function"
  6342. ) {
  6343. // for modern web browsers
  6344. return view => crypto.getRandomValues(view);
  6345. } else if (ENVIRONMENT_IS_NODE) {
  6346. // for nodejs with or without crypto support included
  6347. try {
  6348. var crypto_module = require("crypto");
  6349. var randomFillSync = crypto_module["randomFillSync"];
  6350. if (randomFillSync) {
  6351. // nodejs with LTS crypto support
  6352. return view => crypto_module["randomFillSync"](view);
  6353. }
  6354. // very old nodejs with the original crypto API
  6355. var randomBytes = crypto_module["randomBytes"];
  6356. return view => (
  6357. view.set(randomBytes(view.byteLength)),
  6358. // Return the original view to match modern native implementations.
  6359. view
  6360. );
  6361. } catch (e) {
  6362. // nodejs doesn't have crypto support
  6363. }
  6364. }
  6365. // we couldn't find a proper implementation, as Math.random() is not suitable for /dev/random, see emscripten-core/emscripten/pull/7096
  6366. abort("initRandomDevice");
  6367. };
  6368. var randomFill = view => {
  6369. // Lazily init on the first invocation.
  6370. return (randomFill = initRandomFill())(view);
  6371. };
  6372. var PATH_FS = {
  6373. resolve: function () {
  6374. var resolvedPath = "",
  6375. resolvedAbsolute = false;
  6376. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  6377. var path = i >= 0 ? arguments[i] : FS.cwd();
  6378. // Skip empty and invalid entries
  6379. if (typeof path != "string") {
  6380. throw new TypeError("Arguments to path.resolve must be strings");
  6381. } else if (!path) {
  6382. return ""; // an invalid portion invalidates the whole thing
  6383. }
  6384. resolvedPath = path + "/" + resolvedPath;
  6385. resolvedAbsolute = PATH.isAbs(path);
  6386. }
  6387. // At this point the path should be resolved to a full absolute path, but
  6388. // handle relative paths to be safe (might happen when process.cwd() fails)
  6389. resolvedPath = PATH.normalizeArray(
  6390. resolvedPath.split("/").filter(p => !!p),
  6391. !resolvedAbsolute
  6392. ).join("/");
  6393. return (resolvedAbsolute ? "/" : "") + resolvedPath || ".";
  6394. },
  6395. relative: (from, to) => {
  6396. from = PATH_FS.resolve(from).substr(1);
  6397. to = PATH_FS.resolve(to).substr(1);
  6398. function trim(arr) {
  6399. var start = 0;
  6400. for (; start < arr.length; start++) {
  6401. if (arr[start] !== "") break;
  6402. }
  6403. var end = arr.length - 1;
  6404. for (; end >= 0; end--) {
  6405. if (arr[end] !== "") break;
  6406. }
  6407. if (start > end) return [];
  6408. return arr.slice(start, end - start + 1);
  6409. }
  6410. var fromParts = trim(from.split("/"));
  6411. var toParts = trim(to.split("/"));
  6412. var length = Math.min(fromParts.length, toParts.length);
  6413. var samePartsLength = length;
  6414. for (var i = 0; i < length; i++) {
  6415. if (fromParts[i] !== toParts[i]) {
  6416. samePartsLength = i;
  6417. break;
  6418. }
  6419. }
  6420. var outputParts = [];
  6421. for (var i = samePartsLength; i < fromParts.length; i++) {
  6422. outputParts.push("..");
  6423. }
  6424. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  6425. return outputParts.join("/");
  6426. }
  6427. };
  6428. var UTF8Decoder =
  6429. typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined;
  6430. /**
  6431. * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
  6432. * array that contains uint8 values, returns a copy of that string as a
  6433. * Javascript String object.
  6434. * heapOrArray is either a regular array, or a JavaScript typed array view.
  6435. * @param {number} idx
  6436. * @param {number=} maxBytesToRead
  6437. * @return {string}
  6438. */
  6439. var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
  6440. var endIdx = idx + maxBytesToRead;
  6441. var endPtr = idx;
  6442. // TextDecoder needs to know the byte length in advance, it doesn't stop on
  6443. // null terminator by itself. Also, use the length info to avoid running tiny
  6444. // strings through TextDecoder, since .subarray() allocates garbage.
  6445. // (As a tiny code save trick, compare endPtr against endIdx using a negation,
  6446. // so that undefined means Infinity)
  6447. while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
  6448. if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
  6449. return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
  6450. }
  6451. var str = "";
  6452. // If building with TextDecoder, we have already computed the string length
  6453. // above, so test loop end condition against that
  6454. while (idx < endPtr) {
  6455. // For UTF8 byte structure, see:
  6456. // http://en.wikipedia.org/wiki/UTF-8#Description
  6457. // https://www.ietf.org/rfc/rfc2279.txt
  6458. // https://tools.ietf.org/html/rfc3629
  6459. var u0 = heapOrArray[idx++];
  6460. if (!(u0 & 0x80)) {
  6461. str += String.fromCharCode(u0);
  6462. continue;
  6463. }
  6464. var u1 = heapOrArray[idx++] & 63;
  6465. if ((u0 & 0xe0) == 0xc0) {
  6466. str += String.fromCharCode(((u0 & 31) << 6) | u1);
  6467. continue;
  6468. }
  6469. var u2 = heapOrArray[idx++] & 63;
  6470. if ((u0 & 0xf0) == 0xe0) {
  6471. u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
  6472. } else {
  6473. u0 =
  6474. ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);
  6475. }
  6476. if (u0 < 0x10000) {
  6477. str += String.fromCharCode(u0);
  6478. } else {
  6479. var ch = u0 - 0x10000;
  6480. str += String.fromCharCode(0xd800 | (ch >> 10), 0xdc00 | (ch & 0x3ff));
  6481. }
  6482. }
  6483. return str;
  6484. };
  6485. var FS_stdin_getChar_buffer = [];
  6486. var lengthBytesUTF8 = str => {
  6487. var len = 0;
  6488. for (var i = 0; i < str.length; ++i) {
  6489. // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
  6490. // unit, not a Unicode code point of the character! So decode
  6491. // UTF16->UTF32->UTF8.
  6492. // See http://unicode.org/faq/utf_bom.html#utf16-3
  6493. var c = str.charCodeAt(i); // possibly a lead surrogate
  6494. if (c <= 0x7f) {
  6495. len++;
  6496. } else if (c <= 0x7ff) {
  6497. len += 2;
  6498. } else if (c >= 0xd800 && c <= 0xdfff) {
  6499. len += 4;
  6500. ++i;
  6501. } else {
  6502. len += 3;
  6503. }
  6504. }
  6505. return len;
  6506. };
  6507. var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
  6508. // Parameter maxBytesToWrite is not optional. Negative values, 0, null,
  6509. // undefined and false each don't write out any bytes.
  6510. if (!(maxBytesToWrite > 0)) return 0;
  6511. var startIdx = outIdx;
  6512. var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
  6513. for (var i = 0; i < str.length; ++i) {
  6514. // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
  6515. // unit, not a Unicode code point of the character! So decode
  6516. // UTF16->UTF32->UTF8.
  6517. // See http://unicode.org/faq/utf_bom.html#utf16-3
  6518. // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description
  6519. // and https://www.ietf.org/rfc/rfc2279.txt
  6520. // and https://tools.ietf.org/html/rfc3629
  6521. var u = str.charCodeAt(i); // possibly a lead surrogate
  6522. if (u >= 0xd800 && u <= 0xdfff) {
  6523. var u1 = str.charCodeAt(++i);
  6524. u = (0x10000 + ((u & 0x3ff) << 10)) | (u1 & 0x3ff);
  6525. }
  6526. if (u <= 0x7f) {
  6527. if (outIdx >= endIdx) break;
  6528. heap[outIdx++] = u;
  6529. } else if (u <= 0x7ff) {
  6530. if (outIdx + 1 >= endIdx) break;
  6531. heap[outIdx++] = 0xc0 | (u >> 6);
  6532. heap[outIdx++] = 0x80 | (u & 63);
  6533. } else if (u <= 0xffff) {
  6534. if (outIdx + 2 >= endIdx) break;
  6535. heap[outIdx++] = 0xe0 | (u >> 12);
  6536. heap[outIdx++] = 0x80 | ((u >> 6) & 63);
  6537. heap[outIdx++] = 0x80 | (u & 63);
  6538. } else {
  6539. if (outIdx + 3 >= endIdx) break;
  6540. heap[outIdx++] = 0xf0 | (u >> 18);
  6541. heap[outIdx++] = 0x80 | ((u >> 12) & 63);
  6542. heap[outIdx++] = 0x80 | ((u >> 6) & 63);
  6543. heap[outIdx++] = 0x80 | (u & 63);
  6544. }
  6545. }
  6546. // Null-terminate the pointer to the buffer.
  6547. heap[outIdx] = 0;
  6548. return outIdx - startIdx;
  6549. };
  6550. /** @type {function(string, boolean=, number=)} */
  6551. function intArrayFromString(stringy, dontAddNull, length) {
  6552. var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
  6553. var u8array = new Array(len);
  6554. var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
  6555. if (dontAddNull) u8array.length = numBytesWritten;
  6556. return u8array;
  6557. }
  6558. var FS_stdin_getChar = () => {
  6559. if (!FS_stdin_getChar_buffer.length) {
  6560. var result = null;
  6561. if (ENVIRONMENT_IS_NODE) {
  6562. // we will read data by chunks of BUFSIZE
  6563. var BUFSIZE = 256;
  6564. var buf = Buffer.alloc(BUFSIZE);
  6565. var bytesRead = 0;
  6566. // For some reason we must suppress a closure warning here, even though
  6567. // fd definitely exists on process.stdin, and is even the proper way to
  6568. // get the fd of stdin,
  6569. // https://github.com/nodejs/help/issues/2136#issuecomment-523649904
  6570. // This started to happen after moving this logic out of library_tty.js,
  6571. // so it is related to the surrounding code in some unclear manner.
  6572. /** @suppress {missingProperties} */
  6573. var fd = process.stdin.fd;
  6574. try {
  6575. bytesRead = fs.readSync(fd, buf, 0, BUFSIZE, -1);
  6576. } catch (e) {
  6577. // Cross-platform differences: on Windows, reading EOF throws an exception, but on other OSes,
  6578. // reading EOF returns 0. Uniformize behavior by treating the EOF exception to return 0.
  6579. if (e.toString().includes("EOF")) bytesRead = 0;
  6580. else throw e;
  6581. }
  6582. if (bytesRead > 0) {
  6583. result = buf.slice(0, bytesRead).toString("utf-8");
  6584. } else {
  6585. result = null;
  6586. }
  6587. } else if (
  6588. typeof window != "undefined" &&
  6589. typeof window.prompt == "function"
  6590. ) {
  6591. // Browser.
  6592. result = window.prompt("Input: "); // returns null on cancel
  6593. if (result !== null) {
  6594. result += "\n";
  6595. }
  6596. } else if (typeof readline == "function") {
  6597. // Command line.
  6598. result = readline();
  6599. if (result !== null) {
  6600. result += "\n";
  6601. }
  6602. }
  6603. if (!result) {
  6604. return null;
  6605. }
  6606. FS_stdin_getChar_buffer = intArrayFromString(result, true);
  6607. }
  6608. return FS_stdin_getChar_buffer.shift();
  6609. };
  6610. var TTY = {
  6611. ttys: [],
  6612. init: function () {
  6613. // https://github.com/emscripten-core/emscripten/pull/1555
  6614. // if (ENVIRONMENT_IS_NODE) {
  6615. // // currently, FS.init does not distinguish if process.stdin is a file or TTY
  6616. // // device, it always assumes it's a TTY device. because of this, we're forcing
  6617. // // process.stdin to UTF8 encoding to at least make stdin reading compatible
  6618. // // with text files until FS.init can be refactored.
  6619. // process.stdin.setEncoding('utf8');
  6620. // }
  6621. },
  6622. shutdown: function () {
  6623. // https://github.com/emscripten-core/emscripten/pull/1555
  6624. // if (ENVIRONMENT_IS_NODE) {
  6625. // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?
  6626. // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation
  6627. // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?
  6628. // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle
  6629. // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call
  6630. // process.stdin.pause();
  6631. // }
  6632. },
  6633. register: function (dev, ops) {
  6634. TTY.ttys[dev] = { input: [], output: [], ops: ops };
  6635. FS.registerDevice(dev, TTY.stream_ops);
  6636. },
  6637. stream_ops: {
  6638. open: function (stream) {
  6639. var tty = TTY.ttys[stream.node.rdev];
  6640. if (!tty) {
  6641. throw new FS.ErrnoError(43);
  6642. }
  6643. stream.tty = tty;
  6644. stream.seekable = false;
  6645. },
  6646. close: function (stream) {
  6647. // flush any pending line data
  6648. stream.tty.ops.fsync(stream.tty);
  6649. },
  6650. fsync: function (stream) {
  6651. stream.tty.ops.fsync(stream.tty);
  6652. },
  6653. read: function (stream, buffer, offset, length, pos /* ignored */) {
  6654. if (!stream.tty || !stream.tty.ops.get_char) {
  6655. throw new FS.ErrnoError(60);
  6656. }
  6657. var bytesRead = 0;
  6658. for (var i = 0; i < length; i++) {
  6659. var result;
  6660. try {
  6661. result = stream.tty.ops.get_char(stream.tty);
  6662. } catch (e) {
  6663. throw new FS.ErrnoError(29);
  6664. }
  6665. if (result === undefined && bytesRead === 0) {
  6666. throw new FS.ErrnoError(6);
  6667. }
  6668. if (result === null || result === undefined) break;
  6669. bytesRead++;
  6670. buffer[offset + i] = result;
  6671. }
  6672. if (bytesRead) {
  6673. stream.node.timestamp = Date.now();
  6674. }
  6675. return bytesRead;
  6676. },
  6677. write: function (stream, buffer, offset, length, pos) {
  6678. if (!stream.tty || !stream.tty.ops.put_char) {
  6679. throw new FS.ErrnoError(60);
  6680. }
  6681. try {
  6682. for (var i = 0; i < length; i++) {
  6683. stream.tty.ops.put_char(stream.tty, buffer[offset + i]);
  6684. }
  6685. } catch (e) {
  6686. throw new FS.ErrnoError(29);
  6687. }
  6688. if (length) {
  6689. stream.node.timestamp = Date.now();
  6690. }
  6691. return i;
  6692. }
  6693. },
  6694. default_tty_ops: {
  6695. get_char: function (tty) {
  6696. return FS_stdin_getChar();
  6697. },
  6698. put_char: function (tty, val) {
  6699. if (val === null || val === 10) {
  6700. out(UTF8ArrayToString(tty.output, 0));
  6701. tty.output = [];
  6702. } else {
  6703. if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle.
  6704. }
  6705. },
  6706. fsync: function (tty) {
  6707. if (tty.output && tty.output.length > 0) {
  6708. out(UTF8ArrayToString(tty.output, 0));
  6709. tty.output = [];
  6710. }
  6711. },
  6712. ioctl_tcgets: function (tty) {
  6713. // typical setting
  6714. return {
  6715. c_iflag: 25856,
  6716. c_oflag: 5,
  6717. c_cflag: 191,
  6718. c_lflag: 35387,
  6719. c_cc: [
  6720. 0x03, 0x1c, 0x7f, 0x15, 0x04, 0x00, 0x01, 0x00, 0x11, 0x13, 0x1a,
  6721. 0x00, 0x12, 0x0f, 0x17, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  6722. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  6723. ]
  6724. };
  6725. },
  6726. ioctl_tcsets: function (tty, optional_actions, data) {
  6727. // currently just ignore
  6728. return 0;
  6729. },
  6730. ioctl_tiocgwinsz: function (tty) {
  6731. return [24, 80];
  6732. }
  6733. },
  6734. default_tty1_ops: {
  6735. put_char: function (tty, val) {
  6736. if (val === null || val === 10) {
  6737. err(UTF8ArrayToString(tty.output, 0));
  6738. tty.output = [];
  6739. } else {
  6740. if (val != 0) tty.output.push(val);
  6741. }
  6742. },
  6743. fsync: function (tty) {
  6744. if (tty.output && tty.output.length > 0) {
  6745. err(UTF8ArrayToString(tty.output, 0));
  6746. tty.output = [];
  6747. }
  6748. }
  6749. }
  6750. };
  6751. var zeroMemory = (address, size) => {
  6752. HEAPU8.fill(0, address, address + size);
  6753. return address;
  6754. };
  6755. var alignMemory = (size, alignment) => {
  6756. return Math.ceil(size / alignment) * alignment;
  6757. };
  6758. var mmapAlloc = size => {
  6759. abort();
  6760. };
  6761. var MEMFS = {
  6762. ops_table: null,
  6763. mount(mount) {
  6764. return MEMFS.createNode(null, "/", 16384 | 511 /* 0777 */, 0);
  6765. },
  6766. createNode(parent, name, mode, dev) {
  6767. if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
  6768. // no supported
  6769. throw new FS.ErrnoError(63);
  6770. }
  6771. if (!MEMFS.ops_table) {
  6772. MEMFS.ops_table = {
  6773. dir: {
  6774. node: {
  6775. getattr: MEMFS.node_ops.getattr,
  6776. setattr: MEMFS.node_ops.setattr,
  6777. lookup: MEMFS.node_ops.lookup,
  6778. mknod: MEMFS.node_ops.mknod,
  6779. rename: MEMFS.node_ops.rename,
  6780. unlink: MEMFS.node_ops.unlink,
  6781. rmdir: MEMFS.node_ops.rmdir,
  6782. readdir: MEMFS.node_ops.readdir,
  6783. symlink: MEMFS.node_ops.symlink
  6784. },
  6785. stream: {
  6786. llseek: MEMFS.stream_ops.llseek
  6787. }
  6788. },
  6789. file: {
  6790. node: {
  6791. getattr: MEMFS.node_ops.getattr,
  6792. setattr: MEMFS.node_ops.setattr
  6793. },
  6794. stream: {
  6795. llseek: MEMFS.stream_ops.llseek,
  6796. read: MEMFS.stream_ops.read,
  6797. write: MEMFS.stream_ops.write,
  6798. allocate: MEMFS.stream_ops.allocate,
  6799. mmap: MEMFS.stream_ops.mmap,
  6800. msync: MEMFS.stream_ops.msync
  6801. }
  6802. },
  6803. link: {
  6804. node: {
  6805. getattr: MEMFS.node_ops.getattr,
  6806. setattr: MEMFS.node_ops.setattr,
  6807. readlink: MEMFS.node_ops.readlink
  6808. },
  6809. stream: {}
  6810. },
  6811. chrdev: {
  6812. node: {
  6813. getattr: MEMFS.node_ops.getattr,
  6814. setattr: MEMFS.node_ops.setattr
  6815. },
  6816. stream: FS.chrdev_stream_ops
  6817. }
  6818. };
  6819. }
  6820. var node = FS.createNode(parent, name, mode, dev);
  6821. if (FS.isDir(node.mode)) {
  6822. node.node_ops = MEMFS.ops_table.dir.node;
  6823. node.stream_ops = MEMFS.ops_table.dir.stream;
  6824. node.contents = {};
  6825. } else if (FS.isFile(node.mode)) {
  6826. node.node_ops = MEMFS.ops_table.file.node;
  6827. node.stream_ops = MEMFS.ops_table.file.stream;
  6828. node.usedBytes = 0; // The actual number of bytes used in the typed array, as opposed to contents.length which gives the whole capacity.
  6829. // When the byte data of the file is populated, this will point to either a typed array, or a normal JS array. Typed arrays are preferred
  6830. // for performance, and used by default. However, typed arrays are not resizable like normal JS arrays are, so there is a small disk size
  6831. // penalty involved for appending file writes that continuously grow a file similar to std::vector capacity vs used -scheme.
  6832. node.contents = null;
  6833. } else if (FS.isLink(node.mode)) {
  6834. node.node_ops = MEMFS.ops_table.link.node;
  6835. node.stream_ops = MEMFS.ops_table.link.stream;
  6836. } else if (FS.isChrdev(node.mode)) {
  6837. node.node_ops = MEMFS.ops_table.chrdev.node;
  6838. node.stream_ops = MEMFS.ops_table.chrdev.stream;
  6839. }
  6840. node.timestamp = Date.now();
  6841. // add the new node to the parent
  6842. if (parent) {
  6843. parent.contents[name] = node;
  6844. parent.timestamp = node.timestamp;
  6845. }
  6846. return node;
  6847. },
  6848. getFileDataAsTypedArray(node) {
  6849. if (!node.contents) return new Uint8Array(0);
  6850. if (node.contents.subarray)
  6851. return node.contents.subarray(0, node.usedBytes); // Make sure to not return excess unused bytes.
  6852. return new Uint8Array(node.contents);
  6853. },
  6854. expandFileStorage(node, newCapacity) {
  6855. var prevCapacity = node.contents ? node.contents.length : 0;
  6856. if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough.
  6857. // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity.
  6858. // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to
  6859. // avoid overshooting the allocation cap by a very large margin.
  6860. var CAPACITY_DOUBLING_MAX = 1024 * 1024;
  6861. newCapacity = Math.max(
  6862. newCapacity,
  6863. (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) >>>
  6864. 0
  6865. );
  6866. if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding.
  6867. var oldContents = node.contents;
  6868. node.contents = new Uint8Array(newCapacity); // Allocate new storage.
  6869. if (node.usedBytes > 0)
  6870. node.contents.set(oldContents.subarray(0, node.usedBytes), 0); // Copy old data over to the new storage.
  6871. },
  6872. resizeFileStorage(node, newSize) {
  6873. if (node.usedBytes == newSize) return;
  6874. if (newSize == 0) {
  6875. node.contents = null; // Fully decommit when requesting a resize to zero.
  6876. node.usedBytes = 0;
  6877. } else {
  6878. var oldContents = node.contents;
  6879. node.contents = new Uint8Array(newSize); // Allocate new storage.
  6880. if (oldContents) {
  6881. node.contents.set(
  6882. oldContents.subarray(0, Math.min(newSize, node.usedBytes))
  6883. ); // Copy old data over to the new storage.
  6884. }
  6885. node.usedBytes = newSize;
  6886. }
  6887. },
  6888. node_ops: {
  6889. getattr(node) {
  6890. var attr = {};
  6891. // device numbers reuse inode numbers.
  6892. attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
  6893. attr.ino = node.id;
  6894. attr.mode = node.mode;
  6895. attr.nlink = 1;
  6896. attr.uid = 0;
  6897. attr.gid = 0;
  6898. attr.rdev = node.rdev;
  6899. if (FS.isDir(node.mode)) {
  6900. attr.size = 4096;
  6901. } else if (FS.isFile(node.mode)) {
  6902. attr.size = node.usedBytes;
  6903. } else if (FS.isLink(node.mode)) {
  6904. attr.size = node.link.length;
  6905. } else {
  6906. attr.size = 0;
  6907. }
  6908. attr.atime = new Date(node.timestamp);
  6909. attr.mtime = new Date(node.timestamp);
  6910. attr.ctime = new Date(node.timestamp);
  6911. // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),
  6912. // but this is not required by the standard.
  6913. attr.blksize = 4096;
  6914. attr.blocks = Math.ceil(attr.size / attr.blksize);
  6915. return attr;
  6916. },
  6917. setattr(node, attr) {
  6918. if (attr.mode !== undefined) {
  6919. node.mode = attr.mode;
  6920. }
  6921. if (attr.timestamp !== undefined) {
  6922. node.timestamp = attr.timestamp;
  6923. }
  6924. if (attr.size !== undefined) {
  6925. MEMFS.resizeFileStorage(node, attr.size);
  6926. }
  6927. },
  6928. lookup(parent, name) {
  6929. throw FS.genericErrors[44];
  6930. },
  6931. mknod(parent, name, mode, dev) {
  6932. return MEMFS.createNode(parent, name, mode, dev);
  6933. },
  6934. rename(old_node, new_dir, new_name) {
  6935. // if we're overwriting a directory at new_name, make sure it's empty.
  6936. if (FS.isDir(old_node.mode)) {
  6937. var new_node;
  6938. try {
  6939. new_node = FS.lookupNode(new_dir, new_name);
  6940. } catch (e) {}
  6941. if (new_node) {
  6942. for (var i in new_node.contents) {
  6943. throw new FS.ErrnoError(55);
  6944. }
  6945. }
  6946. }
  6947. // do the internal rewiring
  6948. delete old_node.parent.contents[old_node.name];
  6949. old_node.parent.timestamp = Date.now();
  6950. old_node.name = new_name;
  6951. new_dir.contents[new_name] = old_node;
  6952. new_dir.timestamp = old_node.parent.timestamp;
  6953. old_node.parent = new_dir;
  6954. },
  6955. unlink(parent, name) {
  6956. delete parent.contents[name];
  6957. parent.timestamp = Date.now();
  6958. },
  6959. rmdir(parent, name) {
  6960. var node = FS.lookupNode(parent, name);
  6961. for (var i in node.contents) {
  6962. throw new FS.ErrnoError(55);
  6963. }
  6964. delete parent.contents[name];
  6965. parent.timestamp = Date.now();
  6966. },
  6967. readdir(node) {
  6968. var entries = [".", ".."];
  6969. for (var key in node.contents) {
  6970. if (!node.contents.hasOwnProperty(key)) {
  6971. continue;
  6972. }
  6973. entries.push(key);
  6974. }
  6975. return entries;
  6976. },
  6977. symlink(parent, newname, oldpath) {
  6978. var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);
  6979. node.link = oldpath;
  6980. return node;
  6981. },
  6982. readlink(node) {
  6983. if (!FS.isLink(node.mode)) {
  6984. throw new FS.ErrnoError(28);
  6985. }
  6986. return node.link;
  6987. }
  6988. },
  6989. stream_ops: {
  6990. read(stream, buffer, offset, length, position) {
  6991. var contents = stream.node.contents;
  6992. if (position >= stream.node.usedBytes) return 0;
  6993. var size = Math.min(stream.node.usedBytes - position, length);
  6994. if (size > 8 && contents.subarray) {
  6995. // non-trivial, and typed array
  6996. buffer.set(contents.subarray(position, position + size), offset);
  6997. } else {
  6998. for (var i = 0; i < size; i++)
  6999. buffer[offset + i] = contents[position + i];
  7000. }
  7001. return size;
  7002. },
  7003. write(stream, buffer, offset, length, position, canOwn) {
  7004. // If the buffer is located in main memory (HEAP), and if
  7005. // memory can grow, we can't hold on to references of the
  7006. // memory buffer, as they may get invalidated. That means we
  7007. // need to do copy its contents.
  7008. if (buffer.buffer === HEAP8.buffer) {
  7009. canOwn = false;
  7010. }
  7011. if (!length) return 0;
  7012. var node = stream.node;
  7013. node.timestamp = Date.now();
  7014. if (buffer.subarray && (!node.contents || node.contents.subarray)) {
  7015. // This write is from a typed array to a typed array?
  7016. if (canOwn) {
  7017. node.contents = buffer.subarray(offset, offset + length);
  7018. node.usedBytes = length;
  7019. return length;
  7020. } else if (node.usedBytes === 0 && position === 0) {
  7021. // If this is a simple first write to an empty file, do a fast set since we don't need to care about old data.
  7022. node.contents = buffer.slice(offset, offset + length);
  7023. node.usedBytes = length;
  7024. return length;
  7025. } else if (position + length <= node.usedBytes) {
  7026. // Writing to an already allocated and used subrange of the file?
  7027. node.contents.set(buffer.subarray(offset, offset + length), position);
  7028. return length;
  7029. }
  7030. }
  7031. // Appending to an existing file and we need to reallocate, or source data did not come as a typed array.
  7032. MEMFS.expandFileStorage(node, position + length);
  7033. if (node.contents.subarray && buffer.subarray) {
  7034. // Use typed array write which is available.
  7035. node.contents.set(buffer.subarray(offset, offset + length), position);
  7036. } else {
  7037. for (var i = 0; i < length; i++) {
  7038. node.contents[position + i] = buffer[offset + i]; // Or fall back to manual write if not.
  7039. }
  7040. }
  7041. node.usedBytes = Math.max(node.usedBytes, position + length);
  7042. return length;
  7043. },
  7044. llseek(stream, offset, whence) {
  7045. var position = offset;
  7046. if (whence === 1) {
  7047. position += stream.position;
  7048. } else if (whence === 2) {
  7049. if (FS.isFile(stream.node.mode)) {
  7050. position += stream.node.usedBytes;
  7051. }
  7052. }
  7053. if (position < 0) {
  7054. throw new FS.ErrnoError(28);
  7055. }
  7056. return position;
  7057. },
  7058. allocate(stream, offset, length) {
  7059. MEMFS.expandFileStorage(stream.node, offset + length);
  7060. stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length);
  7061. },
  7062. mmap(stream, length, position, prot, flags) {
  7063. if (!FS.isFile(stream.node.mode)) {
  7064. throw new FS.ErrnoError(43);
  7065. }
  7066. var ptr;
  7067. var allocated;
  7068. var contents = stream.node.contents;
  7069. // Only make a new copy when MAP_PRIVATE is specified.
  7070. if (!(flags & 2) && contents.buffer === HEAP8.buffer) {
  7071. // We can't emulate MAP_SHARED when the file is not backed by the
  7072. // buffer we're mapping to (e.g. the HEAP buffer).
  7073. allocated = false;
  7074. ptr = contents.byteOffset;
  7075. } else {
  7076. // Try to avoid unnecessary slices.
  7077. if (position > 0 || position + length < contents.length) {
  7078. if (contents.subarray) {
  7079. contents = contents.subarray(position, position + length);
  7080. } else {
  7081. contents = Array.prototype.slice.call(
  7082. contents,
  7083. position,
  7084. position + length
  7085. );
  7086. }
  7087. }
  7088. allocated = true;
  7089. ptr = mmapAlloc(length);
  7090. if (!ptr) {
  7091. throw new FS.ErrnoError(48);
  7092. }
  7093. HEAP8.set(contents, ptr);
  7094. }
  7095. return { ptr, allocated };
  7096. },
  7097. msync(stream, buffer, offset, length, mmapFlags) {
  7098. MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false);
  7099. // should we check if bytesWritten and length are the same?
  7100. return 0;
  7101. }
  7102. }
  7103. };
  7104. /** @param {boolean=} noRunDep */
  7105. var asyncLoad = (url, onload, onerror, noRunDep) => {
  7106. var dep = !noRunDep ? getUniqueRunDependency(`al ${url}`) : "";
  7107. readAsync(
  7108. url,
  7109. arrayBuffer => {
  7110. assert(
  7111. arrayBuffer,
  7112. `Loading data file "${url}" failed (no arrayBuffer).`
  7113. );
  7114. onload(new Uint8Array(arrayBuffer));
  7115. if (dep) removeRunDependency(dep);
  7116. },
  7117. event => {
  7118. if (onerror) {
  7119. onerror();
  7120. } else {
  7121. throw `Loading data file "${url}" failed.`;
  7122. }
  7123. }
  7124. );
  7125. if (dep) addRunDependency(dep);
  7126. };
  7127. var preloadPlugins = Module["preloadPlugins"] || [];
  7128. function FS_handledByPreloadPlugin(byteArray, fullname, finish, onerror) {
  7129. // Ensure plugins are ready.
  7130. if (typeof Browser != "undefined") Browser.init();
  7131. var handled = false;
  7132. preloadPlugins.forEach(function (plugin) {
  7133. if (handled) return;
  7134. if (plugin["canHandle"](fullname)) {
  7135. plugin["handle"](byteArray, fullname, finish, onerror);
  7136. handled = true;
  7137. }
  7138. });
  7139. return handled;
  7140. }
  7141. function FS_createPreloadedFile(
  7142. parent,
  7143. name,
  7144. url,
  7145. canRead,
  7146. canWrite,
  7147. onload,
  7148. onerror,
  7149. dontCreateFile,
  7150. canOwn,
  7151. preFinish
  7152. ) {
  7153. // TODO we should allow people to just pass in a complete filename instead
  7154. // of parent and name being that we just join them anyways
  7155. var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent;
  7156. var dep = getUniqueRunDependency(`cp ${fullname}`); // might have several active requests for the same fullname
  7157. function processData(byteArray) {
  7158. function finish(byteArray) {
  7159. if (preFinish) preFinish();
  7160. if (!dontCreateFile) {
  7161. FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
  7162. }
  7163. if (onload) onload();
  7164. removeRunDependency(dep);
  7165. }
  7166. if (
  7167. FS_handledByPreloadPlugin(byteArray, fullname, finish, () => {
  7168. if (onerror) onerror();
  7169. removeRunDependency(dep);
  7170. })
  7171. ) {
  7172. return;
  7173. }
  7174. finish(byteArray);
  7175. }
  7176. addRunDependency(dep);
  7177. if (typeof url == "string") {
  7178. asyncLoad(url, byteArray => processData(byteArray), onerror);
  7179. } else {
  7180. processData(url);
  7181. }
  7182. }
  7183. function FS_modeStringToFlags(str) {
  7184. var flagModes = {
  7185. r: 0,
  7186. "r+": 2,
  7187. w: 512 | 64 | 1,
  7188. "w+": 512 | 64 | 2,
  7189. a: 1024 | 64 | 1,
  7190. "a+": 1024 | 64 | 2
  7191. };
  7192. var flags = flagModes[str];
  7193. if (typeof flags == "undefined") {
  7194. throw new Error(`Unknown file open mode: ${str}`);
  7195. }
  7196. return flags;
  7197. }
  7198. function FS_getMode(canRead, canWrite) {
  7199. var mode = 0;
  7200. if (canRead) mode |= 292 | 73;
  7201. if (canWrite) mode |= 146;
  7202. return mode;
  7203. }
  7204. var WORKERFS = {
  7205. DIR_MODE: 16895,
  7206. FILE_MODE: 33279,
  7207. reader: null,
  7208. mount(mount) {
  7209. assert(ENVIRONMENT_IS_WORKER);
  7210. if (!WORKERFS.reader) WORKERFS.reader = new FileReaderSync();
  7211. var root = WORKERFS.createNode(null, "/", WORKERFS.DIR_MODE, 0);
  7212. var createdParents = {};
  7213. function ensureParent(path) {
  7214. // return the parent node, creating subdirs as necessary
  7215. var parts = path.split("/");
  7216. var parent = root;
  7217. for (var i = 0; i < parts.length - 1; i++) {
  7218. var curr = parts.slice(0, i + 1).join("/");
  7219. // Issue 4254: Using curr as a node name will prevent the node
  7220. // from being found in FS.nameTable when FS.open is called on
  7221. // a path which holds a child of this node,
  7222. // given that all FS functions assume node names
  7223. // are just their corresponding parts within their given path,
  7224. // rather than incremental aggregates which include their parent's
  7225. // directories.
  7226. if (!createdParents[curr]) {
  7227. createdParents[curr] = WORKERFS.createNode(
  7228. parent,
  7229. parts[i],
  7230. WORKERFS.DIR_MODE,
  7231. 0
  7232. );
  7233. }
  7234. parent = createdParents[curr];
  7235. }
  7236. return parent;
  7237. }
  7238. function base(path) {
  7239. var parts = path.split("/");
  7240. return parts[parts.length - 1];
  7241. }
  7242. // We also accept FileList here, by using Array.prototype
  7243. Array.prototype.forEach.call(mount.opts["files"] || [], function (file) {
  7244. WORKERFS.createNode(
  7245. ensureParent(file.name),
  7246. base(file.name),
  7247. WORKERFS.FILE_MODE,
  7248. 0,
  7249. file,
  7250. file.lastModifiedDate
  7251. );
  7252. });
  7253. (mount.opts["blobs"] || []).forEach(function (obj) {
  7254. WORKERFS.createNode(
  7255. ensureParent(obj["name"]),
  7256. base(obj["name"]),
  7257. WORKERFS.FILE_MODE,
  7258. 0,
  7259. obj["data"]
  7260. );
  7261. });
  7262. (mount.opts["packages"] || []).forEach(function (pack) {
  7263. pack["metadata"].files.forEach(function (file) {
  7264. var name = file.filename.substr(1); // remove initial slash
  7265. WORKERFS.createNode(
  7266. ensureParent(name),
  7267. base(name),
  7268. WORKERFS.FILE_MODE,
  7269. 0,
  7270. pack["blob"].slice(file.start, file.end)
  7271. );
  7272. });
  7273. });
  7274. return root;
  7275. },
  7276. createNode(parent, name, mode, dev, contents, mtime) {
  7277. var node = FS.createNode(parent, name, mode);
  7278. node.mode = mode;
  7279. node.node_ops = WORKERFS.node_ops;
  7280. node.stream_ops = WORKERFS.stream_ops;
  7281. node.timestamp = (mtime || new Date()).getTime();
  7282. assert(WORKERFS.FILE_MODE !== WORKERFS.DIR_MODE);
  7283. if (mode === WORKERFS.FILE_MODE) {
  7284. node.size = contents.size;
  7285. node.contents = contents;
  7286. } else {
  7287. node.size = 4096;
  7288. node.contents = {};
  7289. }
  7290. if (parent) {
  7291. parent.contents[name] = node;
  7292. }
  7293. return node;
  7294. },
  7295. node_ops: {
  7296. getattr(node) {
  7297. return {
  7298. dev: 1,
  7299. ino: node.id,
  7300. mode: node.mode,
  7301. nlink: 1,
  7302. uid: 0,
  7303. gid: 0,
  7304. rdev: 0,
  7305. size: node.size,
  7306. atime: new Date(node.timestamp),
  7307. mtime: new Date(node.timestamp),
  7308. ctime: new Date(node.timestamp),
  7309. blksize: 4096,
  7310. blocks: Math.ceil(node.size / 4096)
  7311. };
  7312. },
  7313. setattr(node, attr) {
  7314. if (attr.mode !== undefined) {
  7315. node.mode = attr.mode;
  7316. }
  7317. if (attr.timestamp !== undefined) {
  7318. node.timestamp = attr.timestamp;
  7319. }
  7320. },
  7321. lookup(parent, name) {
  7322. throw new FS.ErrnoError(44);
  7323. },
  7324. mknod(parent, name, mode, dev) {
  7325. throw new FS.ErrnoError(63);
  7326. },
  7327. rename(oldNode, newDir, newName) {
  7328. throw new FS.ErrnoError(63);
  7329. },
  7330. unlink(parent, name) {
  7331. throw new FS.ErrnoError(63);
  7332. },
  7333. rmdir(parent, name) {
  7334. throw new FS.ErrnoError(63);
  7335. },
  7336. readdir(node) {
  7337. var entries = [".", ".."];
  7338. for (var key in node.contents) {
  7339. if (!node.contents.hasOwnProperty(key)) {
  7340. continue;
  7341. }
  7342. entries.push(key);
  7343. }
  7344. return entries;
  7345. },
  7346. symlink(parent, newName, oldPath) {
  7347. throw new FS.ErrnoError(63);
  7348. }
  7349. },
  7350. stream_ops: {
  7351. read(stream, buffer, offset, length, position) {
  7352. if (position >= stream.node.size) return 0;
  7353. var chunk = stream.node.contents.slice(position, position + length);
  7354. var ab = WORKERFS.reader.readAsArrayBuffer(chunk);
  7355. buffer.set(new Uint8Array(ab), offset);
  7356. return chunk.size;
  7357. },
  7358. write(stream, buffer, offset, length, position) {
  7359. throw new FS.ErrnoError(29);
  7360. },
  7361. llseek(stream, offset, whence) {
  7362. var position = offset;
  7363. if (whence === 1) {
  7364. position += stream.position;
  7365. } else if (whence === 2) {
  7366. if (FS.isFile(stream.node.mode)) {
  7367. position += stream.node.size;
  7368. }
  7369. }
  7370. if (position < 0) {
  7371. throw new FS.ErrnoError(28);
  7372. }
  7373. return position;
  7374. }
  7375. }
  7376. };
  7377. var FS = {
  7378. root: null,
  7379. mounts: [],
  7380. devices: {},
  7381. streams: [],
  7382. nextInode: 1,
  7383. nameTable: null,
  7384. currentPath: "/",
  7385. initialized: false,
  7386. ignorePermissions: true,
  7387. ErrnoError: null,
  7388. genericErrors: {},
  7389. filesystems: null,
  7390. syncFSRequests: 0,
  7391. lookupPath: (path, opts = {}) => {
  7392. path = PATH_FS.resolve(path);
  7393. if (!path) return { path: "", node: null };
  7394. var defaults = {
  7395. follow_mount: true,
  7396. recurse_count: 0
  7397. };
  7398. opts = Object.assign(defaults, opts);
  7399. if (opts.recurse_count > 8) {
  7400. // max recursive lookup of 8
  7401. throw new FS.ErrnoError(32);
  7402. }
  7403. // split the absolute path
  7404. var parts = path.split("/").filter(p => !!p);
  7405. // start at the root
  7406. var current = FS.root;
  7407. var current_path = "/";
  7408. for (var i = 0; i < parts.length; i++) {
  7409. var islast = i === parts.length - 1;
  7410. if (islast && opts.parent) {
  7411. // stop resolving
  7412. break;
  7413. }
  7414. current = FS.lookupNode(current, parts[i]);
  7415. current_path = PATH.join2(current_path, parts[i]);
  7416. // jump to the mount's root node if this is a mountpoint
  7417. if (FS.isMountpoint(current)) {
  7418. if (!islast || (islast && opts.follow_mount)) {
  7419. current = current.mounted.root;
  7420. }
  7421. }
  7422. // by default, lookupPath will not follow a symlink if it is the final path component.
  7423. // setting opts.follow = true will override this behavior.
  7424. if (!islast || opts.follow) {
  7425. var count = 0;
  7426. while (FS.isLink(current.mode)) {
  7427. var link = FS.readlink(current_path);
  7428. current_path = PATH_FS.resolve(PATH.dirname(current_path), link);
  7429. var lookup = FS.lookupPath(current_path, {
  7430. recurse_count: opts.recurse_count + 1
  7431. });
  7432. current = lookup.node;
  7433. if (count++ > 40) {
  7434. // limit max consecutive symlinks to 40 (SYMLOOP_MAX).
  7435. throw new FS.ErrnoError(32);
  7436. }
  7437. }
  7438. }
  7439. }
  7440. return { path: current_path, node: current };
  7441. },
  7442. getPath: node => {
  7443. var path;
  7444. while (true) {
  7445. if (FS.isRoot(node)) {
  7446. var mount = node.mount.mountpoint;
  7447. if (!path) return mount;
  7448. return mount[mount.length - 1] !== "/"
  7449. ? `${mount}/${path}`
  7450. : mount + path;
  7451. }
  7452. path = path ? `${node.name}/${path}` : node.name;
  7453. node = node.parent;
  7454. }
  7455. },
  7456. hashName: (parentid, name) => {
  7457. var hash = 0;
  7458. for (var i = 0; i < name.length; i++) {
  7459. hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;
  7460. }
  7461. return ((parentid + hash) >>> 0) % FS.nameTable.length;
  7462. },
  7463. hashAddNode: node => {
  7464. var hash = FS.hashName(node.parent.id, node.name);
  7465. node.name_next = FS.nameTable[hash];
  7466. FS.nameTable[hash] = node;
  7467. },
  7468. hashRemoveNode: node => {
  7469. var hash = FS.hashName(node.parent.id, node.name);
  7470. if (FS.nameTable[hash] === node) {
  7471. FS.nameTable[hash] = node.name_next;
  7472. } else {
  7473. var current = FS.nameTable[hash];
  7474. while (current) {
  7475. if (current.name_next === node) {
  7476. current.name_next = node.name_next;
  7477. break;
  7478. }
  7479. current = current.name_next;
  7480. }
  7481. }
  7482. },
  7483. lookupNode: (parent, name) => {
  7484. var errCode = FS.mayLookup(parent);
  7485. if (errCode) {
  7486. throw new FS.ErrnoError(errCode, parent);
  7487. }
  7488. var hash = FS.hashName(parent.id, name);
  7489. for (var node = FS.nameTable[hash]; node; node = node.name_next) {
  7490. var nodeName = node.name;
  7491. if (node.parent.id === parent.id && nodeName === name) {
  7492. return node;
  7493. }
  7494. }
  7495. // if we failed to find it in the cache, call into the VFS
  7496. return FS.lookup(parent, name);
  7497. },
  7498. createNode: (parent, name, mode, rdev) => {
  7499. var node = new FS.FSNode(parent, name, mode, rdev);
  7500. FS.hashAddNode(node);
  7501. return node;
  7502. },
  7503. destroyNode: node => {
  7504. FS.hashRemoveNode(node);
  7505. },
  7506. isRoot: node => {
  7507. return node === node.parent;
  7508. },
  7509. isMountpoint: node => {
  7510. return !!node.mounted;
  7511. },
  7512. isFile: mode => {
  7513. return (mode & 61440) === 32768;
  7514. },
  7515. isDir: mode => {
  7516. return (mode & 61440) === 16384;
  7517. },
  7518. isLink: mode => {
  7519. return (mode & 61440) === 40960;
  7520. },
  7521. isChrdev: mode => {
  7522. return (mode & 61440) === 8192;
  7523. },
  7524. isBlkdev: mode => {
  7525. return (mode & 61440) === 24576;
  7526. },
  7527. isFIFO: mode => {
  7528. return (mode & 61440) === 4096;
  7529. },
  7530. isSocket: mode => {
  7531. return (mode & 49152) === 49152;
  7532. },
  7533. flagsToPermissionString: flag => {
  7534. var perms = ["r", "w", "rw"][flag & 3];
  7535. if (flag & 512) {
  7536. perms += "w";
  7537. }
  7538. return perms;
  7539. },
  7540. nodePermissions: (node, perms) => {
  7541. if (FS.ignorePermissions) {
  7542. return 0;
  7543. }
  7544. // return 0 if any user, group or owner bits are set.
  7545. if (perms.includes("r") && !(node.mode & 292)) {
  7546. return 2;
  7547. } else if (perms.includes("w") && !(node.mode & 146)) {
  7548. return 2;
  7549. } else if (perms.includes("x") && !(node.mode & 73)) {
  7550. return 2;
  7551. }
  7552. return 0;
  7553. },
  7554. mayLookup: dir => {
  7555. var errCode = FS.nodePermissions(dir, "x");
  7556. if (errCode) return errCode;
  7557. if (!dir.node_ops.lookup) return 2;
  7558. return 0;
  7559. },
  7560. mayCreate: (dir, name) => {
  7561. try {
  7562. var node = FS.lookupNode(dir, name);
  7563. return 20;
  7564. } catch (e) {}
  7565. return FS.nodePermissions(dir, "wx");
  7566. },
  7567. mayDelete: (dir, name, isdir) => {
  7568. var node;
  7569. try {
  7570. node = FS.lookupNode(dir, name);
  7571. } catch (e) {
  7572. return e.errno;
  7573. }
  7574. var errCode = FS.nodePermissions(dir, "wx");
  7575. if (errCode) {
  7576. return errCode;
  7577. }
  7578. if (isdir) {
  7579. if (!FS.isDir(node.mode)) {
  7580. return 54;
  7581. }
  7582. if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
  7583. return 10;
  7584. }
  7585. } else {
  7586. if (FS.isDir(node.mode)) {
  7587. return 31;
  7588. }
  7589. }
  7590. return 0;
  7591. },
  7592. mayOpen: (node, flags) => {
  7593. if (!node) {
  7594. return 44;
  7595. }
  7596. if (FS.isLink(node.mode)) {
  7597. return 32;
  7598. } else if (FS.isDir(node.mode)) {
  7599. if (
  7600. FS.flagsToPermissionString(flags) !== "r" || // opening for write
  7601. flags & 512
  7602. ) {
  7603. // TODO: check for O_SEARCH? (== search for dir only)
  7604. return 31;
  7605. }
  7606. }
  7607. return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
  7608. },
  7609. MAX_OPEN_FDS: 4096,
  7610. nextfd: () => {
  7611. for (var fd = 0; fd <= FS.MAX_OPEN_FDS; fd++) {
  7612. if (!FS.streams[fd]) {
  7613. return fd;
  7614. }
  7615. }
  7616. throw new FS.ErrnoError(33);
  7617. },
  7618. getStreamChecked: fd => {
  7619. var stream = FS.getStream(fd);
  7620. if (!stream) {
  7621. throw new FS.ErrnoError(8);
  7622. }
  7623. return stream;
  7624. },
  7625. getStream: fd => FS.streams[fd],
  7626. createStream: (stream, fd = -1) => {
  7627. if (!FS.FSStream) {
  7628. FS.FSStream = /** @constructor */ function () {
  7629. this.shared = {};
  7630. };
  7631. FS.FSStream.prototype = {};
  7632. Object.defineProperties(FS.FSStream.prototype, {
  7633. object: {
  7634. /** @this {FS.FSStream} */
  7635. get() {
  7636. return this.node;
  7637. },
  7638. /** @this {FS.FSStream} */
  7639. set(val) {
  7640. this.node = val;
  7641. }
  7642. },
  7643. isRead: {
  7644. /** @this {FS.FSStream} */
  7645. get() {
  7646. return (this.flags & 2097155) !== 1;
  7647. }
  7648. },
  7649. isWrite: {
  7650. /** @this {FS.FSStream} */
  7651. get() {
  7652. return (this.flags & 2097155) !== 0;
  7653. }
  7654. },
  7655. isAppend: {
  7656. /** @this {FS.FSStream} */
  7657. get() {
  7658. return this.flags & 1024;
  7659. }
  7660. },
  7661. flags: {
  7662. /** @this {FS.FSStream} */
  7663. get() {
  7664. return this.shared.flags;
  7665. },
  7666. /** @this {FS.FSStream} */
  7667. set(val) {
  7668. this.shared.flags = val;
  7669. }
  7670. },
  7671. position: {
  7672. /** @this {FS.FSStream} */
  7673. get() {
  7674. return this.shared.position;
  7675. },
  7676. /** @this {FS.FSStream} */
  7677. set(val) {
  7678. this.shared.position = val;
  7679. }
  7680. }
  7681. });
  7682. }
  7683. // clone it, so we can return an instance of FSStream
  7684. stream = Object.assign(new FS.FSStream(), stream);
  7685. if (fd == -1) {
  7686. fd = FS.nextfd();
  7687. }
  7688. stream.fd = fd;
  7689. FS.streams[fd] = stream;
  7690. return stream;
  7691. },
  7692. closeStream: fd => {
  7693. FS.streams[fd] = null;
  7694. },
  7695. chrdev_stream_ops: {
  7696. open: stream => {
  7697. var device = FS.getDevice(stream.node.rdev);
  7698. // override node's stream ops with the device's
  7699. stream.stream_ops = device.stream_ops;
  7700. // forward the open call
  7701. if (stream.stream_ops.open) {
  7702. stream.stream_ops.open(stream);
  7703. }
  7704. },
  7705. llseek: () => {
  7706. throw new FS.ErrnoError(70);
  7707. }
  7708. },
  7709. major: dev => dev >> 8,
  7710. minor: dev => dev & 0xff,
  7711. makedev: (ma, mi) => (ma << 8) | mi,
  7712. registerDevice: (dev, ops) => {
  7713. FS.devices[dev] = { stream_ops: ops };
  7714. },
  7715. getDevice: dev => FS.devices[dev],
  7716. getMounts: mount => {
  7717. var mounts = [];
  7718. var check = [mount];
  7719. while (check.length) {
  7720. var m = check.pop();
  7721. mounts.push(m);
  7722. check.push.apply(check, m.mounts);
  7723. }
  7724. return mounts;
  7725. },
  7726. syncfs: (populate, callback) => {
  7727. if (typeof populate == "function") {
  7728. callback = populate;
  7729. populate = false;
  7730. }
  7731. FS.syncFSRequests++;
  7732. if (FS.syncFSRequests > 1) {
  7733. err(
  7734. `warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`
  7735. );
  7736. }
  7737. var mounts = FS.getMounts(FS.root.mount);
  7738. var completed = 0;
  7739. function doCallback(errCode) {
  7740. FS.syncFSRequests--;
  7741. return callback(errCode);
  7742. }
  7743. function done(errCode) {
  7744. if (errCode) {
  7745. if (!done.errored) {
  7746. done.errored = true;
  7747. return doCallback(errCode);
  7748. }
  7749. return;
  7750. }
  7751. if (++completed >= mounts.length) {
  7752. doCallback(null);
  7753. }
  7754. }
  7755. // sync all mounts
  7756. mounts.forEach(mount => {
  7757. if (!mount.type.syncfs) {
  7758. return done(null);
  7759. }
  7760. mount.type.syncfs(mount, populate, done);
  7761. });
  7762. },
  7763. mount: (type, opts, mountpoint) => {
  7764. var root = mountpoint === "/";
  7765. var pseudo = !mountpoint;
  7766. var node;
  7767. if (root && FS.root) {
  7768. throw new FS.ErrnoError(10);
  7769. } else if (!root && !pseudo) {
  7770. var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
  7771. mountpoint = lookup.path; // use the absolute path
  7772. node = lookup.node;
  7773. if (FS.isMountpoint(node)) {
  7774. throw new FS.ErrnoError(10);
  7775. }
  7776. if (!FS.isDir(node.mode)) {
  7777. throw new FS.ErrnoError(54);
  7778. }
  7779. }
  7780. var mount = {
  7781. type,
  7782. opts,
  7783. mountpoint,
  7784. mounts: []
  7785. };
  7786. // create a root node for the fs
  7787. var mountRoot = type.mount(mount);
  7788. mountRoot.mount = mount;
  7789. mount.root = mountRoot;
  7790. if (root) {
  7791. FS.root = mountRoot;
  7792. } else if (node) {
  7793. // set as a mountpoint
  7794. node.mounted = mount;
  7795. // add the new mount to the current mount's children
  7796. if (node.mount) {
  7797. node.mount.mounts.push(mount);
  7798. }
  7799. }
  7800. return mountRoot;
  7801. },
  7802. unmount: mountpoint => {
  7803. var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
  7804. if (!FS.isMountpoint(lookup.node)) {
  7805. throw new FS.ErrnoError(28);
  7806. }
  7807. // destroy the nodes for this mount, and all its child mounts
  7808. var node = lookup.node;
  7809. var mount = node.mounted;
  7810. var mounts = FS.getMounts(mount);
  7811. Object.keys(FS.nameTable).forEach(hash => {
  7812. var current = FS.nameTable[hash];
  7813. while (current) {
  7814. var next = current.name_next;
  7815. if (mounts.includes(current.mount)) {
  7816. FS.destroyNode(current);
  7817. }
  7818. current = next;
  7819. }
  7820. });
  7821. // no longer a mountpoint
  7822. node.mounted = null;
  7823. // remove this mount from the child mounts
  7824. var idx = node.mount.mounts.indexOf(mount);
  7825. node.mount.mounts.splice(idx, 1);
  7826. },
  7827. lookup: (parent, name) => {
  7828. return parent.node_ops.lookup(parent, name);
  7829. },
  7830. mknod: (path, mode, dev) => {
  7831. var lookup = FS.lookupPath(path, { parent: true });
  7832. var parent = lookup.node;
  7833. var name = PATH.basename(path);
  7834. if (!name || name === "." || name === "..") {
  7835. throw new FS.ErrnoError(28);
  7836. }
  7837. var errCode = FS.mayCreate(parent, name);
  7838. if (errCode) {
  7839. throw new FS.ErrnoError(errCode);
  7840. }
  7841. if (!parent.node_ops.mknod) {
  7842. throw new FS.ErrnoError(63);
  7843. }
  7844. return parent.node_ops.mknod(parent, name, mode, dev);
  7845. },
  7846. create: (path, mode) => {
  7847. mode = mode !== undefined ? mode : 438 /* 0666 */;
  7848. mode &= 4095;
  7849. mode |= 32768;
  7850. return FS.mknod(path, mode, 0);
  7851. },
  7852. mkdir: (path, mode) => {
  7853. mode = mode !== undefined ? mode : 511 /* 0777 */;
  7854. mode &= 511 | 512;
  7855. mode |= 16384;
  7856. return FS.mknod(path, mode, 0);
  7857. },
  7858. mkdirTree: (path, mode) => {
  7859. var dirs = path.split("/");
  7860. var d = "";
  7861. for (var i = 0; i < dirs.length; ++i) {
  7862. if (!dirs[i]) continue;
  7863. d += "/" + dirs[i];
  7864. try {
  7865. FS.mkdir(d, mode);
  7866. } catch (e) {
  7867. if (e.errno != 20) throw e;
  7868. }
  7869. }
  7870. },
  7871. mkdev: (path, mode, dev) => {
  7872. if (typeof dev == "undefined") {
  7873. dev = mode;
  7874. mode = 438 /* 0666 */;
  7875. }
  7876. mode |= 8192;
  7877. return FS.mknod(path, mode, dev);
  7878. },
  7879. symlink: (oldpath, newpath) => {
  7880. if (!PATH_FS.resolve(oldpath)) {
  7881. throw new FS.ErrnoError(44);
  7882. }
  7883. var lookup = FS.lookupPath(newpath, { parent: true });
  7884. var parent = lookup.node;
  7885. if (!parent) {
  7886. throw new FS.ErrnoError(44);
  7887. }
  7888. var newname = PATH.basename(newpath);
  7889. var errCode = FS.mayCreate(parent, newname);
  7890. if (errCode) {
  7891. throw new FS.ErrnoError(errCode);
  7892. }
  7893. if (!parent.node_ops.symlink) {
  7894. throw new FS.ErrnoError(63);
  7895. }
  7896. return parent.node_ops.symlink(parent, newname, oldpath);
  7897. },
  7898. rename: (old_path, new_path) => {
  7899. var old_dirname = PATH.dirname(old_path);
  7900. var new_dirname = PATH.dirname(new_path);
  7901. var old_name = PATH.basename(old_path);
  7902. var new_name = PATH.basename(new_path);
  7903. // parents must exist
  7904. var lookup, old_dir, new_dir;
  7905. // let the errors from non existant directories percolate up
  7906. lookup = FS.lookupPath(old_path, { parent: true });
  7907. old_dir = lookup.node;
  7908. lookup = FS.lookupPath(new_path, { parent: true });
  7909. new_dir = lookup.node;
  7910. if (!old_dir || !new_dir) throw new FS.ErrnoError(44);
  7911. // need to be part of the same mount
  7912. if (old_dir.mount !== new_dir.mount) {
  7913. throw new FS.ErrnoError(75);
  7914. }
  7915. // source must exist
  7916. var old_node = FS.lookupNode(old_dir, old_name);
  7917. // old path should not be an ancestor of the new path
  7918. var relative = PATH_FS.relative(old_path, new_dirname);
  7919. if (relative.charAt(0) !== ".") {
  7920. throw new FS.ErrnoError(28);
  7921. }
  7922. // new path should not be an ancestor of the old path
  7923. relative = PATH_FS.relative(new_path, old_dirname);
  7924. if (relative.charAt(0) !== ".") {
  7925. throw new FS.ErrnoError(55);
  7926. }
  7927. // see if the new path already exists
  7928. var new_node;
  7929. try {
  7930. new_node = FS.lookupNode(new_dir, new_name);
  7931. } catch (e) {
  7932. // not fatal
  7933. }
  7934. // early out if nothing needs to change
  7935. if (old_node === new_node) {
  7936. return;
  7937. }
  7938. // we'll need to delete the old entry
  7939. var isdir = FS.isDir(old_node.mode);
  7940. var errCode = FS.mayDelete(old_dir, old_name, isdir);
  7941. if (errCode) {
  7942. throw new FS.ErrnoError(errCode);
  7943. }
  7944. // need delete permissions if we'll be overwriting.
  7945. // need create permissions if new doesn't already exist.
  7946. errCode = new_node
  7947. ? FS.mayDelete(new_dir, new_name, isdir)
  7948. : FS.mayCreate(new_dir, new_name);
  7949. if (errCode) {
  7950. throw new FS.ErrnoError(errCode);
  7951. }
  7952. if (!old_dir.node_ops.rename) {
  7953. throw new FS.ErrnoError(63);
  7954. }
  7955. if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
  7956. throw new FS.ErrnoError(10);
  7957. }
  7958. // if we are going to change the parent, check write permissions
  7959. if (new_dir !== old_dir) {
  7960. errCode = FS.nodePermissions(old_dir, "w");
  7961. if (errCode) {
  7962. throw new FS.ErrnoError(errCode);
  7963. }
  7964. }
  7965. // remove the node from the lookup hash
  7966. FS.hashRemoveNode(old_node);
  7967. // do the underlying fs rename
  7968. try {
  7969. old_dir.node_ops.rename(old_node, new_dir, new_name);
  7970. } catch (e) {
  7971. throw e;
  7972. } finally {
  7973. // add the node back to the hash (in case node_ops.rename
  7974. // changed its name)
  7975. FS.hashAddNode(old_node);
  7976. }
  7977. },
  7978. rmdir: path => {
  7979. var lookup = FS.lookupPath(path, { parent: true });
  7980. var parent = lookup.node;
  7981. var name = PATH.basename(path);
  7982. var node = FS.lookupNode(parent, name);
  7983. var errCode = FS.mayDelete(parent, name, true);
  7984. if (errCode) {
  7985. throw new FS.ErrnoError(errCode);
  7986. }
  7987. if (!parent.node_ops.rmdir) {
  7988. throw new FS.ErrnoError(63);
  7989. }
  7990. if (FS.isMountpoint(node)) {
  7991. throw new FS.ErrnoError(10);
  7992. }
  7993. parent.node_ops.rmdir(parent, name);
  7994. FS.destroyNode(node);
  7995. },
  7996. readdir: path => {
  7997. var lookup = FS.lookupPath(path, { follow: true });
  7998. var node = lookup.node;
  7999. if (!node.node_ops.readdir) {
  8000. throw new FS.ErrnoError(54);
  8001. }
  8002. return node.node_ops.readdir(node);
  8003. },
  8004. unlink: path => {
  8005. var lookup = FS.lookupPath(path, { parent: true });
  8006. var parent = lookup.node;
  8007. if (!parent) {
  8008. throw new FS.ErrnoError(44);
  8009. }
  8010. var name = PATH.basename(path);
  8011. var node = FS.lookupNode(parent, name);
  8012. var errCode = FS.mayDelete(parent, name, false);
  8013. if (errCode) {
  8014. // According to POSIX, we should map EISDIR to EPERM, but
  8015. // we instead do what Linux does (and we must, as we use
  8016. // the musl linux libc).
  8017. throw new FS.ErrnoError(errCode);
  8018. }
  8019. if (!parent.node_ops.unlink) {
  8020. throw new FS.ErrnoError(63);
  8021. }
  8022. if (FS.isMountpoint(node)) {
  8023. throw new FS.ErrnoError(10);
  8024. }
  8025. parent.node_ops.unlink(parent, name);
  8026. FS.destroyNode(node);
  8027. },
  8028. readlink: path => {
  8029. var lookup = FS.lookupPath(path);
  8030. var link = lookup.node;
  8031. if (!link) {
  8032. throw new FS.ErrnoError(44);
  8033. }
  8034. if (!link.node_ops.readlink) {
  8035. throw new FS.ErrnoError(28);
  8036. }
  8037. return PATH_FS.resolve(
  8038. FS.getPath(link.parent),
  8039. link.node_ops.readlink(link)
  8040. );
  8041. },
  8042. stat: (path, dontFollow) => {
  8043. var lookup = FS.lookupPath(path, { follow: !dontFollow });
  8044. var node = lookup.node;
  8045. if (!node) {
  8046. throw new FS.ErrnoError(44);
  8047. }
  8048. if (!node.node_ops.getattr) {
  8049. throw new FS.ErrnoError(63);
  8050. }
  8051. return node.node_ops.getattr(node);
  8052. },
  8053. lstat: path => {
  8054. return FS.stat(path, true);
  8055. },
  8056. chmod: (path, mode, dontFollow) => {
  8057. var node;
  8058. if (typeof path == "string") {
  8059. var lookup = FS.lookupPath(path, { follow: !dontFollow });
  8060. node = lookup.node;
  8061. } else {
  8062. node = path;
  8063. }
  8064. if (!node.node_ops.setattr) {
  8065. throw new FS.ErrnoError(63);
  8066. }
  8067. node.node_ops.setattr(node, {
  8068. mode: (mode & 4095) | (node.mode & ~4095),
  8069. timestamp: Date.now()
  8070. });
  8071. },
  8072. lchmod: (path, mode) => {
  8073. FS.chmod(path, mode, true);
  8074. },
  8075. fchmod: (fd, mode) => {
  8076. var stream = FS.getStreamChecked(fd);
  8077. FS.chmod(stream.node, mode);
  8078. },
  8079. chown: (path, uid, gid, dontFollow) => {
  8080. var node;
  8081. if (typeof path == "string") {
  8082. var lookup = FS.lookupPath(path, { follow: !dontFollow });
  8083. node = lookup.node;
  8084. } else {
  8085. node = path;
  8086. }
  8087. if (!node.node_ops.setattr) {
  8088. throw new FS.ErrnoError(63);
  8089. }
  8090. node.node_ops.setattr(node, {
  8091. timestamp: Date.now()
  8092. // we ignore the uid / gid for now
  8093. });
  8094. },
  8095. lchown: (path, uid, gid) => {
  8096. FS.chown(path, uid, gid, true);
  8097. },
  8098. fchown: (fd, uid, gid) => {
  8099. var stream = FS.getStreamChecked(fd);
  8100. FS.chown(stream.node, uid, gid);
  8101. },
  8102. truncate: (path, len) => {
  8103. if (len < 0) {
  8104. throw new FS.ErrnoError(28);
  8105. }
  8106. var node;
  8107. if (typeof path == "string") {
  8108. var lookup = FS.lookupPath(path, { follow: true });
  8109. node = lookup.node;
  8110. } else {
  8111. node = path;
  8112. }
  8113. if (!node.node_ops.setattr) {
  8114. throw new FS.ErrnoError(63);
  8115. }
  8116. if (FS.isDir(node.mode)) {
  8117. throw new FS.ErrnoError(31);
  8118. }
  8119. if (!FS.isFile(node.mode)) {
  8120. throw new FS.ErrnoError(28);
  8121. }
  8122. var errCode = FS.nodePermissions(node, "w");
  8123. if (errCode) {
  8124. throw new FS.ErrnoError(errCode);
  8125. }
  8126. node.node_ops.setattr(node, {
  8127. size: len,
  8128. timestamp: Date.now()
  8129. });
  8130. },
  8131. ftruncate: (fd, len) => {
  8132. var stream = FS.getStreamChecked(fd);
  8133. if ((stream.flags & 2097155) === 0) {
  8134. throw new FS.ErrnoError(28);
  8135. }
  8136. FS.truncate(stream.node, len);
  8137. },
  8138. utime: (path, atime, mtime) => {
  8139. var lookup = FS.lookupPath(path, { follow: true });
  8140. var node = lookup.node;
  8141. node.node_ops.setattr(node, {
  8142. timestamp: Math.max(atime, mtime)
  8143. });
  8144. },
  8145. open: (path, flags, mode) => {
  8146. if (path === "") {
  8147. throw new FS.ErrnoError(44);
  8148. }
  8149. flags = typeof flags == "string" ? FS_modeStringToFlags(flags) : flags;
  8150. mode = typeof mode == "undefined" ? 438 /* 0666 */ : mode;
  8151. if (flags & 64) {
  8152. mode = (mode & 4095) | 32768;
  8153. } else {
  8154. mode = 0;
  8155. }
  8156. var node;
  8157. if (typeof path == "object") {
  8158. node = path;
  8159. } else {
  8160. path = PATH.normalize(path);
  8161. try {
  8162. var lookup = FS.lookupPath(path, {
  8163. follow: !(flags & 131072)
  8164. });
  8165. node = lookup.node;
  8166. } catch (e) {
  8167. // ignore
  8168. }
  8169. }
  8170. // perhaps we need to create the node
  8171. var created = false;
  8172. if (flags & 64) {
  8173. if (node) {
  8174. // if O_CREAT and O_EXCL are set, error out if the node already exists
  8175. if (flags & 128) {
  8176. throw new FS.ErrnoError(20);
  8177. }
  8178. } else {
  8179. // node doesn't exist, try to create it
  8180. node = FS.mknod(path, mode, 0);
  8181. created = true;
  8182. }
  8183. }
  8184. if (!node) {
  8185. throw new FS.ErrnoError(44);
  8186. }
  8187. // can't truncate a device
  8188. if (FS.isChrdev(node.mode)) {
  8189. flags &= ~512;
  8190. }
  8191. // if asked only for a directory, then this must be one
  8192. if (flags & 65536 && !FS.isDir(node.mode)) {
  8193. throw new FS.ErrnoError(54);
  8194. }
  8195. // check permissions, if this is not a file we just created now (it is ok to
  8196. // create and write to a file with read-only permissions; it is read-only
  8197. // for later use)
  8198. if (!created) {
  8199. var errCode = FS.mayOpen(node, flags);
  8200. if (errCode) {
  8201. throw new FS.ErrnoError(errCode);
  8202. }
  8203. }
  8204. // do truncation if necessary
  8205. if (flags & 512 && !created) {
  8206. FS.truncate(node, 0);
  8207. }
  8208. // we've already handled these, don't pass down to the underlying vfs
  8209. flags &= ~(128 | 512 | 131072);
  8210. // register the stream with the filesystem
  8211. var stream = FS.createStream({
  8212. node,
  8213. path: FS.getPath(node), // we want the absolute path to the node
  8214. flags,
  8215. seekable: true,
  8216. position: 0,
  8217. stream_ops: node.stream_ops,
  8218. // used by the file family libc calls (fopen, fwrite, ferror, etc.)
  8219. ungotten: [],
  8220. error: false
  8221. });
  8222. // call the new stream's open function
  8223. if (stream.stream_ops.open) {
  8224. stream.stream_ops.open(stream);
  8225. }
  8226. if (Module["logReadFiles"] && !(flags & 1)) {
  8227. if (!FS.readFiles) FS.readFiles = {};
  8228. if (!(path in FS.readFiles)) {
  8229. FS.readFiles[path] = 1;
  8230. }
  8231. }
  8232. return stream;
  8233. },
  8234. close: stream => {
  8235. if (FS.isClosed(stream)) {
  8236. throw new FS.ErrnoError(8);
  8237. }
  8238. if (stream.getdents) stream.getdents = null; // free readdir state
  8239. try {
  8240. if (stream.stream_ops.close) {
  8241. stream.stream_ops.close(stream);
  8242. }
  8243. } catch (e) {
  8244. throw e;
  8245. } finally {
  8246. FS.closeStream(stream.fd);
  8247. }
  8248. stream.fd = null;
  8249. },
  8250. isClosed: stream => {
  8251. return stream.fd === null;
  8252. },
  8253. llseek: (stream, offset, whence) => {
  8254. if (FS.isClosed(stream)) {
  8255. throw new FS.ErrnoError(8);
  8256. }
  8257. if (!stream.seekable || !stream.stream_ops.llseek) {
  8258. throw new FS.ErrnoError(70);
  8259. }
  8260. if (whence != 0 && whence != 1 && whence != 2) {
  8261. throw new FS.ErrnoError(28);
  8262. }
  8263. stream.position = stream.stream_ops.llseek(stream, offset, whence);
  8264. stream.ungotten = [];
  8265. return stream.position;
  8266. },
  8267. read: (stream, buffer, offset, length, position) => {
  8268. if (length < 0 || position < 0) {
  8269. throw new FS.ErrnoError(28);
  8270. }
  8271. if (FS.isClosed(stream)) {
  8272. throw new FS.ErrnoError(8);
  8273. }
  8274. if ((stream.flags & 2097155) === 1) {
  8275. throw new FS.ErrnoError(8);
  8276. }
  8277. if (FS.isDir(stream.node.mode)) {
  8278. throw new FS.ErrnoError(31);
  8279. }
  8280. if (!stream.stream_ops.read) {
  8281. throw new FS.ErrnoError(28);
  8282. }
  8283. var seeking = typeof position != "undefined";
  8284. if (!seeking) {
  8285. position = stream.position;
  8286. } else if (!stream.seekable) {
  8287. throw new FS.ErrnoError(70);
  8288. }
  8289. var bytesRead = stream.stream_ops.read(
  8290. stream,
  8291. buffer,
  8292. offset,
  8293. length,
  8294. position
  8295. );
  8296. if (!seeking) stream.position += bytesRead;
  8297. return bytesRead;
  8298. },
  8299. write: (stream, buffer, offset, length, position, canOwn) => {
  8300. if (length < 0 || position < 0) {
  8301. throw new FS.ErrnoError(28);
  8302. }
  8303. if (FS.isClosed(stream)) {
  8304. throw new FS.ErrnoError(8);
  8305. }
  8306. if ((stream.flags & 2097155) === 0) {
  8307. throw new FS.ErrnoError(8);
  8308. }
  8309. if (FS.isDir(stream.node.mode)) {
  8310. throw new FS.ErrnoError(31);
  8311. }
  8312. if (!stream.stream_ops.write) {
  8313. throw new FS.ErrnoError(28);
  8314. }
  8315. if (stream.seekable && stream.flags & 1024) {
  8316. // seek to the end before writing in append mode
  8317. FS.llseek(stream, 0, 2);
  8318. }
  8319. var seeking = typeof position != "undefined";
  8320. if (!seeking) {
  8321. position = stream.position;
  8322. } else if (!stream.seekable) {
  8323. throw new FS.ErrnoError(70);
  8324. }
  8325. var bytesWritten = stream.stream_ops.write(
  8326. stream,
  8327. buffer,
  8328. offset,
  8329. length,
  8330. position,
  8331. canOwn
  8332. );
  8333. if (!seeking) stream.position += bytesWritten;
  8334. return bytesWritten;
  8335. },
  8336. allocate: (stream, offset, length) => {
  8337. if (FS.isClosed(stream)) {
  8338. throw new FS.ErrnoError(8);
  8339. }
  8340. if (offset < 0 || length <= 0) {
  8341. throw new FS.ErrnoError(28);
  8342. }
  8343. if ((stream.flags & 2097155) === 0) {
  8344. throw new FS.ErrnoError(8);
  8345. }
  8346. if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) {
  8347. throw new FS.ErrnoError(43);
  8348. }
  8349. if (!stream.stream_ops.allocate) {
  8350. throw new FS.ErrnoError(138);
  8351. }
  8352. stream.stream_ops.allocate(stream, offset, length);
  8353. },
  8354. mmap: (stream, length, position, prot, flags) => {
  8355. // User requests writing to file (prot & PROT_WRITE != 0).
  8356. // Checking if we have permissions to write to the file unless
  8357. // MAP_PRIVATE flag is set. According to POSIX spec it is possible
  8358. // to write to file opened in read-only mode with MAP_PRIVATE flag,
  8359. // as all modifications will be visible only in the memory of
  8360. // the current process.
  8361. if (
  8362. (prot & 2) !== 0 &&
  8363. (flags & 2) === 0 &&
  8364. (stream.flags & 2097155) !== 2
  8365. ) {
  8366. throw new FS.ErrnoError(2);
  8367. }
  8368. if ((stream.flags & 2097155) === 1) {
  8369. throw new FS.ErrnoError(2);
  8370. }
  8371. if (!stream.stream_ops.mmap) {
  8372. throw new FS.ErrnoError(43);
  8373. }
  8374. return stream.stream_ops.mmap(stream, length, position, prot, flags);
  8375. },
  8376. msync: (stream, buffer, offset, length, mmapFlags) => {
  8377. if (!stream.stream_ops.msync) {
  8378. return 0;
  8379. }
  8380. return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags);
  8381. },
  8382. munmap: stream => 0,
  8383. ioctl: (stream, cmd, arg) => {
  8384. if (!stream.stream_ops.ioctl) {
  8385. throw new FS.ErrnoError(59);
  8386. }
  8387. return stream.stream_ops.ioctl(stream, cmd, arg);
  8388. },
  8389. readFile: (path, opts = {}) => {
  8390. opts.flags = opts.flags || 0;
  8391. opts.encoding = opts.encoding || "binary";
  8392. if (opts.encoding !== "utf8" && opts.encoding !== "binary") {
  8393. throw new Error(`Invalid encoding type "${opts.encoding}"`);
  8394. }
  8395. var ret;
  8396. var stream = FS.open(path, opts.flags);
  8397. var stat = FS.stat(path);
  8398. var length = stat.size;
  8399. var buf = new Uint8Array(length);
  8400. FS.read(stream, buf, 0, length, 0);
  8401. if (opts.encoding === "utf8") {
  8402. ret = UTF8ArrayToString(buf, 0);
  8403. } else if (opts.encoding === "binary") {
  8404. ret = buf;
  8405. }
  8406. FS.close(stream);
  8407. return ret;
  8408. },
  8409. writeFile: (path, data, opts = {}) => {
  8410. opts.flags = opts.flags || 577;
  8411. var stream = FS.open(path, opts.flags, opts.mode);
  8412. if (typeof data == "string") {
  8413. var buf = new Uint8Array(lengthBytesUTF8(data) + 1);
  8414. var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length);
  8415. FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn);
  8416. } else if (ArrayBuffer.isView(data)) {
  8417. FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn);
  8418. } else {
  8419. throw new Error("Unsupported data type");
  8420. }
  8421. FS.close(stream);
  8422. },
  8423. cwd: () => FS.currentPath,
  8424. chdir: path => {
  8425. var lookup = FS.lookupPath(path, { follow: true });
  8426. if (lookup.node === null) {
  8427. throw new FS.ErrnoError(44);
  8428. }
  8429. if (!FS.isDir(lookup.node.mode)) {
  8430. throw new FS.ErrnoError(54);
  8431. }
  8432. var errCode = FS.nodePermissions(lookup.node, "x");
  8433. if (errCode) {
  8434. throw new FS.ErrnoError(errCode);
  8435. }
  8436. FS.currentPath = lookup.path;
  8437. },
  8438. createDefaultDirectories: () => {
  8439. FS.mkdir("/tmp");
  8440. FS.mkdir("/home");
  8441. FS.mkdir("/home/web_user");
  8442. },
  8443. createDefaultDevices: () => {
  8444. // create /dev
  8445. FS.mkdir("/dev");
  8446. // setup /dev/null
  8447. FS.registerDevice(FS.makedev(1, 3), {
  8448. read: () => 0,
  8449. write: (stream, buffer, offset, length, pos) => length
  8450. });
  8451. FS.mkdev("/dev/null", FS.makedev(1, 3));
  8452. // setup /dev/tty and /dev/tty1
  8453. // stderr needs to print output using err() rather than out()
  8454. // so we register a second tty just for it.
  8455. TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
  8456. TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
  8457. FS.mkdev("/dev/tty", FS.makedev(5, 0));
  8458. FS.mkdev("/dev/tty1", FS.makedev(6, 0));
  8459. // setup /dev/[u]random
  8460. // use a buffer to avoid overhead of individual crypto calls per byte
  8461. var randomBuffer = new Uint8Array(1024),
  8462. randomLeft = 0;
  8463. var randomByte = () => {
  8464. if (randomLeft === 0) {
  8465. randomLeft = randomFill(randomBuffer).byteLength;
  8466. }
  8467. return randomBuffer[--randomLeft];
  8468. };
  8469. FS.createDevice("/dev", "random", randomByte);
  8470. FS.createDevice("/dev", "urandom", randomByte);
  8471. // we're not going to emulate the actual shm device,
  8472. // just create the tmp dirs that reside in it commonly
  8473. FS.mkdir("/dev/shm");
  8474. FS.mkdir("/dev/shm/tmp");
  8475. },
  8476. createSpecialDirectories: () => {
  8477. // create /proc/self/fd which allows /proc/self/fd/6 => readlink gives the
  8478. // name of the stream for fd 6 (see test_unistd_ttyname)
  8479. FS.mkdir("/proc");
  8480. var proc_self = FS.mkdir("/proc/self");
  8481. FS.mkdir("/proc/self/fd");
  8482. FS.mount(
  8483. {
  8484. mount: () => {
  8485. var node = FS.createNode(proc_self, "fd", 16384 | 511 /* 0777 */, 73);
  8486. node.node_ops = {
  8487. lookup: (parent, name) => {
  8488. var fd = +name;
  8489. var stream = FS.getStreamChecked(fd);
  8490. var ret = {
  8491. parent: null,
  8492. mount: { mountpoint: "fake" },
  8493. node_ops: { readlink: () => stream.path }
  8494. };
  8495. ret.parent = ret; // make it look like a simple root node
  8496. return ret;
  8497. }
  8498. };
  8499. return node;
  8500. }
  8501. },
  8502. {},
  8503. "/proc/self/fd"
  8504. );
  8505. },
  8506. createStandardStreams: () => {
  8507. // TODO deprecate the old functionality of a single
  8508. // input / output callback and that utilizes FS.createDevice
  8509. // and instead require a unique set of stream ops
  8510. // by default, we symlink the standard streams to the
  8511. // default tty devices. however, if the standard streams
  8512. // have been overwritten we create a unique device for
  8513. // them instead.
  8514. if (Module["stdin"]) {
  8515. FS.createDevice("/dev", "stdin", Module["stdin"]);
  8516. } else {
  8517. FS.symlink("/dev/tty", "/dev/stdin");
  8518. }
  8519. if (Module["stdout"]) {
  8520. FS.createDevice("/dev", "stdout", null, Module["stdout"]);
  8521. } else {
  8522. FS.symlink("/dev/tty", "/dev/stdout");
  8523. }
  8524. if (Module["stderr"]) {
  8525. FS.createDevice("/dev", "stderr", null, Module["stderr"]);
  8526. } else {
  8527. FS.symlink("/dev/tty1", "/dev/stderr");
  8528. }
  8529. // open default streams for the stdin, stdout and stderr devices
  8530. var stdin = FS.open("/dev/stdin", 0);
  8531. var stdout = FS.open("/dev/stdout", 1);
  8532. var stderr = FS.open("/dev/stderr", 1);
  8533. },
  8534. ensureErrnoError: () => {
  8535. if (FS.ErrnoError) return;
  8536. FS.ErrnoError = /** @this{Object} */ function ErrnoError(errno, node) {
  8537. // We set the `name` property to be able to identify `FS.ErrnoError`
  8538. // - the `name` is a standard ECMA-262 property of error objects. Kind of good to have it anyway.
  8539. // - when using PROXYFS, an error can come from an underlying FS
  8540. // as different FS objects have their own FS.ErrnoError each,
  8541. // the test `err instanceof FS.ErrnoError` won't detect an error coming from another filesystem, causing bugs.
  8542. // we'll use the reliable test `err.name == "ErrnoError"` instead
  8543. this.name = "ErrnoError";
  8544. this.node = node;
  8545. this.setErrno = /** @this{Object} */ function (errno) {
  8546. this.errno = errno;
  8547. };
  8548. this.setErrno(errno);
  8549. this.message = "FS error";
  8550. };
  8551. FS.ErrnoError.prototype = new Error();
  8552. FS.ErrnoError.prototype.constructor = FS.ErrnoError;
  8553. // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)
  8554. [44].forEach(code => {
  8555. FS.genericErrors[code] = new FS.ErrnoError(code);
  8556. FS.genericErrors[code].stack = "<generic error, no stack>";
  8557. });
  8558. },
  8559. staticInit: () => {
  8560. FS.ensureErrnoError();
  8561. FS.nameTable = new Array(4096);
  8562. FS.mount(MEMFS, {}, "/");
  8563. FS.createDefaultDirectories();
  8564. FS.createDefaultDevices();
  8565. FS.createSpecialDirectories();
  8566. FS.filesystems = {
  8567. MEMFS: MEMFS,
  8568. WORKERFS: WORKERFS
  8569. };
  8570. },
  8571. init: (input, output, error) => {
  8572. FS.init.initialized = true;
  8573. FS.ensureErrnoError();
  8574. // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here
  8575. Module["stdin"] = input || Module["stdin"];
  8576. Module["stdout"] = output || Module["stdout"];
  8577. Module["stderr"] = error || Module["stderr"];
  8578. FS.createStandardStreams();
  8579. },
  8580. quit: () => {
  8581. FS.init.initialized = false;
  8582. // force-flush all streams, so we get musl std streams printed out
  8583. // close all of our streams
  8584. for (var i = 0; i < FS.streams.length; i++) {
  8585. var stream = FS.streams[i];
  8586. if (!stream) {
  8587. continue;
  8588. }
  8589. FS.close(stream);
  8590. }
  8591. },
  8592. findObject: (path, dontResolveLastLink) => {
  8593. var ret = FS.analyzePath(path, dontResolveLastLink);
  8594. if (!ret.exists) {
  8595. return null;
  8596. }
  8597. return ret.object;
  8598. },
  8599. analyzePath: (path, dontResolveLastLink) => {
  8600. // operate from within the context of the symlink's target
  8601. try {
  8602. var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
  8603. path = lookup.path;
  8604. } catch (e) {}
  8605. var ret = {
  8606. isRoot: false,
  8607. exists: false,
  8608. error: 0,
  8609. name: null,
  8610. path: null,
  8611. object: null,
  8612. parentExists: false,
  8613. parentPath: null,
  8614. parentObject: null
  8615. };
  8616. try {
  8617. var lookup = FS.lookupPath(path, { parent: true });
  8618. ret.parentExists = true;
  8619. ret.parentPath = lookup.path;
  8620. ret.parentObject = lookup.node;
  8621. ret.name = PATH.basename(path);
  8622. lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
  8623. ret.exists = true;
  8624. ret.path = lookup.path;
  8625. ret.object = lookup.node;
  8626. ret.name = lookup.node.name;
  8627. ret.isRoot = lookup.path === "/";
  8628. } catch (e) {
  8629. ret.error = e.errno;
  8630. }
  8631. return ret;
  8632. },
  8633. createPath: (parent, path, canRead, canWrite) => {
  8634. parent = typeof parent == "string" ? parent : FS.getPath(parent);
  8635. var parts = path.split("/").reverse();
  8636. while (parts.length) {
  8637. var part = parts.pop();
  8638. if (!part) continue;
  8639. var current = PATH.join2(parent, part);
  8640. try {
  8641. FS.mkdir(current);
  8642. } catch (e) {
  8643. // ignore EEXIST
  8644. }
  8645. parent = current;
  8646. }
  8647. return current;
  8648. },
  8649. createFile: (parent, name, properties, canRead, canWrite) => {
  8650. var path = PATH.join2(
  8651. typeof parent == "string" ? parent : FS.getPath(parent),
  8652. name
  8653. );
  8654. var mode = FS_getMode(canRead, canWrite);
  8655. return FS.create(path, mode);
  8656. },
  8657. createDataFile: (parent, name, data, canRead, canWrite, canOwn) => {
  8658. var path = name;
  8659. if (parent) {
  8660. parent = typeof parent == "string" ? parent : FS.getPath(parent);
  8661. path = name ? PATH.join2(parent, name) : parent;
  8662. }
  8663. var mode = FS_getMode(canRead, canWrite);
  8664. var node = FS.create(path, mode);
  8665. if (data) {
  8666. if (typeof data == "string") {
  8667. var arr = new Array(data.length);
  8668. for (var i = 0, len = data.length; i < len; ++i)
  8669. arr[i] = data.charCodeAt(i);
  8670. data = arr;
  8671. }
  8672. // make sure we can write to the file
  8673. FS.chmod(node, mode | 146);
  8674. var stream = FS.open(node, 577);
  8675. FS.write(stream, data, 0, data.length, 0, canOwn);
  8676. FS.close(stream);
  8677. FS.chmod(node, mode);
  8678. }
  8679. return node;
  8680. },
  8681. createDevice: (parent, name, input, output) => {
  8682. var path = PATH.join2(
  8683. typeof parent == "string" ? parent : FS.getPath(parent),
  8684. name
  8685. );
  8686. var mode = FS_getMode(!!input, !!output);
  8687. if (!FS.createDevice.major) FS.createDevice.major = 64;
  8688. var dev = FS.makedev(FS.createDevice.major++, 0);
  8689. // Create a fake device that a set of stream ops to emulate
  8690. // the old behavior.
  8691. FS.registerDevice(dev, {
  8692. open: stream => {
  8693. stream.seekable = false;
  8694. },
  8695. close: stream => {
  8696. // flush any pending line data
  8697. if (output && output.buffer && output.buffer.length) {
  8698. output(10);
  8699. }
  8700. },
  8701. read: (stream, buffer, offset, length, pos /* ignored */) => {
  8702. var bytesRead = 0;
  8703. for (var i = 0; i < length; i++) {
  8704. var result;
  8705. try {
  8706. result = input();
  8707. } catch (e) {
  8708. throw new FS.ErrnoError(29);
  8709. }
  8710. if (result === undefined && bytesRead === 0) {
  8711. throw new FS.ErrnoError(6);
  8712. }
  8713. if (result === null || result === undefined) break;
  8714. bytesRead++;
  8715. buffer[offset + i] = result;
  8716. }
  8717. if (bytesRead) {
  8718. stream.node.timestamp = Date.now();
  8719. }
  8720. return bytesRead;
  8721. },
  8722. write: (stream, buffer, offset, length, pos) => {
  8723. for (var i = 0; i < length; i++) {
  8724. try {
  8725. output(buffer[offset + i]);
  8726. } catch (e) {
  8727. throw new FS.ErrnoError(29);
  8728. }
  8729. }
  8730. if (length) {
  8731. stream.node.timestamp = Date.now();
  8732. }
  8733. return i;
  8734. }
  8735. });
  8736. return FS.mkdev(path, mode, dev);
  8737. },
  8738. forceLoadFile: obj => {
  8739. if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
  8740. if (typeof XMLHttpRequest != "undefined") {
  8741. throw new Error(
  8742. "Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread."
  8743. );
  8744. } else if (read_) {
  8745. // Command-line.
  8746. try {
  8747. // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as
  8748. // read() will try to parse UTF8.
  8749. obj.contents = intArrayFromString(read_(obj.url), true);
  8750. obj.usedBytes = obj.contents.length;
  8751. } catch (e) {
  8752. throw new FS.ErrnoError(29);
  8753. }
  8754. } else {
  8755. throw new Error("Cannot load without read() or XMLHttpRequest.");
  8756. }
  8757. },
  8758. createLazyFile: (parent, name, url, canRead, canWrite) => {
  8759. // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.
  8760. /** @constructor */
  8761. function LazyUint8Array() {
  8762. this.lengthKnown = false;
  8763. this.chunks = []; // Loaded chunks. Index is the chunk number
  8764. }
  8765. LazyUint8Array.prototype.get =
  8766. /** @this{Object} */ function LazyUint8Array_get(idx) {
  8767. if (idx > this.length - 1 || idx < 0) {
  8768. return undefined;
  8769. }
  8770. var chunkOffset = idx % this.chunkSize;
  8771. var chunkNum = (idx / this.chunkSize) | 0;
  8772. return this.getter(chunkNum)[chunkOffset];
  8773. };
  8774. LazyUint8Array.prototype.setDataGetter =
  8775. function LazyUint8Array_setDataGetter(getter) {
  8776. this.getter = getter;
  8777. };
  8778. LazyUint8Array.prototype.cacheLength =
  8779. function LazyUint8Array_cacheLength() {
  8780. // Find length
  8781. var xhr = new XMLHttpRequest();
  8782. xhr.open("HEAD", url, false);
  8783. xhr.send(null);
  8784. if (!((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304))
  8785. throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
  8786. var datalength = Number(xhr.getResponseHeader("Content-length"));
  8787. var header;
  8788. var hasByteServing =
  8789. (header = xhr.getResponseHeader("Accept-Ranges")) &&
  8790. header === "bytes";
  8791. var usesGzip =
  8792. (header = xhr.getResponseHeader("Content-Encoding")) &&
  8793. header === "gzip";
  8794. var chunkSize = 1024 * 1024; // Chunk size in bytes
  8795. if (!hasByteServing) chunkSize = datalength;
  8796. // Function to get a range from the remote URL.
  8797. var doXHR = (from, to) => {
  8798. if (from > to)
  8799. throw new Error(
  8800. "invalid range (" + from + ", " + to + ") or no bytes requested!"
  8801. );
  8802. if (to > datalength - 1)
  8803. throw new Error(
  8804. "only " + datalength + " bytes available! programmer error!"
  8805. );
  8806. // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
  8807. var xhr = new XMLHttpRequest();
  8808. xhr.open("GET", url, false);
  8809. if (datalength !== chunkSize)
  8810. xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
  8811. // Some hints to the browser that we want binary data.
  8812. xhr.responseType = "arraybuffer";
  8813. if (xhr.overrideMimeType) {
  8814. xhr.overrideMimeType("text/plain; charset=x-user-defined");
  8815. }
  8816. xhr.send(null);
  8817. if (!((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304))
  8818. throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
  8819. if (xhr.response !== undefined) {
  8820. return new Uint8Array(
  8821. /** @type{Array<number>} */ (xhr.response || [])
  8822. );
  8823. }
  8824. return intArrayFromString(xhr.responseText || "", true);
  8825. };
  8826. var lazyArray = this;
  8827. lazyArray.setDataGetter(chunkNum => {
  8828. var start = chunkNum * chunkSize;
  8829. var end = (chunkNum + 1) * chunkSize - 1; // including this byte
  8830. end = Math.min(end, datalength - 1); // if datalength-1 is selected, this is the last block
  8831. if (typeof lazyArray.chunks[chunkNum] == "undefined") {
  8832. lazyArray.chunks[chunkNum] = doXHR(start, end);
  8833. }
  8834. if (typeof lazyArray.chunks[chunkNum] == "undefined")
  8835. throw new Error("doXHR failed!");
  8836. return lazyArray.chunks[chunkNum];
  8837. });
  8838. if (usesGzip || !datalength) {
  8839. // if the server uses gzip or doesn't supply the length, we have to download the whole file to get the (uncompressed) length
  8840. chunkSize = datalength = 1; // this will force getter(0)/doXHR do download the whole file
  8841. datalength = this.getter(0).length;
  8842. chunkSize = datalength;
  8843. out(
  8844. "LazyFiles on gzip forces download of the whole file when length is accessed"
  8845. );
  8846. }
  8847. this._length = datalength;
  8848. this._chunkSize = chunkSize;
  8849. this.lengthKnown = true;
  8850. };
  8851. if (typeof XMLHttpRequest != "undefined") {
  8852. if (!ENVIRONMENT_IS_WORKER)
  8853. throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
  8854. var lazyArray = new LazyUint8Array();
  8855. Object.defineProperties(lazyArray, {
  8856. length: {
  8857. get: /** @this{Object} */ function () {
  8858. if (!this.lengthKnown) {
  8859. this.cacheLength();
  8860. }
  8861. return this._length;
  8862. }
  8863. },
  8864. chunkSize: {
  8865. get: /** @this{Object} */ function () {
  8866. if (!this.lengthKnown) {
  8867. this.cacheLength();
  8868. }
  8869. return this._chunkSize;
  8870. }
  8871. }
  8872. });
  8873. var properties = { isDevice: false, contents: lazyArray };
  8874. } else {
  8875. var properties = { isDevice: false, url: url };
  8876. }
  8877. var node = FS.createFile(parent, name, properties, canRead, canWrite);
  8878. // This is a total hack, but I want to get this lazy file code out of the
  8879. // core of MEMFS. If we want to keep this lazy file concept I feel it should
  8880. // be its own thin LAZYFS proxying calls to MEMFS.
  8881. if (properties.contents) {
  8882. node.contents = properties.contents;
  8883. } else if (properties.url) {
  8884. node.contents = null;
  8885. node.url = properties.url;
  8886. }
  8887. // Add a function that defers querying the file size until it is asked the first time.
  8888. Object.defineProperties(node, {
  8889. usedBytes: {
  8890. get: /** @this {FSNode} */ function () {
  8891. return this.contents.length;
  8892. }
  8893. }
  8894. });
  8895. // override each stream op with one that tries to force load the lazy file first
  8896. var stream_ops = {};
  8897. var keys = Object.keys(node.stream_ops);
  8898. keys.forEach(key => {
  8899. var fn = node.stream_ops[key];
  8900. stream_ops[key] = function forceLoadLazyFile() {
  8901. FS.forceLoadFile(node);
  8902. return fn.apply(null, arguments);
  8903. };
  8904. });
  8905. function writeChunks(stream, buffer, offset, length, position) {
  8906. var contents = stream.node.contents;
  8907. if (position >= contents.length) return 0;
  8908. var size = Math.min(contents.length - position, length);
  8909. if (contents.slice) {
  8910. // normal array
  8911. for (var i = 0; i < size; i++) {
  8912. buffer[offset + i] = contents[position + i];
  8913. }
  8914. } else {
  8915. for (var i = 0; i < size; i++) {
  8916. // LazyUint8Array from sync binary XHR
  8917. buffer[offset + i] = contents.get(position + i);
  8918. }
  8919. }
  8920. return size;
  8921. }
  8922. // use a custom read function
  8923. stream_ops.read = (stream, buffer, offset, length, position) => {
  8924. FS.forceLoadFile(node);
  8925. return writeChunks(stream, buffer, offset, length, position);
  8926. };
  8927. // use a custom mmap function
  8928. stream_ops.mmap = (stream, length, position, prot, flags) => {
  8929. FS.forceLoadFile(node);
  8930. var ptr = mmapAlloc(length);
  8931. if (!ptr) {
  8932. throw new FS.ErrnoError(48);
  8933. }
  8934. writeChunks(stream, HEAP8, ptr, length, position);
  8935. return { ptr, allocated: true };
  8936. };
  8937. node.stream_ops = stream_ops;
  8938. return node;
  8939. }
  8940. };
  8941. /**
  8942. * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
  8943. * emscripten HEAP, returns a copy of that string as a Javascript String object.
  8944. *
  8945. * @param {number} ptr
  8946. * @param {number=} maxBytesToRead - An optional length that specifies the
  8947. * maximum number of bytes to read. You can omit this parameter to scan the
  8948. * string until the first 0 byte. If maxBytesToRead is passed, and the string
  8949. * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
  8950. * string will cut short at that byte index (i.e. maxBytesToRead will not
  8951. * produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing
  8952. * frequent uses of UTF8ToString() with and without maxBytesToRead may throw
  8953. * JS JIT optimizations off, so it is worth to consider consistently using one
  8954. * @return {string}
  8955. */
  8956. var UTF8ToString = (ptr, maxBytesToRead) => {
  8957. return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
  8958. };
  8959. var SYSCALLS = {
  8960. DEFAULT_POLLMASK: 5,
  8961. calculateAt: function (dirfd, path, allowEmpty) {
  8962. if (PATH.isAbs(path)) {
  8963. return path;
  8964. }
  8965. // relative path
  8966. var dir;
  8967. if (dirfd === -100) {
  8968. dir = FS.cwd();
  8969. } else {
  8970. var dirstream = SYSCALLS.getStreamFromFD(dirfd);
  8971. dir = dirstream.path;
  8972. }
  8973. if (path.length == 0) {
  8974. if (!allowEmpty) {
  8975. throw new FS.ErrnoError(44);
  8976. }
  8977. return dir;
  8978. }
  8979. return PATH.join2(dir, path);
  8980. },
  8981. doStat: function (func, path, buf) {
  8982. try {
  8983. var stat = func(path);
  8984. } catch (e) {
  8985. if (
  8986. e &&
  8987. e.node &&
  8988. PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))
  8989. ) {
  8990. // an error occurred while trying to look up the path; we should just report ENOTDIR
  8991. return -54;
  8992. }
  8993. throw e;
  8994. }
  8995. HEAP32[buf >> 2] = stat.dev;
  8996. HEAP32[(buf + 4) >> 2] = stat.mode;
  8997. HEAPU32[(buf + 8) >> 2] = stat.nlink;
  8998. HEAP32[(buf + 12) >> 2] = stat.uid;
  8999. HEAP32[(buf + 16) >> 2] = stat.gid;
  9000. HEAP32[(buf + 20) >> 2] = stat.rdev;
  9001. (tempI64 = [
  9002. stat.size >>> 0,
  9003. ((tempDouble = stat.size),
  9004. +Math.abs(tempDouble) >= 1.0
  9005. ? tempDouble > 0.0
  9006. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9007. : ~~+Math.ceil(
  9008. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9009. ) >>> 0
  9010. : 0)
  9011. ]),
  9012. (HEAP32[(buf + 24) >> 2] = tempI64[0]),
  9013. (HEAP32[(buf + 28) >> 2] = tempI64[1]);
  9014. HEAP32[(buf + 32) >> 2] = 4096;
  9015. HEAP32[(buf + 36) >> 2] = stat.blocks;
  9016. var atime = stat.atime.getTime();
  9017. var mtime = stat.mtime.getTime();
  9018. var ctime = stat.ctime.getTime();
  9019. (tempI64 = [
  9020. Math.floor(atime / 1000) >>> 0,
  9021. ((tempDouble = Math.floor(atime / 1000)),
  9022. +Math.abs(tempDouble) >= 1.0
  9023. ? tempDouble > 0.0
  9024. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9025. : ~~+Math.ceil(
  9026. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9027. ) >>> 0
  9028. : 0)
  9029. ]),
  9030. (HEAP32[(buf + 40) >> 2] = tempI64[0]),
  9031. (HEAP32[(buf + 44) >> 2] = tempI64[1]);
  9032. HEAPU32[(buf + 48) >> 2] = (atime % 1000) * 1000;
  9033. (tempI64 = [
  9034. Math.floor(mtime / 1000) >>> 0,
  9035. ((tempDouble = Math.floor(mtime / 1000)),
  9036. +Math.abs(tempDouble) >= 1.0
  9037. ? tempDouble > 0.0
  9038. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9039. : ~~+Math.ceil(
  9040. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9041. ) >>> 0
  9042. : 0)
  9043. ]),
  9044. (HEAP32[(buf + 56) >> 2] = tempI64[0]),
  9045. (HEAP32[(buf + 60) >> 2] = tempI64[1]);
  9046. HEAPU32[(buf + 64) >> 2] = (mtime % 1000) * 1000;
  9047. (tempI64 = [
  9048. Math.floor(ctime / 1000) >>> 0,
  9049. ((tempDouble = Math.floor(ctime / 1000)),
  9050. +Math.abs(tempDouble) >= 1.0
  9051. ? tempDouble > 0.0
  9052. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9053. : ~~+Math.ceil(
  9054. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9055. ) >>> 0
  9056. : 0)
  9057. ]),
  9058. (HEAP32[(buf + 72) >> 2] = tempI64[0]),
  9059. (HEAP32[(buf + 76) >> 2] = tempI64[1]);
  9060. HEAPU32[(buf + 80) >> 2] = (ctime % 1000) * 1000;
  9061. (tempI64 = [
  9062. stat.ino >>> 0,
  9063. ((tempDouble = stat.ino),
  9064. +Math.abs(tempDouble) >= 1.0
  9065. ? tempDouble > 0.0
  9066. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9067. : ~~+Math.ceil(
  9068. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9069. ) >>> 0
  9070. : 0)
  9071. ]),
  9072. (HEAP32[(buf + 88) >> 2] = tempI64[0]),
  9073. (HEAP32[(buf + 92) >> 2] = tempI64[1]);
  9074. return 0;
  9075. },
  9076. doMsync: function (addr, stream, len, flags, offset) {
  9077. if (!FS.isFile(stream.node.mode)) {
  9078. throw new FS.ErrnoError(43);
  9079. }
  9080. if (flags & 2) {
  9081. // MAP_PRIVATE calls need not to be synced back to underlying fs
  9082. return 0;
  9083. }
  9084. var buffer = HEAPU8.slice(addr, addr + len);
  9085. FS.msync(stream, buffer, offset, len, flags);
  9086. },
  9087. varargs: undefined,
  9088. get() {
  9089. SYSCALLS.varargs += 4;
  9090. var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2];
  9091. return ret;
  9092. },
  9093. getStr(ptr) {
  9094. var ret = UTF8ToString(ptr);
  9095. return ret;
  9096. },
  9097. getStreamFromFD: function (fd) {
  9098. var stream = FS.getStreamChecked(fd);
  9099. return stream;
  9100. }
  9101. };
  9102. function ___syscall_faccessat(dirfd, path, amode, flags) {
  9103. try {
  9104. path = SYSCALLS.getStr(path);
  9105. path = SYSCALLS.calculateAt(dirfd, path);
  9106. if (amode & ~7) {
  9107. // need a valid mode
  9108. return -28;
  9109. }
  9110. var lookup = FS.lookupPath(path, { follow: true });
  9111. var node = lookup.node;
  9112. if (!node) {
  9113. return -44;
  9114. }
  9115. var perms = "";
  9116. if (amode & 4) perms += "r";
  9117. if (amode & 2) perms += "w";
  9118. if (amode & 1) perms += "x";
  9119. if (
  9120. perms /* otherwise, they've just passed F_OK */ &&
  9121. FS.nodePermissions(node, perms)
  9122. ) {
  9123. return -2;
  9124. }
  9125. return 0;
  9126. } catch (e) {
  9127. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9128. return -e.errno;
  9129. }
  9130. }
  9131. var setErrNo = value => {
  9132. HEAP32[___errno_location() >> 2] = value;
  9133. return value;
  9134. };
  9135. function ___syscall_fcntl64(fd, cmd, varargs) {
  9136. SYSCALLS.varargs = varargs;
  9137. try {
  9138. var stream = SYSCALLS.getStreamFromFD(fd);
  9139. switch (cmd) {
  9140. case 0: {
  9141. var arg = SYSCALLS.get();
  9142. if (arg < 0) {
  9143. return -28;
  9144. }
  9145. var newStream;
  9146. newStream = FS.createStream(stream, arg);
  9147. return newStream.fd;
  9148. }
  9149. case 1:
  9150. case 2:
  9151. return 0; // FD_CLOEXEC makes no sense for a single process.
  9152. case 3:
  9153. return stream.flags;
  9154. case 4: {
  9155. var arg = SYSCALLS.get();
  9156. stream.flags |= arg;
  9157. return 0;
  9158. }
  9159. case 5: /* case 5: Currently in musl F_GETLK64 has same value as F_GETLK, so omitted to avoid duplicate case blocks. If that changes, uncomment this */ {
  9160. var arg = SYSCALLS.get();
  9161. var offset = 0;
  9162. // We're always unlocked.
  9163. HEAP16[(arg + offset) >> 1] = 2;
  9164. return 0;
  9165. }
  9166. case 6:
  9167. case 7:
  9168. /* case 6: Currently in musl F_SETLK64 has same value as F_SETLK, so omitted to avoid duplicate case blocks. If that changes, uncomment this */
  9169. /* case 7: Currently in musl F_SETLKW64 has same value as F_SETLKW, so omitted to avoid duplicate case blocks. If that changes, uncomment this */
  9170. return 0; // Pretend that the locking is successful.
  9171. case 16:
  9172. case 8:
  9173. return -28; // These are for sockets. We don't have them fully implemented yet.
  9174. case 9:
  9175. // musl trusts getown return values, due to a bug where they must be, as they overlap with errors. just return -1 here, so fcntl() returns that, and we set errno ourselves.
  9176. setErrNo(28);
  9177. return -1;
  9178. default: {
  9179. return -28;
  9180. }
  9181. }
  9182. } catch (e) {
  9183. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9184. return -e.errno;
  9185. }
  9186. }
  9187. function ___syscall_fstat64(fd, buf) {
  9188. try {
  9189. var stream = SYSCALLS.getStreamFromFD(fd);
  9190. return SYSCALLS.doStat(FS.stat, stream.path, buf);
  9191. } catch (e) {
  9192. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9193. return -e.errno;
  9194. }
  9195. }
  9196. var stringToUTF8 = (str, outPtr, maxBytesToWrite) => {
  9197. return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
  9198. };
  9199. function ___syscall_getdents64(fd, dirp, count) {
  9200. try {
  9201. var stream = SYSCALLS.getStreamFromFD(fd);
  9202. if (!stream.getdents) {
  9203. stream.getdents = FS.readdir(stream.path);
  9204. }
  9205. var struct_size = 280;
  9206. var pos = 0;
  9207. var off = FS.llseek(stream, 0, 1);
  9208. var idx = Math.floor(off / struct_size);
  9209. while (idx < stream.getdents.length && pos + struct_size <= count) {
  9210. var id;
  9211. var type;
  9212. var name = stream.getdents[idx];
  9213. if (name === ".") {
  9214. id = stream.node.id;
  9215. type = 4; // DT_DIR
  9216. } else if (name === "..") {
  9217. var lookup = FS.lookupPath(stream.path, { parent: true });
  9218. id = lookup.node.id;
  9219. type = 4; // DT_DIR
  9220. } else {
  9221. var child = FS.lookupNode(stream.node, name);
  9222. id = child.id;
  9223. type = FS.isChrdev(child.mode)
  9224. ? 2 // DT_CHR, character device.
  9225. : FS.isDir(child.mode)
  9226. ? 4 // DT_DIR, directory.
  9227. : FS.isLink(child.mode)
  9228. ? 10 // DT_LNK, symbolic link.
  9229. : 8; // DT_REG, regular file.
  9230. }
  9231. (tempI64 = [
  9232. id >>> 0,
  9233. ((tempDouble = id),
  9234. +Math.abs(tempDouble) >= 1.0
  9235. ? tempDouble > 0.0
  9236. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9237. : ~~+Math.ceil(
  9238. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9239. ) >>> 0
  9240. : 0)
  9241. ]),
  9242. (HEAP32[(dirp + pos) >> 2] = tempI64[0]),
  9243. (HEAP32[(dirp + pos + 4) >> 2] = tempI64[1]);
  9244. (tempI64 = [
  9245. ((idx + 1) * struct_size) >>> 0,
  9246. ((tempDouble = (idx + 1) * struct_size),
  9247. +Math.abs(tempDouble) >= 1.0
  9248. ? tempDouble > 0.0
  9249. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9250. : ~~+Math.ceil(
  9251. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9252. ) >>> 0
  9253. : 0)
  9254. ]),
  9255. (HEAP32[(dirp + pos + 8) >> 2] = tempI64[0]),
  9256. (HEAP32[(dirp + pos + 12) >> 2] = tempI64[1]);
  9257. HEAP16[(dirp + pos + 16) >> 1] = 280;
  9258. HEAP8[(dirp + pos + 18) >> 0] = type;
  9259. stringToUTF8(name, dirp + pos + 19, 256);
  9260. pos += struct_size;
  9261. idx += 1;
  9262. }
  9263. FS.llseek(stream, idx * struct_size, 0);
  9264. return pos;
  9265. } catch (e) {
  9266. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9267. return -e.errno;
  9268. }
  9269. }
  9270. function ___syscall_lstat64(path, buf) {
  9271. try {
  9272. path = SYSCALLS.getStr(path);
  9273. return SYSCALLS.doStat(FS.lstat, path, buf);
  9274. } catch (e) {
  9275. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9276. return -e.errno;
  9277. }
  9278. }
  9279. function ___syscall_newfstatat(dirfd, path, buf, flags) {
  9280. try {
  9281. path = SYSCALLS.getStr(path);
  9282. var nofollow = flags & 256;
  9283. var allowEmpty = flags & 4096;
  9284. flags = flags & ~6400;
  9285. path = SYSCALLS.calculateAt(dirfd, path, allowEmpty);
  9286. return SYSCALLS.doStat(nofollow ? FS.lstat : FS.stat, path, buf);
  9287. } catch (e) {
  9288. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9289. return -e.errno;
  9290. }
  9291. }
  9292. function ___syscall_openat(dirfd, path, flags, varargs) {
  9293. SYSCALLS.varargs = varargs;
  9294. try {
  9295. path = SYSCALLS.getStr(path);
  9296. path = SYSCALLS.calculateAt(dirfd, path);
  9297. var mode = varargs ? SYSCALLS.get() : 0;
  9298. return FS.open(path, flags, mode).fd;
  9299. } catch (e) {
  9300. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9301. return -e.errno;
  9302. }
  9303. }
  9304. function ___syscall_renameat(olddirfd, oldpath, newdirfd, newpath) {
  9305. try {
  9306. oldpath = SYSCALLS.getStr(oldpath);
  9307. newpath = SYSCALLS.getStr(newpath);
  9308. oldpath = SYSCALLS.calculateAt(olddirfd, oldpath);
  9309. newpath = SYSCALLS.calculateAt(newdirfd, newpath);
  9310. FS.rename(oldpath, newpath);
  9311. return 0;
  9312. } catch (e) {
  9313. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9314. return -e.errno;
  9315. }
  9316. }
  9317. function ___syscall_rmdir(path) {
  9318. try {
  9319. path = SYSCALLS.getStr(path);
  9320. FS.rmdir(path);
  9321. return 0;
  9322. } catch (e) {
  9323. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9324. return -e.errno;
  9325. }
  9326. }
  9327. function ___syscall_stat64(path, buf) {
  9328. try {
  9329. path = SYSCALLS.getStr(path);
  9330. return SYSCALLS.doStat(FS.stat, path, buf);
  9331. } catch (e) {
  9332. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9333. return -e.errno;
  9334. }
  9335. }
  9336. function ___syscall_unlinkat(dirfd, path, flags) {
  9337. try {
  9338. path = SYSCALLS.getStr(path);
  9339. path = SYSCALLS.calculateAt(dirfd, path);
  9340. if (flags === 0) {
  9341. FS.unlink(path);
  9342. } else if (flags === 512) {
  9343. FS.rmdir(path);
  9344. } else {
  9345. abort("Invalid flags passed to unlinkat");
  9346. }
  9347. return 0;
  9348. } catch (e) {
  9349. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9350. return -e.errno;
  9351. }
  9352. }
  9353. var nowIsMonotonic = true;
  9354. var __emscripten_get_now_is_monotonic = () => nowIsMonotonic;
  9355. function convertI32PairToI53Checked(lo, hi) {
  9356. return (hi + 0x200000) >>> 0 < 0x400001 - !!lo
  9357. ? (lo >>> 0) + hi * 4294967296
  9358. : NaN;
  9359. }
  9360. function __gmtime_js(time_low, time_high, tmPtr) {
  9361. var time = convertI32PairToI53Checked(time_low, time_high);
  9362. var date = new Date(time * 1000);
  9363. HEAP32[tmPtr >> 2] = date.getUTCSeconds();
  9364. HEAP32[(tmPtr + 4) >> 2] = date.getUTCMinutes();
  9365. HEAP32[(tmPtr + 8) >> 2] = date.getUTCHours();
  9366. HEAP32[(tmPtr + 12) >> 2] = date.getUTCDate();
  9367. HEAP32[(tmPtr + 16) >> 2] = date.getUTCMonth();
  9368. HEAP32[(tmPtr + 20) >> 2] = date.getUTCFullYear() - 1900;
  9369. HEAP32[(tmPtr + 24) >> 2] = date.getUTCDay();
  9370. var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0);
  9371. var yday = ((date.getTime() - start) / (1000 * 60 * 60 * 24)) | 0;
  9372. HEAP32[(tmPtr + 28) >> 2] = yday;
  9373. }
  9374. var isLeapYear = year => {
  9375. return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
  9376. };
  9377. var MONTH_DAYS_LEAP_CUMULATIVE = [
  9378. 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335
  9379. ];
  9380. var MONTH_DAYS_REGULAR_CUMULATIVE = [
  9381. 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
  9382. ];
  9383. var ydayFromDate = date => {
  9384. var leap = isLeapYear(date.getFullYear());
  9385. var monthDaysCumulative = leap
  9386. ? MONTH_DAYS_LEAP_CUMULATIVE
  9387. : MONTH_DAYS_REGULAR_CUMULATIVE;
  9388. var yday = monthDaysCumulative[date.getMonth()] + date.getDate() - 1; // -1 since it's days since Jan 1
  9389. return yday;
  9390. };
  9391. function __localtime_js(time_low, time_high, tmPtr) {
  9392. var time = convertI32PairToI53Checked(time_low, time_high);
  9393. var date = new Date(time * 1000);
  9394. HEAP32[tmPtr >> 2] = date.getSeconds();
  9395. HEAP32[(tmPtr + 4) >> 2] = date.getMinutes();
  9396. HEAP32[(tmPtr + 8) >> 2] = date.getHours();
  9397. HEAP32[(tmPtr + 12) >> 2] = date.getDate();
  9398. HEAP32[(tmPtr + 16) >> 2] = date.getMonth();
  9399. HEAP32[(tmPtr + 20) >> 2] = date.getFullYear() - 1900;
  9400. HEAP32[(tmPtr + 24) >> 2] = date.getDay();
  9401. var yday = ydayFromDate(date) | 0;
  9402. HEAP32[(tmPtr + 28) >> 2] = yday;
  9403. HEAP32[(tmPtr + 36) >> 2] = -(date.getTimezoneOffset() * 60);
  9404. // Attention: DST is in December in South, and some regions don't have DST at all.
  9405. var start = new Date(date.getFullYear(), 0, 1);
  9406. var summerOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
  9407. var winterOffset = start.getTimezoneOffset();
  9408. var dst =
  9409. (summerOffset != winterOffset &&
  9410. date.getTimezoneOffset() == Math.min(winterOffset, summerOffset)) | 0;
  9411. HEAP32[(tmPtr + 32) >> 2] = dst;
  9412. }
  9413. var __mktime_js = function (tmPtr) {
  9414. var ret = (() => {
  9415. var date = new Date(
  9416. HEAP32[(tmPtr + 20) >> 2] + 1900,
  9417. HEAP32[(tmPtr + 16) >> 2],
  9418. HEAP32[(tmPtr + 12) >> 2],
  9419. HEAP32[(tmPtr + 8) >> 2],
  9420. HEAP32[(tmPtr + 4) >> 2],
  9421. HEAP32[tmPtr >> 2],
  9422. 0
  9423. );
  9424. // There's an ambiguous hour when the time goes back; the tm_isdst field is
  9425. // used to disambiguate it. Date() basically guesses, so we fix it up if it
  9426. // guessed wrong, or fill in tm_isdst with the guess if it's -1.
  9427. var dst = HEAP32[(tmPtr + 32) >> 2];
  9428. var guessedOffset = date.getTimezoneOffset();
  9429. var start = new Date(date.getFullYear(), 0, 1);
  9430. var summerOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
  9431. var winterOffset = start.getTimezoneOffset();
  9432. var dstOffset = Math.min(winterOffset, summerOffset); // DST is in December in South
  9433. if (dst < 0) {
  9434. // Attention: some regions don't have DST at all.
  9435. HEAP32[(tmPtr + 32) >> 2] = Number(
  9436. summerOffset != winterOffset && dstOffset == guessedOffset
  9437. );
  9438. } else if (dst > 0 != (dstOffset == guessedOffset)) {
  9439. var nonDstOffset = Math.max(winterOffset, summerOffset);
  9440. var trueOffset = dst > 0 ? dstOffset : nonDstOffset;
  9441. // Don't try setMinutes(date.getMinutes() + ...) -- it's messed up.
  9442. date.setTime(date.getTime() + (trueOffset - guessedOffset) * 60000);
  9443. }
  9444. HEAP32[(tmPtr + 24) >> 2] = date.getDay();
  9445. var yday = ydayFromDate(date) | 0;
  9446. HEAP32[(tmPtr + 28) >> 2] = yday;
  9447. // To match expected behavior, update fields from date
  9448. HEAP32[tmPtr >> 2] = date.getSeconds();
  9449. HEAP32[(tmPtr + 4) >> 2] = date.getMinutes();
  9450. HEAP32[(tmPtr + 8) >> 2] = date.getHours();
  9451. HEAP32[(tmPtr + 12) >> 2] = date.getDate();
  9452. HEAP32[(tmPtr + 16) >> 2] = date.getMonth();
  9453. HEAP32[(tmPtr + 20) >> 2] = date.getYear();
  9454. return date.getTime() / 1000;
  9455. })();
  9456. return (
  9457. setTempRet0(
  9458. ((tempDouble = ret),
  9459. +Math.abs(tempDouble) >= 1.0
  9460. ? tempDouble > 0.0
  9461. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9462. : ~~+Math.ceil(
  9463. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9464. ) >>> 0
  9465. : 0)
  9466. ),
  9467. ret >>> 0
  9468. );
  9469. };
  9470. var stringToNewUTF8 = str => {
  9471. var size = lengthBytesUTF8(str) + 1;
  9472. var ret = _malloc(size);
  9473. if (ret) stringToUTF8(str, ret, size);
  9474. return ret;
  9475. };
  9476. var __tzset_js = (timezone, daylight, tzname) => {
  9477. // TODO: Use (malleable) environment variables instead of system settings.
  9478. var currentYear = new Date().getFullYear();
  9479. var winter = new Date(currentYear, 0, 1);
  9480. var summer = new Date(currentYear, 6, 1);
  9481. var winterOffset = winter.getTimezoneOffset();
  9482. var summerOffset = summer.getTimezoneOffset();
  9483. // Local standard timezone offset. Local standard time is not adjusted for daylight savings.
  9484. // This code uses the fact that getTimezoneOffset returns a greater value during Standard Time versus Daylight Saving Time (DST).
  9485. // Thus it determines the expected output during Standard Time, and it compares whether the output of the given date the same (Standard) or less (DST).
  9486. var stdTimezoneOffset = Math.max(winterOffset, summerOffset);
  9487. // timezone is specified as seconds west of UTC ("The external variable
  9488. // `timezone` shall be set to the difference, in seconds, between
  9489. // Coordinated Universal Time (UTC) and local standard time."), the same
  9490. // as returned by stdTimezoneOffset.
  9491. // See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html
  9492. HEAPU32[timezone >> 2] = stdTimezoneOffset * 60;
  9493. HEAP32[daylight >> 2] = Number(winterOffset != summerOffset);
  9494. function extractZone(date) {
  9495. var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/);
  9496. return match ? match[1] : "GMT";
  9497. }
  9498. var winterName = extractZone(winter);
  9499. var summerName = extractZone(summer);
  9500. var winterNamePtr = stringToNewUTF8(winterName);
  9501. var summerNamePtr = stringToNewUTF8(summerName);
  9502. if (summerOffset < winterOffset) {
  9503. // Northern hemisphere
  9504. HEAPU32[tzname >> 2] = winterNamePtr;
  9505. HEAPU32[(tzname + 4) >> 2] = summerNamePtr;
  9506. } else {
  9507. HEAPU32[tzname >> 2] = summerNamePtr;
  9508. HEAPU32[(tzname + 4) >> 2] = winterNamePtr;
  9509. }
  9510. };
  9511. var _abort = () => {
  9512. abort("");
  9513. };
  9514. function _emscripten_date_now() {
  9515. return Date.now();
  9516. }
  9517. var _emscripten_get_now;
  9518. // Modern environment where performance.now() is supported:
  9519. // N.B. a shorter form "_emscripten_get_now = performance.now;" is
  9520. // unfortunately not allowed even in current browsers (e.g. FF Nightly 75).
  9521. _emscripten_get_now = () => performance.now();
  9522. var _emscripten_memcpy_big = (dest, src, num) =>
  9523. HEAPU8.copyWithin(dest, src, src + num);
  9524. var getHeapMax = () =>
  9525. // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
  9526. // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
  9527. // for any code that deals with heap sizes, which would require special
  9528. // casing all heap size related code to treat 0 specially.
  9529. 2147483648;
  9530. var growMemory = size => {
  9531. var b = wasmMemory.buffer;
  9532. var pages = (size - b.byteLength + 65535) >>> 16;
  9533. try {
  9534. // round size grow request up to wasm page size (fixed 64KB per spec)
  9535. wasmMemory.grow(pages); // .grow() takes a delta compared to the previous size
  9536. updateMemoryViews();
  9537. return 1 /*success*/;
  9538. } catch (e) {}
  9539. // implicit 0 return to save code size (caller will cast "undefined" into 0
  9540. // anyhow)
  9541. };
  9542. var _emscripten_resize_heap = requestedSize => {
  9543. var oldSize = HEAPU8.length;
  9544. // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.
  9545. requestedSize >>>= 0;
  9546. // With multithreaded builds, races can happen (another thread might increase the size
  9547. // in between), so return a failure, and let the caller retry.
  9548. // Memory resize rules:
  9549. // 1. Always increase heap size to at least the requested size, rounded up
  9550. // to next page multiple.
  9551. // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap
  9552. // geometrically: increase the heap size according to
  9553. // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most
  9554. // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).
  9555. // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap
  9556. // linearly: increase the heap size by at least
  9557. // MEMORY_GROWTH_LINEAR_STEP bytes.
  9558. // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by
  9559. // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest
  9560. // 4. If we were unable to allocate as much memory, it may be due to
  9561. // over-eager decision to excessively reserve due to (3) above.
  9562. // Hence if an allocation fails, cut down on the amount of excess
  9563. // growth, in an attempt to succeed to perform a smaller allocation.
  9564. // A limit is set for how much we can grow. We should not exceed that
  9565. // (the wasm binary specifies it, so if we tried, we'd fail anyhow).
  9566. var maxHeapSize = getHeapMax();
  9567. if (requestedSize > maxHeapSize) {
  9568. return false;
  9569. }
  9570. var alignUp = (x, multiple) => x + ((multiple - (x % multiple)) % multiple);
  9571. // Loop through potential heap size increases. If we attempt a too eager
  9572. // reservation that fails, cut down on the attempted size and reserve a
  9573. // smaller bump instead. (max 3 times, chosen somewhat arbitrarily)
  9574. for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
  9575. var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth
  9576. // but limit overreserving (default to capping at +96MB overgrowth at most)
  9577. overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
  9578. var newSize = Math.min(
  9579. maxHeapSize,
  9580. alignUp(Math.max(requestedSize, overGrownHeapSize), 65536)
  9581. );
  9582. var replacement = growMemory(newSize);
  9583. if (replacement) {
  9584. return true;
  9585. }
  9586. }
  9587. return false;
  9588. };
  9589. var _emscripten_run_script = ptr => {
  9590. eval(UTF8ToString(ptr));
  9591. };
  9592. var ENV = {};
  9593. var getExecutableName = () => {
  9594. return thisProgram || "./this.program";
  9595. };
  9596. var getEnvStrings = () => {
  9597. if (!getEnvStrings.strings) {
  9598. // Default values.
  9599. // Browser language detection #8751
  9600. var lang =
  9601. (
  9602. (typeof navigator == "object" &&
  9603. navigator.languages &&
  9604. navigator.languages[0]) ||
  9605. "C"
  9606. ).replace("-", "_") + ".UTF-8";
  9607. var env = {
  9608. USER: "web_user",
  9609. LOGNAME: "web_user",
  9610. PATH: "/",
  9611. PWD: "/",
  9612. HOME: "/home/web_user",
  9613. LANG: lang,
  9614. _: getExecutableName()
  9615. };
  9616. // Apply the user-provided values, if any.
  9617. for (var x in ENV) {
  9618. // x is a key in ENV; if ENV[x] is undefined, that means it was
  9619. // explicitly set to be so. We allow user code to do that to
  9620. // force variables with default values to remain unset.
  9621. if (ENV[x] === undefined) delete env[x];
  9622. else env[x] = ENV[x];
  9623. }
  9624. var strings = [];
  9625. for (var x in env) {
  9626. strings.push(`${x}=${env[x]}`);
  9627. }
  9628. getEnvStrings.strings = strings;
  9629. }
  9630. return getEnvStrings.strings;
  9631. };
  9632. var stringToAscii = (str, buffer) => {
  9633. for (var i = 0; i < str.length; ++i) {
  9634. HEAP8[buffer++ >> 0] = str.charCodeAt(i);
  9635. }
  9636. // Null-terminate the string
  9637. HEAP8[buffer >> 0] = 0;
  9638. };
  9639. var _environ_get = (__environ, environ_buf) => {
  9640. var bufSize = 0;
  9641. getEnvStrings().forEach(function (string, i) {
  9642. var ptr = environ_buf + bufSize;
  9643. HEAPU32[(__environ + i * 4) >> 2] = ptr;
  9644. stringToAscii(string, ptr);
  9645. bufSize += string.length + 1;
  9646. });
  9647. return 0;
  9648. };
  9649. var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
  9650. var strings = getEnvStrings();
  9651. HEAPU32[penviron_count >> 2] = strings.length;
  9652. var bufSize = 0;
  9653. strings.forEach(function (string) {
  9654. bufSize += string.length + 1;
  9655. });
  9656. HEAPU32[penviron_buf_size >> 2] = bufSize;
  9657. return 0;
  9658. };
  9659. function _fd_close(fd) {
  9660. try {
  9661. var stream = SYSCALLS.getStreamFromFD(fd);
  9662. FS.close(stream);
  9663. return 0;
  9664. } catch (e) {
  9665. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9666. return e.errno;
  9667. }
  9668. }
  9669. function _fd_fdstat_get(fd, pbuf) {
  9670. try {
  9671. var rightsBase = 0;
  9672. var rightsInheriting = 0;
  9673. var flags = 0;
  9674. {
  9675. var stream = SYSCALLS.getStreamFromFD(fd);
  9676. // All character devices are terminals (other things a Linux system would
  9677. // assume is a character device, like the mouse, we have special APIs for).
  9678. var type = stream.tty
  9679. ? 2
  9680. : FS.isDir(stream.mode)
  9681. ? 3
  9682. : FS.isLink(stream.mode)
  9683. ? 7
  9684. : 4;
  9685. }
  9686. HEAP8[pbuf >> 0] = type;
  9687. HEAP16[(pbuf + 2) >> 1] = flags;
  9688. (tempI64 = [
  9689. rightsBase >>> 0,
  9690. ((tempDouble = rightsBase),
  9691. +Math.abs(tempDouble) >= 1.0
  9692. ? tempDouble > 0.0
  9693. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9694. : ~~+Math.ceil(
  9695. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9696. ) >>> 0
  9697. : 0)
  9698. ]),
  9699. (HEAP32[(pbuf + 8) >> 2] = tempI64[0]),
  9700. (HEAP32[(pbuf + 12) >> 2] = tempI64[1]);
  9701. (tempI64 = [
  9702. rightsInheriting >>> 0,
  9703. ((tempDouble = rightsInheriting),
  9704. +Math.abs(tempDouble) >= 1.0
  9705. ? tempDouble > 0.0
  9706. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9707. : ~~+Math.ceil(
  9708. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9709. ) >>> 0
  9710. : 0)
  9711. ]),
  9712. (HEAP32[(pbuf + 16) >> 2] = tempI64[0]),
  9713. (HEAP32[(pbuf + 20) >> 2] = tempI64[1]);
  9714. return 0;
  9715. } catch (e) {
  9716. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9717. return e.errno;
  9718. }
  9719. }
  9720. /** @param {number=} offset */
  9721. var doReadv = (stream, iov, iovcnt, offset) => {
  9722. var ret = 0;
  9723. for (var i = 0; i < iovcnt; i++) {
  9724. var ptr = HEAPU32[iov >> 2];
  9725. var len = HEAPU32[(iov + 4) >> 2];
  9726. iov += 8;
  9727. var curr = FS.read(stream, HEAP8, ptr, len, offset);
  9728. if (curr < 0) return -1;
  9729. ret += curr;
  9730. if (curr < len) break; // nothing more to read
  9731. if (typeof offset !== "undefined") {
  9732. offset += curr;
  9733. }
  9734. }
  9735. return ret;
  9736. };
  9737. function _fd_read(fd, iov, iovcnt, pnum) {
  9738. try {
  9739. var stream = SYSCALLS.getStreamFromFD(fd);
  9740. var num = doReadv(stream, iov, iovcnt);
  9741. HEAPU32[pnum >> 2] = num;
  9742. return 0;
  9743. } catch (e) {
  9744. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9745. return e.errno;
  9746. }
  9747. }
  9748. function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
  9749. var offset = convertI32PairToI53Checked(offset_low, offset_high);
  9750. try {
  9751. if (isNaN(offset)) return 61;
  9752. var stream = SYSCALLS.getStreamFromFD(fd);
  9753. FS.llseek(stream, offset, whence);
  9754. (tempI64 = [
  9755. stream.position >>> 0,
  9756. ((tempDouble = stream.position),
  9757. +Math.abs(tempDouble) >= 1.0
  9758. ? tempDouble > 0.0
  9759. ? +Math.floor(tempDouble / 4294967296.0) >>> 0
  9760. : ~~+Math.ceil(
  9761. (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0
  9762. ) >>> 0
  9763. : 0)
  9764. ]),
  9765. (HEAP32[newOffset >> 2] = tempI64[0]),
  9766. (HEAP32[(newOffset + 4) >> 2] = tempI64[1]);
  9767. if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state
  9768. return 0;
  9769. } catch (e) {
  9770. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9771. return e.errno;
  9772. }
  9773. }
  9774. /** @param {number=} offset */
  9775. var doWritev = (stream, iov, iovcnt, offset) => {
  9776. var ret = 0;
  9777. for (var i = 0; i < iovcnt; i++) {
  9778. var ptr = HEAPU32[iov >> 2];
  9779. var len = HEAPU32[(iov + 4) >> 2];
  9780. iov += 8;
  9781. var curr = FS.write(stream, HEAP8, ptr, len, offset);
  9782. if (curr < 0) return -1;
  9783. ret += curr;
  9784. if (typeof offset !== "undefined") {
  9785. offset += curr;
  9786. }
  9787. }
  9788. return ret;
  9789. };
  9790. function _fd_write(fd, iov, iovcnt, pnum) {
  9791. try {
  9792. var stream = SYSCALLS.getStreamFromFD(fd);
  9793. var num = doWritev(stream, iov, iovcnt);
  9794. HEAPU32[pnum >> 2] = num;
  9795. return 0;
  9796. } catch (e) {
  9797. if (typeof FS == "undefined" || !(e.name === "ErrnoError")) throw e;
  9798. return e.errno;
  9799. }
  9800. }
  9801. var arraySum = (array, index) => {
  9802. var sum = 0;
  9803. for (var i = 0; i <= index; sum += array[i++]) {
  9804. // no-op
  9805. }
  9806. return sum;
  9807. };
  9808. var MONTH_DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  9809. var MONTH_DAYS_REGULAR = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  9810. var addDays = (date, days) => {
  9811. var newDate = new Date(date.getTime());
  9812. while (days > 0) {
  9813. var leap = isLeapYear(newDate.getFullYear());
  9814. var currentMonth = newDate.getMonth();
  9815. var daysInCurrentMonth = (leap ? MONTH_DAYS_LEAP : MONTH_DAYS_REGULAR)[
  9816. currentMonth
  9817. ];
  9818. if (days > daysInCurrentMonth - newDate.getDate()) {
  9819. // we spill over to next month
  9820. days -= daysInCurrentMonth - newDate.getDate() + 1;
  9821. newDate.setDate(1);
  9822. if (currentMonth < 11) {
  9823. newDate.setMonth(currentMonth + 1);
  9824. } else {
  9825. newDate.setMonth(0);
  9826. newDate.setFullYear(newDate.getFullYear() + 1);
  9827. }
  9828. } else {
  9829. // we stay in current month
  9830. newDate.setDate(newDate.getDate() + days);
  9831. return newDate;
  9832. }
  9833. }
  9834. return newDate;
  9835. };
  9836. var writeArrayToMemory = (array, buffer) => {
  9837. HEAP8.set(array, buffer);
  9838. };
  9839. var _strftime = (s, maxsize, format, tm) => {
  9840. // size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);
  9841. // http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html
  9842. var tm_zone = HEAP32[(tm + 40) >> 2];
  9843. var date = {
  9844. tm_sec: HEAP32[tm >> 2],
  9845. tm_min: HEAP32[(tm + 4) >> 2],
  9846. tm_hour: HEAP32[(tm + 8) >> 2],
  9847. tm_mday: HEAP32[(tm + 12) >> 2],
  9848. tm_mon: HEAP32[(tm + 16) >> 2],
  9849. tm_year: HEAP32[(tm + 20) >> 2],
  9850. tm_wday: HEAP32[(tm + 24) >> 2],
  9851. tm_yday: HEAP32[(tm + 28) >> 2],
  9852. tm_isdst: HEAP32[(tm + 32) >> 2],
  9853. tm_gmtoff: HEAP32[(tm + 36) >> 2],
  9854. tm_zone: tm_zone ? UTF8ToString(tm_zone) : ""
  9855. };
  9856. var pattern = UTF8ToString(format);
  9857. // expand format
  9858. var EXPANSION_RULES_1 = {
  9859. "%c": "%a %b %d %H:%M:%S %Y", // Replaced by the locale's appropriate date and time representation - e.g., Mon Aug 3 14:02:01 2013
  9860. "%D": "%m/%d/%y", // Equivalent to %m / %d / %y
  9861. "%F": "%Y-%m-%d", // Equivalent to %Y - %m - %d
  9862. "%h": "%b", // Equivalent to %b
  9863. "%r": "%I:%M:%S %p", // Replaced by the time in a.m. and p.m. notation
  9864. "%R": "%H:%M", // Replaced by the time in 24-hour notation
  9865. "%T": "%H:%M:%S", // Replaced by the time
  9866. "%x": "%m/%d/%y", // Replaced by the locale's appropriate date representation
  9867. "%X": "%H:%M:%S", // Replaced by the locale's appropriate time representation
  9868. // Modified Conversion Specifiers
  9869. "%Ec": "%c", // Replaced by the locale's alternative appropriate date and time representation.
  9870. "%EC": "%C", // Replaced by the name of the base year (period) in the locale's alternative representation.
  9871. "%Ex": "%m/%d/%y", // Replaced by the locale's alternative date representation.
  9872. "%EX": "%H:%M:%S", // Replaced by the locale's alternative time representation.
  9873. "%Ey": "%y", // Replaced by the offset from %EC (year only) in the locale's alternative representation.
  9874. "%EY": "%Y", // Replaced by the full alternative year representation.
  9875. "%Od": "%d", // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading <space> characters.
  9876. "%Oe": "%e", // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading <space> characters.
  9877. "%OH": "%H", // Replaced by the hour (24-hour clock) using the locale's alternative numeric symbols.
  9878. "%OI": "%I", // Replaced by the hour (12-hour clock) using the locale's alternative numeric symbols.
  9879. "%Om": "%m", // Replaced by the month using the locale's alternative numeric symbols.
  9880. "%OM": "%M", // Replaced by the minutes using the locale's alternative numeric symbols.
  9881. "%OS": "%S", // Replaced by the seconds using the locale's alternative numeric symbols.
  9882. "%Ou": "%u", // Replaced by the weekday as a number in the locale's alternative representation (Monday=1).
  9883. "%OU": "%U", // Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale's alternative numeric symbols.
  9884. "%OV": "%V", // Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale's alternative numeric symbols.
  9885. "%Ow": "%w", // Replaced by the number of the weekday (Sunday=0) using the locale's alternative numeric symbols.
  9886. "%OW": "%W", // Replaced by the week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols.
  9887. "%Oy": "%y" // Replaced by the year (offset from %C ) using the locale's alternative numeric symbols.
  9888. };
  9889. for (var rule in EXPANSION_RULES_1) {
  9890. pattern = pattern.replace(new RegExp(rule, "g"), EXPANSION_RULES_1[rule]);
  9891. }
  9892. var WEEKDAYS = [
  9893. "Sunday",
  9894. "Monday",
  9895. "Tuesday",
  9896. "Wednesday",
  9897. "Thursday",
  9898. "Friday",
  9899. "Saturday"
  9900. ];
  9901. var MONTHS = [
  9902. "January",
  9903. "February",
  9904. "March",
  9905. "April",
  9906. "May",
  9907. "June",
  9908. "July",
  9909. "August",
  9910. "September",
  9911. "October",
  9912. "November",
  9913. "December"
  9914. ];
  9915. function leadingSomething(value, digits, character) {
  9916. var str = typeof value == "number" ? value.toString() : value || "";
  9917. while (str.length < digits) {
  9918. str = character[0] + str;
  9919. }
  9920. return str;
  9921. }
  9922. function leadingNulls(value, digits) {
  9923. return leadingSomething(value, digits, "0");
  9924. }
  9925. function compareByDay(date1, date2) {
  9926. function sgn(value) {
  9927. return value < 0 ? -1 : value > 0 ? 1 : 0;
  9928. }
  9929. var compare;
  9930. if ((compare = sgn(date1.getFullYear() - date2.getFullYear())) === 0) {
  9931. if ((compare = sgn(date1.getMonth() - date2.getMonth())) === 0) {
  9932. compare = sgn(date1.getDate() - date2.getDate());
  9933. }
  9934. }
  9935. return compare;
  9936. }
  9937. function getFirstWeekStartDate(janFourth) {
  9938. switch (janFourth.getDay()) {
  9939. case 0: // Sunday
  9940. return new Date(janFourth.getFullYear() - 1, 11, 29);
  9941. case 1: // Monday
  9942. return janFourth;
  9943. case 2: // Tuesday
  9944. return new Date(janFourth.getFullYear(), 0, 3);
  9945. case 3: // Wednesday
  9946. return new Date(janFourth.getFullYear(), 0, 2);
  9947. case 4: // Thursday
  9948. return new Date(janFourth.getFullYear(), 0, 1);
  9949. case 5: // Friday
  9950. return new Date(janFourth.getFullYear() - 1, 11, 31);
  9951. case 6: // Saturday
  9952. return new Date(janFourth.getFullYear() - 1, 11, 30);
  9953. }
  9954. }
  9955. function getWeekBasedYear(date) {
  9956. var thisDate = addDays(new Date(date.tm_year + 1900, 0, 1), date.tm_yday);
  9957. var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);
  9958. var janFourthNextYear = new Date(thisDate.getFullYear() + 1, 0, 4);
  9959. var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);
  9960. var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);
  9961. if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) {
  9962. // this date is after the start of the first week of this year
  9963. if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) {
  9964. return thisDate.getFullYear() + 1;
  9965. }
  9966. return thisDate.getFullYear();
  9967. }
  9968. return thisDate.getFullYear() - 1;
  9969. }
  9970. var EXPANSION_RULES_2 = {
  9971. "%a": date => WEEKDAYS[date.tm_wday].substring(0, 3),
  9972. "%A": date => WEEKDAYS[date.tm_wday],
  9973. "%b": date => MONTHS[date.tm_mon].substring(0, 3),
  9974. "%B": date => MONTHS[date.tm_mon],
  9975. "%C": date => {
  9976. var year = date.tm_year + 1900;
  9977. return leadingNulls((year / 100) | 0, 2);
  9978. },
  9979. "%d": date => leadingNulls(date.tm_mday, 2),
  9980. "%e": date => leadingSomething(date.tm_mday, 2, " "),
  9981. "%g": date => {
  9982. // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year.
  9983. // In this system, weeks begin on a Monday and week 1 of the year is the week that includes
  9984. // January 4th, which is also the week that includes the first Thursday of the year, and
  9985. // is also the first week that contains at least four days in the year.
  9986. // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of
  9987. // the last week of the preceding year; thus, for Saturday 2nd January 1999,
  9988. // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th,
  9989. // or 31st is a Monday, it and any following days are part of week 1 of the following year.
  9990. // Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.
  9991. return getWeekBasedYear(date).toString().substring(2);
  9992. },
  9993. "%G": date => getWeekBasedYear(date),
  9994. "%H": date => leadingNulls(date.tm_hour, 2),
  9995. "%I": date => {
  9996. var twelveHour = date.tm_hour;
  9997. if (twelveHour == 0) twelveHour = 12;
  9998. else if (twelveHour > 12) twelveHour -= 12;
  9999. return leadingNulls(twelveHour, 2);
  10000. },
  10001. "%j": date => {
  10002. // Day of the year (001-366)
  10003. return leadingNulls(
  10004. date.tm_mday +
  10005. arraySum(
  10006. isLeapYear(date.tm_year + 1900)
  10007. ? MONTH_DAYS_LEAP
  10008. : MONTH_DAYS_REGULAR,
  10009. date.tm_mon - 1
  10010. ),
  10011. 3
  10012. );
  10013. },
  10014. "%m": date => leadingNulls(date.tm_mon + 1, 2),
  10015. "%M": date => leadingNulls(date.tm_min, 2),
  10016. "%n": () => "\n",
  10017. "%p": date => {
  10018. if (date.tm_hour >= 0 && date.tm_hour < 12) {
  10019. return "AM";
  10020. }
  10021. return "PM";
  10022. },
  10023. "%S": date => leadingNulls(date.tm_sec, 2),
  10024. "%t": () => "\t",
  10025. "%u": date => date.tm_wday || 7,
  10026. "%U": date => {
  10027. var days = date.tm_yday + 7 - date.tm_wday;
  10028. return leadingNulls(Math.floor(days / 7), 2);
  10029. },
  10030. "%V": date => {
  10031. // Replaced by the week number of the year (Monday as the first day of the week)
  10032. // as a decimal number [01,53]. If the week containing 1 January has four
  10033. // or more days in the new year, then it is considered week 1.
  10034. // Otherwise, it is the last week of the previous year, and the next week is week 1.
  10035. // Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]
  10036. var val = Math.floor((date.tm_yday + 7 - ((date.tm_wday + 6) % 7)) / 7);
  10037. // If 1 Jan is just 1-3 days past Monday, the previous week
  10038. // is also in this year.
  10039. if ((date.tm_wday + 371 - date.tm_yday - 2) % 7 <= 2) {
  10040. val++;
  10041. }
  10042. if (!val) {
  10043. val = 52;
  10044. // If 31 December of prev year a Thursday, or Friday of a
  10045. // leap year, then the prev year has 53 weeks.
  10046. var dec31 = (date.tm_wday + 7 - date.tm_yday - 1) % 7;
  10047. if (
  10048. dec31 == 4 ||
  10049. (dec31 == 5 && isLeapYear((date.tm_year % 400) - 1))
  10050. ) {
  10051. val++;
  10052. }
  10053. } else if (val == 53) {
  10054. // If 1 January is not a Thursday, and not a Wednesday of a
  10055. // leap year, then this year has only 52 weeks.
  10056. var jan1 = (date.tm_wday + 371 - date.tm_yday) % 7;
  10057. if (jan1 != 4 && (jan1 != 3 || !isLeapYear(date.tm_year))) val = 1;
  10058. }
  10059. return leadingNulls(val, 2);
  10060. },
  10061. "%w": date => date.tm_wday,
  10062. "%W": date => {
  10063. var days = date.tm_yday + 7 - ((date.tm_wday + 6) % 7);
  10064. return leadingNulls(Math.floor(days / 7), 2);
  10065. },
  10066. "%y": date => {
  10067. // Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]
  10068. return (date.tm_year + 1900).toString().substring(2);
  10069. },
  10070. // Replaced by the year as a decimal number (for example, 1997). [ tm_year]
  10071. "%Y": date => date.tm_year + 1900,
  10072. "%z": date => {
  10073. // Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ).
  10074. // For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich).
  10075. var off = date.tm_gmtoff;
  10076. var ahead = off >= 0;
  10077. off = Math.abs(off) / 60;
  10078. // convert from minutes into hhmm format (which means 60 minutes = 100 units)
  10079. off = (off / 60) * 100 + (off % 60);
  10080. return (ahead ? "+" : "-") + String("0000" + off).slice(-4);
  10081. },
  10082. "%Z": date => date.tm_zone,
  10083. "%%": () => "%"
  10084. };
  10085. // Replace %% with a pair of NULLs (which cannot occur in a C string), then
  10086. // re-inject them after processing.
  10087. pattern = pattern.replace(/%%/g, "\0\0");
  10088. for (var rule in EXPANSION_RULES_2) {
  10089. if (pattern.includes(rule)) {
  10090. pattern = pattern.replace(
  10091. new RegExp(rule, "g"),
  10092. EXPANSION_RULES_2[rule](date)
  10093. );
  10094. }
  10095. }
  10096. pattern = pattern.replace(/\0\0/g, "%");
  10097. var bytes = intArrayFromString(pattern, false);
  10098. if (bytes.length > maxsize) {
  10099. return 0;
  10100. }
  10101. writeArrayToMemory(bytes, s);
  10102. return bytes.length - 1;
  10103. };
  10104. var _proc_exit = code => {
  10105. EXITSTATUS = code;
  10106. if (!keepRuntimeAlive()) {
  10107. if (Module["onExit"]) Module["onExit"](code);
  10108. ABORT = true;
  10109. }
  10110. quit_(code, new ExitStatus(code));
  10111. };
  10112. /** @param {boolean|number=} implicit */
  10113. var exitJS = (status, implicit) => {
  10114. EXITSTATUS = status;
  10115. _proc_exit(status);
  10116. };
  10117. var handleException = e => {
  10118. // Certain exception types we do not treat as errors since they are used for
  10119. // internal control flow.
  10120. // 1. ExitStatus, which is thrown by exit()
  10121. // 2. "unwind", which is thrown by emscripten_unwind_to_js_event_loop() and others
  10122. // that wish to return to JS event loop.
  10123. if (e instanceof ExitStatus || e == "unwind") {
  10124. return EXITSTATUS;
  10125. }
  10126. quit_(1, e);
  10127. };
  10128. var stringToUTF8OnStack = str => {
  10129. var size = lengthBytesUTF8(str) + 1;
  10130. var ret = stackAlloc(size);
  10131. stringToUTF8(str, ret, size);
  10132. return ret;
  10133. };
  10134. function getCFunc(ident) {
  10135. var func = Module["_" + ident]; // closure exported function
  10136. return func;
  10137. }
  10138. /**
  10139. * @param {string|null=} returnType
  10140. * @param {Array=} argTypes
  10141. * @param {Arguments|Array=} args
  10142. * @param {Object=} opts
  10143. */
  10144. var ccall = function (ident, returnType, argTypes, args, opts) {
  10145. // For fast lookup of conversion functions
  10146. var toC = {
  10147. string: str => {
  10148. var ret = 0;
  10149. if (str !== null && str !== undefined && str !== 0) {
  10150. // null string
  10151. // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0'
  10152. ret = stringToUTF8OnStack(str);
  10153. }
  10154. return ret;
  10155. },
  10156. array: arr => {
  10157. var ret = stackAlloc(arr.length);
  10158. writeArrayToMemory(arr, ret);
  10159. return ret;
  10160. }
  10161. };
  10162. function convertReturnValue(ret) {
  10163. if (returnType === "string") {
  10164. return UTF8ToString(ret);
  10165. }
  10166. if (returnType === "boolean") return Boolean(ret);
  10167. return ret;
  10168. }
  10169. var func = getCFunc(ident);
  10170. var cArgs = [];
  10171. var stack = 0;
  10172. if (args) {
  10173. for (var i = 0; i < args.length; i++) {
  10174. var converter = toC[argTypes[i]];
  10175. if (converter) {
  10176. if (stack === 0) stack = stackSave();
  10177. cArgs[i] = converter(args[i]);
  10178. } else {
  10179. cArgs[i] = args[i];
  10180. }
  10181. }
  10182. }
  10183. var ret = func.apply(null, cArgs);
  10184. function onDone(ret) {
  10185. if (stack !== 0) stackRestore(stack);
  10186. return convertReturnValue(ret);
  10187. }
  10188. ret = onDone(ret);
  10189. return ret;
  10190. };
  10191. /**
  10192. * @param {string=} returnType
  10193. * @param {Array=} argTypes
  10194. * @param {Object=} opts
  10195. */
  10196. var cwrap = function (ident, returnType, argTypes, opts) {
  10197. // When the function takes numbers and returns a number, we can just return
  10198. // the original function
  10199. var numericArgs =
  10200. !argTypes ||
  10201. argTypes.every(type => type === "number" || type === "boolean");
  10202. var numericRet = returnType !== "string";
  10203. if (numericRet && numericArgs && !opts) {
  10204. return getCFunc(ident);
  10205. }
  10206. return function () {
  10207. return ccall(ident, returnType, argTypes, arguments, opts);
  10208. };
  10209. };
  10210. var FSNode = /** @constructor */ function (parent, name, mode, rdev) {
  10211. if (!parent) {
  10212. parent = this; // root node sets parent to itself
  10213. }
  10214. this.parent = parent;
  10215. this.mount = parent.mount;
  10216. this.mounted = null;
  10217. this.id = FS.nextInode++;
  10218. this.name = name;
  10219. this.mode = mode;
  10220. this.node_ops = {};
  10221. this.stream_ops = {};
  10222. this.rdev = rdev;
  10223. };
  10224. var readMode = 292 /*292*/ | 73; /*73*/
  10225. var writeMode = 146; /*146*/
  10226. Object.defineProperties(FSNode.prototype, {
  10227. read: {
  10228. get: /** @this{FSNode} */ function () {
  10229. return (this.mode & readMode) === readMode;
  10230. },
  10231. set: /** @this{FSNode} */ function (val) {
  10232. val ? (this.mode |= readMode) : (this.mode &= ~readMode);
  10233. }
  10234. },
  10235. write: {
  10236. get: /** @this{FSNode} */ function () {
  10237. return (this.mode & writeMode) === writeMode;
  10238. },
  10239. set: /** @this{FSNode} */ function (val) {
  10240. val ? (this.mode |= writeMode) : (this.mode &= ~writeMode);
  10241. }
  10242. },
  10243. isFolder: {
  10244. get: /** @this{FSNode} */ function () {
  10245. return FS.isDir(this.mode);
  10246. }
  10247. },
  10248. isDevice: {
  10249. get: /** @this{FSNode} */ function () {
  10250. return FS.isChrdev(this.mode);
  10251. }
  10252. }
  10253. });
  10254. FS.FSNode = FSNode;
  10255. FS.createPreloadedFile = FS_createPreloadedFile;
  10256. FS.staticInit();
  10257. var wasmImports = {
  10258. __syscall_faccessat: ___syscall_faccessat,
  10259. __syscall_fcntl64: ___syscall_fcntl64,
  10260. __syscall_fstat64: ___syscall_fstat64,
  10261. __syscall_getdents64: ___syscall_getdents64,
  10262. __syscall_lstat64: ___syscall_lstat64,
  10263. __syscall_newfstatat: ___syscall_newfstatat,
  10264. __syscall_openat: ___syscall_openat,
  10265. __syscall_renameat: ___syscall_renameat,
  10266. __syscall_rmdir: ___syscall_rmdir,
  10267. __syscall_stat64: ___syscall_stat64,
  10268. __syscall_unlinkat: ___syscall_unlinkat,
  10269. _emscripten_get_now_is_monotonic: __emscripten_get_now_is_monotonic,
  10270. _gmtime_js: __gmtime_js,
  10271. _localtime_js: __localtime_js,
  10272. _mktime_js: __mktime_js,
  10273. _tzset_js: __tzset_js,
  10274. abort: _abort,
  10275. emscripten_date_now: _emscripten_date_now,
  10276. emscripten_get_now: _emscripten_get_now,
  10277. emscripten_memcpy_big: _emscripten_memcpy_big,
  10278. emscripten_resize_heap: _emscripten_resize_heap,
  10279. emscripten_run_script: _emscripten_run_script,
  10280. environ_get: _environ_get,
  10281. environ_sizes_get: _environ_sizes_get,
  10282. fd_close: _fd_close,
  10283. fd_fdstat_get: _fd_fdstat_get,
  10284. fd_read: _fd_read,
  10285. fd_seek: _fd_seek,
  10286. fd_write: _fd_write,
  10287. strftime: _strftime
  10288. };
  10289. var asm = createWasm();
  10290. /** @type {function(...*):?} */
  10291. var ___wasm_call_ctors = function () {
  10292. return (___wasm_call_ctors = Module["asm"]["__wasm_call_ctors"]).apply(
  10293. null,
  10294. arguments
  10295. );
  10296. };
  10297. /** @type {function(...*):?} */
  10298. var _malloc = function () {
  10299. return (_malloc = Module["asm"]["malloc"]).apply(null, arguments);
  10300. };
  10301. /** @type {function(...*):?} */
  10302. var _captureByCount = (Module["_captureByCount"] = function () {
  10303. return (_captureByCount = Module["_captureByCount"] =
  10304. Module["asm"]["captureByCount"]).apply(null, arguments);
  10305. });
  10306. /** @type {function(...*):?} */
  10307. var _captureByMs = (Module["_captureByMs"] = function () {
  10308. return (_captureByMs = Module["_captureByMs"] =
  10309. Module["asm"]["captureByMs"]).apply(null, arguments);
  10310. });
  10311. /** @type {function(...*):?} */
  10312. var _main = (Module["_main"] = function () {
  10313. return (_main = Module["_main"] = Module["asm"]["__main_argc_argv"]).apply(
  10314. null,
  10315. arguments
  10316. );
  10317. });
  10318. /** @type {function(...*):?} */
  10319. var ___errno_location = function () {
  10320. return (___errno_location = Module["asm"]["__errno_location"]).apply(
  10321. null,
  10322. arguments
  10323. );
  10324. };
  10325. /** @type {function(...*):?} */
  10326. var _free = (Module["_free"] = function () {
  10327. return (_free = Module["_free"] = Module["asm"]["free"]).apply(
  10328. null,
  10329. arguments
  10330. );
  10331. });
  10332. /** @type {function(...*):?} */
  10333. var setTempRet0 = function () {
  10334. return (setTempRet0 = Module["asm"]["setTempRet0"]).apply(null, arguments);
  10335. };
  10336. /** @type {function(...*):?} */
  10337. var stackSave = function () {
  10338. return (stackSave = Module["asm"]["stackSave"]).apply(null, arguments);
  10339. };
  10340. /** @type {function(...*):?} */
  10341. var stackRestore = function () {
  10342. return (stackRestore = Module["asm"]["stackRestore"]).apply(null, arguments);
  10343. };
  10344. /** @type {function(...*):?} */
  10345. var stackAlloc = function () {
  10346. return (stackAlloc = Module["asm"]["stackAlloc"]).apply(null, arguments);
  10347. };
  10348. /** @type {function(...*):?} */
  10349. var dynCall_iiiji = (Module["dynCall_iiiji"] = function () {
  10350. return (dynCall_iiiji = Module["dynCall_iiiji"] =
  10351. Module["asm"]["dynCall_iiiji"]).apply(null, arguments);
  10352. });
  10353. /** @type {function(...*):?} */
  10354. var dynCall_jiji = (Module["dynCall_jiji"] = function () {
  10355. return (dynCall_jiji = Module["dynCall_jiji"] =
  10356. Module["asm"]["dynCall_jiji"]).apply(null, arguments);
  10357. });
  10358. /** @type {function(...*):?} */
  10359. var dynCall_jiiji = (Module["dynCall_jiiji"] = function () {
  10360. return (dynCall_jiiji = Module["dynCall_jiiji"] =
  10361. Module["asm"]["dynCall_jiiji"]).apply(null, arguments);
  10362. });
  10363. // include: postamble.js
  10364. // === Auto-generated postamble setup entry stuff ===
  10365. Module["ccall"] = ccall;
  10366. Module["cwrap"] = cwrap;
  10367. var calledRun;
  10368. dependenciesFulfilled = function runCaller() {
  10369. // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
  10370. if (!calledRun) run();
  10371. if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
  10372. };
  10373. function callMain(args = []) {
  10374. var entryFunction = _main;
  10375. args.unshift(thisProgram);
  10376. var argc = args.length;
  10377. var argv = stackAlloc((argc + 1) * 4);
  10378. var argv_ptr = argv >> 2;
  10379. args.forEach(arg => {
  10380. HEAP32[argv_ptr++] = stringToUTF8OnStack(arg);
  10381. });
  10382. HEAP32[argv_ptr] = 0;
  10383. try {
  10384. var ret = entryFunction(argc, argv);
  10385. // if we're not running an evented main loop, it's time to exit
  10386. exitJS(ret, /* implicit = */ true);
  10387. return ret;
  10388. } catch (e) {
  10389. return handleException(e);
  10390. }
  10391. }
  10392. function run(args = arguments_) {
  10393. if (runDependencies > 0) {
  10394. return;
  10395. }
  10396. preRun();
  10397. // a preRun added a dependency, run will be called later
  10398. if (runDependencies > 0) {
  10399. return;
  10400. }
  10401. function doRun() {
  10402. // run may have just been called through dependencies being fulfilled just in this very frame,
  10403. // or while the async setStatus time below was happening
  10404. if (calledRun) return;
  10405. calledRun = true;
  10406. Module["calledRun"] = true;
  10407. if (ABORT) return;
  10408. initRuntime();
  10409. preMain();
  10410. if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
  10411. if (shouldRunNow) callMain(args);
  10412. postRun();
  10413. }
  10414. if (Module["setStatus"]) {
  10415. Module["setStatus"]("Running...");
  10416. setTimeout(function () {
  10417. setTimeout(function () {
  10418. Module["setStatus"]("");
  10419. }, 1);
  10420. doRun();
  10421. }, 1);
  10422. } else {
  10423. doRun();
  10424. }
  10425. }
  10426. if (Module["preInit"]) {
  10427. if (typeof Module["preInit"] == "function")
  10428. Module["preInit"] = [Module["preInit"]];
  10429. while (Module["preInit"].length > 0) {
  10430. Module["preInit"].pop()();
  10431. }
  10432. }
  10433. // shouldRunNow refers to calling main(), not run().
  10434. var shouldRunNow = true;
  10435. if (Module["noInitialRun"]) shouldRunNow = false;
  10436. run();
  10437. // end include: postamble.js