react-dom-server.node.production.js 271 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707
  1. /**
  2. * @license React
  3. * react-dom-server.node.production.js
  4. *
  5. * Copyright (c) Meta Platforms, Inc. and affiliates.
  6. *
  7. * This source code is licensed under the MIT license found in the
  8. * LICENSE file in the root directory of this source tree.
  9. */
  10. "use strict";
  11. var util = require("util"),
  12. crypto = require("crypto"),
  13. async_hooks = require("async_hooks"),
  14. React = require("react"),
  15. ReactDOM = require("react-dom"),
  16. stream = require("stream"),
  17. REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
  18. REACT_PORTAL_TYPE = Symbol.for("react.portal"),
  19. REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
  20. REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
  21. REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
  22. REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
  23. REACT_CONTEXT_TYPE = Symbol.for("react.context"),
  24. REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
  25. REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
  26. REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
  27. REACT_MEMO_TYPE = Symbol.for("react.memo"),
  28. REACT_LAZY_TYPE = Symbol.for("react.lazy"),
  29. REACT_SCOPE_TYPE = Symbol.for("react.scope"),
  30. REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
  31. REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
  32. REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
  33. REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
  34. MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
  35. function getIteratorFn(maybeIterable) {
  36. if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
  37. maybeIterable =
  38. (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
  39. maybeIterable["@@iterator"];
  40. return "function" === typeof maybeIterable ? maybeIterable : null;
  41. }
  42. var isArrayImpl = Array.isArray,
  43. scheduleMicrotask = queueMicrotask;
  44. function flushBuffered(destination) {
  45. "function" === typeof destination.flush && destination.flush();
  46. }
  47. var currentView = null,
  48. writtenBytes = 0,
  49. destinationHasCapacity$1 = !0;
  50. function writeChunk(destination, chunk) {
  51. if ("string" === typeof chunk) {
  52. if (0 !== chunk.length)
  53. if (2048 < 3 * chunk.length)
  54. 0 < writtenBytes &&
  55. (writeToDestination(
  56. destination,
  57. currentView.subarray(0, writtenBytes)
  58. ),
  59. (currentView = new Uint8Array(2048)),
  60. (writtenBytes = 0)),
  61. writeToDestination(destination, chunk);
  62. else {
  63. var target = currentView;
  64. 0 < writtenBytes && (target = currentView.subarray(writtenBytes));
  65. target = textEncoder.encodeInto(chunk, target);
  66. var read = target.read;
  67. writtenBytes += target.written;
  68. read < chunk.length &&
  69. (writeToDestination(
  70. destination,
  71. currentView.subarray(0, writtenBytes)
  72. ),
  73. (currentView = new Uint8Array(2048)),
  74. (writtenBytes = textEncoder.encodeInto(
  75. chunk.slice(read),
  76. currentView
  77. ).written));
  78. 2048 === writtenBytes &&
  79. (writeToDestination(destination, currentView),
  80. (currentView = new Uint8Array(2048)),
  81. (writtenBytes = 0));
  82. }
  83. } else
  84. 0 !== chunk.byteLength &&
  85. (2048 < chunk.byteLength
  86. ? (0 < writtenBytes &&
  87. (writeToDestination(
  88. destination,
  89. currentView.subarray(0, writtenBytes)
  90. ),
  91. (currentView = new Uint8Array(2048)),
  92. (writtenBytes = 0)),
  93. writeToDestination(destination, chunk))
  94. : ((target = currentView.length - writtenBytes),
  95. target < chunk.byteLength &&
  96. (0 === target
  97. ? writeToDestination(destination, currentView)
  98. : (currentView.set(chunk.subarray(0, target), writtenBytes),
  99. (writtenBytes += target),
  100. writeToDestination(destination, currentView),
  101. (chunk = chunk.subarray(target))),
  102. (currentView = new Uint8Array(2048)),
  103. (writtenBytes = 0)),
  104. currentView.set(chunk, writtenBytes),
  105. (writtenBytes += chunk.byteLength),
  106. 2048 === writtenBytes &&
  107. (writeToDestination(destination, currentView),
  108. (currentView = new Uint8Array(2048)),
  109. (writtenBytes = 0))));
  110. }
  111. function writeToDestination(destination, view) {
  112. destination = destination.write(view);
  113. destinationHasCapacity$1 = destinationHasCapacity$1 && destination;
  114. }
  115. function writeChunkAndReturn(destination, chunk) {
  116. writeChunk(destination, chunk);
  117. return destinationHasCapacity$1;
  118. }
  119. function completeWriting(destination) {
  120. currentView &&
  121. 0 < writtenBytes &&
  122. destination.write(currentView.subarray(0, writtenBytes));
  123. currentView = null;
  124. writtenBytes = 0;
  125. destinationHasCapacity$1 = !0;
  126. }
  127. var textEncoder = new util.TextEncoder();
  128. function stringToPrecomputedChunk(content) {
  129. return textEncoder.encode(content);
  130. }
  131. function byteLengthOfChunk(chunk) {
  132. return "string" === typeof chunk
  133. ? Buffer.byteLength(chunk, "utf8")
  134. : chunk.byteLength;
  135. }
  136. var assign = Object.assign,
  137. hasOwnProperty = Object.prototype.hasOwnProperty,
  138. VALID_ATTRIBUTE_NAME_REGEX = RegExp(
  139. "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
  140. ),
  141. illegalAttributeNameCache = {},
  142. validatedAttributeNameCache = {};
  143. function isAttributeNameSafe(attributeName) {
  144. if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
  145. return !0;
  146. if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1;
  147. if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
  148. return (validatedAttributeNameCache[attributeName] = !0);
  149. illegalAttributeNameCache[attributeName] = !0;
  150. return !1;
  151. }
  152. var unitlessNumbers = new Set(
  153. "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
  154. " "
  155. )
  156. ),
  157. aliases = new Map([
  158. ["acceptCharset", "accept-charset"],
  159. ["htmlFor", "for"],
  160. ["httpEquiv", "http-equiv"],
  161. ["crossOrigin", "crossorigin"],
  162. ["accentHeight", "accent-height"],
  163. ["alignmentBaseline", "alignment-baseline"],
  164. ["arabicForm", "arabic-form"],
  165. ["baselineShift", "baseline-shift"],
  166. ["capHeight", "cap-height"],
  167. ["clipPath", "clip-path"],
  168. ["clipRule", "clip-rule"],
  169. ["colorInterpolation", "color-interpolation"],
  170. ["colorInterpolationFilters", "color-interpolation-filters"],
  171. ["colorProfile", "color-profile"],
  172. ["colorRendering", "color-rendering"],
  173. ["dominantBaseline", "dominant-baseline"],
  174. ["enableBackground", "enable-background"],
  175. ["fillOpacity", "fill-opacity"],
  176. ["fillRule", "fill-rule"],
  177. ["floodColor", "flood-color"],
  178. ["floodOpacity", "flood-opacity"],
  179. ["fontFamily", "font-family"],
  180. ["fontSize", "font-size"],
  181. ["fontSizeAdjust", "font-size-adjust"],
  182. ["fontStretch", "font-stretch"],
  183. ["fontStyle", "font-style"],
  184. ["fontVariant", "font-variant"],
  185. ["fontWeight", "font-weight"],
  186. ["glyphName", "glyph-name"],
  187. ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
  188. ["glyphOrientationVertical", "glyph-orientation-vertical"],
  189. ["horizAdvX", "horiz-adv-x"],
  190. ["horizOriginX", "horiz-origin-x"],
  191. ["imageRendering", "image-rendering"],
  192. ["letterSpacing", "letter-spacing"],
  193. ["lightingColor", "lighting-color"],
  194. ["markerEnd", "marker-end"],
  195. ["markerMid", "marker-mid"],
  196. ["markerStart", "marker-start"],
  197. ["overlinePosition", "overline-position"],
  198. ["overlineThickness", "overline-thickness"],
  199. ["paintOrder", "paint-order"],
  200. ["panose-1", "panose-1"],
  201. ["pointerEvents", "pointer-events"],
  202. ["renderingIntent", "rendering-intent"],
  203. ["shapeRendering", "shape-rendering"],
  204. ["stopColor", "stop-color"],
  205. ["stopOpacity", "stop-opacity"],
  206. ["strikethroughPosition", "strikethrough-position"],
  207. ["strikethroughThickness", "strikethrough-thickness"],
  208. ["strokeDasharray", "stroke-dasharray"],
  209. ["strokeDashoffset", "stroke-dashoffset"],
  210. ["strokeLinecap", "stroke-linecap"],
  211. ["strokeLinejoin", "stroke-linejoin"],
  212. ["strokeMiterlimit", "stroke-miterlimit"],
  213. ["strokeOpacity", "stroke-opacity"],
  214. ["strokeWidth", "stroke-width"],
  215. ["textAnchor", "text-anchor"],
  216. ["textDecoration", "text-decoration"],
  217. ["textRendering", "text-rendering"],
  218. ["transformOrigin", "transform-origin"],
  219. ["underlinePosition", "underline-position"],
  220. ["underlineThickness", "underline-thickness"],
  221. ["unicodeBidi", "unicode-bidi"],
  222. ["unicodeRange", "unicode-range"],
  223. ["unitsPerEm", "units-per-em"],
  224. ["vAlphabetic", "v-alphabetic"],
  225. ["vHanging", "v-hanging"],
  226. ["vIdeographic", "v-ideographic"],
  227. ["vMathematical", "v-mathematical"],
  228. ["vectorEffect", "vector-effect"],
  229. ["vertAdvY", "vert-adv-y"],
  230. ["vertOriginX", "vert-origin-x"],
  231. ["vertOriginY", "vert-origin-y"],
  232. ["wordSpacing", "word-spacing"],
  233. ["writingMode", "writing-mode"],
  234. ["xmlnsXlink", "xmlns:xlink"],
  235. ["xHeight", "x-height"]
  236. ]),
  237. matchHtmlRegExp = /["'&<>]/;
  238. function escapeTextForBrowser(text) {
  239. if (
  240. "boolean" === typeof text ||
  241. "number" === typeof text ||
  242. "bigint" === typeof text
  243. )
  244. return "" + text;
  245. text = "" + text;
  246. var match = matchHtmlRegExp.exec(text);
  247. if (match) {
  248. var html = "",
  249. index,
  250. lastIndex = 0;
  251. for (index = match.index; index < text.length; index++) {
  252. switch (text.charCodeAt(index)) {
  253. case 34:
  254. match = "&quot;";
  255. break;
  256. case 38:
  257. match = "&amp;";
  258. break;
  259. case 39:
  260. match = "&#x27;";
  261. break;
  262. case 60:
  263. match = "&lt;";
  264. break;
  265. case 62:
  266. match = "&gt;";
  267. break;
  268. default:
  269. continue;
  270. }
  271. lastIndex !== index && (html += text.slice(lastIndex, index));
  272. lastIndex = index + 1;
  273. html += match;
  274. }
  275. text = lastIndex !== index ? html + text.slice(lastIndex, index) : html;
  276. }
  277. return text;
  278. }
  279. var uppercasePattern = /([A-Z])/g,
  280. msPattern = /^ms-/,
  281. isJavaScriptProtocol =
  282. /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
  283. function sanitizeURL(url) {
  284. return isJavaScriptProtocol.test("" + url)
  285. ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
  286. : url;
  287. }
  288. var ReactSharedInternals =
  289. React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
  290. ReactDOMSharedInternals =
  291. ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
  292. sharedNotPendingObject = {
  293. pending: !1,
  294. data: null,
  295. method: null,
  296. action: null
  297. },
  298. previousDispatcher = ReactDOMSharedInternals.d;
  299. ReactDOMSharedInternals.d = {
  300. f: previousDispatcher.f,
  301. r: previousDispatcher.r,
  302. D: prefetchDNS,
  303. C: preconnect,
  304. L: preload,
  305. m: preloadModule,
  306. X: preinitScript,
  307. S: preinitStyle,
  308. M: preinitModuleScript
  309. };
  310. var PRELOAD_NO_CREDS = [],
  311. currentlyFlushingRenderState = null;
  312. stringToPrecomputedChunk('"></template>');
  313. var startInlineScript = stringToPrecomputedChunk("<script"),
  314. endInlineScript = stringToPrecomputedChunk("\x3c/script>"),
  315. startScriptSrc = stringToPrecomputedChunk('<script src="'),
  316. startModuleSrc = stringToPrecomputedChunk('<script type="module" src="'),
  317. scriptNonce = stringToPrecomputedChunk(' nonce="'),
  318. scriptIntegirty = stringToPrecomputedChunk(' integrity="'),
  319. scriptCrossOrigin = stringToPrecomputedChunk(' crossorigin="'),
  320. endAsyncScript = stringToPrecomputedChunk(' async="">\x3c/script>'),
  321. startInlineStyle = stringToPrecomputedChunk("<style"),
  322. scriptRegex = /(<\/|<)(s)(cript)/gi;
  323. function scriptReplacer(match, prefix, s, suffix) {
  324. return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix;
  325. }
  326. var importMapScriptStart = stringToPrecomputedChunk(
  327. '<script type="importmap">'
  328. ),
  329. importMapScriptEnd = stringToPrecomputedChunk("\x3c/script>");
  330. function createRenderState(
  331. resumableState,
  332. nonce,
  333. externalRuntimeConfig,
  334. importMap,
  335. onHeaders,
  336. maxHeadersLength
  337. ) {
  338. externalRuntimeConfig =
  339. "string" === typeof nonce ? nonce : nonce && nonce.script;
  340. var inlineScriptWithNonce =
  341. void 0 === externalRuntimeConfig
  342. ? startInlineScript
  343. : stringToPrecomputedChunk(
  344. '<script nonce="' +
  345. escapeTextForBrowser(externalRuntimeConfig) +
  346. '"'
  347. ),
  348. nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
  349. inlineStyleWithNonce =
  350. void 0 === nonceStyle
  351. ? startInlineStyle
  352. : stringToPrecomputedChunk(
  353. '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"'
  354. ),
  355. idPrefix = resumableState.idPrefix,
  356. bootstrapChunks = [],
  357. bootstrapScriptContent = resumableState.bootstrapScriptContent,
  358. bootstrapScripts = resumableState.bootstrapScripts,
  359. bootstrapModules = resumableState.bootstrapModules;
  360. void 0 !== bootstrapScriptContent &&
  361. (bootstrapChunks.push(inlineScriptWithNonce),
  362. pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
  363. bootstrapChunks.push(
  364. endOfStartTag,
  365. ("" + bootstrapScriptContent).replace(scriptRegex, scriptReplacer),
  366. endInlineScript
  367. ));
  368. bootstrapScriptContent = [];
  369. void 0 !== importMap &&
  370. (bootstrapScriptContent.push(importMapScriptStart),
  371. bootstrapScriptContent.push(
  372. ("" + JSON.stringify(importMap)).replace(scriptRegex, scriptReplacer)
  373. ),
  374. bootstrapScriptContent.push(importMapScriptEnd));
  375. importMap = onHeaders
  376. ? {
  377. preconnects: "",
  378. fontPreloads: "",
  379. highImagePreloads: "",
  380. remainingCapacity:
  381. 2 + ("number" === typeof maxHeadersLength ? maxHeadersLength : 2e3)
  382. }
  383. : null;
  384. onHeaders = {
  385. placeholderPrefix: stringToPrecomputedChunk(idPrefix + "P:"),
  386. segmentPrefix: stringToPrecomputedChunk(idPrefix + "S:"),
  387. boundaryPrefix: stringToPrecomputedChunk(idPrefix + "B:"),
  388. startInlineScript: inlineScriptWithNonce,
  389. startInlineStyle: inlineStyleWithNonce,
  390. preamble: createPreambleState(),
  391. externalRuntimeScript: null,
  392. bootstrapChunks: bootstrapChunks,
  393. importMapChunks: bootstrapScriptContent,
  394. onHeaders: onHeaders,
  395. headers: importMap,
  396. resets: {
  397. font: {},
  398. dns: {},
  399. connect: { default: {}, anonymous: {}, credentials: {} },
  400. image: {},
  401. style: {}
  402. },
  403. charsetChunks: [],
  404. viewportChunks: [],
  405. hoistableChunks: [],
  406. preconnects: new Set(),
  407. fontPreloads: new Set(),
  408. highImagePreloads: new Set(),
  409. styles: new Map(),
  410. bootstrapScripts: new Set(),
  411. scripts: new Set(),
  412. bulkPreloads: new Set(),
  413. preloads: {
  414. images: new Map(),
  415. stylesheets: new Map(),
  416. scripts: new Map(),
  417. moduleScripts: new Map()
  418. },
  419. nonce: { script: externalRuntimeConfig, style: nonceStyle },
  420. hoistableState: null,
  421. stylesToHoist: !1
  422. };
  423. if (void 0 !== bootstrapScripts)
  424. for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
  425. (idPrefix = bootstrapScripts[importMap]),
  426. (nonceStyle = inlineScriptWithNonce = void 0),
  427. (inlineStyleWithNonce = {
  428. rel: "preload",
  429. as: "script",
  430. fetchPriority: "low",
  431. nonce: nonce
  432. }),
  433. "string" === typeof idPrefix
  434. ? (inlineStyleWithNonce.href = maxHeadersLength = idPrefix)
  435. : ((inlineStyleWithNonce.href = maxHeadersLength = idPrefix.src),
  436. (inlineStyleWithNonce.integrity = nonceStyle =
  437. "string" === typeof idPrefix.integrity
  438. ? idPrefix.integrity
  439. : void 0),
  440. (inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =
  441. "string" === typeof idPrefix || null == idPrefix.crossOrigin
  442. ? void 0
  443. : "use-credentials" === idPrefix.crossOrigin
  444. ? "use-credentials"
  445. : "")),
  446. (idPrefix = resumableState),
  447. (bootstrapScriptContent = maxHeadersLength),
  448. (idPrefix.scriptResources[bootstrapScriptContent] = null),
  449. (idPrefix.moduleScriptResources[bootstrapScriptContent] = null),
  450. (idPrefix = []),
  451. pushLinkImpl(idPrefix, inlineStyleWithNonce),
  452. onHeaders.bootstrapScripts.add(idPrefix),
  453. bootstrapChunks.push(
  454. startScriptSrc,
  455. escapeTextForBrowser(maxHeadersLength),
  456. attributeEnd
  457. ),
  458. externalRuntimeConfig &&
  459. bootstrapChunks.push(
  460. scriptNonce,
  461. escapeTextForBrowser(externalRuntimeConfig),
  462. attributeEnd
  463. ),
  464. "string" === typeof nonceStyle &&
  465. bootstrapChunks.push(
  466. scriptIntegirty,
  467. escapeTextForBrowser(nonceStyle),
  468. attributeEnd
  469. ),
  470. "string" === typeof inlineScriptWithNonce &&
  471. bootstrapChunks.push(
  472. scriptCrossOrigin,
  473. escapeTextForBrowser(inlineScriptWithNonce),
  474. attributeEnd
  475. ),
  476. pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
  477. bootstrapChunks.push(endAsyncScript);
  478. if (void 0 !== bootstrapModules)
  479. for (nonce = 0; nonce < bootstrapModules.length; nonce++)
  480. (nonceStyle = bootstrapModules[nonce]),
  481. (maxHeadersLength = importMap = void 0),
  482. (inlineScriptWithNonce = {
  483. rel: "modulepreload",
  484. fetchPriority: "low",
  485. nonce: externalRuntimeConfig
  486. }),
  487. "string" === typeof nonceStyle
  488. ? (inlineScriptWithNonce.href = bootstrapScripts = nonceStyle)
  489. : ((inlineScriptWithNonce.href = bootstrapScripts = nonceStyle.src),
  490. (inlineScriptWithNonce.integrity = maxHeadersLength =
  491. "string" === typeof nonceStyle.integrity
  492. ? nonceStyle.integrity
  493. : void 0),
  494. (inlineScriptWithNonce.crossOrigin = importMap =
  495. "string" === typeof nonceStyle || null == nonceStyle.crossOrigin
  496. ? void 0
  497. : "use-credentials" === nonceStyle.crossOrigin
  498. ? "use-credentials"
  499. : "")),
  500. (nonceStyle = resumableState),
  501. (inlineStyleWithNonce = bootstrapScripts),
  502. (nonceStyle.scriptResources[inlineStyleWithNonce] = null),
  503. (nonceStyle.moduleScriptResources[inlineStyleWithNonce] = null),
  504. (nonceStyle = []),
  505. pushLinkImpl(nonceStyle, inlineScriptWithNonce),
  506. onHeaders.bootstrapScripts.add(nonceStyle),
  507. bootstrapChunks.push(
  508. startModuleSrc,
  509. escapeTextForBrowser(bootstrapScripts),
  510. attributeEnd
  511. ),
  512. externalRuntimeConfig &&
  513. bootstrapChunks.push(
  514. scriptNonce,
  515. escapeTextForBrowser(externalRuntimeConfig),
  516. attributeEnd
  517. ),
  518. "string" === typeof maxHeadersLength &&
  519. bootstrapChunks.push(
  520. scriptIntegirty,
  521. escapeTextForBrowser(maxHeadersLength),
  522. attributeEnd
  523. ),
  524. "string" === typeof importMap &&
  525. bootstrapChunks.push(
  526. scriptCrossOrigin,
  527. escapeTextForBrowser(importMap),
  528. attributeEnd
  529. ),
  530. pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
  531. bootstrapChunks.push(endAsyncScript);
  532. return onHeaders;
  533. }
  534. function createResumableState(
  535. identifierPrefix,
  536. externalRuntimeConfig,
  537. bootstrapScriptContent,
  538. bootstrapScripts,
  539. bootstrapModules
  540. ) {
  541. return {
  542. idPrefix: void 0 === identifierPrefix ? "" : identifierPrefix,
  543. nextFormID: 0,
  544. streamingFormat: 0,
  545. bootstrapScriptContent: bootstrapScriptContent,
  546. bootstrapScripts: bootstrapScripts,
  547. bootstrapModules: bootstrapModules,
  548. instructions: 0,
  549. hasBody: !1,
  550. hasHtml: !1,
  551. unknownResources: {},
  552. dnsResources: {},
  553. connectResources: { default: {}, anonymous: {}, credentials: {} },
  554. imageResources: {},
  555. styleResources: {},
  556. scriptResources: {},
  557. moduleUnknownResources: {},
  558. moduleScriptResources: {}
  559. };
  560. }
  561. function createPreambleState() {
  562. return { htmlChunks: null, headChunks: null, bodyChunks: null };
  563. }
  564. function createFormatContext(
  565. insertionMode,
  566. selectedValue,
  567. tagScope,
  568. viewTransition
  569. ) {
  570. return {
  571. insertionMode: insertionMode,
  572. selectedValue: selectedValue,
  573. tagScope: tagScope,
  574. viewTransition: viewTransition
  575. };
  576. }
  577. function createRootFormatContext(namespaceURI) {
  578. return createFormatContext(
  579. "http://www.w3.org/2000/svg" === namespaceURI
  580. ? 4
  581. : "http://www.w3.org/1998/Math/MathML" === namespaceURI
  582. ? 5
  583. : 0,
  584. null,
  585. 0,
  586. null
  587. );
  588. }
  589. function getChildFormatContext(parentContext, type, props) {
  590. var subtreeScope = parentContext.tagScope & -25;
  591. switch (type) {
  592. case "noscript":
  593. return createFormatContext(2, null, subtreeScope | 1, null);
  594. case "select":
  595. return createFormatContext(
  596. 2,
  597. null != props.value ? props.value : props.defaultValue,
  598. subtreeScope,
  599. null
  600. );
  601. case "svg":
  602. return createFormatContext(4, null, subtreeScope, null);
  603. case "picture":
  604. return createFormatContext(2, null, subtreeScope | 2, null);
  605. case "math":
  606. return createFormatContext(5, null, subtreeScope, null);
  607. case "foreignObject":
  608. return createFormatContext(2, null, subtreeScope, null);
  609. case "table":
  610. return createFormatContext(6, null, subtreeScope, null);
  611. case "thead":
  612. case "tbody":
  613. case "tfoot":
  614. return createFormatContext(7, null, subtreeScope, null);
  615. case "colgroup":
  616. return createFormatContext(9, null, subtreeScope, null);
  617. case "tr":
  618. return createFormatContext(8, null, subtreeScope, null);
  619. case "head":
  620. if (2 > parentContext.insertionMode)
  621. return createFormatContext(3, null, subtreeScope, null);
  622. break;
  623. case "html":
  624. if (0 === parentContext.insertionMode)
  625. return createFormatContext(1, null, subtreeScope, null);
  626. }
  627. return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode
  628. ? createFormatContext(2, null, subtreeScope, null)
  629. : parentContext.tagScope !== subtreeScope
  630. ? createFormatContext(
  631. parentContext.insertionMode,
  632. parentContext.selectedValue,
  633. subtreeScope,
  634. null
  635. )
  636. : parentContext;
  637. }
  638. function getSuspenseViewTransition(parentViewTransition) {
  639. return null === parentViewTransition
  640. ? null
  641. : {
  642. update: parentViewTransition.update,
  643. enter: "none",
  644. exit: "none",
  645. share: parentViewTransition.update,
  646. name: parentViewTransition.autoName,
  647. autoName: parentViewTransition.autoName,
  648. nameIdx: 0
  649. };
  650. }
  651. function getSuspenseFallbackFormatContext(resumableState, parentContext) {
  652. parentContext.tagScope & 32 && (resumableState.instructions |= 128);
  653. return createFormatContext(
  654. parentContext.insertionMode,
  655. parentContext.selectedValue,
  656. parentContext.tagScope | 12,
  657. getSuspenseViewTransition(parentContext.viewTransition)
  658. );
  659. }
  660. function getSuspenseContentFormatContext(resumableState, parentContext) {
  661. resumableState = getSuspenseViewTransition(parentContext.viewTransition);
  662. var subtreeScope = parentContext.tagScope | 16;
  663. null !== resumableState &&
  664. "none" !== resumableState.share &&
  665. (subtreeScope |= 64);
  666. return createFormatContext(
  667. parentContext.insertionMode,
  668. parentContext.selectedValue,
  669. subtreeScope,
  670. resumableState
  671. );
  672. }
  673. var textSeparator = stringToPrecomputedChunk("\x3c!-- --\x3e");
  674. function pushTextInstance(target, text, renderState, textEmbedded) {
  675. if ("" === text) return textEmbedded;
  676. textEmbedded && target.push(textSeparator);
  677. target.push(escapeTextForBrowser(text));
  678. return !0;
  679. }
  680. var styleNameCache = new Map(),
  681. styleAttributeStart = stringToPrecomputedChunk(' style="'),
  682. styleAssign = stringToPrecomputedChunk(":"),
  683. styleSeparator = stringToPrecomputedChunk(";");
  684. function pushStyleAttribute(target, style) {
  685. if ("object" !== typeof style)
  686. throw Error(
  687. "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
  688. );
  689. var isFirst = !0,
  690. styleName;
  691. for (styleName in style)
  692. if (hasOwnProperty.call(style, styleName)) {
  693. var styleValue = style[styleName];
  694. if (
  695. null != styleValue &&
  696. "boolean" !== typeof styleValue &&
  697. "" !== styleValue
  698. ) {
  699. if (0 === styleName.indexOf("--")) {
  700. var nameChunk = escapeTextForBrowser(styleName);
  701. styleValue = escapeTextForBrowser(("" + styleValue).trim());
  702. } else
  703. (nameChunk = styleNameCache.get(styleName)),
  704. void 0 === nameChunk &&
  705. ((nameChunk = stringToPrecomputedChunk(
  706. escapeTextForBrowser(
  707. styleName
  708. .replace(uppercasePattern, "-$1")
  709. .toLowerCase()
  710. .replace(msPattern, "-ms-")
  711. )
  712. )),
  713. styleNameCache.set(styleName, nameChunk)),
  714. (styleValue =
  715. "number" === typeof styleValue
  716. ? 0 === styleValue || unitlessNumbers.has(styleName)
  717. ? "" + styleValue
  718. : styleValue + "px"
  719. : escapeTextForBrowser(("" + styleValue).trim()));
  720. isFirst
  721. ? ((isFirst = !1),
  722. target.push(
  723. styleAttributeStart,
  724. nameChunk,
  725. styleAssign,
  726. styleValue
  727. ))
  728. : target.push(styleSeparator, nameChunk, styleAssign, styleValue);
  729. }
  730. }
  731. isFirst || target.push(attributeEnd);
  732. }
  733. var attributeSeparator = stringToPrecomputedChunk(" "),
  734. attributeAssign = stringToPrecomputedChunk('="'),
  735. attributeEnd = stringToPrecomputedChunk('"'),
  736. attributeEmptyString = stringToPrecomputedChunk('=""');
  737. function pushBooleanAttribute(target, name, value) {
  738. value &&
  739. "function" !== typeof value &&
  740. "symbol" !== typeof value &&
  741. target.push(attributeSeparator, name, attributeEmptyString);
  742. }
  743. function pushStringAttribute(target, name, value) {
  744. "function" !== typeof value &&
  745. "symbol" !== typeof value &&
  746. "boolean" !== typeof value &&
  747. target.push(
  748. attributeSeparator,
  749. name,
  750. attributeAssign,
  751. escapeTextForBrowser(value),
  752. attributeEnd
  753. );
  754. }
  755. var actionJavaScriptURL = stringToPrecomputedChunk(
  756. escapeTextForBrowser(
  757. "javascript:throw new Error('React form unexpectedly submitted.')"
  758. )
  759. ),
  760. startHiddenInputChunk = stringToPrecomputedChunk('<input type="hidden"');
  761. function pushAdditionalFormField(value, key) {
  762. this.push(startHiddenInputChunk);
  763. validateAdditionalFormField(value);
  764. pushStringAttribute(this, "name", key);
  765. pushStringAttribute(this, "value", value);
  766. this.push(endOfStartTagSelfClosing);
  767. }
  768. function validateAdditionalFormField(value) {
  769. if ("string" !== typeof value)
  770. throw Error(
  771. "File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."
  772. );
  773. }
  774. function getCustomFormFields(resumableState, formAction) {
  775. if ("function" === typeof formAction.$$FORM_ACTION) {
  776. var id = resumableState.nextFormID++;
  777. resumableState = resumableState.idPrefix + id;
  778. try {
  779. var customFields = formAction.$$FORM_ACTION(resumableState);
  780. if (customFields) {
  781. var formData = customFields.data;
  782. null != formData && formData.forEach(validateAdditionalFormField);
  783. }
  784. return customFields;
  785. } catch (x) {
  786. if ("object" === typeof x && null !== x && "function" === typeof x.then)
  787. throw x;
  788. }
  789. }
  790. return null;
  791. }
  792. function pushFormActionAttribute(
  793. target,
  794. resumableState,
  795. renderState,
  796. formAction,
  797. formEncType,
  798. formMethod,
  799. formTarget,
  800. name
  801. ) {
  802. var formData = null;
  803. if ("function" === typeof formAction) {
  804. var customFields = getCustomFormFields(resumableState, formAction);
  805. null !== customFields
  806. ? ((name = customFields.name),
  807. (formAction = customFields.action || ""),
  808. (formEncType = customFields.encType),
  809. (formMethod = customFields.method),
  810. (formTarget = customFields.target),
  811. (formData = customFields.data))
  812. : (target.push(
  813. attributeSeparator,
  814. "formAction",
  815. attributeAssign,
  816. actionJavaScriptURL,
  817. attributeEnd
  818. ),
  819. (formTarget = formMethod = formEncType = formAction = name = null),
  820. injectFormReplayingRuntime(resumableState, renderState));
  821. }
  822. null != name && pushAttribute(target, "name", name);
  823. null != formAction && pushAttribute(target, "formAction", formAction);
  824. null != formEncType && pushAttribute(target, "formEncType", formEncType);
  825. null != formMethod && pushAttribute(target, "formMethod", formMethod);
  826. null != formTarget && pushAttribute(target, "formTarget", formTarget);
  827. return formData;
  828. }
  829. function pushAttribute(target, name, value) {
  830. switch (name) {
  831. case "className":
  832. pushStringAttribute(target, "class", value);
  833. break;
  834. case "tabIndex":
  835. pushStringAttribute(target, "tabindex", value);
  836. break;
  837. case "dir":
  838. case "role":
  839. case "viewBox":
  840. case "width":
  841. case "height":
  842. pushStringAttribute(target, name, value);
  843. break;
  844. case "style":
  845. pushStyleAttribute(target, value);
  846. break;
  847. case "src":
  848. case "href":
  849. if ("" === value) break;
  850. case "action":
  851. case "formAction":
  852. if (
  853. null == value ||
  854. "function" === typeof value ||
  855. "symbol" === typeof value ||
  856. "boolean" === typeof value
  857. )
  858. break;
  859. value = sanitizeURL("" + value);
  860. target.push(
  861. attributeSeparator,
  862. name,
  863. attributeAssign,
  864. escapeTextForBrowser(value),
  865. attributeEnd
  866. );
  867. break;
  868. case "defaultValue":
  869. case "defaultChecked":
  870. case "innerHTML":
  871. case "suppressContentEditableWarning":
  872. case "suppressHydrationWarning":
  873. case "ref":
  874. break;
  875. case "autoFocus":
  876. case "multiple":
  877. case "muted":
  878. pushBooleanAttribute(target, name.toLowerCase(), value);
  879. break;
  880. case "xlinkHref":
  881. if (
  882. "function" === typeof value ||
  883. "symbol" === typeof value ||
  884. "boolean" === typeof value
  885. )
  886. break;
  887. value = sanitizeURL("" + value);
  888. target.push(
  889. attributeSeparator,
  890. "xlink:href",
  891. attributeAssign,
  892. escapeTextForBrowser(value),
  893. attributeEnd
  894. );
  895. break;
  896. case "contentEditable":
  897. case "spellCheck":
  898. case "draggable":
  899. case "value":
  900. case "autoReverse":
  901. case "externalResourcesRequired":
  902. case "focusable":
  903. case "preserveAlpha":
  904. "function" !== typeof value &&
  905. "symbol" !== typeof value &&
  906. target.push(
  907. attributeSeparator,
  908. name,
  909. attributeAssign,
  910. escapeTextForBrowser(value),
  911. attributeEnd
  912. );
  913. break;
  914. case "inert":
  915. case "allowFullScreen":
  916. case "async":
  917. case "autoPlay":
  918. case "controls":
  919. case "default":
  920. case "defer":
  921. case "disabled":
  922. case "disablePictureInPicture":
  923. case "disableRemotePlayback":
  924. case "formNoValidate":
  925. case "hidden":
  926. case "loop":
  927. case "noModule":
  928. case "noValidate":
  929. case "open":
  930. case "playsInline":
  931. case "readOnly":
  932. case "required":
  933. case "reversed":
  934. case "scoped":
  935. case "seamless":
  936. case "itemScope":
  937. value &&
  938. "function" !== typeof value &&
  939. "symbol" !== typeof value &&
  940. target.push(attributeSeparator, name, attributeEmptyString);
  941. break;
  942. case "capture":
  943. case "download":
  944. !0 === value
  945. ? target.push(attributeSeparator, name, attributeEmptyString)
  946. : !1 !== value &&
  947. "function" !== typeof value &&
  948. "symbol" !== typeof value &&
  949. target.push(
  950. attributeSeparator,
  951. name,
  952. attributeAssign,
  953. escapeTextForBrowser(value),
  954. attributeEnd
  955. );
  956. break;
  957. case "cols":
  958. case "rows":
  959. case "size":
  960. case "span":
  961. "function" !== typeof value &&
  962. "symbol" !== typeof value &&
  963. !isNaN(value) &&
  964. 1 <= value &&
  965. target.push(
  966. attributeSeparator,
  967. name,
  968. attributeAssign,
  969. escapeTextForBrowser(value),
  970. attributeEnd
  971. );
  972. break;
  973. case "rowSpan":
  974. case "start":
  975. "function" === typeof value ||
  976. "symbol" === typeof value ||
  977. isNaN(value) ||
  978. target.push(
  979. attributeSeparator,
  980. name,
  981. attributeAssign,
  982. escapeTextForBrowser(value),
  983. attributeEnd
  984. );
  985. break;
  986. case "xlinkActuate":
  987. pushStringAttribute(target, "xlink:actuate", value);
  988. break;
  989. case "xlinkArcrole":
  990. pushStringAttribute(target, "xlink:arcrole", value);
  991. break;
  992. case "xlinkRole":
  993. pushStringAttribute(target, "xlink:role", value);
  994. break;
  995. case "xlinkShow":
  996. pushStringAttribute(target, "xlink:show", value);
  997. break;
  998. case "xlinkTitle":
  999. pushStringAttribute(target, "xlink:title", value);
  1000. break;
  1001. case "xlinkType":
  1002. pushStringAttribute(target, "xlink:type", value);
  1003. break;
  1004. case "xmlBase":
  1005. pushStringAttribute(target, "xml:base", value);
  1006. break;
  1007. case "xmlLang":
  1008. pushStringAttribute(target, "xml:lang", value);
  1009. break;
  1010. case "xmlSpace":
  1011. pushStringAttribute(target, "xml:space", value);
  1012. break;
  1013. default:
  1014. if (
  1015. !(2 < name.length) ||
  1016. ("o" !== name[0] && "O" !== name[0]) ||
  1017. ("n" !== name[1] && "N" !== name[1])
  1018. )
  1019. if (((name = aliases.get(name) || name), isAttributeNameSafe(name))) {
  1020. switch (typeof value) {
  1021. case "function":
  1022. case "symbol":
  1023. return;
  1024. case "boolean":
  1025. var prefix$8 = name.toLowerCase().slice(0, 5);
  1026. if ("data-" !== prefix$8 && "aria-" !== prefix$8) return;
  1027. }
  1028. target.push(
  1029. attributeSeparator,
  1030. name,
  1031. attributeAssign,
  1032. escapeTextForBrowser(value),
  1033. attributeEnd
  1034. );
  1035. }
  1036. }
  1037. }
  1038. var endOfStartTag = stringToPrecomputedChunk(">"),
  1039. endOfStartTagSelfClosing = stringToPrecomputedChunk("/>");
  1040. function pushInnerHTML(target, innerHTML, children) {
  1041. if (null != innerHTML) {
  1042. if (null != children)
  1043. throw Error(
  1044. "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
  1045. );
  1046. if ("object" !== typeof innerHTML || !("__html" in innerHTML))
  1047. throw Error(
  1048. "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
  1049. );
  1050. innerHTML = innerHTML.__html;
  1051. null !== innerHTML && void 0 !== innerHTML && target.push("" + innerHTML);
  1052. }
  1053. }
  1054. function flattenOptionChildren(children) {
  1055. var content = "";
  1056. React.Children.forEach(children, function (child) {
  1057. null != child && (content += child);
  1058. });
  1059. return content;
  1060. }
  1061. var selectedMarkerAttribute = stringToPrecomputedChunk(' selected=""'),
  1062. formReplayingRuntimeScript = stringToPrecomputedChunk(
  1063. 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'
  1064. );
  1065. function injectFormReplayingRuntime(resumableState, renderState) {
  1066. if (0 === (resumableState.instructions & 16)) {
  1067. resumableState.instructions |= 16;
  1068. var preamble = renderState.preamble,
  1069. bootstrapChunks = renderState.bootstrapChunks;
  1070. (preamble.htmlChunks || preamble.headChunks) && 0 === bootstrapChunks.length
  1071. ? (bootstrapChunks.push(renderState.startInlineScript),
  1072. pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
  1073. bootstrapChunks.push(
  1074. endOfStartTag,
  1075. formReplayingRuntimeScript,
  1076. endInlineScript
  1077. ))
  1078. : bootstrapChunks.unshift(
  1079. renderState.startInlineScript,
  1080. endOfStartTag,
  1081. formReplayingRuntimeScript,
  1082. endInlineScript
  1083. );
  1084. }
  1085. }
  1086. var formStateMarkerIsMatching = stringToPrecomputedChunk("\x3c!--F!--\x3e"),
  1087. formStateMarkerIsNotMatching = stringToPrecomputedChunk("\x3c!--F--\x3e");
  1088. function pushLinkImpl(target, props) {
  1089. target.push(startChunkForTag("link"));
  1090. for (var propKey in props)
  1091. if (hasOwnProperty.call(props, propKey)) {
  1092. var propValue = props[propKey];
  1093. if (null != propValue)
  1094. switch (propKey) {
  1095. case "children":
  1096. case "dangerouslySetInnerHTML":
  1097. throw Error(
  1098. "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
  1099. );
  1100. default:
  1101. pushAttribute(target, propKey, propValue);
  1102. }
  1103. }
  1104. target.push(endOfStartTagSelfClosing);
  1105. return null;
  1106. }
  1107. var styleRegex = /(<\/|<)(s)(tyle)/gi;
  1108. function styleReplacer(match, prefix, s, suffix) {
  1109. return "" + prefix + ("s" === s ? "\\73 " : "\\53 ") + suffix;
  1110. }
  1111. function pushSelfClosing(target, props, tag) {
  1112. target.push(startChunkForTag(tag));
  1113. for (var propKey in props)
  1114. if (hasOwnProperty.call(props, propKey)) {
  1115. var propValue = props[propKey];
  1116. if (null != propValue)
  1117. switch (propKey) {
  1118. case "children":
  1119. case "dangerouslySetInnerHTML":
  1120. throw Error(
  1121. tag +
  1122. " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
  1123. );
  1124. default:
  1125. pushAttribute(target, propKey, propValue);
  1126. }
  1127. }
  1128. target.push(endOfStartTagSelfClosing);
  1129. return null;
  1130. }
  1131. function pushTitleImpl(target, props) {
  1132. target.push(startChunkForTag("title"));
  1133. var children = null,
  1134. innerHTML = null,
  1135. propKey;
  1136. for (propKey in props)
  1137. if (hasOwnProperty.call(props, propKey)) {
  1138. var propValue = props[propKey];
  1139. if (null != propValue)
  1140. switch (propKey) {
  1141. case "children":
  1142. children = propValue;
  1143. break;
  1144. case "dangerouslySetInnerHTML":
  1145. innerHTML = propValue;
  1146. break;
  1147. default:
  1148. pushAttribute(target, propKey, propValue);
  1149. }
  1150. }
  1151. target.push(endOfStartTag);
  1152. props = Array.isArray(children)
  1153. ? 2 > children.length
  1154. ? children[0]
  1155. : null
  1156. : children;
  1157. "function" !== typeof props &&
  1158. "symbol" !== typeof props &&
  1159. null !== props &&
  1160. void 0 !== props &&
  1161. target.push(escapeTextForBrowser("" + props));
  1162. pushInnerHTML(target, innerHTML, children);
  1163. target.push(endChunkForTag("title"));
  1164. return null;
  1165. }
  1166. var headPreambleContributionChunk =
  1167. stringToPrecomputedChunk("\x3c!--head--\x3e"),
  1168. bodyPreambleContributionChunk = stringToPrecomputedChunk("\x3c!--body--\x3e"),
  1169. htmlPreambleContributionChunk = stringToPrecomputedChunk("\x3c!--html--\x3e");
  1170. function pushScriptImpl(target, props) {
  1171. target.push(startChunkForTag("script"));
  1172. var children = null,
  1173. innerHTML = null,
  1174. propKey;
  1175. for (propKey in props)
  1176. if (hasOwnProperty.call(props, propKey)) {
  1177. var propValue = props[propKey];
  1178. if (null != propValue)
  1179. switch (propKey) {
  1180. case "children":
  1181. children = propValue;
  1182. break;
  1183. case "dangerouslySetInnerHTML":
  1184. innerHTML = propValue;
  1185. break;
  1186. default:
  1187. pushAttribute(target, propKey, propValue);
  1188. }
  1189. }
  1190. target.push(endOfStartTag);
  1191. pushInnerHTML(target, innerHTML, children);
  1192. "string" === typeof children &&
  1193. target.push(("" + children).replace(scriptRegex, scriptReplacer));
  1194. target.push(endChunkForTag("script"));
  1195. return null;
  1196. }
  1197. function pushStartSingletonElement(target, props, tag) {
  1198. target.push(startChunkForTag(tag));
  1199. var innerHTML = (tag = null),
  1200. propKey;
  1201. for (propKey in props)
  1202. if (hasOwnProperty.call(props, propKey)) {
  1203. var propValue = props[propKey];
  1204. if (null != propValue)
  1205. switch (propKey) {
  1206. case "children":
  1207. tag = propValue;
  1208. break;
  1209. case "dangerouslySetInnerHTML":
  1210. innerHTML = propValue;
  1211. break;
  1212. default:
  1213. pushAttribute(target, propKey, propValue);
  1214. }
  1215. }
  1216. target.push(endOfStartTag);
  1217. pushInnerHTML(target, innerHTML, tag);
  1218. return tag;
  1219. }
  1220. function pushStartGenericElement(target, props, tag) {
  1221. target.push(startChunkForTag(tag));
  1222. var innerHTML = (tag = null),
  1223. propKey;
  1224. for (propKey in props)
  1225. if (hasOwnProperty.call(props, propKey)) {
  1226. var propValue = props[propKey];
  1227. if (null != propValue)
  1228. switch (propKey) {
  1229. case "children":
  1230. tag = propValue;
  1231. break;
  1232. case "dangerouslySetInnerHTML":
  1233. innerHTML = propValue;
  1234. break;
  1235. default:
  1236. pushAttribute(target, propKey, propValue);
  1237. }
  1238. }
  1239. target.push(endOfStartTag);
  1240. pushInnerHTML(target, innerHTML, tag);
  1241. return "string" === typeof tag
  1242. ? (target.push(escapeTextForBrowser(tag)), null)
  1243. : tag;
  1244. }
  1245. var leadingNewline = stringToPrecomputedChunk("\n"),
  1246. VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,
  1247. validatedTagCache = new Map();
  1248. function startChunkForTag(tag) {
  1249. var tagStartChunk = validatedTagCache.get(tag);
  1250. if (void 0 === tagStartChunk) {
  1251. if (!VALID_TAG_REGEX.test(tag)) throw Error("Invalid tag: " + tag);
  1252. tagStartChunk = stringToPrecomputedChunk("<" + tag);
  1253. validatedTagCache.set(tag, tagStartChunk);
  1254. }
  1255. return tagStartChunk;
  1256. }
  1257. var doctypeChunk = stringToPrecomputedChunk("<!DOCTYPE html>");
  1258. function pushStartInstance(
  1259. target$jscomp$0,
  1260. type,
  1261. props,
  1262. resumableState,
  1263. renderState,
  1264. preambleState,
  1265. hoistableState,
  1266. formatContext,
  1267. textEmbedded
  1268. ) {
  1269. switch (type) {
  1270. case "div":
  1271. case "span":
  1272. case "svg":
  1273. case "path":
  1274. break;
  1275. case "a":
  1276. target$jscomp$0.push(startChunkForTag("a"));
  1277. var children = null,
  1278. innerHTML = null,
  1279. propKey;
  1280. for (propKey in props)
  1281. if (hasOwnProperty.call(props, propKey)) {
  1282. var propValue = props[propKey];
  1283. if (null != propValue)
  1284. switch (propKey) {
  1285. case "children":
  1286. children = propValue;
  1287. break;
  1288. case "dangerouslySetInnerHTML":
  1289. innerHTML = propValue;
  1290. break;
  1291. case "href":
  1292. "" === propValue
  1293. ? pushStringAttribute(target$jscomp$0, "href", "")
  1294. : pushAttribute(target$jscomp$0, propKey, propValue);
  1295. break;
  1296. default:
  1297. pushAttribute(target$jscomp$0, propKey, propValue);
  1298. }
  1299. }
  1300. target$jscomp$0.push(endOfStartTag);
  1301. pushInnerHTML(target$jscomp$0, innerHTML, children);
  1302. if ("string" === typeof children) {
  1303. target$jscomp$0.push(escapeTextForBrowser(children));
  1304. var JSCompiler_inline_result = null;
  1305. } else JSCompiler_inline_result = children;
  1306. return JSCompiler_inline_result;
  1307. case "g":
  1308. case "p":
  1309. case "li":
  1310. break;
  1311. case "select":
  1312. target$jscomp$0.push(startChunkForTag("select"));
  1313. var children$jscomp$0 = null,
  1314. innerHTML$jscomp$0 = null,
  1315. propKey$jscomp$0;
  1316. for (propKey$jscomp$0 in props)
  1317. if (hasOwnProperty.call(props, propKey$jscomp$0)) {
  1318. var propValue$jscomp$0 = props[propKey$jscomp$0];
  1319. if (null != propValue$jscomp$0)
  1320. switch (propKey$jscomp$0) {
  1321. case "children":
  1322. children$jscomp$0 = propValue$jscomp$0;
  1323. break;
  1324. case "dangerouslySetInnerHTML":
  1325. innerHTML$jscomp$0 = propValue$jscomp$0;
  1326. break;
  1327. case "defaultValue":
  1328. case "value":
  1329. break;
  1330. default:
  1331. pushAttribute(
  1332. target$jscomp$0,
  1333. propKey$jscomp$0,
  1334. propValue$jscomp$0
  1335. );
  1336. }
  1337. }
  1338. target$jscomp$0.push(endOfStartTag);
  1339. pushInnerHTML(target$jscomp$0, innerHTML$jscomp$0, children$jscomp$0);
  1340. return children$jscomp$0;
  1341. case "option":
  1342. var selectedValue = formatContext.selectedValue;
  1343. target$jscomp$0.push(startChunkForTag("option"));
  1344. var children$jscomp$1 = null,
  1345. value = null,
  1346. selected = null,
  1347. innerHTML$jscomp$1 = null,
  1348. propKey$jscomp$1;
  1349. for (propKey$jscomp$1 in props)
  1350. if (hasOwnProperty.call(props, propKey$jscomp$1)) {
  1351. var propValue$jscomp$1 = props[propKey$jscomp$1];
  1352. if (null != propValue$jscomp$1)
  1353. switch (propKey$jscomp$1) {
  1354. case "children":
  1355. children$jscomp$1 = propValue$jscomp$1;
  1356. break;
  1357. case "selected":
  1358. selected = propValue$jscomp$1;
  1359. break;
  1360. case "dangerouslySetInnerHTML":
  1361. innerHTML$jscomp$1 = propValue$jscomp$1;
  1362. break;
  1363. case "value":
  1364. value = propValue$jscomp$1;
  1365. default:
  1366. pushAttribute(
  1367. target$jscomp$0,
  1368. propKey$jscomp$1,
  1369. propValue$jscomp$1
  1370. );
  1371. }
  1372. }
  1373. if (null != selectedValue) {
  1374. var stringValue =
  1375. null !== value
  1376. ? "" + value
  1377. : flattenOptionChildren(children$jscomp$1);
  1378. if (isArrayImpl(selectedValue))
  1379. for (var i = 0; i < selectedValue.length; i++) {
  1380. if ("" + selectedValue[i] === stringValue) {
  1381. target$jscomp$0.push(selectedMarkerAttribute);
  1382. break;
  1383. }
  1384. }
  1385. else
  1386. "" + selectedValue === stringValue &&
  1387. target$jscomp$0.push(selectedMarkerAttribute);
  1388. } else selected && target$jscomp$0.push(selectedMarkerAttribute);
  1389. target$jscomp$0.push(endOfStartTag);
  1390. pushInnerHTML(target$jscomp$0, innerHTML$jscomp$1, children$jscomp$1);
  1391. return children$jscomp$1;
  1392. case "textarea":
  1393. target$jscomp$0.push(startChunkForTag("textarea"));
  1394. var value$jscomp$0 = null,
  1395. defaultValue = null,
  1396. children$jscomp$2 = null,
  1397. propKey$jscomp$2;
  1398. for (propKey$jscomp$2 in props)
  1399. if (hasOwnProperty.call(props, propKey$jscomp$2)) {
  1400. var propValue$jscomp$2 = props[propKey$jscomp$2];
  1401. if (null != propValue$jscomp$2)
  1402. switch (propKey$jscomp$2) {
  1403. case "children":
  1404. children$jscomp$2 = propValue$jscomp$2;
  1405. break;
  1406. case "value":
  1407. value$jscomp$0 = propValue$jscomp$2;
  1408. break;
  1409. case "defaultValue":
  1410. defaultValue = propValue$jscomp$2;
  1411. break;
  1412. case "dangerouslySetInnerHTML":
  1413. throw Error(
  1414. "`dangerouslySetInnerHTML` does not make sense on <textarea>."
  1415. );
  1416. default:
  1417. pushAttribute(
  1418. target$jscomp$0,
  1419. propKey$jscomp$2,
  1420. propValue$jscomp$2
  1421. );
  1422. }
  1423. }
  1424. null === value$jscomp$0 &&
  1425. null !== defaultValue &&
  1426. (value$jscomp$0 = defaultValue);
  1427. target$jscomp$0.push(endOfStartTag);
  1428. if (null != children$jscomp$2) {
  1429. if (null != value$jscomp$0)
  1430. throw Error(
  1431. "If you supply `defaultValue` on a <textarea>, do not pass children."
  1432. );
  1433. if (isArrayImpl(children$jscomp$2)) {
  1434. if (1 < children$jscomp$2.length)
  1435. throw Error("<textarea> can only have at most one child.");
  1436. value$jscomp$0 = "" + children$jscomp$2[0];
  1437. }
  1438. value$jscomp$0 = "" + children$jscomp$2;
  1439. }
  1440. "string" === typeof value$jscomp$0 &&
  1441. "\n" === value$jscomp$0[0] &&
  1442. target$jscomp$0.push(leadingNewline);
  1443. null !== value$jscomp$0 &&
  1444. target$jscomp$0.push(escapeTextForBrowser("" + value$jscomp$0));
  1445. return null;
  1446. case "input":
  1447. target$jscomp$0.push(startChunkForTag("input"));
  1448. var name = null,
  1449. formAction = null,
  1450. formEncType = null,
  1451. formMethod = null,
  1452. formTarget = null,
  1453. value$jscomp$1 = null,
  1454. defaultValue$jscomp$0 = null,
  1455. checked = null,
  1456. defaultChecked = null,
  1457. propKey$jscomp$3;
  1458. for (propKey$jscomp$3 in props)
  1459. if (hasOwnProperty.call(props, propKey$jscomp$3)) {
  1460. var propValue$jscomp$3 = props[propKey$jscomp$3];
  1461. if (null != propValue$jscomp$3)
  1462. switch (propKey$jscomp$3) {
  1463. case "children":
  1464. case "dangerouslySetInnerHTML":
  1465. throw Error(
  1466. "input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
  1467. );
  1468. case "name":
  1469. name = propValue$jscomp$3;
  1470. break;
  1471. case "formAction":
  1472. formAction = propValue$jscomp$3;
  1473. break;
  1474. case "formEncType":
  1475. formEncType = propValue$jscomp$3;
  1476. break;
  1477. case "formMethod":
  1478. formMethod = propValue$jscomp$3;
  1479. break;
  1480. case "formTarget":
  1481. formTarget = propValue$jscomp$3;
  1482. break;
  1483. case "defaultChecked":
  1484. defaultChecked = propValue$jscomp$3;
  1485. break;
  1486. case "defaultValue":
  1487. defaultValue$jscomp$0 = propValue$jscomp$3;
  1488. break;
  1489. case "checked":
  1490. checked = propValue$jscomp$3;
  1491. break;
  1492. case "value":
  1493. value$jscomp$1 = propValue$jscomp$3;
  1494. break;
  1495. default:
  1496. pushAttribute(
  1497. target$jscomp$0,
  1498. propKey$jscomp$3,
  1499. propValue$jscomp$3
  1500. );
  1501. }
  1502. }
  1503. var formData = pushFormActionAttribute(
  1504. target$jscomp$0,
  1505. resumableState,
  1506. renderState,
  1507. formAction,
  1508. formEncType,
  1509. formMethod,
  1510. formTarget,
  1511. name
  1512. );
  1513. null !== checked
  1514. ? pushBooleanAttribute(target$jscomp$0, "checked", checked)
  1515. : null !== defaultChecked &&
  1516. pushBooleanAttribute(target$jscomp$0, "checked", defaultChecked);
  1517. null !== value$jscomp$1
  1518. ? pushAttribute(target$jscomp$0, "value", value$jscomp$1)
  1519. : null !== defaultValue$jscomp$0 &&
  1520. pushAttribute(target$jscomp$0, "value", defaultValue$jscomp$0);
  1521. target$jscomp$0.push(endOfStartTagSelfClosing);
  1522. null != formData &&
  1523. formData.forEach(pushAdditionalFormField, target$jscomp$0);
  1524. return null;
  1525. case "button":
  1526. target$jscomp$0.push(startChunkForTag("button"));
  1527. var children$jscomp$3 = null,
  1528. innerHTML$jscomp$2 = null,
  1529. name$jscomp$0 = null,
  1530. formAction$jscomp$0 = null,
  1531. formEncType$jscomp$0 = null,
  1532. formMethod$jscomp$0 = null,
  1533. formTarget$jscomp$0 = null,
  1534. propKey$jscomp$4;
  1535. for (propKey$jscomp$4 in props)
  1536. if (hasOwnProperty.call(props, propKey$jscomp$4)) {
  1537. var propValue$jscomp$4 = props[propKey$jscomp$4];
  1538. if (null != propValue$jscomp$4)
  1539. switch (propKey$jscomp$4) {
  1540. case "children":
  1541. children$jscomp$3 = propValue$jscomp$4;
  1542. break;
  1543. case "dangerouslySetInnerHTML":
  1544. innerHTML$jscomp$2 = propValue$jscomp$4;
  1545. break;
  1546. case "name":
  1547. name$jscomp$0 = propValue$jscomp$4;
  1548. break;
  1549. case "formAction":
  1550. formAction$jscomp$0 = propValue$jscomp$4;
  1551. break;
  1552. case "formEncType":
  1553. formEncType$jscomp$0 = propValue$jscomp$4;
  1554. break;
  1555. case "formMethod":
  1556. formMethod$jscomp$0 = propValue$jscomp$4;
  1557. break;
  1558. case "formTarget":
  1559. formTarget$jscomp$0 = propValue$jscomp$4;
  1560. break;
  1561. default:
  1562. pushAttribute(
  1563. target$jscomp$0,
  1564. propKey$jscomp$4,
  1565. propValue$jscomp$4
  1566. );
  1567. }
  1568. }
  1569. var formData$jscomp$0 = pushFormActionAttribute(
  1570. target$jscomp$0,
  1571. resumableState,
  1572. renderState,
  1573. formAction$jscomp$0,
  1574. formEncType$jscomp$0,
  1575. formMethod$jscomp$0,
  1576. formTarget$jscomp$0,
  1577. name$jscomp$0
  1578. );
  1579. target$jscomp$0.push(endOfStartTag);
  1580. null != formData$jscomp$0 &&
  1581. formData$jscomp$0.forEach(pushAdditionalFormField, target$jscomp$0);
  1582. pushInnerHTML(target$jscomp$0, innerHTML$jscomp$2, children$jscomp$3);
  1583. if ("string" === typeof children$jscomp$3) {
  1584. target$jscomp$0.push(escapeTextForBrowser(children$jscomp$3));
  1585. var JSCompiler_inline_result$jscomp$0 = null;
  1586. } else JSCompiler_inline_result$jscomp$0 = children$jscomp$3;
  1587. return JSCompiler_inline_result$jscomp$0;
  1588. case "form":
  1589. target$jscomp$0.push(startChunkForTag("form"));
  1590. var children$jscomp$4 = null,
  1591. innerHTML$jscomp$3 = null,
  1592. formAction$jscomp$1 = null,
  1593. formEncType$jscomp$1 = null,
  1594. formMethod$jscomp$1 = null,
  1595. formTarget$jscomp$1 = null,
  1596. propKey$jscomp$5;
  1597. for (propKey$jscomp$5 in props)
  1598. if (hasOwnProperty.call(props, propKey$jscomp$5)) {
  1599. var propValue$jscomp$5 = props[propKey$jscomp$5];
  1600. if (null != propValue$jscomp$5)
  1601. switch (propKey$jscomp$5) {
  1602. case "children":
  1603. children$jscomp$4 = propValue$jscomp$5;
  1604. break;
  1605. case "dangerouslySetInnerHTML":
  1606. innerHTML$jscomp$3 = propValue$jscomp$5;
  1607. break;
  1608. case "action":
  1609. formAction$jscomp$1 = propValue$jscomp$5;
  1610. break;
  1611. case "encType":
  1612. formEncType$jscomp$1 = propValue$jscomp$5;
  1613. break;
  1614. case "method":
  1615. formMethod$jscomp$1 = propValue$jscomp$5;
  1616. break;
  1617. case "target":
  1618. formTarget$jscomp$1 = propValue$jscomp$5;
  1619. break;
  1620. default:
  1621. pushAttribute(
  1622. target$jscomp$0,
  1623. propKey$jscomp$5,
  1624. propValue$jscomp$5
  1625. );
  1626. }
  1627. }
  1628. var formData$jscomp$1 = null,
  1629. formActionName = null;
  1630. if ("function" === typeof formAction$jscomp$1) {
  1631. var customFields = getCustomFormFields(
  1632. resumableState,
  1633. formAction$jscomp$1
  1634. );
  1635. null !== customFields
  1636. ? ((formAction$jscomp$1 = customFields.action || ""),
  1637. (formEncType$jscomp$1 = customFields.encType),
  1638. (formMethod$jscomp$1 = customFields.method),
  1639. (formTarget$jscomp$1 = customFields.target),
  1640. (formData$jscomp$1 = customFields.data),
  1641. (formActionName = customFields.name))
  1642. : (target$jscomp$0.push(
  1643. attributeSeparator,
  1644. "action",
  1645. attributeAssign,
  1646. actionJavaScriptURL,
  1647. attributeEnd
  1648. ),
  1649. (formTarget$jscomp$1 =
  1650. formMethod$jscomp$1 =
  1651. formEncType$jscomp$1 =
  1652. formAction$jscomp$1 =
  1653. null),
  1654. injectFormReplayingRuntime(resumableState, renderState));
  1655. }
  1656. null != formAction$jscomp$1 &&
  1657. pushAttribute(target$jscomp$0, "action", formAction$jscomp$1);
  1658. null != formEncType$jscomp$1 &&
  1659. pushAttribute(target$jscomp$0, "encType", formEncType$jscomp$1);
  1660. null != formMethod$jscomp$1 &&
  1661. pushAttribute(target$jscomp$0, "method", formMethod$jscomp$1);
  1662. null != formTarget$jscomp$1 &&
  1663. pushAttribute(target$jscomp$0, "target", formTarget$jscomp$1);
  1664. target$jscomp$0.push(endOfStartTag);
  1665. null !== formActionName &&
  1666. (target$jscomp$0.push(startHiddenInputChunk),
  1667. pushStringAttribute(target$jscomp$0, "name", formActionName),
  1668. target$jscomp$0.push(endOfStartTagSelfClosing),
  1669. null != formData$jscomp$1 &&
  1670. formData$jscomp$1.forEach(pushAdditionalFormField, target$jscomp$0));
  1671. pushInnerHTML(target$jscomp$0, innerHTML$jscomp$3, children$jscomp$4);
  1672. if ("string" === typeof children$jscomp$4) {
  1673. target$jscomp$0.push(escapeTextForBrowser(children$jscomp$4));
  1674. var JSCompiler_inline_result$jscomp$1 = null;
  1675. } else JSCompiler_inline_result$jscomp$1 = children$jscomp$4;
  1676. return JSCompiler_inline_result$jscomp$1;
  1677. case "menuitem":
  1678. target$jscomp$0.push(startChunkForTag("menuitem"));
  1679. for (var propKey$jscomp$6 in props)
  1680. if (hasOwnProperty.call(props, propKey$jscomp$6)) {
  1681. var propValue$jscomp$6 = props[propKey$jscomp$6];
  1682. if (null != propValue$jscomp$6)
  1683. switch (propKey$jscomp$6) {
  1684. case "children":
  1685. case "dangerouslySetInnerHTML":
  1686. throw Error(
  1687. "menuitems cannot have `children` nor `dangerouslySetInnerHTML`."
  1688. );
  1689. default:
  1690. pushAttribute(
  1691. target$jscomp$0,
  1692. propKey$jscomp$6,
  1693. propValue$jscomp$6
  1694. );
  1695. }
  1696. }
  1697. target$jscomp$0.push(endOfStartTag);
  1698. return null;
  1699. case "object":
  1700. target$jscomp$0.push(startChunkForTag("object"));
  1701. var children$jscomp$5 = null,
  1702. innerHTML$jscomp$4 = null,
  1703. propKey$jscomp$7;
  1704. for (propKey$jscomp$7 in props)
  1705. if (hasOwnProperty.call(props, propKey$jscomp$7)) {
  1706. var propValue$jscomp$7 = props[propKey$jscomp$7];
  1707. if (null != propValue$jscomp$7)
  1708. switch (propKey$jscomp$7) {
  1709. case "children":
  1710. children$jscomp$5 = propValue$jscomp$7;
  1711. break;
  1712. case "dangerouslySetInnerHTML":
  1713. innerHTML$jscomp$4 = propValue$jscomp$7;
  1714. break;
  1715. case "data":
  1716. var sanitizedValue = sanitizeURL("" + propValue$jscomp$7);
  1717. if ("" === sanitizedValue) break;
  1718. target$jscomp$0.push(
  1719. attributeSeparator,
  1720. "data",
  1721. attributeAssign,
  1722. escapeTextForBrowser(sanitizedValue),
  1723. attributeEnd
  1724. );
  1725. break;
  1726. default:
  1727. pushAttribute(
  1728. target$jscomp$0,
  1729. propKey$jscomp$7,
  1730. propValue$jscomp$7
  1731. );
  1732. }
  1733. }
  1734. target$jscomp$0.push(endOfStartTag);
  1735. pushInnerHTML(target$jscomp$0, innerHTML$jscomp$4, children$jscomp$5);
  1736. if ("string" === typeof children$jscomp$5) {
  1737. target$jscomp$0.push(escapeTextForBrowser(children$jscomp$5));
  1738. var JSCompiler_inline_result$jscomp$2 = null;
  1739. } else JSCompiler_inline_result$jscomp$2 = children$jscomp$5;
  1740. return JSCompiler_inline_result$jscomp$2;
  1741. case "title":
  1742. var noscriptTagInScope = formatContext.tagScope & 1,
  1743. isFallback = formatContext.tagScope & 4;
  1744. if (
  1745. 4 === formatContext.insertionMode ||
  1746. noscriptTagInScope ||
  1747. null != props.itemProp
  1748. )
  1749. var JSCompiler_inline_result$jscomp$3 = pushTitleImpl(
  1750. target$jscomp$0,
  1751. props
  1752. );
  1753. else
  1754. isFallback
  1755. ? (JSCompiler_inline_result$jscomp$3 = null)
  1756. : (pushTitleImpl(renderState.hoistableChunks, props),
  1757. (JSCompiler_inline_result$jscomp$3 = void 0));
  1758. return JSCompiler_inline_result$jscomp$3;
  1759. case "link":
  1760. var noscriptTagInScope$jscomp$0 = formatContext.tagScope & 1,
  1761. isFallback$jscomp$0 = formatContext.tagScope & 4,
  1762. rel = props.rel,
  1763. href = props.href,
  1764. precedence = props.precedence;
  1765. if (
  1766. 4 === formatContext.insertionMode ||
  1767. noscriptTagInScope$jscomp$0 ||
  1768. null != props.itemProp ||
  1769. "string" !== typeof rel ||
  1770. "string" !== typeof href ||
  1771. "" === href
  1772. ) {
  1773. pushLinkImpl(target$jscomp$0, props);
  1774. var JSCompiler_inline_result$jscomp$4 = null;
  1775. } else if ("stylesheet" === props.rel)
  1776. if (
  1777. "string" !== typeof precedence ||
  1778. null != props.disabled ||
  1779. props.onLoad ||
  1780. props.onError
  1781. )
  1782. JSCompiler_inline_result$jscomp$4 = pushLinkImpl(
  1783. target$jscomp$0,
  1784. props
  1785. );
  1786. else {
  1787. var styleQueue = renderState.styles.get(precedence),
  1788. resourceState = resumableState.styleResources.hasOwnProperty(href)
  1789. ? resumableState.styleResources[href]
  1790. : void 0;
  1791. if (null !== resourceState) {
  1792. resumableState.styleResources[href] = null;
  1793. styleQueue ||
  1794. ((styleQueue = {
  1795. precedence: escapeTextForBrowser(precedence),
  1796. rules: [],
  1797. hrefs: [],
  1798. sheets: new Map()
  1799. }),
  1800. renderState.styles.set(precedence, styleQueue));
  1801. var resource = {
  1802. state: 0,
  1803. props: assign({}, props, {
  1804. "data-precedence": props.precedence,
  1805. precedence: null
  1806. })
  1807. };
  1808. if (resourceState) {
  1809. 2 === resourceState.length &&
  1810. adoptPreloadCredentials(resource.props, resourceState);
  1811. var preloadResource = renderState.preloads.stylesheets.get(href);
  1812. preloadResource && 0 < preloadResource.length
  1813. ? (preloadResource.length = 0)
  1814. : (resource.state = 1);
  1815. }
  1816. styleQueue.sheets.set(href, resource);
  1817. hoistableState && hoistableState.stylesheets.add(resource);
  1818. } else if (styleQueue) {
  1819. var resource$9 = styleQueue.sheets.get(href);
  1820. resource$9 &&
  1821. hoistableState &&
  1822. hoistableState.stylesheets.add(resource$9);
  1823. }
  1824. textEmbedded && target$jscomp$0.push(textSeparator);
  1825. JSCompiler_inline_result$jscomp$4 = null;
  1826. }
  1827. else
  1828. props.onLoad || props.onError
  1829. ? (JSCompiler_inline_result$jscomp$4 = pushLinkImpl(
  1830. target$jscomp$0,
  1831. props
  1832. ))
  1833. : (textEmbedded && target$jscomp$0.push(textSeparator),
  1834. (JSCompiler_inline_result$jscomp$4 = isFallback$jscomp$0
  1835. ? null
  1836. : pushLinkImpl(renderState.hoistableChunks, props)));
  1837. return JSCompiler_inline_result$jscomp$4;
  1838. case "script":
  1839. var noscriptTagInScope$jscomp$1 = formatContext.tagScope & 1,
  1840. asyncProp = props.async;
  1841. if (
  1842. "string" !== typeof props.src ||
  1843. !props.src ||
  1844. !asyncProp ||
  1845. "function" === typeof asyncProp ||
  1846. "symbol" === typeof asyncProp ||
  1847. props.onLoad ||
  1848. props.onError ||
  1849. 4 === formatContext.insertionMode ||
  1850. noscriptTagInScope$jscomp$1 ||
  1851. null != props.itemProp
  1852. )
  1853. var JSCompiler_inline_result$jscomp$5 = pushScriptImpl(
  1854. target$jscomp$0,
  1855. props
  1856. );
  1857. else {
  1858. var key = props.src;
  1859. if ("module" === props.type) {
  1860. var resources = resumableState.moduleScriptResources;
  1861. var preloads = renderState.preloads.moduleScripts;
  1862. } else
  1863. (resources = resumableState.scriptResources),
  1864. (preloads = renderState.preloads.scripts);
  1865. var resourceState$jscomp$0 = resources.hasOwnProperty(key)
  1866. ? resources[key]
  1867. : void 0;
  1868. if (null !== resourceState$jscomp$0) {
  1869. resources[key] = null;
  1870. var scriptProps = props;
  1871. if (resourceState$jscomp$0) {
  1872. 2 === resourceState$jscomp$0.length &&
  1873. ((scriptProps = assign({}, props)),
  1874. adoptPreloadCredentials(scriptProps, resourceState$jscomp$0));
  1875. var preloadResource$jscomp$0 = preloads.get(key);
  1876. preloadResource$jscomp$0 && (preloadResource$jscomp$0.length = 0);
  1877. }
  1878. var resource$jscomp$0 = [];
  1879. renderState.scripts.add(resource$jscomp$0);
  1880. pushScriptImpl(resource$jscomp$0, scriptProps);
  1881. }
  1882. textEmbedded && target$jscomp$0.push(textSeparator);
  1883. JSCompiler_inline_result$jscomp$5 = null;
  1884. }
  1885. return JSCompiler_inline_result$jscomp$5;
  1886. case "style":
  1887. var noscriptTagInScope$jscomp$2 = formatContext.tagScope & 1,
  1888. precedence$jscomp$0 = props.precedence,
  1889. href$jscomp$0 = props.href,
  1890. nonce = props.nonce;
  1891. if (
  1892. 4 === formatContext.insertionMode ||
  1893. noscriptTagInScope$jscomp$2 ||
  1894. null != props.itemProp ||
  1895. "string" !== typeof precedence$jscomp$0 ||
  1896. "string" !== typeof href$jscomp$0 ||
  1897. "" === href$jscomp$0
  1898. ) {
  1899. target$jscomp$0.push(startChunkForTag("style"));
  1900. var children$jscomp$6 = null,
  1901. innerHTML$jscomp$5 = null,
  1902. propKey$jscomp$8;
  1903. for (propKey$jscomp$8 in props)
  1904. if (hasOwnProperty.call(props, propKey$jscomp$8)) {
  1905. var propValue$jscomp$8 = props[propKey$jscomp$8];
  1906. if (null != propValue$jscomp$8)
  1907. switch (propKey$jscomp$8) {
  1908. case "children":
  1909. children$jscomp$6 = propValue$jscomp$8;
  1910. break;
  1911. case "dangerouslySetInnerHTML":
  1912. innerHTML$jscomp$5 = propValue$jscomp$8;
  1913. break;
  1914. default:
  1915. pushAttribute(
  1916. target$jscomp$0,
  1917. propKey$jscomp$8,
  1918. propValue$jscomp$8
  1919. );
  1920. }
  1921. }
  1922. target$jscomp$0.push(endOfStartTag);
  1923. var child = Array.isArray(children$jscomp$6)
  1924. ? 2 > children$jscomp$6.length
  1925. ? children$jscomp$6[0]
  1926. : null
  1927. : children$jscomp$6;
  1928. "function" !== typeof child &&
  1929. "symbol" !== typeof child &&
  1930. null !== child &&
  1931. void 0 !== child &&
  1932. target$jscomp$0.push(("" + child).replace(styleRegex, styleReplacer));
  1933. pushInnerHTML(target$jscomp$0, innerHTML$jscomp$5, children$jscomp$6);
  1934. target$jscomp$0.push(endChunkForTag("style"));
  1935. var JSCompiler_inline_result$jscomp$6 = null;
  1936. } else {
  1937. var styleQueue$jscomp$0 = renderState.styles.get(precedence$jscomp$0);
  1938. if (
  1939. null !==
  1940. (resumableState.styleResources.hasOwnProperty(href$jscomp$0)
  1941. ? resumableState.styleResources[href$jscomp$0]
  1942. : void 0)
  1943. ) {
  1944. resumableState.styleResources[href$jscomp$0] = null;
  1945. styleQueue$jscomp$0 ||
  1946. ((styleQueue$jscomp$0 = {
  1947. precedence: escapeTextForBrowser(precedence$jscomp$0),
  1948. rules: [],
  1949. hrefs: [],
  1950. sheets: new Map()
  1951. }),
  1952. renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
  1953. var nonceStyle = renderState.nonce.style;
  1954. if (!nonceStyle || nonceStyle === nonce) {
  1955. styleQueue$jscomp$0.hrefs.push(escapeTextForBrowser(href$jscomp$0));
  1956. var target = styleQueue$jscomp$0.rules,
  1957. children$jscomp$7 = null,
  1958. innerHTML$jscomp$6 = null,
  1959. propKey$jscomp$9;
  1960. for (propKey$jscomp$9 in props)
  1961. if (hasOwnProperty.call(props, propKey$jscomp$9)) {
  1962. var propValue$jscomp$9 = props[propKey$jscomp$9];
  1963. if (null != propValue$jscomp$9)
  1964. switch (propKey$jscomp$9) {
  1965. case "children":
  1966. children$jscomp$7 = propValue$jscomp$9;
  1967. break;
  1968. case "dangerouslySetInnerHTML":
  1969. innerHTML$jscomp$6 = propValue$jscomp$9;
  1970. }
  1971. }
  1972. var child$jscomp$0 = Array.isArray(children$jscomp$7)
  1973. ? 2 > children$jscomp$7.length
  1974. ? children$jscomp$7[0]
  1975. : null
  1976. : children$jscomp$7;
  1977. "function" !== typeof child$jscomp$0 &&
  1978. "symbol" !== typeof child$jscomp$0 &&
  1979. null !== child$jscomp$0 &&
  1980. void 0 !== child$jscomp$0 &&
  1981. target.push(
  1982. ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
  1983. );
  1984. pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
  1985. }
  1986. }
  1987. styleQueue$jscomp$0 &&
  1988. hoistableState &&
  1989. hoistableState.styles.add(styleQueue$jscomp$0);
  1990. textEmbedded && target$jscomp$0.push(textSeparator);
  1991. JSCompiler_inline_result$jscomp$6 = void 0;
  1992. }
  1993. return JSCompiler_inline_result$jscomp$6;
  1994. case "meta":
  1995. var noscriptTagInScope$jscomp$3 = formatContext.tagScope & 1,
  1996. isFallback$jscomp$1 = formatContext.tagScope & 4;
  1997. if (
  1998. 4 === formatContext.insertionMode ||
  1999. noscriptTagInScope$jscomp$3 ||
  2000. null != props.itemProp
  2001. )
  2002. var JSCompiler_inline_result$jscomp$7 = pushSelfClosing(
  2003. target$jscomp$0,
  2004. props,
  2005. "meta"
  2006. );
  2007. else
  2008. textEmbedded && target$jscomp$0.push(textSeparator),
  2009. (JSCompiler_inline_result$jscomp$7 = isFallback$jscomp$1
  2010. ? null
  2011. : "string" === typeof props.charSet
  2012. ? pushSelfClosing(renderState.charsetChunks, props, "meta")
  2013. : "viewport" === props.name
  2014. ? pushSelfClosing(renderState.viewportChunks, props, "meta")
  2015. : pushSelfClosing(renderState.hoistableChunks, props, "meta"));
  2016. return JSCompiler_inline_result$jscomp$7;
  2017. case "listing":
  2018. case "pre":
  2019. target$jscomp$0.push(startChunkForTag(type));
  2020. var children$jscomp$8 = null,
  2021. innerHTML$jscomp$7 = null,
  2022. propKey$jscomp$10;
  2023. for (propKey$jscomp$10 in props)
  2024. if (hasOwnProperty.call(props, propKey$jscomp$10)) {
  2025. var propValue$jscomp$10 = props[propKey$jscomp$10];
  2026. if (null != propValue$jscomp$10)
  2027. switch (propKey$jscomp$10) {
  2028. case "children":
  2029. children$jscomp$8 = propValue$jscomp$10;
  2030. break;
  2031. case "dangerouslySetInnerHTML":
  2032. innerHTML$jscomp$7 = propValue$jscomp$10;
  2033. break;
  2034. default:
  2035. pushAttribute(
  2036. target$jscomp$0,
  2037. propKey$jscomp$10,
  2038. propValue$jscomp$10
  2039. );
  2040. }
  2041. }
  2042. target$jscomp$0.push(endOfStartTag);
  2043. if (null != innerHTML$jscomp$7) {
  2044. if (null != children$jscomp$8)
  2045. throw Error(
  2046. "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
  2047. );
  2048. if (
  2049. "object" !== typeof innerHTML$jscomp$7 ||
  2050. !("__html" in innerHTML$jscomp$7)
  2051. )
  2052. throw Error(
  2053. "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
  2054. );
  2055. var html = innerHTML$jscomp$7.__html;
  2056. null !== html &&
  2057. void 0 !== html &&
  2058. ("string" === typeof html && 0 < html.length && "\n" === html[0]
  2059. ? target$jscomp$0.push(leadingNewline, html)
  2060. : target$jscomp$0.push("" + html));
  2061. }
  2062. "string" === typeof children$jscomp$8 &&
  2063. "\n" === children$jscomp$8[0] &&
  2064. target$jscomp$0.push(leadingNewline);
  2065. return children$jscomp$8;
  2066. case "img":
  2067. var pictureOrNoScriptTagInScope = formatContext.tagScope & 3,
  2068. src = props.src,
  2069. srcSet = props.srcSet;
  2070. if (
  2071. !(
  2072. "lazy" === props.loading ||
  2073. (!src && !srcSet) ||
  2074. ("string" !== typeof src && null != src) ||
  2075. ("string" !== typeof srcSet && null != srcSet) ||
  2076. "low" === props.fetchPriority ||
  2077. pictureOrNoScriptTagInScope
  2078. ) &&
  2079. ("string" !== typeof src ||
  2080. ":" !== src[4] ||
  2081. ("d" !== src[0] && "D" !== src[0]) ||
  2082. ("a" !== src[1] && "A" !== src[1]) ||
  2083. ("t" !== src[2] && "T" !== src[2]) ||
  2084. ("a" !== src[3] && "A" !== src[3])) &&
  2085. ("string" !== typeof srcSet ||
  2086. ":" !== srcSet[4] ||
  2087. ("d" !== srcSet[0] && "D" !== srcSet[0]) ||
  2088. ("a" !== srcSet[1] && "A" !== srcSet[1]) ||
  2089. ("t" !== srcSet[2] && "T" !== srcSet[2]) ||
  2090. ("a" !== srcSet[3] && "A" !== srcSet[3]))
  2091. ) {
  2092. null !== hoistableState &&
  2093. formatContext.tagScope & 64 &&
  2094. (hoistableState.suspenseyImages = !0);
  2095. var sizes = "string" === typeof props.sizes ? props.sizes : void 0,
  2096. key$jscomp$0 = srcSet ? srcSet + "\n" + (sizes || "") : src,
  2097. promotablePreloads = renderState.preloads.images,
  2098. resource$jscomp$1 = promotablePreloads.get(key$jscomp$0);
  2099. if (resource$jscomp$1) {
  2100. if (
  2101. "high" === props.fetchPriority ||
  2102. 10 > renderState.highImagePreloads.size
  2103. )
  2104. promotablePreloads.delete(key$jscomp$0),
  2105. renderState.highImagePreloads.add(resource$jscomp$1);
  2106. } else if (
  2107. !resumableState.imageResources.hasOwnProperty(key$jscomp$0)
  2108. ) {
  2109. resumableState.imageResources[key$jscomp$0] = PRELOAD_NO_CREDS;
  2110. var input = props.crossOrigin;
  2111. var JSCompiler_inline_result$jscomp$8 =
  2112. "string" === typeof input
  2113. ? "use-credentials" === input
  2114. ? input
  2115. : ""
  2116. : void 0;
  2117. var headers = renderState.headers,
  2118. header;
  2119. headers &&
  2120. 0 < headers.remainingCapacity &&
  2121. "string" !== typeof props.srcSet &&
  2122. ("high" === props.fetchPriority ||
  2123. 500 > headers.highImagePreloads.length) &&
  2124. ((header = getPreloadAsHeader(src, "image", {
  2125. imageSrcSet: props.srcSet,
  2126. imageSizes: props.sizes,
  2127. crossOrigin: JSCompiler_inline_result$jscomp$8,
  2128. integrity: props.integrity,
  2129. nonce: props.nonce,
  2130. type: props.type,
  2131. fetchPriority: props.fetchPriority,
  2132. referrerPolicy: props.refererPolicy
  2133. })),
  2134. 0 <= (headers.remainingCapacity -= header.length + 2))
  2135. ? ((renderState.resets.image[key$jscomp$0] = PRELOAD_NO_CREDS),
  2136. headers.highImagePreloads && (headers.highImagePreloads += ", "),
  2137. (headers.highImagePreloads += header))
  2138. : ((resource$jscomp$1 = []),
  2139. pushLinkImpl(resource$jscomp$1, {
  2140. rel: "preload",
  2141. as: "image",
  2142. href: srcSet ? void 0 : src,
  2143. imageSrcSet: srcSet,
  2144. imageSizes: sizes,
  2145. crossOrigin: JSCompiler_inline_result$jscomp$8,
  2146. integrity: props.integrity,
  2147. type: props.type,
  2148. fetchPriority: props.fetchPriority,
  2149. referrerPolicy: props.referrerPolicy
  2150. }),
  2151. "high" === props.fetchPriority ||
  2152. 10 > renderState.highImagePreloads.size
  2153. ? renderState.highImagePreloads.add(resource$jscomp$1)
  2154. : (renderState.bulkPreloads.add(resource$jscomp$1),
  2155. promotablePreloads.set(key$jscomp$0, resource$jscomp$1)));
  2156. }
  2157. }
  2158. return pushSelfClosing(target$jscomp$0, props, "img");
  2159. case "base":
  2160. case "area":
  2161. case "br":
  2162. case "col":
  2163. case "embed":
  2164. case "hr":
  2165. case "keygen":
  2166. case "param":
  2167. case "source":
  2168. case "track":
  2169. case "wbr":
  2170. return pushSelfClosing(target$jscomp$0, props, type);
  2171. case "annotation-xml":
  2172. case "color-profile":
  2173. case "font-face":
  2174. case "font-face-src":
  2175. case "font-face-uri":
  2176. case "font-face-format":
  2177. case "font-face-name":
  2178. case "missing-glyph":
  2179. break;
  2180. case "head":
  2181. if (2 > formatContext.insertionMode) {
  2182. var preamble = preambleState || renderState.preamble;
  2183. if (preamble.headChunks)
  2184. throw Error("The `<head>` tag may only be rendered once.");
  2185. null !== preambleState &&
  2186. target$jscomp$0.push(headPreambleContributionChunk);
  2187. preamble.headChunks = [];
  2188. var JSCompiler_inline_result$jscomp$9 = pushStartSingletonElement(
  2189. preamble.headChunks,
  2190. props,
  2191. "head"
  2192. );
  2193. } else
  2194. JSCompiler_inline_result$jscomp$9 = pushStartGenericElement(
  2195. target$jscomp$0,
  2196. props,
  2197. "head"
  2198. );
  2199. return JSCompiler_inline_result$jscomp$9;
  2200. case "body":
  2201. if (2 > formatContext.insertionMode) {
  2202. var preamble$jscomp$0 = preambleState || renderState.preamble;
  2203. if (preamble$jscomp$0.bodyChunks)
  2204. throw Error("The `<body>` tag may only be rendered once.");
  2205. null !== preambleState &&
  2206. target$jscomp$0.push(bodyPreambleContributionChunk);
  2207. preamble$jscomp$0.bodyChunks = [];
  2208. var JSCompiler_inline_result$jscomp$10 = pushStartSingletonElement(
  2209. preamble$jscomp$0.bodyChunks,
  2210. props,
  2211. "body"
  2212. );
  2213. } else
  2214. JSCompiler_inline_result$jscomp$10 = pushStartGenericElement(
  2215. target$jscomp$0,
  2216. props,
  2217. "body"
  2218. );
  2219. return JSCompiler_inline_result$jscomp$10;
  2220. case "html":
  2221. if (0 === formatContext.insertionMode) {
  2222. var preamble$jscomp$1 = preambleState || renderState.preamble;
  2223. if (preamble$jscomp$1.htmlChunks)
  2224. throw Error("The `<html>` tag may only be rendered once.");
  2225. null !== preambleState &&
  2226. target$jscomp$0.push(htmlPreambleContributionChunk);
  2227. preamble$jscomp$1.htmlChunks = [doctypeChunk];
  2228. var JSCompiler_inline_result$jscomp$11 = pushStartSingletonElement(
  2229. preamble$jscomp$1.htmlChunks,
  2230. props,
  2231. "html"
  2232. );
  2233. } else
  2234. JSCompiler_inline_result$jscomp$11 = pushStartGenericElement(
  2235. target$jscomp$0,
  2236. props,
  2237. "html"
  2238. );
  2239. return JSCompiler_inline_result$jscomp$11;
  2240. default:
  2241. if (-1 !== type.indexOf("-")) {
  2242. target$jscomp$0.push(startChunkForTag(type));
  2243. var children$jscomp$9 = null,
  2244. innerHTML$jscomp$8 = null,
  2245. propKey$jscomp$11;
  2246. for (propKey$jscomp$11 in props)
  2247. if (hasOwnProperty.call(props, propKey$jscomp$11)) {
  2248. var propValue$jscomp$11 = props[propKey$jscomp$11];
  2249. if (null != propValue$jscomp$11) {
  2250. var attributeName = propKey$jscomp$11;
  2251. switch (propKey$jscomp$11) {
  2252. case "children":
  2253. children$jscomp$9 = propValue$jscomp$11;
  2254. break;
  2255. case "dangerouslySetInnerHTML":
  2256. innerHTML$jscomp$8 = propValue$jscomp$11;
  2257. break;
  2258. case "style":
  2259. pushStyleAttribute(target$jscomp$0, propValue$jscomp$11);
  2260. break;
  2261. case "suppressContentEditableWarning":
  2262. case "suppressHydrationWarning":
  2263. case "ref":
  2264. break;
  2265. case "className":
  2266. attributeName = "class";
  2267. default:
  2268. if (
  2269. isAttributeNameSafe(propKey$jscomp$11) &&
  2270. "function" !== typeof propValue$jscomp$11 &&
  2271. "symbol" !== typeof propValue$jscomp$11 &&
  2272. !1 !== propValue$jscomp$11
  2273. ) {
  2274. if (!0 === propValue$jscomp$11) propValue$jscomp$11 = "";
  2275. else if ("object" === typeof propValue$jscomp$11) continue;
  2276. target$jscomp$0.push(
  2277. attributeSeparator,
  2278. attributeName,
  2279. attributeAssign,
  2280. escapeTextForBrowser(propValue$jscomp$11),
  2281. attributeEnd
  2282. );
  2283. }
  2284. }
  2285. }
  2286. }
  2287. target$jscomp$0.push(endOfStartTag);
  2288. pushInnerHTML(target$jscomp$0, innerHTML$jscomp$8, children$jscomp$9);
  2289. return children$jscomp$9;
  2290. }
  2291. }
  2292. return pushStartGenericElement(target$jscomp$0, props, type);
  2293. }
  2294. var endTagCache = new Map();
  2295. function endChunkForTag(tag) {
  2296. var chunk = endTagCache.get(tag);
  2297. void 0 === chunk &&
  2298. ((chunk = stringToPrecomputedChunk("</" + tag + ">")),
  2299. endTagCache.set(tag, chunk));
  2300. return chunk;
  2301. }
  2302. function hoistPreambleState(renderState, preambleState) {
  2303. renderState = renderState.preamble;
  2304. null === renderState.htmlChunks &&
  2305. preambleState.htmlChunks &&
  2306. (renderState.htmlChunks = preambleState.htmlChunks);
  2307. null === renderState.headChunks &&
  2308. preambleState.headChunks &&
  2309. (renderState.headChunks = preambleState.headChunks);
  2310. null === renderState.bodyChunks &&
  2311. preambleState.bodyChunks &&
  2312. (renderState.bodyChunks = preambleState.bodyChunks);
  2313. }
  2314. function writeBootstrap(destination, renderState) {
  2315. renderState = renderState.bootstrapChunks;
  2316. for (var i = 0; i < renderState.length - 1; i++)
  2317. writeChunk(destination, renderState[i]);
  2318. return i < renderState.length
  2319. ? ((i = renderState[i]),
  2320. (renderState.length = 0),
  2321. writeChunkAndReturn(destination, i))
  2322. : !0;
  2323. }
  2324. var shellTimeRuntimeScript = stringToPrecomputedChunk(
  2325. "requestAnimationFrame(function(){$RT=performance.now()});"
  2326. ),
  2327. placeholder1 = stringToPrecomputedChunk('<template id="'),
  2328. placeholder2 = stringToPrecomputedChunk('"></template>'),
  2329. startActivityBoundary = stringToPrecomputedChunk("\x3c!--&--\x3e"),
  2330. endActivityBoundary = stringToPrecomputedChunk("\x3c!--/&--\x3e"),
  2331. startCompletedSuspenseBoundary = stringToPrecomputedChunk("\x3c!--$--\x3e"),
  2332. startPendingSuspenseBoundary1 = stringToPrecomputedChunk(
  2333. '\x3c!--$?--\x3e<template id="'
  2334. ),
  2335. startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>'),
  2336. startClientRenderedSuspenseBoundary =
  2337. stringToPrecomputedChunk("\x3c!--$!--\x3e"),
  2338. endSuspenseBoundary = stringToPrecomputedChunk("\x3c!--/$--\x3e"),
  2339. clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk("<template"),
  2340. clientRenderedSuspenseBoundaryErrorAttrInterstitial =
  2341. stringToPrecomputedChunk('"'),
  2342. clientRenderedSuspenseBoundaryError1A =
  2343. stringToPrecomputedChunk(' data-dgst="');
  2344. stringToPrecomputedChunk(' data-msg="');
  2345. stringToPrecomputedChunk(' data-stck="');
  2346. stringToPrecomputedChunk(' data-cstck="');
  2347. var clientRenderedSuspenseBoundaryError2 =
  2348. stringToPrecomputedChunk("></template>");
  2349. function writeStartPendingSuspenseBoundary(destination, renderState, id) {
  2350. writeChunk(destination, startPendingSuspenseBoundary1);
  2351. if (null === id)
  2352. throw Error(
  2353. "An ID must have been assigned before we can complete the boundary."
  2354. );
  2355. writeChunk(destination, renderState.boundaryPrefix);
  2356. writeChunk(destination, id.toString(16));
  2357. return writeChunkAndReturn(destination, startPendingSuspenseBoundary2);
  2358. }
  2359. var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="'),
  2360. startSegmentHTML2 = stringToPrecomputedChunk('">'),
  2361. endSegmentHTML = stringToPrecomputedChunk("</div>"),
  2362. startSegmentSVG = stringToPrecomputedChunk(
  2363. '<svg aria-hidden="true" style="display:none" id="'
  2364. ),
  2365. startSegmentSVG2 = stringToPrecomputedChunk('">'),
  2366. endSegmentSVG = stringToPrecomputedChunk("</svg>"),
  2367. startSegmentMathML = stringToPrecomputedChunk(
  2368. '<math aria-hidden="true" style="display:none" id="'
  2369. ),
  2370. startSegmentMathML2 = stringToPrecomputedChunk('">'),
  2371. endSegmentMathML = stringToPrecomputedChunk("</math>"),
  2372. startSegmentTable = stringToPrecomputedChunk('<table hidden id="'),
  2373. startSegmentTable2 = stringToPrecomputedChunk('">'),
  2374. endSegmentTable = stringToPrecomputedChunk("</table>"),
  2375. startSegmentTableBody = stringToPrecomputedChunk('<table hidden><tbody id="'),
  2376. startSegmentTableBody2 = stringToPrecomputedChunk('">'),
  2377. endSegmentTableBody = stringToPrecomputedChunk("</tbody></table>"),
  2378. startSegmentTableRow = stringToPrecomputedChunk('<table hidden><tr id="'),
  2379. startSegmentTableRow2 = stringToPrecomputedChunk('">'),
  2380. endSegmentTableRow = stringToPrecomputedChunk("</tr></table>"),
  2381. startSegmentColGroup = stringToPrecomputedChunk(
  2382. '<table hidden><colgroup id="'
  2383. ),
  2384. startSegmentColGroup2 = stringToPrecomputedChunk('">'),
  2385. endSegmentColGroup = stringToPrecomputedChunk("</colgroup></table>");
  2386. function writeStartSegment(destination, renderState, formatContext, id) {
  2387. switch (formatContext.insertionMode) {
  2388. case 0:
  2389. case 1:
  2390. case 3:
  2391. case 2:
  2392. return (
  2393. writeChunk(destination, startSegmentHTML),
  2394. writeChunk(destination, renderState.segmentPrefix),
  2395. writeChunk(destination, id.toString(16)),
  2396. writeChunkAndReturn(destination, startSegmentHTML2)
  2397. );
  2398. case 4:
  2399. return (
  2400. writeChunk(destination, startSegmentSVG),
  2401. writeChunk(destination, renderState.segmentPrefix),
  2402. writeChunk(destination, id.toString(16)),
  2403. writeChunkAndReturn(destination, startSegmentSVG2)
  2404. );
  2405. case 5:
  2406. return (
  2407. writeChunk(destination, startSegmentMathML),
  2408. writeChunk(destination, renderState.segmentPrefix),
  2409. writeChunk(destination, id.toString(16)),
  2410. writeChunkAndReturn(destination, startSegmentMathML2)
  2411. );
  2412. case 6:
  2413. return (
  2414. writeChunk(destination, startSegmentTable),
  2415. writeChunk(destination, renderState.segmentPrefix),
  2416. writeChunk(destination, id.toString(16)),
  2417. writeChunkAndReturn(destination, startSegmentTable2)
  2418. );
  2419. case 7:
  2420. return (
  2421. writeChunk(destination, startSegmentTableBody),
  2422. writeChunk(destination, renderState.segmentPrefix),
  2423. writeChunk(destination, id.toString(16)),
  2424. writeChunkAndReturn(destination, startSegmentTableBody2)
  2425. );
  2426. case 8:
  2427. return (
  2428. writeChunk(destination, startSegmentTableRow),
  2429. writeChunk(destination, renderState.segmentPrefix),
  2430. writeChunk(destination, id.toString(16)),
  2431. writeChunkAndReturn(destination, startSegmentTableRow2)
  2432. );
  2433. case 9:
  2434. return (
  2435. writeChunk(destination, startSegmentColGroup),
  2436. writeChunk(destination, renderState.segmentPrefix),
  2437. writeChunk(destination, id.toString(16)),
  2438. writeChunkAndReturn(destination, startSegmentColGroup2)
  2439. );
  2440. default:
  2441. throw Error("Unknown insertion mode. This is a bug in React.");
  2442. }
  2443. }
  2444. function writeEndSegment(destination, formatContext) {
  2445. switch (formatContext.insertionMode) {
  2446. case 0:
  2447. case 1:
  2448. case 3:
  2449. case 2:
  2450. return writeChunkAndReturn(destination, endSegmentHTML);
  2451. case 4:
  2452. return writeChunkAndReturn(destination, endSegmentSVG);
  2453. case 5:
  2454. return writeChunkAndReturn(destination, endSegmentMathML);
  2455. case 6:
  2456. return writeChunkAndReturn(destination, endSegmentTable);
  2457. case 7:
  2458. return writeChunkAndReturn(destination, endSegmentTableBody);
  2459. case 8:
  2460. return writeChunkAndReturn(destination, endSegmentTableRow);
  2461. case 9:
  2462. return writeChunkAndReturn(destination, endSegmentColGroup);
  2463. default:
  2464. throw Error("Unknown insertion mode. This is a bug in React.");
  2465. }
  2466. }
  2467. var completeSegmentScript1Full = stringToPrecomputedChunk(
  2468. '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'
  2469. ),
  2470. completeSegmentScript1Partial = stringToPrecomputedChunk('$RS("'),
  2471. completeSegmentScript2 = stringToPrecomputedChunk('","'),
  2472. completeSegmentScriptEnd = stringToPrecomputedChunk('")\x3c/script>');
  2473. stringToPrecomputedChunk('<template data-rsi="" data-sid="');
  2474. stringToPrecomputedChunk('" data-pid="');
  2475. var completeBoundaryScriptFunctionOnly = stringToPrecomputedChunk(
  2476. '$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};\n$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};'
  2477. ),
  2478. completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'),
  2479. completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk(
  2480. '$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=\n"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=\n"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("'
  2481. ),
  2482. completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'),
  2483. completeBoundaryScript2 = stringToPrecomputedChunk('","'),
  2484. completeBoundaryScript3a = stringToPrecomputedChunk('",'),
  2485. completeBoundaryScript3b = stringToPrecomputedChunk('"'),
  2486. completeBoundaryScriptEnd = stringToPrecomputedChunk(")\x3c/script>");
  2487. stringToPrecomputedChunk('<template data-rci="" data-bid="');
  2488. stringToPrecomputedChunk('<template data-rri="" data-bid="');
  2489. stringToPrecomputedChunk('" data-sid="');
  2490. stringToPrecomputedChunk('" data-sty="');
  2491. var clientRenderScriptFunctionOnly = stringToPrecomputedChunk(
  2492. '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'
  2493. ),
  2494. clientRenderScript1Full = stringToPrecomputedChunk(
  2495. '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'
  2496. ),
  2497. clientRenderScript1Partial = stringToPrecomputedChunk('$RX("'),
  2498. clientRenderScript1A = stringToPrecomputedChunk('"'),
  2499. clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(","),
  2500. clientRenderScriptEnd = stringToPrecomputedChunk(")\x3c/script>");
  2501. stringToPrecomputedChunk('<template data-rxi="" data-bid="');
  2502. stringToPrecomputedChunk('" data-dgst="');
  2503. stringToPrecomputedChunk('" data-msg="');
  2504. stringToPrecomputedChunk('" data-stck="');
  2505. stringToPrecomputedChunk('" data-cstck="');
  2506. var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g;
  2507. function escapeJSStringsForInstructionScripts(input) {
  2508. return JSON.stringify(input).replace(
  2509. regexForJSStringsInInstructionScripts,
  2510. function (match) {
  2511. switch (match) {
  2512. case "<":
  2513. return "\\u003c";
  2514. case "\u2028":
  2515. return "\\u2028";
  2516. case "\u2029":
  2517. return "\\u2029";
  2518. default:
  2519. throw Error(
  2520. "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
  2521. );
  2522. }
  2523. }
  2524. );
  2525. }
  2526. var regexForJSStringsInScripts = /[&><\u2028\u2029]/g;
  2527. function escapeJSObjectForInstructionScripts(input) {
  2528. return JSON.stringify(input).replace(
  2529. regexForJSStringsInScripts,
  2530. function (match) {
  2531. switch (match) {
  2532. case "&":
  2533. return "\\u0026";
  2534. case ">":
  2535. return "\\u003e";
  2536. case "<":
  2537. return "\\u003c";
  2538. case "\u2028":
  2539. return "\\u2028";
  2540. case "\u2029":
  2541. return "\\u2029";
  2542. default:
  2543. throw Error(
  2544. "escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
  2545. );
  2546. }
  2547. }
  2548. );
  2549. }
  2550. var lateStyleTagResourceOpen1 = stringToPrecomputedChunk(
  2551. ' media="not all" data-precedence="'
  2552. ),
  2553. lateStyleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
  2554. lateStyleTagResourceOpen3 = stringToPrecomputedChunk('">'),
  2555. lateStyleTagTemplateClose = stringToPrecomputedChunk("</style>"),
  2556. currentlyRenderingBoundaryHasStylesToHoist = !1,
  2557. destinationHasCapacity = !0;
  2558. function flushStyleTagsLateForBoundary(styleQueue) {
  2559. var rules = styleQueue.rules,
  2560. hrefs = styleQueue.hrefs,
  2561. i = 0;
  2562. if (hrefs.length) {
  2563. writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
  2564. writeChunk(this, lateStyleTagResourceOpen1);
  2565. writeChunk(this, styleQueue.precedence);
  2566. for (writeChunk(this, lateStyleTagResourceOpen2); i < hrefs.length - 1; i++)
  2567. writeChunk(this, hrefs[i]), writeChunk(this, spaceSeparator);
  2568. writeChunk(this, hrefs[i]);
  2569. writeChunk(this, lateStyleTagResourceOpen3);
  2570. for (i = 0; i < rules.length; i++) writeChunk(this, rules[i]);
  2571. destinationHasCapacity = writeChunkAndReturn(
  2572. this,
  2573. lateStyleTagTemplateClose
  2574. );
  2575. currentlyRenderingBoundaryHasStylesToHoist = !0;
  2576. rules.length = 0;
  2577. hrefs.length = 0;
  2578. }
  2579. }
  2580. function hasStylesToHoist(stylesheet) {
  2581. return 2 !== stylesheet.state
  2582. ? (currentlyRenderingBoundaryHasStylesToHoist = !0)
  2583. : !1;
  2584. }
  2585. function writeHoistablesForBoundary(destination, hoistableState, renderState) {
  2586. currentlyRenderingBoundaryHasStylesToHoist = !1;
  2587. destinationHasCapacity = !0;
  2588. currentlyFlushingRenderState = renderState;
  2589. hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
  2590. currentlyFlushingRenderState = null;
  2591. hoistableState.stylesheets.forEach(hasStylesToHoist);
  2592. currentlyRenderingBoundaryHasStylesToHoist &&
  2593. (renderState.stylesToHoist = !0);
  2594. return destinationHasCapacity;
  2595. }
  2596. function flushResource(resource) {
  2597. for (var i = 0; i < resource.length; i++) writeChunk(this, resource[i]);
  2598. resource.length = 0;
  2599. }
  2600. var stylesheetFlushingQueue = [];
  2601. function flushStyleInPreamble(stylesheet) {
  2602. pushLinkImpl(stylesheetFlushingQueue, stylesheet.props);
  2603. for (var i = 0; i < stylesheetFlushingQueue.length; i++)
  2604. writeChunk(this, stylesheetFlushingQueue[i]);
  2605. stylesheetFlushingQueue.length = 0;
  2606. stylesheet.state = 2;
  2607. }
  2608. var styleTagResourceOpen1 = stringToPrecomputedChunk(' data-precedence="'),
  2609. styleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
  2610. spaceSeparator = stringToPrecomputedChunk(" "),
  2611. styleTagResourceOpen3 = stringToPrecomputedChunk('">'),
  2612. styleTagResourceClose = stringToPrecomputedChunk("</style>");
  2613. function flushStylesInPreamble(styleQueue) {
  2614. var hasStylesheets = 0 < styleQueue.sheets.size;
  2615. styleQueue.sheets.forEach(flushStyleInPreamble, this);
  2616. styleQueue.sheets.clear();
  2617. var rules = styleQueue.rules,
  2618. hrefs = styleQueue.hrefs;
  2619. if (!hasStylesheets || hrefs.length) {
  2620. writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
  2621. writeChunk(this, styleTagResourceOpen1);
  2622. writeChunk(this, styleQueue.precedence);
  2623. styleQueue = 0;
  2624. if (hrefs.length) {
  2625. for (
  2626. writeChunk(this, styleTagResourceOpen2);
  2627. styleQueue < hrefs.length - 1;
  2628. styleQueue++
  2629. )
  2630. writeChunk(this, hrefs[styleQueue]), writeChunk(this, spaceSeparator);
  2631. writeChunk(this, hrefs[styleQueue]);
  2632. }
  2633. writeChunk(this, styleTagResourceOpen3);
  2634. for (styleQueue = 0; styleQueue < rules.length; styleQueue++)
  2635. writeChunk(this, rules[styleQueue]);
  2636. writeChunk(this, styleTagResourceClose);
  2637. rules.length = 0;
  2638. hrefs.length = 0;
  2639. }
  2640. }
  2641. function preloadLateStyle(stylesheet) {
  2642. if (0 === stylesheet.state) {
  2643. stylesheet.state = 1;
  2644. var props = stylesheet.props;
  2645. pushLinkImpl(stylesheetFlushingQueue, {
  2646. rel: "preload",
  2647. as: "style",
  2648. href: stylesheet.props.href,
  2649. crossOrigin: props.crossOrigin,
  2650. fetchPriority: props.fetchPriority,
  2651. integrity: props.integrity,
  2652. media: props.media,
  2653. hrefLang: props.hrefLang,
  2654. referrerPolicy: props.referrerPolicy
  2655. });
  2656. for (
  2657. stylesheet = 0;
  2658. stylesheet < stylesheetFlushingQueue.length;
  2659. stylesheet++
  2660. )
  2661. writeChunk(this, stylesheetFlushingQueue[stylesheet]);
  2662. stylesheetFlushingQueue.length = 0;
  2663. }
  2664. }
  2665. function preloadLateStyles(styleQueue) {
  2666. styleQueue.sheets.forEach(preloadLateStyle, this);
  2667. styleQueue.sheets.clear();
  2668. }
  2669. stringToPrecomputedChunk('<link rel="expect" href="#');
  2670. stringToPrecomputedChunk('" blocking="render"/>');
  2671. var completedShellIdAttributeStart = stringToPrecomputedChunk(' id="');
  2672. function pushCompletedShellIdAttribute(target, resumableState) {
  2673. 0 === (resumableState.instructions & 32) &&
  2674. ((resumableState.instructions |= 32),
  2675. target.push(
  2676. completedShellIdAttributeStart,
  2677. escapeTextForBrowser("_" + resumableState.idPrefix + "R_"),
  2678. attributeEnd
  2679. ));
  2680. }
  2681. var arrayFirstOpenBracket = stringToPrecomputedChunk("["),
  2682. arraySubsequentOpenBracket = stringToPrecomputedChunk(",["),
  2683. arrayInterstitial = stringToPrecomputedChunk(","),
  2684. arrayCloseBracket = stringToPrecomputedChunk("]");
  2685. function writeStyleResourceDependenciesInJS(destination, hoistableState) {
  2686. writeChunk(destination, arrayFirstOpenBracket);
  2687. var nextArrayOpenBrackChunk = arrayFirstOpenBracket;
  2688. hoistableState.stylesheets.forEach(function (resource) {
  2689. if (2 !== resource.state)
  2690. if (3 === resource.state)
  2691. writeChunk(destination, nextArrayOpenBrackChunk),
  2692. writeChunk(
  2693. destination,
  2694. escapeJSObjectForInstructionScripts("" + resource.props.href)
  2695. ),
  2696. writeChunk(destination, arrayCloseBracket),
  2697. (nextArrayOpenBrackChunk = arraySubsequentOpenBracket);
  2698. else {
  2699. writeChunk(destination, nextArrayOpenBrackChunk);
  2700. var precedence = resource.props["data-precedence"],
  2701. props = resource.props,
  2702. coercedHref = sanitizeURL("" + resource.props.href);
  2703. writeChunk(
  2704. destination,
  2705. escapeJSObjectForInstructionScripts(coercedHref)
  2706. );
  2707. precedence = "" + precedence;
  2708. writeChunk(destination, arrayInterstitial);
  2709. writeChunk(
  2710. destination,
  2711. escapeJSObjectForInstructionScripts(precedence)
  2712. );
  2713. for (var propKey in props)
  2714. if (
  2715. hasOwnProperty.call(props, propKey) &&
  2716. ((precedence = props[propKey]), null != precedence)
  2717. )
  2718. switch (propKey) {
  2719. case "href":
  2720. case "rel":
  2721. case "precedence":
  2722. case "data-precedence":
  2723. break;
  2724. case "children":
  2725. case "dangerouslySetInnerHTML":
  2726. throw Error(
  2727. "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
  2728. );
  2729. default:
  2730. writeStyleResourceAttributeInJS(
  2731. destination,
  2732. propKey,
  2733. precedence
  2734. );
  2735. }
  2736. writeChunk(destination, arrayCloseBracket);
  2737. nextArrayOpenBrackChunk = arraySubsequentOpenBracket;
  2738. resource.state = 3;
  2739. }
  2740. });
  2741. writeChunk(destination, arrayCloseBracket);
  2742. }
  2743. function writeStyleResourceAttributeInJS(destination, name, value) {
  2744. var attributeName = name.toLowerCase();
  2745. switch (typeof value) {
  2746. case "function":
  2747. case "symbol":
  2748. return;
  2749. }
  2750. switch (name) {
  2751. case "innerHTML":
  2752. case "dangerouslySetInnerHTML":
  2753. case "suppressContentEditableWarning":
  2754. case "suppressHydrationWarning":
  2755. case "style":
  2756. case "ref":
  2757. return;
  2758. case "className":
  2759. attributeName = "class";
  2760. name = "" + value;
  2761. break;
  2762. case "hidden":
  2763. if (!1 === value) return;
  2764. name = "";
  2765. break;
  2766. case "src":
  2767. case "href":
  2768. value = sanitizeURL(value);
  2769. name = "" + value;
  2770. break;
  2771. default:
  2772. if (
  2773. (2 < name.length &&
  2774. ("o" === name[0] || "O" === name[0]) &&
  2775. ("n" === name[1] || "N" === name[1])) ||
  2776. !isAttributeNameSafe(name)
  2777. )
  2778. return;
  2779. name = "" + value;
  2780. }
  2781. writeChunk(destination, arrayInterstitial);
  2782. writeChunk(destination, escapeJSObjectForInstructionScripts(attributeName));
  2783. writeChunk(destination, arrayInterstitial);
  2784. writeChunk(destination, escapeJSObjectForInstructionScripts(name));
  2785. }
  2786. function createHoistableState() {
  2787. return { styles: new Set(), stylesheets: new Set(), suspenseyImages: !1 };
  2788. }
  2789. function prefetchDNS(href) {
  2790. var request = resolveRequest();
  2791. if (request) {
  2792. var resumableState = request.resumableState,
  2793. renderState = request.renderState;
  2794. if ("string" === typeof href && href) {
  2795. if (!resumableState.dnsResources.hasOwnProperty(href)) {
  2796. resumableState.dnsResources[href] = null;
  2797. resumableState = renderState.headers;
  2798. var header, JSCompiler_temp;
  2799. if (
  2800. (JSCompiler_temp =
  2801. resumableState && 0 < resumableState.remainingCapacity)
  2802. )
  2803. JSCompiler_temp =
  2804. ((header =
  2805. "<" +
  2806. ("" + href).replace(
  2807. regexForHrefInLinkHeaderURLContext,
  2808. escapeHrefForLinkHeaderURLContextReplacer
  2809. ) +
  2810. ">; rel=dns-prefetch"),
  2811. 0 <= (resumableState.remainingCapacity -= header.length + 2));
  2812. JSCompiler_temp
  2813. ? ((renderState.resets.dns[href] = null),
  2814. resumableState.preconnects && (resumableState.preconnects += ", "),
  2815. (resumableState.preconnects += header))
  2816. : ((header = []),
  2817. pushLinkImpl(header, { href: href, rel: "dns-prefetch" }),
  2818. renderState.preconnects.add(header));
  2819. }
  2820. enqueueFlush(request);
  2821. }
  2822. } else previousDispatcher.D(href);
  2823. }
  2824. function preconnect(href, crossOrigin) {
  2825. var request = resolveRequest();
  2826. if (request) {
  2827. var resumableState = request.resumableState,
  2828. renderState = request.renderState;
  2829. if ("string" === typeof href && href) {
  2830. var bucket =
  2831. "use-credentials" === crossOrigin
  2832. ? "credentials"
  2833. : "string" === typeof crossOrigin
  2834. ? "anonymous"
  2835. : "default";
  2836. if (!resumableState.connectResources[bucket].hasOwnProperty(href)) {
  2837. resumableState.connectResources[bucket][href] = null;
  2838. resumableState = renderState.headers;
  2839. var header, JSCompiler_temp;
  2840. if (
  2841. (JSCompiler_temp =
  2842. resumableState && 0 < resumableState.remainingCapacity)
  2843. ) {
  2844. JSCompiler_temp =
  2845. "<" +
  2846. ("" + href).replace(
  2847. regexForHrefInLinkHeaderURLContext,
  2848. escapeHrefForLinkHeaderURLContextReplacer
  2849. ) +
  2850. ">; rel=preconnect";
  2851. if ("string" === typeof crossOrigin) {
  2852. var escapedCrossOrigin = ("" + crossOrigin).replace(
  2853. regexForLinkHeaderQuotedParamValueContext,
  2854. escapeStringForLinkHeaderQuotedParamValueContextReplacer
  2855. );
  2856. JSCompiler_temp += '; crossorigin="' + escapedCrossOrigin + '"';
  2857. }
  2858. JSCompiler_temp =
  2859. ((header = JSCompiler_temp),
  2860. 0 <= (resumableState.remainingCapacity -= header.length + 2));
  2861. }
  2862. JSCompiler_temp
  2863. ? ((renderState.resets.connect[bucket][href] = null),
  2864. resumableState.preconnects && (resumableState.preconnects += ", "),
  2865. (resumableState.preconnects += header))
  2866. : ((bucket = []),
  2867. pushLinkImpl(bucket, {
  2868. rel: "preconnect",
  2869. href: href,
  2870. crossOrigin: crossOrigin
  2871. }),
  2872. renderState.preconnects.add(bucket));
  2873. }
  2874. enqueueFlush(request);
  2875. }
  2876. } else previousDispatcher.C(href, crossOrigin);
  2877. }
  2878. function preload(href, as, options) {
  2879. var request = resolveRequest();
  2880. if (request) {
  2881. var resumableState = request.resumableState,
  2882. renderState = request.renderState;
  2883. if (as && href) {
  2884. switch (as) {
  2885. case "image":
  2886. if (options) {
  2887. var imageSrcSet = options.imageSrcSet;
  2888. var imageSizes = options.imageSizes;
  2889. var fetchPriority = options.fetchPriority;
  2890. }
  2891. var key = imageSrcSet
  2892. ? imageSrcSet + "\n" + (imageSizes || "")
  2893. : href;
  2894. if (resumableState.imageResources.hasOwnProperty(key)) return;
  2895. resumableState.imageResources[key] = PRELOAD_NO_CREDS;
  2896. resumableState = renderState.headers;
  2897. var header;
  2898. resumableState &&
  2899. 0 < resumableState.remainingCapacity &&
  2900. "string" !== typeof imageSrcSet &&
  2901. "high" === fetchPriority &&
  2902. ((header = getPreloadAsHeader(href, as, options)),
  2903. 0 <= (resumableState.remainingCapacity -= header.length + 2))
  2904. ? ((renderState.resets.image[key] = PRELOAD_NO_CREDS),
  2905. resumableState.highImagePreloads &&
  2906. (resumableState.highImagePreloads += ", "),
  2907. (resumableState.highImagePreloads += header))
  2908. : ((resumableState = []),
  2909. pushLinkImpl(
  2910. resumableState,
  2911. assign(
  2912. { rel: "preload", href: imageSrcSet ? void 0 : href, as: as },
  2913. options
  2914. )
  2915. ),
  2916. "high" === fetchPriority
  2917. ? renderState.highImagePreloads.add(resumableState)
  2918. : (renderState.bulkPreloads.add(resumableState),
  2919. renderState.preloads.images.set(key, resumableState)));
  2920. break;
  2921. case "style":
  2922. if (resumableState.styleResources.hasOwnProperty(href)) return;
  2923. imageSrcSet = [];
  2924. pushLinkImpl(
  2925. imageSrcSet,
  2926. assign({ rel: "preload", href: href, as: as }, options)
  2927. );
  2928. resumableState.styleResources[href] =
  2929. !options ||
  2930. ("string" !== typeof options.crossOrigin &&
  2931. "string" !== typeof options.integrity)
  2932. ? PRELOAD_NO_CREDS
  2933. : [options.crossOrigin, options.integrity];
  2934. renderState.preloads.stylesheets.set(href, imageSrcSet);
  2935. renderState.bulkPreloads.add(imageSrcSet);
  2936. break;
  2937. case "script":
  2938. if (resumableState.scriptResources.hasOwnProperty(href)) return;
  2939. imageSrcSet = [];
  2940. renderState.preloads.scripts.set(href, imageSrcSet);
  2941. renderState.bulkPreloads.add(imageSrcSet);
  2942. pushLinkImpl(
  2943. imageSrcSet,
  2944. assign({ rel: "preload", href: href, as: as }, options)
  2945. );
  2946. resumableState.scriptResources[href] =
  2947. !options ||
  2948. ("string" !== typeof options.crossOrigin &&
  2949. "string" !== typeof options.integrity)
  2950. ? PRELOAD_NO_CREDS
  2951. : [options.crossOrigin, options.integrity];
  2952. break;
  2953. default:
  2954. if (resumableState.unknownResources.hasOwnProperty(as)) {
  2955. if (
  2956. ((imageSrcSet = resumableState.unknownResources[as]),
  2957. imageSrcSet.hasOwnProperty(href))
  2958. )
  2959. return;
  2960. } else
  2961. (imageSrcSet = {}),
  2962. (resumableState.unknownResources[as] = imageSrcSet);
  2963. imageSrcSet[href] = PRELOAD_NO_CREDS;
  2964. if (
  2965. (resumableState = renderState.headers) &&
  2966. 0 < resumableState.remainingCapacity &&
  2967. "font" === as &&
  2968. ((key = getPreloadAsHeader(href, as, options)),
  2969. 0 <= (resumableState.remainingCapacity -= key.length + 2))
  2970. )
  2971. (renderState.resets.font[href] = PRELOAD_NO_CREDS),
  2972. resumableState.fontPreloads &&
  2973. (resumableState.fontPreloads += ", "),
  2974. (resumableState.fontPreloads += key);
  2975. else
  2976. switch (
  2977. ((resumableState = []),
  2978. (href = assign({ rel: "preload", href: href, as: as }, options)),
  2979. pushLinkImpl(resumableState, href),
  2980. as)
  2981. ) {
  2982. case "font":
  2983. renderState.fontPreloads.add(resumableState);
  2984. break;
  2985. default:
  2986. renderState.bulkPreloads.add(resumableState);
  2987. }
  2988. }
  2989. enqueueFlush(request);
  2990. }
  2991. } else previousDispatcher.L(href, as, options);
  2992. }
  2993. function preloadModule(href, options) {
  2994. var request = resolveRequest();
  2995. if (request) {
  2996. var resumableState = request.resumableState,
  2997. renderState = request.renderState;
  2998. if (href) {
  2999. var as =
  3000. options && "string" === typeof options.as ? options.as : "script";
  3001. switch (as) {
  3002. case "script":
  3003. if (resumableState.moduleScriptResources.hasOwnProperty(href)) return;
  3004. as = [];
  3005. resumableState.moduleScriptResources[href] =
  3006. !options ||
  3007. ("string" !== typeof options.crossOrigin &&
  3008. "string" !== typeof options.integrity)
  3009. ? PRELOAD_NO_CREDS
  3010. : [options.crossOrigin, options.integrity];
  3011. renderState.preloads.moduleScripts.set(href, as);
  3012. break;
  3013. default:
  3014. if (resumableState.moduleUnknownResources.hasOwnProperty(as)) {
  3015. var resources = resumableState.unknownResources[as];
  3016. if (resources.hasOwnProperty(href)) return;
  3017. } else
  3018. (resources = {}),
  3019. (resumableState.moduleUnknownResources[as] = resources);
  3020. as = [];
  3021. resources[href] = PRELOAD_NO_CREDS;
  3022. }
  3023. pushLinkImpl(as, assign({ rel: "modulepreload", href: href }, options));
  3024. renderState.bulkPreloads.add(as);
  3025. enqueueFlush(request);
  3026. }
  3027. } else previousDispatcher.m(href, options);
  3028. }
  3029. function preinitStyle(href, precedence, options) {
  3030. var request = resolveRequest();
  3031. if (request) {
  3032. var resumableState = request.resumableState,
  3033. renderState = request.renderState;
  3034. if (href) {
  3035. precedence = precedence || "default";
  3036. var styleQueue = renderState.styles.get(precedence),
  3037. resourceState = resumableState.styleResources.hasOwnProperty(href)
  3038. ? resumableState.styleResources[href]
  3039. : void 0;
  3040. null !== resourceState &&
  3041. ((resumableState.styleResources[href] = null),
  3042. styleQueue ||
  3043. ((styleQueue = {
  3044. precedence: escapeTextForBrowser(precedence),
  3045. rules: [],
  3046. hrefs: [],
  3047. sheets: new Map()
  3048. }),
  3049. renderState.styles.set(precedence, styleQueue)),
  3050. (precedence = {
  3051. state: 0,
  3052. props: assign(
  3053. { rel: "stylesheet", href: href, "data-precedence": precedence },
  3054. options
  3055. )
  3056. }),
  3057. resourceState &&
  3058. (2 === resourceState.length &&
  3059. adoptPreloadCredentials(precedence.props, resourceState),
  3060. (renderState = renderState.preloads.stylesheets.get(href)) &&
  3061. 0 < renderState.length
  3062. ? (renderState.length = 0)
  3063. : (precedence.state = 1)),
  3064. styleQueue.sheets.set(href, precedence),
  3065. enqueueFlush(request));
  3066. }
  3067. } else previousDispatcher.S(href, precedence, options);
  3068. }
  3069. function preinitScript(src, options) {
  3070. var request = resolveRequest();
  3071. if (request) {
  3072. var resumableState = request.resumableState,
  3073. renderState = request.renderState;
  3074. if (src) {
  3075. var resourceState = resumableState.scriptResources.hasOwnProperty(src)
  3076. ? resumableState.scriptResources[src]
  3077. : void 0;
  3078. null !== resourceState &&
  3079. ((resumableState.scriptResources[src] = null),
  3080. (options = assign({ src: src, async: !0 }, options)),
  3081. resourceState &&
  3082. (2 === resourceState.length &&
  3083. adoptPreloadCredentials(options, resourceState),
  3084. (src = renderState.preloads.scripts.get(src))) &&
  3085. (src.length = 0),
  3086. (src = []),
  3087. renderState.scripts.add(src),
  3088. pushScriptImpl(src, options),
  3089. enqueueFlush(request));
  3090. }
  3091. } else previousDispatcher.X(src, options);
  3092. }
  3093. function preinitModuleScript(src, options) {
  3094. var request = resolveRequest();
  3095. if (request) {
  3096. var resumableState = request.resumableState,
  3097. renderState = request.renderState;
  3098. if (src) {
  3099. var resourceState = resumableState.moduleScriptResources.hasOwnProperty(
  3100. src
  3101. )
  3102. ? resumableState.moduleScriptResources[src]
  3103. : void 0;
  3104. null !== resourceState &&
  3105. ((resumableState.moduleScriptResources[src] = null),
  3106. (options = assign({ src: src, type: "module", async: !0 }, options)),
  3107. resourceState &&
  3108. (2 === resourceState.length &&
  3109. adoptPreloadCredentials(options, resourceState),
  3110. (src = renderState.preloads.moduleScripts.get(src))) &&
  3111. (src.length = 0),
  3112. (src = []),
  3113. renderState.scripts.add(src),
  3114. pushScriptImpl(src, options),
  3115. enqueueFlush(request));
  3116. }
  3117. } else previousDispatcher.M(src, options);
  3118. }
  3119. function adoptPreloadCredentials(target, preloadState) {
  3120. null == target.crossOrigin && (target.crossOrigin = preloadState[0]);
  3121. null == target.integrity && (target.integrity = preloadState[1]);
  3122. }
  3123. function getPreloadAsHeader(href, as, params) {
  3124. href = ("" + href).replace(
  3125. regexForHrefInLinkHeaderURLContext,
  3126. escapeHrefForLinkHeaderURLContextReplacer
  3127. );
  3128. as = ("" + as).replace(
  3129. regexForLinkHeaderQuotedParamValueContext,
  3130. escapeStringForLinkHeaderQuotedParamValueContextReplacer
  3131. );
  3132. as = "<" + href + '>; rel=preload; as="' + as + '"';
  3133. for (var paramName in params)
  3134. hasOwnProperty.call(params, paramName) &&
  3135. ((href = params[paramName]),
  3136. "string" === typeof href &&
  3137. (as +=
  3138. "; " +
  3139. paramName.toLowerCase() +
  3140. '="' +
  3141. ("" + href).replace(
  3142. regexForLinkHeaderQuotedParamValueContext,
  3143. escapeStringForLinkHeaderQuotedParamValueContextReplacer
  3144. ) +
  3145. '"'));
  3146. return as;
  3147. }
  3148. var regexForHrefInLinkHeaderURLContext = /[<>\r\n]/g;
  3149. function escapeHrefForLinkHeaderURLContextReplacer(match) {
  3150. switch (match) {
  3151. case "<":
  3152. return "%3C";
  3153. case ">":
  3154. return "%3E";
  3155. case "\n":
  3156. return "%0A";
  3157. case "\r":
  3158. return "%0D";
  3159. default:
  3160. throw Error(
  3161. "escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
  3162. );
  3163. }
  3164. }
  3165. var regexForLinkHeaderQuotedParamValueContext = /["';,\r\n]/g;
  3166. function escapeStringForLinkHeaderQuotedParamValueContextReplacer(match) {
  3167. switch (match) {
  3168. case '"':
  3169. return "%22";
  3170. case "'":
  3171. return "%27";
  3172. case ";":
  3173. return "%3B";
  3174. case ",":
  3175. return "%2C";
  3176. case "\n":
  3177. return "%0A";
  3178. case "\r":
  3179. return "%0D";
  3180. default:
  3181. throw Error(
  3182. "escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
  3183. );
  3184. }
  3185. }
  3186. function hoistStyleQueueDependency(styleQueue) {
  3187. this.styles.add(styleQueue);
  3188. }
  3189. function hoistStylesheetDependency(stylesheet) {
  3190. this.stylesheets.add(stylesheet);
  3191. }
  3192. function hoistHoistables(parentState, childState) {
  3193. childState.styles.forEach(hoistStyleQueueDependency, parentState);
  3194. childState.stylesheets.forEach(hoistStylesheetDependency, parentState);
  3195. childState.suspenseyImages && (parentState.suspenseyImages = !0);
  3196. }
  3197. function hasSuspenseyContent(hoistableState) {
  3198. return 0 < hoistableState.stylesheets.size || hoistableState.suspenseyImages;
  3199. }
  3200. var bind = Function.prototype.bind,
  3201. requestStorage = new async_hooks.AsyncLocalStorage(),
  3202. REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
  3203. function getComponentNameFromType(type) {
  3204. if (null == type) return null;
  3205. if ("function" === typeof type)
  3206. return type.$$typeof === REACT_CLIENT_REFERENCE
  3207. ? null
  3208. : type.displayName || type.name || null;
  3209. if ("string" === typeof type) return type;
  3210. switch (type) {
  3211. case REACT_FRAGMENT_TYPE:
  3212. return "Fragment";
  3213. case REACT_PROFILER_TYPE:
  3214. return "Profiler";
  3215. case REACT_STRICT_MODE_TYPE:
  3216. return "StrictMode";
  3217. case REACT_SUSPENSE_TYPE:
  3218. return "Suspense";
  3219. case REACT_SUSPENSE_LIST_TYPE:
  3220. return "SuspenseList";
  3221. case REACT_ACTIVITY_TYPE:
  3222. return "Activity";
  3223. }
  3224. if ("object" === typeof type)
  3225. switch (type.$$typeof) {
  3226. case REACT_PORTAL_TYPE:
  3227. return "Portal";
  3228. case REACT_CONTEXT_TYPE:
  3229. return type.displayName || "Context";
  3230. case REACT_CONSUMER_TYPE:
  3231. return (type._context.displayName || "Context") + ".Consumer";
  3232. case REACT_FORWARD_REF_TYPE:
  3233. var innerType = type.render;
  3234. type = type.displayName;
  3235. type ||
  3236. ((type = innerType.displayName || innerType.name || ""),
  3237. (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
  3238. return type;
  3239. case REACT_MEMO_TYPE:
  3240. return (
  3241. (innerType = type.displayName || null),
  3242. null !== innerType
  3243. ? innerType
  3244. : getComponentNameFromType(type.type) || "Memo"
  3245. );
  3246. case REACT_LAZY_TYPE:
  3247. innerType = type._payload;
  3248. type = type._init;
  3249. try {
  3250. return getComponentNameFromType(type(innerType));
  3251. } catch (x) {}
  3252. }
  3253. return null;
  3254. }
  3255. var emptyContextObject = {},
  3256. currentActiveSnapshot = null;
  3257. function popToNearestCommonAncestor(prev, next) {
  3258. if (prev !== next) {
  3259. prev.context._currentValue = prev.parentValue;
  3260. prev = prev.parent;
  3261. var parentNext = next.parent;
  3262. if (null === prev) {
  3263. if (null !== parentNext)
  3264. throw Error(
  3265. "The stacks must reach the root at the same time. This is a bug in React."
  3266. );
  3267. } else {
  3268. if (null === parentNext)
  3269. throw Error(
  3270. "The stacks must reach the root at the same time. This is a bug in React."
  3271. );
  3272. popToNearestCommonAncestor(prev, parentNext);
  3273. }
  3274. next.context._currentValue = next.value;
  3275. }
  3276. }
  3277. function popAllPrevious(prev) {
  3278. prev.context._currentValue = prev.parentValue;
  3279. prev = prev.parent;
  3280. null !== prev && popAllPrevious(prev);
  3281. }
  3282. function pushAllNext(next) {
  3283. var parentNext = next.parent;
  3284. null !== parentNext && pushAllNext(parentNext);
  3285. next.context._currentValue = next.value;
  3286. }
  3287. function popPreviousToCommonLevel(prev, next) {
  3288. prev.context._currentValue = prev.parentValue;
  3289. prev = prev.parent;
  3290. if (null === prev)
  3291. throw Error(
  3292. "The depth must equal at least at zero before reaching the root. This is a bug in React."
  3293. );
  3294. prev.depth === next.depth
  3295. ? popToNearestCommonAncestor(prev, next)
  3296. : popPreviousToCommonLevel(prev, next);
  3297. }
  3298. function popNextToCommonLevel(prev, next) {
  3299. var parentNext = next.parent;
  3300. if (null === parentNext)
  3301. throw Error(
  3302. "The depth must equal at least at zero before reaching the root. This is a bug in React."
  3303. );
  3304. prev.depth === parentNext.depth
  3305. ? popToNearestCommonAncestor(prev, parentNext)
  3306. : popNextToCommonLevel(prev, parentNext);
  3307. next.context._currentValue = next.value;
  3308. }
  3309. function switchContext(newSnapshot) {
  3310. var prev = currentActiveSnapshot;
  3311. prev !== newSnapshot &&
  3312. (null === prev
  3313. ? pushAllNext(newSnapshot)
  3314. : null === newSnapshot
  3315. ? popAllPrevious(prev)
  3316. : prev.depth === newSnapshot.depth
  3317. ? popToNearestCommonAncestor(prev, newSnapshot)
  3318. : prev.depth > newSnapshot.depth
  3319. ? popPreviousToCommonLevel(prev, newSnapshot)
  3320. : popNextToCommonLevel(prev, newSnapshot),
  3321. (currentActiveSnapshot = newSnapshot));
  3322. }
  3323. var classComponentUpdater = {
  3324. enqueueSetState: function (inst, payload) {
  3325. inst = inst._reactInternals;
  3326. null !== inst.queue && inst.queue.push(payload);
  3327. },
  3328. enqueueReplaceState: function (inst, payload) {
  3329. inst = inst._reactInternals;
  3330. inst.replace = !0;
  3331. inst.queue = [payload];
  3332. },
  3333. enqueueForceUpdate: function () {}
  3334. },
  3335. emptyTreeContext = { id: 1, overflow: "" };
  3336. function pushTreeContext(baseContext, totalChildren, index) {
  3337. var baseIdWithLeadingBit = baseContext.id;
  3338. baseContext = baseContext.overflow;
  3339. var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
  3340. baseIdWithLeadingBit &= ~(1 << baseLength);
  3341. index += 1;
  3342. var length = 32 - clz32(totalChildren) + baseLength;
  3343. if (30 < length) {
  3344. var numberOfOverflowBits = baseLength - (baseLength % 5);
  3345. length = (
  3346. baseIdWithLeadingBit &
  3347. ((1 << numberOfOverflowBits) - 1)
  3348. ).toString(32);
  3349. baseIdWithLeadingBit >>= numberOfOverflowBits;
  3350. baseLength -= numberOfOverflowBits;
  3351. return {
  3352. id:
  3353. (1 << (32 - clz32(totalChildren) + baseLength)) |
  3354. (index << baseLength) |
  3355. baseIdWithLeadingBit,
  3356. overflow: length + baseContext
  3357. };
  3358. }
  3359. return {
  3360. id: (1 << length) | (index << baseLength) | baseIdWithLeadingBit,
  3361. overflow: baseContext
  3362. };
  3363. }
  3364. var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback,
  3365. log = Math.log,
  3366. LN2 = Math.LN2;
  3367. function clz32Fallback(x) {
  3368. x >>>= 0;
  3369. return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;
  3370. }
  3371. function noop() {}
  3372. var SuspenseException = Error(
  3373. "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
  3374. );
  3375. function trackUsedThenable(thenableState, thenable, index) {
  3376. index = thenableState[index];
  3377. void 0 === index
  3378. ? thenableState.push(thenable)
  3379. : index !== thenable && (thenable.then(noop, noop), (thenable = index));
  3380. switch (thenable.status) {
  3381. case "fulfilled":
  3382. return thenable.value;
  3383. case "rejected":
  3384. throw thenable.reason;
  3385. default:
  3386. "string" === typeof thenable.status
  3387. ? thenable.then(noop, noop)
  3388. : ((thenableState = thenable),
  3389. (thenableState.status = "pending"),
  3390. thenableState.then(
  3391. function (fulfilledValue) {
  3392. if ("pending" === thenable.status) {
  3393. var fulfilledThenable = thenable;
  3394. fulfilledThenable.status = "fulfilled";
  3395. fulfilledThenable.value = fulfilledValue;
  3396. }
  3397. },
  3398. function (error) {
  3399. if ("pending" === thenable.status) {
  3400. var rejectedThenable = thenable;
  3401. rejectedThenable.status = "rejected";
  3402. rejectedThenable.reason = error;
  3403. }
  3404. }
  3405. ));
  3406. switch (thenable.status) {
  3407. case "fulfilled":
  3408. return thenable.value;
  3409. case "rejected":
  3410. throw thenable.reason;
  3411. }
  3412. suspendedThenable = thenable;
  3413. throw SuspenseException;
  3414. }
  3415. }
  3416. var suspendedThenable = null;
  3417. function getSuspendedThenable() {
  3418. if (null === suspendedThenable)
  3419. throw Error(
  3420. "Expected a suspended thenable. This is a bug in React. Please file an issue."
  3421. );
  3422. var thenable = suspendedThenable;
  3423. suspendedThenable = null;
  3424. return thenable;
  3425. }
  3426. function is(x, y) {
  3427. return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
  3428. }
  3429. var objectIs = "function" === typeof Object.is ? Object.is : is,
  3430. currentlyRenderingComponent = null,
  3431. currentlyRenderingTask = null,
  3432. currentlyRenderingRequest = null,
  3433. currentlyRenderingKeyPath = null,
  3434. firstWorkInProgressHook = null,
  3435. workInProgressHook = null,
  3436. isReRender = !1,
  3437. didScheduleRenderPhaseUpdate = !1,
  3438. localIdCounter = 0,
  3439. actionStateCounter = 0,
  3440. actionStateMatchingIndex = -1,
  3441. thenableIndexCounter = 0,
  3442. thenableState = null,
  3443. renderPhaseUpdates = null,
  3444. numberOfReRenders = 0;
  3445. function resolveCurrentlyRenderingComponent() {
  3446. if (null === currentlyRenderingComponent)
  3447. throw Error(
  3448. "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
  3449. );
  3450. return currentlyRenderingComponent;
  3451. }
  3452. function createHook() {
  3453. if (0 < numberOfReRenders)
  3454. throw Error("Rendered more hooks than during the previous render");
  3455. return { memoizedState: null, queue: null, next: null };
  3456. }
  3457. function createWorkInProgressHook() {
  3458. null === workInProgressHook
  3459. ? null === firstWorkInProgressHook
  3460. ? ((isReRender = !1),
  3461. (firstWorkInProgressHook = workInProgressHook = createHook()))
  3462. : ((isReRender = !0), (workInProgressHook = firstWorkInProgressHook))
  3463. : null === workInProgressHook.next
  3464. ? ((isReRender = !1),
  3465. (workInProgressHook = workInProgressHook.next = createHook()))
  3466. : ((isReRender = !0), (workInProgressHook = workInProgressHook.next));
  3467. return workInProgressHook;
  3468. }
  3469. function getThenableStateAfterSuspending() {
  3470. var state = thenableState;
  3471. thenableState = null;
  3472. return state;
  3473. }
  3474. function resetHooksState() {
  3475. currentlyRenderingKeyPath =
  3476. currentlyRenderingRequest =
  3477. currentlyRenderingTask =
  3478. currentlyRenderingComponent =
  3479. null;
  3480. didScheduleRenderPhaseUpdate = !1;
  3481. firstWorkInProgressHook = null;
  3482. numberOfReRenders = 0;
  3483. workInProgressHook = renderPhaseUpdates = null;
  3484. }
  3485. function basicStateReducer(state, action) {
  3486. return "function" === typeof action ? action(state) : action;
  3487. }
  3488. function useReducer(reducer, initialArg, init) {
  3489. currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  3490. workInProgressHook = createWorkInProgressHook();
  3491. if (isReRender) {
  3492. var queue = workInProgressHook.queue;
  3493. initialArg = queue.dispatch;
  3494. if (
  3495. null !== renderPhaseUpdates &&
  3496. ((init = renderPhaseUpdates.get(queue)), void 0 !== init)
  3497. ) {
  3498. renderPhaseUpdates.delete(queue);
  3499. queue = workInProgressHook.memoizedState;
  3500. do (queue = reducer(queue, init.action)), (init = init.next);
  3501. while (null !== init);
  3502. workInProgressHook.memoizedState = queue;
  3503. return [queue, initialArg];
  3504. }
  3505. return [workInProgressHook.memoizedState, initialArg];
  3506. }
  3507. reducer =
  3508. reducer === basicStateReducer
  3509. ? "function" === typeof initialArg
  3510. ? initialArg()
  3511. : initialArg
  3512. : void 0 !== init
  3513. ? init(initialArg)
  3514. : initialArg;
  3515. workInProgressHook.memoizedState = reducer;
  3516. reducer = workInProgressHook.queue = { last: null, dispatch: null };
  3517. reducer = reducer.dispatch = dispatchAction.bind(
  3518. null,
  3519. currentlyRenderingComponent,
  3520. reducer
  3521. );
  3522. return [workInProgressHook.memoizedState, reducer];
  3523. }
  3524. function useMemo(nextCreate, deps) {
  3525. currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  3526. workInProgressHook = createWorkInProgressHook();
  3527. deps = void 0 === deps ? null : deps;
  3528. if (null !== workInProgressHook) {
  3529. var prevState = workInProgressHook.memoizedState;
  3530. if (null !== prevState && null !== deps) {
  3531. var prevDeps = prevState[1];
  3532. a: if (null === prevDeps) prevDeps = !1;
  3533. else {
  3534. for (var i = 0; i < prevDeps.length && i < deps.length; i++)
  3535. if (!objectIs(deps[i], prevDeps[i])) {
  3536. prevDeps = !1;
  3537. break a;
  3538. }
  3539. prevDeps = !0;
  3540. }
  3541. if (prevDeps) return prevState[0];
  3542. }
  3543. }
  3544. nextCreate = nextCreate();
  3545. workInProgressHook.memoizedState = [nextCreate, deps];
  3546. return nextCreate;
  3547. }
  3548. function dispatchAction(componentIdentity, queue, action) {
  3549. if (25 <= numberOfReRenders)
  3550. throw Error(
  3551. "Too many re-renders. React limits the number of renders to prevent an infinite loop."
  3552. );
  3553. if (componentIdentity === currentlyRenderingComponent)
  3554. if (
  3555. ((didScheduleRenderPhaseUpdate = !0),
  3556. (componentIdentity = { action: action, next: null }),
  3557. null === renderPhaseUpdates && (renderPhaseUpdates = new Map()),
  3558. (action = renderPhaseUpdates.get(queue)),
  3559. void 0 === action)
  3560. )
  3561. renderPhaseUpdates.set(queue, componentIdentity);
  3562. else {
  3563. for (queue = action; null !== queue.next; ) queue = queue.next;
  3564. queue.next = componentIdentity;
  3565. }
  3566. }
  3567. function throwOnUseEffectEventCall() {
  3568. throw Error(
  3569. "A function wrapped in useEffectEvent can't be called during rendering."
  3570. );
  3571. }
  3572. function unsupportedStartTransition() {
  3573. throw Error("startTransition cannot be called during server rendering.");
  3574. }
  3575. function unsupportedSetOptimisticState() {
  3576. throw Error("Cannot update optimistic state while rendering.");
  3577. }
  3578. function createPostbackActionStateKey(permalink, componentKeyPath, hookIndex) {
  3579. if (void 0 !== permalink) return "p" + permalink;
  3580. permalink = JSON.stringify([componentKeyPath, null, hookIndex]);
  3581. componentKeyPath = crypto.createHash("md5");
  3582. componentKeyPath.update(permalink);
  3583. return "k" + componentKeyPath.digest("hex");
  3584. }
  3585. function useActionState(action, initialState, permalink) {
  3586. resolveCurrentlyRenderingComponent();
  3587. var actionStateHookIndex = actionStateCounter++,
  3588. request = currentlyRenderingRequest;
  3589. if ("function" === typeof action.$$FORM_ACTION) {
  3590. var nextPostbackStateKey = null,
  3591. componentKeyPath = currentlyRenderingKeyPath;
  3592. request = request.formState;
  3593. var isSignatureEqual = action.$$IS_SIGNATURE_EQUAL;
  3594. if (null !== request && "function" === typeof isSignatureEqual) {
  3595. var postbackKey = request[1];
  3596. isSignatureEqual.call(action, request[2], request[3]) &&
  3597. ((nextPostbackStateKey = createPostbackActionStateKey(
  3598. permalink,
  3599. componentKeyPath,
  3600. actionStateHookIndex
  3601. )),
  3602. postbackKey === nextPostbackStateKey &&
  3603. ((actionStateMatchingIndex = actionStateHookIndex),
  3604. (initialState = request[0])));
  3605. }
  3606. var boundAction = action.bind(null, initialState);
  3607. action = function (payload) {
  3608. boundAction(payload);
  3609. };
  3610. "function" === typeof boundAction.$$FORM_ACTION &&
  3611. (action.$$FORM_ACTION = function (prefix) {
  3612. prefix = boundAction.$$FORM_ACTION(prefix);
  3613. void 0 !== permalink &&
  3614. ((permalink += ""), (prefix.action = permalink));
  3615. var formData = prefix.data;
  3616. formData &&
  3617. (null === nextPostbackStateKey &&
  3618. (nextPostbackStateKey = createPostbackActionStateKey(
  3619. permalink,
  3620. componentKeyPath,
  3621. actionStateHookIndex
  3622. )),
  3623. formData.append("$ACTION_KEY", nextPostbackStateKey));
  3624. return prefix;
  3625. });
  3626. return [initialState, action, !1];
  3627. }
  3628. var boundAction$22 = action.bind(null, initialState);
  3629. return [
  3630. initialState,
  3631. function (payload) {
  3632. boundAction$22(payload);
  3633. },
  3634. !1
  3635. ];
  3636. }
  3637. function unwrapThenable(thenable) {
  3638. var index = thenableIndexCounter;
  3639. thenableIndexCounter += 1;
  3640. null === thenableState && (thenableState = []);
  3641. return trackUsedThenable(thenableState, thenable, index);
  3642. }
  3643. function unsupportedRefresh() {
  3644. throw Error("Cache cannot be refreshed during server rendering.");
  3645. }
  3646. var HooksDispatcher = {
  3647. readContext: function (context) {
  3648. return context._currentValue;
  3649. },
  3650. use: function (usable) {
  3651. if (null !== usable && "object" === typeof usable) {
  3652. if ("function" === typeof usable.then) return unwrapThenable(usable);
  3653. if (usable.$$typeof === REACT_CONTEXT_TYPE) return usable._currentValue;
  3654. }
  3655. throw Error("An unsupported type was passed to use(): " + String(usable));
  3656. },
  3657. useContext: function (context) {
  3658. resolveCurrentlyRenderingComponent();
  3659. return context._currentValue;
  3660. },
  3661. useMemo: useMemo,
  3662. useReducer: useReducer,
  3663. useRef: function (initialValue) {
  3664. currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  3665. workInProgressHook = createWorkInProgressHook();
  3666. var previousRef = workInProgressHook.memoizedState;
  3667. return null === previousRef
  3668. ? ((initialValue = { current: initialValue }),
  3669. (workInProgressHook.memoizedState = initialValue))
  3670. : previousRef;
  3671. },
  3672. useState: function (initialState) {
  3673. return useReducer(basicStateReducer, initialState);
  3674. },
  3675. useInsertionEffect: noop,
  3676. useLayoutEffect: noop,
  3677. useCallback: function (callback, deps) {
  3678. return useMemo(function () {
  3679. return callback;
  3680. }, deps);
  3681. },
  3682. useImperativeHandle: noop,
  3683. useEffect: noop,
  3684. useDebugValue: noop,
  3685. useDeferredValue: function (value, initialValue) {
  3686. resolveCurrentlyRenderingComponent();
  3687. return void 0 !== initialValue ? initialValue : value;
  3688. },
  3689. useTransition: function () {
  3690. resolveCurrentlyRenderingComponent();
  3691. return [!1, unsupportedStartTransition];
  3692. },
  3693. useId: function () {
  3694. var JSCompiler_inline_result = currentlyRenderingTask.treeContext;
  3695. var overflow = JSCompiler_inline_result.overflow;
  3696. JSCompiler_inline_result = JSCompiler_inline_result.id;
  3697. JSCompiler_inline_result =
  3698. (
  3699. JSCompiler_inline_result &
  3700. ~(1 << (32 - clz32(JSCompiler_inline_result) - 1))
  3701. ).toString(32) + overflow;
  3702. var resumableState = currentResumableState;
  3703. if (null === resumableState)
  3704. throw Error(
  3705. "Invalid hook call. Hooks can only be called inside of the body of a function component."
  3706. );
  3707. overflow = localIdCounter++;
  3708. JSCompiler_inline_result =
  3709. "_" + resumableState.idPrefix + "R_" + JSCompiler_inline_result;
  3710. 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32));
  3711. return JSCompiler_inline_result + "_";
  3712. },
  3713. useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
  3714. if (void 0 === getServerSnapshot)
  3715. throw Error(
  3716. "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
  3717. );
  3718. return getServerSnapshot();
  3719. },
  3720. useOptimistic: function (passthrough) {
  3721. resolveCurrentlyRenderingComponent();
  3722. return [passthrough, unsupportedSetOptimisticState];
  3723. },
  3724. useActionState: useActionState,
  3725. useFormState: useActionState,
  3726. useHostTransitionStatus: function () {
  3727. resolveCurrentlyRenderingComponent();
  3728. return sharedNotPendingObject;
  3729. },
  3730. useMemoCache: function (size) {
  3731. for (var data = Array(size), i = 0; i < size; i++)
  3732. data[i] = REACT_MEMO_CACHE_SENTINEL;
  3733. return data;
  3734. },
  3735. useCacheRefresh: function () {
  3736. return unsupportedRefresh;
  3737. },
  3738. useEffectEvent: function () {
  3739. return throwOnUseEffectEventCall;
  3740. }
  3741. },
  3742. currentResumableState = null,
  3743. DefaultAsyncDispatcher = {
  3744. getCacheForType: function () {
  3745. throw Error("Not implemented.");
  3746. },
  3747. cacheSignal: function () {
  3748. throw Error("Not implemented.");
  3749. }
  3750. };
  3751. function prepareStackTrace(error, structuredStackTrace) {
  3752. error = (error.name || "Error") + ": " + (error.message || "");
  3753. for (var i = 0; i < structuredStackTrace.length; i++)
  3754. error += "\n at " + structuredStackTrace[i].toString();
  3755. return error;
  3756. }
  3757. var prefix, suffix;
  3758. function describeBuiltInComponentFrame(name) {
  3759. if (void 0 === prefix)
  3760. try {
  3761. throw Error();
  3762. } catch (x) {
  3763. var match = x.stack.trim().match(/\n( *(at )?)/);
  3764. prefix = (match && match[1]) || "";
  3765. suffix =
  3766. -1 < x.stack.indexOf("\n at")
  3767. ? " (<anonymous>)"
  3768. : -1 < x.stack.indexOf("@")
  3769. ? "@unknown:0:0"
  3770. : "";
  3771. }
  3772. return "\n" + prefix + name + suffix;
  3773. }
  3774. var reentry = !1;
  3775. function describeNativeComponentFrame(fn, construct) {
  3776. if (!fn || reentry) return "";
  3777. reentry = !0;
  3778. var previousPrepareStackTrace = Error.prepareStackTrace;
  3779. Error.prepareStackTrace = prepareStackTrace;
  3780. try {
  3781. var RunInRootFrame = {
  3782. DetermineComponentFrameRoot: function () {
  3783. try {
  3784. if (construct) {
  3785. var Fake = function () {
  3786. throw Error();
  3787. };
  3788. Object.defineProperty(Fake.prototype, "props", {
  3789. set: function () {
  3790. throw Error();
  3791. }
  3792. });
  3793. if ("object" === typeof Reflect && Reflect.construct) {
  3794. try {
  3795. Reflect.construct(Fake, []);
  3796. } catch (x) {
  3797. var control = x;
  3798. }
  3799. Reflect.construct(fn, [], Fake);
  3800. } else {
  3801. try {
  3802. Fake.call();
  3803. } catch (x$24) {
  3804. control = x$24;
  3805. }
  3806. fn.call(Fake.prototype);
  3807. }
  3808. } else {
  3809. try {
  3810. throw Error();
  3811. } catch (x$25) {
  3812. control = x$25;
  3813. }
  3814. (Fake = fn()) &&
  3815. "function" === typeof Fake.catch &&
  3816. Fake.catch(function () {});
  3817. }
  3818. } catch (sample) {
  3819. if (sample && control && "string" === typeof sample.stack)
  3820. return [sample.stack, control.stack];
  3821. }
  3822. return [null, null];
  3823. }
  3824. };
  3825. RunInRootFrame.DetermineComponentFrameRoot.displayName =
  3826. "DetermineComponentFrameRoot";
  3827. var namePropDescriptor = Object.getOwnPropertyDescriptor(
  3828. RunInRootFrame.DetermineComponentFrameRoot,
  3829. "name"
  3830. );
  3831. namePropDescriptor &&
  3832. namePropDescriptor.configurable &&
  3833. Object.defineProperty(
  3834. RunInRootFrame.DetermineComponentFrameRoot,
  3835. "name",
  3836. { value: "DetermineComponentFrameRoot" }
  3837. );
  3838. var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
  3839. sampleStack = _RunInRootFrame$Deter[0],
  3840. controlStack = _RunInRootFrame$Deter[1];
  3841. if (sampleStack && controlStack) {
  3842. var sampleLines = sampleStack.split("\n"),
  3843. controlLines = controlStack.split("\n");
  3844. for (
  3845. namePropDescriptor = RunInRootFrame = 0;
  3846. RunInRootFrame < sampleLines.length &&
  3847. !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot");
  3848. )
  3849. RunInRootFrame++;
  3850. for (
  3851. ;
  3852. namePropDescriptor < controlLines.length &&
  3853. !controlLines[namePropDescriptor].includes(
  3854. "DetermineComponentFrameRoot"
  3855. );
  3856. )
  3857. namePropDescriptor++;
  3858. if (
  3859. RunInRootFrame === sampleLines.length ||
  3860. namePropDescriptor === controlLines.length
  3861. )
  3862. for (
  3863. RunInRootFrame = sampleLines.length - 1,
  3864. namePropDescriptor = controlLines.length - 1;
  3865. 1 <= RunInRootFrame &&
  3866. 0 <= namePropDescriptor &&
  3867. sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor];
  3868. )
  3869. namePropDescriptor--;
  3870. for (
  3871. ;
  3872. 1 <= RunInRootFrame && 0 <= namePropDescriptor;
  3873. RunInRootFrame--, namePropDescriptor--
  3874. )
  3875. if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
  3876. if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {
  3877. do
  3878. if (
  3879. (RunInRootFrame--,
  3880. namePropDescriptor--,
  3881. 0 > namePropDescriptor ||
  3882. sampleLines[RunInRootFrame] !==
  3883. controlLines[namePropDescriptor])
  3884. ) {
  3885. var frame =
  3886. "\n" +
  3887. sampleLines[RunInRootFrame].replace(" at new ", " at ");
  3888. fn.displayName &&
  3889. frame.includes("<anonymous>") &&
  3890. (frame = frame.replace("<anonymous>", fn.displayName));
  3891. return frame;
  3892. }
  3893. while (1 <= RunInRootFrame && 0 <= namePropDescriptor);
  3894. }
  3895. break;
  3896. }
  3897. }
  3898. } finally {
  3899. (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace);
  3900. }
  3901. return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "")
  3902. ? describeBuiltInComponentFrame(previousPrepareStackTrace)
  3903. : "";
  3904. }
  3905. function describeComponentStackByType(type) {
  3906. if ("string" === typeof type) return describeBuiltInComponentFrame(type);
  3907. if ("function" === typeof type)
  3908. return type.prototype && type.prototype.isReactComponent
  3909. ? describeNativeComponentFrame(type, !0)
  3910. : describeNativeComponentFrame(type, !1);
  3911. if ("object" === typeof type && null !== type) {
  3912. switch (type.$$typeof) {
  3913. case REACT_FORWARD_REF_TYPE:
  3914. return describeNativeComponentFrame(type.render, !1);
  3915. case REACT_MEMO_TYPE:
  3916. return describeNativeComponentFrame(type.type, !1);
  3917. case REACT_LAZY_TYPE:
  3918. var lazyComponent = type,
  3919. payload = lazyComponent._payload;
  3920. lazyComponent = lazyComponent._init;
  3921. try {
  3922. type = lazyComponent(payload);
  3923. } catch (x) {
  3924. return describeBuiltInComponentFrame("Lazy");
  3925. }
  3926. return describeComponentStackByType(type);
  3927. }
  3928. if ("string" === typeof type.name) {
  3929. a: {
  3930. payload = type.name;
  3931. lazyComponent = type.env;
  3932. var location = type.debugLocation;
  3933. if (
  3934. null != location &&
  3935. ((type = Error.prepareStackTrace),
  3936. (Error.prepareStackTrace = prepareStackTrace),
  3937. (location = location.stack),
  3938. (Error.prepareStackTrace = type),
  3939. location.startsWith("Error: react-stack-top-frame\n") &&
  3940. (location = location.slice(29)),
  3941. (type = location.indexOf("\n")),
  3942. -1 !== type && (location = location.slice(type + 1)),
  3943. (type = location.indexOf("react_stack_bottom_frame")),
  3944. -1 !== type && (type = location.lastIndexOf("\n", type)),
  3945. (type = -1 !== type ? (location = location.slice(0, type)) : ""),
  3946. (location = type.lastIndexOf("\n")),
  3947. (type = -1 === location ? type : type.slice(location + 1)),
  3948. -1 !== type.indexOf(payload))
  3949. ) {
  3950. payload = "\n" + type;
  3951. break a;
  3952. }
  3953. payload = describeBuiltInComponentFrame(
  3954. payload + (lazyComponent ? " [" + lazyComponent + "]" : "")
  3955. );
  3956. }
  3957. return payload;
  3958. }
  3959. }
  3960. switch (type) {
  3961. case REACT_SUSPENSE_LIST_TYPE:
  3962. return describeBuiltInComponentFrame("SuspenseList");
  3963. case REACT_SUSPENSE_TYPE:
  3964. return describeBuiltInComponentFrame("Suspense");
  3965. }
  3966. return "";
  3967. }
  3968. function isEligibleForOutlining(request, boundary) {
  3969. return (
  3970. (500 < boundary.byteSize || hasSuspenseyContent(boundary.contentState)) &&
  3971. null === boundary.contentPreamble
  3972. );
  3973. }
  3974. function defaultErrorHandler(error) {
  3975. if (
  3976. "object" === typeof error &&
  3977. null !== error &&
  3978. "string" === typeof error.environmentName
  3979. ) {
  3980. var JSCompiler_inline_result = error.environmentName;
  3981. error = [error].slice(0);
  3982. "string" === typeof error[0]
  3983. ? error.splice(
  3984. 0,
  3985. 1,
  3986. "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + error[0],
  3987. "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",
  3988. " " + JSCompiler_inline_result + " ",
  3989. ""
  3990. )
  3991. : error.splice(
  3992. 0,
  3993. 0,
  3994. "\u001b[0m\u001b[7m%c%s\u001b[0m%c",
  3995. "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",
  3996. " " + JSCompiler_inline_result + " ",
  3997. ""
  3998. );
  3999. error.unshift(console);
  4000. JSCompiler_inline_result = bind.apply(console.error, error);
  4001. JSCompiler_inline_result();
  4002. } else console.error(error);
  4003. return null;
  4004. }
  4005. function RequestInstance(
  4006. resumableState,
  4007. renderState,
  4008. rootFormatContext,
  4009. progressiveChunkSize,
  4010. onError,
  4011. onAllReady,
  4012. onShellReady,
  4013. onShellError,
  4014. onFatalError,
  4015. onPostpone,
  4016. formState
  4017. ) {
  4018. var abortSet = new Set();
  4019. this.destination = null;
  4020. this.flushScheduled = !1;
  4021. this.resumableState = resumableState;
  4022. this.renderState = renderState;
  4023. this.rootFormatContext = rootFormatContext;
  4024. this.progressiveChunkSize =
  4025. void 0 === progressiveChunkSize ? 12800 : progressiveChunkSize;
  4026. this.status = 10;
  4027. this.fatalError = null;
  4028. this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
  4029. this.completedPreambleSegments = this.completedRootSegment = null;
  4030. this.byteSize = 0;
  4031. this.abortableTasks = abortSet;
  4032. this.pingedTasks = [];
  4033. this.clientRenderedBoundaries = [];
  4034. this.completedBoundaries = [];
  4035. this.partialBoundaries = [];
  4036. this.trackedPostpones = null;
  4037. this.onError = void 0 === onError ? defaultErrorHandler : onError;
  4038. this.onPostpone = void 0 === onPostpone ? noop : onPostpone;
  4039. this.onAllReady = void 0 === onAllReady ? noop : onAllReady;
  4040. this.onShellReady = void 0 === onShellReady ? noop : onShellReady;
  4041. this.onShellError = void 0 === onShellError ? noop : onShellError;
  4042. this.onFatalError = void 0 === onFatalError ? noop : onFatalError;
  4043. this.formState = void 0 === formState ? null : formState;
  4044. }
  4045. function createRequest(
  4046. children,
  4047. resumableState,
  4048. renderState,
  4049. rootFormatContext,
  4050. progressiveChunkSize,
  4051. onError,
  4052. onAllReady,
  4053. onShellReady,
  4054. onShellError,
  4055. onFatalError,
  4056. onPostpone,
  4057. formState
  4058. ) {
  4059. resumableState = new RequestInstance(
  4060. resumableState,
  4061. renderState,
  4062. rootFormatContext,
  4063. progressiveChunkSize,
  4064. onError,
  4065. onAllReady,
  4066. onShellReady,
  4067. onShellError,
  4068. onFatalError,
  4069. onPostpone,
  4070. formState
  4071. );
  4072. renderState = createPendingSegment(
  4073. resumableState,
  4074. 0,
  4075. null,
  4076. rootFormatContext,
  4077. !1,
  4078. !1
  4079. );
  4080. renderState.parentFlushed = !0;
  4081. children = createRenderTask(
  4082. resumableState,
  4083. null,
  4084. children,
  4085. -1,
  4086. null,
  4087. renderState,
  4088. null,
  4089. null,
  4090. resumableState.abortableTasks,
  4091. null,
  4092. rootFormatContext,
  4093. null,
  4094. emptyTreeContext,
  4095. null,
  4096. null
  4097. );
  4098. pushComponentStack(children);
  4099. resumableState.pingedTasks.push(children);
  4100. return resumableState;
  4101. }
  4102. function createPrerenderRequest(
  4103. children,
  4104. resumableState,
  4105. renderState,
  4106. rootFormatContext,
  4107. progressiveChunkSize,
  4108. onError,
  4109. onAllReady,
  4110. onShellReady,
  4111. onShellError,
  4112. onFatalError,
  4113. onPostpone
  4114. ) {
  4115. children = createRequest(
  4116. children,
  4117. resumableState,
  4118. renderState,
  4119. rootFormatContext,
  4120. progressiveChunkSize,
  4121. onError,
  4122. onAllReady,
  4123. onShellReady,
  4124. onShellError,
  4125. onFatalError,
  4126. onPostpone,
  4127. void 0
  4128. );
  4129. children.trackedPostpones = {
  4130. workingMap: new Map(),
  4131. rootNodes: [],
  4132. rootSlots: null
  4133. };
  4134. return children;
  4135. }
  4136. function resumeRequest(
  4137. children,
  4138. postponedState,
  4139. renderState,
  4140. onError,
  4141. onAllReady,
  4142. onShellReady,
  4143. onShellError,
  4144. onFatalError,
  4145. onPostpone
  4146. ) {
  4147. renderState = new RequestInstance(
  4148. postponedState.resumableState,
  4149. renderState,
  4150. postponedState.rootFormatContext,
  4151. postponedState.progressiveChunkSize,
  4152. onError,
  4153. onAllReady,
  4154. onShellReady,
  4155. onShellError,
  4156. onFatalError,
  4157. onPostpone,
  4158. null
  4159. );
  4160. renderState.nextSegmentId = postponedState.nextSegmentId;
  4161. if ("number" === typeof postponedState.replaySlots)
  4162. return (
  4163. (onError = createPendingSegment(
  4164. renderState,
  4165. 0,
  4166. null,
  4167. postponedState.rootFormatContext,
  4168. !1,
  4169. !1
  4170. )),
  4171. (onError.parentFlushed = !0),
  4172. (children = createRenderTask(
  4173. renderState,
  4174. null,
  4175. children,
  4176. -1,
  4177. null,
  4178. onError,
  4179. null,
  4180. null,
  4181. renderState.abortableTasks,
  4182. null,
  4183. postponedState.rootFormatContext,
  4184. null,
  4185. emptyTreeContext,
  4186. null,
  4187. null
  4188. )),
  4189. pushComponentStack(children),
  4190. renderState.pingedTasks.push(children),
  4191. renderState
  4192. );
  4193. children = createReplayTask(
  4194. renderState,
  4195. null,
  4196. {
  4197. nodes: postponedState.replayNodes,
  4198. slots: postponedState.replaySlots,
  4199. pendingTasks: 0
  4200. },
  4201. children,
  4202. -1,
  4203. null,
  4204. null,
  4205. renderState.abortableTasks,
  4206. null,
  4207. postponedState.rootFormatContext,
  4208. null,
  4209. emptyTreeContext,
  4210. null,
  4211. null
  4212. );
  4213. pushComponentStack(children);
  4214. renderState.pingedTasks.push(children);
  4215. return renderState;
  4216. }
  4217. function resumeAndPrerenderRequest(
  4218. children,
  4219. postponedState,
  4220. renderState,
  4221. onError,
  4222. onAllReady,
  4223. onShellReady,
  4224. onShellError,
  4225. onFatalError,
  4226. onPostpone
  4227. ) {
  4228. children = resumeRequest(
  4229. children,
  4230. postponedState,
  4231. renderState,
  4232. onError,
  4233. onAllReady,
  4234. onShellReady,
  4235. onShellError,
  4236. onFatalError,
  4237. onPostpone
  4238. );
  4239. children.trackedPostpones = {
  4240. workingMap: new Map(),
  4241. rootNodes: [],
  4242. rootSlots: null
  4243. };
  4244. return children;
  4245. }
  4246. var currentRequest = null;
  4247. function resolveRequest() {
  4248. if (currentRequest) return currentRequest;
  4249. var store = requestStorage.getStore();
  4250. return store ? store : null;
  4251. }
  4252. function pingTask(request, task) {
  4253. request.pingedTasks.push(task);
  4254. 1 === request.pingedTasks.length &&
  4255. ((request.flushScheduled = null !== request.destination),
  4256. null !== request.trackedPostpones || 10 === request.status
  4257. ? scheduleMicrotask(function () {
  4258. return performWork(request);
  4259. })
  4260. : setImmediate(function () {
  4261. return performWork(request);
  4262. }));
  4263. }
  4264. function createSuspenseBoundary(
  4265. request,
  4266. row,
  4267. fallbackAbortableTasks,
  4268. contentPreamble,
  4269. fallbackPreamble
  4270. ) {
  4271. fallbackAbortableTasks = {
  4272. status: 0,
  4273. rootSegmentID: -1,
  4274. parentFlushed: !1,
  4275. pendingTasks: 0,
  4276. row: row,
  4277. completedSegments: [],
  4278. byteSize: 0,
  4279. fallbackAbortableTasks: fallbackAbortableTasks,
  4280. errorDigest: null,
  4281. contentState: createHoistableState(),
  4282. fallbackState: createHoistableState(),
  4283. contentPreamble: contentPreamble,
  4284. fallbackPreamble: fallbackPreamble,
  4285. trackedContentKeyPath: null,
  4286. trackedFallbackNode: null
  4287. };
  4288. null !== row &&
  4289. (row.pendingTasks++,
  4290. (contentPreamble = row.boundaries),
  4291. null !== contentPreamble &&
  4292. (request.allPendingTasks++,
  4293. fallbackAbortableTasks.pendingTasks++,
  4294. contentPreamble.push(fallbackAbortableTasks)),
  4295. (request = row.inheritedHoistables),
  4296. null !== request &&
  4297. hoistHoistables(fallbackAbortableTasks.contentState, request));
  4298. return fallbackAbortableTasks;
  4299. }
  4300. function createRenderTask(
  4301. request,
  4302. thenableState,
  4303. node,
  4304. childIndex,
  4305. blockedBoundary,
  4306. blockedSegment,
  4307. blockedPreamble,
  4308. hoistableState,
  4309. abortSet,
  4310. keyPath,
  4311. formatContext,
  4312. context,
  4313. treeContext,
  4314. row,
  4315. componentStack
  4316. ) {
  4317. request.allPendingTasks++;
  4318. null === blockedBoundary
  4319. ? request.pendingRootTasks++
  4320. : blockedBoundary.pendingTasks++;
  4321. null !== row && row.pendingTasks++;
  4322. var task = {
  4323. replay: null,
  4324. node: node,
  4325. childIndex: childIndex,
  4326. ping: function () {
  4327. return pingTask(request, task);
  4328. },
  4329. blockedBoundary: blockedBoundary,
  4330. blockedSegment: blockedSegment,
  4331. blockedPreamble: blockedPreamble,
  4332. hoistableState: hoistableState,
  4333. abortSet: abortSet,
  4334. keyPath: keyPath,
  4335. formatContext: formatContext,
  4336. context: context,
  4337. treeContext: treeContext,
  4338. row: row,
  4339. componentStack: componentStack,
  4340. thenableState: thenableState
  4341. };
  4342. abortSet.add(task);
  4343. return task;
  4344. }
  4345. function createReplayTask(
  4346. request,
  4347. thenableState,
  4348. replay,
  4349. node,
  4350. childIndex,
  4351. blockedBoundary,
  4352. hoistableState,
  4353. abortSet,
  4354. keyPath,
  4355. formatContext,
  4356. context,
  4357. treeContext,
  4358. row,
  4359. componentStack
  4360. ) {
  4361. request.allPendingTasks++;
  4362. null === blockedBoundary
  4363. ? request.pendingRootTasks++
  4364. : blockedBoundary.pendingTasks++;
  4365. null !== row && row.pendingTasks++;
  4366. replay.pendingTasks++;
  4367. var task = {
  4368. replay: replay,
  4369. node: node,
  4370. childIndex: childIndex,
  4371. ping: function () {
  4372. return pingTask(request, task);
  4373. },
  4374. blockedBoundary: blockedBoundary,
  4375. blockedSegment: null,
  4376. blockedPreamble: null,
  4377. hoistableState: hoistableState,
  4378. abortSet: abortSet,
  4379. keyPath: keyPath,
  4380. formatContext: formatContext,
  4381. context: context,
  4382. treeContext: treeContext,
  4383. row: row,
  4384. componentStack: componentStack,
  4385. thenableState: thenableState
  4386. };
  4387. abortSet.add(task);
  4388. return task;
  4389. }
  4390. function createPendingSegment(
  4391. request,
  4392. index,
  4393. boundary,
  4394. parentFormatContext,
  4395. lastPushedText,
  4396. textEmbedded
  4397. ) {
  4398. return {
  4399. status: 0,
  4400. parentFlushed: !1,
  4401. id: -1,
  4402. index: index,
  4403. chunks: [],
  4404. children: [],
  4405. preambleChildren: [],
  4406. parentFormatContext: parentFormatContext,
  4407. boundary: boundary,
  4408. lastPushedText: lastPushedText,
  4409. textEmbedded: textEmbedded
  4410. };
  4411. }
  4412. function pushComponentStack(task) {
  4413. var node = task.node;
  4414. if ("object" === typeof node && null !== node)
  4415. switch (node.$$typeof) {
  4416. case REACT_ELEMENT_TYPE:
  4417. task.componentStack = { parent: task.componentStack, type: node.type };
  4418. }
  4419. }
  4420. function replaceSuspenseComponentStackWithSuspenseFallbackStack(
  4421. componentStack
  4422. ) {
  4423. return null === componentStack
  4424. ? null
  4425. : { parent: componentStack.parent, type: "Suspense Fallback" };
  4426. }
  4427. function getThrownInfo(node$jscomp$0) {
  4428. var errorInfo = {};
  4429. node$jscomp$0 &&
  4430. Object.defineProperty(errorInfo, "componentStack", {
  4431. configurable: !0,
  4432. enumerable: !0,
  4433. get: function () {
  4434. try {
  4435. var info = "",
  4436. node = node$jscomp$0;
  4437. do
  4438. (info += describeComponentStackByType(node.type)),
  4439. (node = node.parent);
  4440. while (node);
  4441. var JSCompiler_inline_result = info;
  4442. } catch (x) {
  4443. JSCompiler_inline_result =
  4444. "\nError generating stack: " + x.message + "\n" + x.stack;
  4445. }
  4446. Object.defineProperty(errorInfo, "componentStack", {
  4447. value: JSCompiler_inline_result
  4448. });
  4449. return JSCompiler_inline_result;
  4450. }
  4451. });
  4452. return errorInfo;
  4453. }
  4454. function logRecoverableError(request, error, errorInfo) {
  4455. request = request.onError;
  4456. error = request(error, errorInfo);
  4457. if (null == error || "string" === typeof error) return error;
  4458. }
  4459. function fatalError(request, error) {
  4460. var onShellError = request.onShellError,
  4461. onFatalError = request.onFatalError;
  4462. onShellError(error);
  4463. onFatalError(error);
  4464. null !== request.destination
  4465. ? ((request.status = 14), request.destination.destroy(error))
  4466. : ((request.status = 13), (request.fatalError = error));
  4467. }
  4468. function finishSuspenseListRow(request, row) {
  4469. unblockSuspenseListRow(request, row.next, row.hoistables);
  4470. }
  4471. function unblockSuspenseListRow(request, unblockedRow, inheritedHoistables) {
  4472. for (; null !== unblockedRow; ) {
  4473. null !== inheritedHoistables &&
  4474. (hoistHoistables(unblockedRow.hoistables, inheritedHoistables),
  4475. (unblockedRow.inheritedHoistables = inheritedHoistables));
  4476. var unblockedBoundaries = unblockedRow.boundaries;
  4477. if (null !== unblockedBoundaries) {
  4478. unblockedRow.boundaries = null;
  4479. for (var i = 0; i < unblockedBoundaries.length; i++) {
  4480. var unblockedBoundary = unblockedBoundaries[i];
  4481. null !== inheritedHoistables &&
  4482. hoistHoistables(unblockedBoundary.contentState, inheritedHoistables);
  4483. finishedTask(request, unblockedBoundary, null, null);
  4484. }
  4485. }
  4486. unblockedRow.pendingTasks--;
  4487. if (0 < unblockedRow.pendingTasks) break;
  4488. inheritedHoistables = unblockedRow.hoistables;
  4489. unblockedRow = unblockedRow.next;
  4490. }
  4491. }
  4492. function tryToResolveTogetherRow(request, togetherRow) {
  4493. var boundaries = togetherRow.boundaries;
  4494. if (null !== boundaries && togetherRow.pendingTasks === boundaries.length) {
  4495. for (var allCompleteAndInlinable = !0, i = 0; i < boundaries.length; i++) {
  4496. var rowBoundary = boundaries[i];
  4497. if (
  4498. 1 !== rowBoundary.pendingTasks ||
  4499. rowBoundary.parentFlushed ||
  4500. isEligibleForOutlining(request, rowBoundary)
  4501. ) {
  4502. allCompleteAndInlinable = !1;
  4503. break;
  4504. }
  4505. }
  4506. allCompleteAndInlinable &&
  4507. unblockSuspenseListRow(request, togetherRow, togetherRow.hoistables);
  4508. }
  4509. }
  4510. function createSuspenseListRow(previousRow) {
  4511. var newRow = {
  4512. pendingTasks: 1,
  4513. boundaries: null,
  4514. hoistables: createHoistableState(),
  4515. inheritedHoistables: null,
  4516. together: !1,
  4517. next: null
  4518. };
  4519. null !== previousRow &&
  4520. 0 < previousRow.pendingTasks &&
  4521. (newRow.pendingTasks++,
  4522. (newRow.boundaries = []),
  4523. (previousRow.next = newRow));
  4524. return newRow;
  4525. }
  4526. function renderSuspenseListRows(request, task, keyPath, rows, revealOrder) {
  4527. var prevKeyPath = task.keyPath,
  4528. prevTreeContext = task.treeContext,
  4529. prevRow = task.row;
  4530. task.keyPath = keyPath;
  4531. keyPath = rows.length;
  4532. var previousSuspenseListRow = null;
  4533. if (null !== task.replay) {
  4534. var resumeSlots = task.replay.slots;
  4535. if (null !== resumeSlots && "object" === typeof resumeSlots)
  4536. for (var n = 0; n < keyPath; n++) {
  4537. var i =
  4538. "backwards" !== revealOrder &&
  4539. "unstable_legacy-backwards" !== revealOrder
  4540. ? n
  4541. : keyPath - 1 - n,
  4542. node = rows[i];
  4543. task.row = previousSuspenseListRow = createSuspenseListRow(
  4544. previousSuspenseListRow
  4545. );
  4546. task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);
  4547. var resumeSegmentID = resumeSlots[i];
  4548. "number" === typeof resumeSegmentID
  4549. ? (resumeNode(request, task, resumeSegmentID, node, i),
  4550. delete resumeSlots[i])
  4551. : renderNode(request, task, node, i);
  4552. 0 === --previousSuspenseListRow.pendingTasks &&
  4553. finishSuspenseListRow(request, previousSuspenseListRow);
  4554. }
  4555. else
  4556. for (resumeSlots = 0; resumeSlots < keyPath; resumeSlots++)
  4557. (n =
  4558. "backwards" !== revealOrder &&
  4559. "unstable_legacy-backwards" !== revealOrder
  4560. ? resumeSlots
  4561. : keyPath - 1 - resumeSlots),
  4562. (i = rows[n]),
  4563. (task.row = previousSuspenseListRow =
  4564. createSuspenseListRow(previousSuspenseListRow)),
  4565. (task.treeContext = pushTreeContext(prevTreeContext, keyPath, n)),
  4566. renderNode(request, task, i, n),
  4567. 0 === --previousSuspenseListRow.pendingTasks &&
  4568. finishSuspenseListRow(request, previousSuspenseListRow);
  4569. } else if (
  4570. "backwards" !== revealOrder &&
  4571. "unstable_legacy-backwards" !== revealOrder
  4572. )
  4573. for (revealOrder = 0; revealOrder < keyPath; revealOrder++)
  4574. (resumeSlots = rows[revealOrder]),
  4575. (task.row = previousSuspenseListRow =
  4576. createSuspenseListRow(previousSuspenseListRow)),
  4577. (task.treeContext = pushTreeContext(
  4578. prevTreeContext,
  4579. keyPath,
  4580. revealOrder
  4581. )),
  4582. renderNode(request, task, resumeSlots, revealOrder),
  4583. 0 === --previousSuspenseListRow.pendingTasks &&
  4584. finishSuspenseListRow(request, previousSuspenseListRow);
  4585. else {
  4586. revealOrder = task.blockedSegment;
  4587. resumeSlots = revealOrder.children.length;
  4588. n = revealOrder.chunks.length;
  4589. for (i = keyPath - 1; 0 <= i; i--) {
  4590. node = rows[i];
  4591. task.row = previousSuspenseListRow = createSuspenseListRow(
  4592. previousSuspenseListRow
  4593. );
  4594. task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);
  4595. resumeSegmentID = createPendingSegment(
  4596. request,
  4597. n,
  4598. null,
  4599. task.formatContext,
  4600. 0 === i ? revealOrder.lastPushedText : !0,
  4601. !0
  4602. );
  4603. revealOrder.children.splice(resumeSlots, 0, resumeSegmentID);
  4604. task.blockedSegment = resumeSegmentID;
  4605. try {
  4606. renderNode(request, task, node, i),
  4607. resumeSegmentID.lastPushedText &&
  4608. resumeSegmentID.textEmbedded &&
  4609. resumeSegmentID.chunks.push(textSeparator),
  4610. (resumeSegmentID.status = 1),
  4611. finishedSegment(request, task.blockedBoundary, resumeSegmentID),
  4612. 0 === --previousSuspenseListRow.pendingTasks &&
  4613. finishSuspenseListRow(request, previousSuspenseListRow);
  4614. } catch (thrownValue) {
  4615. throw (
  4616. ((resumeSegmentID.status = 12 === request.status ? 3 : 4),
  4617. thrownValue)
  4618. );
  4619. }
  4620. }
  4621. task.blockedSegment = revealOrder;
  4622. revealOrder.lastPushedText = !1;
  4623. }
  4624. null !== prevRow &&
  4625. null !== previousSuspenseListRow &&
  4626. 0 < previousSuspenseListRow.pendingTasks &&
  4627. (prevRow.pendingTasks++, (previousSuspenseListRow.next = prevRow));
  4628. task.treeContext = prevTreeContext;
  4629. task.row = prevRow;
  4630. task.keyPath = prevKeyPath;
  4631. }
  4632. function renderWithHooks(request, task, keyPath, Component, props, secondArg) {
  4633. var prevThenableState = task.thenableState;
  4634. task.thenableState = null;
  4635. currentlyRenderingComponent = {};
  4636. currentlyRenderingTask = task;
  4637. currentlyRenderingRequest = request;
  4638. currentlyRenderingKeyPath = keyPath;
  4639. actionStateCounter = localIdCounter = 0;
  4640. actionStateMatchingIndex = -1;
  4641. thenableIndexCounter = 0;
  4642. thenableState = prevThenableState;
  4643. for (request = Component(props, secondArg); didScheduleRenderPhaseUpdate; )
  4644. (didScheduleRenderPhaseUpdate = !1),
  4645. (actionStateCounter = localIdCounter = 0),
  4646. (actionStateMatchingIndex = -1),
  4647. (thenableIndexCounter = 0),
  4648. (numberOfReRenders += 1),
  4649. (workInProgressHook = null),
  4650. (request = Component(props, secondArg));
  4651. resetHooksState();
  4652. return request;
  4653. }
  4654. function finishFunctionComponent(
  4655. request,
  4656. task,
  4657. keyPath,
  4658. children,
  4659. hasId,
  4660. actionStateCount,
  4661. actionStateMatchingIndex
  4662. ) {
  4663. var didEmitActionStateMarkers = !1;
  4664. if (0 !== actionStateCount && null !== request.formState) {
  4665. var segment = task.blockedSegment;
  4666. if (null !== segment) {
  4667. didEmitActionStateMarkers = !0;
  4668. segment = segment.chunks;
  4669. for (var i = 0; i < actionStateCount; i++)
  4670. i === actionStateMatchingIndex
  4671. ? segment.push(formStateMarkerIsMatching)
  4672. : segment.push(formStateMarkerIsNotMatching);
  4673. }
  4674. }
  4675. actionStateCount = task.keyPath;
  4676. task.keyPath = keyPath;
  4677. hasId
  4678. ? ((keyPath = task.treeContext),
  4679. (task.treeContext = pushTreeContext(keyPath, 1, 0)),
  4680. renderNode(request, task, children, -1),
  4681. (task.treeContext = keyPath))
  4682. : didEmitActionStateMarkers
  4683. ? renderNode(request, task, children, -1)
  4684. : renderNodeDestructive(request, task, children, -1);
  4685. task.keyPath = actionStateCount;
  4686. }
  4687. function renderElement(request, task, keyPath, type, props, ref) {
  4688. if ("function" === typeof type)
  4689. if (type.prototype && type.prototype.isReactComponent) {
  4690. var newProps = props;
  4691. if ("ref" in props) {
  4692. newProps = {};
  4693. for (var propName in props)
  4694. "ref" !== propName && (newProps[propName] = props[propName]);
  4695. }
  4696. var defaultProps = type.defaultProps;
  4697. if (defaultProps) {
  4698. newProps === props && (newProps = assign({}, newProps, props));
  4699. for (var propName$44 in defaultProps)
  4700. void 0 === newProps[propName$44] &&
  4701. (newProps[propName$44] = defaultProps[propName$44]);
  4702. }
  4703. props = newProps;
  4704. newProps = emptyContextObject;
  4705. defaultProps = type.contextType;
  4706. "object" === typeof defaultProps &&
  4707. null !== defaultProps &&
  4708. (newProps = defaultProps._currentValue);
  4709. newProps = new type(props, newProps);
  4710. var initialState = void 0 !== newProps.state ? newProps.state : null;
  4711. newProps.updater = classComponentUpdater;
  4712. newProps.props = props;
  4713. newProps.state = initialState;
  4714. defaultProps = { queue: [], replace: !1 };
  4715. newProps._reactInternals = defaultProps;
  4716. ref = type.contextType;
  4717. newProps.context =
  4718. "object" === typeof ref && null !== ref
  4719. ? ref._currentValue
  4720. : emptyContextObject;
  4721. ref = type.getDerivedStateFromProps;
  4722. "function" === typeof ref &&
  4723. ((ref = ref(props, initialState)),
  4724. (initialState =
  4725. null === ref || void 0 === ref
  4726. ? initialState
  4727. : assign({}, initialState, ref)),
  4728. (newProps.state = initialState));
  4729. if (
  4730. "function" !== typeof type.getDerivedStateFromProps &&
  4731. "function" !== typeof newProps.getSnapshotBeforeUpdate &&
  4732. ("function" === typeof newProps.UNSAFE_componentWillMount ||
  4733. "function" === typeof newProps.componentWillMount)
  4734. )
  4735. if (
  4736. ((type = newProps.state),
  4737. "function" === typeof newProps.componentWillMount &&
  4738. newProps.componentWillMount(),
  4739. "function" === typeof newProps.UNSAFE_componentWillMount &&
  4740. newProps.UNSAFE_componentWillMount(),
  4741. type !== newProps.state &&
  4742. classComponentUpdater.enqueueReplaceState(
  4743. newProps,
  4744. newProps.state,
  4745. null
  4746. ),
  4747. null !== defaultProps.queue && 0 < defaultProps.queue.length)
  4748. )
  4749. if (
  4750. ((type = defaultProps.queue),
  4751. (ref = defaultProps.replace),
  4752. (defaultProps.queue = null),
  4753. (defaultProps.replace = !1),
  4754. ref && 1 === type.length)
  4755. )
  4756. newProps.state = type[0];
  4757. else {
  4758. defaultProps = ref ? type[0] : newProps.state;
  4759. initialState = !0;
  4760. for (ref = ref ? 1 : 0; ref < type.length; ref++)
  4761. (propName$44 = type[ref]),
  4762. (propName$44 =
  4763. "function" === typeof propName$44
  4764. ? propName$44.call(newProps, defaultProps, props, void 0)
  4765. : propName$44),
  4766. null != propName$44 &&
  4767. (initialState
  4768. ? ((initialState = !1),
  4769. (defaultProps = assign({}, defaultProps, propName$44)))
  4770. : assign(defaultProps, propName$44));
  4771. newProps.state = defaultProps;
  4772. }
  4773. else defaultProps.queue = null;
  4774. type = newProps.render();
  4775. if (12 === request.status) throw null;
  4776. props = task.keyPath;
  4777. task.keyPath = keyPath;
  4778. renderNodeDestructive(request, task, type, -1);
  4779. task.keyPath = props;
  4780. } else {
  4781. type = renderWithHooks(request, task, keyPath, type, props, void 0);
  4782. if (12 === request.status) throw null;
  4783. finishFunctionComponent(
  4784. request,
  4785. task,
  4786. keyPath,
  4787. type,
  4788. 0 !== localIdCounter,
  4789. actionStateCounter,
  4790. actionStateMatchingIndex
  4791. );
  4792. }
  4793. else if ("string" === typeof type)
  4794. if (((newProps = task.blockedSegment), null === newProps))
  4795. (newProps = props.children),
  4796. (defaultProps = task.formatContext),
  4797. (initialState = task.keyPath),
  4798. (task.formatContext = getChildFormatContext(defaultProps, type, props)),
  4799. (task.keyPath = keyPath),
  4800. renderNode(request, task, newProps, -1),
  4801. (task.formatContext = defaultProps),
  4802. (task.keyPath = initialState);
  4803. else {
  4804. initialState = pushStartInstance(
  4805. newProps.chunks,
  4806. type,
  4807. props,
  4808. request.resumableState,
  4809. request.renderState,
  4810. task.blockedPreamble,
  4811. task.hoistableState,
  4812. task.formatContext,
  4813. newProps.lastPushedText
  4814. );
  4815. newProps.lastPushedText = !1;
  4816. defaultProps = task.formatContext;
  4817. ref = task.keyPath;
  4818. task.keyPath = keyPath;
  4819. if (
  4820. 3 ===
  4821. (task.formatContext = getChildFormatContext(defaultProps, type, props))
  4822. .insertionMode
  4823. ) {
  4824. keyPath = createPendingSegment(
  4825. request,
  4826. 0,
  4827. null,
  4828. task.formatContext,
  4829. !1,
  4830. !1
  4831. );
  4832. newProps.preambleChildren.push(keyPath);
  4833. task.blockedSegment = keyPath;
  4834. try {
  4835. (keyPath.status = 6),
  4836. renderNode(request, task, initialState, -1),
  4837. keyPath.lastPushedText &&
  4838. keyPath.textEmbedded &&
  4839. keyPath.chunks.push(textSeparator),
  4840. (keyPath.status = 1),
  4841. finishedSegment(request, task.blockedBoundary, keyPath);
  4842. } finally {
  4843. task.blockedSegment = newProps;
  4844. }
  4845. } else renderNode(request, task, initialState, -1);
  4846. task.formatContext = defaultProps;
  4847. task.keyPath = ref;
  4848. a: {
  4849. task = newProps.chunks;
  4850. request = request.resumableState;
  4851. switch (type) {
  4852. case "title":
  4853. case "style":
  4854. case "script":
  4855. case "area":
  4856. case "base":
  4857. case "br":
  4858. case "col":
  4859. case "embed":
  4860. case "hr":
  4861. case "img":
  4862. case "input":
  4863. case "keygen":
  4864. case "link":
  4865. case "meta":
  4866. case "param":
  4867. case "source":
  4868. case "track":
  4869. case "wbr":
  4870. break a;
  4871. case "body":
  4872. if (1 >= defaultProps.insertionMode) {
  4873. request.hasBody = !0;
  4874. break a;
  4875. }
  4876. break;
  4877. case "html":
  4878. if (0 === defaultProps.insertionMode) {
  4879. request.hasHtml = !0;
  4880. break a;
  4881. }
  4882. break;
  4883. case "head":
  4884. if (1 >= defaultProps.insertionMode) break a;
  4885. }
  4886. task.push(endChunkForTag(type));
  4887. }
  4888. newProps.lastPushedText = !1;
  4889. }
  4890. else {
  4891. switch (type) {
  4892. case REACT_LEGACY_HIDDEN_TYPE:
  4893. case REACT_STRICT_MODE_TYPE:
  4894. case REACT_PROFILER_TYPE:
  4895. case REACT_FRAGMENT_TYPE:
  4896. type = task.keyPath;
  4897. task.keyPath = keyPath;
  4898. renderNodeDestructive(request, task, props.children, -1);
  4899. task.keyPath = type;
  4900. return;
  4901. case REACT_ACTIVITY_TYPE:
  4902. type = task.blockedSegment;
  4903. null === type
  4904. ? "hidden" !== props.mode &&
  4905. ((type = task.keyPath),
  4906. (task.keyPath = keyPath),
  4907. renderNode(request, task, props.children, -1),
  4908. (task.keyPath = type))
  4909. : "hidden" !== props.mode &&
  4910. (type.chunks.push(startActivityBoundary),
  4911. (type.lastPushedText = !1),
  4912. (newProps = task.keyPath),
  4913. (task.keyPath = keyPath),
  4914. renderNode(request, task, props.children, -1),
  4915. (task.keyPath = newProps),
  4916. type.chunks.push(endActivityBoundary),
  4917. (type.lastPushedText = !1));
  4918. return;
  4919. case REACT_SUSPENSE_LIST_TYPE:
  4920. a: {
  4921. type = props.children;
  4922. props = props.revealOrder;
  4923. if (
  4924. "forwards" === props ||
  4925. "backwards" === props ||
  4926. "unstable_legacy-backwards" === props
  4927. ) {
  4928. if (isArrayImpl(type)) {
  4929. renderSuspenseListRows(request, task, keyPath, type, props);
  4930. break a;
  4931. }
  4932. if ((newProps = getIteratorFn(type)))
  4933. if ((newProps = newProps.call(type))) {
  4934. defaultProps = newProps.next();
  4935. if (!defaultProps.done) {
  4936. do defaultProps = newProps.next();
  4937. while (!defaultProps.done);
  4938. renderSuspenseListRows(request, task, keyPath, type, props);
  4939. }
  4940. break a;
  4941. }
  4942. }
  4943. "together" === props
  4944. ? ((props = task.keyPath),
  4945. (newProps = task.row),
  4946. (defaultProps = task.row = createSuspenseListRow(null)),
  4947. (defaultProps.boundaries = []),
  4948. (defaultProps.together = !0),
  4949. (task.keyPath = keyPath),
  4950. renderNodeDestructive(request, task, type, -1),
  4951. 0 === --defaultProps.pendingTasks &&
  4952. finishSuspenseListRow(request, defaultProps),
  4953. (task.keyPath = props),
  4954. (task.row = newProps),
  4955. null !== newProps &&
  4956. 0 < defaultProps.pendingTasks &&
  4957. (newProps.pendingTasks++, (defaultProps.next = newProps)))
  4958. : ((props = task.keyPath),
  4959. (task.keyPath = keyPath),
  4960. renderNodeDestructive(request, task, type, -1),
  4961. (task.keyPath = props));
  4962. }
  4963. return;
  4964. case REACT_VIEW_TRANSITION_TYPE:
  4965. case REACT_SCOPE_TYPE:
  4966. throw Error("ReactDOMServer does not yet support scope components.");
  4967. case REACT_SUSPENSE_TYPE:
  4968. a: if (null !== task.replay) {
  4969. type = task.keyPath;
  4970. newProps = task.formatContext;
  4971. defaultProps = task.row;
  4972. task.keyPath = keyPath;
  4973. task.formatContext = getSuspenseContentFormatContext(
  4974. request.resumableState,
  4975. newProps
  4976. );
  4977. task.row = null;
  4978. keyPath = props.children;
  4979. try {
  4980. renderNode(request, task, keyPath, -1);
  4981. } finally {
  4982. (task.keyPath = type),
  4983. (task.formatContext = newProps),
  4984. (task.row = defaultProps);
  4985. }
  4986. } else {
  4987. type = task.keyPath;
  4988. ref = task.formatContext;
  4989. var prevRow = task.row;
  4990. propName$44 = task.blockedBoundary;
  4991. propName = task.blockedPreamble;
  4992. var parentHoistableState = task.hoistableState,
  4993. parentSegment = task.blockedSegment,
  4994. fallback = props.fallback;
  4995. props = props.children;
  4996. var fallbackAbortSet = new Set();
  4997. var newBoundary =
  4998. 2 > task.formatContext.insertionMode
  4999. ? createSuspenseBoundary(
  5000. request,
  5001. task.row,
  5002. fallbackAbortSet,
  5003. createPreambleState(),
  5004. createPreambleState()
  5005. )
  5006. : createSuspenseBoundary(
  5007. request,
  5008. task.row,
  5009. fallbackAbortSet,
  5010. null,
  5011. null
  5012. );
  5013. null !== request.trackedPostpones &&
  5014. (newBoundary.trackedContentKeyPath = keyPath);
  5015. var boundarySegment = createPendingSegment(
  5016. request,
  5017. parentSegment.chunks.length,
  5018. newBoundary,
  5019. task.formatContext,
  5020. !1,
  5021. !1
  5022. );
  5023. parentSegment.children.push(boundarySegment);
  5024. parentSegment.lastPushedText = !1;
  5025. var contentRootSegment = createPendingSegment(
  5026. request,
  5027. 0,
  5028. null,
  5029. task.formatContext,
  5030. !1,
  5031. !1
  5032. );
  5033. contentRootSegment.parentFlushed = !0;
  5034. if (null !== request.trackedPostpones) {
  5035. newProps = task.componentStack;
  5036. defaultProps = [keyPath[0], "Suspense Fallback", keyPath[2]];
  5037. initialState = [defaultProps[1], defaultProps[2], [], null];
  5038. request.trackedPostpones.workingMap.set(defaultProps, initialState);
  5039. newBoundary.trackedFallbackNode = initialState;
  5040. task.blockedSegment = boundarySegment;
  5041. task.blockedPreamble = newBoundary.fallbackPreamble;
  5042. task.keyPath = defaultProps;
  5043. task.formatContext = getSuspenseFallbackFormatContext(
  5044. request.resumableState,
  5045. ref
  5046. );
  5047. task.componentStack =
  5048. replaceSuspenseComponentStackWithSuspenseFallbackStack(newProps);
  5049. boundarySegment.status = 6;
  5050. try {
  5051. renderNode(request, task, fallback, -1),
  5052. boundarySegment.lastPushedText &&
  5053. boundarySegment.textEmbedded &&
  5054. boundarySegment.chunks.push(textSeparator),
  5055. (boundarySegment.status = 1),
  5056. finishedSegment(request, propName$44, boundarySegment);
  5057. } catch (thrownValue) {
  5058. throw (
  5059. ((boundarySegment.status = 12 === request.status ? 3 : 4),
  5060. thrownValue)
  5061. );
  5062. } finally {
  5063. (task.blockedSegment = parentSegment),
  5064. (task.blockedPreamble = propName),
  5065. (task.keyPath = type),
  5066. (task.formatContext = ref);
  5067. }
  5068. task = createRenderTask(
  5069. request,
  5070. null,
  5071. props,
  5072. -1,
  5073. newBoundary,
  5074. contentRootSegment,
  5075. newBoundary.contentPreamble,
  5076. newBoundary.contentState,
  5077. task.abortSet,
  5078. keyPath,
  5079. getSuspenseContentFormatContext(
  5080. request.resumableState,
  5081. task.formatContext
  5082. ),
  5083. task.context,
  5084. task.treeContext,
  5085. null,
  5086. newProps
  5087. );
  5088. pushComponentStack(task);
  5089. request.pingedTasks.push(task);
  5090. } else {
  5091. task.blockedBoundary = newBoundary;
  5092. task.blockedPreamble = newBoundary.contentPreamble;
  5093. task.hoistableState = newBoundary.contentState;
  5094. task.blockedSegment = contentRootSegment;
  5095. task.keyPath = keyPath;
  5096. task.formatContext = getSuspenseContentFormatContext(
  5097. request.resumableState,
  5098. ref
  5099. );
  5100. task.row = null;
  5101. contentRootSegment.status = 6;
  5102. try {
  5103. if (
  5104. (renderNode(request, task, props, -1),
  5105. contentRootSegment.lastPushedText &&
  5106. contentRootSegment.textEmbedded &&
  5107. contentRootSegment.chunks.push(textSeparator),
  5108. (contentRootSegment.status = 1),
  5109. finishedSegment(request, newBoundary, contentRootSegment),
  5110. queueCompletedSegment(newBoundary, contentRootSegment),
  5111. 0 === newBoundary.pendingTasks && 0 === newBoundary.status)
  5112. ) {
  5113. if (
  5114. ((newBoundary.status = 1),
  5115. !isEligibleForOutlining(request, newBoundary))
  5116. ) {
  5117. null !== prevRow &&
  5118. 0 === --prevRow.pendingTasks &&
  5119. finishSuspenseListRow(request, prevRow);
  5120. 0 === request.pendingRootTasks &&
  5121. task.blockedPreamble &&
  5122. preparePreamble(request);
  5123. break a;
  5124. }
  5125. } else
  5126. null !== prevRow &&
  5127. prevRow.together &&
  5128. tryToResolveTogetherRow(request, prevRow);
  5129. } catch (thrownValue$31) {
  5130. (newBoundary.status = 4),
  5131. 12 === request.status
  5132. ? ((contentRootSegment.status = 3),
  5133. (newProps = request.fatalError))
  5134. : ((contentRootSegment.status = 4),
  5135. (newProps = thrownValue$31)),
  5136. (defaultProps = getThrownInfo(task.componentStack)),
  5137. (initialState = logRecoverableError(
  5138. request,
  5139. newProps,
  5140. defaultProps
  5141. )),
  5142. (newBoundary.errorDigest = initialState),
  5143. untrackBoundary(request, newBoundary);
  5144. } finally {
  5145. (task.blockedBoundary = propName$44),
  5146. (task.blockedPreamble = propName),
  5147. (task.hoistableState = parentHoistableState),
  5148. (task.blockedSegment = parentSegment),
  5149. (task.keyPath = type),
  5150. (task.formatContext = ref),
  5151. (task.row = prevRow);
  5152. }
  5153. task = createRenderTask(
  5154. request,
  5155. null,
  5156. fallback,
  5157. -1,
  5158. propName$44,
  5159. boundarySegment,
  5160. newBoundary.fallbackPreamble,
  5161. newBoundary.fallbackState,
  5162. fallbackAbortSet,
  5163. [keyPath[0], "Suspense Fallback", keyPath[2]],
  5164. getSuspenseFallbackFormatContext(
  5165. request.resumableState,
  5166. task.formatContext
  5167. ),
  5168. task.context,
  5169. task.treeContext,
  5170. task.row,
  5171. replaceSuspenseComponentStackWithSuspenseFallbackStack(
  5172. task.componentStack
  5173. )
  5174. );
  5175. pushComponentStack(task);
  5176. request.pingedTasks.push(task);
  5177. }
  5178. }
  5179. return;
  5180. }
  5181. if ("object" === typeof type && null !== type)
  5182. switch (type.$$typeof) {
  5183. case REACT_FORWARD_REF_TYPE:
  5184. if ("ref" in props)
  5185. for (parentSegment in ((newProps = {}), props))
  5186. "ref" !== parentSegment &&
  5187. (newProps[parentSegment] = props[parentSegment]);
  5188. else newProps = props;
  5189. type = renderWithHooks(
  5190. request,
  5191. task,
  5192. keyPath,
  5193. type.render,
  5194. newProps,
  5195. ref
  5196. );
  5197. finishFunctionComponent(
  5198. request,
  5199. task,
  5200. keyPath,
  5201. type,
  5202. 0 !== localIdCounter,
  5203. actionStateCounter,
  5204. actionStateMatchingIndex
  5205. );
  5206. return;
  5207. case REACT_MEMO_TYPE:
  5208. renderElement(request, task, keyPath, type.type, props, ref);
  5209. return;
  5210. case REACT_CONTEXT_TYPE:
  5211. defaultProps = props.children;
  5212. newProps = task.keyPath;
  5213. props = props.value;
  5214. initialState = type._currentValue;
  5215. type._currentValue = props;
  5216. ref = currentActiveSnapshot;
  5217. currentActiveSnapshot = type = {
  5218. parent: ref,
  5219. depth: null === ref ? 0 : ref.depth + 1,
  5220. context: type,
  5221. parentValue: initialState,
  5222. value: props
  5223. };
  5224. task.context = type;
  5225. task.keyPath = keyPath;
  5226. renderNodeDestructive(request, task, defaultProps, -1);
  5227. request = currentActiveSnapshot;
  5228. if (null === request)
  5229. throw Error(
  5230. "Tried to pop a Context at the root of the app. This is a bug in React."
  5231. );
  5232. request.context._currentValue = request.parentValue;
  5233. request = currentActiveSnapshot = request.parent;
  5234. task.context = request;
  5235. task.keyPath = newProps;
  5236. return;
  5237. case REACT_CONSUMER_TYPE:
  5238. props = props.children;
  5239. type = props(type._context._currentValue);
  5240. props = task.keyPath;
  5241. task.keyPath = keyPath;
  5242. renderNodeDestructive(request, task, type, -1);
  5243. task.keyPath = props;
  5244. return;
  5245. case REACT_LAZY_TYPE:
  5246. newProps = type._init;
  5247. type = newProps(type._payload);
  5248. if (12 === request.status) throw null;
  5249. renderElement(request, task, keyPath, type, props, ref);
  5250. return;
  5251. }
  5252. throw Error(
  5253. "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
  5254. ((null == type ? type : typeof type) + ".")
  5255. );
  5256. }
  5257. }
  5258. function resumeNode(request, task, segmentId, node, childIndex) {
  5259. var prevReplay = task.replay,
  5260. blockedBoundary = task.blockedBoundary,
  5261. resumedSegment = createPendingSegment(
  5262. request,
  5263. 0,
  5264. null,
  5265. task.formatContext,
  5266. !1,
  5267. !1
  5268. );
  5269. resumedSegment.id = segmentId;
  5270. resumedSegment.parentFlushed = !0;
  5271. try {
  5272. (task.replay = null),
  5273. (task.blockedSegment = resumedSegment),
  5274. renderNode(request, task, node, childIndex),
  5275. (resumedSegment.status = 1),
  5276. finishedSegment(request, blockedBoundary, resumedSegment),
  5277. null === blockedBoundary
  5278. ? (request.completedRootSegment = resumedSegment)
  5279. : (queueCompletedSegment(blockedBoundary, resumedSegment),
  5280. blockedBoundary.parentFlushed &&
  5281. request.partialBoundaries.push(blockedBoundary));
  5282. } finally {
  5283. (task.replay = prevReplay), (task.blockedSegment = null);
  5284. }
  5285. }
  5286. function renderNodeDestructive(request, task, node, childIndex) {
  5287. null !== task.replay && "number" === typeof task.replay.slots
  5288. ? resumeNode(request, task, task.replay.slots, node, childIndex)
  5289. : ((task.node = node),
  5290. (task.childIndex = childIndex),
  5291. (node = task.componentStack),
  5292. pushComponentStack(task),
  5293. retryNode(request, task),
  5294. (task.componentStack = node));
  5295. }
  5296. function retryNode(request, task) {
  5297. var node = task.node,
  5298. childIndex = task.childIndex;
  5299. if (null !== node) {
  5300. if ("object" === typeof node) {
  5301. switch (node.$$typeof) {
  5302. case REACT_ELEMENT_TYPE:
  5303. var type = node.type,
  5304. key = node.key,
  5305. props = node.props;
  5306. node = props.ref;
  5307. var ref = void 0 !== node ? node : null,
  5308. name = getComponentNameFromType(type),
  5309. keyOrIndex =
  5310. null == key ? (-1 === childIndex ? 0 : childIndex) : key;
  5311. key = [task.keyPath, name, keyOrIndex];
  5312. if (null !== task.replay)
  5313. a: {
  5314. var replay = task.replay;
  5315. childIndex = replay.nodes;
  5316. for (node = 0; node < childIndex.length; node++) {
  5317. var node$jscomp$0 = childIndex[node];
  5318. if (keyOrIndex === node$jscomp$0[1]) {
  5319. if (4 === node$jscomp$0.length) {
  5320. if (null !== name && name !== node$jscomp$0[0])
  5321. throw Error(
  5322. "Expected the resume to render <" +
  5323. node$jscomp$0[0] +
  5324. "> in this slot but instead it rendered <" +
  5325. name +
  5326. ">. The tree doesn't match so React will fallback to client rendering."
  5327. );
  5328. var childNodes = node$jscomp$0[2];
  5329. name = node$jscomp$0[3];
  5330. keyOrIndex = task.node;
  5331. task.replay = {
  5332. nodes: childNodes,
  5333. slots: name,
  5334. pendingTasks: 1
  5335. };
  5336. try {
  5337. renderElement(request, task, key, type, props, ref);
  5338. if (
  5339. 1 === task.replay.pendingTasks &&
  5340. 0 < task.replay.nodes.length
  5341. )
  5342. throw Error(
  5343. "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
  5344. );
  5345. task.replay.pendingTasks--;
  5346. } catch (x) {
  5347. if (
  5348. "object" === typeof x &&
  5349. null !== x &&
  5350. (x === SuspenseException ||
  5351. "function" === typeof x.then)
  5352. )
  5353. throw (
  5354. (task.node === keyOrIndex
  5355. ? (task.replay = replay)
  5356. : childIndex.splice(node, 1),
  5357. x)
  5358. );
  5359. task.replay.pendingTasks--;
  5360. props = getThrownInfo(task.componentStack);
  5361. key = request;
  5362. request = task.blockedBoundary;
  5363. type = x;
  5364. props = logRecoverableError(key, type, props);
  5365. abortRemainingReplayNodes(
  5366. key,
  5367. request,
  5368. childNodes,
  5369. name,
  5370. type,
  5371. props
  5372. );
  5373. }
  5374. task.replay = replay;
  5375. } else {
  5376. if (type !== REACT_SUSPENSE_TYPE)
  5377. throw Error(
  5378. "Expected the resume to render <Suspense> in this slot but instead it rendered <" +
  5379. (getComponentNameFromType(type) || "Unknown") +
  5380. ">. The tree doesn't match so React will fallback to client rendering."
  5381. );
  5382. b: {
  5383. replay = void 0;
  5384. type = node$jscomp$0[5];
  5385. ref = node$jscomp$0[2];
  5386. name = node$jscomp$0[3];
  5387. keyOrIndex =
  5388. null === node$jscomp$0[4] ? [] : node$jscomp$0[4][2];
  5389. node$jscomp$0 =
  5390. null === node$jscomp$0[4] ? null : node$jscomp$0[4][3];
  5391. var prevKeyPath = task.keyPath,
  5392. prevContext = task.formatContext,
  5393. prevRow = task.row,
  5394. previousReplaySet = task.replay,
  5395. parentBoundary = task.blockedBoundary,
  5396. parentHoistableState = task.hoistableState,
  5397. content = props.children,
  5398. fallback = props.fallback,
  5399. fallbackAbortSet = new Set();
  5400. props =
  5401. 2 > task.formatContext.insertionMode
  5402. ? createSuspenseBoundary(
  5403. request,
  5404. task.row,
  5405. fallbackAbortSet,
  5406. createPreambleState(),
  5407. createPreambleState()
  5408. )
  5409. : createSuspenseBoundary(
  5410. request,
  5411. task.row,
  5412. fallbackAbortSet,
  5413. null,
  5414. null
  5415. );
  5416. props.parentFlushed = !0;
  5417. props.rootSegmentID = type;
  5418. task.blockedBoundary = props;
  5419. task.hoistableState = props.contentState;
  5420. task.keyPath = key;
  5421. task.formatContext = getSuspenseContentFormatContext(
  5422. request.resumableState,
  5423. prevContext
  5424. );
  5425. task.row = null;
  5426. task.replay = {
  5427. nodes: ref,
  5428. slots: name,
  5429. pendingTasks: 1
  5430. };
  5431. try {
  5432. renderNode(request, task, content, -1);
  5433. if (
  5434. 1 === task.replay.pendingTasks &&
  5435. 0 < task.replay.nodes.length
  5436. )
  5437. throw Error(
  5438. "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
  5439. );
  5440. task.replay.pendingTasks--;
  5441. if (0 === props.pendingTasks && 0 === props.status) {
  5442. props.status = 1;
  5443. request.completedBoundaries.push(props);
  5444. break b;
  5445. }
  5446. } catch (error) {
  5447. (props.status = 4),
  5448. (childNodes = getThrownInfo(task.componentStack)),
  5449. (replay = logRecoverableError(
  5450. request,
  5451. error,
  5452. childNodes
  5453. )),
  5454. (props.errorDigest = replay),
  5455. task.replay.pendingTasks--,
  5456. request.clientRenderedBoundaries.push(props);
  5457. } finally {
  5458. (task.blockedBoundary = parentBoundary),
  5459. (task.hoistableState = parentHoistableState),
  5460. (task.replay = previousReplaySet),
  5461. (task.keyPath = prevKeyPath),
  5462. (task.formatContext = prevContext),
  5463. (task.row = prevRow);
  5464. }
  5465. childNodes = createReplayTask(
  5466. request,
  5467. null,
  5468. {
  5469. nodes: keyOrIndex,
  5470. slots: node$jscomp$0,
  5471. pendingTasks: 0
  5472. },
  5473. fallback,
  5474. -1,
  5475. parentBoundary,
  5476. props.fallbackState,
  5477. fallbackAbortSet,
  5478. [key[0], "Suspense Fallback", key[2]],
  5479. getSuspenseFallbackFormatContext(
  5480. request.resumableState,
  5481. task.formatContext
  5482. ),
  5483. task.context,
  5484. task.treeContext,
  5485. task.row,
  5486. replaceSuspenseComponentStackWithSuspenseFallbackStack(
  5487. task.componentStack
  5488. )
  5489. );
  5490. pushComponentStack(childNodes);
  5491. request.pingedTasks.push(childNodes);
  5492. }
  5493. }
  5494. childIndex.splice(node, 1);
  5495. break a;
  5496. }
  5497. }
  5498. }
  5499. else renderElement(request, task, key, type, props, ref);
  5500. return;
  5501. case REACT_PORTAL_TYPE:
  5502. throw Error(
  5503. "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render."
  5504. );
  5505. case REACT_LAZY_TYPE:
  5506. childNodes = node._init;
  5507. node = childNodes(node._payload);
  5508. if (12 === request.status) throw null;
  5509. renderNodeDestructive(request, task, node, childIndex);
  5510. return;
  5511. }
  5512. if (isArrayImpl(node)) {
  5513. renderChildrenArray(request, task, node, childIndex);
  5514. return;
  5515. }
  5516. if ((childNodes = getIteratorFn(node)))
  5517. if ((childNodes = childNodes.call(node))) {
  5518. node = childNodes.next();
  5519. if (!node.done) {
  5520. props = [];
  5521. do props.push(node.value), (node = childNodes.next());
  5522. while (!node.done);
  5523. renderChildrenArray(request, task, props, childIndex);
  5524. }
  5525. return;
  5526. }
  5527. if ("function" === typeof node.then)
  5528. return (
  5529. (task.thenableState = null),
  5530. renderNodeDestructive(request, task, unwrapThenable(node), childIndex)
  5531. );
  5532. if (node.$$typeof === REACT_CONTEXT_TYPE)
  5533. return renderNodeDestructive(
  5534. request,
  5535. task,
  5536. node._currentValue,
  5537. childIndex
  5538. );
  5539. childIndex = Object.prototype.toString.call(node);
  5540. throw Error(
  5541. "Objects are not valid as a React child (found: " +
  5542. ("[object Object]" === childIndex
  5543. ? "object with keys {" + Object.keys(node).join(", ") + "}"
  5544. : childIndex) +
  5545. "). If you meant to render a collection of children, use an array instead."
  5546. );
  5547. }
  5548. if ("string" === typeof node)
  5549. (childIndex = task.blockedSegment),
  5550. null !== childIndex &&
  5551. (childIndex.lastPushedText = pushTextInstance(
  5552. childIndex.chunks,
  5553. node,
  5554. request.renderState,
  5555. childIndex.lastPushedText
  5556. ));
  5557. else if ("number" === typeof node || "bigint" === typeof node)
  5558. (childIndex = task.blockedSegment),
  5559. null !== childIndex &&
  5560. (childIndex.lastPushedText = pushTextInstance(
  5561. childIndex.chunks,
  5562. "" + node,
  5563. request.renderState,
  5564. childIndex.lastPushedText
  5565. ));
  5566. }
  5567. }
  5568. function renderChildrenArray(request, task, children, childIndex) {
  5569. var prevKeyPath = task.keyPath;
  5570. if (
  5571. -1 !== childIndex &&
  5572. ((task.keyPath = [task.keyPath, "Fragment", childIndex]),
  5573. null !== task.replay)
  5574. ) {
  5575. for (
  5576. var replay = task.replay, replayNodes = replay.nodes, j = 0;
  5577. j < replayNodes.length;
  5578. j++
  5579. ) {
  5580. var node = replayNodes[j];
  5581. if (node[1] === childIndex) {
  5582. childIndex = node[2];
  5583. node = node[3];
  5584. task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 };
  5585. try {
  5586. renderChildrenArray(request, task, children, -1);
  5587. if (1 === task.replay.pendingTasks && 0 < task.replay.nodes.length)
  5588. throw Error(
  5589. "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
  5590. );
  5591. task.replay.pendingTasks--;
  5592. } catch (x) {
  5593. if (
  5594. "object" === typeof x &&
  5595. null !== x &&
  5596. (x === SuspenseException || "function" === typeof x.then)
  5597. )
  5598. throw x;
  5599. task.replay.pendingTasks--;
  5600. children = getThrownInfo(task.componentStack);
  5601. var boundary = task.blockedBoundary,
  5602. error = x;
  5603. children = logRecoverableError(request, error, children);
  5604. abortRemainingReplayNodes(
  5605. request,
  5606. boundary,
  5607. childIndex,
  5608. node,
  5609. error,
  5610. children
  5611. );
  5612. }
  5613. task.replay = replay;
  5614. replayNodes.splice(j, 1);
  5615. break;
  5616. }
  5617. }
  5618. task.keyPath = prevKeyPath;
  5619. return;
  5620. }
  5621. replay = task.treeContext;
  5622. replayNodes = children.length;
  5623. if (
  5624. null !== task.replay &&
  5625. ((j = task.replay.slots), null !== j && "object" === typeof j)
  5626. ) {
  5627. for (childIndex = 0; childIndex < replayNodes; childIndex++)
  5628. (node = children[childIndex]),
  5629. (task.treeContext = pushTreeContext(replay, replayNodes, childIndex)),
  5630. (boundary = j[childIndex]),
  5631. "number" === typeof boundary
  5632. ? (resumeNode(request, task, boundary, node, childIndex),
  5633. delete j[childIndex])
  5634. : renderNode(request, task, node, childIndex);
  5635. task.treeContext = replay;
  5636. task.keyPath = prevKeyPath;
  5637. return;
  5638. }
  5639. for (j = 0; j < replayNodes; j++)
  5640. (childIndex = children[j]),
  5641. (task.treeContext = pushTreeContext(replay, replayNodes, j)),
  5642. renderNode(request, task, childIndex, j);
  5643. task.treeContext = replay;
  5644. task.keyPath = prevKeyPath;
  5645. }
  5646. function trackPostponedBoundary(request, trackedPostpones, boundary) {
  5647. boundary.status = 5;
  5648. boundary.rootSegmentID = request.nextSegmentId++;
  5649. request = boundary.trackedContentKeyPath;
  5650. if (null === request)
  5651. throw Error(
  5652. "It should not be possible to postpone at the root. This is a bug in React."
  5653. );
  5654. var fallbackReplayNode = boundary.trackedFallbackNode,
  5655. children = [],
  5656. boundaryNode = trackedPostpones.workingMap.get(request);
  5657. if (void 0 === boundaryNode)
  5658. return (
  5659. (boundary = [
  5660. request[1],
  5661. request[2],
  5662. children,
  5663. null,
  5664. fallbackReplayNode,
  5665. boundary.rootSegmentID
  5666. ]),
  5667. trackedPostpones.workingMap.set(request, boundary),
  5668. addToReplayParent(boundary, request[0], trackedPostpones),
  5669. boundary
  5670. );
  5671. boundaryNode[4] = fallbackReplayNode;
  5672. boundaryNode[5] = boundary.rootSegmentID;
  5673. return boundaryNode;
  5674. }
  5675. function trackPostpone(request, trackedPostpones, task, segment) {
  5676. segment.status = 5;
  5677. var keyPath = task.keyPath,
  5678. boundary = task.blockedBoundary;
  5679. if (null === boundary)
  5680. (segment.id = request.nextSegmentId++),
  5681. (trackedPostpones.rootSlots = segment.id),
  5682. null !== request.completedRootSegment &&
  5683. (request.completedRootSegment.status = 5);
  5684. else {
  5685. if (null !== boundary && 0 === boundary.status) {
  5686. var boundaryNode = trackPostponedBoundary(
  5687. request,
  5688. trackedPostpones,
  5689. boundary
  5690. );
  5691. if (
  5692. boundary.trackedContentKeyPath === keyPath &&
  5693. -1 === task.childIndex
  5694. ) {
  5695. -1 === segment.id &&
  5696. (segment.id = segment.parentFlushed
  5697. ? boundary.rootSegmentID
  5698. : request.nextSegmentId++);
  5699. boundaryNode[3] = segment.id;
  5700. return;
  5701. }
  5702. }
  5703. -1 === segment.id &&
  5704. (segment.id =
  5705. segment.parentFlushed && null !== boundary
  5706. ? boundary.rootSegmentID
  5707. : request.nextSegmentId++);
  5708. if (-1 === task.childIndex)
  5709. null === keyPath
  5710. ? (trackedPostpones.rootSlots = segment.id)
  5711. : ((task = trackedPostpones.workingMap.get(keyPath)),
  5712. void 0 === task
  5713. ? ((task = [keyPath[1], keyPath[2], [], segment.id]),
  5714. addToReplayParent(task, keyPath[0], trackedPostpones))
  5715. : (task[3] = segment.id));
  5716. else {
  5717. if (null === keyPath)
  5718. if (((request = trackedPostpones.rootSlots), null === request))
  5719. request = trackedPostpones.rootSlots = {};
  5720. else {
  5721. if ("number" === typeof request)
  5722. throw Error(
  5723. "It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React."
  5724. );
  5725. }
  5726. else if (
  5727. ((boundary = trackedPostpones.workingMap),
  5728. (boundaryNode = boundary.get(keyPath)),
  5729. void 0 === boundaryNode)
  5730. )
  5731. (request = {}),
  5732. (boundaryNode = [keyPath[1], keyPath[2], [], request]),
  5733. boundary.set(keyPath, boundaryNode),
  5734. addToReplayParent(boundaryNode, keyPath[0], trackedPostpones);
  5735. else if (((request = boundaryNode[3]), null === request))
  5736. request = boundaryNode[3] = {};
  5737. else if ("number" === typeof request)
  5738. throw Error(
  5739. "It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React."
  5740. );
  5741. request[task.childIndex] = segment.id;
  5742. }
  5743. }
  5744. }
  5745. function untrackBoundary(request, boundary) {
  5746. request = request.trackedPostpones;
  5747. null !== request &&
  5748. ((boundary = boundary.trackedContentKeyPath),
  5749. null !== boundary &&
  5750. ((boundary = request.workingMap.get(boundary)),
  5751. void 0 !== boundary &&
  5752. ((boundary.length = 4), (boundary[2] = []), (boundary[3] = null))));
  5753. }
  5754. function spawnNewSuspendedReplayTask(request, task, thenableState) {
  5755. return createReplayTask(
  5756. request,
  5757. thenableState,
  5758. task.replay,
  5759. task.node,
  5760. task.childIndex,
  5761. task.blockedBoundary,
  5762. task.hoistableState,
  5763. task.abortSet,
  5764. task.keyPath,
  5765. task.formatContext,
  5766. task.context,
  5767. task.treeContext,
  5768. task.row,
  5769. task.componentStack
  5770. );
  5771. }
  5772. function spawnNewSuspendedRenderTask(request, task, thenableState) {
  5773. var segment = task.blockedSegment,
  5774. newSegment = createPendingSegment(
  5775. request,
  5776. segment.chunks.length,
  5777. null,
  5778. task.formatContext,
  5779. segment.lastPushedText,
  5780. !0
  5781. );
  5782. segment.children.push(newSegment);
  5783. segment.lastPushedText = !1;
  5784. return createRenderTask(
  5785. request,
  5786. thenableState,
  5787. task.node,
  5788. task.childIndex,
  5789. task.blockedBoundary,
  5790. newSegment,
  5791. task.blockedPreamble,
  5792. task.hoistableState,
  5793. task.abortSet,
  5794. task.keyPath,
  5795. task.formatContext,
  5796. task.context,
  5797. task.treeContext,
  5798. task.row,
  5799. task.componentStack
  5800. );
  5801. }
  5802. function renderNode(request, task, node, childIndex) {
  5803. var previousFormatContext = task.formatContext,
  5804. previousContext = task.context,
  5805. previousKeyPath = task.keyPath,
  5806. previousTreeContext = task.treeContext,
  5807. previousComponentStack = task.componentStack,
  5808. segment = task.blockedSegment;
  5809. if (null === segment) {
  5810. segment = task.replay;
  5811. try {
  5812. return renderNodeDestructive(request, task, node, childIndex);
  5813. } catch (thrownValue) {
  5814. if (
  5815. (resetHooksState(),
  5816. (node =
  5817. thrownValue === SuspenseException
  5818. ? getSuspendedThenable()
  5819. : thrownValue),
  5820. 12 !== request.status && "object" === typeof node && null !== node)
  5821. ) {
  5822. if ("function" === typeof node.then) {
  5823. childIndex =
  5824. thrownValue === SuspenseException
  5825. ? getThenableStateAfterSuspending()
  5826. : null;
  5827. request = spawnNewSuspendedReplayTask(request, task, childIndex).ping;
  5828. node.then(request, request);
  5829. task.formatContext = previousFormatContext;
  5830. task.context = previousContext;
  5831. task.keyPath = previousKeyPath;
  5832. task.treeContext = previousTreeContext;
  5833. task.componentStack = previousComponentStack;
  5834. task.replay = segment;
  5835. switchContext(previousContext);
  5836. return;
  5837. }
  5838. if ("Maximum call stack size exceeded" === node.message) {
  5839. node =
  5840. thrownValue === SuspenseException
  5841. ? getThenableStateAfterSuspending()
  5842. : null;
  5843. node = spawnNewSuspendedReplayTask(request, task, node);
  5844. request.pingedTasks.push(node);
  5845. task.formatContext = previousFormatContext;
  5846. task.context = previousContext;
  5847. task.keyPath = previousKeyPath;
  5848. task.treeContext = previousTreeContext;
  5849. task.componentStack = previousComponentStack;
  5850. task.replay = segment;
  5851. switchContext(previousContext);
  5852. return;
  5853. }
  5854. }
  5855. }
  5856. } else {
  5857. var childrenLength = segment.children.length,
  5858. chunkLength = segment.chunks.length;
  5859. try {
  5860. return renderNodeDestructive(request, task, node, childIndex);
  5861. } catch (thrownValue$63) {
  5862. if (
  5863. (resetHooksState(),
  5864. (segment.children.length = childrenLength),
  5865. (segment.chunks.length = chunkLength),
  5866. (node =
  5867. thrownValue$63 === SuspenseException
  5868. ? getSuspendedThenable()
  5869. : thrownValue$63),
  5870. 12 !== request.status && "object" === typeof node && null !== node)
  5871. ) {
  5872. if ("function" === typeof node.then) {
  5873. segment = node;
  5874. node =
  5875. thrownValue$63 === SuspenseException
  5876. ? getThenableStateAfterSuspending()
  5877. : null;
  5878. request = spawnNewSuspendedRenderTask(request, task, node).ping;
  5879. segment.then(request, request);
  5880. task.formatContext = previousFormatContext;
  5881. task.context = previousContext;
  5882. task.keyPath = previousKeyPath;
  5883. task.treeContext = previousTreeContext;
  5884. task.componentStack = previousComponentStack;
  5885. switchContext(previousContext);
  5886. return;
  5887. }
  5888. if ("Maximum call stack size exceeded" === node.message) {
  5889. segment =
  5890. thrownValue$63 === SuspenseException
  5891. ? getThenableStateAfterSuspending()
  5892. : null;
  5893. segment = spawnNewSuspendedRenderTask(request, task, segment);
  5894. request.pingedTasks.push(segment);
  5895. task.formatContext = previousFormatContext;
  5896. task.context = previousContext;
  5897. task.keyPath = previousKeyPath;
  5898. task.treeContext = previousTreeContext;
  5899. task.componentStack = previousComponentStack;
  5900. switchContext(previousContext);
  5901. return;
  5902. }
  5903. }
  5904. }
  5905. }
  5906. task.formatContext = previousFormatContext;
  5907. task.context = previousContext;
  5908. task.keyPath = previousKeyPath;
  5909. task.treeContext = previousTreeContext;
  5910. switchContext(previousContext);
  5911. throw node;
  5912. }
  5913. function abortTaskSoft(task) {
  5914. var boundary = task.blockedBoundary,
  5915. segment = task.blockedSegment;
  5916. null !== segment &&
  5917. ((segment.status = 3), finishedTask(this, boundary, task.row, segment));
  5918. }
  5919. function abortRemainingReplayNodes(
  5920. request$jscomp$0,
  5921. boundary,
  5922. nodes,
  5923. slots,
  5924. error,
  5925. errorDigest$jscomp$0
  5926. ) {
  5927. for (var i = 0; i < nodes.length; i++) {
  5928. var node = nodes[i];
  5929. if (4 === node.length)
  5930. abortRemainingReplayNodes(
  5931. request$jscomp$0,
  5932. boundary,
  5933. node[2],
  5934. node[3],
  5935. error,
  5936. errorDigest$jscomp$0
  5937. );
  5938. else {
  5939. node = node[5];
  5940. var request = request$jscomp$0,
  5941. errorDigest = errorDigest$jscomp$0,
  5942. resumedBoundary = createSuspenseBoundary(
  5943. request,
  5944. null,
  5945. new Set(),
  5946. null,
  5947. null
  5948. );
  5949. resumedBoundary.parentFlushed = !0;
  5950. resumedBoundary.rootSegmentID = node;
  5951. resumedBoundary.status = 4;
  5952. resumedBoundary.errorDigest = errorDigest;
  5953. resumedBoundary.parentFlushed &&
  5954. request.clientRenderedBoundaries.push(resumedBoundary);
  5955. }
  5956. }
  5957. nodes.length = 0;
  5958. if (null !== slots) {
  5959. if (null === boundary)
  5960. throw Error(
  5961. "We should not have any resumable nodes in the shell. This is a bug in React."
  5962. );
  5963. 4 !== boundary.status &&
  5964. ((boundary.status = 4),
  5965. (boundary.errorDigest = errorDigest$jscomp$0),
  5966. boundary.parentFlushed &&
  5967. request$jscomp$0.clientRenderedBoundaries.push(boundary));
  5968. if ("object" === typeof slots) for (var index in slots) delete slots[index];
  5969. }
  5970. }
  5971. function abortTask(task, request, error) {
  5972. var boundary = task.blockedBoundary,
  5973. segment = task.blockedSegment;
  5974. if (null !== segment) {
  5975. if (6 === segment.status) return;
  5976. segment.status = 3;
  5977. }
  5978. var errorInfo = getThrownInfo(task.componentStack);
  5979. if (null === boundary) {
  5980. if (13 !== request.status && 14 !== request.status) {
  5981. boundary = task.replay;
  5982. if (null === boundary) {
  5983. null !== request.trackedPostpones && null !== segment
  5984. ? ((boundary = request.trackedPostpones),
  5985. logRecoverableError(request, error, errorInfo),
  5986. trackPostpone(request, boundary, task, segment),
  5987. finishedTask(request, null, task.row, segment))
  5988. : (logRecoverableError(request, error, errorInfo),
  5989. fatalError(request, error));
  5990. return;
  5991. }
  5992. boundary.pendingTasks--;
  5993. 0 === boundary.pendingTasks &&
  5994. 0 < boundary.nodes.length &&
  5995. ((segment = logRecoverableError(request, error, errorInfo)),
  5996. abortRemainingReplayNodes(
  5997. request,
  5998. null,
  5999. boundary.nodes,
  6000. boundary.slots,
  6001. error,
  6002. segment
  6003. ));
  6004. request.pendingRootTasks--;
  6005. 0 === request.pendingRootTasks && completeShell(request);
  6006. }
  6007. } else {
  6008. var trackedPostpones$64 = request.trackedPostpones;
  6009. if (4 !== boundary.status) {
  6010. if (null !== trackedPostpones$64 && null !== segment)
  6011. return (
  6012. logRecoverableError(request, error, errorInfo),
  6013. trackPostpone(request, trackedPostpones$64, task, segment),
  6014. boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {
  6015. return abortTask(fallbackTask, request, error);
  6016. }),
  6017. boundary.fallbackAbortableTasks.clear(),
  6018. finishedTask(request, boundary, task.row, segment)
  6019. );
  6020. boundary.status = 4;
  6021. segment = logRecoverableError(request, error, errorInfo);
  6022. boundary.status = 4;
  6023. boundary.errorDigest = segment;
  6024. untrackBoundary(request, boundary);
  6025. boundary.parentFlushed && request.clientRenderedBoundaries.push(boundary);
  6026. }
  6027. boundary.pendingTasks--;
  6028. segment = boundary.row;
  6029. null !== segment &&
  6030. 0 === --segment.pendingTasks &&
  6031. finishSuspenseListRow(request, segment);
  6032. boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {
  6033. return abortTask(fallbackTask, request, error);
  6034. });
  6035. boundary.fallbackAbortableTasks.clear();
  6036. }
  6037. task = task.row;
  6038. null !== task &&
  6039. 0 === --task.pendingTasks &&
  6040. finishSuspenseListRow(request, task);
  6041. request.allPendingTasks--;
  6042. 0 === request.allPendingTasks && completeAll(request);
  6043. }
  6044. function safelyEmitEarlyPreloads(request, shellComplete) {
  6045. try {
  6046. var renderState = request.renderState,
  6047. onHeaders = renderState.onHeaders;
  6048. if (onHeaders) {
  6049. var headers = renderState.headers;
  6050. if (headers) {
  6051. renderState.headers = null;
  6052. var linkHeader = headers.preconnects;
  6053. headers.fontPreloads &&
  6054. (linkHeader && (linkHeader += ", "),
  6055. (linkHeader += headers.fontPreloads));
  6056. headers.highImagePreloads &&
  6057. (linkHeader && (linkHeader += ", "),
  6058. (linkHeader += headers.highImagePreloads));
  6059. if (!shellComplete) {
  6060. var queueIter = renderState.styles.values(),
  6061. queueStep = queueIter.next();
  6062. b: for (
  6063. ;
  6064. 0 < headers.remainingCapacity && !queueStep.done;
  6065. queueStep = queueIter.next()
  6066. )
  6067. for (
  6068. var sheetIter = queueStep.value.sheets.values(),
  6069. sheetStep = sheetIter.next();
  6070. 0 < headers.remainingCapacity && !sheetStep.done;
  6071. sheetStep = sheetIter.next()
  6072. ) {
  6073. var sheet = sheetStep.value,
  6074. props = sheet.props,
  6075. key = props.href,
  6076. props$jscomp$0 = sheet.props,
  6077. header = getPreloadAsHeader(props$jscomp$0.href, "style", {
  6078. crossOrigin: props$jscomp$0.crossOrigin,
  6079. integrity: props$jscomp$0.integrity,
  6080. nonce: props$jscomp$0.nonce,
  6081. type: props$jscomp$0.type,
  6082. fetchPriority: props$jscomp$0.fetchPriority,
  6083. referrerPolicy: props$jscomp$0.referrerPolicy,
  6084. media: props$jscomp$0.media
  6085. });
  6086. if (0 <= (headers.remainingCapacity -= header.length + 2))
  6087. (renderState.resets.style[key] = PRELOAD_NO_CREDS),
  6088. linkHeader && (linkHeader += ", "),
  6089. (linkHeader += header),
  6090. (renderState.resets.style[key] =
  6091. "string" === typeof props.crossOrigin ||
  6092. "string" === typeof props.integrity
  6093. ? [props.crossOrigin, props.integrity]
  6094. : PRELOAD_NO_CREDS);
  6095. else break b;
  6096. }
  6097. }
  6098. linkHeader ? onHeaders({ Link: linkHeader }) : onHeaders({});
  6099. }
  6100. }
  6101. } catch (error) {
  6102. logRecoverableError(request, error, {});
  6103. }
  6104. }
  6105. function completeShell(request) {
  6106. null === request.trackedPostpones && safelyEmitEarlyPreloads(request, !0);
  6107. null === request.trackedPostpones && preparePreamble(request);
  6108. request.onShellError = noop;
  6109. request = request.onShellReady;
  6110. request();
  6111. }
  6112. function completeAll(request) {
  6113. safelyEmitEarlyPreloads(
  6114. request,
  6115. null === request.trackedPostpones
  6116. ? !0
  6117. : null === request.completedRootSegment ||
  6118. 5 !== request.completedRootSegment.status
  6119. );
  6120. preparePreamble(request);
  6121. request = request.onAllReady;
  6122. request();
  6123. }
  6124. function queueCompletedSegment(boundary, segment) {
  6125. if (
  6126. 0 === segment.chunks.length &&
  6127. 1 === segment.children.length &&
  6128. null === segment.children[0].boundary &&
  6129. -1 === segment.children[0].id
  6130. ) {
  6131. var childSegment = segment.children[0];
  6132. childSegment.id = segment.id;
  6133. childSegment.parentFlushed = !0;
  6134. (1 !== childSegment.status &&
  6135. 3 !== childSegment.status &&
  6136. 4 !== childSegment.status) ||
  6137. queueCompletedSegment(boundary, childSegment);
  6138. } else boundary.completedSegments.push(segment);
  6139. }
  6140. function finishedSegment(request, boundary, segment) {
  6141. if (null !== byteLengthOfChunk) {
  6142. segment = segment.chunks;
  6143. for (var segmentByteSize = 0, i = 0; i < segment.length; i++)
  6144. segmentByteSize += byteLengthOfChunk(segment[i]);
  6145. null === boundary
  6146. ? (request.byteSize += segmentByteSize)
  6147. : (boundary.byteSize += segmentByteSize);
  6148. }
  6149. }
  6150. function finishedTask(request, boundary, row, segment) {
  6151. null !== row &&
  6152. (0 === --row.pendingTasks
  6153. ? finishSuspenseListRow(request, row)
  6154. : row.together && tryToResolveTogetherRow(request, row));
  6155. request.allPendingTasks--;
  6156. if (null === boundary) {
  6157. if (null !== segment && segment.parentFlushed) {
  6158. if (null !== request.completedRootSegment)
  6159. throw Error(
  6160. "There can only be one root segment. This is a bug in React."
  6161. );
  6162. request.completedRootSegment = segment;
  6163. }
  6164. request.pendingRootTasks--;
  6165. 0 === request.pendingRootTasks && completeShell(request);
  6166. } else if ((boundary.pendingTasks--, 4 !== boundary.status))
  6167. if (0 === boundary.pendingTasks)
  6168. if (
  6169. (0 === boundary.status && (boundary.status = 1),
  6170. null !== segment &&
  6171. segment.parentFlushed &&
  6172. (1 === segment.status || 3 === segment.status) &&
  6173. queueCompletedSegment(boundary, segment),
  6174. boundary.parentFlushed && request.completedBoundaries.push(boundary),
  6175. 1 === boundary.status)
  6176. )
  6177. (row = boundary.row),
  6178. null !== row &&
  6179. hoistHoistables(row.hoistables, boundary.contentState),
  6180. isEligibleForOutlining(request, boundary) ||
  6181. (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
  6182. boundary.fallbackAbortableTasks.clear(),
  6183. null !== row &&
  6184. 0 === --row.pendingTasks &&
  6185. finishSuspenseListRow(request, row)),
  6186. 0 === request.pendingRootTasks &&
  6187. null === request.trackedPostpones &&
  6188. null !== boundary.contentPreamble &&
  6189. preparePreamble(request);
  6190. else {
  6191. if (
  6192. 5 === boundary.status &&
  6193. ((boundary = boundary.row), null !== boundary)
  6194. ) {
  6195. if (null !== request.trackedPostpones) {
  6196. row = request.trackedPostpones;
  6197. var postponedRow = boundary.next;
  6198. if (
  6199. null !== postponedRow &&
  6200. ((segment = postponedRow.boundaries), null !== segment)
  6201. )
  6202. for (
  6203. postponedRow.boundaries = null, postponedRow = 0;
  6204. postponedRow < segment.length;
  6205. postponedRow++
  6206. ) {
  6207. var postponedBoundary = segment[postponedRow];
  6208. trackPostponedBoundary(request, row, postponedBoundary);
  6209. finishedTask(request, postponedBoundary, null, null);
  6210. }
  6211. }
  6212. 0 === --boundary.pendingTasks &&
  6213. finishSuspenseListRow(request, boundary);
  6214. }
  6215. }
  6216. else
  6217. null === segment ||
  6218. !segment.parentFlushed ||
  6219. (1 !== segment.status && 3 !== segment.status) ||
  6220. (queueCompletedSegment(boundary, segment),
  6221. 1 === boundary.completedSegments.length &&
  6222. boundary.parentFlushed &&
  6223. request.partialBoundaries.push(boundary)),
  6224. (boundary = boundary.row),
  6225. null !== boundary &&
  6226. boundary.together &&
  6227. tryToResolveTogetherRow(request, boundary);
  6228. 0 === request.allPendingTasks && completeAll(request);
  6229. }
  6230. function performWork(request$jscomp$2) {
  6231. if (14 !== request$jscomp$2.status && 13 !== request$jscomp$2.status) {
  6232. var prevContext = currentActiveSnapshot,
  6233. prevDispatcher = ReactSharedInternals.H;
  6234. ReactSharedInternals.H = HooksDispatcher;
  6235. var prevAsyncDispatcher = ReactSharedInternals.A;
  6236. ReactSharedInternals.A = DefaultAsyncDispatcher;
  6237. var prevRequest = currentRequest;
  6238. currentRequest = request$jscomp$2;
  6239. var prevResumableState = currentResumableState;
  6240. currentResumableState = request$jscomp$2.resumableState;
  6241. try {
  6242. var pingedTasks = request$jscomp$2.pingedTasks,
  6243. i;
  6244. for (i = 0; i < pingedTasks.length; i++) {
  6245. var task = pingedTasks[i],
  6246. request = request$jscomp$2,
  6247. segment = task.blockedSegment;
  6248. if (null === segment) {
  6249. var request$jscomp$0 = request;
  6250. if (0 !== task.replay.pendingTasks) {
  6251. switchContext(task.context);
  6252. try {
  6253. "number" === typeof task.replay.slots
  6254. ? resumeNode(
  6255. request$jscomp$0,
  6256. task,
  6257. task.replay.slots,
  6258. task.node,
  6259. task.childIndex
  6260. )
  6261. : retryNode(request$jscomp$0, task);
  6262. if (
  6263. 1 === task.replay.pendingTasks &&
  6264. 0 < task.replay.nodes.length
  6265. )
  6266. throw Error(
  6267. "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
  6268. );
  6269. task.replay.pendingTasks--;
  6270. task.abortSet.delete(task);
  6271. finishedTask(
  6272. request$jscomp$0,
  6273. task.blockedBoundary,
  6274. task.row,
  6275. null
  6276. );
  6277. } catch (thrownValue) {
  6278. resetHooksState();
  6279. var x =
  6280. thrownValue === SuspenseException
  6281. ? getSuspendedThenable()
  6282. : thrownValue;
  6283. if (
  6284. "object" === typeof x &&
  6285. null !== x &&
  6286. "function" === typeof x.then
  6287. ) {
  6288. var ping = task.ping;
  6289. x.then(ping, ping);
  6290. task.thenableState =
  6291. thrownValue === SuspenseException
  6292. ? getThenableStateAfterSuspending()
  6293. : null;
  6294. } else {
  6295. task.replay.pendingTasks--;
  6296. task.abortSet.delete(task);
  6297. var errorInfo = getThrownInfo(task.componentStack);
  6298. request = void 0;
  6299. var request$jscomp$1 = request$jscomp$0,
  6300. boundary = task.blockedBoundary,
  6301. error$jscomp$0 =
  6302. 12 === request$jscomp$0.status
  6303. ? request$jscomp$0.fatalError
  6304. : x,
  6305. replayNodes = task.replay.nodes,
  6306. resumeSlots = task.replay.slots;
  6307. request = logRecoverableError(
  6308. request$jscomp$1,
  6309. error$jscomp$0,
  6310. errorInfo
  6311. );
  6312. abortRemainingReplayNodes(
  6313. request$jscomp$1,
  6314. boundary,
  6315. replayNodes,
  6316. resumeSlots,
  6317. error$jscomp$0,
  6318. request
  6319. );
  6320. request$jscomp$0.pendingRootTasks--;
  6321. 0 === request$jscomp$0.pendingRootTasks &&
  6322. completeShell(request$jscomp$0);
  6323. request$jscomp$0.allPendingTasks--;
  6324. 0 === request$jscomp$0.allPendingTasks &&
  6325. completeAll(request$jscomp$0);
  6326. }
  6327. } finally {
  6328. }
  6329. }
  6330. } else if (
  6331. ((request$jscomp$0 = void 0),
  6332. (request$jscomp$1 = segment),
  6333. 0 === request$jscomp$1.status)
  6334. ) {
  6335. request$jscomp$1.status = 6;
  6336. switchContext(task.context);
  6337. var childrenLength = request$jscomp$1.children.length,
  6338. chunkLength = request$jscomp$1.chunks.length;
  6339. try {
  6340. retryNode(request, task),
  6341. request$jscomp$1.lastPushedText &&
  6342. request$jscomp$1.textEmbedded &&
  6343. request$jscomp$1.chunks.push(textSeparator),
  6344. task.abortSet.delete(task),
  6345. (request$jscomp$1.status = 1),
  6346. finishedSegment(request, task.blockedBoundary, request$jscomp$1),
  6347. finishedTask(
  6348. request,
  6349. task.blockedBoundary,
  6350. task.row,
  6351. request$jscomp$1
  6352. );
  6353. } catch (thrownValue) {
  6354. resetHooksState();
  6355. request$jscomp$1.children.length = childrenLength;
  6356. request$jscomp$1.chunks.length = chunkLength;
  6357. var x$jscomp$0 =
  6358. thrownValue === SuspenseException
  6359. ? getSuspendedThenable()
  6360. : 12 === request.status
  6361. ? request.fatalError
  6362. : thrownValue;
  6363. if (12 === request.status && null !== request.trackedPostpones) {
  6364. var trackedPostpones = request.trackedPostpones,
  6365. thrownInfo = getThrownInfo(task.componentStack);
  6366. task.abortSet.delete(task);
  6367. logRecoverableError(request, x$jscomp$0, thrownInfo);
  6368. trackPostpone(request, trackedPostpones, task, request$jscomp$1);
  6369. finishedTask(
  6370. request,
  6371. task.blockedBoundary,
  6372. task.row,
  6373. request$jscomp$1
  6374. );
  6375. } else if (
  6376. "object" === typeof x$jscomp$0 &&
  6377. null !== x$jscomp$0 &&
  6378. "function" === typeof x$jscomp$0.then
  6379. ) {
  6380. request$jscomp$1.status = 0;
  6381. task.thenableState =
  6382. thrownValue === SuspenseException
  6383. ? getThenableStateAfterSuspending()
  6384. : null;
  6385. var ping$jscomp$0 = task.ping;
  6386. x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0);
  6387. } else {
  6388. var errorInfo$jscomp$0 = getThrownInfo(task.componentStack);
  6389. task.abortSet.delete(task);
  6390. request$jscomp$1.status = 4;
  6391. var boundary$jscomp$0 = task.blockedBoundary,
  6392. row = task.row;
  6393. null !== row &&
  6394. 0 === --row.pendingTasks &&
  6395. finishSuspenseListRow(request, row);
  6396. request.allPendingTasks--;
  6397. request$jscomp$0 = logRecoverableError(
  6398. request,
  6399. x$jscomp$0,
  6400. errorInfo$jscomp$0
  6401. );
  6402. if (null === boundary$jscomp$0) fatalError(request, x$jscomp$0);
  6403. else if (
  6404. (boundary$jscomp$0.pendingTasks--,
  6405. 4 !== boundary$jscomp$0.status)
  6406. ) {
  6407. boundary$jscomp$0.status = 4;
  6408. boundary$jscomp$0.errorDigest = request$jscomp$0;
  6409. untrackBoundary(request, boundary$jscomp$0);
  6410. var boundaryRow = boundary$jscomp$0.row;
  6411. null !== boundaryRow &&
  6412. 0 === --boundaryRow.pendingTasks &&
  6413. finishSuspenseListRow(request, boundaryRow);
  6414. boundary$jscomp$0.parentFlushed &&
  6415. request.clientRenderedBoundaries.push(boundary$jscomp$0);
  6416. 0 === request.pendingRootTasks &&
  6417. null === request.trackedPostpones &&
  6418. null !== boundary$jscomp$0.contentPreamble &&
  6419. preparePreamble(request);
  6420. }
  6421. 0 === request.allPendingTasks && completeAll(request);
  6422. }
  6423. } finally {
  6424. }
  6425. }
  6426. }
  6427. pingedTasks.splice(0, i);
  6428. null !== request$jscomp$2.destination &&
  6429. flushCompletedQueues(request$jscomp$2, request$jscomp$2.destination);
  6430. } catch (error) {
  6431. logRecoverableError(request$jscomp$2, error, {}),
  6432. fatalError(request$jscomp$2, error);
  6433. } finally {
  6434. (currentResumableState = prevResumableState),
  6435. (ReactSharedInternals.H = prevDispatcher),
  6436. (ReactSharedInternals.A = prevAsyncDispatcher),
  6437. prevDispatcher === HooksDispatcher && switchContext(prevContext),
  6438. (currentRequest = prevRequest);
  6439. }
  6440. }
  6441. }
  6442. function preparePreambleFromSubtree(
  6443. request,
  6444. segment,
  6445. collectedPreambleSegments
  6446. ) {
  6447. segment.preambleChildren.length &&
  6448. collectedPreambleSegments.push(segment.preambleChildren);
  6449. for (var pendingPreambles = !1, i = 0; i < segment.children.length; i++)
  6450. pendingPreambles =
  6451. preparePreambleFromSegment(
  6452. request,
  6453. segment.children[i],
  6454. collectedPreambleSegments
  6455. ) || pendingPreambles;
  6456. return pendingPreambles;
  6457. }
  6458. function preparePreambleFromSegment(
  6459. request,
  6460. segment,
  6461. collectedPreambleSegments
  6462. ) {
  6463. var boundary = segment.boundary;
  6464. if (null === boundary)
  6465. return preparePreambleFromSubtree(
  6466. request,
  6467. segment,
  6468. collectedPreambleSegments
  6469. );
  6470. var preamble = boundary.contentPreamble,
  6471. fallbackPreamble = boundary.fallbackPreamble;
  6472. if (null === preamble || null === fallbackPreamble) return !1;
  6473. switch (boundary.status) {
  6474. case 1:
  6475. hoistPreambleState(request.renderState, preamble);
  6476. request.byteSize += boundary.byteSize;
  6477. segment = boundary.completedSegments[0];
  6478. if (!segment)
  6479. throw Error(
  6480. "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
  6481. );
  6482. return preparePreambleFromSubtree(
  6483. request,
  6484. segment,
  6485. collectedPreambleSegments
  6486. );
  6487. case 5:
  6488. if (null !== request.trackedPostpones) return !0;
  6489. case 4:
  6490. if (1 === segment.status)
  6491. return (
  6492. hoistPreambleState(request.renderState, fallbackPreamble),
  6493. preparePreambleFromSubtree(
  6494. request,
  6495. segment,
  6496. collectedPreambleSegments
  6497. )
  6498. );
  6499. default:
  6500. return !0;
  6501. }
  6502. }
  6503. function preparePreamble(request) {
  6504. if (
  6505. request.completedRootSegment &&
  6506. null === request.completedPreambleSegments
  6507. ) {
  6508. var collectedPreambleSegments = [],
  6509. originalRequestByteSize = request.byteSize,
  6510. hasPendingPreambles = preparePreambleFromSegment(
  6511. request,
  6512. request.completedRootSegment,
  6513. collectedPreambleSegments
  6514. ),
  6515. preamble = request.renderState.preamble;
  6516. !1 === hasPendingPreambles || (preamble.headChunks && preamble.bodyChunks)
  6517. ? (request.completedPreambleSegments = collectedPreambleSegments)
  6518. : (request.byteSize = originalRequestByteSize);
  6519. }
  6520. }
  6521. function flushSubtree(request, destination, segment, hoistableState) {
  6522. segment.parentFlushed = !0;
  6523. switch (segment.status) {
  6524. case 0:
  6525. segment.id = request.nextSegmentId++;
  6526. case 5:
  6527. return (
  6528. (hoistableState = segment.id),
  6529. (segment.lastPushedText = !1),
  6530. (segment.textEmbedded = !1),
  6531. (request = request.renderState),
  6532. writeChunk(destination, placeholder1),
  6533. writeChunk(destination, request.placeholderPrefix),
  6534. (request = hoistableState.toString(16)),
  6535. writeChunk(destination, request),
  6536. writeChunkAndReturn(destination, placeholder2)
  6537. );
  6538. case 1:
  6539. segment.status = 2;
  6540. var r = !0,
  6541. chunks = segment.chunks,
  6542. chunkIdx = 0;
  6543. segment = segment.children;
  6544. for (var childIdx = 0; childIdx < segment.length; childIdx++) {
  6545. for (r = segment[childIdx]; chunkIdx < r.index; chunkIdx++)
  6546. writeChunk(destination, chunks[chunkIdx]);
  6547. r = flushSegment(request, destination, r, hoistableState);
  6548. }
  6549. for (; chunkIdx < chunks.length - 1; chunkIdx++)
  6550. writeChunk(destination, chunks[chunkIdx]);
  6551. chunkIdx < chunks.length &&
  6552. (r = writeChunkAndReturn(destination, chunks[chunkIdx]));
  6553. return r;
  6554. case 3:
  6555. return !0;
  6556. default:
  6557. throw Error(
  6558. "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React."
  6559. );
  6560. }
  6561. }
  6562. var flushedByteSize = 0;
  6563. function flushSegment(request, destination, segment, hoistableState) {
  6564. var boundary = segment.boundary;
  6565. if (null === boundary)
  6566. return flushSubtree(request, destination, segment, hoistableState);
  6567. boundary.parentFlushed = !0;
  6568. if (4 === boundary.status) {
  6569. var row = boundary.row;
  6570. null !== row &&
  6571. 0 === --row.pendingTasks &&
  6572. finishSuspenseListRow(request, row);
  6573. boundary = boundary.errorDigest;
  6574. writeChunkAndReturn(destination, startClientRenderedSuspenseBoundary);
  6575. writeChunk(destination, clientRenderedSuspenseBoundaryError1);
  6576. boundary &&
  6577. (writeChunk(destination, clientRenderedSuspenseBoundaryError1A),
  6578. writeChunk(destination, escapeTextForBrowser(boundary)),
  6579. writeChunk(
  6580. destination,
  6581. clientRenderedSuspenseBoundaryErrorAttrInterstitial
  6582. ));
  6583. writeChunkAndReturn(destination, clientRenderedSuspenseBoundaryError2);
  6584. flushSubtree(request, destination, segment, hoistableState);
  6585. } else if (1 !== boundary.status)
  6586. 0 === boundary.status && (boundary.rootSegmentID = request.nextSegmentId++),
  6587. 0 < boundary.completedSegments.length &&
  6588. request.partialBoundaries.push(boundary),
  6589. writeStartPendingSuspenseBoundary(
  6590. destination,
  6591. request.renderState,
  6592. boundary.rootSegmentID
  6593. ),
  6594. hoistableState && hoistHoistables(hoistableState, boundary.fallbackState),
  6595. flushSubtree(request, destination, segment, hoistableState);
  6596. else if (
  6597. !flushingPartialBoundaries &&
  6598. isEligibleForOutlining(request, boundary) &&
  6599. (flushedByteSize + boundary.byteSize > request.progressiveChunkSize ||
  6600. hasSuspenseyContent(boundary.contentState))
  6601. )
  6602. (boundary.rootSegmentID = request.nextSegmentId++),
  6603. request.completedBoundaries.push(boundary),
  6604. writeStartPendingSuspenseBoundary(
  6605. destination,
  6606. request.renderState,
  6607. boundary.rootSegmentID
  6608. ),
  6609. flushSubtree(request, destination, segment, hoistableState);
  6610. else {
  6611. flushedByteSize += boundary.byteSize;
  6612. hoistableState && hoistHoistables(hoistableState, boundary.contentState);
  6613. segment = boundary.row;
  6614. null !== segment &&
  6615. isEligibleForOutlining(request, boundary) &&
  6616. 0 === --segment.pendingTasks &&
  6617. finishSuspenseListRow(request, segment);
  6618. writeChunkAndReturn(destination, startCompletedSuspenseBoundary);
  6619. segment = boundary.completedSegments;
  6620. if (1 !== segment.length)
  6621. throw Error(
  6622. "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
  6623. );
  6624. flushSegment(request, destination, segment[0], hoistableState);
  6625. }
  6626. return writeChunkAndReturn(destination, endSuspenseBoundary);
  6627. }
  6628. function flushSegmentContainer(request, destination, segment, hoistableState) {
  6629. writeStartSegment(
  6630. destination,
  6631. request.renderState,
  6632. segment.parentFormatContext,
  6633. segment.id
  6634. );
  6635. flushSegment(request, destination, segment, hoistableState);
  6636. return writeEndSegment(destination, segment.parentFormatContext);
  6637. }
  6638. function flushCompletedBoundary(request, destination, boundary) {
  6639. flushedByteSize = boundary.byteSize;
  6640. for (
  6641. var completedSegments = boundary.completedSegments, i = 0;
  6642. i < completedSegments.length;
  6643. i++
  6644. )
  6645. flushPartiallyCompletedSegment(
  6646. request,
  6647. destination,
  6648. boundary,
  6649. completedSegments[i]
  6650. );
  6651. completedSegments.length = 0;
  6652. completedSegments = boundary.row;
  6653. null !== completedSegments &&
  6654. isEligibleForOutlining(request, boundary) &&
  6655. 0 === --completedSegments.pendingTasks &&
  6656. finishSuspenseListRow(request, completedSegments);
  6657. writeHoistablesForBoundary(
  6658. destination,
  6659. boundary.contentState,
  6660. request.renderState
  6661. );
  6662. completedSegments = request.resumableState;
  6663. request = request.renderState;
  6664. i = boundary.rootSegmentID;
  6665. boundary = boundary.contentState;
  6666. var requiresStyleInsertion = request.stylesToHoist;
  6667. request.stylesToHoist = !1;
  6668. writeChunk(destination, request.startInlineScript);
  6669. writeChunk(destination, endOfStartTag);
  6670. requiresStyleInsertion
  6671. ? (0 === (completedSegments.instructions & 4) &&
  6672. ((completedSegments.instructions |= 4),
  6673. writeChunk(destination, clientRenderScriptFunctionOnly)),
  6674. 0 === (completedSegments.instructions & 2) &&
  6675. ((completedSegments.instructions |= 2),
  6676. writeChunk(destination, completeBoundaryScriptFunctionOnly)),
  6677. 0 === (completedSegments.instructions & 8)
  6678. ? ((completedSegments.instructions |= 8),
  6679. writeChunk(destination, completeBoundaryWithStylesScript1FullPartial))
  6680. : writeChunk(destination, completeBoundaryWithStylesScript1Partial))
  6681. : (0 === (completedSegments.instructions & 2) &&
  6682. ((completedSegments.instructions |= 2),
  6683. writeChunk(destination, completeBoundaryScriptFunctionOnly)),
  6684. writeChunk(destination, completeBoundaryScript1Partial));
  6685. completedSegments = i.toString(16);
  6686. writeChunk(destination, request.boundaryPrefix);
  6687. writeChunk(destination, completedSegments);
  6688. writeChunk(destination, completeBoundaryScript2);
  6689. writeChunk(destination, request.segmentPrefix);
  6690. writeChunk(destination, completedSegments);
  6691. requiresStyleInsertion
  6692. ? (writeChunk(destination, completeBoundaryScript3a),
  6693. writeStyleResourceDependenciesInJS(destination, boundary))
  6694. : writeChunk(destination, completeBoundaryScript3b);
  6695. boundary = writeChunkAndReturn(destination, completeBoundaryScriptEnd);
  6696. return writeBootstrap(destination, request) && boundary;
  6697. }
  6698. function flushPartiallyCompletedSegment(
  6699. request,
  6700. destination,
  6701. boundary,
  6702. segment
  6703. ) {
  6704. if (2 === segment.status) return !0;
  6705. var hoistableState = boundary.contentState,
  6706. segmentID = segment.id;
  6707. if (-1 === segmentID) {
  6708. if (-1 === (segment.id = boundary.rootSegmentID))
  6709. throw Error(
  6710. "A root segment ID must have been assigned by now. This is a bug in React."
  6711. );
  6712. return flushSegmentContainer(request, destination, segment, hoistableState);
  6713. }
  6714. if (segmentID === boundary.rootSegmentID)
  6715. return flushSegmentContainer(request, destination, segment, hoistableState);
  6716. flushSegmentContainer(request, destination, segment, hoistableState);
  6717. boundary = request.resumableState;
  6718. request = request.renderState;
  6719. writeChunk(destination, request.startInlineScript);
  6720. writeChunk(destination, endOfStartTag);
  6721. 0 === (boundary.instructions & 1)
  6722. ? ((boundary.instructions |= 1),
  6723. writeChunk(destination, completeSegmentScript1Full))
  6724. : writeChunk(destination, completeSegmentScript1Partial);
  6725. writeChunk(destination, request.segmentPrefix);
  6726. segmentID = segmentID.toString(16);
  6727. writeChunk(destination, segmentID);
  6728. writeChunk(destination, completeSegmentScript2);
  6729. writeChunk(destination, request.placeholderPrefix);
  6730. writeChunk(destination, segmentID);
  6731. destination = writeChunkAndReturn(destination, completeSegmentScriptEnd);
  6732. return destination;
  6733. }
  6734. var flushingPartialBoundaries = !1;
  6735. function flushCompletedQueues(request, destination) {
  6736. currentView = new Uint8Array(2048);
  6737. writtenBytes = 0;
  6738. destinationHasCapacity$1 = !0;
  6739. try {
  6740. if (!(0 < request.pendingRootTasks)) {
  6741. var i,
  6742. completedRootSegment = request.completedRootSegment;
  6743. if (null !== completedRootSegment) {
  6744. if (5 === completedRootSegment.status) return;
  6745. var completedPreambleSegments = request.completedPreambleSegments;
  6746. if (null === completedPreambleSegments) return;
  6747. flushedByteSize = request.byteSize;
  6748. var resumableState = request.resumableState,
  6749. renderState = request.renderState,
  6750. preamble = renderState.preamble,
  6751. htmlChunks = preamble.htmlChunks,
  6752. headChunks = preamble.headChunks,
  6753. i$jscomp$0;
  6754. if (htmlChunks) {
  6755. for (i$jscomp$0 = 0; i$jscomp$0 < htmlChunks.length; i$jscomp$0++)
  6756. writeChunk(destination, htmlChunks[i$jscomp$0]);
  6757. if (headChunks)
  6758. for (i$jscomp$0 = 0; i$jscomp$0 < headChunks.length; i$jscomp$0++)
  6759. writeChunk(destination, headChunks[i$jscomp$0]);
  6760. else
  6761. writeChunk(destination, startChunkForTag("head")),
  6762. writeChunk(destination, endOfStartTag);
  6763. } else if (headChunks)
  6764. for (i$jscomp$0 = 0; i$jscomp$0 < headChunks.length; i$jscomp$0++)
  6765. writeChunk(destination, headChunks[i$jscomp$0]);
  6766. var charsetChunks = renderState.charsetChunks;
  6767. for (i$jscomp$0 = 0; i$jscomp$0 < charsetChunks.length; i$jscomp$0++)
  6768. writeChunk(destination, charsetChunks[i$jscomp$0]);
  6769. charsetChunks.length = 0;
  6770. renderState.preconnects.forEach(flushResource, destination);
  6771. renderState.preconnects.clear();
  6772. var viewportChunks = renderState.viewportChunks;
  6773. for (i$jscomp$0 = 0; i$jscomp$0 < viewportChunks.length; i$jscomp$0++)
  6774. writeChunk(destination, viewportChunks[i$jscomp$0]);
  6775. viewportChunks.length = 0;
  6776. renderState.fontPreloads.forEach(flushResource, destination);
  6777. renderState.fontPreloads.clear();
  6778. renderState.highImagePreloads.forEach(flushResource, destination);
  6779. renderState.highImagePreloads.clear();
  6780. currentlyFlushingRenderState = renderState;
  6781. renderState.styles.forEach(flushStylesInPreamble, destination);
  6782. currentlyFlushingRenderState = null;
  6783. var importMapChunks = renderState.importMapChunks;
  6784. for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)
  6785. writeChunk(destination, importMapChunks[i$jscomp$0]);
  6786. importMapChunks.length = 0;
  6787. renderState.bootstrapScripts.forEach(flushResource, destination);
  6788. renderState.scripts.forEach(flushResource, destination);
  6789. renderState.scripts.clear();
  6790. renderState.bulkPreloads.forEach(flushResource, destination);
  6791. renderState.bulkPreloads.clear();
  6792. htmlChunks || headChunks || (resumableState.instructions |= 32);
  6793. var hoistableChunks = renderState.hoistableChunks;
  6794. for (i$jscomp$0 = 0; i$jscomp$0 < hoistableChunks.length; i$jscomp$0++)
  6795. writeChunk(destination, hoistableChunks[i$jscomp$0]);
  6796. for (
  6797. resumableState = hoistableChunks.length = 0;
  6798. resumableState < completedPreambleSegments.length;
  6799. resumableState++
  6800. ) {
  6801. var segments = completedPreambleSegments[resumableState];
  6802. for (renderState = 0; renderState < segments.length; renderState++)
  6803. flushSegment(request, destination, segments[renderState], null);
  6804. }
  6805. var preamble$jscomp$0 = request.renderState.preamble,
  6806. headChunks$jscomp$0 = preamble$jscomp$0.headChunks;
  6807. (preamble$jscomp$0.htmlChunks || headChunks$jscomp$0) &&
  6808. writeChunk(destination, endChunkForTag("head"));
  6809. var bodyChunks = preamble$jscomp$0.bodyChunks;
  6810. if (bodyChunks)
  6811. for (
  6812. completedPreambleSegments = 0;
  6813. completedPreambleSegments < bodyChunks.length;
  6814. completedPreambleSegments++
  6815. )
  6816. writeChunk(destination, bodyChunks[completedPreambleSegments]);
  6817. flushSegment(request, destination, completedRootSegment, null);
  6818. request.completedRootSegment = null;
  6819. var renderState$jscomp$0 = request.renderState;
  6820. if (
  6821. 0 !== request.allPendingTasks ||
  6822. 0 !== request.clientRenderedBoundaries.length ||
  6823. 0 !== request.completedBoundaries.length ||
  6824. (null !== request.trackedPostpones &&
  6825. (0 !== request.trackedPostpones.rootNodes.length ||
  6826. null !== request.trackedPostpones.rootSlots))
  6827. ) {
  6828. var resumableState$jscomp$0 = request.resumableState;
  6829. if (0 === (resumableState$jscomp$0.instructions & 64)) {
  6830. resumableState$jscomp$0.instructions |= 64;
  6831. writeChunk(destination, renderState$jscomp$0.startInlineScript);
  6832. if (0 === (resumableState$jscomp$0.instructions & 32)) {
  6833. resumableState$jscomp$0.instructions |= 32;
  6834. var shellId = "_" + resumableState$jscomp$0.idPrefix + "R_";
  6835. writeChunk(destination, completedShellIdAttributeStart);
  6836. writeChunk(destination, escapeTextForBrowser(shellId));
  6837. writeChunk(destination, attributeEnd);
  6838. }
  6839. writeChunk(destination, endOfStartTag);
  6840. writeChunk(destination, shellTimeRuntimeScript);
  6841. writeChunkAndReturn(destination, endInlineScript);
  6842. }
  6843. }
  6844. writeBootstrap(destination, renderState$jscomp$0);
  6845. }
  6846. var renderState$jscomp$1 = request.renderState;
  6847. completedRootSegment = 0;
  6848. var viewportChunks$jscomp$0 = renderState$jscomp$1.viewportChunks;
  6849. for (
  6850. completedRootSegment = 0;
  6851. completedRootSegment < viewportChunks$jscomp$0.length;
  6852. completedRootSegment++
  6853. )
  6854. writeChunk(destination, viewportChunks$jscomp$0[completedRootSegment]);
  6855. viewportChunks$jscomp$0.length = 0;
  6856. renderState$jscomp$1.preconnects.forEach(flushResource, destination);
  6857. renderState$jscomp$1.preconnects.clear();
  6858. renderState$jscomp$1.fontPreloads.forEach(flushResource, destination);
  6859. renderState$jscomp$1.fontPreloads.clear();
  6860. renderState$jscomp$1.highImagePreloads.forEach(
  6861. flushResource,
  6862. destination
  6863. );
  6864. renderState$jscomp$1.highImagePreloads.clear();
  6865. renderState$jscomp$1.styles.forEach(preloadLateStyles, destination);
  6866. renderState$jscomp$1.scripts.forEach(flushResource, destination);
  6867. renderState$jscomp$1.scripts.clear();
  6868. renderState$jscomp$1.bulkPreloads.forEach(flushResource, destination);
  6869. renderState$jscomp$1.bulkPreloads.clear();
  6870. var hoistableChunks$jscomp$0 = renderState$jscomp$1.hoistableChunks;
  6871. for (
  6872. completedRootSegment = 0;
  6873. completedRootSegment < hoistableChunks$jscomp$0.length;
  6874. completedRootSegment++
  6875. )
  6876. writeChunk(destination, hoistableChunks$jscomp$0[completedRootSegment]);
  6877. hoistableChunks$jscomp$0.length = 0;
  6878. var clientRenderedBoundaries = request.clientRenderedBoundaries;
  6879. for (i = 0; i < clientRenderedBoundaries.length; i++) {
  6880. var boundary = clientRenderedBoundaries[i];
  6881. renderState$jscomp$1 = destination;
  6882. var resumableState$jscomp$1 = request.resumableState,
  6883. renderState$jscomp$2 = request.renderState,
  6884. id = boundary.rootSegmentID,
  6885. errorDigest = boundary.errorDigest;
  6886. writeChunk(
  6887. renderState$jscomp$1,
  6888. renderState$jscomp$2.startInlineScript
  6889. );
  6890. writeChunk(renderState$jscomp$1, endOfStartTag);
  6891. 0 === (resumableState$jscomp$1.instructions & 4)
  6892. ? ((resumableState$jscomp$1.instructions |= 4),
  6893. writeChunk(renderState$jscomp$1, clientRenderScript1Full))
  6894. : writeChunk(renderState$jscomp$1, clientRenderScript1Partial);
  6895. writeChunk(renderState$jscomp$1, renderState$jscomp$2.boundaryPrefix);
  6896. writeChunk(renderState$jscomp$1, id.toString(16));
  6897. writeChunk(renderState$jscomp$1, clientRenderScript1A);
  6898. errorDigest &&
  6899. (writeChunk(
  6900. renderState$jscomp$1,
  6901. clientRenderErrorScriptArgInterstitial
  6902. ),
  6903. writeChunk(
  6904. renderState$jscomp$1,
  6905. escapeJSStringsForInstructionScripts(errorDigest || "")
  6906. ));
  6907. var JSCompiler_inline_result = writeChunkAndReturn(
  6908. renderState$jscomp$1,
  6909. clientRenderScriptEnd
  6910. );
  6911. if (!JSCompiler_inline_result) {
  6912. request.destination = null;
  6913. i++;
  6914. clientRenderedBoundaries.splice(0, i);
  6915. return;
  6916. }
  6917. }
  6918. clientRenderedBoundaries.splice(0, i);
  6919. var completedBoundaries = request.completedBoundaries;
  6920. for (i = 0; i < completedBoundaries.length; i++)
  6921. if (
  6922. !flushCompletedBoundary(request, destination, completedBoundaries[i])
  6923. ) {
  6924. request.destination = null;
  6925. i++;
  6926. completedBoundaries.splice(0, i);
  6927. return;
  6928. }
  6929. completedBoundaries.splice(0, i);
  6930. completeWriting(destination);
  6931. currentView = new Uint8Array(2048);
  6932. writtenBytes = 0;
  6933. flushingPartialBoundaries = destinationHasCapacity$1 = !0;
  6934. var partialBoundaries = request.partialBoundaries;
  6935. for (i = 0; i < partialBoundaries.length; i++) {
  6936. var boundary$70 = partialBoundaries[i];
  6937. a: {
  6938. clientRenderedBoundaries = request;
  6939. boundary = destination;
  6940. flushedByteSize = boundary$70.byteSize;
  6941. var completedSegments = boundary$70.completedSegments;
  6942. for (
  6943. JSCompiler_inline_result = 0;
  6944. JSCompiler_inline_result < completedSegments.length;
  6945. JSCompiler_inline_result++
  6946. )
  6947. if (
  6948. !flushPartiallyCompletedSegment(
  6949. clientRenderedBoundaries,
  6950. boundary,
  6951. boundary$70,
  6952. completedSegments[JSCompiler_inline_result]
  6953. )
  6954. ) {
  6955. JSCompiler_inline_result++;
  6956. completedSegments.splice(0, JSCompiler_inline_result);
  6957. var JSCompiler_inline_result$jscomp$0 = !1;
  6958. break a;
  6959. }
  6960. completedSegments.splice(0, JSCompiler_inline_result);
  6961. var row = boundary$70.row;
  6962. null !== row &&
  6963. row.together &&
  6964. 1 === boundary$70.pendingTasks &&
  6965. (1 === row.pendingTasks
  6966. ? unblockSuspenseListRow(
  6967. clientRenderedBoundaries,
  6968. row,
  6969. row.hoistables
  6970. )
  6971. : row.pendingTasks--);
  6972. JSCompiler_inline_result$jscomp$0 = writeHoistablesForBoundary(
  6973. boundary,
  6974. boundary$70.contentState,
  6975. clientRenderedBoundaries.renderState
  6976. );
  6977. }
  6978. if (!JSCompiler_inline_result$jscomp$0) {
  6979. request.destination = null;
  6980. i++;
  6981. partialBoundaries.splice(0, i);
  6982. return;
  6983. }
  6984. }
  6985. partialBoundaries.splice(0, i);
  6986. flushingPartialBoundaries = !1;
  6987. var largeBoundaries = request.completedBoundaries;
  6988. for (i = 0; i < largeBoundaries.length; i++)
  6989. if (!flushCompletedBoundary(request, destination, largeBoundaries[i])) {
  6990. request.destination = null;
  6991. i++;
  6992. largeBoundaries.splice(0, i);
  6993. return;
  6994. }
  6995. largeBoundaries.splice(0, i);
  6996. }
  6997. } finally {
  6998. (flushingPartialBoundaries = !1),
  6999. 0 === request.allPendingTasks &&
  7000. 0 === request.clientRenderedBoundaries.length &&
  7001. 0 === request.completedBoundaries.length
  7002. ? ((request.flushScheduled = !1),
  7003. (i = request.resumableState),
  7004. i.hasBody && writeChunk(destination, endChunkForTag("body")),
  7005. i.hasHtml && writeChunk(destination, endChunkForTag("html")),
  7006. completeWriting(destination),
  7007. flushBuffered(destination),
  7008. (request.status = 14),
  7009. destination.end(),
  7010. (request.destination = null))
  7011. : (completeWriting(destination), flushBuffered(destination));
  7012. }
  7013. }
  7014. function startWork(request) {
  7015. request.flushScheduled = null !== request.destination;
  7016. scheduleMicrotask(function () {
  7017. return requestStorage.run(request, performWork, request);
  7018. });
  7019. setImmediate(function () {
  7020. 10 === request.status && (request.status = 11);
  7021. null === request.trackedPostpones &&
  7022. requestStorage.run(
  7023. request,
  7024. enqueueEarlyPreloadsAfterInitialWork,
  7025. request
  7026. );
  7027. });
  7028. }
  7029. function enqueueEarlyPreloadsAfterInitialWork(request) {
  7030. safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks);
  7031. }
  7032. function enqueueFlush(request) {
  7033. !1 === request.flushScheduled &&
  7034. 0 === request.pingedTasks.length &&
  7035. null !== request.destination &&
  7036. ((request.flushScheduled = !0),
  7037. setImmediate(function () {
  7038. var destination = request.destination;
  7039. destination
  7040. ? flushCompletedQueues(request, destination)
  7041. : (request.flushScheduled = !1);
  7042. }));
  7043. }
  7044. function startFlowing(request, destination) {
  7045. if (13 === request.status)
  7046. (request.status = 14), destination.destroy(request.fatalError);
  7047. else if (14 !== request.status && null === request.destination) {
  7048. request.destination = destination;
  7049. try {
  7050. flushCompletedQueues(request, destination);
  7051. } catch (error) {
  7052. logRecoverableError(request, error, {}), fatalError(request, error);
  7053. }
  7054. }
  7055. }
  7056. function abort(request, reason) {
  7057. if (11 === request.status || 10 === request.status) request.status = 12;
  7058. try {
  7059. var abortableTasks = request.abortableTasks;
  7060. if (0 < abortableTasks.size) {
  7061. var error =
  7062. void 0 === reason
  7063. ? Error("The render was aborted by the server without a reason.")
  7064. : "object" === typeof reason &&
  7065. null !== reason &&
  7066. "function" === typeof reason.then
  7067. ? Error("The render was aborted by the server with a promise.")
  7068. : reason;
  7069. request.fatalError = error;
  7070. abortableTasks.forEach(function (task) {
  7071. return abortTask(task, request, error);
  7072. });
  7073. abortableTasks.clear();
  7074. }
  7075. null !== request.destination &&
  7076. flushCompletedQueues(request, request.destination);
  7077. } catch (error$72) {
  7078. logRecoverableError(request, error$72, {}), fatalError(request, error$72);
  7079. }
  7080. }
  7081. function addToReplayParent(node, parentKeyPath, trackedPostpones) {
  7082. if (null === parentKeyPath) trackedPostpones.rootNodes.push(node);
  7083. else {
  7084. var workingMap = trackedPostpones.workingMap,
  7085. parentNode = workingMap.get(parentKeyPath);
  7086. void 0 === parentNode &&
  7087. ((parentNode = [parentKeyPath[1], parentKeyPath[2], [], null]),
  7088. workingMap.set(parentKeyPath, parentNode),
  7089. addToReplayParent(parentNode, parentKeyPath[0], trackedPostpones));
  7090. parentNode[2].push(node);
  7091. }
  7092. }
  7093. function getPostponedState(request) {
  7094. var trackedPostpones = request.trackedPostpones;
  7095. if (
  7096. null === trackedPostpones ||
  7097. (0 === trackedPostpones.rootNodes.length &&
  7098. null === trackedPostpones.rootSlots)
  7099. )
  7100. return (request.trackedPostpones = null);
  7101. if (
  7102. null === request.completedRootSegment ||
  7103. (5 !== request.completedRootSegment.status &&
  7104. null !== request.completedPreambleSegments)
  7105. ) {
  7106. var nextSegmentId = request.nextSegmentId;
  7107. var replaySlots = trackedPostpones.rootSlots;
  7108. var resumableState = request.resumableState;
  7109. resumableState.bootstrapScriptContent = void 0;
  7110. resumableState.bootstrapScripts = void 0;
  7111. resumableState.bootstrapModules = void 0;
  7112. } else {
  7113. nextSegmentId = 0;
  7114. replaySlots = -1;
  7115. resumableState = request.resumableState;
  7116. var renderState = request.renderState;
  7117. resumableState.nextFormID = 0;
  7118. resumableState.hasBody = !1;
  7119. resumableState.hasHtml = !1;
  7120. resumableState.unknownResources = { font: renderState.resets.font };
  7121. resumableState.dnsResources = renderState.resets.dns;
  7122. resumableState.connectResources = renderState.resets.connect;
  7123. resumableState.imageResources = renderState.resets.image;
  7124. resumableState.styleResources = renderState.resets.style;
  7125. resumableState.scriptResources = {};
  7126. resumableState.moduleUnknownResources = {};
  7127. resumableState.moduleScriptResources = {};
  7128. resumableState.instructions = 0;
  7129. }
  7130. return {
  7131. nextSegmentId: nextSegmentId,
  7132. rootFormatContext: request.rootFormatContext,
  7133. progressiveChunkSize: request.progressiveChunkSize,
  7134. resumableState: request.resumableState,
  7135. replayNodes: trackedPostpones.rootNodes,
  7136. replaySlots: replaySlots
  7137. };
  7138. }
  7139. function ensureCorrectIsomorphicReactVersion() {
  7140. var isomorphicReactPackageVersion = React.version;
  7141. if ("19.2.4" !== isomorphicReactPackageVersion)
  7142. throw Error(
  7143. 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
  7144. (isomorphicReactPackageVersion +
  7145. "\n - react-dom: 19.2.4\nLearn more: https://react.dev/warnings/version-mismatch")
  7146. );
  7147. }
  7148. ensureCorrectIsomorphicReactVersion();
  7149. function createDrainHandler(destination, request) {
  7150. return function () {
  7151. return startFlowing(request, destination);
  7152. };
  7153. }
  7154. function createCancelHandler(request, reason) {
  7155. return function () {
  7156. request.destination = null;
  7157. abort(request, Error(reason));
  7158. };
  7159. }
  7160. function createRequestImpl(children, options) {
  7161. var resumableState = createResumableState(
  7162. options ? options.identifierPrefix : void 0,
  7163. options ? options.unstable_externalRuntimeSrc : void 0,
  7164. options ? options.bootstrapScriptContent : void 0,
  7165. options ? options.bootstrapScripts : void 0,
  7166. options ? options.bootstrapModules : void 0
  7167. );
  7168. return createRequest(
  7169. children,
  7170. resumableState,
  7171. createRenderState(
  7172. resumableState,
  7173. options ? options.nonce : void 0,
  7174. options ? options.unstable_externalRuntimeSrc : void 0,
  7175. options ? options.importMap : void 0,
  7176. options ? options.onHeaders : void 0,
  7177. options ? options.maxHeadersLength : void 0
  7178. ),
  7179. createRootFormatContext(options ? options.namespaceURI : void 0),
  7180. options ? options.progressiveChunkSize : void 0,
  7181. options ? options.onError : void 0,
  7182. options ? options.onAllReady : void 0,
  7183. options ? options.onShellReady : void 0,
  7184. options ? options.onShellError : void 0,
  7185. void 0,
  7186. options ? options.onPostpone : void 0,
  7187. options ? options.formState : void 0
  7188. );
  7189. }
  7190. function createFakeWritableFromReadableStreamController$1(controller) {
  7191. return {
  7192. write: function (chunk) {
  7193. "string" === typeof chunk && (chunk = textEncoder.encode(chunk));
  7194. controller.enqueue(chunk);
  7195. return !0;
  7196. },
  7197. end: function () {
  7198. controller.close();
  7199. },
  7200. destroy: function (error) {
  7201. "function" === typeof controller.error
  7202. ? controller.error(error)
  7203. : controller.close();
  7204. }
  7205. };
  7206. }
  7207. function resumeRequestImpl(children, postponedState, options) {
  7208. return resumeRequest(
  7209. children,
  7210. postponedState,
  7211. createRenderState(
  7212. postponedState.resumableState,
  7213. options ? options.nonce : void 0,
  7214. void 0,
  7215. void 0,
  7216. void 0,
  7217. void 0
  7218. ),
  7219. options ? options.onError : void 0,
  7220. options ? options.onAllReady : void 0,
  7221. options ? options.onShellReady : void 0,
  7222. options ? options.onShellError : void 0,
  7223. void 0,
  7224. options ? options.onPostpone : void 0
  7225. );
  7226. }
  7227. ensureCorrectIsomorphicReactVersion();
  7228. function createFakeWritableFromReadableStreamController(controller) {
  7229. return {
  7230. write: function (chunk) {
  7231. "string" === typeof chunk && (chunk = textEncoder.encode(chunk));
  7232. controller.enqueue(chunk);
  7233. return !0;
  7234. },
  7235. end: function () {
  7236. controller.close();
  7237. },
  7238. destroy: function (error) {
  7239. "function" === typeof controller.error
  7240. ? controller.error(error)
  7241. : controller.close();
  7242. }
  7243. };
  7244. }
  7245. function createFakeWritableFromReadable(readable) {
  7246. return {
  7247. write: function (chunk) {
  7248. return readable.push(chunk);
  7249. },
  7250. end: function () {
  7251. readable.push(null);
  7252. },
  7253. destroy: function (error) {
  7254. readable.destroy(error);
  7255. }
  7256. };
  7257. }
  7258. exports.prerender = function (children, options) {
  7259. return new Promise(function (resolve, reject) {
  7260. var onHeaders = options ? options.onHeaders : void 0,
  7261. onHeadersImpl;
  7262. onHeaders &&
  7263. (onHeadersImpl = function (headersDescriptor) {
  7264. onHeaders(new Headers(headersDescriptor));
  7265. });
  7266. var resources = createResumableState(
  7267. options ? options.identifierPrefix : void 0,
  7268. options ? options.unstable_externalRuntimeSrc : void 0,
  7269. options ? options.bootstrapScriptContent : void 0,
  7270. options ? options.bootstrapScripts : void 0,
  7271. options ? options.bootstrapModules : void 0
  7272. ),
  7273. request = createPrerenderRequest(
  7274. children,
  7275. resources,
  7276. createRenderState(
  7277. resources,
  7278. void 0,
  7279. options ? options.unstable_externalRuntimeSrc : void 0,
  7280. options ? options.importMap : void 0,
  7281. onHeadersImpl,
  7282. options ? options.maxHeadersLength : void 0
  7283. ),
  7284. createRootFormatContext(options ? options.namespaceURI : void 0),
  7285. options ? options.progressiveChunkSize : void 0,
  7286. options ? options.onError : void 0,
  7287. function () {
  7288. var writable,
  7289. stream = new ReadableStream(
  7290. {
  7291. type: "bytes",
  7292. start: function (controller) {
  7293. writable =
  7294. createFakeWritableFromReadableStreamController(controller);
  7295. },
  7296. pull: function () {
  7297. startFlowing(request, writable);
  7298. },
  7299. cancel: function (reason) {
  7300. request.destination = null;
  7301. abort(request, reason);
  7302. }
  7303. },
  7304. { highWaterMark: 0 }
  7305. );
  7306. stream = { postponed: getPostponedState(request), prelude: stream };
  7307. resolve(stream);
  7308. },
  7309. void 0,
  7310. void 0,
  7311. reject,
  7312. options ? options.onPostpone : void 0
  7313. );
  7314. if (options && options.signal) {
  7315. var signal = options.signal;
  7316. if (signal.aborted) abort(request, signal.reason);
  7317. else {
  7318. var listener = function () {
  7319. abort(request, signal.reason);
  7320. signal.removeEventListener("abort", listener);
  7321. };
  7322. signal.addEventListener("abort", listener);
  7323. }
  7324. }
  7325. startWork(request);
  7326. });
  7327. };
  7328. exports.prerenderToNodeStream = function (children, options) {
  7329. return new Promise(function (resolve, reject) {
  7330. var resumableState = createResumableState(
  7331. options ? options.identifierPrefix : void 0,
  7332. options ? options.unstable_externalRuntimeSrc : void 0,
  7333. options ? options.bootstrapScriptContent : void 0,
  7334. options ? options.bootstrapScripts : void 0,
  7335. options ? options.bootstrapModules : void 0
  7336. ),
  7337. request = createPrerenderRequest(
  7338. children,
  7339. resumableState,
  7340. createRenderState(
  7341. resumableState,
  7342. void 0,
  7343. options ? options.unstable_externalRuntimeSrc : void 0,
  7344. options ? options.importMap : void 0,
  7345. options ? options.onHeaders : void 0,
  7346. options ? options.maxHeadersLength : void 0
  7347. ),
  7348. createRootFormatContext(options ? options.namespaceURI : void 0),
  7349. options ? options.progressiveChunkSize : void 0,
  7350. options ? options.onError : void 0,
  7351. function () {
  7352. var readable = new stream.Readable({
  7353. read: function () {
  7354. startFlowing(request, writable);
  7355. }
  7356. }),
  7357. writable = createFakeWritableFromReadable(readable);
  7358. readable = {
  7359. postponed: getPostponedState(request),
  7360. prelude: readable
  7361. };
  7362. resolve(readable);
  7363. },
  7364. void 0,
  7365. void 0,
  7366. reject,
  7367. options ? options.onPostpone : void 0
  7368. );
  7369. if (options && options.signal) {
  7370. var signal = options.signal;
  7371. if (signal.aborted) abort(request, signal.reason);
  7372. else {
  7373. var listener = function () {
  7374. abort(request, signal.reason);
  7375. signal.removeEventListener("abort", listener);
  7376. };
  7377. signal.addEventListener("abort", listener);
  7378. }
  7379. }
  7380. startWork(request);
  7381. });
  7382. };
  7383. exports.renderToPipeableStream = function (children, options) {
  7384. var request = createRequestImpl(children, options),
  7385. hasStartedFlowing = !1;
  7386. startWork(request);
  7387. return {
  7388. pipe: function (destination) {
  7389. if (hasStartedFlowing)
  7390. throw Error(
  7391. "React currently only supports piping to one writable stream."
  7392. );
  7393. hasStartedFlowing = !0;
  7394. safelyEmitEarlyPreloads(
  7395. request,
  7396. null === request.trackedPostpones
  7397. ? 0 === request.pendingRootTasks
  7398. : null === request.completedRootSegment
  7399. ? 0 === request.pendingRootTasks
  7400. : 5 !== request.completedRootSegment.status
  7401. );
  7402. startFlowing(request, destination);
  7403. destination.on("drain", createDrainHandler(destination, request));
  7404. destination.on(
  7405. "error",
  7406. createCancelHandler(
  7407. request,
  7408. "The destination stream errored while writing data."
  7409. )
  7410. );
  7411. destination.on(
  7412. "close",
  7413. createCancelHandler(request, "The destination stream closed early.")
  7414. );
  7415. return destination;
  7416. },
  7417. abort: function (reason) {
  7418. abort(request, reason);
  7419. }
  7420. };
  7421. };
  7422. exports.renderToReadableStream = function (children, options) {
  7423. return new Promise(function (resolve, reject) {
  7424. var onFatalError,
  7425. onAllReady,
  7426. allReady = new Promise(function (res, rej) {
  7427. onAllReady = res;
  7428. onFatalError = rej;
  7429. }),
  7430. onHeaders = options ? options.onHeaders : void 0,
  7431. onHeadersImpl;
  7432. onHeaders &&
  7433. (onHeadersImpl = function (headersDescriptor) {
  7434. onHeaders(new Headers(headersDescriptor));
  7435. });
  7436. var resumableState = createResumableState(
  7437. options ? options.identifierPrefix : void 0,
  7438. options ? options.unstable_externalRuntimeSrc : void 0,
  7439. options ? options.bootstrapScriptContent : void 0,
  7440. options ? options.bootstrapScripts : void 0,
  7441. options ? options.bootstrapModules : void 0
  7442. ),
  7443. request = createRequest(
  7444. children,
  7445. resumableState,
  7446. createRenderState(
  7447. resumableState,
  7448. options ? options.nonce : void 0,
  7449. options ? options.unstable_externalRuntimeSrc : void 0,
  7450. options ? options.importMap : void 0,
  7451. onHeadersImpl,
  7452. options ? options.maxHeadersLength : void 0
  7453. ),
  7454. createRootFormatContext(options ? options.namespaceURI : void 0),
  7455. options ? options.progressiveChunkSize : void 0,
  7456. options ? options.onError : void 0,
  7457. onAllReady,
  7458. function () {
  7459. var writable,
  7460. stream = new ReadableStream(
  7461. {
  7462. type: "bytes",
  7463. start: function (controller) {
  7464. writable =
  7465. createFakeWritableFromReadableStreamController$1(
  7466. controller
  7467. );
  7468. },
  7469. pull: function () {
  7470. startFlowing(request, writable);
  7471. },
  7472. cancel: function (reason) {
  7473. request.destination = null;
  7474. abort(request, reason);
  7475. }
  7476. },
  7477. { highWaterMark: 0 }
  7478. );
  7479. stream.allReady = allReady;
  7480. resolve(stream);
  7481. },
  7482. function (error) {
  7483. allReady.catch(function () {});
  7484. reject(error);
  7485. },
  7486. onFatalError,
  7487. options ? options.onPostpone : void 0,
  7488. options ? options.formState : void 0
  7489. );
  7490. if (options && options.signal) {
  7491. var signal = options.signal;
  7492. if (signal.aborted) abort(request, signal.reason);
  7493. else {
  7494. var listener = function () {
  7495. abort(request, signal.reason);
  7496. signal.removeEventListener("abort", listener);
  7497. };
  7498. signal.addEventListener("abort", listener);
  7499. }
  7500. }
  7501. startWork(request);
  7502. });
  7503. };
  7504. exports.resume = function (children, postponedState, options) {
  7505. return new Promise(function (resolve, reject) {
  7506. var onFatalError,
  7507. onAllReady,
  7508. allReady = new Promise(function (res, rej) {
  7509. onAllReady = res;
  7510. onFatalError = rej;
  7511. }),
  7512. request = resumeRequest(
  7513. children,
  7514. postponedState,
  7515. createRenderState(
  7516. postponedState.resumableState,
  7517. options ? options.nonce : void 0,
  7518. void 0,
  7519. void 0,
  7520. void 0,
  7521. void 0
  7522. ),
  7523. options ? options.onError : void 0,
  7524. onAllReady,
  7525. function () {
  7526. var writable,
  7527. stream = new ReadableStream(
  7528. {
  7529. type: "bytes",
  7530. start: function (controller) {
  7531. writable =
  7532. createFakeWritableFromReadableStreamController$1(
  7533. controller
  7534. );
  7535. },
  7536. pull: function () {
  7537. startFlowing(request, writable);
  7538. },
  7539. cancel: function (reason) {
  7540. request.destination = null;
  7541. abort(request, reason);
  7542. }
  7543. },
  7544. { highWaterMark: 0 }
  7545. );
  7546. stream.allReady = allReady;
  7547. resolve(stream);
  7548. },
  7549. function (error) {
  7550. allReady.catch(function () {});
  7551. reject(error);
  7552. },
  7553. onFatalError,
  7554. options ? options.onPostpone : void 0
  7555. );
  7556. if (options && options.signal) {
  7557. var signal = options.signal;
  7558. if (signal.aborted) abort(request, signal.reason);
  7559. else {
  7560. var listener = function () {
  7561. abort(request, signal.reason);
  7562. signal.removeEventListener("abort", listener);
  7563. };
  7564. signal.addEventListener("abort", listener);
  7565. }
  7566. }
  7567. startWork(request);
  7568. });
  7569. };
  7570. exports.resumeAndPrerender = function (children, postponedState, options) {
  7571. return new Promise(function (resolve, reject) {
  7572. var request = resumeAndPrerenderRequest(
  7573. children,
  7574. postponedState,
  7575. createRenderState(
  7576. postponedState.resumableState,
  7577. void 0,
  7578. void 0,
  7579. void 0,
  7580. void 0,
  7581. void 0
  7582. ),
  7583. options ? options.onError : void 0,
  7584. function () {
  7585. var writable,
  7586. stream = new ReadableStream(
  7587. {
  7588. type: "bytes",
  7589. start: function (controller) {
  7590. writable =
  7591. createFakeWritableFromReadableStreamController(controller);
  7592. },
  7593. pull: function () {
  7594. startFlowing(request, writable);
  7595. },
  7596. cancel: function (reason) {
  7597. request.destination = null;
  7598. abort(request, reason);
  7599. }
  7600. },
  7601. { highWaterMark: 0 }
  7602. );
  7603. stream = { postponed: getPostponedState(request), prelude: stream };
  7604. resolve(stream);
  7605. },
  7606. void 0,
  7607. void 0,
  7608. reject,
  7609. options ? options.onPostpone : void 0
  7610. );
  7611. if (options && options.signal) {
  7612. var signal = options.signal;
  7613. if (signal.aborted) abort(request, signal.reason);
  7614. else {
  7615. var listener = function () {
  7616. abort(request, signal.reason);
  7617. signal.removeEventListener("abort", listener);
  7618. };
  7619. signal.addEventListener("abort", listener);
  7620. }
  7621. }
  7622. startWork(request);
  7623. });
  7624. };
  7625. exports.resumeAndPrerenderToNodeStream = function (
  7626. children,
  7627. postponedState,
  7628. options
  7629. ) {
  7630. return new Promise(function (resolve, reject) {
  7631. var request = resumeAndPrerenderRequest(
  7632. children,
  7633. postponedState,
  7634. createRenderState(
  7635. postponedState.resumableState,
  7636. void 0,
  7637. void 0,
  7638. void 0,
  7639. void 0,
  7640. void 0
  7641. ),
  7642. options ? options.onError : void 0,
  7643. function () {
  7644. var readable = new stream.Readable({
  7645. read: function () {
  7646. startFlowing(request, writable);
  7647. }
  7648. }),
  7649. writable = createFakeWritableFromReadable(readable);
  7650. readable = { postponed: getPostponedState(request), prelude: readable };
  7651. resolve(readable);
  7652. },
  7653. void 0,
  7654. void 0,
  7655. reject,
  7656. options ? options.onPostpone : void 0
  7657. );
  7658. if (options && options.signal) {
  7659. var signal = options.signal;
  7660. if (signal.aborted) abort(request, signal.reason);
  7661. else {
  7662. var listener = function () {
  7663. abort(request, signal.reason);
  7664. signal.removeEventListener("abort", listener);
  7665. };
  7666. signal.addEventListener("abort", listener);
  7667. }
  7668. }
  7669. startWork(request);
  7670. });
  7671. };
  7672. exports.resumeToPipeableStream = function (children, postponedState, options) {
  7673. var request = resumeRequestImpl(children, postponedState, options),
  7674. hasStartedFlowing = !1;
  7675. startWork(request);
  7676. return {
  7677. pipe: function (destination) {
  7678. if (hasStartedFlowing)
  7679. throw Error(
  7680. "React currently only supports piping to one writable stream."
  7681. );
  7682. hasStartedFlowing = !0;
  7683. startFlowing(request, destination);
  7684. destination.on("drain", createDrainHandler(destination, request));
  7685. destination.on(
  7686. "error",
  7687. createCancelHandler(
  7688. request,
  7689. "The destination stream errored while writing data."
  7690. )
  7691. );
  7692. destination.on(
  7693. "close",
  7694. createCancelHandler(request, "The destination stream closed early.")
  7695. );
  7696. return destination;
  7697. },
  7698. abort: function (reason) {
  7699. abort(request, reason);
  7700. }
  7701. };
  7702. };
  7703. exports.version = "19.2.4";